DrawCalculator

The DrawCalculator calculates the amount of user picks based on the user average weighted balance (during each draw period).

Write methods description

initialize()

Allows to initialize the contract during the deployment.

Parameters:

NameTypeDescription

_ticket

address

Address of the ticket.

_drawBuffer

address

Address of the DrawBuffer.

_prizeDistributionBuffer

address

Address of the PrizeDistributionBuffer.

Read methods description

calculateNumberOfUserPicks()

Calculates the picks amount for a user for multiple draws. Typically called by a PrizeDistributor.

Parameters:

NameTypeDescription

_user

address

User for which to calculate picks amount.

_drawIds

uint32[]

drawId array for which to calculate picks amount for.

Return:

NameTypeDescription

_picks

uint256[]

List of number of user picks ordered by drawId.

drawBuffer()

Address of the DrawBuffer connected to the DrawCalculator.

getDrawBuffer()

Address of the DrawBuffer connected to the DrawCalculator.

getNormalizedBalancesForDrawIds()

Returns a user's balances expressed as a fraction of the total supply over time.

Parameters:

NameTypeDescription

_user

address

The user's address.

_drawIds

uint32[]

The _drawIds to consider.

Return:

NameTypeDescription

_balances

uint256[]

Array of balances.

getPrizeDistributionBuffer()

Read global prizeDistributionBuffer variable.

prizeDistributionBuffer()

Read global prizeDistributionBuffer variable.

ticket()

Address of the Ticket associated with DrawCalculator.

Last updated