Skip to main content

BeaconTimelockTrigger

The BeaconTimelockTrigger smart contract is an upgrade of the L1TimelockTimelock smart contract. Reducing protocol risk by eliminating off-chain computation of PrizeDistribution parameters. The timelock will only pass the total supply of all tickets in a "PrizePool Network" to the prize distribution factory contract.

Functions

constructor

  function constructor(
address _owner,
contract IPrizeDistributionFactory _prizeDistributionFactory,
contract IDrawCalculatorTimelock _timelock
) public

Initialize BeaconTimelockTrigger smart contract.

Parameters:

NameTypeDescription
_owneraddressThe smart contract owner
_prizeDistributionFactorycontract IPrizeDistributionFactoryPrizeDistributionFactory address
_timelockcontract IDrawCalculatorTimelockDrawCalculatorTimelock address

push

  function push(
struct IDrawBeacon.Draw draw,
uint256 totalNetworkTicketSupply
) external

Locks next Draw and pushes totalNetworkTicketSupply to PrizeDistributionFactory

Restricts new draws for N seconds by forcing timelock on the next target draw id.

Parameters:

NameTypeDescription
drawstruct IDrawBeacon.DrawDraw
totalNetworkTicketSupplyuint256totalNetworkTicketSupply

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

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.

Deployed

  event Deployed(
)

Emitted when the contract is deployed.

DrawLockedAndTotalNetworkTicketSupplyPushed

  event DrawLockedAndTotalNetworkTicketSupplyPushed(
uint32 drawId,
struct IDrawBeacon.Draw draw,
uint256 totalNetworkTicketSupply
)

Emitted when Draw is locked and totalNetworkTicketSupply is pushed to PrizeDistributionFactory

Parameters:

NameTypeDescription
drawIduint32Draw ID
drawstruct IDrawBeacon.DrawDraw
totalNetworkTicketSupplyuint256totalNetworkTicketSupply