neozipkit 0.1.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.
Files changed (330) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +371 -200
  3. package/contracts/ABI.txt +889 -0
  4. package/contracts/Bytecode.txt +1 -0
  5. package/contracts/COMPILATION_NOTES.md +59 -0
  6. package/contracts/QUICK_DEPLOY.md +286 -0
  7. package/contracts/README.md +256 -0
  8. package/contracts/VERIFICATION.md +308 -0
  9. package/contracts/deploy-interactive.js +448 -0
  10. package/contracts/deployment-arbitrum-sepolia.json +12 -0
  11. package/contracts/deployment-arbitrum.json +12 -0
  12. package/contracts/deployment-eth-sepolia.json +12 -0
  13. package/contracts/hardhat.config.js +114 -0
  14. package/contracts/package.json +20 -0
  15. package/contracts/scripts/compile-and-extract.js +119 -0
  16. package/contracts/scripts/verify-contract.js +223 -0
  17. package/contracts/src/{NZIP-NFT-Private.sol → NZIP-NFT-v2.0.sol} +66 -151
  18. package/contracts/src/NZIP-NFT.sol +9 -15
  19. package/dist/{browser → blockchain/browser}/TokenVerifierBrowser.d.ts +11 -20
  20. package/dist/blockchain/browser/TokenVerifierBrowser.d.ts.map +1 -0
  21. package/dist/{browser → blockchain/browser}/TokenVerifierBrowser.js +106 -92
  22. package/dist/blockchain/browser/TokenVerifierBrowser.js.map +1 -0
  23. package/dist/blockchain/browser/WalletManagerBrowser.d.ts +98 -0
  24. package/dist/blockchain/browser/WalletManagerBrowser.d.ts.map +1 -0
  25. package/dist/blockchain/browser/WalletManagerBrowser.js +434 -0
  26. package/dist/blockchain/browser/WalletManagerBrowser.js.map +1 -0
  27. package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts +58 -0
  28. package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts.map +1 -0
  29. package/dist/blockchain/browser/ZipkitMinterBrowser.js +317 -0
  30. package/dist/blockchain/browser/ZipkitMinterBrowser.js.map +1 -0
  31. package/dist/blockchain/browser/index.d.ts +11 -0
  32. package/dist/blockchain/browser/index.d.ts.map +1 -0
  33. package/dist/blockchain/browser/index.js +16 -0
  34. package/dist/blockchain/browser/index.js.map +1 -0
  35. package/dist/{server/blockchain/WalletAnalyzer.d.ts → blockchain/core/WalletManager.d.ts} +69 -26
  36. package/dist/blockchain/core/WalletManager.d.ts.map +1 -0
  37. package/dist/{server/blockchain/WalletAnalyzer.js → blockchain/core/WalletManager.js} +172 -160
  38. package/dist/blockchain/core/WalletManager.js.map +1 -0
  39. package/dist/blockchain/core/ZipkitMinter.d.ts +141 -0
  40. package/dist/blockchain/core/ZipkitMinter.d.ts.map +1 -0
  41. package/dist/blockchain/core/ZipkitMinter.js +548 -0
  42. package/dist/blockchain/core/ZipkitMinter.js.map +1 -0
  43. package/dist/blockchain/core/ZipkitOTS.d.ts +126 -0
  44. package/dist/blockchain/core/ZipkitOTS.d.ts.map +1 -0
  45. package/dist/blockchain/core/ZipkitOTS.js +506 -0
  46. package/dist/blockchain/core/ZipkitOTS.js.map +1 -0
  47. package/dist/blockchain/core/ZipkitVerifier.d.ts +177 -0
  48. package/dist/blockchain/core/ZipkitVerifier.d.ts.map +1 -0
  49. package/dist/blockchain/core/ZipkitVerifier.js +632 -0
  50. package/dist/blockchain/core/ZipkitVerifier.js.map +1 -0
  51. package/dist/blockchain/core/contracts.d.ts +83 -0
  52. package/dist/blockchain/core/contracts.d.ts.map +1 -0
  53. package/dist/blockchain/core/contracts.js +341 -0
  54. package/dist/blockchain/core/contracts.js.map +1 -0
  55. package/dist/blockchain/core/index.d.ts +12 -0
  56. package/dist/blockchain/core/index.d.ts.map +1 -0
  57. package/dist/blockchain/core/index.js +59 -0
  58. package/dist/blockchain/core/index.js.map +1 -0
  59. package/dist/blockchain/index.d.ts +11 -0
  60. package/dist/blockchain/index.d.ts.map +1 -0
  61. package/dist/blockchain/index.js +34 -0
  62. package/dist/blockchain/index.js.map +1 -0
  63. package/dist/blockchain/node/WalletManagerNode.d.ts +47 -0
  64. package/dist/blockchain/node/WalletManagerNode.d.ts.map +1 -0
  65. package/dist/blockchain/node/WalletManagerNode.js +203 -0
  66. package/dist/blockchain/node/WalletManagerNode.js.map +1 -0
  67. package/dist/blockchain/node/index.d.ts +12 -0
  68. package/dist/blockchain/node/index.d.ts.map +1 -0
  69. package/dist/blockchain/node/index.js +24 -0
  70. package/dist/blockchain/node/index.js.map +1 -0
  71. package/dist/browser/ZipkitBrowser.d.ts +27 -0
  72. package/dist/browser/ZipkitBrowser.d.ts.map +1 -0
  73. package/dist/browser/{ZipKitBrowser.js → ZipkitBrowser.js} +96 -43
  74. package/dist/browser/ZipkitBrowser.js.map +1 -0
  75. package/dist/browser/index.d.ts +12 -0
  76. package/dist/browser/index.d.ts.map +1 -0
  77. package/dist/browser/index.js +42 -0
  78. package/dist/browser/index.js.map +1 -0
  79. package/dist/browser-esm/index.d.ts +12 -0
  80. package/dist/browser-esm/index.js +59559 -0
  81. package/dist/browser-esm/index.js.map +7 -0
  82. package/dist/browser-umd/index.d.ts +12 -0
  83. package/dist/browser-umd/index.js +59576 -0
  84. package/dist/browser-umd/index.js.map +7 -0
  85. package/dist/browser-umd/index.min.js +63 -0
  86. package/dist/browser.d.ts +8 -17
  87. package/dist/browser.js +13 -29
  88. package/dist/core/ZipCompress.d.ts +99 -0
  89. package/dist/core/ZipCompress.d.ts.map +1 -0
  90. package/dist/core/ZipCompress.js +309 -0
  91. package/dist/core/ZipCompress.js.map +1 -0
  92. package/dist/core/ZipDecompress.d.ts +58 -0
  93. package/dist/core/ZipDecompress.d.ts.map +1 -0
  94. package/dist/core/ZipDecompress.js +172 -0
  95. package/dist/core/ZipDecompress.js.map +1 -0
  96. package/dist/{shared → core}/ZipEntry.d.ts +8 -1
  97. package/dist/core/ZipEntry.d.ts.map +1 -0
  98. package/dist/{shared → core}/ZipEntry.js +224 -81
  99. package/dist/core/ZipEntry.js.map +1 -0
  100. package/dist/core/Zipkit.d.ts +315 -0
  101. package/dist/core/Zipkit.d.ts.map +1 -0
  102. package/dist/core/Zipkit.js +647 -0
  103. package/dist/core/Zipkit.js.map +1 -0
  104. package/dist/core/components/HashCalculator.d.ts +138 -0
  105. package/dist/core/components/HashCalculator.d.ts.map +1 -0
  106. package/dist/core/components/HashCalculator.js +360 -0
  107. package/dist/core/components/HashCalculator.js.map +1 -0
  108. package/dist/core/components/Logger.d.ts +73 -0
  109. package/dist/core/components/Logger.d.ts.map +1 -0
  110. package/dist/core/components/Logger.js +156 -0
  111. package/dist/core/components/Logger.js.map +1 -0
  112. package/dist/core/components/ProgressTracker.d.ts +43 -0
  113. package/dist/core/components/ProgressTracker.d.ts.map +1 -0
  114. package/dist/core/components/ProgressTracker.js +112 -0
  115. package/dist/core/components/ProgressTracker.js.map +1 -0
  116. package/dist/{shared → core}/components/Support.d.ts +1 -0
  117. package/dist/core/components/Support.d.ts.map +1 -0
  118. package/dist/{shared → core}/components/Support.js +1 -0
  119. package/dist/core/components/Support.js.map +1 -0
  120. package/dist/{shared → core}/components/Util.d.ts +7 -2
  121. package/dist/core/components/Util.d.ts.map +1 -0
  122. package/dist/{shared → core}/components/Util.js +14 -34
  123. package/dist/core/components/Util.js.map +1 -0
  124. package/dist/{shared → core}/constants/Errors.d.ts +1 -2
  125. package/dist/core/constants/Errors.d.ts.map +1 -0
  126. package/dist/{shared → core}/constants/Errors.js +1 -3
  127. package/dist/core/constants/Errors.js.map +1 -0
  128. package/dist/{shared → core}/constants/Headers.d.ts +3 -0
  129. package/dist/core/constants/Headers.d.ts.map +1 -0
  130. package/dist/{shared → core}/constants/Headers.js +20 -17
  131. package/dist/core/constants/Headers.js.map +1 -0
  132. package/dist/core/encryption/Manager.d.ts +58 -0
  133. package/dist/core/encryption/Manager.d.ts.map +1 -0
  134. package/dist/core/encryption/Manager.js +121 -0
  135. package/dist/core/encryption/Manager.js.map +1 -0
  136. package/dist/core/encryption/ZipCrypto.d.ts +172 -0
  137. package/dist/core/encryption/ZipCrypto.d.ts.map +1 -0
  138. package/dist/core/encryption/ZipCrypto.js +554 -0
  139. package/dist/core/encryption/ZipCrypto.js.map +1 -0
  140. package/dist/core/encryption/index.d.ts +9 -0
  141. package/dist/core/encryption/index.d.ts.map +1 -0
  142. package/dist/core/encryption/index.js +17 -0
  143. package/dist/core/encryption/index.js.map +1 -0
  144. package/dist/core/encryption/types.d.ts +29 -0
  145. package/dist/core/encryption/types.d.ts.map +1 -0
  146. package/dist/core/encryption/types.js +12 -0
  147. package/dist/core/encryption/types.js.map +1 -0
  148. package/dist/core/index.d.ts +24 -0
  149. package/dist/core/index.d.ts.map +1 -0
  150. package/dist/core/index.js +57 -0
  151. package/dist/core/index.js.map +1 -0
  152. package/dist/{shared → core}/version.d.ts +1 -0
  153. package/dist/core/version.d.ts.map +1 -0
  154. package/dist/core/version.js +31 -0
  155. package/dist/core/version.js.map +1 -0
  156. package/dist/index.d.ts +8 -25
  157. package/dist/index.d.ts.map +1 -0
  158. package/dist/index.js +29 -47
  159. package/dist/index.js.map +1 -0
  160. package/dist/node/ZipCompressNode.d.ts +123 -0
  161. package/dist/node/ZipCompressNode.d.ts.map +1 -0
  162. package/dist/node/ZipCompressNode.js +576 -0
  163. package/dist/node/ZipCompressNode.js.map +1 -0
  164. package/dist/node/ZipDecompressNode.d.ts +120 -0
  165. package/dist/node/ZipDecompressNode.d.ts.map +1 -0
  166. package/dist/node/ZipDecompressNode.js +461 -0
  167. package/dist/node/ZipDecompressNode.js.map +1 -0
  168. package/dist/node/ZipkitNode.d.ts +406 -0
  169. package/dist/node/ZipkitNode.d.ts.map +1 -0
  170. package/dist/node/ZipkitNode.js +1305 -0
  171. package/dist/node/ZipkitNode.js.map +1 -0
  172. package/dist/node/index.d.ts +26 -0
  173. package/dist/node/index.d.ts.map +1 -0
  174. package/dist/node/index.js +65 -0
  175. package/dist/node/index.js.map +1 -0
  176. package/dist/types/index.d.ts +59 -0
  177. package/dist/types/index.d.ts.map +1 -0
  178. package/dist/types/index.js +36 -1
  179. package/dist/types/index.js.map +1 -0
  180. package/examples/README.md +269 -0
  181. package/examples/blockchain-tokenize.ts +354 -0
  182. package/examples/create-zip.ts +172 -0
  183. package/examples/extract-zip.ts +158 -0
  184. package/examples/list-zip.ts +161 -0
  185. package/examples/test-files/data.json +116 -0
  186. package/examples/test-files/document.md +80 -0
  187. package/examples/test-files/document.txt +2 -0
  188. package/examples/test-files/file1.txt +48 -0
  189. package/examples/test-files/file2.txt +80 -0
  190. package/examples/tsconfig.json +44 -0
  191. package/examples/unzip-token.ts +6 -3
  192. package/examples/verify-tokenized-zip.ts +305 -0
  193. package/package.json +117 -23
  194. package/src/blockchain/README.md +222 -0
  195. package/src/{browser → blockchain/browser}/TokenVerifierBrowser.ts +125 -79
  196. package/src/blockchain/browser/WalletManagerBrowser.ts +486 -0
  197. package/src/blockchain/browser/ZipkitMinterBrowser.ts +400 -0
  198. package/src/blockchain/browser/index.ts +13 -0
  199. package/src/blockchain/core/WalletManager.ts +436 -0
  200. package/src/blockchain/core/ZipkitMinter.ts +716 -0
  201. package/src/blockchain/core/ZipkitOTS.ts +588 -0
  202. package/src/blockchain/core/ZipkitVerifier.ts +853 -0
  203. package/src/blockchain/core/contracts.ts +370 -0
  204. package/src/blockchain/core/index.ts +71 -0
  205. package/src/blockchain/index.ts +27 -0
  206. package/src/blockchain/node/WalletManagerNode.ts +171 -0
  207. package/src/blockchain/node/index.ts +40 -0
  208. package/src/browser/{ZipKitBrowser.ts → ZipkitBrowser.ts} +104 -41
  209. package/src/browser/index.esm.ts +37 -0
  210. package/src/browser/index.ts +25 -0
  211. package/src/core/ZipCompress.ts +398 -0
  212. package/src/core/ZipDecompress.ts +212 -0
  213. package/src/{shared → core}/ZipEntry.ts +239 -89
  214. package/src/core/Zipkit.ts +794 -0
  215. package/src/core/components/HashCalculator.ts +384 -0
  216. package/src/core/components/Logger.ts +180 -0
  217. package/src/core/components/ProgressTracker.ts +134 -0
  218. package/src/{shared → core}/components/Util.ts +12 -34
  219. package/src/{shared → core}/constants/Errors.ts +0 -4
  220. package/src/{shared → core}/constants/Headers.ts +19 -17
  221. package/src/core/encryption/Manager.ts +137 -0
  222. package/src/core/encryption/ZipCrypto.ts +650 -0
  223. package/src/core/encryption/index.ts +15 -0
  224. package/src/core/encryption/types.ts +33 -0
  225. package/src/core/index.ts +34 -0
  226. package/src/core/version.ts +33 -0
  227. package/src/index.ts +54 -32
  228. package/src/node/ZipCompressNode.ts +632 -0
  229. package/src/node/ZipDecompressNode.ts +508 -0
  230. package/src/node/ZipkitNode.ts +1559 -0
  231. package/src/node/index.ts +69 -0
  232. package/src/types/index.ts +131 -1
  233. package/src/types/opentimestamps.d.ts +1 -23
  234. package/contracts/Lock.sol +0 -34
  235. package/contracts/bytecode.txt +0 -1
  236. package/contracts/compile-contract.js +0 -168
  237. package/contracts/deploy/deploy-both-contracts.js +0 -286
  238. package/contracts/deploy/deploy-enhanced-contract.js +0 -197
  239. package/contracts/deploy/deploy-private-contract.js +0 -190
  240. package/contracts/deploy/deploy-public-clean.js +0 -1063
  241. package/contracts/deploy/deploy-public-contract.js +0 -1107
  242. package/contracts/deployment.config.example.js +0 -25
  243. package/contracts/remix-compile.js +0 -222
  244. package/contracts/setup-deployment.js +0 -51
  245. package/contracts/src/ZipFileNFT-DEPRECATED-6field.sol +0 -260
  246. package/contracts/src/ZipFileNFT-DEPRECATED-Enhanced.sol +0 -289
  247. package/dist/browser/CertificateGeneratorBrowser.d.ts +0 -75
  248. package/dist/browser/CertificateGeneratorBrowser.js +0 -433
  249. package/dist/browser/ZipKitBrowser.d.ts +0 -18
  250. package/dist/browser/ZipKitStampBrowser.d.ts +0 -2
  251. package/dist/browser/ZipKitStampBrowser.js +0 -12
  252. package/dist/browser-index.d.ts +0 -21
  253. package/dist/browser-index.js +0 -58
  254. package/dist/server/blockchain/CertificateToken.d.ts +0 -48
  255. package/dist/server/blockchain/CertificateToken.js +0 -386
  256. package/dist/server/blockchain/NFTMinter.d.ts +0 -41
  257. package/dist/server/blockchain/NFTMinter.js +0 -323
  258. package/dist/server/blockchain/TokenQuerier.d.ts +0 -31
  259. package/dist/server/blockchain/TokenQuerier.js +0 -259
  260. package/dist/server/blockchain/TokenVerifier.d.ts +0 -20
  261. package/dist/server/blockchain/TokenVerifier.js +0 -395
  262. package/dist/server/blockchain/WalletFormatter.d.ts +0 -39
  263. package/dist/server/blockchain/WalletFormatter.js +0 -196
  264. package/dist/server/blockchain/WalletManager.d.ts +0 -46
  265. package/dist/server/blockchain/WalletManager.js +0 -294
  266. package/dist/server/blockchain/ZipMetadata.d.ts +0 -27
  267. package/dist/server/blockchain/ZipMetadata.js +0 -131
  268. package/dist/server/blockchain/ZipTokenProcessor.d.ts +0 -44
  269. package/dist/server/blockchain/ZipTokenProcessor.js +0 -204
  270. package/dist/server/blockchain/constants.d.ts +0 -102
  271. package/dist/server/blockchain/constants.js +0 -968
  272. package/dist/server/blockchain/index.d.ts +0 -9
  273. package/dist/server/blockchain/index.js +0 -44
  274. package/dist/server/blockchain/test-certificate.d.ts +0 -8
  275. package/dist/server/blockchain/test-certificate.js +0 -100
  276. package/dist/server/blockchain/types.d.ts +0 -69
  277. package/dist/server/blockchain/types.js +0 -51
  278. package/dist/server/platform/server/ZipKitServer.d.ts +0 -105
  279. package/dist/server/platform/server/ZipKitServer.js +0 -437
  280. package/dist/server/platform/servercomponents/ZipKitOTS.d.ts +0 -91
  281. package/dist/server/platform/servercomponents/ZipKitOTS.js +0 -271
  282. package/dist/shared/ZipKit.d.ts +0 -249
  283. package/dist/shared/ZipKit.js +0 -789
  284. package/dist/shared/components/CertificateOTS.d.ts +0 -15
  285. package/dist/shared/components/CertificateOTS.js +0 -116
  286. package/dist/shared/components/FileSys.d.ts +0 -2
  287. package/dist/shared/components/FileSys.js +0 -113
  288. package/dist/shared/components/HashAccumulator.d.ts +0 -55
  289. package/dist/shared/components/HashAccumulator.js +0 -100
  290. package/dist/shared/components/ZipCrypto.d.ts +0 -3
  291. package/dist/shared/components/ZipCrypto.js +0 -78
  292. package/dist/shared/components/merkleTree.d.ts +0 -66
  293. package/dist/shared/components/merkleTree.js +0 -136
  294. package/dist/shared/types/index.d.ts +0 -21
  295. package/dist/shared/types/index.js +0 -3
  296. package/dist/shared/types.d.ts +0 -33
  297. package/dist/shared/types.js +0 -8
  298. package/dist/shared/version.js +0 -7
  299. package/src/browser/CertificateGeneratorBrowser.ts +0 -498
  300. package/src/browser/ZipKitStampBrowser.ts +0 -9
  301. package/src/browser-index.ts +0 -36
  302. package/src/server/blockchain/CertificateToken.ts +0 -444
  303. package/src/server/blockchain/NFTMinter.ts +0 -357
  304. package/src/server/blockchain/TokenQuerier.ts +0 -287
  305. package/src/server/blockchain/TokenVerifier.ts +0 -453
  306. package/src/server/blockchain/WalletAnalyzer.ts +0 -397
  307. package/src/server/blockchain/WalletFormatter.ts +0 -206
  308. package/src/server/blockchain/WalletManager.ts +0 -294
  309. package/src/server/blockchain/ZipMetadata.ts +0 -117
  310. package/src/server/blockchain/ZipTokenProcessor.ts +0 -234
  311. package/src/server/blockchain/constants.ts +0 -969
  312. package/src/server/blockchain/index.ts +0 -42
  313. package/src/server/blockchain/test-certificate.ts +0 -137
  314. package/src/server/blockchain/types.ts +0 -134
  315. package/src/server/platform/server/ZipKitServer.ts +0 -459
  316. package/src/server/platform/servercomponents/ZipKitOTS.ts +0 -313
  317. package/src/server/platform/servercomponents/opentimestamps.d.ts +0 -23
  318. package/src/shared/ZipKit.ts +0 -899
  319. package/src/shared/components/CertificateOTS.ts +0 -132
  320. package/src/shared/components/FileSys.ts +0 -87
  321. package/src/shared/components/HashAccumulator.ts +0 -113
  322. package/src/shared/components/ZipCrypto.ts +0 -91
  323. package/src/shared/components/merkleTree.ts +0 -162
  324. package/src/shared/types/index.ts +0 -25
  325. package/src/shared/types/modules.d.ts +0 -22
  326. package/src/shared/types/opentimestamps.d.ts +0 -23
  327. package/src/shared/types.d.ts +0 -8
  328. package/src/shared/types.ts +0 -43
  329. package/src/shared/version.ts +0 -4
  330. /package/src/{shared → core}/components/Support.ts +0 -0
@@ -0,0 +1,308 @@
1
+ # Contract Verification Guide
2
+
3
+ This guide explains how to verify your deployed NeoZip NFT contract on blockchain scanners using Hardhat and Etherscan API V2.
4
+
5
+ ## Overview
6
+
7
+ Contract verification makes your contract's source code publicly visible on block explorers, allowing users to:
8
+ - View and audit the contract source code
9
+ - Interact with the contract through the explorer's UI
10
+ - Verify that the deployed bytecode matches the source code
11
+
12
+ All verification uses **Etherscan API V2**, which is the unified API for Etherscan and its family of block explorers (Arbiscan, Basescan, Polygonscan, etc.).
13
+
14
+ ## Prerequisites
15
+
16
+ 1. **Etherscan API Key**: Get a free API key from [Etherscan](https://etherscan.io/apis)
17
+ - This single API key works for all Etherscan-based explorers (Etherscan, Arbiscan, Basescan, Polygonscan)
18
+ - No need for separate API keys per network
19
+
20
+ 2. **Hardhat Setup**: Ensure you've installed dependencies:
21
+ ```bash
22
+ cd contracts
23
+ yarn install
24
+ ```
25
+
26
+ 3. **Environment Variable**: Set your Etherscan API key:
27
+ ```bash
28
+ export ETHERSCAN_API_KEY=your_api_key_here
29
+ ```
30
+
31
+ Or add it to `hardhat.config.js`:
32
+ ```javascript
33
+ etherscan: {
34
+ apiKey: {
35
+ mainnet: "your_api_key_here",
36
+ // ... other networks
37
+ }
38
+ }
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ### Step 1: Compile the Contract
44
+
45
+ Before deploying, compile the contract to generate compiled ABI and bytecode:
46
+
47
+ ```bash
48
+ cd contracts
49
+ yarn compile:extract
50
+ ```
51
+
52
+ This will:
53
+ - Compile `src/NZIP-NFT.sol` using Hardhat
54
+ - Extract the ABI and write it to `ABI-compiled.txt`
55
+ - Extract the bytecode and write it to `Bytecode-compiled.txt`
56
+
57
+ **⚠️ IMPORTANT:** The compilation script does NOT overwrite `ABI.txt` and `Bytecode.txt` (these are the deployed versions that match contracts already on-chain). The compiled files are written to `ABI-compiled.txt` and `Bytecode-compiled.txt` for review. Only manually copy them to `ABI.txt` and `Bytecode.txt` if you want to use the new compilation for deployment.
58
+
59
+ ### Step 2: Deploy the Contract
60
+
61
+ Deploy using the interactive deployment script:
62
+
63
+ ```bash
64
+ cd contracts
65
+ node deploy-interactive.js
66
+ ```
67
+
68
+ Or use any other deployment method. Make sure to save the contract address.
69
+
70
+ ### Step 3: Verify the Contract
71
+
72
+ After deployment, verify the contract:
73
+
74
+ ```bash
75
+ cd contracts
76
+ yarn verify <contractAddress> <network>
77
+ ```
78
+
79
+ **Examples:**
80
+ ```bash
81
+ # Verify on Arbitrum Sepolia
82
+ yarn verify 0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60 arbitrumSepolia
83
+
84
+ # Verify on Ethereum Sepolia
85
+ yarn verify 0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60 sepolia
86
+
87
+ # Verify on Base Sepolia
88
+ yarn verify 0x2716c4609fD97DaEdF429BC4B4Ec2faa81e2cC60 baseSepolia
89
+ ```
90
+
91
+ ## Supported Networks
92
+
93
+ The verification script supports the following networks:
94
+
95
+ | Network Name | Hardhat Config Name | Explorer |
96
+ |-------------|---------------------|----------|
97
+ | Ethereum Mainnet | `ethereum` | [Etherscan](https://etherscan.io) |
98
+ | Ethereum Sepolia | `sepolia` | [Sepolia Etherscan](https://sepolia.etherscan.io) |
99
+ | Base Mainnet | `base` | [Basescan](https://basescan.org) |
100
+ | Base Sepolia | `baseSepolia` | [Base Sepolia Explorer](https://sepolia.basescan.org) |
101
+ | Arbitrum One | `arbitrum` | [Arbiscan](https://arbiscan.io) |
102
+ | Arbitrum Sepolia | `arbitrumSepolia` | [Arbitrum Sepolia Explorer](https://sepolia.arbiscan.io) |
103
+ | Polygon Mainnet | `polygon` | [Polygonscan](https://polygonscan.com) |
104
+ | Polygon Sepolia (Amoy) | `polygonSepolia` | [Amoy Polygonscan](https://amoy.polygonscan.com) |
105
+
106
+ ### Network Name Aliases
107
+
108
+ You can use any of these names when verifying:
109
+ - `sepolia`, `eth-sepolia`, `ethereum-sepolia`
110
+ - `baseSepolia`, `base-sepolia`
111
+ - `arbitrumSepolia`, `arbitrum-sepolia`
112
+ - `polygonSepolia`, `polygon-sepolia`, `amoy`
113
+
114
+ ## Detailed Verification Steps
115
+
116
+ ### 1. Get Your Etherscan API Key
117
+
118
+ 1. Visit [Etherscan API](https://etherscan.io/apis)
119
+ 2. Sign up or log in to your Etherscan account
120
+ 3. Create a new API key
121
+ 4. Copy the API key
122
+
123
+ ### 2. Set the API Key
124
+
125
+ **Option A: Environment Variable (Recommended)**
126
+ ```bash
127
+ export ETHERSCAN_API_KEY=your_api_key_here
128
+ ```
129
+
130
+ **Option B: hardhat.config.js**
131
+ ```javascript
132
+ etherscan: {
133
+ apiKey: {
134
+ mainnet: "your_api_key_here",
135
+ sepolia: "your_api_key_here",
136
+ // ... same key for all networks
137
+ }
138
+ }
139
+ ```
140
+
141
+ ### 3. Verify the Contract
142
+
143
+ ```bash
144
+ cd contracts
145
+ yarn verify <contractAddress> <network>
146
+ ```
147
+
148
+ The script will:
149
+ 1. Validate the contract address
150
+ 2. Check network configuration
151
+ 3. Verify the API key is set
152
+ 4. Submit verification request to the appropriate explorer
153
+ 5. Display the explorer URL once verified
154
+
155
+ ## Troubleshooting
156
+
157
+ ### Error: "Etherscan API key not found"
158
+
159
+ **Solution:**
160
+ - Set the `ETHERSCAN_API_KEY` environment variable
161
+ - Or add it to `hardhat.config.js` in the `etherscan.apiKey` section
162
+
163
+ ### Error: "Bytecode mismatch"
164
+
165
+ This error means the deployed bytecode doesn't match the compiled source code.
166
+
167
+ **Common Causes:**
168
+ 1. Contract was compiled with different compiler settings
169
+ 2. Source code has changed since deployment
170
+ 3. Different Solidity version was used
171
+
172
+ **Solutions:**
173
+ 1. **Recompile and redeploy:**
174
+ ```bash
175
+ cd contracts
176
+ yarn compile:extract
177
+ # Redeploy with new bytecode
178
+ node deploy-interactive.js
179
+ # Verify again
180
+ yarn verify <address> <network>
181
+ ```
182
+
183
+ 2. **Match exact compiler settings:**
184
+ - Check the deployed contract's compiler version on the explorer
185
+ - Update `hardhat.config.js` to match:
186
+ ```javascript
187
+ solidity: {
188
+ version: "0.8.19", // Match deployed version
189
+ settings: {
190
+ optimizer: {
191
+ enabled: true,
192
+ runs: 200 // Match deployed settings
193
+ }
194
+ }
195
+ }
196
+ ```
197
+
198
+ ### Error: "Already Verified"
199
+
200
+ This is not an error! The contract is already verified on the explorer. You can view it on the explorer's website.
201
+
202
+ ### Error: "Network not configured"
203
+
204
+ **Solution:**
205
+ - Check that the network name matches one in `hardhat.config.js`
206
+ - Use the exact network name from the config (e.g., `arbitrumSepolia`, not `arbitrum-sepolia`)
207
+
208
+ ### Verification Takes Too Long
209
+
210
+ Verification can take 30 seconds to several minutes depending on:
211
+ - Network congestion
212
+ - Explorer API response time
213
+ - Contract complexity
214
+
215
+ Wait for the process to complete. If it times out, try again after a few minutes.
216
+
217
+ ## Compiler Settings
218
+
219
+ The contract is compiled with these settings (defined in `hardhat.config.js`):
220
+
221
+ ```javascript
222
+ solidity: {
223
+ version: "0.8.20",
224
+ settings: {
225
+ optimizer: {
226
+ enabled: true,
227
+ runs: 200
228
+ },
229
+ evmVersion: "paris"
230
+ }
231
+ }
232
+ ```
233
+
234
+ **Important:** When deploying, ensure these settings match. If you deploy with different settings, verification will fail with a bytecode mismatch.
235
+
236
+ ## Manual Verification (Alternative)
237
+
238
+ If automatic verification fails, you can verify manually on the explorer:
239
+
240
+ 1. Visit the contract address on the appropriate explorer
241
+ 2. Click "Contract" tab
242
+ 3. Click "Verify and Publish"
243
+ 4. Select "Via Standard JSON Input" (recommended) or "Via Solidity (Single file)"
244
+ 5. Fill in the required information:
245
+ - Compiler version: `0.8.20`
246
+ - Optimization: `Yes` (200 runs)
247
+ - EVM Version: `Paris`
248
+ 6. Upload the Standard JSON Input or flattened contract source
249
+
250
+ ## Best Practices
251
+
252
+ 1. **Always compile before deploying:**
253
+ ```bash
254
+ yarn compile:extract
255
+ ```
256
+
257
+ 2. **Verify immediately after deployment:**
258
+ - Verification is easier when done right after deployment
259
+ - The contract is fresh in the explorer's cache
260
+
261
+ 3. **Keep compiler settings consistent:**
262
+ - Use the same settings for compilation and deployment
263
+ - Document any changes to compiler settings
264
+
265
+ 4. **Test on testnets first:**
266
+ - Verify on testnets (Sepolia, Base Sepolia, Arbitrum Sepolia) before mainnet
267
+ - Testnets are free and help catch issues early
268
+
269
+ 5. **Save deployment information:**
270
+ - Keep a record of deployed addresses and networks
271
+ - Note the compiler settings used for each deployment
272
+
273
+ ## Network-Specific Notes
274
+
275
+ ### Arbitrum Sepolia
276
+
277
+ - Uses Etherscan API V2 (same as other networks)
278
+ - API endpoint: `https://api-sepolia.arbiscan.io/api`
279
+ - Explorer: `https://sepolia.arbiscan.io`
280
+
281
+ ### Base Sepolia
282
+
283
+ - Uses Basescan (Etherscan-based)
284
+ - API endpoint: `https://api-sepolia.basescan.org/api`
285
+ - Explorer: `https://sepolia.basescan.org`
286
+
287
+ ### Polygon Sepolia (Amoy)
288
+
289
+ - Uses Polygonscan (Etherscan-based)
290
+ - API endpoint: `https://api-amoy.polygonscan.com/api`
291
+ - Explorer: `https://amoy.polygonscan.com`
292
+
293
+ ## Additional Resources
294
+
295
+ - [Etherscan API Documentation](https://docs.etherscan.io/)
296
+ - [Hardhat Verification Plugin](https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify)
297
+ - [OpenZeppelin Contracts](https://docs.openzeppelin.com/contracts) (used by NZIP-NFT.sol)
298
+
299
+ ## Support
300
+
301
+ If you encounter issues not covered in this guide:
302
+
303
+ 1. Check the error message carefully
304
+ 2. Verify your API key is correct and active
305
+ 3. Ensure the network is properly configured
306
+ 4. Try recompiling and redeploying if bytecode mismatch occurs
307
+ 5. Check the explorer's status page for API issues
308
+