Commit 3d04ee7
Staking updates (#294)
* more efficient way of storing state for Staking contracts
* [M-1] Block gas limit can be exceeded during setTimeUnit() and setRewardsPerUnit() when staker count grows
* [C-1] Contract admins can lock staked tokens in the contract
* [M-1] revised fix for Staking1155
* [H-1] TokenStake.sol rewards can be over- or under-awarded when the staking and reward tokens have different decimals
* [M-2] ERC721 and ERC1155 tokens safe-transferred directly to contract will be locked and unrecoverable
* [C-1] revised fix for large rewardsPerUnitTime
* [L-1] Incorrect ERC165 implementation for NFTStake and EditionStake
* [Q-2] Normalize support for ERC2771 trusted forwarder
* [Q-3] Reentrancy init called twice
* [Q-5] unitTime and rewardsPerUnitTime setter functions don’t check for new input data
* [Q-6] getStakeInfo should be marked as external
* [G-1] Halt array iteration after staker removed during withdraw()
* [G-2] Loop reading from storage array length
* [Q-7] Missing reward balance information
* [M-3] TokenStake.sol: Double entry-point ERC20 tokens could be drained from the staking contract
* [H-2] TokenStake.sol: Tokens with a tax on transfer will account for inaccurate amounts
* virtual functions for bases
* docs
* v3.2.9
Co-authored-by: Krishang <krishang@thirdweb.com>1 parent 3014c2c commit 3d04ee7
File tree
36 files changed
+2853
-938
lines changed- contracts
- base
- extension
- interface
- openzeppelin-presets/utils/math
- staking
- docs
- lib
- src/test
- mocks
- sdk/extension
- staking
36 files changed
+2853
-938
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | | - | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | | - | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
0 commit comments