IPackVRFDirect
The thirdweb Pack
contract is a lootbox mechanism. An account can bundle up arbitrary ERC20, ERC721 and ERC1155 tokens into a set of packs. A pack can then be opened in return for a selection of the tokens in the pack. The selection of tokens distributed on opening a pack depends on the relative supply of all tokens in the packs.
Methods
canClaimRewards
Returns whether a pack opener is ready to call claimRewards
.
Parameters
_opener
address
undefined
Returns
_0
bool
undefined
claimRewards
Called by a pack opener to claim rewards from the opened pack.
Returns
rewardUnits
ITokenBundle.Token[]
undefined
createPack
Parameters
contents
ITokenBundle.Token[]
undefined
numOfRewardUnits
uint256[]
undefined
packUri
string
undefined
openStartTimestamp
uint128
undefined
amountDistributedPerOpen
uint128
undefined
recipient
address
undefined
Returns
packId
uint256
undefined
packTotalSupply
uint256
undefined
openPack
Lets a pack owner request to open a pack.
Parameters
packId
uint256
The identifier of the pack to open.
amountToOpen
uint256
The number of packs to open at once.
Returns
requestId
uint256
undefined
openPackAndClaimRewards
Called by a pack opener to open a pack in a single transaction, instead of calling openPack and claimRewards separately.
Parameters
_packId
uint256
undefined
_amountToOpen
uint256
undefined
_callBackGasLimit
uint32
undefined
Returns
_0
uint256
undefined
Events
PackCreated
Emitted when a set of packs is created.
Parameters
packId indexed
uint256
undefined
recipient
address
undefined
totalPacksCreated
uint256
undefined
PackOpenRequested
Emitted when the opening of a pack is requested.
Parameters
opener indexed
address
undefined
packId indexed
uint256
undefined
amountToOpen
uint256
undefined
requestId
uint256
undefined
PackOpened
Emitted when a pack is opened.
Parameters
packId indexed
uint256
undefined
opener indexed
address
undefined
numOfPacksOpened
uint256
undefined
rewardUnitsDistributed
ITokenBundle.Token[]
undefined
PackRandomnessFulfilled
Emitted when Chainlink VRF fulfills a random number request.
Parameters
packId indexed
uint256
undefined
requestId indexed
uint256
undefined
Last updated