@evvm/testnet-contracts 3.0.0 → 3.0.1
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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# EVVM Testnet Contracts
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|

|
|
5
5
|

|
|
6
6
|

|
package/contracts/core/Core.sol
CHANGED
|
@@ -688,17 +688,15 @@ contract Core is Storage {
|
|
|
688
688
|
* - Canceling pending service operations
|
|
689
689
|
* - Correcting accidental reservations
|
|
690
690
|
* - Freeing nonces for different services
|
|
691
|
-
*
|
|
692
|
-
* @param user Address that reserved the nonce
|
|
693
691
|
* @param nonce The async nonce to revoke reservation for
|
|
694
692
|
*/
|
|
695
|
-
function revokeAsyncNonce(
|
|
696
|
-
if (asyncNonce[
|
|
693
|
+
function revokeAsyncNonce(uint256 nonce) external {
|
|
694
|
+
if (asyncNonce[msg.sender][nonce]) revert Error.AsyncNonceAlreadyUsed();
|
|
697
695
|
|
|
698
|
-
if (asyncNonceReservedPointers[
|
|
696
|
+
if (asyncNonceReservedPointers[msg.sender][nonce] == address(0))
|
|
699
697
|
revert Error.AsyncNonceNotReserved();
|
|
700
698
|
|
|
701
|
-
asyncNonceReservedPointers[
|
|
699
|
+
asyncNonceReservedPointers[msg.sender][nonce] = address(0);
|
|
702
700
|
}
|
|
703
701
|
|
|
704
702
|
//░▒▓█ UserValidator Management Functions █████████████████████████████████████▓▒░
|
package/interfaces/ICore.sol
CHANGED
|
@@ -145,7 +145,7 @@ interface ICore {
|
|
|
145
145
|
function rejectUpgrade() external;
|
|
146
146
|
function removeAmountFromUser(address user, address token, uint256 amount) external;
|
|
147
147
|
function reserveAsyncNonce(uint256 nonce, address serviceAddress) external;
|
|
148
|
-
function revokeAsyncNonce(
|
|
148
|
+
function revokeAsyncNonce(uint256 nonce) external;
|
|
149
149
|
function setEvvmID(uint256 newEvvmID) external;
|
|
150
150
|
function setPointStaker(address user, bytes1 answer) external;
|
|
151
151
|
function validateAndConsumeNonce(
|
package/interfaces/IP2PSwap.sol
CHANGED
|
@@ -133,8 +133,6 @@ interface IP2PSwap {
|
|
|
133
133
|
function rejectProposeOwner() external;
|
|
134
134
|
function rejectProposePercentageFee() external;
|
|
135
135
|
function rejectProposeWithdrawal() external;
|
|
136
|
-
function reserveAsyncNonceToService(uint256 nonce) external;
|
|
137
|
-
function revokeAsyncNonceToService(address user, uint256 nonce) external;
|
|
138
136
|
function stake(uint256 amount) external;
|
|
139
137
|
function unstake(uint256 amount) external;
|
|
140
138
|
}
|
|
@@ -121,25 +121,6 @@ abstract contract CoreExecution {
|
|
|
121
121
|
core.disperseCaPay(toData, token, amount);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
/**
|
|
125
|
-
* @notice Reserves async nonce for user and this service exclusively
|
|
126
|
-
* @dev Calls core.reserveAsyncNonce(user, nonce, address(this)). Nonce can be revoked before use.
|
|
127
|
-
* @param nonce Async nonce number to reserve
|
|
128
|
-
*/
|
|
129
|
-
function reserveAsyncNonceToService(uint256 nonce) external {
|
|
130
|
-
core.reserveAsyncNonce(nonce, address(this));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @notice Revokes reserved async nonce before use
|
|
135
|
-
* @dev Calls core.revokeAsyncNonce(user, nonce). Cannot revoke consumed nonces.
|
|
136
|
-
* @param user User address that reserved nonce
|
|
137
|
-
* @param nonce Async nonce number to revoke
|
|
138
|
-
*/
|
|
139
|
-
function revokeAsyncNonceToService(address user, uint256 nonce) external {
|
|
140
|
-
core.revokeAsyncNonce(user, nonce);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
124
|
/**
|
|
144
125
|
* @notice Gets next sequential sync nonce for user
|
|
145
126
|
* @dev View function returning core.getNextCurrentSyncNonce(user). Auto-increments after each use.
|
package/package.json
CHANGED