PrizeFlush

The PrizeFlush contract helps capture interest from the PrizePool and move collected funds to a designated PrizeDistributor contract. When deployed, the destination, reserve addresses are set and used as static parameters during every "flush" execution. The parameters can be reset by the Owner if necessary. The protocol can charge a fee during the movement of the funds.

Write methods description

initialize()

Allows to initialize the contract during the deployment.

Parameters:

NameTypeDescription

_owner

address

An account that will become a new owner of a contract.

_destination

address

Address of the prizeDistributor contract.

_reserve

address

Reserve address.

_prizePool

address

PrizePool address.

flush()

Migrate interest from PrizePool to PrizeDistributor and the protocolFeeRecipient in a single transaction. Captures interest, checkpoints data and transfers tokens to final destination.

Return:

NameTypeDescription

_flushed

bool

true if operation is successful, false otherwise.

setDestination()

Set global destination variable. PrizeDistributor contract that will receive the obtained yield.

setPrizePool()

Set global prizePool variable. PrizePool from where to get the yield from.

setProtocolFeePercentage()

Set global protocolFeePercentage variable.

setProtocolFeeRecipient()

Set global protocolFeeRecipient variable.

setReserve()

Set global reserve variable.

transferOwnership()

Transfers ownership of the contract to a _pendingOwner. Can only be called by the current owner.

Parameters:

NameTypeDescription

newOwner

address

An account that will become the _pendingOwner.

claimOwnership()

Allows the pendingOwner address to claim the owner role. This function is only callable by the pendingOwner.

renounceOwnership()

Leaves the contract without owner. It will not be possible to call the owner's functions anymore. Can only be called by the current owner. The method does not take any parameters. Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

setManager()

Allows the owner to give the manager role to an address. The manager role has access to the functions with the modified onlyOwner or onlyManagerOrOwner.

Parameters:

NameTypeDescription

_newManager

address

An account that will become the new manager.

Read methods description

ONE_AS_FIXED_POINT_3()

Representation of 100% with 3 decimal places, used to split the obtained funds.

getDestination()

Read global destination variable. It shows where the funds will be moved at the end.

getPrizePool()

Read global prizePool variable. Pool from where to capture the award balance.

getProtocolFeePercentage()

Read global ProtocolFeePercentage variable. Portion of the obtained yield that will be paid to the protocol as a fee.

getProtocolFeeRecipient()

Read global ProtocolFeeRecipient variable. Address that will receive the protocolFee.

getReserve()

Read global reserve variable. Contract that tracks funds earned over periods of time.

owner()

Owner role that can be granted exclusive access to specific functions with the modifier onlyOwner.

manager()

Manager role that can be granted exclusive access to specific functions with the modifier onlyManager or onlyManagerOrOwner.

pendingOwner()

The address that can claim the owner role. It is used to transfer the owner.

Last updated