neozipkit 0.2.1 → 0.3.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.
- package/LICENSE +22 -0
- package/README.md +410 -186
- package/contracts/ABI.txt +889 -0
- package/contracts/Bytecode.txt +1 -0
- package/contracts/COMPILATION_NOTES.md +59 -0
- package/contracts/QUICK_DEPLOY.md +286 -0
- package/contracts/README.md +235 -131
- package/contracts/VERIFICATION.md +308 -0
- package/contracts/deploy-interactive.js +448 -0
- package/contracts/deployment-arbitrum-sepolia.json +12 -0
- package/contracts/deployment-arbitrum.json +12 -0
- package/contracts/deployment-eth-sepolia.json +12 -0
- package/contracts/hardhat.config.js +114 -0
- package/contracts/package.json +20 -0
- package/contracts/scripts/compile-and-extract.js +119 -0
- package/contracts/scripts/verify-contract.js +223 -0
- package/contracts/src/{NZIP-NFT-Private.sol → NZIP-NFT-v2.0.sol} +66 -151
- package/contracts/src/NZIP-NFT.sol +9 -15
- package/dist/blockchain/browser/TokenVerifierBrowser.d.ts +67 -0
- package/dist/blockchain/browser/TokenVerifierBrowser.d.ts.map +1 -0
- package/dist/blockchain/browser/TokenVerifierBrowser.js +313 -0
- package/dist/blockchain/browser/TokenVerifierBrowser.js.map +1 -0
- package/dist/blockchain/browser/WalletManagerBrowser.d.ts +98 -0
- package/dist/blockchain/browser/WalletManagerBrowser.d.ts.map +1 -0
- package/dist/blockchain/browser/WalletManagerBrowser.js +434 -0
- package/dist/blockchain/browser/WalletManagerBrowser.js.map +1 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts +58 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts.map +1 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.js +317 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.js.map +1 -0
- package/dist/blockchain/browser/index.d.ts +11 -0
- package/dist/blockchain/browser/index.d.ts.map +1 -0
- package/dist/blockchain/browser/index.js +16 -0
- package/dist/blockchain/browser/index.js.map +1 -0
- package/dist/blockchain/core/WalletManager.d.ts +124 -0
- package/dist/blockchain/core/WalletManager.d.ts.map +1 -0
- package/dist/blockchain/{ZipKitWallet.js → core/WalletManager.js} +157 -177
- package/dist/blockchain/core/WalletManager.js.map +1 -0
- package/dist/blockchain/{ZipKitMinter.d.ts → core/ZipkitMinter.d.ts} +46 -11
- package/dist/blockchain/core/ZipkitMinter.d.ts.map +1 -0
- package/dist/blockchain/core/ZipkitMinter.js +548 -0
- package/dist/blockchain/core/ZipkitMinter.js.map +1 -0
- package/dist/blockchain/{ZipKitOTS.d.ts → core/ZipkitOTS.d.ts} +6 -15
- package/dist/blockchain/core/ZipkitOTS.d.ts.map +1 -0
- package/dist/blockchain/{ZipKitOTS.js → core/ZipkitOTS.js} +26 -84
- package/dist/blockchain/core/ZipkitOTS.js.map +1 -0
- package/dist/blockchain/core/ZipkitVerifier.d.ts +177 -0
- package/dist/blockchain/core/ZipkitVerifier.d.ts.map +1 -0
- package/dist/blockchain/core/ZipkitVerifier.js +632 -0
- package/dist/blockchain/core/ZipkitVerifier.js.map +1 -0
- package/dist/blockchain/core/contracts.d.ts +83 -0
- package/dist/blockchain/core/contracts.d.ts.map +1 -0
- package/dist/blockchain/core/contracts.js +341 -0
- package/dist/blockchain/core/contracts.js.map +1 -0
- package/dist/blockchain/core/index.d.ts +12 -0
- package/dist/blockchain/core/index.d.ts.map +1 -0
- package/dist/blockchain/core/index.js +59 -0
- package/dist/blockchain/core/index.js.map +1 -0
- package/dist/blockchain/index.d.ts +11 -7
- package/dist/blockchain/index.d.ts.map +1 -0
- package/dist/blockchain/index.js +18 -34
- package/dist/blockchain/index.js.map +1 -0
- package/dist/blockchain/node/WalletManagerNode.d.ts +47 -0
- package/dist/blockchain/node/WalletManagerNode.d.ts.map +1 -0
- package/dist/blockchain/node/WalletManagerNode.js +203 -0
- package/dist/blockchain/node/WalletManagerNode.js.map +1 -0
- package/dist/blockchain/node/index.d.ts +12 -0
- package/dist/blockchain/node/index.d.ts.map +1 -0
- package/dist/blockchain/node/index.js +24 -0
- package/dist/blockchain/node/index.js.map +1 -0
- package/dist/browser/ZipkitBrowser.d.ts +27 -0
- package/dist/browser/ZipkitBrowser.d.ts.map +1 -0
- package/dist/browser/{ZipKitBrowser.js → ZipkitBrowser.js} +96 -43
- package/dist/browser/ZipkitBrowser.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +42 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser-esm/index.d.ts +12 -0
- package/dist/browser-esm/index.js +59559 -0
- package/dist/browser-esm/index.js.map +7 -0
- package/dist/browser-umd/index.d.ts +12 -0
- package/dist/browser-umd/index.js +59576 -0
- package/dist/browser-umd/index.js.map +7 -0
- package/dist/browser-umd/index.min.js +63 -0
- package/dist/browser.d.ts +8 -14
- package/dist/browser.js +13 -28
- package/dist/core/ZipCompress.d.ts +99 -0
- package/dist/core/ZipCompress.d.ts.map +1 -0
- package/dist/core/ZipCompress.js +309 -0
- package/dist/core/ZipCompress.js.map +1 -0
- package/dist/core/ZipDecompress.d.ts +58 -0
- package/dist/core/ZipDecompress.d.ts.map +1 -0
- package/dist/core/ZipDecompress.js +172 -0
- package/dist/core/ZipDecompress.js.map +1 -0
- package/dist/{shared → core}/ZipEntry.d.ts +8 -1
- package/dist/core/ZipEntry.d.ts.map +1 -0
- package/dist/{shared → core}/ZipEntry.js +225 -82
- package/dist/core/ZipEntry.js.map +1 -0
- package/dist/core/Zipkit.d.ts +315 -0
- package/dist/core/Zipkit.d.ts.map +1 -0
- package/dist/core/Zipkit.js +647 -0
- package/dist/core/Zipkit.js.map +1 -0
- package/dist/core/components/HashCalculator.d.ts +138 -0
- package/dist/core/components/HashCalculator.d.ts.map +1 -0
- package/dist/core/components/HashCalculator.js +360 -0
- package/dist/core/components/HashCalculator.js.map +1 -0
- package/dist/core/components/Logger.d.ts +73 -0
- package/dist/core/components/Logger.d.ts.map +1 -0
- package/dist/core/components/Logger.js +156 -0
- package/dist/core/components/Logger.js.map +1 -0
- package/dist/core/components/ProgressTracker.d.ts +43 -0
- package/dist/core/components/ProgressTracker.d.ts.map +1 -0
- package/dist/core/components/ProgressTracker.js +112 -0
- package/dist/core/components/ProgressTracker.js.map +1 -0
- package/dist/{shared → core}/components/Support.d.ts +1 -0
- package/dist/core/components/Support.d.ts.map +1 -0
- package/dist/{shared → core}/components/Support.js +1 -0
- package/dist/core/components/Support.js.map +1 -0
- package/dist/{shared → core}/components/Util.d.ts +7 -2
- package/dist/core/components/Util.d.ts.map +1 -0
- package/dist/{shared → core}/components/Util.js +14 -34
- package/dist/core/components/Util.js.map +1 -0
- package/dist/{shared → core}/constants/Errors.d.ts +1 -2
- package/dist/core/constants/Errors.d.ts.map +1 -0
- package/dist/{shared → core}/constants/Errors.js +1 -3
- package/dist/core/constants/Errors.js.map +1 -0
- package/dist/{shared → core}/constants/Headers.d.ts +3 -0
- package/dist/core/constants/Headers.d.ts.map +1 -0
- package/dist/{shared → core}/constants/Headers.js +20 -17
- package/dist/core/constants/Headers.js.map +1 -0
- package/dist/core/encryption/Manager.d.ts +58 -0
- package/dist/core/encryption/Manager.d.ts.map +1 -0
- package/dist/core/encryption/Manager.js +121 -0
- package/dist/core/encryption/Manager.js.map +1 -0
- package/dist/core/encryption/ZipCrypto.d.ts +172 -0
- package/dist/core/encryption/ZipCrypto.d.ts.map +1 -0
- package/dist/core/encryption/ZipCrypto.js +554 -0
- package/dist/core/encryption/ZipCrypto.js.map +1 -0
- package/dist/core/encryption/index.d.ts +9 -0
- package/dist/core/encryption/index.d.ts.map +1 -0
- package/dist/core/encryption/index.js +17 -0
- package/dist/core/encryption/index.js.map +1 -0
- package/dist/core/encryption/types.d.ts +29 -0
- package/dist/core/encryption/types.d.ts.map +1 -0
- package/dist/core/encryption/types.js +12 -0
- package/dist/core/encryption/types.js.map +1 -0
- package/dist/core/index.d.ts +24 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +57 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/version.d.ts +5 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +31 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.d.ts +8 -18
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -35
- package/dist/index.js.map +1 -0
- package/dist/node/ZipCompressNode.d.ts +123 -0
- package/dist/node/ZipCompressNode.d.ts.map +1 -0
- package/dist/node/ZipCompressNode.js +576 -0
- package/dist/node/ZipCompressNode.js.map +1 -0
- package/dist/node/ZipDecompressNode.d.ts +120 -0
- package/dist/node/ZipDecompressNode.d.ts.map +1 -0
- package/dist/node/ZipDecompressNode.js +461 -0
- package/dist/node/ZipDecompressNode.js.map +1 -0
- package/dist/node/ZipkitNode.d.ts +406 -0
- package/dist/node/ZipkitNode.d.ts.map +1 -0
- package/dist/node/ZipkitNode.js +1305 -0
- package/dist/node/ZipkitNode.js.map +1 -0
- package/dist/node/index.d.ts +26 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +65 -0
- package/dist/node/index.js.map +1 -0
- package/dist/types/index.d.ts +59 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +36 -1
- package/dist/types/index.js.map +1 -0
- package/examples/README.md +269 -0
- package/examples/blockchain-tokenize.ts +354 -0
- package/examples/create-zip.ts +172 -0
- package/examples/extract-zip.ts +158 -0
- package/examples/list-zip.ts +161 -0
- package/examples/test-files/data.json +116 -0
- package/examples/test-files/document.md +80 -0
- package/examples/test-files/document.txt +2 -0
- package/examples/test-files/file1.txt +48 -0
- package/examples/test-files/file2.txt +80 -0
- package/examples/tsconfig.json +44 -0
- package/examples/unzip-token.ts +491 -0
- package/examples/verify-tokenized-zip.ts +305 -0
- package/examples/zip-token.ts +604 -0
- package/package.json +108 -24
- package/src/blockchain/README.md +59 -66
- package/src/{browser/TokenVerifierBrowser.ts-remove → blockchain/browser/TokenVerifierBrowser.ts} +125 -79
- package/src/blockchain/browser/WalletManagerBrowser.ts +486 -0
- package/src/blockchain/browser/ZipkitMinterBrowser.ts +400 -0
- package/src/blockchain/browser/index.ts +13 -0
- package/src/blockchain/{ZipKitWallet.ts → core/WalletManager.ts} +241 -143
- package/src/blockchain/core/ZipkitMinter.ts +716 -0
- package/src/blockchain/{ZipKitOTS.ts → core/ZipkitOTS.ts} +28 -62
- package/src/blockchain/core/ZipkitVerifier.ts +853 -0
- package/src/blockchain/core/contracts.ts +370 -0
- package/src/blockchain/core/index.ts +71 -0
- package/src/blockchain/index.ts +21 -55
- package/src/blockchain/node/WalletManagerNode.ts +171 -0
- package/src/blockchain/node/index.ts +40 -0
- package/src/browser/{ZipKitBrowser.ts → ZipkitBrowser.ts} +104 -41
- package/src/browser/index.esm.ts +37 -0
- package/src/browser/index.ts +25 -0
- package/src/core/ZipCompress.ts +398 -0
- package/src/core/ZipDecompress.ts +212 -0
- package/src/{shared → core}/ZipEntry.ts +240 -90
- package/src/core/Zipkit.ts +794 -0
- package/src/core/components/HashCalculator.ts +384 -0
- package/src/core/components/Logger.ts +180 -0
- package/src/core/components/ProgressTracker.ts +134 -0
- package/src/{shared → core}/components/Util.ts +12 -34
- package/src/{shared → core}/constants/Errors.ts +0 -4
- package/src/{shared → core}/constants/Headers.ts +19 -17
- package/src/core/encryption/Manager.ts +137 -0
- package/src/core/encryption/ZipCrypto.ts +650 -0
- package/src/core/encryption/index.ts +15 -0
- package/src/core/encryption/types.ts +33 -0
- package/src/core/index.ts +34 -0
- package/src/core/version.ts +33 -0
- package/src/index.ts +54 -25
- package/src/node/ZipCompressNode.ts +632 -0
- package/src/node/ZipDecompressNode.ts +508 -0
- package/src/node/ZipkitNode.ts +1559 -0
- package/src/node/index.ts +69 -0
- package/src/types/index.ts +131 -1
- package/src/types/modules.d.ts +1 -11
- package/src/types/opentimestamps.d.ts +1 -23
- package/contracts/INTEGRATION.md +0 -338
- package/contracts/NETWORKS.md +0 -156
- package/contracts/NZIP-NFT-bytecode.txt +0 -1
- package/contracts/constants.ts +0 -952
- package/contracts/deploy-bytecode.mjs +0 -94
- package/dist/blockchain/CertificateToken.d.ts +0 -48
- package/dist/blockchain/CertificateToken.js +0 -386
- package/dist/blockchain/ZipKitMinter.js +0 -347
- package/dist/blockchain/ZipKitNFT.d.ts +0 -3
- package/dist/blockchain/ZipKitNFT.js +0 -7
- package/dist/blockchain/ZipKitVerifier.d.ts +0 -69
- package/dist/blockchain/ZipKitVerifier.js +0 -289
- package/dist/blockchain/ZipKitWallet.d.ts +0 -69
- package/dist/blockchain/contracts.d.ts +0 -14
- package/dist/blockchain/contracts.js +0 -77
- package/dist/blockchain/types.d.ts +0 -47
- package/dist/blockchain/types.js +0 -30
- package/dist/browser/ZipKitBrowser.d.ts +0 -18
- package/dist/browser/ZipKitStampBrowser.d.ts +0 -2
- package/dist/browser/ZipKitStampBrowser.js +0 -12
- package/dist/browser-index.d.ts +0 -18
- package/dist/browser-index.js +0 -57
- package/dist/server/ZipKitServer.d.ts +0 -74
- package/dist/server/ZipKitServer.js +0 -310
- package/dist/shared/ZipKit.d.ts +0 -243
- package/dist/shared/ZipKit.js +0 -772
- package/dist/shared/components/CertificateOTS.d.ts +0 -15
- package/dist/shared/components/CertificateOTS.js +0 -116
- package/dist/shared/components/FileSys.d.ts +0 -2
- package/dist/shared/components/FileSys.js +0 -113
- package/dist/shared/components/HashAccumulator.d.ts +0 -55
- package/dist/shared/components/HashAccumulator.js +0 -100
- package/dist/shared/components/ZipCrypto.d.ts +0 -3
- package/dist/shared/components/ZipCrypto.js +0 -78
- package/dist/shared/components/merkleTree.d.ts +0 -66
- package/dist/shared/components/merkleTree.js +0 -136
- package/dist/shared/types/index.d.ts +0 -21
- package/dist/shared/types/index.js +0 -3
- package/dist/shared/types.d.ts +0 -33
- package/dist/shared/types.js +0 -8
- package/dist/shared/version.d.ts +0 -2
- package/dist/shared/version.js +0 -6
- package/src/blockchain/CertificateToken.ts +0 -444
- package/src/blockchain/ZipKitMinter.ts +0 -470
- package/src/blockchain/ZipKitNFT.ts +0 -12
- package/src/blockchain/ZipKitVerifier.ts +0 -382
- package/src/blockchain/contracts.ts +0 -88
- package/src/blockchain/types.ts +0 -91
- package/src/browser/CertificateGeneratorBrowser.ts-remove +0 -498
- package/src/browser/ZipKitStampBrowser.ts +0 -9
- package/src/browser-index.ts +0 -36
- package/src/server/README.md +0 -25
- package/src/server/ZipKitServer.ts +0 -305
- package/src/shared/ZipKit.ts +0 -881
- package/src/shared/components/CertificateOTS.ts +0 -132
- package/src/shared/components/FileSys.ts +0 -87
- package/src/shared/components/HashAccumulator.ts +0 -113
- package/src/shared/components/ZipCrypto.ts +0 -91
- package/src/shared/components/merkleTree.ts +0 -162
- package/src/shared/types/index.ts +0 -25
- package/src/shared/types/modules.d.ts +0 -22
- package/src/shared/types/opentimestamps.d.ts +0 -23
- package/src/shared/types.d.ts +0 -8
- package/src/shared/types.ts +0 -43
- package/src/shared/version.ts +0 -3
- /package/src/{shared → core}/components/Support.ts +0 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interactive Deployment script for NeoZip NFT Contract
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* node deploy-interactive.js
|
|
8
|
+
*
|
|
9
|
+
* This script will prompt you for:
|
|
10
|
+
* - Private key
|
|
11
|
+
* - Network selection
|
|
12
|
+
* - Confirmation before deployment
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const { ethers } = require("ethers");
|
|
16
|
+
const fs = require("fs");
|
|
17
|
+
const path = require("path");
|
|
18
|
+
const readline = require("readline");
|
|
19
|
+
|
|
20
|
+
// Network configurations
|
|
21
|
+
const NETWORKS = {
|
|
22
|
+
"ETH": {
|
|
23
|
+
name: "Ethereum Mainnet",
|
|
24
|
+
chainId: 1,
|
|
25
|
+
rpcUrls: [
|
|
26
|
+
"https://eth.llamarpc.com",
|
|
27
|
+
"https://rpc.ankr.com/eth",
|
|
28
|
+
"https://ethereum.publicnode.com"
|
|
29
|
+
],
|
|
30
|
+
explorer: "https://etherscan.io",
|
|
31
|
+
isTestnet: false
|
|
32
|
+
},
|
|
33
|
+
"ETH Sepolia": {
|
|
34
|
+
name: "Ethereum Sepolia",
|
|
35
|
+
chainId: 11155111,
|
|
36
|
+
rpcUrls: [
|
|
37
|
+
"https://rpc.sepolia.org",
|
|
38
|
+
"https://ethereum-sepolia-rpc.publicnode.com",
|
|
39
|
+
"https://sepolia.gateway.tenderly.co"
|
|
40
|
+
],
|
|
41
|
+
explorer: "https://sepolia.etherscan.io",
|
|
42
|
+
isTestnet: true
|
|
43
|
+
},
|
|
44
|
+
"Base": {
|
|
45
|
+
name: "Base Mainnet",
|
|
46
|
+
chainId: 8453,
|
|
47
|
+
rpcUrls: [
|
|
48
|
+
"https://mainnet.base.org",
|
|
49
|
+
"https://base.drpc.org",
|
|
50
|
+
"https://base.gateway.tenderly.co"
|
|
51
|
+
],
|
|
52
|
+
explorer: "https://basescan.org",
|
|
53
|
+
isTestnet: false
|
|
54
|
+
},
|
|
55
|
+
"Base Sepolia": {
|
|
56
|
+
name: "Base Sepolia",
|
|
57
|
+
chainId: 84532,
|
|
58
|
+
rpcUrls: [
|
|
59
|
+
"https://sepolia.base.org",
|
|
60
|
+
"https://base-sepolia-rpc.publicnode.com",
|
|
61
|
+
"https://base-sepolia.gateway.tenderly.co"
|
|
62
|
+
],
|
|
63
|
+
explorer: "https://sepolia.basescan.org",
|
|
64
|
+
isTestnet: true
|
|
65
|
+
},
|
|
66
|
+
"Arbitrum": {
|
|
67
|
+
name: "Arbitrum One",
|
|
68
|
+
chainId: 42161,
|
|
69
|
+
rpcUrls: [
|
|
70
|
+
"https://arb1.arbitrum.io/rpc",
|
|
71
|
+
"https://arbitrum.llamarpc.com",
|
|
72
|
+
"https://arbitrum.publicnode.com"
|
|
73
|
+
],
|
|
74
|
+
explorer: "https://arbiscan.io",
|
|
75
|
+
isTestnet: false
|
|
76
|
+
},
|
|
77
|
+
"Arbitrum Sepolia": {
|
|
78
|
+
name: "Arbitrum Sepolia",
|
|
79
|
+
chainId: 421614,
|
|
80
|
+
rpcUrls: [
|
|
81
|
+
"https://sepolia-rollup.arbitrum.io/rpc",
|
|
82
|
+
"https://arbitrum-sepolia-rpc.publicnode.com"
|
|
83
|
+
],
|
|
84
|
+
explorer: "https://sepolia.arbiscan.io",
|
|
85
|
+
isTestnet: true
|
|
86
|
+
},
|
|
87
|
+
"Polygon": {
|
|
88
|
+
name: "Polygon Mainnet",
|
|
89
|
+
chainId: 137,
|
|
90
|
+
rpcUrls: [
|
|
91
|
+
"https://polygon.llamarpc.com",
|
|
92
|
+
"https://rpc.ankr.com/polygon",
|
|
93
|
+
"https://polygon-rpc.com"
|
|
94
|
+
],
|
|
95
|
+
explorer: "https://polygonscan.com",
|
|
96
|
+
isTestnet: false
|
|
97
|
+
},
|
|
98
|
+
"Polygon Sepolia": {
|
|
99
|
+
name: "Polygon Sepolia",
|
|
100
|
+
chainId: 80002,
|
|
101
|
+
rpcUrls: [
|
|
102
|
+
"https://rpc-amoy.polygon.technology",
|
|
103
|
+
"https://polygon-amoy-rpc.publicnode.com"
|
|
104
|
+
],
|
|
105
|
+
explorer: "https://amoy.polygonscan.com",
|
|
106
|
+
isTestnet: true
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// Create readline interface
|
|
111
|
+
const rl = readline.createInterface({
|
|
112
|
+
input: process.stdin,
|
|
113
|
+
output: process.stdout
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Helper function to prompt for input
|
|
117
|
+
function question(prompt) {
|
|
118
|
+
return new Promise((resolve) => {
|
|
119
|
+
rl.question(prompt, resolve);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Helper function to close readline
|
|
124
|
+
function close() {
|
|
125
|
+
rl.close();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function main() {
|
|
129
|
+
console.log("=".repeat(70));
|
|
130
|
+
console.log("🚀 NeoZip NFT Contract Deployment - Interactive");
|
|
131
|
+
console.log("=".repeat(70));
|
|
132
|
+
console.log();
|
|
133
|
+
|
|
134
|
+
// File paths
|
|
135
|
+
const contractsDir = __dirname;
|
|
136
|
+
const bytecodePath = path.join(contractsDir, "Bytecode.txt");
|
|
137
|
+
const abiPath = path.join(contractsDir, "ABI.txt");
|
|
138
|
+
|
|
139
|
+
// Check if files exist
|
|
140
|
+
if (!fs.existsSync(bytecodePath)) {
|
|
141
|
+
console.error(`❌ Error: Bytecode.txt not found at ${bytecodePath}`);
|
|
142
|
+
close();
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (!fs.existsSync(abiPath)) {
|
|
147
|
+
console.error(`❌ Error: ABI.txt not found at ${abiPath}`);
|
|
148
|
+
close();
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
// Step 1: Prompt for private key
|
|
154
|
+
console.log("📝 Step 1: Enter your private key");
|
|
155
|
+
console.log(" (Your private key will NOT be saved or displayed)");
|
|
156
|
+
const privateKey = await question("\nPrivate Key: ");
|
|
157
|
+
|
|
158
|
+
if (!privateKey || !privateKey.trim()) {
|
|
159
|
+
console.error("\n❌ Error: Private key is required");
|
|
160
|
+
close();
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const trimmedKey = privateKey.trim();
|
|
165
|
+
if (!trimmedKey.startsWith("0x")) {
|
|
166
|
+
console.log(" ℹ️ Adding 0x prefix to private key...");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
console.log();
|
|
170
|
+
|
|
171
|
+
// Step 2: Select network
|
|
172
|
+
console.log("🌐 Step 2: Select network to deploy to");
|
|
173
|
+
console.log();
|
|
174
|
+
const networkKeys = Object.keys(NETWORKS);
|
|
175
|
+
networkKeys.forEach((key, index) => {
|
|
176
|
+
const network = NETWORKS[key];
|
|
177
|
+
const testnetLabel = network.isTestnet ? " (Testnet)" : " (Mainnet)";
|
|
178
|
+
console.log(` ${index + 1}. ${key}${testnetLabel}`);
|
|
179
|
+
});
|
|
180
|
+
console.log();
|
|
181
|
+
|
|
182
|
+
const networkChoice = await question(`Select network (1-${networkKeys.length}): `);
|
|
183
|
+
const networkIndex = parseInt(networkChoice) - 1;
|
|
184
|
+
|
|
185
|
+
if (isNaN(networkIndex) || networkIndex < 0 || networkIndex >= networkKeys.length) {
|
|
186
|
+
console.error("\n❌ Error: Invalid network selection");
|
|
187
|
+
close();
|
|
188
|
+
process.exit(1);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const selectedNetworkKey = networkKeys[networkIndex];
|
|
192
|
+
const selectedNetwork = NETWORKS[selectedNetworkKey];
|
|
193
|
+
|
|
194
|
+
console.log();
|
|
195
|
+
console.log(`✅ Selected: ${selectedNetwork.name} (Chain ID: ${selectedNetwork.chainId})`);
|
|
196
|
+
console.log();
|
|
197
|
+
|
|
198
|
+
// Step 3: Read contract files
|
|
199
|
+
console.log("📖 Reading contract files...");
|
|
200
|
+
let bytecode = fs.readFileSync(bytecodePath, "utf8").trim();
|
|
201
|
+
if (!bytecode.startsWith("0x")) {
|
|
202
|
+
bytecode = "0x" + bytecode;
|
|
203
|
+
}
|
|
204
|
+
const abi = JSON.parse(fs.readFileSync(abiPath, "utf8"));
|
|
205
|
+
console.log("✅ Contract files loaded");
|
|
206
|
+
console.log(` Bytecode length: ${bytecode.length} characters`);
|
|
207
|
+
console.log();
|
|
208
|
+
|
|
209
|
+
// Step 4: Connect to network
|
|
210
|
+
console.log(`🔗 Connecting to ${selectedNetwork.name}...`);
|
|
211
|
+
|
|
212
|
+
let provider;
|
|
213
|
+
let lastError;
|
|
214
|
+
|
|
215
|
+
// Try each RPC URL until one works
|
|
216
|
+
for (const rpcUrl of selectedNetwork.rpcUrls) {
|
|
217
|
+
try {
|
|
218
|
+
provider = new ethers.JsonRpcProvider(rpcUrl);
|
|
219
|
+
// Test connection
|
|
220
|
+
await provider.getBlockNumber();
|
|
221
|
+
console.log(`✅ Connected via: ${rpcUrl}`);
|
|
222
|
+
break;
|
|
223
|
+
} catch (error) {
|
|
224
|
+
lastError = error;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (!provider) {
|
|
230
|
+
console.error(`❌ Error: Could not connect to ${selectedNetwork.name}`);
|
|
231
|
+
console.error(` Tried ${selectedNetwork.rpcUrls.length} RPC endpoints`);
|
|
232
|
+
if (lastError) {
|
|
233
|
+
console.error(` Last error: ${lastError.message}`);
|
|
234
|
+
}
|
|
235
|
+
close();
|
|
236
|
+
process.exit(1);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Create wallet
|
|
240
|
+
const wallet = new ethers.Wallet(trimmedKey.startsWith("0x") ? trimmedKey : "0x" + trimmedKey, provider);
|
|
241
|
+
console.log(`✅ Wallet address: ${wallet.address}`);
|
|
242
|
+
console.log();
|
|
243
|
+
|
|
244
|
+
// Step 5: Check balance
|
|
245
|
+
console.log("💰 Checking wallet balance...");
|
|
246
|
+
const balance = await provider.getBalance(wallet.address);
|
|
247
|
+
const balanceEth = ethers.formatEther(balance);
|
|
248
|
+
console.log(` Balance: ${balanceEth} ETH`);
|
|
249
|
+
console.log();
|
|
250
|
+
|
|
251
|
+
if (balance === 0n) {
|
|
252
|
+
const networkType = selectedNetwork.isTestnet ? "testnet tokens" : "ETH";
|
|
253
|
+
console.error(`❌ Error: Insufficient balance. Please fund your wallet with ${networkType}.`);
|
|
254
|
+
if (selectedNetwork.isTestnet) {
|
|
255
|
+
console.error(` Get testnet tokens from a faucet for ${selectedNetwork.name}`);
|
|
256
|
+
}
|
|
257
|
+
close();
|
|
258
|
+
process.exit(1);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Step 6: Estimate gas
|
|
262
|
+
console.log("⛽ Estimating gas costs...");
|
|
263
|
+
let gasEstimate;
|
|
264
|
+
let estimatedCost;
|
|
265
|
+
try {
|
|
266
|
+
const ContractFactory = new ethers.ContractFactory(abi, bytecode, wallet);
|
|
267
|
+
const deployTx = ContractFactory.getDeployTransaction();
|
|
268
|
+
gasEstimate = await provider.estimateGas(deployTx);
|
|
269
|
+
const feeData = await provider.getFeeData();
|
|
270
|
+
estimatedCost = gasEstimate * (feeData.gasPrice || 0n);
|
|
271
|
+
console.log(` Estimated gas: ${gasEstimate.toString()}`);
|
|
272
|
+
console.log(` Estimated cost: ${ethers.formatEther(estimatedCost)} ETH`);
|
|
273
|
+
} catch (err) {
|
|
274
|
+
console.log(" ⚠️ Could not estimate gas (will use default)");
|
|
275
|
+
gasEstimate = null;
|
|
276
|
+
estimatedCost = null;
|
|
277
|
+
}
|
|
278
|
+
console.log();
|
|
279
|
+
|
|
280
|
+
// Step 7: Show summary and confirm
|
|
281
|
+
console.log("=".repeat(70));
|
|
282
|
+
console.log("📋 DEPLOYMENT SUMMARY");
|
|
283
|
+
console.log("=".repeat(70));
|
|
284
|
+
console.log();
|
|
285
|
+
console.log(`Network: ${selectedNetwork.name}`);
|
|
286
|
+
console.log(`Chain ID: ${selectedNetwork.chainId}`);
|
|
287
|
+
console.log(`Deployer: ${wallet.address}`);
|
|
288
|
+
console.log(`Balance: ${balanceEth} ETH`);
|
|
289
|
+
if (gasEstimate) {
|
|
290
|
+
console.log(`Gas Estimate: ${gasEstimate.toString()}`);
|
|
291
|
+
console.log(`Est. Cost: ${ethers.formatEther(estimatedCost)} ETH`);
|
|
292
|
+
}
|
|
293
|
+
console.log(`Explorer: ${selectedNetwork.explorer}`);
|
|
294
|
+
console.log();
|
|
295
|
+
|
|
296
|
+
if (!selectedNetwork.isTestnet) {
|
|
297
|
+
console.log("⚠️ WARNING: You are deploying to MAINNET!");
|
|
298
|
+
console.log(" This will cost real ETH. Make sure you want to proceed.");
|
|
299
|
+
console.log();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const confirm = await question("Proceed with deployment? (yes/no): ");
|
|
303
|
+
|
|
304
|
+
if (confirm.toLowerCase() !== "yes" && confirm.toLowerCase() !== "y") {
|
|
305
|
+
console.log("\n❌ Deployment cancelled by user");
|
|
306
|
+
close();
|
|
307
|
+
process.exit(0);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
console.log();
|
|
311
|
+
console.log("=".repeat(70));
|
|
312
|
+
console.log("🚀 DEPLOYING CONTRACT");
|
|
313
|
+
console.log("=".repeat(70));
|
|
314
|
+
console.log();
|
|
315
|
+
|
|
316
|
+
// Step 8: Deploy
|
|
317
|
+
console.log("🏗️ Creating contract factory...");
|
|
318
|
+
const ContractFactory = new ethers.ContractFactory(abi, bytecode, wallet);
|
|
319
|
+
|
|
320
|
+
console.log("📤 Sending deployment transaction...");
|
|
321
|
+
console.log(" This may take a few moments...");
|
|
322
|
+
const contract = await ContractFactory.deploy();
|
|
323
|
+
|
|
324
|
+
const txHash = contract.deploymentTransaction().hash;
|
|
325
|
+
console.log("✅ Deployment transaction sent!");
|
|
326
|
+
console.log(` Transaction hash: ${txHash}`);
|
|
327
|
+
console.log(` View on explorer: ${selectedNetwork.explorer}/tx/${txHash}`);
|
|
328
|
+
console.log();
|
|
329
|
+
console.log("⏳ Waiting for deployment confirmation...");
|
|
330
|
+
|
|
331
|
+
const deploymentResponse = await contract.waitForDeployment();
|
|
332
|
+
|
|
333
|
+
const contractAddress = await contract.getAddress();
|
|
334
|
+
console.log();
|
|
335
|
+
console.log("=".repeat(70));
|
|
336
|
+
console.log("✅ DEPLOYMENT SUCCESSFUL!");
|
|
337
|
+
console.log("=".repeat(70));
|
|
338
|
+
console.log();
|
|
339
|
+
console.log(`Contract Address: ${contractAddress}`);
|
|
340
|
+
console.log(`Transaction Hash: ${txHash}`);
|
|
341
|
+
|
|
342
|
+
// Get deployment block from the deployment response
|
|
343
|
+
let blockNumber = null;
|
|
344
|
+
let version = "2.10.0";
|
|
345
|
+
|
|
346
|
+
try {
|
|
347
|
+
// Get receipt from the deployment transaction
|
|
348
|
+
const receipt = await contract.deploymentTransaction().wait();
|
|
349
|
+
blockNumber = receipt.blockNumber;
|
|
350
|
+
console.log(`Deployed at Block: ${blockNumber}`);
|
|
351
|
+
} catch (err) {
|
|
352
|
+
// If we can't get the receipt, try to get it from the provider
|
|
353
|
+
try {
|
|
354
|
+
const txReceipt = await provider.getTransactionReceipt(txHash);
|
|
355
|
+
if (txReceipt) {
|
|
356
|
+
blockNumber = txReceipt.blockNumber;
|
|
357
|
+
console.log(`Deployed at Block: ${blockNumber}`);
|
|
358
|
+
} else {
|
|
359
|
+
console.log("⚠️ Could not retrieve block number (deployment was successful)");
|
|
360
|
+
}
|
|
361
|
+
} catch (err2) {
|
|
362
|
+
console.log("⚠️ Could not retrieve block number (deployment was successful)");
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Verify version (optional, don't fail if this doesn't work)
|
|
367
|
+
try {
|
|
368
|
+
version = await contract.getVersion();
|
|
369
|
+
console.log(`Contract Version: ${version}`);
|
|
370
|
+
} catch (err) {
|
|
371
|
+
// Version check failed, but deployment was successful
|
|
372
|
+
console.log(`Contract Version: ${version} (assumed, verification failed)`);
|
|
373
|
+
}
|
|
374
|
+
console.log();
|
|
375
|
+
|
|
376
|
+
// Save deployment info
|
|
377
|
+
const deploymentInfo = {
|
|
378
|
+
network: selectedNetwork.name,
|
|
379
|
+
networkKey: selectedNetworkKey,
|
|
380
|
+
chainId: selectedNetwork.chainId,
|
|
381
|
+
contractAddress: contractAddress,
|
|
382
|
+
version: version,
|
|
383
|
+
deployer: wallet.address,
|
|
384
|
+
transactionHash: txHash,
|
|
385
|
+
blockNumber: blockNumber,
|
|
386
|
+
timestamp: new Date().toISOString(),
|
|
387
|
+
explorerUrl: `${selectedNetwork.explorer}/address/${contractAddress}`
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
const deploymentFileName = `deployment-${selectedNetworkKey.toLowerCase().replace(/\s+/g, "-")}.json`;
|
|
391
|
+
const deploymentPath = path.join(contractsDir, deploymentFileName);
|
|
392
|
+
fs.writeFileSync(
|
|
393
|
+
deploymentPath,
|
|
394
|
+
JSON.stringify(deploymentInfo, null, 2)
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
console.log("📝 Deployment info saved to:", deploymentPath);
|
|
398
|
+
console.log();
|
|
399
|
+
console.log("🔍 View contract on explorer:");
|
|
400
|
+
console.log(` ${selectedNetwork.explorer}/address/${contractAddress}`);
|
|
401
|
+
console.log();
|
|
402
|
+
console.log("📋 Next steps:");
|
|
403
|
+
console.log(" 1. Verify the contract on the block explorer");
|
|
404
|
+
console.log(" 2. Update contract address in src/blockchain/core/contracts.ts");
|
|
405
|
+
console.log(" 3. Test the deployed contract");
|
|
406
|
+
console.log();
|
|
407
|
+
|
|
408
|
+
// Close readline and exit cleanly
|
|
409
|
+
close();
|
|
410
|
+
|
|
411
|
+
// Give a moment for any pending operations to complete, then exit
|
|
412
|
+
setTimeout(() => {
|
|
413
|
+
process.exit(0);
|
|
414
|
+
}, 100);
|
|
415
|
+
|
|
416
|
+
} catch (error) {
|
|
417
|
+
console.error();
|
|
418
|
+
console.error("❌ Deployment failed!");
|
|
419
|
+
console.error("Error:", error.message);
|
|
420
|
+
|
|
421
|
+
if (error.transaction) {
|
|
422
|
+
console.error("Transaction:", error.transaction);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (error.receipt) {
|
|
426
|
+
console.error("Receipt:", error.receipt);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
console.error();
|
|
430
|
+
if (error.code) {
|
|
431
|
+
console.error("Error code:", error.code);
|
|
432
|
+
}
|
|
433
|
+
if (error.reason) {
|
|
434
|
+
console.error("Reason:", error.reason);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
close();
|
|
438
|
+
process.exit(1);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// Run deployment
|
|
443
|
+
main().catch((error) => {
|
|
444
|
+
console.error("Fatal error:", error);
|
|
445
|
+
close();
|
|
446
|
+
process.exit(1);
|
|
447
|
+
});
|
|
448
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"network": "Arbitrum Sepolia",
|
|
3
|
+
"networkKey": "Arbitrum Sepolia",
|
|
4
|
+
"chainId": 421614,
|
|
5
|
+
"contractAddress": "0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60",
|
|
6
|
+
"version": "2.10.0",
|
|
7
|
+
"deployer": "0xab90062062A68576D9F2Be2fa3051e101f06AD93",
|
|
8
|
+
"transactionHash": "0x7b9de6873442b329468cbd5baf2a6d117596b2a5b7e705fbfede0136a8a57739",
|
|
9
|
+
"blockNumber": 216250759,
|
|
10
|
+
"timestamp": "2025-11-17T19:44:48.038Z",
|
|
11
|
+
"explorerUrl": "https://sepolia.arbiscan.io/address/0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60"
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"network": "Arbitrum One",
|
|
3
|
+
"networkKey": "Arbitrum",
|
|
4
|
+
"chainId": 42161,
|
|
5
|
+
"contractAddress": "0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60",
|
|
6
|
+
"version": "2.10.0",
|
|
7
|
+
"deployer": "0xab90062062A68576D9F2Be2fa3051e101f06AD93",
|
|
8
|
+
"transactionHash": "0x7033d592f9b0a87bb9164817ad129771bfe73eb09182e5a8ebddd64af5b339e9",
|
|
9
|
+
"blockNumber": 401371840,
|
|
10
|
+
"timestamp": "2025-11-18T00:11:09.100Z",
|
|
11
|
+
"explorerUrl": "https://arbiscan.io/address/0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60"
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"network": "Ethereum Sepolia",
|
|
3
|
+
"networkKey": "ETH Sepolia",
|
|
4
|
+
"chainId": 11155111,
|
|
5
|
+
"contractAddress": "0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60",
|
|
6
|
+
"version": "2.10.0",
|
|
7
|
+
"deployer": "0xab90062062A68576D9F2Be2fa3051e101f06AD93",
|
|
8
|
+
"transactionHash": "0x5c52fb8a16ccecfc68378bb5b0a4bb1b03a493b7e67bd96388bc8705582d528c",
|
|
9
|
+
"blockNumber": 9623207,
|
|
10
|
+
"timestamp": "2025-11-13T18:51:16.202Z",
|
|
11
|
+
"explorerUrl": "https://sepolia.etherscan.io/address/0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60"
|
|
12
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
require("@nomicfoundation/hardhat-verify");
|
|
2
|
+
|
|
3
|
+
/** @type import('hardhat/config').HardhatUserConfig */
|
|
4
|
+
module.exports = {
|
|
5
|
+
solidity: {
|
|
6
|
+
version: "0.8.20",
|
|
7
|
+
settings: {
|
|
8
|
+
optimizer: {
|
|
9
|
+
enabled: true,
|
|
10
|
+
runs: 200
|
|
11
|
+
},
|
|
12
|
+
evmVersion: "paris"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
paths: {
|
|
16
|
+
sources: "./src",
|
|
17
|
+
tests: "./test",
|
|
18
|
+
cache: "./cache",
|
|
19
|
+
artifacts: "./artifacts"
|
|
20
|
+
},
|
|
21
|
+
networks: {
|
|
22
|
+
// Ethereum Mainnet
|
|
23
|
+
ethereum: {
|
|
24
|
+
url: process.env.ETH_RPC_URL || "https://eth.llamarpc.com",
|
|
25
|
+
chainId: 1,
|
|
26
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
27
|
+
},
|
|
28
|
+
// Ethereum Sepolia
|
|
29
|
+
sepolia: {
|
|
30
|
+
url: process.env.SEPOLIA_RPC_URL || "https://rpc.sepolia.org",
|
|
31
|
+
chainId: 11155111,
|
|
32
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
33
|
+
},
|
|
34
|
+
// Base Mainnet
|
|
35
|
+
base: {
|
|
36
|
+
url: process.env.BASE_RPC_URL || "https://mainnet.base.org",
|
|
37
|
+
chainId: 8453,
|
|
38
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
39
|
+
},
|
|
40
|
+
// Base Sepolia
|
|
41
|
+
baseSepolia: {
|
|
42
|
+
url: process.env.BASE_SEPOLIA_RPC_URL || "https://sepolia.base.org",
|
|
43
|
+
chainId: 84532,
|
|
44
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
45
|
+
},
|
|
46
|
+
// Arbitrum One
|
|
47
|
+
arbitrum: {
|
|
48
|
+
url: process.env.ARBITRUM_RPC_URL || "https://arb1.arbitrum.io/rpc",
|
|
49
|
+
chainId: 42161,
|
|
50
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
51
|
+
},
|
|
52
|
+
// Arbitrum Sepolia
|
|
53
|
+
arbitrumSepolia: {
|
|
54
|
+
url: process.env.ARBITRUM_SEPOLIA_RPC_URL || "https://sepolia-rollup.arbitrum.io/rpc",
|
|
55
|
+
chainId: 421614,
|
|
56
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
57
|
+
},
|
|
58
|
+
// Polygon Mainnet
|
|
59
|
+
polygon: {
|
|
60
|
+
url: process.env.POLYGON_RPC_URL || "https://polygon.llamarpc.com",
|
|
61
|
+
chainId: 137,
|
|
62
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
63
|
+
},
|
|
64
|
+
// Polygon Sepolia (Amoy)
|
|
65
|
+
polygonSepolia: {
|
|
66
|
+
url: process.env.POLYGON_SEPOLIA_RPC_URL || "https://rpc-amoy.polygon.technology",
|
|
67
|
+
chainId: 80002,
|
|
68
|
+
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
etherscan: {
|
|
72
|
+
apiKey: {
|
|
73
|
+
// Etherscan API V2 - unified API key for all networks
|
|
74
|
+
mainnet: process.env.ETHERSCAN_API_KEY || "",
|
|
75
|
+
sepolia: process.env.ETHERSCAN_API_KEY || "",
|
|
76
|
+
base: process.env.ETHERSCAN_API_KEY || "",
|
|
77
|
+
baseSepolia: process.env.ETHERSCAN_API_KEY || "",
|
|
78
|
+
arbitrumOne: process.env.ETHERSCAN_API_KEY || "",
|
|
79
|
+
arbitrumSepolia: process.env.ETHERSCAN_API_KEY || "",
|
|
80
|
+
polygon: process.env.ETHERSCAN_API_KEY || "",
|
|
81
|
+
polygonMumbai: process.env.ETHERSCAN_API_KEY || ""
|
|
82
|
+
},
|
|
83
|
+
customChains: [
|
|
84
|
+
{
|
|
85
|
+
network: "baseSepolia",
|
|
86
|
+
chainId: 84532,
|
|
87
|
+
urls: {
|
|
88
|
+
apiURL: "https://api-sepolia.basescan.org/api",
|
|
89
|
+
browserURL: "https://sepolia.basescan.org"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
network: "arbitrumSepolia",
|
|
94
|
+
chainId: 421614,
|
|
95
|
+
urls: {
|
|
96
|
+
apiURL: "https://api-sepolia.arbiscan.io/api",
|
|
97
|
+
browserURL: "https://sepolia.arbiscan.io"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
network: "polygonSepolia",
|
|
102
|
+
chainId: 80002,
|
|
103
|
+
urls: {
|
|
104
|
+
apiURL: "https://api-amoy.polygonscan.com/api",
|
|
105
|
+
browserURL: "https://amoy.polygonscan.com"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
sourcify: {
|
|
111
|
+
enabled: false
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "neozip-contracts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "NeoZip NFT Smart Contracts - Isolated compilation and verification setup",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"compile": "hardhat compile",
|
|
8
|
+
"compile:extract": "node scripts/compile-and-extract.js",
|
|
9
|
+
"verify": "node scripts/verify-contract.js"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@nomicfoundation/hardhat-verify": "^2.0.0",
|
|
13
|
+
"@openzeppelin/contracts": "^5.4.0",
|
|
14
|
+
"hardhat": "^2.22.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"ethers": "^6.0.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|