Skip to main content
Version: V4

L1TimelockTrigger

L1TimelockTrigger(s) acts as an intermediary between multiple V4 smart contracts. The L1TimelockTrigger 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 malicously set Draw in the unfortunate event an Owner is compromised.

Functions

constructor

  function constructor(
address _owner,
contract IPrizeDistributionBuffer _prizeDistributionBuffer,
contract IDrawCalculatorTimelock _timelock
) public

Initialize L1TimelockTrigger smart contract.

Parameters:

NameTypeDescription
_owneraddressAddress of the L1TimelockTrigger owner.
_prizeDistributionBuffercontract IPrizeDistributionBufferPrizeDistributionBuffer address
_timelockcontract IDrawCalculatorTimelockElapsed seconds before new Draw is available

push

  function push(
struct IDrawBeacon.Draw _draw,
struct IPrizeDistributionBuffer.PrizeDistribution _prizeDistribution
) external

Push Draw onto draws ring buffer history.

Restricts new draws by forcing a push timelock.

Parameters:

NameTypeDescription
_drawstruct IDrawBeacon.DrawDraw struct
_prizeDistributionstruct IPrizeDistributionBuffer.PrizeDistributionPrizeDistribution struct

manager

  function manager(
) public returns (address)

Gets current _manager.

Return Values:

TypeDescription
addressCurrent _manager address.

setManager

  function setManager(
address _newManager
) external returns (bool)

Set or change of manager.

Throws if called by any account other than the owner.

Parameters:

NameTypeDescription
_newManageraddressNew _manager address.

Return Values:

TypeDescription
boolBoolean to indicate if the operation was successful or not.

owner

  function owner(
) public returns (address)

Returns the address of the current owner.

pendingOwner

  function pendingOwner(
) external returns (address)

Gets current _pendingOwner.

Return Values:

TypeDescription
addressCurrent _pendingOwner address.

renounceOwnership

  function renounceOwnership(
) external

Renounce ownership of the contract.

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership

  function transferOwnership(
address _newOwner
) external

Allows current owner to set the _pendingOwner address.

Parameters:

NameTypeDescription
_newOwneraddressAddress to transfer ownership to.

claimOwnership

  function claimOwnership(
) external

Allows the _pendingOwner address to finalize the transfer.

This function is only callable by the _pendingOwner.

Events

Deployed

  event Deployed(
contract IPrizeDistributionBuffer prizeDistributionBuffer,
contract IDrawCalculatorTimelock timelock
)

Emitted when the contract is deployed.

Parameters:

NameTypeDescription
prizeDistributionBuffercontract IPrizeDistributionBufferThe address of the prize distribution buffer contract.
timelockcontract IDrawCalculatorTimelockThe address of the DrawCalculatorTimelock

PrizeDistributionPushed

  event PrizeDistributionPushed(
uint32 drawId,
struct IPrizeDistributionBuffer.PrizeDistribution prizeDistribution
)

Emitted when target prize distribution is pushed.

Parameters:

NameTypeDescription
drawIduint32Draw ID
prizeDistributionstruct IPrizeDistributionBuffer.PrizeDistributionPrizeDistribution

ManagerTransferred

  event ManagerTransferred(
address previousManager,
address newManager
)

Emitted when _manager has been changed.

Parameters:

NameTypeDescription
previousManageraddressprevious _manager address.
newManageraddressnew _manager address.

OwnershipOffered

  event OwnershipOffered(
address pendingOwner
)

Emitted when _pendingOwner has been changed.

Parameters:

NameTypeDescription
pendingOwneraddressnew _pendingOwner address.

OwnershipTransferred

  event OwnershipTransferred(
address previousOwner,
address newOwner
)

Emitted when _owner has been changed.

Parameters:

NameTypeDescription
previousOwneraddressprevious _owner address.
newOwneraddressnew _owner address.