|
| 1 | +# IStaking20 |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Methods |
| 12 | + |
| 13 | +### claimRewards |
| 14 | + |
| 15 | +```solidity |
| 16 | +function claimRewards() external nonpayable |
| 17 | +``` |
| 18 | + |
| 19 | +Claim accumulated rewards. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +### getStakeInfo |
| 25 | + |
| 26 | +```solidity |
| 27 | +function getStakeInfo(address staker) external view returns (uint256 _tokensStaked, uint256 _rewards) |
| 28 | +``` |
| 29 | + |
| 30 | +View amount staked and total rewards for a user. |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +#### Parameters |
| 35 | + |
| 36 | +| Name | Type | Description | |
| 37 | +|---|---|---| |
| 38 | +| staker | address | Address for which to calculated rewards. | |
| 39 | + |
| 40 | +#### Returns |
| 41 | + |
| 42 | +| Name | Type | Description | |
| 43 | +|---|---|---| |
| 44 | +| _tokensStaked | uint256 | undefined | |
| 45 | +| _rewards | uint256 | undefined | |
| 46 | + |
| 47 | +### stake |
| 48 | + |
| 49 | +```solidity |
| 50 | +function stake(uint256 amount) external nonpayable |
| 51 | +``` |
| 52 | + |
| 53 | +Stake ERC721 Tokens. |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +#### Parameters |
| 58 | + |
| 59 | +| Name | Type | Description | |
| 60 | +|---|---|---| |
| 61 | +| amount | uint256 | Amount to stake. | |
| 62 | + |
| 63 | +### withdraw |
| 64 | + |
| 65 | +```solidity |
| 66 | +function withdraw(uint256 amount) external nonpayable |
| 67 | +``` |
| 68 | + |
| 69 | +Withdraw staked tokens. |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +#### Parameters |
| 74 | + |
| 75 | +| Name | Type | Description | |
| 76 | +|---|---|---| |
| 77 | +| amount | uint256 | Amount to withdraw. | |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +## Events |
| 82 | + |
| 83 | +### RewardsClaimed |
| 84 | + |
| 85 | +```solidity |
| 86 | +event RewardsClaimed(address indexed staker, uint256 rewardAmount) |
| 87 | +``` |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +*Emitted when a staker claims staking rewards.* |
| 92 | + |
| 93 | +#### Parameters |
| 94 | + |
| 95 | +| Name | Type | Description | |
| 96 | +|---|---|---| |
| 97 | +| staker `indexed` | address | undefined | |
| 98 | +| rewardAmount | uint256 | undefined | |
| 99 | + |
| 100 | +### TokensStaked |
| 101 | + |
| 102 | +```solidity |
| 103 | +event TokensStaked(address indexed staker, uint256 amount) |
| 104 | +``` |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | +*Emitted when tokens are staked.* |
| 109 | + |
| 110 | +#### Parameters |
| 111 | + |
| 112 | +| Name | Type | Description | |
| 113 | +|---|---|---| |
| 114 | +| staker `indexed` | address | undefined | |
| 115 | +| amount | uint256 | undefined | |
| 116 | + |
| 117 | +### TokensWithdrawn |
| 118 | + |
| 119 | +```solidity |
| 120 | +event TokensWithdrawn(address indexed staker, uint256 amount) |
| 121 | +``` |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | +*Emitted when a tokens are withdrawn.* |
| 126 | + |
| 127 | +#### Parameters |
| 128 | + |
| 129 | +| Name | Type | Description | |
| 130 | +|---|---|---| |
| 131 | +| staker `indexed` | address | undefined | |
| 132 | +| amount | uint256 | undefined | |
| 133 | + |
| 134 | +### UpdatedMinStakeAmount |
| 135 | + |
| 136 | +```solidity |
| 137 | +event UpdatedMinStakeAmount(uint256 oldAmount, uint256 newAmount) |
| 138 | +``` |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | +*Emitted when contract admin updates minimum staking amount.* |
| 143 | + |
| 144 | +#### Parameters |
| 145 | + |
| 146 | +| Name | Type | Description | |
| 147 | +|---|---|---| |
| 148 | +| oldAmount | uint256 | undefined | |
| 149 | +| newAmount | uint256 | undefined | |
| 150 | + |
| 151 | +### UpdatedRewardRatio |
| 152 | + |
| 153 | +```solidity |
| 154 | +event UpdatedRewardRatio(uint256 oldNumerator, uint256 newNumerator, uint256 oldDenominator, uint256 newDenominator) |
| 155 | +``` |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | +*Emitted when contract admin updates rewardsPerUnitTime.* |
| 160 | + |
| 161 | +#### Parameters |
| 162 | + |
| 163 | +| Name | Type | Description | |
| 164 | +|---|---|---| |
| 165 | +| oldNumerator | uint256 | undefined | |
| 166 | +| newNumerator | uint256 | undefined | |
| 167 | +| oldDenominator | uint256 | undefined | |
| 168 | +| newDenominator | uint256 | undefined | |
| 169 | + |
| 170 | +### UpdatedTimeUnit |
| 171 | + |
| 172 | +```solidity |
| 173 | +event UpdatedTimeUnit(uint256 oldTimeUnit, uint256 newTimeUnit) |
| 174 | +``` |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | +*Emitted when contract admin updates timeUnit.* |
| 179 | + |
| 180 | +#### Parameters |
| 181 | + |
| 182 | +| Name | Type | Description | |
| 183 | +|---|---|---| |
| 184 | +| oldTimeUnit | uint256 | undefined | |
| 185 | +| newTimeUnit | uint256 | undefined | |
| 186 | + |
| 187 | + |
| 188 | + |
0 commit comments