Skip to main content

PrizePool

A Prize Pool. Provides read only functions for the contracts that make up the deployment of this Prize Pool.

Hierarchy

Table of contents

Constructors

Properties

Methods

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

NameTypeDescription
prizePoolMetadataContractthe metadata for the YieldSourcePrizePool contract in the Prize Pool
signerOrProviderSigner | Providera Provider or Signer for the network the Prize Pool deployment is on
contractMetadataListContract[]an array of metadata for the Prize Pool

Defined in

src/PrizePool.ts:49

Properties

address

Readonly address: string

Defined in

src/PrizePool.ts:30


chainId

Readonly chainId: number

Defined in

src/PrizePool.ts:29


contractMetadataList

Readonly contractMetadataList: Contract[]

Defined in

src/PrizePool.ts:27


prizePoolContract

Readonly prizePoolContract: Contract

Defined in

src/PrizePool.ts:38


prizePoolMetadata

Readonly prizePoolMetadata: Contract

Defined in

src/PrizePool.ts:33


signerOrProvider

Readonly signerOrProvider: Signer | Provider

Defined in

src/PrizePool.ts:28


ticketContract

ticketContract: Contract

Defined in

src/PrizePool.ts:39


ticketMetadata

ticketMetadata: Contract

Defined in

src/PrizePool.ts:34


tokenContract

tokenContract: Contract

Defined in

src/PrizePool.ts:40


tokenMetadata

tokenMetadata: Contract

Defined in

src/PrizePool.ts:35

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

src/PrizePool.ts:273


getTicketData

getTicketData(): Promise<TokenData>

Fetches decimals, name and symbol for the Ticket.

Returns

Promise<TokenData>

decimals, name and symbol for the ticket

Defined in

src/PrizePool.ts:201


getTicketTotalSupply

getTicketTotalSupply(): Promise<BigNumber>

Fetches total supply for the Ticket.

Returns

Promise<BigNumber>

the total supply of the ticket

Defined in

src/PrizePool.ts:213


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

src/PrizePool.ts:296


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

src/PrizePool.ts:189


getUsersDepositAllowance

getUsersDepositAllowance(usersAddress): Promise<{ allowanceUnformatted: BigNumber ; isApproved: boolean = !allowanceUnformatted.isZero() }>

Fetches a users deposit allowance for the Prize Pool.

Parameters

NameTypeDescription
usersAddressstringthe 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

src/PrizePool.ts:159


getUsersPrizePoolBalances

getUsersPrizePoolBalances(usersAddress): Promise<PrizePoolTokenBalances>

Fetches a users balances for the Prize Pool underlying Token and Ticket.

Parameters

NameTypeDescription
usersAddressstringthe users address to fetch balances for

Returns

Promise<PrizePoolTokenBalances>

the users balances for the underlying deposit token and the ticket token

Defined in

src/PrizePool.ts:93


getUsersTicketBalance

getUsersTicketBalance(usersAddress): Promise<BigNumber>

Fetches a users balance for the Prize Pools Ticket.

Parameters

NameTypeDescription
usersAddressstringthe address to fetch the balance for

Returns

Promise<BigNumber>

the users ticket balance

Defined in

src/PrizePool.ts:114


getUsersTicketDelegate

getUsersTicketDelegate(usersAddress): Promise<string>

Fetches the address a user has delegated to.

Parameters

NameTypeDescription
usersAddressstringthe address to fetch the delegate for

Returns

Promise<string>

the address a user has delegated to

Defined in

src/PrizePool.ts:176


getUsersTicketTwabAt

getUsersTicketTwabAt(usersAddress, unixTimestamp): Promise<BigNumber>

Fetches a users Ticket TWAB at a specific unix timestamp.

Parameters

NameTypeDescription
usersAddressstringthe address to fetch the ticket TWAB for
unixTimestampnumberthe unix timestamp to fetch in seconds

Returns

Promise<BigNumber>

the users TWAB at the requested time

Defined in

src/PrizePool.ts:129


getUsersTokenBalance

getUsersTokenBalance(usersAddress): Promise<BigNumber>

Fetches a users balance for the Prize Pools underlying Token.

Parameters

NameTypeDescription
usersAddressstringthe address to fetch the balance for

Returns

Promise<BigNumber>

the users token balance

Defined in

src/PrizePool.ts:145


id

id(): string

Returns a unique id string for this Prize Pool.

Returns

string

a unique id for the Prize Pool

Defined in

src/PrizePool.ts:82