diff --git a/contracts/DrawHistory.sol b/contracts/DrawHistory.sol index 47beca0f..9161c7e0 100644 --- a/contracts/DrawHistory.sol +++ b/contracts/DrawHistory.sol @@ -11,13 +11,13 @@ import "./libraries/DrawRingBufferLib.sol"; /** * @title PoolTogether V4 DrawHistory * @author PoolTogether Inc Team - * @notice The DrawHistory keeps a historical record of Draws created/pushed by DrawBeacon(s). - Once a DrawBeacon (on mainnet) completes a RNG request, a new Draw will be added - to the DrawHistory draws ring buffer. A DrawHistory will store a limited number - of Draws before beginning to overwrite (managed via the cardinality) previous Draws. - All mainnet DrawHistory(s) are updated directly from a DrawBeacon, but non-mainnet - DrawHistory(s) (Matic, Optimism, Arbitrum, etc...) will receive a cross-chain message, - duplicating the mainnet Draw configuration - enabling a prize savings liquidity network. + * @notice The DrawHistory provides historical lookups of Draws via a circular ring buffer. + Historical Draws can be accessed on-chain using a drawId to calculate ring buffer storage slot. + The Draw settings can be created by manager/owner and existing Draws can only be updated the owner. + Once a starting Draw has been added to the ring buffer, all following draws must have a sequential Draw ID. + @dev A DrawHistory store a limited number of Draws before beginning to overwrite (managed via the cardinality) previous Draws. + @dev All mainnet DrawHistory(s) are updated directly from a DrawBeacon, but non-mainnet DrawHistory(s) (Matic, Optimism, Arbitrum, etc...) + will receive a cross-chain message, duplicating the mainnet Draw configuration - enabling a prize savings liquidity network. */ contract DrawHistory is IDrawHistory, Manageable { using DrawRingBufferLib for DrawRingBufferLib.Buffer; diff --git a/contracts/DrawPrize.sol b/contracts/DrawPrize.sol index bc2326f5..443a743c 100644 --- a/contracts/DrawPrize.sol +++ b/contracts/DrawPrize.sol @@ -24,7 +24,7 @@ contract DrawPrize is IDrawPrize, Ownable { /* ============ Global Variables ============ */ - /// @notice The Draw Calculator to use + /// @notice DrawCalculator address IDrawCalculator internal drawCalculator; /// @notice Token address @@ -37,8 +37,8 @@ contract DrawPrize is IDrawPrize, Ownable { /** * @notice Initialize DrawPrize smart contract. - * @param _owner Address of the DrawPrize owner - * @param _token Token address + * @param _owner Owner address + * @param _token Token address * @param _drawCalculator DrawCalculator address */ constructor( @@ -87,6 +87,22 @@ contract DrawPrize is IDrawPrize, Ownable { return totalPayout; } + /// @inheritdoc IDrawPrize + function withdrawERC20( + IERC20 _erc20Token, + address _to, + uint256 _amount + ) external override onlyOwner returns (bool) { + require(_to != address(0), "DrawPrize/recipient-not-zero-address"); + require(address(_erc20Token) != address(0), "DrawPrize/ERC20-not-zero-address"); + + _erc20Token.safeTransfer(_to, _amount); + + emit ERC20Withdrawn(_erc20Token, _to, _amount); + + return true; + } + /// @inheritdoc IDrawPrize function getDrawCalculator() external view override returns (IDrawCalculator) { return drawCalculator; @@ -156,26 +172,4 @@ contract DrawPrize is IDrawPrize, Ownable { token.safeTransfer(_to, _amount); } - /** - * @notice Transfer ERC20 tokens out of this contract. - * @dev This function is only callable by the owner. - * @param _erc20Token ERC20 token to transfer. - * @param _to Recipient of the tokens. - * @param _amount Amount of tokens to transfer. - * @return true if operation is successful. - */ - function withdrawERC20( - IERC20 _erc20Token, - address _to, - uint256 _amount - ) external override onlyOwner returns (bool) { - require(_to != address(0), "DrawPrize/recipient-not-zero-address"); - require(address(_erc20Token) != address(0), "DrawPrize/ERC20-not-zero-address"); - - _erc20Token.safeTransfer(_to, _amount); - - emit ERC20Withdrawn(_erc20Token, _to, _amount); - - return true; - } } diff --git a/contracts/PrizeDistributionHistory.sol b/contracts/PrizeDistributionHistory.sol index d6c657ba..754a1b24 100644 --- a/contracts/PrizeDistributionHistory.sol +++ b/contracts/PrizeDistributionHistory.sol @@ -11,9 +11,11 @@ import "./interfaces/IPrizeDistributionHistory.sol"; /** * @title PoolTogether V4 PrizeDistributionHistory * @author PoolTogether Inc Team - * @notice The PrizeDistributionHistory stores historic PrizeDistribution for each drawId. - Storage of the PrizeDistributions is handled by a ring buffer with a max cardinality - of 256 or roughly 5 years of history with a weekly draw cadence. + * @notice The PrizeDistributionHistory contract provides historical lookups of PrizeDistribution struct parameters (linked with a Draw ID) via a + circular ring buffer. Historical PrizeDistribution parameters can be accessed on-chain using a drawId to calculate + ring buffer storage slot. The PrizeDistribution parameters can be created by manager/owner and existing PrizeDistribution + parameters can only be updated the owner. When adding a new PrizeDistribution basic sanity checks will be used to + validate the incoming parameters. */ contract PrizeDistributionHistory is IPrizeDistributionHistory, Manageable { using DrawRingBufferLib for DrawRingBufferLib.Buffer; diff --git a/contracts/PrizeFlush.sol b/contracts/PrizeFlush.sol index 1a506fef..73f1d100 100644 --- a/contracts/PrizeFlush.sol +++ b/contracts/PrizeFlush.sol @@ -8,9 +8,14 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/IPrizeFlush.sol"; /** - * @title PoolTogether V4 PrizeFlush - * @author PoolTogether Inc Team - * @notice The PrizeFlush is a helper library to facilate interest distribution. + * @title PoolTogether V4 PrizeFlush + * @author PoolTogether Inc Team + * @notice The PrizeFlush contract helps capture interest from the PrizePool and move collected funds + to a designated PrizeDistributor contract. When deployed the destination, resereve and strategy + addresses are set and used as static parameters during every "flush" execution. The parameters can be + reset by the Owner if neccesary. + * @dev Ultimately the PrizeFlush contract minimizes the amount of time tokens spend in the Reserve contract by executing + a predictable token transfer "order of operations" which includes a critical checkpoint in the Reserve ring buffer. */ contract PrizeFlush is IPrizeFlush, Manageable { /// @notice Static destination for captured interest @@ -39,12 +44,11 @@ contract PrizeFlush is IPrizeFlush, Manageable { /* ============ Constructor ============ */ /** - * @notice Set owner, reserve and strategy when deployed. + * @notice Set owner, destination, reserve and strategy when deployed. * @param _owner address * @param _destination address * @param _strategy IStrategy * @param _reserve IReserve - * */ constructor( address _owner, @@ -56,7 +60,6 @@ contract PrizeFlush is IPrizeFlush, Manageable { strategy = _strategy; reserve = _reserve; - // Emit Deploy State emit Deployed(_destination, _reserve, _strategy); } @@ -109,14 +112,15 @@ contract PrizeFlush is IPrizeFlush, Manageable { /// @inheritdoc IPrizeFlush function flush() external override onlyManagerOrOwner returns (bool) { + // Captures interest from PrizePool and distributes funds using a PrizeSplitStrategy strategy.distribute(); - // After captured interest transferred to Strategy.PrizeSplits[]: [Reserve, Other] - // transfer the Reserve balance directly to the DrawPrize (destination) address. + // After funds are distributed using PrizeSplitStrategy we EXPECT funds to be located in the Reserve. IReserve _reserve = reserve; IERC20 _token = _reserve.getToken(); uint256 _amount = _token.balanceOf(address(_reserve)); + // IF the tokens were succesfully moved to the Reserve, now move the to the destination (PrizeDistributor) address. if (_amount > 0) { // Create checkpoint and transfers new total balance to DrawPrize address _destination = destination; diff --git a/contracts/Reserve.sol b/contracts/Reserve.sol index 461f18d4..2b79b474 100644 --- a/contracts/Reserve.sol +++ b/contracts/Reserve.sol @@ -10,9 +10,16 @@ import "./interfaces/IReserve.sol"; import "./libraries/ObservationLib.sol"; /** - * @title PoolTogether V4 Reserve - * @author PoolTogether Inc Team - * @notice The Reserve migrates allotments of token distributions. + * @title PoolTogether V4 Reserve + * @author PoolTogether Inc Team + * @notice The Reserve contract provides historical lookups of a token balance increase during a target timerange. + As the Reserve contract transfers OUT tokens, the withdraw accumulator is increased. When tokens are + transfered IN new checkpoint *can* be created if checkpoint() is called after transfering tokens. + By using the reserve and withdraw accumulators to create a new checkpoint, any contract or account + can lookup the balance increase of the reserve for a target timerange. + * @dev By calculating the total held tokens in a speicific time range, contracts that require knowledge + of captured interest during a draw period, can easily call into the Reserve and determininstially + determine the newly aqcuired tokens for that time range. */ contract Reserve is IReserve, Manageable { using SafeERC20 for IERC20; diff --git a/contracts/interfaces/IControlledToken.sol b/contracts/interfaces/IControlledToken.sol index 2b61d5df..50068740 100644 --- a/contracts/interfaces/IControlledToken.sol +++ b/contracts/interfaces/IControlledToken.sol @@ -4,29 +4,40 @@ pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -/// @title Controlled ERC20 Token -/// @notice ERC20 Tokens with a controller for minting & burning +/** @title IControlledToken + * @author PoolTogether Inc Team + * @notice ERC20 Tokens with a controller for minting & burning. +*/ interface IControlledToken is IERC20 { - /// @notice Interface to the contract responsible for controlling mint/burn + + /** + @notice Interface to the contract responsible for controlling mint/burn + */ function controller() external view returns (address); - /// @notice Allows the controller to mint tokens for a user account - /// @dev May be overridden to provide more granular control over minting - /// @param user Address of the receiver of the minted tokens - /// @param amount Amount of tokens to mint + /** + * @notice Allows the controller to mint tokens for a user account + * @dev May be overridden to provide more granular control over minting + * @param user Address of the receiver of the minted tokens + * @param amount Amount of tokens to mint + */ function controllerMint(address user, uint256 amount) external; - /// @notice Allows the controller to burn tokens from a user account - /// @dev May be overridden to provide more granular control over burning - /// @param user Address of the holder account to burn tokens from - /// @param amount Amount of tokens to burn + /** + * @notice Allows the controller to burn tokens from a user account + * @dev May be overridden to provide more granular control over burning + * @param user Address of the holder account to burn tokens from + * @param amount Amount of tokens to burn + */ function controllerBurn(address user, uint256 amount) external; - /// @notice Allows an operator via the controller to burn tokens on behalf of a user account - /// @dev May be overridden to provide more granular control over operator-burning - /// @param operator Address of the operator performing the burn action via the controller contract - /// @param user Address of the holder account to burn tokens from - /// @param amount Amount of tokens to burn + /** + * @notice Allows an operator via the controller to burn tokens on behalf of a user account + * @dev May be overridden to provide more granular control over operator-burning + * @param operator Address of the operator performing the burn action via the controller contract + * @param user Address of the holder account to burn tokens from + * @param amount Amount of tokens to burn + */ function controllerBurnFrom( address operator, address user, diff --git a/contracts/interfaces/IDrawBeacon.sol b/contracts/interfaces/IDrawBeacon.sol index 8ce762e8..ad7dff14 100644 --- a/contracts/interfaces/IDrawBeacon.sol +++ b/contracts/interfaces/IDrawBeacon.sol @@ -6,6 +6,10 @@ import "@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol"; import "./IDrawHistory.sol"; import "../libraries/DrawLib.sol"; +/** @title IDrawBeacon + * @author PoolTogether Inc Team + * @notice The DrawBeacon interface. +*/ interface IDrawBeacon { /** * @notice Emit when a new DrawHistory has been set. @@ -15,7 +19,7 @@ interface IDrawBeacon { /** * @notice Emit when a draw has opened. - * @param operator User address responsible for opening draw + * @param operator User address responsible for opening draw * @param startedAt Start timestamp */ event BeaconPeriodStarted(address indexed operator, uint64 indexed startedAt); diff --git a/contracts/interfaces/IDrawCalculator.sol b/contracts/interfaces/IDrawCalculator.sol index 90b9338c..d1caa578 100644 --- a/contracts/interfaces/IDrawCalculator.sol +++ b/contracts/interfaces/IDrawCalculator.sol @@ -9,7 +9,7 @@ import "../DrawPrize.sol"; import "../libraries/DrawLib.sol"; /** - * @title PoolTogether V4 DrawCalculator + * @title PoolTogether V4 IDrawCalculator * @author PoolTogether Inc Team * @notice The DrawCalculator interface. */ diff --git a/contracts/interfaces/IDrawHistory.sol b/contracts/interfaces/IDrawHistory.sol index f79c2f40..f1cc51ff 100644 --- a/contracts/interfaces/IDrawHistory.sol +++ b/contracts/interfaces/IDrawHistory.sol @@ -4,6 +4,10 @@ pragma solidity 0.8.6; import "../libraries/DrawLib.sol"; +/** @title IDrawHistory + * @author PoolTogether Inc Team + * @notice The DrawHistory interface. +*/ interface IDrawHistory { /** * @notice Emit when a new draw has been created. @@ -13,17 +17,17 @@ interface IDrawHistory { event DrawSet(uint32 indexed drawId, DrawLib.Draw draw); /** - * @notice Read a Draw from the draws ring buffer. - * @dev Read a Draw using the Draw.drawId to calculate position in the draws ring buffer. - * @param drawId Draw.drawId + * @notice Read a Draw from draws ring buffer. + * @dev Read a Draw using the drawId to calculate position in draws ring buffer. + * @param drawId drawId * @return DrawLib.Draw */ function getDraw(uint32 drawId) external view returns (DrawLib.Draw memory); /** - * @notice Read multiple Draws from the draws ring buffer. - * @dev Read multiple Draws using each Draw.drawId to calculate position in the draws ring buffer. - * @param drawIds Array of Draw.drawIds + * @notice Read multiple Draws from draws ring buffer. + * @dev Read multiple Draws using each drawId to calculate position in draws ring buffer. + * @param drawIds Array of drawIds * @return DrawLib.Draw[] */ function getDraws(uint32[] calldata drawIds) external view returns (DrawLib.Draw[] memory); @@ -38,14 +42,14 @@ interface IDrawHistory { function getDrawCount() external view returns (uint32); /** - * @notice Read newest Draw from the draws ring buffer. + * @notice Read newest Draw from draws ring buffer. * @dev Uses the nextDrawIndex to calculate the most recently added Draw. * @return DrawLib.Draw */ function getNewestDraw() external view returns (DrawLib.Draw memory); /** - * @notice Read oldest Draw from the draws ring buffer. + * @notice Read oldest Draw from draws ring buffer. * @dev Finds the oldest Draw by comparing and/or diffing totalDraws with the cardinality. * @return DrawLib.Draw */ @@ -54,8 +58,8 @@ interface IDrawHistory { /** * @notice Push Draw onto draws ring buffer history. * @dev Push new draw onto draws history via authorized manager or owner. - * @param draw DrawLib.Draw - * @return Draw.drawId + * @param draw DrawLib.Draw + * @return drawId */ function pushDraw(DrawLib.Draw calldata draw) external returns (uint32); @@ -63,7 +67,7 @@ interface IDrawHistory { * @notice Set existing Draw in draws ring buffer with new parameters. * @dev Updating a Draw should be used sparingly and only in the event an incorrect Draw parameter has been stored. * @param newDraw DrawLib.Draw - * @return Draw.drawId + * @return drawId */ function setDraw(DrawLib.Draw calldata newDraw) external returns (uint32); } diff --git a/contracts/interfaces/IDrawPrize.sol b/contracts/interfaces/IDrawPrize.sol index 61856114..9109bb49 100644 --- a/contracts/interfaces/IDrawPrize.sol +++ b/contracts/interfaces/IDrawPrize.sol @@ -5,41 +5,52 @@ import "./IDrawHistory.sol"; import "./IDrawCalculator.sol"; import "../libraries/DrawLib.sol"; +/** @title IDrawPrize + * @author PoolTogether Inc Team + * @notice The DrawPrize interface. +*/ interface IDrawPrize { + /** - * @notice Emitted when a user has claimed N draw payouts. - * @param user User address receiving draw claim payouts - * @param drawId Draw id that was paid out + * @notice Emit when user has claimed token from the PrizeDistributor. + * @param user User address receiving draw claim payouts + * @param drawId Draw id that was paid out * @param payout Payout for draw */ event ClaimedDraw(address indexed user, uint32 indexed drawId, uint256 payout); /** - * @notice Emitted when a DrawCalculator is set + * @notice Emit when DrawCalculator is set. * @param calculator DrawCalculator address */ event DrawCalculatorSet(IDrawCalculator indexed calculator); /** - * @notice Emitted when a global Ticket variable is set. + * @notice Emit when Token is set. * @param token Token address */ event TokenSet(IERC20 indexed token); /** - * @notice Emitted when ERC20 tokens are withdrawn - * @param token ERC20 token transferred. - * @param to Address that received funds. + * @notice Emit when ERC20 tokens are withdrawn. + * @param token ERC20 token transferred. + * @param to Address that received funds. * @param amount Amount of tokens transferred. */ event ERC20Withdrawn(IERC20 indexed token, address indexed to, uint256 amount); /** - * @notice Claim a user token payouts via a collection of draw ids and pick indices. + * @notice Claim prize payout(s) by submitting valud drawId(s) and winning pick indice(s). The user address + is used as the "seed" phrase to generate random numbers. + * @dev The claim function is public and any wallet may execute claim on behalf of another user. + Prizes are always paid out to the designated user account and not the caller (msg.sender). + Claiming prizes is not limited to a single transaction. Reclaiming can be executed + subsequentially if an "optimal" prize was not included in previous claim pick indices. The + payout difference for the new claim is calculated during the award process and transfered to user. * @param user Address of user to claim awards for. Does NOT need to be msg.sender * @param drawIds Draw IDs from global DrawHistory reference * @param data The data to pass to the draw calculator - * @return Actual claim payout. If the user has previously claimed a draw, this may be less. + * @return Total claim payout. May include calcuations from multiple draws. */ function claim( address user, @@ -48,34 +59,42 @@ interface IDrawPrize { ) external returns (uint256); /** - * @notice Read DrawCalculator - * @return IDrawCalculator + * @notice Read global DrawCalculator address. + * @return IDrawCalculator */ function getDrawCalculator() external view returns (IDrawCalculator); /** - * @notice Get the amount that a user has already been paid out for a draw - * @param user User address - * @param drawId Draw ID + * @notice Get the amount that a user has already been paid out for a draw + * @param user User address + * @param drawId Draw ID */ function getDrawPayoutBalanceOf(address user, uint32 drawId) external view returns (uint256); /** - * @notice Read global Ticket variable. - * @return IERC20 + * @notice Read global Ticket address. + * @return IERC20 */ function getToken() external view returns (IERC20); /** - * @notice Sets DrawCalculator reference for individual draw id. - * @param _newCalculator DrawCalculator address - * @return New DrawCalculator address + * @notice Sets DrawCalculator reference contract. + * @param _newCalculator DrawCalculator address + * @return New DrawCalculator address */ function setDrawCalculator(IDrawCalculator _newCalculator) external returns (IDrawCalculator); + /** + * @notice Transfer ERC20 tokens out of contract to recipient address. + * @dev Only callable by contract owner. + * @param token ERC20 token to transfer. + * @param to Recipient of the tokens. + * @param amount Amount of tokens to transfer. + * @return true if operation is successful. + */ function withdrawERC20( - IERC20 _erc20Token, - address _to, - uint256 _amount + IERC20 token, + address to, + uint256 amount ) external returns (bool); } diff --git a/contracts/interfaces/IPrizeDistributionHistory.sol b/contracts/interfaces/IPrizeDistributionHistory.sol index 13df61c8..6606dd73 100644 --- a/contracts/interfaces/IPrizeDistributionHistory.sol +++ b/contracts/interfaces/IPrizeDistributionHistory.sol @@ -4,19 +4,16 @@ pragma solidity 0.8.6; import "../libraries/DrawLib.sol"; +/** @title IPrizeDistributionHistory + * @author PoolTogether Inc Team + * @notice The PrizeDistributionHistory interface. +*/ interface IPrizeDistributionHistory { + /** - * @notice Emit when a new draw has been created. - * @param drawId Draw id - * @param timestamp Epoch timestamp when the draw is created. - * @param winningRandomNumber Randomly generated number used to calculate draw winning numbers - */ - event DrawSet(uint32 indexed drawId, uint32 timestamp, uint256 winningRandomNumber); - - /** - * @notice Emitted when the PrizeDistribution are set/updated - * @param drawId Draw id - * @param prizeDistributions DrawLib.PrizeDistribution + * @notice Emit when PrizeDistribution is set. + * @param drawId Draw id + * @param prizeDistributions PrizeDistribution */ event PrizeDistributionsSet( uint32 indexed drawId, @@ -24,10 +21,10 @@ interface IPrizeDistributionHistory { ); /** - * @notice Read the newest PrizeDistribution from the prize distributions ring buffer. - * @dev Uses the nextDrawIndex to calculate the most recently added PrizeDistribution. - * @return prizeDistribution stored in ring buffer - * @return drawId stored in ring buffer + * @notice Read newest PrizeDistribution from prize distributions ring buffer. + * @dev Uses nextDrawIndex to calculate the most recently added PrizeDistribution. + * @return prizeDistribution + * @return drawId */ function getNewestPrizeDistribution() external @@ -35,10 +32,10 @@ interface IPrizeDistributionHistory { returns (DrawLib.PrizeDistribution memory prizeDistribution, uint32 drawId); /** - * @notice Read the oldest PrizeDistribution from the prize distributions ring buffer. + * @notice Read oldest PrizeDistribution from prize distributions ring buffer. * @dev Finds the oldest Draw by buffer.nextIndex and buffer.lastDrawId - * @return prizeDistribution stored in ring buffer - * @return drawId stored in ring buffer + * @return prizeDistribution + * @return drawId */ function getOldestPrizeDistribution() external @@ -46,8 +43,9 @@ interface IPrizeDistributionHistory { returns (DrawLib.PrizeDistribution memory prizeDistribution, uint32 drawId); /** - * @notice Gets array of PrizeDistributions for drawIds + * @notice Gets PrizeDistribution list from array of drawIds * @param drawIds drawIds to get PrizeDistribution for + * @return prizeDistributionList */ function getPrizeDistributions(uint32[] calldata drawIds) external @@ -56,7 +54,8 @@ interface IPrizeDistributionHistory { /** * @notice Gets the PrizeDistributionHistory for a drawId - * @param drawId Draw.drawId + * @param drawId drawId + * @return prizeDistribution */ function getPrizeDistribution(uint32 drawId) external @@ -73,10 +72,10 @@ interface IPrizeDistributionHistory { function getPrizeDistributionCount() external view returns (uint32); /** - * @notice Stores a PrizeDistribution for a drawId + * @notice Adds new PrizeDistribution record to ring buffer storage. * @dev Only callable by the owner or manager - * @param drawId drawId to store PrizeDistribution for - * @param prizeDistribution PrizeDistribution to store + * @param drawId Draw ID linked to PrizeDistribution parameters + * @param prizeDistribution PrizeDistribution parameters struct */ function pushPrizeDistribution( uint32 drawId, @@ -84,11 +83,13 @@ interface IPrizeDistributionHistory { ) external returns (bool); /** - * @notice Set existing Draw in prize distributions ring buffer with new parameters. - * @dev Updating a Draw should be used sparingly and only in the event an incorrect Draw parameter has been stored. - * @return Draw.drawId + * @notice Sets existing PrizeDistribution with new PrizeDistribution parameters in ring buffer storage. + * @dev Retroactively updates an existing PrizeDistribution and should be thought of as a "safety" + fallback. If the manager is setting invalid PrizeDistribution parameters the Owner can update + the invalid parameters with correct parameters. + * @return drawId */ function setPrizeDistribution(uint32 drawId, DrawLib.PrizeDistribution calldata draw) external - returns (uint32); // maybe return drawIndex + returns (uint32); } diff --git a/contracts/interfaces/IPrizeFlush.sol b/contracts/interfaces/IPrizeFlush.sol index a30a67a8..ac0b753b 100644 --- a/contracts/interfaces/IPrizeFlush.sol +++ b/contracts/interfaces/IPrizeFlush.sol @@ -6,10 +6,30 @@ import "./IReserve.sol"; import "./IStrategy.sol"; interface IPrizeFlush { - // Events + + /** + * @notice Emit when flush is executed. + * @param recipient Receiver of flushed tokens + * @param amount Amount of flushed tokens + */ event Flushed(address indexed recipient, uint256 amount); + + /** + * @notice Emit when destination is set. + * @param destination Destination address + */ event DestinationSet(address indexed destination); + + /** + * @notice Emit when strategy is set. + * @param strategy Strategy address + */ event StrategySet(IStrategy indexed strategy); + + /** + * @notice Emit when destination is set. + * @param reserve Reserve address + */ event ReserveSet(IReserve indexed reserve); /// @notice Read global destination variable.