Now let's deposit into the Prize Pool. Since we're depositing into a Compound Prize Pool that uses a Single Random Winner strategy, we'll want to mint Tickets so that we're eligible for prizes.
We can retrieve the Ticket controlled token address from the Single Random Winner prize strategy:
Solidity
JavaScript
Now let's deposit to mint tickets for ourselves:
Solidity
JavaScript
Depositing Sponsorship
If you wish to deposit and receive sponsorship, or any other controlled token, you simply need to pass it in as the controlledToken argument.
Depositing for Someone Else
If you'd like to deposit on someone else's behalf, you can simply change the to address in the call to whomever you want to receive the tickets. Note that the caller will not be able to withdraw the funds; those funds can only be withdrawn by the recipient unless they increase your allowance.
Capturing Referral Rewards
The last parameter to the depositTo function is the referral address. The protocol may drip referral awards globally to Prize Pools. Referrals can earn tokens based on the fraction of referral volume they supply.
Any interface for a PrizePool will want to pass it's own address as the referrer so that it can capture sweet, sweet rewards.