Skip to content

Commit

Permalink
Place structs on top of the interfaces (Fix #53)
Browse files Browse the repository at this point in the history
  • Loading branch information
nxqbao committed Nov 13, 2022
1 parent b424f15 commit 997ea5b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions contracts/interfaces/staking/IBaseStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
pragma solidity ^0.8.9;

interface IBaseStaking {
/// @dev Emitted when the minium number of seconds to undelegate is updated.
event CooldownSecsToUndelegateUpdated(uint256 minSecs);
/// @dev Emitted when the number of seconds that a candidate must wait to be revoked.
event WaitingSecsToRevokeUpdated(uint256 secs);

struct PoolDetail {
// Address of the pool i.e. consensus address of the validator
address addr;
Expand All @@ -23,6 +18,11 @@ interface IBaseStaking {
mapping(address => uint256) lastDelegatingTimestamp;
}

/// @dev Emitted when the minium number of seconds to undelegate is updated.
event CooldownSecsToUndelegateUpdated(uint256 minSecs);
/// @dev Emitted when the number of seconds that a candidate must wait to be revoked.
event WaitingSecsToRevokeUpdated(uint256 secs);

/**
* @dev Returns The cooldown time in seconds to undelegate from the last timestamp (s)he delegated.
*/
Expand Down
28 changes: 14 additions & 14 deletions contracts/interfaces/staking/IRewardPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ pragma solidity ^0.8.9;
import "../../interfaces/consumers/PeriodWrapperConsumer.sol";

interface IRewardPool is PeriodWrapperConsumer {
/// @dev Emitted when the fields to calculate pending reward for the user is updated.
event UserRewardUpdated(address indexed poolAddr, address indexed user, uint256 debited);
/// @dev Emitted when the user claimed their reward
event RewardClaimed(address indexed poolAddr, address indexed user, uint256 amount);

/// @dev Emitted when the pool shares are updated
event PoolSharesUpdated(uint256 indexed period, address indexed poolAddr, uint256 shares);
/// @dev Emitted when the pools are updated
event PoolsUpdated(uint256 indexed period, address[] poolAddrs, uint256[] aRps, uint256[] shares);
/// @dev Emitted when the contract fails when updating the pools
event PoolsUpdateFailed(uint256 indexed period, address[] poolAddrs, uint256[] rewards);
/// @dev Emitted when the contract fails when updating the pools that already set
event PoolsUpdateConflicted(uint256 indexed period, address[] poolAddrs);

struct UserRewardFields {
// Recorded reward amount.
uint256 debited;
Expand All @@ -37,6 +23,20 @@ interface IRewardPool is PeriodWrapperConsumer {
PeriodWrapper shares;
}

/// @dev Emitted when the fields to calculate pending reward for the user is updated.
event UserRewardUpdated(address indexed poolAddr, address indexed user, uint256 debited);
/// @dev Emitted when the user claimed their reward
event RewardClaimed(address indexed poolAddr, address indexed user, uint256 amount);

/// @dev Emitted when the pool shares are updated
event PoolSharesUpdated(uint256 indexed period, address indexed poolAddr, uint256 shares);
/// @dev Emitted when the pools are updated
event PoolsUpdated(uint256 indexed period, address[] poolAddrs, uint256[] aRps, uint256[] shares);
/// @dev Emitted when the contract fails when updating the pools
event PoolsUpdateFailed(uint256 indexed period, address[] poolAddrs, uint256[] rewards);
/// @dev Emitted when the contract fails when updating the pools that already set
event PoolsUpdateConflicted(uint256 indexed period, address[] poolAddrs);

/**
* @dev Returns the reward amount that user claimable.
*/
Expand Down

0 comments on commit 997ea5b

Please sign in to comment.