Skip to main content
Version: V4

PrizeFlush

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

Functions

constructor

  function constructor(
address _owner,
address _destination,
contract IStrategy _strategy,
contract IReserve _reserve
) public

Deploy Prize Flush.

Parameters:

NameTypeDescription
_owneraddressPrize Flush owner address
_destinationaddressDestination address
_strategycontract IStrategyStrategy address
_reservecontract IReserveReserve address

getDestination

  function getDestination(
) external returns (address)

Read global destination variable.

getReserve

  function getReserve(
) external returns (contract IReserve)

Read global reserve variable.

getStrategy

  function getStrategy(
) external returns (contract IStrategy)

Read global strategy variable.

setDestination

  function setDestination(
) external returns (address)

Set global destination variable.

setReserve

  function setReserve(
) external returns (contract IReserve)

Set global reserve variable.

setStrategy

  function setStrategy(
) external returns (contract IStrategy)

Set global strategy variable.

flush

  function flush(
) external returns (bool)

Migrate interest from PrizePool to PrizeDistributor in a single transaction.

Captures interest, checkpoint data and transfers tokens to final destination.

Return Values:

TypeDescription
boolTrue if operation is successful.

manager

  function manager(
) public returns (address)

Gets current _manager.

Return Values:

TypeDescription
addressCurrent _manager address.

setManager

  function setManager(
address _newManager
) external returns (bool)

Set or change of manager.

Throws if called by any account other than the owner.

Parameters:

NameTypeDescription
_newManageraddressNew _manager address.

Return Values:

TypeDescription
boolBoolean to indicate if the operation was successful or not.

owner

  function owner(
) public returns (address)

Returns the address of the current owner.

pendingOwner

  function pendingOwner(
) external returns (address)

Gets current _pendingOwner.

Return Values:

TypeDescription
addressCurrent _pendingOwner address.

renounceOwnership

  function renounceOwnership(
) external

Renounce ownership of the contract.

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership

  function transferOwnership(
address _newOwner
) external

Allows current owner to set the _pendingOwner address.

Parameters:

NameTypeDescription
_newOwneraddressAddress to transfer ownership to.

claimOwnership

  function claimOwnership(
) external

Allows the _pendingOwner address to finalize the transfer.

This function is only callable by the _pendingOwner.

Events

Deployed

  event Deployed(
address destination,
contract IReserve reserve,
contract IStrategy strategy
)

Emitted when contract has been deployed.

Parameters:

NameTypeDescription
destinationaddressDestination address
reservecontract IReserveStrategy address
strategycontract IStrategyReserve address

ManagerTransferred

  event ManagerTransferred(
address previousManager,
address newManager
)

Emitted when _manager has been changed.

Parameters:

NameTypeDescription
previousManageraddressprevious _manager address.
newManageraddressnew _manager address.

OwnershipOffered

  event OwnershipOffered(
address pendingOwner
)

Emitted when _pendingOwner has been changed.

Parameters:

NameTypeDescription
pendingOwneraddressnew _pendingOwner address.

OwnershipTransferred

  event OwnershipTransferred(
address previousOwner,
address newOwner
)

Emitted when _owner has been changed.

Parameters:

NameTypeDescription
previousOwneraddressprevious _owner address.
newOwneraddressnew _owner address.

Flushed

  event Flushed(
address destination,
uint256 amount
)

Emit when the flush function has executed.

Parameters:

NameTypeDescription
destinationaddressAddress receiving funds
amountuint256Amount of tokens transferred

DestinationSet

  event DestinationSet(
address destination
)

Emit when destination is set.

Parameters:

NameTypeDescription
destinationaddressDestination address

StrategySet

  event StrategySet(
contract IStrategy strategy
)

Emit when strategy is set.

Parameters:

NameTypeDescription
strategycontract IStrategyStrategy address

ReserveSet

  event ReserveSet(
contract IReserve reserve
)

Emit when reserve is set.

Parameters:

NameTypeDescription
reservecontract IReserveReserve address