@evvm/testnet-contracts 2.1.1 → 2.1.3
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 +195 -17
- package/contracts/evvm/Evvm.sol +2 -3
- package/contracts/evvm/EvvmLegacy.sol +1 -1
- package/contracts/evvm/lib/SignatureUtils.sol +0 -1
- package/contracts/nameService/NameService.sol +3 -3
- package/contracts/p2pSwap/P2PSwap.sol +6 -6
- package/contracts/staking/Estimator.sol +4 -4
- package/contracts/staking/Staking.sol +8 -8
- package/contracts/treasuryTwoChains/TreasuryExternalChainStation.sol +302 -52
- package/contracts/treasuryTwoChains/TreasuryHostChainStation.sol +288 -63
- package/contracts/treasuryTwoChains/lib/ErrorsLib.sol +31 -0
- package/contracts/treasuryTwoChains/lib/ExternalChainStationStructs.sol +50 -0
- package/contracts/treasuryTwoChains/lib/HostChainStationStructs.sol +47 -8
- package/contracts/treasuryTwoChains/lib/PayloadUtils.sol +42 -0
- package/contracts/treasuryTwoChains/lib/SignatureUtils.sol +41 -7
- package/interfaces/ITreasuryExternalChainStation.sol +34 -130
- package/interfaces/ITreasuryHostChainStation.sol +35 -124
- package/package.json +16 -4
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
pragma solidity ^0.8.0;
|
|
1
|
+
// SPDX-License-Identifier: UNLICENSED
|
|
2
|
+
pragma solidity ^0.8.4;
|
|
5
3
|
|
|
6
4
|
library HostChainStationStructs {
|
|
7
5
|
struct AddressTypeProposal {
|
|
@@ -40,7 +38,7 @@ library HostChainStationStructs {
|
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
interface
|
|
41
|
+
interface TreasuryHostChainStation {
|
|
44
42
|
struct EnforcedOptionParam {
|
|
45
43
|
uint32 eid;
|
|
46
44
|
uint16 msgType;
|
|
@@ -87,40 +85,25 @@ interface ITreasuryHostChainStation {
|
|
|
87
85
|
uint256 amount,
|
|
88
86
|
uint256 nonce
|
|
89
87
|
);
|
|
90
|
-
event OwnershipTransferred(
|
|
91
|
-
address indexed previousOwner,
|
|
92
|
-
address indexed newOwner
|
|
93
|
-
);
|
|
88
|
+
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
|
|
94
89
|
event PeerSet(uint32 eid, bytes32 peer);
|
|
95
90
|
|
|
91
|
+
function _setExternalChainAddress(
|
|
92
|
+
address externalChainStationAddress,
|
|
93
|
+
string memory externalChainStationAddressString
|
|
94
|
+
) external;
|
|
96
95
|
function acceptAdmin() external;
|
|
97
|
-
|
|
96
|
+
function acceptExternalChainAddress() external;
|
|
98
97
|
function acceptFisherExecutor() external;
|
|
99
|
-
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
function combineOptions(
|
|
105
|
-
uint32 _eid,
|
|
106
|
-
uint16 _msgType,
|
|
107
|
-
bytes memory _extraOptions
|
|
108
|
-
) external view returns (bytes memory);
|
|
109
|
-
|
|
98
|
+
function allowInitializePath(Origin memory origin) external view returns (bool);
|
|
99
|
+
function combineOptions(uint32 _eid, uint16 _msgType, bytes memory _extraOptions)
|
|
100
|
+
external
|
|
101
|
+
view
|
|
102
|
+
returns (bytes memory);
|
|
110
103
|
function endpoint() external view returns (address);
|
|
111
|
-
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
uint16 msgType
|
|
115
|
-
) external view returns (bytes memory enforcedOption);
|
|
116
|
-
|
|
117
|
-
function execute(
|
|
118
|
-
bytes32 commandId,
|
|
119
|
-
string memory sourceChain,
|
|
120
|
-
string memory sourceAddress,
|
|
121
|
-
bytes memory payload
|
|
122
|
-
) external;
|
|
123
|
-
|
|
104
|
+
function enforcedOptions(uint32 eid, uint16 msgType) external view returns (bytes memory enforcedOption);
|
|
105
|
+
function execute(bytes32 commandId, string memory sourceChain, string memory sourceAddress, bytes memory payload)
|
|
106
|
+
external;
|
|
124
107
|
function fisherBridgeReceive(
|
|
125
108
|
address from,
|
|
126
109
|
address addressToReceive,
|
|
@@ -129,7 +112,6 @@ interface ITreasuryHostChainStation {
|
|
|
129
112
|
uint256 amount,
|
|
130
113
|
bytes memory signature
|
|
131
114
|
) external;
|
|
132
|
-
|
|
133
115
|
function fisherBridgeSend(
|
|
134
116
|
address from,
|
|
135
117
|
address addressToReceive,
|
|
@@ -138,60 +120,18 @@ interface ITreasuryHostChainStation {
|
|
|
138
120
|
uint256 amount,
|
|
139
121
|
bytes memory signature
|
|
140
122
|
) external;
|
|
141
|
-
|
|
142
123
|
function gateway() external view returns (address);
|
|
143
|
-
|
|
144
|
-
function
|
|
145
|
-
external
|
|
146
|
-
view
|
|
147
|
-
returns (HostChainStationStructs.AddressTypeProposal memory);
|
|
148
|
-
|
|
149
|
-
function getAxelarConfig()
|
|
150
|
-
external
|
|
151
|
-
view
|
|
152
|
-
returns (HostChainStationStructs.AxelarConfig memory);
|
|
153
|
-
|
|
124
|
+
function getAdmin() external view returns (HostChainStationStructs.AddressTypeProposal memory);
|
|
125
|
+
function getAxelarConfig() external view returns (HostChainStationStructs.AxelarConfig memory);
|
|
154
126
|
function getEvvmAddress() external view returns (address);
|
|
155
|
-
|
|
156
|
-
function
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
returns (HostChainStationStructs.AddressTypeProposal memory);
|
|
160
|
-
|
|
161
|
-
function getHyperlaneConfig()
|
|
162
|
-
external
|
|
163
|
-
view
|
|
164
|
-
returns (HostChainStationStructs.HyperlaneConfig memory);
|
|
165
|
-
|
|
166
|
-
function getLayerZeroConfig()
|
|
167
|
-
external
|
|
168
|
-
view
|
|
169
|
-
returns (HostChainStationStructs.LayerZeroConfig memory);
|
|
170
|
-
|
|
171
|
-
function getNextFisherExecutionNonce(
|
|
172
|
-
address user
|
|
173
|
-
) external view returns (uint256);
|
|
174
|
-
|
|
127
|
+
function getFisherExecutor() external view returns (HostChainStationStructs.AddressTypeProposal memory);
|
|
128
|
+
function getHyperlaneConfig() external view returns (HostChainStationStructs.HyperlaneConfig memory);
|
|
129
|
+
function getLayerZeroConfig() external view returns (HostChainStationStructs.LayerZeroConfig memory);
|
|
130
|
+
function getNextFisherExecutionNonce(address user) external view returns (uint256);
|
|
175
131
|
function getOptions() external view returns (bytes memory);
|
|
176
|
-
|
|
177
|
-
function
|
|
178
|
-
|
|
179
|
-
address token,
|
|
180
|
-
uint256 amount
|
|
181
|
-
) external view returns (uint256);
|
|
182
|
-
|
|
183
|
-
function handle(
|
|
184
|
-
uint32 _origin,
|
|
185
|
-
bytes32 _sender,
|
|
186
|
-
bytes memory _data
|
|
187
|
-
) external payable;
|
|
188
|
-
|
|
189
|
-
function isComposeMsgSender(
|
|
190
|
-
Origin memory,
|
|
191
|
-
bytes memory,
|
|
192
|
-
address _sender
|
|
193
|
-
) external view returns (bool);
|
|
194
|
-
|
|
132
|
+
function getQuoteHyperlane(address toAddress, address token, uint256 amount) external view returns (uint256);
|
|
133
|
+
function handle(uint32 _origin, bytes32 _sender, bytes memory _data) external payable;
|
|
134
|
+
function isComposeMsgSender(Origin memory, bytes memory, address _sender) external view returns (bool);
|
|
195
135
|
function lzReceive(
|
|
196
136
|
Origin memory _origin,
|
|
197
137
|
bytes32 _guid,
|
|
@@ -199,53 +139,24 @@ interface ITreasuryHostChainStation {
|
|
|
199
139
|
address _executor,
|
|
200
140
|
bytes memory _extraData
|
|
201
141
|
) external payable;
|
|
202
|
-
|
|
203
142
|
function nextNonce(uint32, bytes32) external view returns (uint64 nonce);
|
|
204
|
-
|
|
205
|
-
function oAppVersion()
|
|
206
|
-
external
|
|
207
|
-
pure
|
|
208
|
-
returns (uint64 senderVersion, uint64 receiverVersion);
|
|
209
|
-
|
|
143
|
+
function oAppVersion() external pure returns (uint64 senderVersion, uint64 receiverVersion);
|
|
210
144
|
function owner() external view returns (address);
|
|
211
|
-
|
|
212
145
|
function peers(uint32 eid) external view returns (bytes32 peer);
|
|
213
|
-
|
|
214
146
|
function proposeAdmin(address _newOwner) external;
|
|
215
|
-
|
|
147
|
+
function proposeExternalChainAddress(
|
|
148
|
+
address externalChainStationAddress,
|
|
149
|
+
string memory externalChainStationAddressString
|
|
150
|
+
) external;
|
|
216
151
|
function proposeFisherExecutor(address _newFisherExecutor) external;
|
|
217
|
-
|
|
218
|
-
function quoteLayerZero(
|
|
219
|
-
address toAddress,
|
|
220
|
-
address token,
|
|
221
|
-
uint256 amount
|
|
222
|
-
) external view returns (uint256);
|
|
223
|
-
|
|
152
|
+
function quoteLayerZero(address toAddress, address token, uint256 amount) external view returns (uint256);
|
|
224
153
|
function rejectProposalAdmin() external;
|
|
225
|
-
|
|
154
|
+
function rejectProposalExternalChainAddress() external;
|
|
226
155
|
function rejectProposalFisherExecutor() external;
|
|
227
|
-
|
|
228
156
|
function renounceOwnership() external;
|
|
229
|
-
|
|
230
157
|
function setDelegate(address _delegate) external;
|
|
231
|
-
|
|
232
|
-
function setEnforcedOptions(
|
|
233
|
-
EnforcedOptionParam[] memory _enforcedOptions
|
|
234
|
-
) external;
|
|
235
|
-
|
|
236
|
-
function setExternalChainAddress(
|
|
237
|
-
address externalChainStationAddress,
|
|
238
|
-
string memory externalChainStationAddressString
|
|
239
|
-
) external;
|
|
240
|
-
|
|
158
|
+
function setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) external;
|
|
241
159
|
function setPeer(uint32 _eid, bytes32 _peer) external;
|
|
242
|
-
|
|
243
160
|
function transferOwnership(address newOwner) external;
|
|
244
|
-
|
|
245
|
-
function withdraw(
|
|
246
|
-
address toAddress,
|
|
247
|
-
address token,
|
|
248
|
-
uint256 amount,
|
|
249
|
-
bytes1 protocolToExecute
|
|
250
|
-
) external payable;
|
|
161
|
+
function withdraw(address toAddress, address token, uint256 amount, bytes1 protocolToExecute) external payable;
|
|
251
162
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evvm/testnet-contracts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "EVVM Testnet Contracts - Smart contracts and tools for scalable, modular, and cross-chain EVM virtualization",
|
|
5
6
|
"files": [
|
|
6
7
|
"contracts/**/*.sol",
|
|
@@ -44,15 +45,26 @@
|
|
|
44
45
|
"test": "forge test",
|
|
45
46
|
"deploy:anvil": "make deployLocalTestnet",
|
|
46
47
|
"deploy:sepolia": "make deployTestnet NETWORK=eth",
|
|
47
|
-
"deploy:arbitrum": "make deployTestnet NETWORK=arb"
|
|
48
|
+
"deploy:arbitrum": "make deployTestnet NETWORK=arb",
|
|
49
|
+
"wizard": "tsx scripts/evvm-init.ts",
|
|
50
|
+
"wizard:deploy": "tsx scripts/evvm-init.ts --deploy"
|
|
48
51
|
},
|
|
49
52
|
"peerDependencies": {
|
|
50
53
|
"@openzeppelin/contracts": "^5.0.0"
|
|
51
54
|
},
|
|
52
55
|
"dependencies": {
|
|
53
|
-
"@hyperlane-xyz/core": "^3.6.1"
|
|
56
|
+
"@hyperlane-xyz/core": "^3.6.1",
|
|
57
|
+
"chalk": "^5.3.0",
|
|
58
|
+
"dotenv": "^16.4.5",
|
|
59
|
+
"execa": "^8.0.1",
|
|
60
|
+
"prompts": "^2.4.2",
|
|
61
|
+
"viem": "^2.39.0"
|
|
54
62
|
},
|
|
55
63
|
"devDependencies": {
|
|
56
|
-
"
|
|
64
|
+
"@types/node": "^20.11.0",
|
|
65
|
+
"@types/prompts": "^2.4.9",
|
|
66
|
+
"forge-std": "^1.0.0",
|
|
67
|
+
"tsx": "^4.7.0",
|
|
68
|
+
"typescript": "^5.3.0"
|
|
57
69
|
}
|
|
58
70
|
}
|