@evvm/testnet-contracts 2.3.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 +44 -24
- package/contracts/core/Core.sol +1392 -0
- package/contracts/core/lib/CoreStorage.sol +171 -0
- package/contracts/nameService/NameService.sol +613 -543
- package/contracts/nameService/lib/IdentityValidation.sol +15 -21
- package/contracts/p2pSwap/P2PSwap.sol +258 -145
- package/contracts/staking/Estimator.sol +25 -44
- package/contracts/staking/Staking.sol +284 -262
- package/contracts/treasury/Treasury.sol +40 -47
- package/contracts/treasuryTwoChains/TreasuryExternalChainStation.sol +585 -198
- package/contracts/treasuryTwoChains/TreasuryHostChainStation.sol +425 -174
- package/contracts/treasuryTwoChains/lib/PayloadUtils.sol +2 -4
- package/interfaces/{IEvvm.sol → ICore.sol} +58 -25
- package/interfaces/IEstimator.sol +1 -1
- package/interfaces/INameService.sol +46 -49
- package/interfaces/IP2PSwap.sol +16 -17
- package/interfaces/IStaking.sol +21 -17
- package/interfaces/ITreasury.sol +2 -1
- package/interfaces/ITreasuryExternalChainStation.sol +15 -9
- package/interfaces/ITreasuryHostChainStation.sol +14 -11
- package/interfaces/IUserValidator.sol +6 -0
- package/library/Erc191TestBuilder.sol +336 -471
- package/library/EvvmService.sol +27 -71
- package/library/errors/CoreError.sol +116 -0
- package/library/errors/CrossChainTreasuryError.sol +36 -0
- package/library/errors/NameServiceError.sol +79 -0
- package/library/errors/StakingError.sol +79 -0
- package/{contracts/treasury/lib/ErrorsLib.sol → library/errors/TreasuryError.sol} +9 -17
- package/library/structs/CoreStructs.sol +146 -0
- package/library/structs/ExternalChainStationStructs.sol +92 -0
- package/library/structs/HostChainStationStructs.sol +77 -0
- package/library/structs/NameServiceStructs.sol +47 -0
- package/library/structs/P2PSwapStructs.sol +127 -0
- package/library/structs/StakingStructs.sol +67 -0
- package/library/utils/AdvancedStrings.sol +62 -44
- package/library/utils/CAUtils.sol +29 -0
- package/library/utils/governance/Admin.sol +66 -0
- package/library/utils/governance/ProposalStructs.sol +49 -0
- package/library/utils/service/CoreExecution.sol +158 -0
- package/library/utils/service/StakingServiceUtils.sol +20 -37
- package/library/utils/signature/CoreHashUtils.sol +73 -0
- package/library/utils/signature/NameServiceHashUtils.sol +156 -0
- package/library/utils/signature/P2PSwapHashUtils.sol +65 -0
- package/library/utils/signature/StakingHashUtils.sol +41 -0
- package/library/utils/signature/TreasuryCrossChainHashUtils.sol +40 -0
- package/package.json +1 -1
- package/contracts/evvm/Evvm.sol +0 -1300
- package/contracts/evvm/lib/ErrorsLib.sol +0 -131
- package/contracts/evvm/lib/EvvmStorage.sol +0 -217
- package/contracts/evvm/lib/EvvmStructs.sol +0 -208
- package/contracts/evvm/lib/SignatureUtils.sol +0 -162
- package/contracts/nameService/lib/ErrorsLib.sol +0 -155
- package/contracts/nameService/lib/NameServiceStructs.sol +0 -125
- package/contracts/nameService/lib/SignatureUtils.sol +0 -420
- package/contracts/p2pSwap/lib/P2PSwapStructs.sol +0 -59
- package/contracts/p2pSwap/lib/SignatureUtils.sol +0 -98
- package/contracts/staking/lib/ErrorsLib.sol +0 -98
- package/contracts/staking/lib/SignatureUtils.sol +0 -105
- package/contracts/staking/lib/StakingStructs.sol +0 -106
- package/contracts/treasuryTwoChains/lib/ErrorsLib.sol +0 -48
- package/contracts/treasuryTwoChains/lib/ExternalChainStationStructs.sol +0 -80
- package/contracts/treasuryTwoChains/lib/HostChainStationStructs.sol +0 -87
- package/contracts/treasuryTwoChains/lib/SignatureUtils.sol +0 -79
- package/library/utils/GovernanceUtils.sol +0 -81
- package/library/utils/nonces/AsyncNonce.sol +0 -74
- package/library/utils/nonces/SyncNonce.sol +0 -71
- package/library/utils/service/EvvmPayments.sol +0 -144
package/README.md
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
# EVVM Testnet Contracts
|
|
2
2
|
|
|
3
|
-

|
|
4
|
+

|
|
5
|
+

|
|
5
6
|

|
|
6
7
|

|
|
7
|
-
[](LICENSE)
|
|
8
|
+
[](LICENSE)
|
|
9
9
|
[](https://www.evvm.info/)
|
|
10
10
|
[](https://www.npmjs.com/package/@evvm/testnet-contracts)
|
|
11
|
-

|
|
11
|
+

|
|
12
12
|
|
|
13
13
|
A compact toolkit for creating virtual EVM chains on testnets.
|
|
14
14
|
|
|
15
15
|
Two ways to use EVVM:
|
|
16
|
+
|
|
16
17
|
1. As a library - Import Solidity contracts in your dApp
|
|
17
18
|
2. As a CLI tool - Deploy and manage EVVM instances on testnets
|
|
18
19
|
|
|
@@ -23,18 +24,21 @@ Docs & hosted library: https://www.evvm.info/
|
|
|
23
24
|
### Install the library (1 min)
|
|
24
25
|
|
|
25
26
|
**NPM (recommended):**
|
|
27
|
+
|
|
26
28
|
```bash
|
|
27
29
|
npm install @evvm/testnet-contracts
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
**Or with Forge:**
|
|
33
|
+
|
|
31
34
|
```bash
|
|
32
35
|
forge install EVVM-org/Testnet-Contracts
|
|
33
36
|
```
|
|
34
37
|
|
|
35
38
|
**Import in your contracts:**
|
|
39
|
+
|
|
36
40
|
```solidity
|
|
37
|
-
import "@evvm/testnet-contracts/interfaces/
|
|
41
|
+
import "@evvm/testnet-contracts/interfaces/ICore.sol";
|
|
38
42
|
```
|
|
39
43
|
|
|
40
44
|
Guide: How to build on top of EVVM: https://www.evvm.info/docs/HowToMakeAEVVMService
|
|
@@ -50,7 +54,9 @@ Before deploying with the CLI, ensure you have the following installed:
|
|
|
50
54
|
- **Git** - [Install](https://git-scm.com/downloads)
|
|
51
55
|
|
|
52
56
|
### Quick start (2 min)
|
|
53
|
-
|
|
57
|
+
|
|
58
|
+
1. Clone & install
|
|
59
|
+
|
|
54
60
|
```bash
|
|
55
61
|
git clone --recursive https://github.com/EVVM-org/Testnet-Contracts
|
|
56
62
|
cd Testnet-Contracts
|
|
@@ -64,30 +70,35 @@ bun install
|
|
|
64
70
|
forge install
|
|
65
71
|
```
|
|
66
72
|
|
|
67
|
-
2
|
|
73
|
+
2. Prepare environment
|
|
74
|
+
|
|
68
75
|
```bash
|
|
69
76
|
cp .env.example .env
|
|
70
77
|
# Edit RPC_URL, ETHERSCAN_API, etc.
|
|
71
78
|
```
|
|
72
79
|
|
|
73
|
-
3
|
|
80
|
+
3. Import wallet (secure)
|
|
81
|
+
|
|
74
82
|
```bash
|
|
75
83
|
cast wallet import defaultKey --interactive
|
|
76
84
|
```
|
|
77
85
|
|
|
78
|
-
4
|
|
86
|
+
4. Deploy (interactive)
|
|
79
87
|
|
|
80
88
|
If you are on Linux or macOS, run:
|
|
89
|
+
|
|
81
90
|
```bash
|
|
82
91
|
./evvm deploy
|
|
83
92
|
```
|
|
84
93
|
|
|
85
94
|
If you are on Windows, run on PowerShell:
|
|
95
|
+
|
|
86
96
|
```powershell
|
|
87
97
|
.\evvm.bat deploy
|
|
88
98
|
```
|
|
89
99
|
|
|
90
100
|
Or use Bun from any directory:
|
|
101
|
+
|
|
91
102
|
```bash
|
|
92
103
|
bun run evvm deploy
|
|
93
104
|
```
|
|
@@ -97,22 +108,24 @@ bun run evvm deploy
|
|
|
97
108
|
The repository includes platform-specific wrapper scripts to easily call the CLI:
|
|
98
109
|
|
|
99
110
|
**Linux/macOS:**
|
|
111
|
+
|
|
100
112
|
```bash
|
|
101
113
|
# Make script executable (first time only)
|
|
102
114
|
chmod +x ./evvm
|
|
103
115
|
|
|
104
116
|
# Run any EVVM CLI command
|
|
105
117
|
./evvm deploy
|
|
106
|
-
./evvm register --
|
|
118
|
+
./evvm register --coreAddress 0x...
|
|
107
119
|
./evvm developer --makeInterface
|
|
108
120
|
./evvm help
|
|
109
121
|
```
|
|
110
122
|
|
|
111
123
|
**Windows (PowerShell):**
|
|
124
|
+
|
|
112
125
|
```powershell
|
|
113
126
|
# Run any EVVM CLI command
|
|
114
127
|
.\evvm.bat deploy
|
|
115
|
-
.\evvm.bat register --
|
|
128
|
+
.\evvm.bat register --coreAddress 0x...
|
|
116
129
|
.\evvm.bat developer --makeInterface
|
|
117
130
|
.\evvm.bat help
|
|
118
131
|
```
|
|
@@ -124,31 +137,36 @@ Quick Start (CLI): https://www.evvm.info/docs/QuickStart
|
|
|
124
137
|
## CLI - Available Commands
|
|
125
138
|
|
|
126
139
|
**Deployment & Registration:**
|
|
127
|
-
|
|
128
|
-
- `evvm deploy
|
|
129
|
-
- `evvm deploy --
|
|
130
|
-
- `evvm
|
|
131
|
-
- `evvm register --
|
|
140
|
+
|
|
141
|
+
- `evvm deploy` # Deploy EVVM (single or cross-chain)
|
|
142
|
+
- `evvm deploy --skipInputConfig` # Deploy with existing config (no prompts)
|
|
143
|
+
- `evvm deploy --crossChain` # Deploy cross-chain EVVM instance
|
|
144
|
+
- `evvm register --coreAddress <addr>` # Register EVVM in registry
|
|
145
|
+
- `evvm register --crossChain` # Register cross-chain EVVM
|
|
132
146
|
|
|
133
147
|
**Cross-Chain Management:**
|
|
134
|
-
|
|
148
|
+
|
|
149
|
+
- `evvm setUpCrossChainTreasuries` # Configure treasury station connections
|
|
135
150
|
|
|
136
151
|
**Developer Utilities:**
|
|
137
|
-
|
|
138
|
-
- `evvm developer --
|
|
139
|
-
- `evvm
|
|
152
|
+
|
|
153
|
+
- `evvm developer --makeInterface` # Generate Solidity interfaces from contracts
|
|
154
|
+
- `evvm developer --runTest` # Run test suites with custom filters
|
|
155
|
+
- `evvm install` # Install Bun and Foundry dependencies
|
|
140
156
|
|
|
141
157
|
**Information:**
|
|
142
|
-
|
|
143
|
-
- `evvm
|
|
158
|
+
|
|
159
|
+
- `evvm help` # Show comprehensive CLI help
|
|
160
|
+
- `evvm version` # Show CLI version
|
|
144
161
|
|
|
145
162
|
## Library Usage (Quick Reference)
|
|
146
163
|
|
|
147
164
|
- **NPM install:** `npm install @evvm/testnet-contracts`
|
|
148
165
|
- **Forge install:** `forge install EVVM-org/Testnet-Contracts`
|
|
149
|
-
- **Import in Solidity:** `import "@evvm/testnet-contracts/interfaces/
|
|
166
|
+
- **Import in Solidity:** `import "@evvm/testnet-contracts/interfaces/ICore.sol";`
|
|
150
167
|
|
|
151
168
|
## Troubleshooting
|
|
169
|
+
|
|
152
170
|
- **RPC timeouts**: CLI automatically tries fallback RPCs; set `RPC_URL` in `.env` to a reliable endpoint.
|
|
153
171
|
- **Wallet not found**: import with `cast wallet import <name> --interactive`.
|
|
154
172
|
- **Bun missing**: install Bun (`curl -fsSL https://bun.sh/install | bash`).
|
|
@@ -157,6 +175,7 @@ Quick Start (CLI): https://www.evvm.info/docs/QuickStart
|
|
|
157
175
|
- **Wrong architecture detected**: The wrapper scripts auto-detect OS/architecture. If issues occur, manually run the correct binary from `.executables/`.
|
|
158
176
|
|
|
159
177
|
Files & structure (short)
|
|
178
|
+
|
|
160
179
|
- `src/contracts/` — core contracts (Evvm, NameService, Staking, Treasury, P2PSwap)
|
|
161
180
|
- `cli/` — TypeScript CLI source
|
|
162
181
|
- `script/` — Foundry deployment scripts
|
|
@@ -189,6 +208,7 @@ We welcome contributions from the community! Here's how you can help:
|
|
|
189
208
|
- **Commit Messages**: Write clear, descriptive commit messages
|
|
190
209
|
|
|
191
210
|
## Security Best Practices
|
|
211
|
+
|
|
192
212
|
- **Never commit private keys**: Always use `cast wallet import <YOUR_ALIAS> --interactive` to securely store your keys
|
|
193
213
|
- **Use test credentials only**: This repository is for testnet deployment only
|
|
194
214
|
- **Environment variables**: Store sensitive data like API keys in `.env` files (not committed to git)
|