Comment on page

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:
Name
Type
Description
_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:
Name
Type
Description
_user
address
User for which to calculate picks amount.
_drawIds
uint32[]
drawId array for which to calculate picks amount for.
Return:
Name
Type
Description
_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:
Name
Type
Description
_user
address
The user's address.
_drawIds
uint32[]
The _drawIds to consider.
Return:
Name
Type
Description
_balances
uint256[]
Array of balances.

getPrizeDistributionBuffer()

Read global prizeDistributionBuffer variable.

prizeDistributionBuffer()

Read global prizeDistributionBuffer variable.

ticket()

Address of the Ticket associated with DrawCalculator.