@evvm/testnet-contracts 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/interfaces/IStaking.sol
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: EVVM-NONCOMMERCIAL-1.0
|
|
2
2
|
// Full license terms available at: https://www.evvm.info/docs/EVVMNoncommercialLicense
|
|
3
3
|
|
|
4
|
-
pragma solidity ^0.8.
|
|
5
|
-
|
|
4
|
+
pragma solidity ^0.8.4;
|
|
5
|
+
|
|
6
|
+
interface Staking {
|
|
6
7
|
struct BoolTypeProposal {
|
|
7
8
|
bool flag;
|
|
8
9
|
uint256 timeToAccept;
|
|
@@ -16,108 +17,77 @@ interface IStaking {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
error AddressIsNotAService();
|
|
20
|
+
error AddressMismatch();
|
|
21
|
+
error AddressMustWaitToFullUnstake();
|
|
22
|
+
error AddressMustWaitToStakeAgain();
|
|
19
23
|
error InvalidSignatureOnStaking();
|
|
20
24
|
error PresaleStakingDisabled();
|
|
21
|
-
error PublicStakingDisabled();
|
|
22
25
|
error SenderIsNotAdmin();
|
|
23
26
|
error SenderIsNotGoldenFisher();
|
|
27
|
+
error ServiceDoesNotFulfillCorrectStakingAmount(uint256 requiredAmount);
|
|
28
|
+
error ServiceDoesNotStakeInSameTx();
|
|
24
29
|
error StakingNonceAlreadyUsed();
|
|
25
|
-
error UserAndServiceMismatch();
|
|
26
30
|
error UserIsNotPresaleStaker();
|
|
27
|
-
error UserMustWaitToFullUnstake();
|
|
28
|
-
error UserMustWaitToStakeAgain();
|
|
29
31
|
error UserPresaleStakerLimitExceeded();
|
|
30
32
|
|
|
31
33
|
function _setupEstimatorAndEvvm(address _estimator, address _evvm) external;
|
|
32
|
-
|
|
33
34
|
function acceptNewAdmin() external;
|
|
34
|
-
|
|
35
35
|
function acceptNewEstimator() external;
|
|
36
|
-
|
|
37
36
|
function acceptNewGoldenFisher() external;
|
|
38
|
-
|
|
39
37
|
function acceptSetSecondsToUnlockStaking() external;
|
|
40
|
-
|
|
41
38
|
function addPresaleStaker(address _staker) external;
|
|
42
|
-
|
|
43
39
|
function addPresaleStakers(address[] memory _stakers) external;
|
|
44
|
-
|
|
45
40
|
function cancelChangeAllowPresaleStaking() external;
|
|
46
|
-
|
|
47
41
|
function cancelChangeAllowPublicStaking() external;
|
|
48
|
-
|
|
49
42
|
function cancelSetSecondsToUnllockFullUnstaking() external;
|
|
50
|
-
|
|
51
43
|
function checkIfStakeNonceUsed(
|
|
52
44
|
address _account,
|
|
53
45
|
uint256 _nonce
|
|
54
46
|
) external view returns (bool);
|
|
55
|
-
|
|
56
47
|
function confirmChangeAllowPresaleStaking() external;
|
|
57
|
-
|
|
58
48
|
function confirmChangeAllowPublicStaking() external;
|
|
59
|
-
|
|
49
|
+
function confirmServiceStaking() external;
|
|
60
50
|
function confirmSetSecondsToUnllockFullUnstaking() external;
|
|
61
|
-
|
|
62
51
|
function getAddressHistory(
|
|
63
52
|
address _account
|
|
64
53
|
) external view returns (HistoryMetadata[] memory);
|
|
65
|
-
|
|
66
54
|
function getAddressHistoryByIndex(
|
|
67
55
|
address _account,
|
|
68
56
|
uint256 _index
|
|
69
57
|
) external view returns (HistoryMetadata memory);
|
|
70
|
-
|
|
71
58
|
function getAllDataOfAllowPublicStaking()
|
|
72
59
|
external
|
|
73
60
|
view
|
|
74
61
|
returns (BoolTypeProposal memory);
|
|
75
|
-
|
|
76
62
|
function getAllowPresaleStaking()
|
|
77
63
|
external
|
|
78
64
|
view
|
|
79
65
|
returns (BoolTypeProposal memory);
|
|
80
|
-
|
|
81
66
|
function getEstimatorAddress() external view returns (address);
|
|
82
|
-
|
|
83
67
|
function getEstimatorProposal() external view returns (address);
|
|
84
|
-
|
|
85
68
|
function getEvvmAddress() external view returns (address);
|
|
86
|
-
|
|
87
69
|
function getGoldenFisher() external view returns (address);
|
|
88
|
-
|
|
89
70
|
function getGoldenFisherProposal() external view returns (address);
|
|
90
|
-
|
|
91
71
|
function getMateAddress() external pure returns (address);
|
|
92
|
-
|
|
93
72
|
function getOwner() external view returns (address);
|
|
94
|
-
|
|
95
73
|
function getPresaleStaker(
|
|
96
74
|
address _account
|
|
97
75
|
) external view returns (bool, uint256);
|
|
98
|
-
|
|
99
76
|
function getPresaleStakerCount() external view returns (uint256);
|
|
100
|
-
|
|
101
77
|
function getSecondsToUnlockFullUnstaking() external view returns (uint256);
|
|
102
|
-
|
|
103
78
|
function getSecondsToUnlockStaking() external view returns (uint256);
|
|
104
|
-
|
|
105
79
|
function getSizeOfAddressHistory(
|
|
106
80
|
address _account
|
|
107
81
|
) external view returns (uint256);
|
|
108
|
-
|
|
109
82
|
function getTimeToUserUnlockFullUnstakingTime(
|
|
110
83
|
address _account
|
|
111
84
|
) external view returns (uint256);
|
|
112
|
-
|
|
113
85
|
function getTimeToUserUnlockStakingTime(
|
|
114
86
|
address _account
|
|
115
87
|
) external view returns (uint256);
|
|
116
|
-
|
|
117
88
|
function getUserAmountStaked(
|
|
118
89
|
address _account
|
|
119
90
|
) external view returns (uint256);
|
|
120
|
-
|
|
121
91
|
function gimmeYiel(
|
|
122
92
|
address user
|
|
123
93
|
)
|
|
@@ -129,21 +99,17 @@ interface IStaking {
|
|
|
129
99
|
uint256 idToOverwriteUserHistory,
|
|
130
100
|
uint256 timestampToBeOverwritten
|
|
131
101
|
);
|
|
132
|
-
|
|
133
102
|
function goldenStaking(
|
|
134
103
|
bool isStaking,
|
|
135
104
|
uint256 amountOfStaking,
|
|
136
105
|
bytes memory signature_EVVM
|
|
137
106
|
) external;
|
|
138
|
-
|
|
139
107
|
function prepareChangeAllowPresaleStaking() external;
|
|
140
|
-
|
|
141
108
|
function prepareChangeAllowPublicStaking() external;
|
|
142
|
-
|
|
109
|
+
function prepareServiceStaking(uint256 amountOfStaking) external;
|
|
143
110
|
function prepareSetSecondsToUnllockFullUnstaking(
|
|
144
111
|
uint256 _secondsToUnllockFullUnstaking
|
|
145
112
|
) external;
|
|
146
|
-
|
|
147
113
|
function presaleStaking(
|
|
148
114
|
address user,
|
|
149
115
|
bool isStaking,
|
|
@@ -154,32 +120,13 @@ interface IStaking {
|
|
|
154
120
|
bool priorityFlag_EVVM,
|
|
155
121
|
bytes memory signature_EVVM
|
|
156
122
|
) external;
|
|
157
|
-
|
|
158
123
|
function priceOfStaking() external pure returns (uint256);
|
|
159
|
-
|
|
160
124
|
function proposeAdmin(address _newAdmin) external;
|
|
161
|
-
|
|
162
125
|
function proposeEstimator(address _estimator) external;
|
|
163
|
-
|
|
164
126
|
function proposeGoldenFisher(address _goldenFisher) external;
|
|
165
|
-
|
|
166
127
|
function proposeSetSecondsToUnlockStaking(
|
|
167
128
|
uint256 _secondsToUnlockStaking
|
|
168
129
|
) external;
|
|
169
|
-
|
|
170
|
-
function publicServiceStaking(
|
|
171
|
-
address user,
|
|
172
|
-
address service,
|
|
173
|
-
bool isStaking,
|
|
174
|
-
uint256 amountOfStaking,
|
|
175
|
-
uint256 nonce,
|
|
176
|
-
bytes memory signature,
|
|
177
|
-
uint256 priorityFee_EVVM,
|
|
178
|
-
uint256 nonce_EVVM,
|
|
179
|
-
bool priorityFlag_EVVM,
|
|
180
|
-
bytes memory signature_EVVM
|
|
181
|
-
) external;
|
|
182
|
-
|
|
183
130
|
function publicStaking(
|
|
184
131
|
address user,
|
|
185
132
|
bool isStaking,
|
|
@@ -191,12 +138,9 @@ interface IStaking {
|
|
|
191
138
|
bool priorityFlag_EVVM,
|
|
192
139
|
bytes memory signature_EVVM
|
|
193
140
|
) external;
|
|
194
|
-
|
|
195
141
|
function rejectProposalAdmin() external;
|
|
196
|
-
|
|
197
142
|
function rejectProposalEstimator() external;
|
|
198
|
-
|
|
199
143
|
function rejectProposalGoldenFisher() external;
|
|
200
|
-
|
|
201
144
|
function rejectProposalSetSecondsToUnlockStaking() external;
|
|
145
|
+
function serviceUnstaking(uint256 amountOfStaking) external;
|
|
202
146
|
}
|
|
@@ -59,7 +59,7 @@ abstract contract StakingServiceHooks {
|
|
|
59
59
|
* @dev CRITICAL: This function ensures atomicity - if any step fails, the entire transaction reverts
|
|
60
60
|
* preventing the loss of Principal Tokens that could occur with manual step-by-step execution
|
|
61
61
|
*/
|
|
62
|
-
function makeStakeService(uint256 amountToStake)
|
|
62
|
+
function makeStakeService(uint256 amountToStake) internal {
|
|
63
63
|
Staking(stakingHookAddress).prepareServiceStaking(amountToStake);
|
|
64
64
|
Evvm(evvmHookAddress).caPay(
|
|
65
65
|
address(stakingHookAddress),
|
|
@@ -84,7 +84,7 @@ abstract contract StakingServiceHooks {
|
|
|
84
84
|
*
|
|
85
85
|
* @dev Unstaking is subject to the same time locks as regular user unstaking
|
|
86
86
|
*/
|
|
87
|
-
function makeUnstakeService(uint256 amountToUnstake)
|
|
87
|
+
function makeUnstakeService(uint256 amountToUnstake) internal {
|
|
88
88
|
Staking(stakingHookAddress).serviceUnstaking(amountToUnstake);
|
|
89
89
|
}
|
|
90
90
|
|
package/package.json
CHANGED