Raffl
s.
Raffl
s addresses
requestId
to the Raffl
s address
Raffl
factory contract.
Requirements:
implementationAddress
has to be a contract.feeCollectorAddress
can’t be address 0x0.poolFeePercentage
must be within 0 and maxFee range.vrfCoordinator
can’t be address 0x0.*Name | Type | Description |
---|---|---|
implementationAddress | address | Address of Raffl contract implementation. |
feeCollectorAddress | address | Address of feeCollector . |
creationFeeValue | uint64 | Value for creationFee that will be charged on new Raffl s deployed. |
poolFeePercentage | uint64 | Value for poolFeePercentage that will be charged from the Raffl s pool on success draw. |
vrfCoordinator | address | VRF Coordinator address |
_keyHash | bytes32 | The gas lane to use, which specifies the maximum gas price to bump to |
_subscriptionId | uint256 | The subscription ID that this contract uses for funding VRF requests |
Raffl
contracts.
Requirements:
underlyingTokenAddress
cannot be the zero address.timestamps
must be given in ascending order.percentages
must be given in ascending order and the last one must always be 1 eth, where 1 eth equals to
100%.Name | Type | Description |
---|---|---|
entryToken | address | The address of the ERC-20 token as entry. If address zero, entry is the network token |
entryPrice | uint256 | The value of each entry for the raffle. |
minEntries | uint256 | The minimum number of entries to consider make the draw. |
deadline | uint256 | The block timestamp until the raffle will receive entries and that will perform the draw if criteria is met. |
prizes | IRaffl.Prize[] | The prizes that will be held by this contract. |
tokenGates | IRaffl.TokenGate[] | The token gating that will be imposed to users. |
extraRecipient | IRaffl.ExtraRecipient | The extra recipient that will share the rewards (optional). |
ActiveRaffle
s
Name | Type | Description |
---|---|---|
_subscriptionId | uint64 | The subscription ID that this contract uses for funding VRF requests |
_keyHash | bytes32 | The gas lane to use, which specifies the maximum gas price to bump to |
_callbackGasLimit | uint32 | Callback gas limit for the Chainlink VRF |
_requestConfirmations | uint16 | Number of requests confirmations for the Chainlink VRF |
performUpkeep
must be done.
Performs the computation to the array of _activeRaffles
. This opens the possibility of having several
checkUpkeeps done at the same time.
Name | Type | Description |
---|---|---|
checkData | bytes | Encoded binary data which contains the lower bound and upper bound of the _activeRaffles array on which to perform the computation |
Name | Type | Description |
---|---|---|
upkeepNeeded | bool | Whether the upkeep must be performed or not |
performData | bytes | Encoded binary data which contains the raffle address and index of the _activeRaffles |
Name | Type | Description |
---|---|---|
performData | bytes | Encoded binary data which contains the raffle address and index of the _activeRaffles |
Name | Type | Description |
---|---|---|
requestId | uint256 | Id of the VRF request |
randomWords | uint256[] | Provably fair and verifiable array of random words |
_activeRaffles
array
Move the last element to the deleted stop and removes the last element
Name | Type | Description |
---|---|---|
i | uint256 | Element index to remove |
msg.sender
has to be the owner of the factory.newFeeCollector
can’t be address 0x0.*Name | Type | Description |
---|---|---|
newFeeCollector | address | Address of feeCollector . |
Name | Type | Description |
---|---|---|
raffle | address | Address of the created raffle |
raffle
the address of the raffle
deadline
is the timestamp that marks the start time to perform the upkeep effect.