PrizePool
A Prize Pool. Provides read only functions for the contracts that make up the deployment of this Prize Pool.
Hierarchy
PrizePool
↳
User
Table of contents
Constructors
Properties
- address
- chainId
- contractMetadataList
- prizePoolContract
- prizePoolMetadata
- signerOrProvider
- ticketContract
- ticketMetadata
- tokenContract
- tokenMetadata
Methods
- getTicketContract
- getTicketData
- getTicketTotalSupply
- getTokenContract
- getTokenData
- getUsersDepositAllowance
- getUsersPrizePoolBalances
- getUsersTicketBalance
- getUsersTicketDelegate
- getUsersTicketTwabAt
- getUsersTokenBalance
- id
Constructors
constructor
• new PrizePool(prizePoolMetadata
, signerOrProvider
, contractMetadataList
)
Create an instance of a PrizePool by providing the metadata for the YieldSourcePrizePool contract, an ethers Provider or Signer for the network the Prize Pool is deployed on and a list of contract metadata for the other contracts that make up the Prize Pool.
Parameters
Name | Type | Description |
---|---|---|
prizePoolMetadata | Contract | the metadata for the YieldSourcePrizePool contract in the Prize Pool |
signerOrProvider | Signer | Provider | a Provider or Signer for the network the Prize Pool deployment is on |
contractMetadataList | Contract [] | an array of metadata for the Prize Pool |
Defined in
Properties
address
• Readonly
address: string
Defined in
chainId
• Readonly
chainId: number
Defined in
contractMetadataList
• Readonly
contractMetadataList: Contract
[]
Defined in
prizePoolContract
• Readonly
prizePoolContract: Contract
Defined in
prizePoolMetadata
• Readonly
prizePoolMetadata: Contract
Defined in
signerOrProvider
• Readonly
signerOrProvider: Signer
| Provider
Defined in
ticketContract
• ticketContract: Contract
Defined in
ticketMetadata
• ticketMetadata: Contract
Defined in
tokenContract
• tokenContract: Contract
Defined in
tokenMetadata
• tokenMetadata: Contract
Defined in
Methods
getTicketContract
▸ getTicketContract(): Promise
<Contract
>
Fetches the addresses to build an instance of an ethers Contract for the Ticket
Returns
Promise
<Contract
>
an ethers contract for the ticket
Defined in
getTicketData
▸ getTicketData(): Promise
<TokenData
>
Fetches decimals, name and symbol for the Ticket.
Returns
Promise
<TokenData
>
decimals, name and symbol for the ticket
Defined in
getTicketTotalSupply
▸ getTicketTotalSupply(): Promise
<BigNumber
>
Fetches total supply for the Ticket.
Returns
Promise
<BigNumber
>
the total supply of the ticket
Defined in
getTokenContract
▸ getTokenContract(): Promise
<Contract
>
Fetches the addresses to build an instance of an ethers Contract for the underlying Token
Returns
Promise
<Contract
>
an ethers contract for the underlying token
Defined in
getTokenData
▸ getTokenData(): Promise
<TokenData
>
Fetches decimals, name and symbol for the underling Token.
Returns
Promise
<TokenData
>
decimals, name and symbol for the underling token
Defined in
getUsersDepositAllowance
▸ getUsersDepositAllowance(usersAddress
): Promise
<{ allowanceUnformatted
: BigNumber
; isApproved
: boolean
= !allowanceUnformatted.isZero() }>
Fetches a users deposit allowance for the Prize Pool.
Parameters
Name | Type | Description |
---|---|---|
usersAddress | string | the address to fetch the deposit allowance for |
Returns
Promise
<{ allowanceUnformatted
: BigNumber
; isApproved
: boolean
= !allowanceUnformatted.isZero() }>
the amount the user has approved for deposits
Defined in
getUsersPrizePoolBalances
▸ getUsersPrizePoolBalances(usersAddress
): Promise
<PrizePoolTokenBalances
>
Fetches a users balances for the Prize Pool underlying Token and Ticket.
Parameters
Name | Type | Description |
---|---|---|
usersAddress | string | the users address to fetch balances for |
Returns
Promise
<PrizePoolTokenBalances
>
the users balances for the underlying deposit token and the ticket token
Defined in
getUsersTicketBalance
▸ getUsersTicketBalance(usersAddress
): Promise
<BigNumber
>
Fetches a users balance for the Prize Pools Ticket.
Parameters
Name | Type | Description |
---|---|---|
usersAddress | string | the address to fetch the balance for |
Returns
Promise
<BigNumber
>
the users ticket balance
Defined in
getUsersTicketDelegate
▸ getUsersTicketDelegate(usersAddress
): Promise
<string
>
Fetches the address a user has delegated to.
Parameters
Name | Type | Description |
---|---|---|
usersAddress | string | the address to fetch the delegate for |
Returns
Promise
<string
>
the address a user has delegated to
Defined in
getUsersTicketTwabAt
▸ getUsersTicketTwabAt(usersAddress
, unixTimestamp
): Promise
<BigNumber
>
Fetches a users Ticket TWAB at a specific unix timestamp.
Parameters
Name | Type | Description |
---|---|---|
usersAddress | string | the address to fetch the ticket TWAB for |
unixTimestamp | number | the unix timestamp to fetch in seconds |
Returns
Promise
<BigNumber
>
the users TWAB at the requested time
Defined in
getUsersTokenBalance
▸ getUsersTokenBalance(usersAddress
): Promise
<BigNumber
>
Fetches a users balance for the Prize Pools underlying Token.
Parameters
Name | Type | Description |
---|---|---|
usersAddress | string | the address to fetch the balance for |
Returns
Promise
<BigNumber
>
the users token balance
Defined in
id
▸ id(): string
Returns a unique id string for this Prize Pool.
Returns
string
a unique id for the Prize Pool