Random Chainlink

ChainlinkContructorArgs

Because of the Stack too deep error, we combine some constructor arguments into a single stuct

struct ChainlinkContructorArgs {
  address vrfCoordinator;
  bytes32 keyHash;
  uint16 minimumRequestConfirmations;
  uint32 callbackGasLimit;
}

subscriptionID

uint64 subscriptionID

Chainlink VRF V2 subscription ID.

callbackGasLimit

uint32 callbackGasLimit

Chainlink VRF V2 gas limit to call fulfillRandomWords() with.

vrfCoordinator

contract VRFCoordinatorV2Interface vrfCoordinator

Chainlink VRF V2 coordinator.

ChangeCallbackGasLimit

event ChangeCallbackGasLimit(uint32 previousCallbackGasLimit, uint32 newCallbackGasLimit)

performUpkeep

function performUpkeep(bytes) external

Requests random from Chainlink. Emits {RequestRandom} event.

changeCallbackGasLimit

function changeCallbackGasLimit(uint32 _callbackGasLimit) external

Changes callbackGasLimit. Emits {ChangeCallbackGasLimit} event.

Parameters

checkUpkeep

function checkUpkeep(bytes) external view returns (bool upkeepNeeded, bytes)

Called by Chainlink Keeper to determine if performUpkeep() needs to be called.

Inherited from VRFConsumerBaseV2

rawFulfillRandomWords

function rawFulfillRandomWords(uint256 requestId, uint256[] randomWords) external

Inherited from EeseeRandomBase

requestRandomImmediate

function requestRandomImmediate() external

Request random immediately, skipping canRequestRandom() check. Emits {RequestRandom} event. Note: This function can only be called by REQUEST_RANDOM_ROLE.

changeRandomRequestInterval

function changeRandomRequestInterval(uint32 _randomRequestInterval) external

Changes randomRequestInterval. Emits {ChangeRandomRequestInterval} event.

Parameters

getRandomFromTimestamp

function getRandomFromTimestamp(uint256 _timestamp) external view returns (uint256 word, uint256 timestamp)

canRequestRandom

function canRequestRandom() public view virtual returns (bool randomNeeded)

Check if random needs to be requested.

ChangeRandomRequestInterval

event ChangeRandomRequestInterval(uint32 previousRandomRequestInterval, uint32 newRandomRequestInterval)

Inherited from EeseeRoleHandler

Inherited from IEeseeRandom

random

function random(uint256) external view returns (uint256 word, uint256 timestamp)

lastRandomRequestTimestamp

function lastRandomRequestTimestamp() external view returns (uint64)

randomRequestInterval

function randomRequestInterval() external view returns (uint32)

MAX_RANDOM_REQUEST_INTERVAL

function MAX_RANDOM_REQUEST_INTERVAL() external view returns (uint48)

FulfillRandom

event FulfillRandom(uint256 random)

RequestRandom

event RequestRandom()

Last updated