DrawBeacon

Manages pushing draws onto DrawBuffer. The DrawBeacon has 1 major action: creating of a new draw. A user can create a new draw using the startDraw() method which will push the draw onto the DrawBuffer.

Write methods description

initialize()

Allows to initialize the contract during the deployment.

Parameters:

setBeaconPeriodSeconds()

Allows the owner to set the beacon period in seconds.

Parameters:

setDrawBuffer()

Set global DrawBuffer variable. All subsequent draw requests/completions will be pushed to the new DrawBuffer.

Parameters:

startDraw()

Starts the draw creation process. The previous beacon period must have ended.

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.

transferOwnership()

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

Parameters:

Read methods description

beaconPeriodEndAt()

Returns the timestamp at which the beacon period ends.

beaconPeriodRemainingSeconds()

Returns the number of seconds remaining until the beacon period can be complete.

calculateNextBeaconPeriodStartTime()

Calculates when the next beacon period will start.

Parameters:

calculateNextBeaconPeriodStartTimeFromCurrentTime()

Calculates the next beacon start time, assuming all beacon periods have occurred between the last and now.

canStartDraw()

Returns whether the draw can start. true if the beacon period is over, false otherwise.

getBeaconPeriodSeconds()

Returns beacon period seconds.

getBeaconPeriodStartedAt()

Returns the time when the beacon period started at.

getDrawBuffer()

Returns the address of the DrawBuffer.

getNextDrawId()

Returns the next draw to be processed.

isBeaconPeriodOver()

Returns whether the beacon period is over. true if the beacon period is over, false otherwise.

owner()

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

pendingOwner()

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

Last updated