@evvm/testnet-contracts 2.1.2 → 2.2.0

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.
Files changed (32) hide show
  1. package/README.md +195 -17
  2. package/contracts/evvm/Evvm.sol +13 -10
  3. package/contracts/evvm/lib/EvvmStorage.sol +2 -0
  4. package/contracts/evvm/lib/SignatureUtils.sol +12 -13
  5. package/contracts/nameService/NameService.sol +11 -8
  6. package/contracts/nameService/lib/ErrorsLib.sol +1 -1
  7. package/contracts/nameService/lib/SignatureUtils.sol +38 -39
  8. package/contracts/p2pSwap/P2PSwap.sol +14 -382
  9. package/contracts/p2pSwap/lib/SignatureUtils.sol +15 -16
  10. package/contracts/staking/Estimator.sol +4 -4
  11. package/contracts/staking/Staking.sol +28 -17
  12. package/contracts/staking/lib/ErrorsLib.sol +0 -1
  13. package/contracts/staking/lib/SignatureUtils.sol +6 -34
  14. package/contracts/treasuryTwoChains/TreasuryExternalChainStation.sol +3 -3
  15. package/contracts/treasuryTwoChains/TreasuryHostChainStation.sol +3 -3
  16. package/contracts/treasuryTwoChains/lib/SignatureUtils.sol +7 -7
  17. package/interfaces/IStaking.sol +1 -1
  18. package/library/Erc191TestBuilder.sol +57 -57
  19. package/library/EvvmService.sol +104 -0
  20. package/library/primitives/Math.sol +415 -0
  21. package/library/primitives/SignatureRecover.sol +42 -0
  22. package/library/utils/AdvancedStrings.sol +89 -0
  23. package/library/utils/SignatureUtil.sol +29 -0
  24. package/library/utils/service/AsyncNonceService.sol +34 -0
  25. package/library/utils/service/MakeServicePaymentOnEvvm.sol +49 -0
  26. package/library/utils/service/StakingServiceUtils.sol +37 -0
  27. package/library/utils/service/SyncNonceService.sol +18 -0
  28. package/package.json +16 -4
  29. package/contracts/evvm/EvvmLegacy.sol +0 -1553
  30. package/library/AdvancedStrings.sol +0 -77
  31. package/library/SignatureRecover.sol +0 -140
  32. package/library/StakingServiceHooks.sol +0 -116
package/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # EVVM Testnet Contracts
2
2
 
3
- ![](https://github.com/user-attachments/assets/08d995ee-7512-42e4-a26c-0d62d2e8e0bf)
4
-
5
3
  EVVM is an innovative blockchain virtualization system that allows you to create and deploy your own virtual blockchains on top of existing Ethereum networks where you can:
6
4
 
7
5
  - **Create your own virtual blockchain** with custom tokens and governance
@@ -15,10 +13,26 @@ EVVM provides a complete ecosystem of smart contracts:
15
13
  - **Core EVVM**: Your virtual blockchain's main engine
16
14
  - **NameService**: Domain name system for your blockchain (like ENS)
17
15
  - **Staking**: Token staking and rewards system
18
- - **Treasury**: Secure fund management inside the host chain or across chains
16
+ - **Treasury**: Secure fund management inside the host chain or across chains
19
17
  - **Estimator**: Reward calculation and optimization
20
18
  - **P2PSwap**: Peer-to-peer token exchange service with automated market making
21
19
 
20
+ ## Latest Features
21
+
22
+ **Enhanced Deployment Experience:**
23
+ - **Interactive TypeScript Wizard**: Modern, user-friendly deployment wizard with comprehensive guidance
24
+ - **Automatic RPC Fallback**: 99%+ deployment success rate with 5 fallback RPCs per network
25
+ - **Deployment Summary**: Instant access to all deployed contract addresses with explorer links
26
+ - **Auto Registry Integration**: Automatic EVVM registration and ID configuration
27
+ - **Smart Prerequisites Check**: Automatic dependency initialization and validation
28
+ - **Multi-Wallet Support**: Easy selection from your Foundry keystores
29
+
30
+ **Reliability Improvements:**
31
+ - Intelligent retry mechanism for network failures
32
+ - Comprehensive error handling and troubleshooting guides
33
+ - Verified high-performance RPC endpoints
34
+ - Zero-configuration setup for most users
35
+
22
36
  ## Use Cases
23
37
 
24
38
  This repository serves two main purposes:
@@ -218,27 +232,35 @@ forge install hyperlane-xyz/hyperlane-monorepo # For cross-chain functionality
218
232
  - `src/contracts/treasury/` — Treasury contract for managing deposits and withdrawals
219
233
  - `src/contracts/p2pSwap/` — P2P token exchange service contracts
220
234
  - `src/lib/` — Shared Solidity libraries (AdvancedStrings, SignatureRecover, etc.)
221
- - `script/` — Deployment and automation scripts (e.g., `DeployTestnet.s.sol`)
235
+ - `script/` — Foundry deployment scripts (e.g., `DeployTestnet.s.sol`)
236
+ - `scripts/` — TypeScript utilities and deployment wizard (`evvm-init.ts`)
222
237
  - `lib/` — External dependencies (OpenZeppelin, Uniswap v3, forge-std)
223
238
  - `broadcast/` — Foundry deployment artifacts and transaction history
224
239
  - `cache/` — Foundry compilation cache
225
- - `input/` — Configuration files for deployment (generated by `evvm-init.sh`)
226
- - `evvm-init.sh` — Interactive setup and deployment script
240
+ - `input/` — Configuration files for deployment (generated by wizard)
241
+ - `evvm-init.sh` — Legacy bash wizard (deprecated, use `npm run wizard` instead)
227
242
 
228
243
  ## Prerequisites
229
244
  - [Foundry](https://getfoundry.sh/) (Solidity development toolkit)
230
- - Node.js (if using npm installation method)
231
- - Bash shell (for running `evvm-init.sh`)
245
+ - [Node.js](https://nodejs.org/) v16 or higher (required for deployment wizard)
246
+ - Git (for cloning and managing the repository)
232
247
  - Environment variables set up (`.env` file with API keys and RPC URLs)
233
248
 
234
249
  ### Environment Setup
235
250
  Create a `.env` file with your configuration:
236
251
  ```bash
237
- RPC_URL_ETH_SEPOLIA=<YOUR_ETH_SEPOLIA_RPC_URL>
238
- RPC_URL_ARB_SEPOLIA=<YOUR_ARB_SEPOLIA_RPC_URL>
252
+ # Ethereum Sepolia RPC (primary endpoint)
253
+ RPC_URL_ETH_SEPOLIA=https://0xrpc.io/sep
254
+
255
+ # Arbitrum Sepolia RPC (primary endpoint)
256
+ RPC_URL_ARB_SEPOLIA=https://sepolia-rollup.arbitrum.io/rpc
257
+
258
+ # Etherscan API key for contract verification
239
259
  ETHERSCAN_API=<YOUR_ETHERSCAN_API_KEY>
240
260
  ```
241
261
 
262
+ **Note**: The deployment wizard includes automatic RPC fallback mechanisms. If your primary RPC endpoint fails, it will automatically try alternative endpoints to ensure deployment success. See the [RPC Reliability](#rpc-reliability) section for details.
263
+
242
264
  ### Security Setup - Import Private Key
243
265
  Before deploying to testnets, securely import your private key using Foundry:
244
266
  ```bash
@@ -280,17 +302,33 @@ cast wallet import defaultKey --interactive
280
302
 
281
303
  ### 4. Interactive Setup & Deploy
282
304
  ```bash
283
- ./evvm-init.sh
305
+ npm run wizard
284
306
  ```
285
307
 
286
- The wizard will configure:
308
+ The interactive deployment wizard will guide you through:
309
+ - **Prerequisites check** (Foundry, Git, Node.js)
310
+ - **Dependency initialization** (git submodules - automatic)
287
311
  - **Administrator addresses** (admin, golden fisher, activator)
288
- - **EVVM metadata** (name, ID, principal token details)
312
+ - **EVVM metadata** (name, principal token details)
289
313
  - **Advanced parameters** (supply, rewards) - optional
290
- - **Network selection** (Ethereum Sepolia, Arbitrum Sepolia, or custom)
314
+ - **Network selection** (Ethereum Sepolia, Arbitrum Sepolia, or custom RPC)
315
+ - **Wallet selection** (from your Foundry keystores)
291
316
  - **Automatic deployment** with contract verification
292
-
293
- That's it! Your EVVM virtual blockchain is now deployed and verified on your chosen host blockchain.
317
+ - **Deployment summary** with all contract addresses and explorer links
318
+ - **Registry EVVM registration** (automatic for supported networks)
319
+ - **EVVM ID configuration** (automatic setup)
320
+
321
+ **What happens after deployment:**
322
+ - All 6 core contracts deployed and verified on your chosen network
323
+ - Complete deployment summary displayed with:
324
+ - EVVM Core contract address
325
+ - Treasury contract address
326
+ - Staking, Estimator, NameService, and P2PSwap addresses
327
+ - Direct links to block explorer for each contract
328
+ - Automatic registration with Registry EVVM (Ethereum Sepolia)
329
+ - EVVM ID assigned and configured
330
+
331
+ That's it! Your EVVM virtual blockchain is now deployed, verified, and ready to use.
294
332
 
295
333
  ## Manual Configuration (Alternative)
296
334
 
@@ -360,6 +398,144 @@ make seeSizes # Check contract sizes
360
398
  make help # Show all available commands
361
399
  ```
362
400
 
401
+ ### NPM Scripts
402
+ ```bash
403
+ npm run wizard # Run interactive deployment wizard (recommended)
404
+ npm run build # Copy src/ files to root (for NPM publishing)
405
+ npm run clean # Remove copied files from root
406
+ npm run compile # forge build
407
+ npm run test # forge test
408
+ npm run deploy:anvil # Deploy to local Anvil
409
+ npm run deploy:sepolia # Deploy to Ethereum Sepolia
410
+ npm run deploy:arbitrum # Deploy to Arbitrum Sepolia
411
+ ```
412
+
413
+ ## RPC Reliability
414
+
415
+ The deployment wizard includes an intelligent RPC fallback mechanism to ensure maximum deployment success rates, even when individual RPC providers experience downtime.
416
+
417
+ ### How It Works
418
+
419
+ **Automatic Failover**: If your primary RPC endpoint fails, the wizard automatically tries alternative endpoints without user intervention.
420
+
421
+ **Multi-Provider Support**: Each network has 5 verified RPC endpoints:
422
+
423
+ **Ethereum Sepolia Fallback Chain:**
424
+ 1. `https://0xrpc.io/sep` (Primary)
425
+ 2. `https://ethereum-sepolia.rpc.subquery.network/public` (0.165s latency)
426
+ 3. `https://ethereum-sepolia.gateway.tatum.io` (0.172s latency)
427
+ 4. `https://sepolia.drpc.org` (0.192s latency)
428
+ 5. `https://gateway.tenderly.co/public/sepolia` (0.184s latency)
429
+
430
+ **Arbitrum Sepolia Fallback Chain:**
431
+ 1. `https://sepolia-rollup.arbitrum.io/rpc` (Official Arbitrum)
432
+ 2. `https://arbitrum-sepolia.gateway.tenderly.co` (0.167s latency)
433
+ 3. `https://endpoints.omniatech.io/v1/arbitrum/sepolia/public` (0.258s latency)
434
+ 4. `https://arbitrum-sepolia.drpc.org` (0.590s latency)
435
+ 5. `https://arbitrum-sepolia-rpc.publicnode.com` (0.430s latency)
436
+
437
+ **Smart Retry Logic**: The wizard displays clear progress messages during fallback attempts and provides troubleshooting tips if all endpoints fail.
438
+
439
+ ### Benefits
440
+ - **99%+ success rate** through endpoint redundancy
441
+ - **Zero configuration** required for most users
442
+ - **Automatic recovery** from individual RPC failures
443
+ - **Clear visibility** into which RPC is being used
444
+ - **Future-proof** against provider outages
445
+
446
+ ## Deployment Summary
447
+
448
+ After successful deployment, the wizard displays a comprehensive summary of all deployed contracts:
449
+
450
+ ```
451
+ ═══════════════════════════════════════════════════════════
452
+ DEPLOYED CONTRACTS SUMMARY
453
+ ═══════════════════════════════════════════════════════════
454
+
455
+ Network: Ethereum Sepolia (Chain ID: 11155111)
456
+
457
+ Core Contracts:
458
+ EVVM: 0xb0994626541c9bd3d64605dee610386c7a005a39
459
+ https://sepolia.etherscan.io/address/0xb099...
460
+ Treasury: 0x47be342c4d803490530737cac7bcf34916cf7e80
461
+ https://sepolia.etherscan.io/address/0x47be...
462
+
463
+ Supporting Contracts:
464
+ Staking: 0xc2cd4ec40bb4fa6f98c7b7095f692588e6b68fd4
465
+ Estimator: 0x1adf3fd08f0744f24bb29bbfcfb57a5f37f144cb
466
+ NameService: 0xe28eedff481b7c640394f44070309a0afe06de00
467
+ P2PSwap: 0xc90dc57d848fae4ecf46268b8a90015085968645
468
+
469
+ ═══════════════════════════════════════════════════════════
470
+ ```
471
+
472
+ This summary includes:
473
+ - Network name and chain ID
474
+ - All 6 deployed contract addresses
475
+ - Direct links to block explorer for verification
476
+ - Organized by contract importance (Core vs Supporting)
477
+
478
+ ## Troubleshooting
479
+
480
+ ### RPC Connection Issues
481
+
482
+ **Problem**: Deployment fails with "Connection timed out" or "HTTP error 522"
483
+
484
+ **Solution**: The wizard automatically tries fallback RPCs. If all fail:
485
+ 1. Check your internet connection
486
+ 2. Verify firewall/VPN settings aren't blocking RPC endpoints
487
+ 3. Try again later (temporary provider downtime)
488
+ 4. Update your `.env` file with a custom RPC from [chainlist.org](https://chainlist.org/)
489
+
490
+ ### Wallet Not Found
491
+
492
+ **Problem**: "No wallets found" error during deployment
493
+
494
+ **Solution**:
495
+ ```bash
496
+ cast wallet import <WALLET_NAME> --interactive
497
+ ```
498
+ Then run the wizard again and select your imported wallet.
499
+
500
+ ### Insufficient Funds
501
+
502
+ **Problem**: Deployment fails with "insufficient funds for gas"
503
+
504
+ **Solution**:
505
+ 1. Get testnet ETH from faucets:
506
+ - Ethereum Sepolia: [sepoliafaucet.com](https://sepoliafaucet.com/)
507
+ - Arbitrum Sepolia: [faucet.quicknode.com/arbitrum/sepolia](https://faucet.quicknode.com/arbitrum/sepolia)
508
+ 2. Verify your wallet address has received funds
509
+ 3. Run the wizard again
510
+
511
+ ### Git Submodules Not Initialized
512
+
513
+ **Problem**: Compilation fails with missing dependencies
514
+
515
+ **Solution**: The wizard automatically initializes submodules, but you can also do it manually:
516
+ ```bash
517
+ git submodule update --init --recursive
518
+ ```
519
+
520
+ ### Contract Size Too Large
521
+
522
+ **Problem**: "Contract code size exceeds 24576 bytes"
523
+
524
+ **Solution**: The project uses `via-ir` optimization to stay under limits. If you modified contracts:
525
+ ```bash
526
+ make seeSizes # Check contract sizes
527
+ ```
528
+ Consider refactoring large contracts or using libraries.
529
+
530
+ ### TypeScript/TSX Not Found
531
+
532
+ **Problem**: `npm run wizard` fails with "tsx: command not found"
533
+
534
+ **Solution**:
535
+ ```bash
536
+ npm install # Reinstall dependencies
537
+ ```
538
+
363
539
  ## Contract Architecture
364
540
  The EVVM ecosystem consists of six main contracts:
365
541
  - **Evvm.sol**: Core virtual machine implementation
@@ -372,10 +548,12 @@ The EVVM ecosystem consists of six main contracts:
372
548
 
373
549
  ## Configuration Files
374
550
  Key files for EVVM deployment:
375
- - `evvm-init.sh` — Interactive setup wizard
551
+ - `scripts/evvm-init.ts` — Interactive TypeScript deployment wizard (run with `npm run wizard`)
376
552
  - `input/` — Generated configuration files (address.json, evvmBasicMetadata.json, evvmAdvancedMetadata.json)
553
+ - `.env` — Environment variables (RPC URLs, API keys)
377
554
  - `foundry.toml` — Foundry project configuration
378
555
  - `makefile` — Build and deployment automation
556
+ - `package.json` — NPM scripts and dependencies
379
557
 
380
558
  ## Contributing
381
559
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  pragma solidity ^0.8.0;
5
5
  /**
6
-
7
6
  ░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓██████████████▓▒░
8
7
  ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
9
8
  ░▒▓█▓▒░ ░▒▓█▓▒▒▓█▓▒░ ░▒▓█▓▒▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
@@ -78,7 +77,7 @@ import {NameService} from "@evvm/testnet-contracts/contracts/nameService/NameSer
78
77
  import {EvvmStorage} from "@evvm/testnet-contracts/contracts/evvm/lib/EvvmStorage.sol";
79
78
  import {ErrorsLib} from "@evvm/testnet-contracts/contracts/evvm/lib/ErrorsLib.sol";
80
79
  import {SignatureUtils} from "@evvm/testnet-contracts/contracts/evvm/lib/SignatureUtils.sol";
81
- import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
80
+ import {AdvancedStrings} from "@evvm/testnet-contracts/library/utils/AdvancedStrings.sol";
82
81
 
83
82
  contract Evvm is EvvmStorage {
84
83
  /**
@@ -146,6 +145,8 @@ contract Evvm is EvvmStorage {
146
145
  address _stakingContractAddress,
147
146
  EvvmMetadata memory _evvmMetadata
148
147
  ) {
148
+ evvmMetadata = _evvmMetadata;
149
+
149
150
  stakingContractAddress = _stakingContractAddress;
150
151
 
151
152
  admin.current = _initialOwner;
@@ -158,7 +159,7 @@ contract Evvm is EvvmStorage {
158
159
 
159
160
  breakerSetupNameServiceAddress = FLAG_IS_STAKER;
160
161
 
161
- evvmMetadata = _evvmMetadata;
162
+
162
163
  }
163
164
 
164
165
  /**
@@ -210,14 +211,14 @@ contract Evvm is EvvmStorage {
210
211
  * @dev Allows the admin to change the EVVM ID within a 1-day window after deployment
211
212
  */
212
213
  function setEvvmID(uint256 newEvvmID) external onlyAdmin {
213
- if (newEvvmID == 0) {
214
+ if (evvmMetadata.EvvmID != 0) {
214
215
  if (block.timestamp > windowTimeToChangeEvvmID)
215
216
  revert ErrorsLib.WindowToChangeEvvmIDExpired();
216
217
  }
217
218
 
218
219
  evvmMetadata.EvvmID = newEvvmID;
219
220
 
220
- windowTimeToChangeEvvmID = block.timestamp + 1 days;
221
+ windowTimeToChangeEvvmID = block.timestamp + 24 hours;
221
222
  }
222
223
 
223
224
  /**
@@ -381,7 +382,7 @@ contract Evvm is EvvmStorage {
381
382
  if (priorityFlag && asyncUsedNonce[from][nonce])
382
383
  revert ErrorsLib.InvalidAsyncNonce();
383
384
 
384
- address to = !Strings.equal(to_identity, "")
385
+ address to = !AdvancedStrings.equal(to_identity, "")
385
386
  ? NameService(nameServiceAddress).verifyStrictAndGetOwnerOfIdentity(
386
387
  to_identity
387
388
  )
@@ -502,7 +503,7 @@ contract Evvm is EvvmStorage {
502
503
  }
503
504
  }
504
505
 
505
- to_aux = !Strings.equal(payData[iteration].to_identity, "")
506
+ to_aux = !AdvancedStrings.equal(payData[iteration].to_identity, "")
506
507
  ? NameService(nameServiceAddress)
507
508
  .verifyStrictAndGetOwnerOfIdentity(
508
509
  payData[iteration].to_identity
@@ -634,7 +635,7 @@ contract Evvm is EvvmStorage {
634
635
  for (uint256 i = 0; i < toData.length; i++) {
635
636
  acomulatedAmount += toData[i].amount;
636
637
 
637
- if (!Strings.equal(toData[i].to_identity, "")) {
638
+ if (!AdvancedStrings.equal(toData[i].to_identity, "")) {
638
639
  if (
639
640
  NameService(nameServiceAddress).strictVerifyIfIdentityExist(
640
641
  toData[i].to_identity
@@ -951,7 +952,9 @@ contract Evvm is EvvmStorage {
951
952
  */
952
953
  function proposeImplementation(address _newImpl) external onlyAdmin {
953
954
  proposalImplementation = _newImpl;
954
- timeToAcceptImplementation = block.timestamp + 30 days;
955
+ timeToAcceptImplementation =
956
+ block.timestamp +
957
+ TIME_TO_ACCEPT_IMPLEMENTATION;
955
958
  }
956
959
 
957
960
  /**
@@ -1000,7 +1003,7 @@ contract Evvm is EvvmStorage {
1000
1003
  }
1001
1004
 
1002
1005
  admin.proposal = _newOwner;
1003
- admin.timeToAccept = block.timestamp + 1 days;
1006
+ admin.timeToAccept = block.timestamp + TIME_TO_ACCEPT_PROPOSAL;
1004
1007
  }
1005
1008
 
1006
1009
  /**
@@ -20,6 +20,8 @@ import {EvvmStructs} from "./EvvmStructs.sol";
20
20
  abstract contract EvvmStorage is EvvmStructs {
21
21
  address constant ETH_ADDRESS = address(0);
22
22
  bytes1 constant FLAG_IS_STAKER = 0x01;
23
+ uint256 constant TIME_TO_ACCEPT_PROPOSAL = 1 days;
24
+ uint256 constant TIME_TO_ACCEPT_IMPLEMENTATION = 30 days;
23
25
 
24
26
  address nameServiceAddress;
25
27
 
@@ -1,9 +1,8 @@
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
- import {SignatureRecover} from "@evvm/testnet-contracts/library/SignatureRecover.sol";
5
- import {AdvancedStrings} from "@evvm/testnet-contracts/library/AdvancedStrings.sol";
6
- import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
4
+ import {SignatureUtil} from "@evvm/testnet-contracts/library/utils/SignatureUtil.sol";
5
+ import {AdvancedStrings} from "@evvm/testnet-contracts/library/utils/AdvancedStrings.sol";
7
6
 
8
7
  pragma solidity ^0.8.0;
9
8
 
@@ -46,8 +45,8 @@ library SignatureUtils {
46
45
  bytes memory signature
47
46
  ) internal pure returns (bool) {
48
47
  return
49
- SignatureRecover.signatureVerification(
50
- Strings.toString(evvmID),
48
+ SignatureUtil.verifySignature(
49
+ evvmID,
51
50
  "pay",
52
51
  string.concat(
53
52
  _receiverAddress == address(0)
@@ -56,11 +55,11 @@ library SignatureUtils {
56
55
  ",",
57
56
  AdvancedStrings.addressToString(_token),
58
57
  ",",
59
- Strings.toString(_amount),
58
+ AdvancedStrings.uintToString(_amount),
60
59
  ",",
61
- Strings.toString(_priorityFee),
60
+ AdvancedStrings.uintToString(_priorityFee),
62
61
  ",",
63
- Strings.toString(_nonce),
62
+ AdvancedStrings.uintToString(_nonce),
64
63
  ",",
65
64
  _priorityFlag ? "true" : "false",
66
65
  ",",
@@ -98,19 +97,19 @@ library SignatureUtils {
98
97
  bytes memory signature
99
98
  ) internal pure returns (bool) {
100
99
  return
101
- SignatureRecover.signatureVerification(
102
- Strings.toString(evvmID),
100
+ SignatureUtil.verifySignature(
101
+ evvmID,
103
102
  "dispersePay",
104
103
  string.concat(
105
104
  AdvancedStrings.bytes32ToString(hashList),
106
105
  ",",
107
106
  AdvancedStrings.addressToString(_token),
108
107
  ",",
109
- Strings.toString(_amount),
108
+ AdvancedStrings.uintToString(_amount),
110
109
  ",",
111
- Strings.toString(_priorityFee),
110
+ AdvancedStrings.uintToString(_priorityFee),
112
111
  ",",
113
- Strings.toString(_nonce),
112
+ AdvancedStrings.uintToString(_nonce),
114
113
  ",",
115
114
  _priorityFlag ? "true" : "false",
116
115
  ",",
@@ -57,8 +57,7 @@ pragma solidity ^0.8.0;
57
57
  */
58
58
 
59
59
  import {Evvm} from "@evvm/testnet-contracts/contracts/evvm/Evvm.sol";
60
- import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
61
- import {AdvancedStrings} from "@evvm/testnet-contracts/library/AdvancedStrings.sol";
60
+ import {AdvancedStrings} from "@evvm/testnet-contracts/library/utils/AdvancedStrings.sol";
62
61
  import {ErrorsLib} from "@evvm/testnet-contracts/contracts/nameService/lib/ErrorsLib.sol";
63
62
  import {SignatureUtils} from "@evvm/testnet-contracts/contracts/nameService/lib/SignatureUtils.sol";
64
63
 
@@ -129,6 +128,11 @@ contract NameService {
129
128
  uint256 amount;
130
129
  }
131
130
 
131
+ uint256 constant TIME_TO_ACCEPT_PROPOSAL = 1 days;
132
+
133
+ /// @dev Amount of Principal Tokens locked in pending marketplace offers
134
+ uint256 private principalTokenTokenLockedForWithdrawOffers;
135
+
132
136
  /// @dev Nested mapping: username => offer ID => offer details
133
137
  mapping(string username => mapping(uint256 id => OfferMetadata))
134
138
  private usernameOffers;
@@ -153,9 +157,6 @@ contract NameService {
153
157
  address private constant PRINCIPAL_TOKEN_ADDRESS =
154
158
  0x0000000000000000000000000000000000000001;
155
159
 
156
- /// @dev Amount of Principal Tokens locked in pending marketplace offers
157
- uint256 private principalTokenTokenLockedForWithdrawOffers;
158
-
159
160
  /// @dev Restricts function access to the current admin address only
160
161
  modifier onlyAdmin() {
161
162
  if (msg.sender != admin.current) revert ErrorsLib.SenderIsNotAdmin();
@@ -955,7 +956,7 @@ contract NameService {
955
956
  }
956
957
 
957
958
  admin.proposal = _adminToPropose;
958
- admin.timeToAccept = block.timestamp + 1 days;
959
+ admin.timeToAccept = block.timestamp + TIME_TO_ACCEPT_PROPOSAL;
959
960
  }
960
961
 
961
962
  /**
@@ -1007,7 +1008,9 @@ contract NameService {
1007
1008
  }
1008
1009
 
1009
1010
  amountToWithdrawTokens.proposal = _amount;
1010
- amountToWithdrawTokens.timeToAccept = block.timestamp + 1 days;
1011
+ amountToWithdrawTokens.timeToAccept =
1012
+ block.timestamp +
1013
+ TIME_TO_ACCEPT_PROPOSAL;
1011
1014
  }
1012
1015
 
1013
1016
  /**
@@ -1046,7 +1049,7 @@ contract NameService {
1046
1049
  revert();
1047
1050
  }
1048
1051
  evvmAddress.proposal = _newEvvmAddress;
1049
- evvmAddress.timeToAccept = block.timestamp + 1 days;
1052
+ evvmAddress.timeToAccept = block.timestamp + TIME_TO_ACCEPT_PROPOSAL;
1050
1053
  }
1051
1054
 
1052
1055
  /**
@@ -24,4 +24,4 @@ library ErrorsLib {
24
24
  error EmptyCustomMetadata();
25
25
  error InvalidKey();
26
26
  error FlushUsernameVerificationFailed();
27
- }
27
+ }