internal
function named _distributePrizeSplits
which should be called at the top of the inheriting smart contracts _distribute
function.setPrizeSplits
setPrizeSplit
_distributePrizeSplits
_getPrizeSplitAmount
_totalPrizeSplitPercentageAmount
PrizeSplitConfig
struct with 3 configurable variables: target, percentage and token. The target
variable designates the receiver of the prize split. The percentage
variable stores single point decimal precision percentage using a number with a range between 0-to-1000. And finally the token
parameter references the index position of the ControlledToken
in the PrizePool.tokens
array.percentage
uses a range of 0-to-1000 so single decimal precision can easily be calculated without requiring a fixed point math library.1000
than the distribution amount would result in 100% of the prize being awarded to the prize split. If the the prize split percentage is set to 505
distribution amount would equate to 50.5%
of the original award amount. PoolWithMultipleWinnersBuilder.sol
instance to deploy a new PrizePool, the first token stored in the tokens
array is the Ticket
and the second is the Sponsorship
token. Thus, when deciding which token is minted during the prize split distribution, the token
variable must be set to either 0
or 1
depending on the desired ticket to be awarded.Tickets
the prize splits must first be distributed, so the remaining prize award amount can be used to calculate the winners distribution amount._distribute
function is called within MultipleWinners.sol
(responsible for capturing the interest earned during that award period) the captured award balance is immediately passed into the internal_distributePrizeSplits
function. Distributing the prize splits to target recipients and returning the updated prize
amount for winner award distribution.