Pool Factory V2.2 (Update Apr-23)
Functions:
initialize()
createPool(uint8 _game, uint8 _gameMode, uint256 _currentPrize, uint256 _entryFee, uint256 _startOn, uint256 _finishOn, uint16[] _winnersFees, address _tokenAddr)
joinPool(uint256 _poolId)
leavePool(uint256 _poolId)
viewPools(address _addr)
viewPoolPlayers(uint256 _poolId)
viewActivePools()
getPoolPaidPosition(uint256 _poolId, uint8 _position)
finishPool(uint256 _poolId, address[] _winners)
cancelPool(uint256 _poolId)
updateFee(uint256 _newFee)
updateTreasury(address payable _newTreasury)
claimPrize(uint256 _poolId, address payable _winnerAddress, uint8 _position)
Events:
NewPool(uint256 poolId, uint256 _game, uint256 _gameMode, uint256 _currentPrize, uint256 _entryFee, uint256 _startOn, uint256 _finishOn, address _tokenAddr)
CancelPool(uint256 _poolId)
PoolLeftBy(uint256 _poolId, address _player)
PoolJoinedBy(uint256 _poolId, address _player)
PoolFinished(uint256 _poolId, address _winner)
PrizeClaimFinished(uint256 _poolId, address _winnerAddress)
Function initialize()
initialize()
Initializes pool count and bbFee
Function createPool(uint8 _game, uint8 _gameMode, uint256 _currentPrize, uint256 _entryFee, uint256 _startOn, uint256 _finishOn, uint16[] _winnersFees, address _tokenAddr) → uint256
createPool(uint8 _game, uint8 _gameMode, uint256 _currentPrize, uint256 _entryFee, uint256 _startOn, uint256 _finishOn, uint16[] _winnersFees, address _tokenAddr) → uint256
Creates a new Pool providing entryFee, CurrentPrize, start and finish times. The transaction value must be equal to initial pool prize. Prizes and fees are in uint256, start and finish times are Unix Epochs in miliseconds. Fees are uint expressed in percentages i.e. a value of 10 means 10% fee, the sum of the 3 fees must equal a 100
poolId
: pool Id_game
: game Id_gameMode
: game Mode Id_currentPrize
: initial pool prize_entryFee
: entry fee to join the pool_startOn
: unix start epoch in ms_finishOn
: unix finish epoch in ms_tokenAddr
: address of token used for pool
Event CancelPool(uint256 _poolId)
CancelPool(uint256 _poolId)
Event emitted on cancelled pool
Parameters:
_poolId
: pool Id of cancelled pool
Event PoolLeftBy(uint256 _poolId, address _player)
PoolLeftBy(uint256 _poolId, address _player)
Event emitted when a player leaves a pool
Parameters:
_player
: player who leaves the pool_poolId
: pool Id
Event PoolJoinedBy(uint256 _poolId, address _player)
PoolJoinedBy(uint256 _poolId, address _player)
Event emitted when a player joins a pool
Parameters:
_player
: player who joins the pool_poolId
: pool Id
Event PoolFinished(uint256 _poolId, address _winner)
PoolFinished(uint256 _poolId, address _winner)
Event emitted on a finished pool
Parameters:
_poolId
: pool Id_winner
: winner of the pool tournament
Event PrizeClaimFinished(uint256 _poolId, address _winnerAddress)
PrizeClaimFinished(uint256 _poolId, address _winnerAddress)
Event emitted on a claimPrize
Parameters:
_poolId
: pool Id_winnerAddress
: position winner address
Last updated