Skip to main content

Hubnate

Functions#

# # createPool#

function createPool(
address _token,
address _ticketToken,
uint256 _costPerTicket
) external onlyOwner() returns(uint256 poolId)

Creates a pool with the specified parameters.

Parameters:#

NameTypeDescription
_tokenaddressDonate token address
_ticketTokenaddressCT-token address
_costPerTicketuint24Cost per ticket

Return values:#

NameTypeDescription
poolIduint256Id of the created pool

donate#

function donate(
uint256 _seed,
uint256 _poolId,
uint256 _numberOfTickets
) external

Allows you to make donations

Parameters:#

NameTypeDescription
_seeduint256Seed
_poolIduint256Pool ID
_numberOfTicketsuint256Number of tickets

donateDistribution#

function donateDistribution(
bytes32 _requestId,
uint256 _randomness,
uint256 _poolId,
uint256 _donateId
) external onlyRandomGenerator()

Distributes the donate using a random number. Called by Random generator.

Parameters:#

NameTypeDescription
_requestIdbytes32ID randomness request
_randomnessuint256Random number
_poolIduint256Pool ID
_donateIduint256Donate ID

claimTickets#

function claimTickets(
uint256 _poolId,
uint256 _donateId
) external

Allows you to collect CT-tokens after making a donation.

Parameters:#

NameTypeDescription
_poolIduint256Pool ID
_donateIduint256Donate ID