_distributePrizeSplitswhich should be called at the top of the inheriting smart contracts
PrizeSplitConfigstruct with 3 configurable variables: target, percentage and token. The
targetvariable designates the receiver of the prize split. The
percentagevariable stores single point decimal precision percentage using a number with a range between 0-to-1000. And finally the
tokenparameter references the index position of the
percentageuses a range of 0-to-1000 so single decimal precision can easily be calculated without requiring a fixed point math library.
1000than 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
505distribution amount would equate to
50.5%of the original award amount.
PoolWithMultipleWinnersBuilder.solinstance to deploy a new PrizePool, the first token stored in the
tokensarray is the
Ticketand the second is the
Sponsorshiptoken. Thus, when deciding which token is minted during the prize split distribution, the
tokenvariable must be set to either
1depending on the desired ticket to be awarded.
Ticketsthe prize splits must first be distributed, so the remaining prize award amount can be used to calculate the winners distribution amount.
_distributefunction 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
_distributePrizeSplitsfunction. Distributing the prize splits to target recipients and returning the updated
prizeamount for winner award distribution.