-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathIStakingPools.sol
More file actions
79 lines (67 loc) · 2.38 KB
/
IStakingPools.sol
File metadata and controls
79 lines (67 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Neptune Mutual Protocol (https://neptunemutual.com)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import "./IMember.sol";
interface IStakingPools is IMember {
enum StakingPoolType {
TokenStaking,
PODStaking
}
struct AddOrEditPoolArgs {
bytes32 key;
string name;
StakingPoolType poolType;
address stakingToken;
address uniStakingTokenDollarPair;
address rewardToken;
address uniRewardTokenDollarPair;
uint256 stakingTarget;
uint256 maxStake;
uint256 platformFee;
uint256 rewardPerBlock;
uint256 lockupPeriod;
uint256 rewardTokenToDeposit;
}
struct StakingPoolInfoType {
string name;
address stakingToken;
address stakingTokenStablecoinPair;
address rewardToken;
address rewardTokenStablecoinPair;
uint256 totalStaked;
uint256 target;
uint256 maximumStake;
uint256 stakeBalance;
uint256 cumulativeDeposits;
uint256 rewardPerBlock;
uint256 platformFee;
uint256 lockupPeriod;
uint256 rewardTokenBalance;
uint256 accountStakeBalance;
uint256 totalBlockSinceLastReward;
uint256 rewards;
uint256 canWithdrawFromBlockHeight;
uint256 lastDepositHeight;
uint256 lastRewardHeight;
}
event PoolUpdated(bytes32 indexed key, AddOrEditPoolArgs args);
event PoolClosed(bytes32 indexed key, string name);
event Deposited(bytes32 indexed key, address indexed account, address indexed token, uint256 amount);
event Withdrawn(bytes32 indexed key, address indexed account, address indexed token, uint256 amount);
event RewardsWithdrawn(bytes32 indexed key, address indexed account, address indexed token, uint256 rewards, uint256 platformFee);
/**
* @dev Adds or edits the pool by key
*/
function addOrEditPool(AddOrEditPoolArgs calldata args) external;
function closePool(bytes32 key) external;
function deposit(bytes32 key, uint256 amount) external;
function withdraw(bytes32 key, uint256 amount) external;
function withdrawRewards(bytes32 key) external;
function calculateRewards(bytes32 key, address account) external view returns (uint256);
/**
* @dev Gets the info of a given staking pool by key
* @param key Provide the staking pool key to fetch info for
* @param you Specify the address to customize the info for
*/
function getInfo(bytes32 key, address you) external view returns (StakingPoolInfoType memory info);
}