DrawCalculatorTimelock

The DrawCalculatorTimelock is responsible for pushing Draws to a DrawBuffer and routing claim requests from a PrizeDistributor to a DrawCalculator. The primary objective is to include a "cooldown" period for all new Draws. Allowing the correction of a maliciously set Draw in the unfortunate event an Owner is compromised.

Write methods description

initialize()

Allows to initialize the contract during the deployment.

Parameters:

setTimelock()

Set the Timelock struct. Only callable by the contract owner.

Parameters:

lock()

Lock passed draw ID for timelockDuration seconds. Restricts new draws by forcing a push timelock.

Parameters:

Return:

transferOwnership()

Transfers ownership of the contract to a _pendingOwner. Can only be called by the current owner.

Parameters:

claimOwnership()

Allows the pendingOwner address to claim the owner role. This function is only callable by the pendingOwner".

renounceOwnership()

Leaves the contract without owner. It will not be possible to call the owner's functions anymore. Can only be called by the current owner. The method does not take any parameters. Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

setManager()

Allows the owner to give the manager role to an address. The manager role has access to the functions with the modified onlyManager or onlyManagerOrOwner.

Parameters:

Read methods description

getTimelock()

Read internal Timelock struct. Includes values: timestamp, drawId.

hasElapsed()

Returns bool for timelockDuration elapsing.

Return:

owner()

Owner role that can be granted exclusive access to specific functions with the modifier onlyOwner.

manager()

Manager role that can be granted exclusive access to specific functions with the modifier onlyManager or onlyManagerOrOwner.

pendingOwner()

The address that can claim the owner role. It is used to transfer the owner.

Last updated