neozipkit 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +400 -0
  2. package/contracts/Lock.sol +34 -0
  3. package/contracts/bytecode.txt +1 -0
  4. package/contracts/compile-contract.js +168 -0
  5. package/contracts/deploy/deploy-both-contracts.js +286 -0
  6. package/contracts/deploy/deploy-enhanced-contract.js +197 -0
  7. package/contracts/deploy/deploy-private-contract.js +190 -0
  8. package/contracts/deploy/deploy-public-clean.js +1063 -0
  9. package/contracts/deploy/deploy-public-contract.js +1107 -0
  10. package/contracts/deployment.config.example.js +25 -0
  11. package/contracts/remix-compile.js +222 -0
  12. package/contracts/setup-deployment.js +51 -0
  13. package/contracts/src/NZIP-NFT-Private.sol +350 -0
  14. package/contracts/src/NZIP-NFT.sol +265 -0
  15. package/contracts/src/ZipFileNFT-DEPRECATED-6field.sol +260 -0
  16. package/contracts/src/ZipFileNFT-DEPRECATED-Enhanced.sol +289 -0
  17. package/dist/browser/CertificateGeneratorBrowser.d.ts +75 -0
  18. package/dist/browser/CertificateGeneratorBrowser.js +433 -0
  19. package/dist/browser/TokenVerifierBrowser.d.ts +76 -0
  20. package/dist/browser/TokenVerifierBrowser.js +299 -0
  21. package/dist/browser/ZipKitBrowser.d.ts +18 -0
  22. package/dist/browser/ZipKitBrowser.js +250 -0
  23. package/dist/browser/ZipKitStampBrowser.d.ts +2 -0
  24. package/dist/browser/ZipKitStampBrowser.js +12 -0
  25. package/dist/browser-index.d.ts +21 -0
  26. package/dist/browser-index.js +58 -0
  27. package/dist/browser.d.ts +21 -0
  28. package/dist/browser.js +58 -0
  29. package/dist/index.d.ts +29 -0
  30. package/dist/index.js +76 -0
  31. package/dist/server/blockchain/CertificateToken.d.ts +48 -0
  32. package/dist/server/blockchain/CertificateToken.js +386 -0
  33. package/dist/server/blockchain/NFTMinter.d.ts +41 -0
  34. package/dist/server/blockchain/NFTMinter.js +323 -0
  35. package/dist/server/blockchain/TokenQuerier.d.ts +31 -0
  36. package/dist/server/blockchain/TokenQuerier.js +259 -0
  37. package/dist/server/blockchain/TokenVerifier.d.ts +20 -0
  38. package/dist/server/blockchain/TokenVerifier.js +395 -0
  39. package/dist/server/blockchain/WalletAnalyzer.d.ts +81 -0
  40. package/dist/server/blockchain/WalletAnalyzer.js +356 -0
  41. package/dist/server/blockchain/WalletFormatter.d.ts +39 -0
  42. package/dist/server/blockchain/WalletFormatter.js +196 -0
  43. package/dist/server/blockchain/WalletManager.d.ts +46 -0
  44. package/dist/server/blockchain/WalletManager.js +294 -0
  45. package/dist/server/blockchain/ZipMetadata.d.ts +27 -0
  46. package/dist/server/blockchain/ZipMetadata.js +131 -0
  47. package/dist/server/blockchain/ZipTokenProcessor.d.ts +44 -0
  48. package/dist/server/blockchain/ZipTokenProcessor.js +204 -0
  49. package/dist/server/blockchain/constants.d.ts +102 -0
  50. package/dist/server/blockchain/constants.js +968 -0
  51. package/dist/server/blockchain/index.d.ts +9 -0
  52. package/dist/server/blockchain/index.js +44 -0
  53. package/dist/server/blockchain/test-certificate.d.ts +8 -0
  54. package/dist/server/blockchain/test-certificate.js +100 -0
  55. package/dist/server/blockchain/types.d.ts +69 -0
  56. package/dist/server/blockchain/types.js +51 -0
  57. package/dist/server/platform/server/ZipKitServer.d.ts +105 -0
  58. package/dist/server/platform/server/ZipKitServer.js +437 -0
  59. package/dist/server/platform/servercomponents/ZipKitOTS.d.ts +91 -0
  60. package/dist/server/platform/servercomponents/ZipKitOTS.js +271 -0
  61. package/dist/shared/ZipEntry.d.ts +131 -0
  62. package/dist/shared/ZipEntry.js +686 -0
  63. package/dist/shared/ZipKit.d.ts +249 -0
  64. package/dist/shared/ZipKit.js +789 -0
  65. package/dist/shared/components/CertificateOTS.d.ts +15 -0
  66. package/dist/shared/components/CertificateOTS.js +116 -0
  67. package/dist/shared/components/FileSys.d.ts +2 -0
  68. package/dist/shared/components/FileSys.js +113 -0
  69. package/dist/shared/components/HashAccumulator.d.ts +55 -0
  70. package/dist/shared/components/HashAccumulator.js +100 -0
  71. package/dist/shared/components/Support.d.ts +63 -0
  72. package/dist/shared/components/Support.js +70 -0
  73. package/dist/shared/components/Util.d.ts +21 -0
  74. package/dist/shared/components/Util.js +115 -0
  75. package/dist/shared/components/ZipCrypto.d.ts +3 -0
  76. package/dist/shared/components/ZipCrypto.js +78 -0
  77. package/dist/shared/components/merkleTree.d.ts +66 -0
  78. package/dist/shared/components/merkleTree.js +136 -0
  79. package/dist/shared/constants/Errors.d.ts +53 -0
  80. package/dist/shared/constants/Errors.js +69 -0
  81. package/dist/shared/constants/Headers.d.ts +167 -0
  82. package/dist/shared/constants/Headers.js +191 -0
  83. package/dist/shared/types/index.d.ts +21 -0
  84. package/dist/shared/types/index.js +3 -0
  85. package/dist/shared/types.d.ts +33 -0
  86. package/dist/shared/types.js +8 -0
  87. package/dist/shared/version.d.ts +4 -0
  88. package/dist/shared/version.js +7 -0
  89. package/dist/types/index.d.ts +21 -0
  90. package/dist/types/index.js +3 -0
  91. package/examples/unzip-token.ts +488 -0
  92. package/examples/zip-token.ts +604 -0
  93. package/package.json +117 -0
  94. package/src/browser/CertificateGeneratorBrowser.ts +498 -0
  95. package/src/browser/TokenVerifierBrowser.ts +344 -0
  96. package/src/browser/ZipKitBrowser.ts +242 -0
  97. package/src/browser/ZipKitStampBrowser.ts +9 -0
  98. package/src/browser-index.ts +36 -0
  99. package/src/index.ts +48 -0
  100. package/src/server/blockchain/CertificateToken.ts +444 -0
  101. package/src/server/blockchain/NFTMinter.ts +357 -0
  102. package/src/server/blockchain/TokenQuerier.ts +287 -0
  103. package/src/server/blockchain/TokenVerifier.ts +453 -0
  104. package/src/server/blockchain/WalletAnalyzer.ts +397 -0
  105. package/src/server/blockchain/WalletFormatter.ts +206 -0
  106. package/src/server/blockchain/WalletManager.ts +294 -0
  107. package/src/server/blockchain/ZipMetadata.ts +117 -0
  108. package/src/server/blockchain/ZipTokenProcessor.ts +234 -0
  109. package/src/server/blockchain/constants.ts +969 -0
  110. package/src/server/blockchain/index.ts +42 -0
  111. package/src/server/blockchain/test-certificate.ts +137 -0
  112. package/src/server/blockchain/types.ts +134 -0
  113. package/src/server/platform/server/ZipKitServer.ts +459 -0
  114. package/src/server/platform/servercomponents/ZipKitOTS.ts +313 -0
  115. package/src/server/platform/servercomponents/opentimestamps.d.ts +23 -0
  116. package/src/shared/ZipEntry.ts +767 -0
  117. package/src/shared/ZipKit.ts +899 -0
  118. package/src/shared/components/CertificateOTS.ts +132 -0
  119. package/src/shared/components/FileSys.ts +87 -0
  120. package/src/shared/components/HashAccumulator.ts +113 -0
  121. package/src/shared/components/Support.ts +77 -0
  122. package/src/shared/components/Util.ts +113 -0
  123. package/src/shared/components/ZipCrypto.ts +91 -0
  124. package/src/shared/components/merkleTree.ts +162 -0
  125. package/src/shared/constants/Errors.ts +82 -0
  126. package/src/shared/constants/Headers.ts +203 -0
  127. package/src/shared/types/index.ts +25 -0
  128. package/src/shared/types/modules.d.ts +22 -0
  129. package/src/shared/types/opentimestamps.d.ts +23 -0
  130. package/src/shared/types.d.ts +8 -0
  131. package/src/shared/types.ts +43 -0
  132. package/src/shared/version.ts +4 -0
  133. package/src/types/index.ts +25 -0
  134. package/src/types/modules.d.ts +22 -0
  135. package/src/types/opentimestamps.d.ts +23 -0
@@ -0,0 +1,1107 @@
1
+ const { deployContract, NETWORK_CONFIG } = require('./deploy-both-contracts');
2
+ const { ethers } = require('ethers');
3
+ const fs = require('fs');
4
+
5
+ /**
6
+ * Deployment script for NZIP NFT Public Contract Only
7
+ *
8
+ * This script deploys only the public NZIP-NFT.sol contract
9
+ * Usage: node deploy-public-contract.js
10
+ */
11
+
12
+ // Configuration - Load from environment variables or config file
13
+ function loadConfig() {
14
+ let config = {};
15
+
16
+ // Try to load from deployment.config.js first
17
+ try {
18
+ config = require('../deployment.config.js');
19
+ console.log('๐Ÿ“ Loaded configuration from deployment.config.js');
20
+ } catch (err) {
21
+ console.log('๐Ÿ“ No deployment.config.js found, using environment variables');
22
+ }
23
+
24
+ // Environment variables override config file
25
+ const CHAIN_ID = process.env.CHAIN_ID ? parseInt(process.env.CHAIN_ID) : (config.CHAIN_ID || 84532);
26
+ const PRIVATE_KEY = process.env.PRIVATE_KEY || config.PRIVATE_KEY;
27
+
28
+ return { CHAIN_ID, PRIVATE_KEY, EXISTING_CONTRACT: config.EXISTING_CONTRACT };
29
+ }
30
+
31
+ const { CHAIN_ID, PRIVATE_KEY, EXISTING_CONTRACT } = loadConfig();
32
+
33
+ // Contract compilation configuration
34
+ // NOTE: This needs to be replaced with actual compiled bytecode from NZIP-NFT.sol
35
+ const CONTRACT_BYTECODE = "608060405234801561000f575f5ffd5b5033604051806040016040528060128152602001712732b7ad34b8102334b6329027232a103b1960711b8152506040518060400160405280600481526020016304e5a49560e41b815250815f9081610067919061019c565b506001610074828261019c565b5050506001600160a01b0381166100a457604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100ad816100b3565b50610256565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061012c57607f821691505b60208210810361014a57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561019757805f5260205f20601f840160051c810160208510156101755750805b601f840160051c820191505b81811015610194575f8155600101610181565b50505b505050565b81516001600160401b038111156101b5576101b5610104565b6101c9816101c38454610118565b84610150565b6020601f8211600181146101fb575f83156101e45750848201515b5f19600385901b1c1916600184901b178455610194565b5f84815260208120601f198516915b8281101561022a578785015182556020948501946001909201910161020a565b508482101561024757868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b612549806102635f395ff3fe608060405234801561000f575f5ffd5b50600436106101a0575f3560e01c806370d4d9fd116100f3578063a5e20a9c11610093578063ca3685d91161006e578063ca3685d9146103c4578063e985e9c5146103ea578063f2fde38b146103fd578063fe974bfe14610410575f5ffd5b8063a5e20a9c1461037f578063b88d4fde1461039e578063c87b56dd146103b1575f5ffd5b80638da5cb5b116100ce5780638da5cb5b1461033357806395d89b41146103445780639e8a1e7e1461034c578063a22cb4651461036c575f5ffd5b806370d4d9fd146102ee578063715018a6146103185780637f5950bd14610320575f5ffd5b806318160ddd1161015e5780635cefc90b116101395780635cefc90b1461028d5780635dce1ad8146102b55780636352211e146102c857806370a08231146102db575f5ffd5b806318160ddd1461025557806323b872dd1461026757806342842e0e1461027a575f5ffd5b8062ca4f78146101a457806301ffc9a7146101cc57806306fdde03146101df578063081812fc146101f4578063095ea7b31461021f5780630d8e6e2c14610234575b5f5ffd5b6101b76101b2366004611d5f565b610430565b60405190151581526020015b60405180910390f35b6101b76101da366004611db7565b6104d0565b6101e76104e0565b6040516101c39190611e00565b610207610202366004611e12565b61056f565b6040516001600160a01b0390911681526020016101c3565b61023261022d366004611e44565b610596565b005b6040805180820190915260058152640322e302e360dc1b60208201526101e7565b6008545b6040519081526020016101c3565b610232610275366004611e6c565b6105a5565b610232610288366004611e6c565b61062e565b6102a061029b366004611e12565b61064d565b604080519283526020830191909152016101c3565b6102596102c3366004611ea6565b610890565b6102076102d6366004611e12565b6108c2565b6102596102e9366004611ee7565b6108cc565b6103016102fc366004611ea6565b61093e565b6040805192151583526020830191909152016101c3565b610232610967565b61025961032e366004611f00565b61097a565b6007546001600160a01b0316610207565b6101e7610c5e565b61035f61035a366004611fbe565b610c6d565b6040516101c39190611fef565b61023261037a366004612031565b610e15565b61025961038d366004611e12565b600a6020525f908152604090205481565b6102326103ac36600461206a565b610e20565b6101e76103bf366004611e12565b610e38565b6103d76103d2366004611e12565b610e43565b6040516101c397969594939291906120e0565b6101b76103f8366004612148565b611019565b61023261040b366004611ee7565b611046565b61042361041e366004611e12565b611083565b6040516101c39190612179565b5f828152600260205260408120546001600160a01b031661046c5760405162461bcd60e51b81526004016104639061220d565b60405180910390fd5b8160405160200161047d9190612252565b60408051601f1981840301815282825280516020918201205f878152600983529290922091926104b1926001019101612295565b6040516020818303038152906040528051906020012014905092915050565b5f6104da826112fa565b92915050565b60605f80546104ee9061225d565b80601f016020809104026020016040519081016040528092919081815260200182805461051a9061225d565b80156105655780601f1061053c57610100808354040283529160200191610565565b820191905f5260205f20905b81548152906001019060200180831161054857829003601f168201915b5050505050905090565b5f6105798261131e565b505f828152600460205260409020546001600160a01b03166104da565b6105a1828233611356565b5050565b6001600160a01b0382166105ce57604051633250574960e11b81525f6004820152602401610463565b5f6105da838333611363565b9050836001600160a01b0316816001600160a01b031614610628576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610463565b50505050565b61064883838360405180602001604052805f815250610e20565b505050565b5f8181526002602052604081205481906001600160a01b03166106825760405162461bcd60e51b81526004016104639061220d565b5f83815260096020526040808220815160e081019092528054829082906106a89061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546106d49061225d565b801561071f5780601f106106f65761010080835404028352916020019161071f565b820191905f5260205f20905b81548152906001019060200180831161070257829003601f168201915b505050505081526020016001820180546107389061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546107649061225d565b80156107af5780601f10610786576101008083540402835291602001916107af565b820191905f5260205f20905b81548152906001019060200180831161079257829003601f168201915b505050505081526020016002820180546107c89061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546107f49061225d565b801561083f5780601f106108165761010080835404028352916020019161083f565b820191905f5260205f20905b81548152906001019060200180831161082257829003601f168201915b505050918352505060038201546001600160a01b03166020820152600482015460408201526005820154606082015260069091015460809091015260c081015160a090910151909590945092505050565b5f82826040516020016108a4929190612306565b60405160208183030381529060405280519060200120905092915050565b5f6104da8261131e565b5f6001600160a01b0382166109355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610463565b6104da82611455565b5f5f5f61094b8585610890565b5f908152600a6020526040902054801515969095509350505050565b61096f61149a565b6109785f6114c7565b565b5f5f8651116109cb5760405162461bcd60e51b815260206004820152601960248201527f46696c65206e616d652063616e6e6f7420626520656d707479000000000000006044820152606401610463565b5f855111610a1b5760405162461bcd60e51b815260206004820181905260248201527f4d65726b6c6520726f6f7420686173682063616e6e6f7420626520656d7074796044820152606401610463565b5f8411610a7c5760405162461bcd60e51b815260206004820152602960248201527f4372656174696f6e2074696d657374616d70206d75737420626520677265617460448201526806572207468616e20360bc1b6064820152608401610463565b5f610a878686610890565b5f818152600a602052604090205490915015610b0b5760405162461bcd60e51b815260206004820152603a60248201527f5a49502066696c652077697468207468697320636f6e74656e7420616e64207460448201527f696d657374616d7020616c726561647920746f6b656e697a65640000000000006064820152608401610463565b60088054905f610b1a8361231e565b9091555050600854610b2c3382611518565b835115610b3d57610b3d8185611531565b6040805160e08101825289815260208082018a9052818301889052336060830152608082018990524260a08301524360c08301525f84815260099091529190912081518190610b8c9082612386565b5060208201516001820190610ba19082612386565b5060408201516002820190610bb69082612386565b5060608201516003820180546001600160a01b0319166001600160a01b039092169190911790556080820151600482015560a0820151600582015560c0909101516006909101555f828152600a60205260409081902082905551339082907f0f09874b9c74d4595582d6c98e63000a1e9b6d57d383f3faa9b82ec744bc2db190610c4b908c908c908c908c9042904390612440565b60405180910390a3979650505050505050565b6060600180546104ee9061225d565b60605f6008546001600160401b03811115610c8a57610c8a611cb8565b604051908082528060200260200182016040528015610cb3578160200160208202803683370190505b5090505f60015b6008548111610d7d575f818152600260205260409020546001600160a01b031615610d6b5784604051602001610cf09190612252565b60408051601f1981840301815282825280516020918201205f85815260098352929092209192610d24926001019101612295565b6040516020818303038152906040528051906020012003610d6b5780838381518110610d5257610d52612494565b602090810291909101015281610d678161231e565b9250505b80610d758161231e565b915050610cba565b505f816001600160401b03811115610d9757610d97611cb8565b604051908082528060200260200182016040528015610dc0578160200160208202803683370190505b5090505f5b82811015610e0c57838181518110610ddf57610ddf612494565b6020026020010151828281518110610df957610df9612494565b6020908102919091010152600101610dc5565b50949350505050565b6105a1338383611580565b610e2b8484846105a5565b610628338585858561161e565b60606104da82611746565b60096020525f9081526040902080548190610e5d9061225d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e899061225d565b8015610ed45780601f10610eab57610100808354040283529160200191610ed4565b820191905f5260205f20905b815481529060010190602001808311610eb757829003601f168201915b505050505090806001018054610ee99061225d565b80601f0160208091040260200160405190810160405280929190818152602001828054610f159061225d565b8015610f605780601f10610f3757610100808354040283529160200191610f60565b820191905f5260205f20905b815481529060010190602001808311610f4357829003601f168201915b505050505090806002018054610f759061225d565b80601f0160208091040260200160405190810160405280929190818152602001828054610fa19061225d565b8015610fec5780601f10610fc357610100808354040283529160200191610fec565b820191905f5260205f20905b815481529060010190602001808311610fcf57829003601f168201915b5050505060038301546004840154600585015460069095015493946001600160a01b039092169390925087565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b61104e61149a565b6001600160a01b03811661107757604051631e4fbdf760e01b81525f6004820152602401610463565b611080816114c7565b50565b6110c86040518060e001604052806060815260200160608152602001606081526020015f6001600160a01b031681526020015f81526020015f81526020015f81525090565b5f828152600260205260409020546001600160a01b03166110fb5760405162461bcd60e51b81526004016104639061220d565b5f8281526009602052604090819020815160e081019092528054829082906111229061225d565b80601f016020809104026020016040519081016040528092919081815260200182805461114e9061225d565b80156111995780601f1061117057610100808354040283529160200191611199565b820191905f5260205f20905b81548152906001019060200180831161117c57829003601f168201915b505050505081526020016001820180546111b29061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546111de9061225d565b80156112295780601f1061120057610100808354040283529160200191611229565b820191905f5260205f20905b81548152906001019060200180831161120c57829003601f168201915b505050505081526020016002820180546112429061225d565b80601f016020809104026020016040519081016040528092919081815260200182805461126e9061225d565b80156112b95780601f10611290576101008083540402835291602001916112b9565b820191905f5260205f20905b81548152906001019060200180831161129c57829003601f168201915b505050918352505060038201546001600160a01b03166020820152600482015460408201526005820154606082015260069091015460809091015292915050565b5f6001600160e01b03198216632483248360e11b14806104da57506104da82611851565b5f818152600260205260408120546001600160a01b0316806104da57604051637e27328960e01b815260048101849052602401610463565b61064883838360016118a0565b5f828152600260205260408120546001600160a01b039081169083161561138f5761138f8184866119a4565b6001600160a01b038116156113c9576113aa5f855f5f6118a0565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b038516156113f7576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f6001600160a01b03821661147f576040516322718ad960e21b81525f6004820152602401610463565b506001600160a01b03165f9081526003602052604090205490565b6007546001600160a01b031633146109785760405163118cdaa760e01b8152336004820152602401610463565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6105a1828260405180602001604052805f815250611a08565b5f8281526006602052604090206115488282612386565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b0382166115b257604051630b61174360e31b81526001600160a01b0383166004820152602401610463565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561173f57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906116609088908890879087906004016124a8565b6020604051808303815f875af192505050801561169a575060408051601f3d908101601f19168201909252611697918101906124e4565b60015b611701573d8080156116c7576040519150601f19603f3d011682016040523d82523d5f602084013e6116cc565b606091505b5080515f036116f957604051633250574960e11b81526001600160a01b0385166004820152602401610463565b805160208201fd5b6001600160e01b03198116630a85bd0160e11b1461173d57604051633250574960e11b81526001600160a01b0385166004820152602401610463565b505b5050505050565b60606117518261131e565b505f828152600660205260408120805461176a9061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546117969061225d565b80156117e15780601f106117b8576101008083540402835291602001916117e1565b820191905f5260205f20905b8154815290600101906020018083116117c457829003601f168201915b505050505090505f6117fd60408051602081019091525f815290565b905080515f0361180e575092915050565b8151156118405780826040516020016118289291906124ff565b60405160208183030381529060405292505050919050565b61184984611a1f565b949350505050565b5f6001600160e01b031982166380ac58cd60e01b148061188157506001600160e01b03198216635b5e139f60e01b145b806104da57506301ffc9a760e01b6001600160e01b03198316146104da565b80806118b457506001600160a01b03821615155b15611975575f6118c38461131e565b90506001600160a01b038316158015906118ef5750826001600160a01b0316816001600160a01b031614155b801561190257506119008184611019565b155b1561192b5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610463565b81156119735783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6119af838383611a90565b610648576001600160a01b0383166119dd57604051637e27328960e01b815260048101829052602401610463565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610463565b611a128383611af1565b610648335f85858561161e565b6060611a2a8261131e565b505f611a4060408051602081019091525f815290565b90505f815111611a5e5760405180602001604052805f815250611a89565b80611a6884611b52565b604051602001611a799291906124ff565b6040516020818303038152906040525b9392505050565b5f6001600160a01b038316158015906118495750826001600160a01b0316846001600160a01b03161480611ac95750611ac98484611019565b806118495750505f908152600460205260409020546001600160a01b03908116911614919050565b6001600160a01b038216611b1a57604051633250574960e11b81525f6004820152602401610463565b5f611b2683835f611363565b90506001600160a01b03811615610648576040516339e3563760e11b81525f6004820152602401610463565b60605f611b5e83611be1565b60010190505f816001600160401b03811115611b7c57611b7c611cb8565b6040519080825280601f01601f191660200182016040528015611ba6576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611bb057509392505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611c1f5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611c4b576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611c6957662386f26fc10000830492506010015b6305f5e1008310611c81576305f5e100830492506008015b6127108310611c9557612710830492506004015b60648310611ca7576064830492506002015b600a83106104da5760010192915050565b634e487b7160e01b5f52604160045260245ffd5b5f5f6001600160401b03841115611ce557611ce5611cb8565b50604051601f19601f85018116603f011681018181106001600160401b0382111715611d1357611d13611cb8565b604052838152905080828401851015611d2a575f5ffd5b838360208301375f60208583010152509392505050565b5f82601f830112611d50575f5ffd5b611a8983833560208501611ccc565b5f5f60408385031215611d70575f5ffd5b8235915060208301356001600160401b03811115611d8c575f5ffd5b611d9885828601611d41565b9150509250929050565b6001600160e01b031981168114611080575f5ffd5b5f60208284031215611dc7575f5ffd5b8135611a8981611da2565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611a896020830184611dd2565b5f60208284031215611e22575f5ffd5b5035919050565b80356001600160a01b0381168114611e3f575f5ffd5b919050565b5f5f60408385031215611e55575f5ffd5b611e5e83611e29565b946020939093013593505050565b5f5f5f60608486031215611e7e575f5ffd5b611e8784611e29565b9250611e9560208501611e29565b929592945050506040919091013590565b5f5f60408385031215611eb7575f5ffd5b82356001600160401b03811115611ecc575f5ffd5b611ed885828601611d41565b95602094909401359450505050565b5f60208284031215611ef7575f5ffd5b611a8982611e29565b5f5f5f5f5f60a08688031215611f14575f5ffd5b85356001600160401b03811115611f29575f5ffd5b611f3588828901611d41565b95505060208601356001600160401b03811115611f50575f5ffd5b611f5c88828901611d41565b9450506040860135925060608601356001600160401b03811115611f7e575f5ffd5b611f8a88828901611d41565b92505060808601356001600160401b03811115611fa5575f5ffd5b611fb188828901611d41565b9150509295509295909350565b5f60208284031215611fce575f5ffd5b81356001600160401b03811115611fe3575f5ffd5b61184984828501611d41565b602080825282518282018190525f918401906040840190835b81811015612026578351835260209384019390920191600101612008565b509095945050505050565b5f5f60408385031215612042575f5ffd5b61204b83611e29565b91506020830135801515811461205f575f5ffd5b809150509250929050565b5f5f5f5f6080858703121561207d575f5ffd5b61208685611e29565b935061209460208601611e29565b92506040850135915060608501356001600160401b038111156120b5575f5ffd5b8501601f810187136120c5575f5ffd5b6120d487823560208401611ccc565b91505092959194509250565b60e081525f6120f260e083018a611dd2565b8281036020840152612104818a611dd2565b905082810360408401526121188189611dd2565b6001600160a01b039790971660608401525050608081019390935260a083019190915260c0909101529392505050565b5f5f60408385031215612159575f5ffd5b61216283611e29565b915061217060208401611e29565b90509250929050565b602081525f825160e06020840152612195610100840182611dd2565b90506020840151601f198483030160408501526121b28282611dd2565b9150506040840151601f198483030160608501526121d08282611dd2565b91505060018060a01b036060850151166080840152608084015160a084015260a084015160c084015260c084015160e08401528091505092915050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b5f81518060208401855e5f93019283525090919050565b5f611a89828461223b565b600181811c9082168061227157607f821691505b60208210810361228f57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f5f83546122a28161225d565b6001821680156122b957600181146122ce576122fb565b60ff19831686528115158202860193506122fb565b865f5260205f205f5b838110156122f3578154888201526001909101906020016122d7565b505081860193505b509195945050505050565b5f612311828561223b565b9283525050602001919050565b5f6001820161233b57634e487b7160e01b5f52601160045260245ffd5b5060010190565b601f82111561064857805f5260205f20601f840160051c810160208510156123675750805b601f840160051c820191505b8181101561173f575f8155600101612373565b81516001600160401b0381111561239f5761239f611cb8565b6123b3816123ad845461225d565b84612342565b6020601f8211600181146123e5575f83156123ce5750848201515b5f19600385901b1c1916600184901b17845561173f565b5f84815260208120601f198516915b8281101561241457878501518255602094850194600190920191016123f4565b508482101561243157868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b60c081525f61245260c0830189611dd2565b82810360208401526124648189611dd2565b9050866040840152828103606084015261247e8187611dd2565b6080840195909552505060a00152949350505050565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906124da90830184611dd2565b9695505050505050565b5f602082840312156124f4575f5ffd5b8151611a8981611da2565b5f61184961250d838661223b565b8461223b56fea2646970667358221220ec5692f96d1d270dc9c2c061988393c84d97f92e3bcc623597bccbb57a29d12d64736f6c634300081e0033";
36
+ const CONTRACT_ABI =
37
+ [
38
+ {
39
+ "inputs": [],
40
+ "stateMutability": "nonpayable",
41
+ "type": "constructor"
42
+ },
43
+ {
44
+ "inputs": [
45
+ {
46
+ "internalType": "address",
47
+ "name": "sender",
48
+ "type": "address"
49
+ },
50
+ {
51
+ "internalType": "uint256",
52
+ "name": "tokenId",
53
+ "type": "uint256"
54
+ },
55
+ {
56
+ "internalType": "address",
57
+ "name": "owner",
58
+ "type": "address"
59
+ }
60
+ ],
61
+ "name": "ERC721IncorrectOwner",
62
+ "type": "error"
63
+ },
64
+ {
65
+ "inputs": [
66
+ {
67
+ "internalType": "address",
68
+ "name": "operator",
69
+ "type": "address"
70
+ },
71
+ {
72
+ "internalType": "uint256",
73
+ "name": "tokenId",
74
+ "type": "uint256"
75
+ }
76
+ ],
77
+ "name": "ERC721InsufficientApproval",
78
+ "type": "error"
79
+ },
80
+ {
81
+ "inputs": [
82
+ {
83
+ "internalType": "address",
84
+ "name": "approver",
85
+ "type": "address"
86
+ }
87
+ ],
88
+ "name": "ERC721InvalidApprover",
89
+ "type": "error"
90
+ },
91
+ {
92
+ "inputs": [
93
+ {
94
+ "internalType": "address",
95
+ "name": "operator",
96
+ "type": "address"
97
+ }
98
+ ],
99
+ "name": "ERC721InvalidOperator",
100
+ "type": "error"
101
+ },
102
+ {
103
+ "inputs": [
104
+ {
105
+ "internalType": "address",
106
+ "name": "owner",
107
+ "type": "address"
108
+ }
109
+ ],
110
+ "name": "ERC721InvalidOwner",
111
+ "type": "error"
112
+ },
113
+ {
114
+ "inputs": [
115
+ {
116
+ "internalType": "address",
117
+ "name": "receiver",
118
+ "type": "address"
119
+ }
120
+ ],
121
+ "name": "ERC721InvalidReceiver",
122
+ "type": "error"
123
+ },
124
+ {
125
+ "inputs": [
126
+ {
127
+ "internalType": "address",
128
+ "name": "sender",
129
+ "type": "address"
130
+ }
131
+ ],
132
+ "name": "ERC721InvalidSender",
133
+ "type": "error"
134
+ },
135
+ {
136
+ "inputs": [
137
+ {
138
+ "internalType": "uint256",
139
+ "name": "tokenId",
140
+ "type": "uint256"
141
+ }
142
+ ],
143
+ "name": "ERC721NonexistentToken",
144
+ "type": "error"
145
+ },
146
+ {
147
+ "inputs": [
148
+ {
149
+ "internalType": "address",
150
+ "name": "owner",
151
+ "type": "address"
152
+ }
153
+ ],
154
+ "name": "OwnableInvalidOwner",
155
+ "type": "error"
156
+ },
157
+ {
158
+ "inputs": [
159
+ {
160
+ "internalType": "address",
161
+ "name": "account",
162
+ "type": "address"
163
+ }
164
+ ],
165
+ "name": "OwnableUnauthorizedAccount",
166
+ "type": "error"
167
+ },
168
+ {
169
+ "anonymous": false,
170
+ "inputs": [
171
+ {
172
+ "indexed": true,
173
+ "internalType": "address",
174
+ "name": "owner",
175
+ "type": "address"
176
+ },
177
+ {
178
+ "indexed": true,
179
+ "internalType": "address",
180
+ "name": "approved",
181
+ "type": "address"
182
+ },
183
+ {
184
+ "indexed": true,
185
+ "internalType": "uint256",
186
+ "name": "tokenId",
187
+ "type": "uint256"
188
+ }
189
+ ],
190
+ "name": "Approval",
191
+ "type": "event"
192
+ },
193
+ {
194
+ "anonymous": false,
195
+ "inputs": [
196
+ {
197
+ "indexed": true,
198
+ "internalType": "address",
199
+ "name": "owner",
200
+ "type": "address"
201
+ },
202
+ {
203
+ "indexed": true,
204
+ "internalType": "address",
205
+ "name": "operator",
206
+ "type": "address"
207
+ },
208
+ {
209
+ "indexed": false,
210
+ "internalType": "bool",
211
+ "name": "approved",
212
+ "type": "bool"
213
+ }
214
+ ],
215
+ "name": "ApprovalForAll",
216
+ "type": "event"
217
+ },
218
+ {
219
+ "anonymous": false,
220
+ "inputs": [
221
+ {
222
+ "indexed": false,
223
+ "internalType": "uint256",
224
+ "name": "_fromTokenId",
225
+ "type": "uint256"
226
+ },
227
+ {
228
+ "indexed": false,
229
+ "internalType": "uint256",
230
+ "name": "_toTokenId",
231
+ "type": "uint256"
232
+ }
233
+ ],
234
+ "name": "BatchMetadataUpdate",
235
+ "type": "event"
236
+ },
237
+ {
238
+ "anonymous": false,
239
+ "inputs": [
240
+ {
241
+ "indexed": false,
242
+ "internalType": "uint256",
243
+ "name": "_tokenId",
244
+ "type": "uint256"
245
+ }
246
+ ],
247
+ "name": "MetadataUpdate",
248
+ "type": "event"
249
+ },
250
+ {
251
+ "anonymous": false,
252
+ "inputs": [
253
+ {
254
+ "indexed": true,
255
+ "internalType": "address",
256
+ "name": "previousOwner",
257
+ "type": "address"
258
+ },
259
+ {
260
+ "indexed": true,
261
+ "internalType": "address",
262
+ "name": "newOwner",
263
+ "type": "address"
264
+ }
265
+ ],
266
+ "name": "OwnershipTransferred",
267
+ "type": "event"
268
+ },
269
+ {
270
+ "anonymous": false,
271
+ "inputs": [
272
+ {
273
+ "indexed": true,
274
+ "internalType": "address",
275
+ "name": "from",
276
+ "type": "address"
277
+ },
278
+ {
279
+ "indexed": true,
280
+ "internalType": "address",
281
+ "name": "to",
282
+ "type": "address"
283
+ },
284
+ {
285
+ "indexed": true,
286
+ "internalType": "uint256",
287
+ "name": "tokenId",
288
+ "type": "uint256"
289
+ }
290
+ ],
291
+ "name": "Transfer",
292
+ "type": "event"
293
+ },
294
+ {
295
+ "anonymous": false,
296
+ "inputs": [
297
+ {
298
+ "indexed": true,
299
+ "internalType": "uint256",
300
+ "name": "tokenId",
301
+ "type": "uint256"
302
+ },
303
+ {
304
+ "indexed": true,
305
+ "internalType": "address",
306
+ "name": "creator",
307
+ "type": "address"
308
+ },
309
+ {
310
+ "indexed": false,
311
+ "internalType": "string",
312
+ "name": "fileName",
313
+ "type": "string"
314
+ },
315
+ {
316
+ "indexed": false,
317
+ "internalType": "string",
318
+ "name": "merkleRootHash",
319
+ "type": "string"
320
+ },
321
+ {
322
+ "indexed": false,
323
+ "internalType": "uint256",
324
+ "name": "creationTimestamp",
325
+ "type": "uint256"
326
+ },
327
+ {
328
+ "indexed": false,
329
+ "internalType": "string",
330
+ "name": "ipfsHash",
331
+ "type": "string"
332
+ },
333
+ {
334
+ "indexed": false,
335
+ "internalType": "uint256",
336
+ "name": "tokenizationTime",
337
+ "type": "uint256"
338
+ },
339
+ {
340
+ "indexed": false,
341
+ "internalType": "uint256",
342
+ "name": "blockNumber",
343
+ "type": "uint256"
344
+ }
345
+ ],
346
+ "name": "ZipFileTokenized",
347
+ "type": "event"
348
+ },
349
+ {
350
+ "inputs": [
351
+ {
352
+ "internalType": "address",
353
+ "name": "to",
354
+ "type": "address"
355
+ },
356
+ {
357
+ "internalType": "uint256",
358
+ "name": "tokenId",
359
+ "type": "uint256"
360
+ }
361
+ ],
362
+ "name": "approve",
363
+ "outputs": [],
364
+ "stateMutability": "nonpayable",
365
+ "type": "function"
366
+ },
367
+ {
368
+ "inputs": [
369
+ {
370
+ "internalType": "address",
371
+ "name": "owner",
372
+ "type": "address"
373
+ }
374
+ ],
375
+ "name": "balanceOf",
376
+ "outputs": [
377
+ {
378
+ "internalType": "uint256",
379
+ "name": "",
380
+ "type": "uint256"
381
+ }
382
+ ],
383
+ "stateMutability": "view",
384
+ "type": "function"
385
+ },
386
+ {
387
+ "inputs": [
388
+ {
389
+ "internalType": "bytes32",
390
+ "name": "",
391
+ "type": "bytes32"
392
+ }
393
+ ],
394
+ "name": "compositeKeyToTokenId",
395
+ "outputs": [
396
+ {
397
+ "internalType": "uint256",
398
+ "name": "",
399
+ "type": "uint256"
400
+ }
401
+ ],
402
+ "stateMutability": "view",
403
+ "type": "function"
404
+ },
405
+ {
406
+ "inputs": [
407
+ {
408
+ "internalType": "string",
409
+ "name": "merkleRootHash",
410
+ "type": "string"
411
+ },
412
+ {
413
+ "internalType": "uint256",
414
+ "name": "creationTimestamp",
415
+ "type": "uint256"
416
+ }
417
+ ],
418
+ "name": "generateCompositeKey",
419
+ "outputs": [
420
+ {
421
+ "internalType": "bytes32",
422
+ "name": "",
423
+ "type": "bytes32"
424
+ }
425
+ ],
426
+ "stateMutability": "pure",
427
+ "type": "function"
428
+ },
429
+ {
430
+ "inputs": [
431
+ {
432
+ "internalType": "uint256",
433
+ "name": "tokenId",
434
+ "type": "uint256"
435
+ }
436
+ ],
437
+ "name": "getApproved",
438
+ "outputs": [
439
+ {
440
+ "internalType": "address",
441
+ "name": "",
442
+ "type": "address"
443
+ }
444
+ ],
445
+ "stateMutability": "view",
446
+ "type": "function"
447
+ },
448
+ {
449
+ "inputs": [
450
+ {
451
+ "internalType": "uint256",
452
+ "name": "tokenId",
453
+ "type": "uint256"
454
+ }
455
+ ],
456
+ "name": "getBlockchainMetadata",
457
+ "outputs": [
458
+ {
459
+ "internalType": "uint256",
460
+ "name": "blockNumber",
461
+ "type": "uint256"
462
+ },
463
+ {
464
+ "internalType": "uint256",
465
+ "name": "tokenizationTime",
466
+ "type": "uint256"
467
+ }
468
+ ],
469
+ "stateMutability": "view",
470
+ "type": "function"
471
+ },
472
+ {
473
+ "inputs": [
474
+ {
475
+ "internalType": "string",
476
+ "name": "merkleRoot",
477
+ "type": "string"
478
+ }
479
+ ],
480
+ "name": "getTokensByMerkleRoot",
481
+ "outputs": [
482
+ {
483
+ "internalType": "uint256[]",
484
+ "name": "",
485
+ "type": "uint256[]"
486
+ }
487
+ ],
488
+ "stateMutability": "view",
489
+ "type": "function"
490
+ },
491
+ {
492
+ "inputs": [],
493
+ "name": "getVersion",
494
+ "outputs": [
495
+ {
496
+ "internalType": "string",
497
+ "name": "",
498
+ "type": "string"
499
+ }
500
+ ],
501
+ "stateMutability": "pure",
502
+ "type": "function"
503
+ },
504
+ {
505
+ "inputs": [
506
+ {
507
+ "internalType": "uint256",
508
+ "name": "tokenId",
509
+ "type": "uint256"
510
+ }
511
+ ],
512
+ "name": "getZipFileInfo",
513
+ "outputs": [
514
+ {
515
+ "components": [
516
+ {
517
+ "internalType": "string",
518
+ "name": "fileName",
519
+ "type": "string"
520
+ },
521
+ {
522
+ "internalType": "string",
523
+ "name": "merkleRootHash",
524
+ "type": "string"
525
+ },
526
+ {
527
+ "internalType": "string",
528
+ "name": "ipfsHash",
529
+ "type": "string"
530
+ },
531
+ {
532
+ "internalType": "address",
533
+ "name": "creator",
534
+ "type": "address"
535
+ },
536
+ {
537
+ "internalType": "uint256",
538
+ "name": "creationTimestamp",
539
+ "type": "uint256"
540
+ },
541
+ {
542
+ "internalType": "uint256",
543
+ "name": "tokenizationTime",
544
+ "type": "uint256"
545
+ },
546
+ {
547
+ "internalType": "uint256",
548
+ "name": "blockNumber",
549
+ "type": "uint256"
550
+ }
551
+ ],
552
+ "internalType": "struct ZipFileNFT.ZipFileInfo",
553
+ "name": "",
554
+ "type": "tuple"
555
+ }
556
+ ],
557
+ "stateMutability": "view",
558
+ "type": "function"
559
+ },
560
+ {
561
+ "inputs": [
562
+ {
563
+ "internalType": "address",
564
+ "name": "owner",
565
+ "type": "address"
566
+ },
567
+ {
568
+ "internalType": "address",
569
+ "name": "operator",
570
+ "type": "address"
571
+ }
572
+ ],
573
+ "name": "isApprovedForAll",
574
+ "outputs": [
575
+ {
576
+ "internalType": "bool",
577
+ "name": "",
578
+ "type": "bool"
579
+ }
580
+ ],
581
+ "stateMutability": "view",
582
+ "type": "function"
583
+ },
584
+ {
585
+ "inputs": [
586
+ {
587
+ "internalType": "string",
588
+ "name": "merkleRootHash",
589
+ "type": "string"
590
+ },
591
+ {
592
+ "internalType": "uint256",
593
+ "name": "creationTimestamp",
594
+ "type": "uint256"
595
+ }
596
+ ],
597
+ "name": "isZipFileTokenized",
598
+ "outputs": [
599
+ {
600
+ "internalType": "bool",
601
+ "name": "exists",
602
+ "type": "bool"
603
+ },
604
+ {
605
+ "internalType": "uint256",
606
+ "name": "tokenId",
607
+ "type": "uint256"
608
+ }
609
+ ],
610
+ "stateMutability": "view",
611
+ "type": "function"
612
+ },
613
+ {
614
+ "inputs": [],
615
+ "name": "name",
616
+ "outputs": [
617
+ {
618
+ "internalType": "string",
619
+ "name": "",
620
+ "type": "string"
621
+ }
622
+ ],
623
+ "stateMutability": "view",
624
+ "type": "function"
625
+ },
626
+ {
627
+ "inputs": [],
628
+ "name": "owner",
629
+ "outputs": [
630
+ {
631
+ "internalType": "address",
632
+ "name": "",
633
+ "type": "address"
634
+ }
635
+ ],
636
+ "stateMutability": "view",
637
+ "type": "function"
638
+ },
639
+ {
640
+ "inputs": [
641
+ {
642
+ "internalType": "uint256",
643
+ "name": "tokenId",
644
+ "type": "uint256"
645
+ }
646
+ ],
647
+ "name": "ownerOf",
648
+ "outputs": [
649
+ {
650
+ "internalType": "address",
651
+ "name": "",
652
+ "type": "address"
653
+ }
654
+ ],
655
+ "stateMutability": "view",
656
+ "type": "function"
657
+ },
658
+ {
659
+ "inputs": [
660
+ {
661
+ "internalType": "string",
662
+ "name": "fileName",
663
+ "type": "string"
664
+ },
665
+ {
666
+ "internalType": "string",
667
+ "name": "merkleRootHash",
668
+ "type": "string"
669
+ },
670
+ {
671
+ "internalType": "uint256",
672
+ "name": "creationTimestamp",
673
+ "type": "uint256"
674
+ },
675
+ {
676
+ "internalType": "string",
677
+ "name": "ipfsHash",
678
+ "type": "string"
679
+ },
680
+ {
681
+ "internalType": "string",
682
+ "name": "metadataURI",
683
+ "type": "string"
684
+ }
685
+ ],
686
+ "name": "publicMintZipFile",
687
+ "outputs": [
688
+ {
689
+ "internalType": "uint256",
690
+ "name": "",
691
+ "type": "uint256"
692
+ }
693
+ ],
694
+ "stateMutability": "nonpayable",
695
+ "type": "function"
696
+ },
697
+ {
698
+ "inputs": [],
699
+ "name": "renounceOwnership",
700
+ "outputs": [],
701
+ "stateMutability": "nonpayable",
702
+ "type": "function"
703
+ },
704
+ {
705
+ "inputs": [
706
+ {
707
+ "internalType": "address",
708
+ "name": "from",
709
+ "type": "address"
710
+ },
711
+ {
712
+ "internalType": "address",
713
+ "name": "to",
714
+ "type": "address"
715
+ },
716
+ {
717
+ "internalType": "uint256",
718
+ "name": "tokenId",
719
+ "type": "uint256"
720
+ }
721
+ ],
722
+ "name": "safeTransferFrom",
723
+ "outputs": [],
724
+ "stateMutability": "nonpayable",
725
+ "type": "function"
726
+ },
727
+ {
728
+ "inputs": [
729
+ {
730
+ "internalType": "address",
731
+ "name": "from",
732
+ "type": "address"
733
+ },
734
+ {
735
+ "internalType": "address",
736
+ "name": "to",
737
+ "type": "address"
738
+ },
739
+ {
740
+ "internalType": "uint256",
741
+ "name": "tokenId",
742
+ "type": "uint256"
743
+ },
744
+ {
745
+ "internalType": "bytes",
746
+ "name": "data",
747
+ "type": "bytes"
748
+ }
749
+ ],
750
+ "name": "safeTransferFrom",
751
+ "outputs": [],
752
+ "stateMutability": "nonpayable",
753
+ "type": "function"
754
+ },
755
+ {
756
+ "inputs": [
757
+ {
758
+ "internalType": "address",
759
+ "name": "operator",
760
+ "type": "address"
761
+ },
762
+ {
763
+ "internalType": "bool",
764
+ "name": "approved",
765
+ "type": "bool"
766
+ }
767
+ ],
768
+ "name": "setApprovalForAll",
769
+ "outputs": [],
770
+ "stateMutability": "nonpayable",
771
+ "type": "function"
772
+ },
773
+ {
774
+ "inputs": [
775
+ {
776
+ "internalType": "bytes4",
777
+ "name": "interfaceId",
778
+ "type": "bytes4"
779
+ }
780
+ ],
781
+ "name": "supportsInterface",
782
+ "outputs": [
783
+ {
784
+ "internalType": "bool",
785
+ "name": "",
786
+ "type": "bool"
787
+ }
788
+ ],
789
+ "stateMutability": "view",
790
+ "type": "function"
791
+ },
792
+ {
793
+ "inputs": [],
794
+ "name": "symbol",
795
+ "outputs": [
796
+ {
797
+ "internalType": "string",
798
+ "name": "",
799
+ "type": "string"
800
+ }
801
+ ],
802
+ "stateMutability": "view",
803
+ "type": "function"
804
+ },
805
+ {
806
+ "inputs": [
807
+ {
808
+ "internalType": "uint256",
809
+ "name": "tokenId",
810
+ "type": "uint256"
811
+ }
812
+ ],
813
+ "name": "tokenURI",
814
+ "outputs": [
815
+ {
816
+ "internalType": "string",
817
+ "name": "",
818
+ "type": "string"
819
+ }
820
+ ],
821
+ "stateMutability": "view",
822
+ "type": "function"
823
+ },
824
+ {
825
+ "inputs": [],
826
+ "name": "totalSupply",
827
+ "outputs": [
828
+ {
829
+ "internalType": "uint256",
830
+ "name": "",
831
+ "type": "uint256"
832
+ }
833
+ ],
834
+ "stateMutability": "view",
835
+ "type": "function"
836
+ },
837
+ {
838
+ "inputs": [
839
+ {
840
+ "internalType": "address",
841
+ "name": "from",
842
+ "type": "address"
843
+ },
844
+ {
845
+ "internalType": "address",
846
+ "name": "to",
847
+ "type": "address"
848
+ },
849
+ {
850
+ "internalType": "uint256",
851
+ "name": "tokenId",
852
+ "type": "uint256"
853
+ }
854
+ ],
855
+ "name": "transferFrom",
856
+ "outputs": [],
857
+ "stateMutability": "nonpayable",
858
+ "type": "function"
859
+ },
860
+ {
861
+ "inputs": [
862
+ {
863
+ "internalType": "address",
864
+ "name": "newOwner",
865
+ "type": "address"
866
+ }
867
+ ],
868
+ "name": "transferOwnership",
869
+ "outputs": [],
870
+ "stateMutability": "nonpayable",
871
+ "type": "function"
872
+ },
873
+ {
874
+ "inputs": [
875
+ {
876
+ "internalType": "uint256",
877
+ "name": "tokenId",
878
+ "type": "uint256"
879
+ },
880
+ {
881
+ "internalType": "string",
882
+ "name": "providedMerkleRoot",
883
+ "type": "string"
884
+ }
885
+ ],
886
+ "name": "verifyZipFile",
887
+ "outputs": [
888
+ {
889
+ "internalType": "bool",
890
+ "name": "isValid",
891
+ "type": "bool"
892
+ }
893
+ ],
894
+ "stateMutability": "view",
895
+ "type": "function"
896
+ },
897
+ {
898
+ "inputs": [
899
+ {
900
+ "internalType": "uint256",
901
+ "name": "",
902
+ "type": "uint256"
903
+ }
904
+ ],
905
+ "name": "zipFileInfo",
906
+ "outputs": [
907
+ {
908
+ "internalType": "string",
909
+ "name": "fileName",
910
+ "type": "string"
911
+ },
912
+ {
913
+ "internalType": "string",
914
+ "name": "merkleRootHash",
915
+ "type": "string"
916
+ },
917
+ {
918
+ "internalType": "string",
919
+ "name": "ipfsHash",
920
+ "type": "string"
921
+ },
922
+ {
923
+ "internalType": "address",
924
+ "name": "creator",
925
+ "type": "address"
926
+ },
927
+ {
928
+ "internalType": "uint256",
929
+ "name": "creationTimestamp",
930
+ "type": "uint256"
931
+ },
932
+ {
933
+ "internalType": "uint256",
934
+ "name": "tokenizationTime",
935
+ "type": "uint256"
936
+ },
937
+ {
938
+ "internalType": "uint256",
939
+ "name": "blockNumber",
940
+ "type": "uint256"
941
+ }
942
+ ],
943
+ "stateMutability": "view",
944
+ "type": "function"
945
+ }
946
+ ];
947
+
948
+ // Check if contract compilation is ready
949
+ function isContractReady() {
950
+ return CONTRACT_BYTECODE &&
951
+ CONTRACT_BYTECODE !== "608060405234801561000f575f5ffd5b5033604051806040016040528060128152602001712732b7ad34b8102334b6329027232a103b1960711b8152506040518060400160405280600481526020016304e5a49560e41b815250815f9081610067919061019c565b506001610074828261019c565b5050506001600160a01b0381166100a457604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100ad816100b3565b50610256565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061012c57607f821691505b60208210810361014a57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561019757805f5260205f20601f840160051c810160208510156101755750805b601f840160051c820191505b81811015610194575f8155600101610181565b50505b505050565b81516001600160401b038111156101b5576101b5610104565b6101c9816101c38454610118565b84610150565b6020601f8211600181146101fb575f83156101e45750848201515b5f19600385901b1c1916600184901b178455610194565b5f84815260208120601f198516915b8281101561022a578785015182556020948501946001909201910161020a565b508482101561024757868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b612549806102635f395ff3fe608060405234801561000f575f5ffd5b50600436106101a0575f3560e01c806370d4d9fd116100f3578063a5e20a9c11610093578063ca3685d91161006e578063ca3685d9146103c4578063e985e9c5146103ea578063f2fde38b146103fd578063fe974bfe14610410575f5ffd5b8063a5e20a9c1461037f578063b88d4fde1461039e578063c87b56dd146103b1575f5ffd5b80638da5cb5b116100ce5780638da5cb5b1461033357806395d89b41146103445780639e8a1e7e1461034c578063a22cb4651461036c575f5ffd5b806370d4d9fd146102ee578063715018a6146103185780637f5950bd14610320575f5ffd5b806318160ddd1161015e5780635cefc90b116101395780635cefc90b1461028d5780635dce1ad8146102b55780636352211e146102c857806370a08231146102db575f5ffd5b806318160ddd1461025557806323b872dd1461026757806342842e0e1461027a575f5ffd5b8062ca4f78146101a457806301ffc9a7146101cc57806306fdde03146101df578063081812fc146101f4578063095ea7b31461021f5780630d8e6e2c14610234575b5f5ffd5b6101b76101b2366004611d5f565b610430565b60405190151581526020015b60405180910390f35b6101b76101da366004611db7565b6104d0565b6101e76104e0565b6040516101c39190611e00565b610207610202366004611e12565b61056f565b6040516001600160a01b0390911681526020016101c3565b61023261022d366004611e44565b610596565b005b6040805180820190915260058152640322e302e360dc1b60208201526101e7565b6008545b6040519081526020016101c3565b610232610275366004611e6c565b6105a5565b610232610288366004611e6c565b61062e565b6102a061029b366004611e12565b61064d565b604080519283526020830191909152016101c3565b6102596102c3366004611ea6565b610890565b6102076102d6366004611e12565b6108c2565b6102596102e9366004611ee7565b6108cc565b6103016102fc366004611ea6565b61093e565b6040805192151583526020830191909152016101c3565b610232610967565b61025961032e366004611f00565b61097a565b6007546001600160a01b0316610207565b6101e7610c5e565b61035f61035a366004611fbe565b610c6d565b6040516101c39190611fef565b61023261037a366004612031565b610e15565b61025961038d366004611e12565b600a6020525f908152604090205481565b6102326103ac36600461206a565b610e20565b6101e76103bf366004611e12565b610e38565b6103d76103d2366004611e12565b610e43565b6040516101c397969594939291906120e0565b6101b76103f8366004612148565b611019565b61023261040b366004611ee7565b611046565b61042361041e366004611e12565b611083565b6040516101c39190612179565b5f828152600260205260408120546001600160a01b031661046c5760405162461bcd60e51b81526004016104639061220d565b60405180910390fd5b8160405160200161047d9190612252565b60408051601f1981840301815282825280516020918201205f878152600983529290922091926104b1926001019101612295565b6040516020818303038152906040528051906020012014905092915050565b5f6104da826112fa565b92915050565b60605f80546104ee9061225d565b80601f016020809104026020016040519081016040528092919081815260200182805461051a9061225d565b80156105655780601f1061053c57610100808354040283529160200191610565565b820191905f5260205f20905b81548152906001019060200180831161054857829003601f168201915b5050505050905090565b5f6105798261131e565b505f828152600460205260409020546001600160a01b03166104da565b6105a1828233611356565b5050565b6001600160a01b0382166105ce57604051633250574960e11b81525f6004820152602401610463565b5f6105da838333611363565b9050836001600160a01b0316816001600160a01b031614610628576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610463565b50505050565b61064883838360405180602001604052805f815250610e20565b505050565b5f8181526002602052604081205481906001600160a01b03166106825760405162461bcd60e51b81526004016104639061220d565b5f83815260096020526040808220815160e081019092528054829082906106a89061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546106d49061225d565b801561071f5780601f106106f65761010080835404028352916020019161071f565b820191905f5260205f20905b81548152906001019060200180831161070257829003601f168201915b505050505081526020016001820180546107389061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546107649061225d565b80156107af5780601f10610786576101008083540402835291602001916107af565b820191905f5260205f20905b81548152906001019060200180831161079257829003601f168201915b505050505081526020016002820180546107c89061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546107f49061225d565b801561083f5780601f106108165761010080835404028352916020019161083f565b820191905f5260205f20905b81548152906001019060200180831161082257829003601f168201915b505050918352505060038201546001600160a01b03166020820152600482015460408201526005820154606082015260069091015460809091015260c081015160a090910151909590945092505050565b5f82826040516020016108a4929190612306565b60405160208183030381529060405280519060200120905092915050565b5f6104da8261131e565b5f6001600160a01b0382166109355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610463565b6104da82611455565b5f5f5f61094b8585610890565b5f908152600a6020526040902054801515969095509350505050565b61096f61149a565b6109785f6114c7565b565b5f5f8651116109cb5760405162461bcd60e51b815260206004820152601960248201527f46696c65206e616d652063616e6e6f7420626520656d707479000000000000006044820152606401610463565b5f855111610a1b5760405162461bcd60e51b815260206004820181905260248201527f4d65726b6c6520726f6f7420686173682063616e6e6f7420626520656d7074796044820152606401610463565b5f8411610a7c5760405162461bcd60e51b815260206004820152602960248201527f4372656174696f6e2074696d657374616d70206d75737420626520677265617460448201526806572207468616e20360bc1b6064820152608401610463565b5f610a878686610890565b5f818152600a602052604090205490915015610b0b5760405162461bcd60e51b815260206004820152603a60248201527f5a49502066696c652077697468207468697320636f6e74656e7420616e64207460448201527f696d657374616d7020616c726561647920746f6b656e697a65640000000000006064820152608401610463565b60088054905f610b1a8361231e565b9091555050600854610b2c3382611518565b835115610b3d57610b3d8185611531565b6040805160e08101825289815260208082018a9052818301889052336060830152608082018990524260a08301524360c08301525f84815260099091529190912081518190610b8c9082612386565b5060208201516001820190610ba19082612386565b5060408201516002820190610bb69082612386565b5060608201516003820180546001600160a01b0319166001600160a01b039092169190911790556080820151600482015560a0820151600582015560c0909101516006909101555f828152600a60205260409081902082905551339082907f0f09874b9c74d4595582d6c98e63000a1e9b6d57d383f3faa9b82ec744bc2db190610c4b908c908c908c908c9042904390612440565b60405180910390a3979650505050505050565b6060600180546104ee9061225d565b60605f6008546001600160401b03811115610c8a57610c8a611cb8565b604051908082528060200260200182016040528015610cb3578160200160208202803683370190505b5090505f60015b6008548111610d7d575f818152600260205260409020546001600160a01b031615610d6b5784604051602001610cf09190612252565b60408051601f1981840301815282825280516020918201205f85815260098352929092209192610d24926001019101612295565b6040516020818303038152906040528051906020012003610d6b5780838381518110610d5257610d52612494565b602090810291909101015281610d678161231e565b9250505b80610d758161231e565b915050610cba565b505f816001600160401b03811115610d9757610d97611cb8565b604051908082528060200260200182016040528015610dc0578160200160208202803683370190505b5090505f5b82811015610e0c57838181518110610ddf57610ddf612494565b6020026020010151828281518110610df957610df9612494565b6020908102919091010152600101610dc5565b50949350505050565b6105a1338383611580565b610e2b8484846105a5565b610628338585858561161e565b60606104da82611746565b60096020525f9081526040902080548190610e5d9061225d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e899061225d565b8015610ed45780601f10610eab57610100808354040283529160200191610ed4565b820191905f5260205f20905b815481529060010190602001808311610eb757829003601f168201915b505050505090806001018054610ee99061225d565b80601f0160208091040260200160405190810160405280929190818152602001828054610f159061225d565b8015610f605780601f10610f3757610100808354040283529160200191610f60565b820191905f5260205f20905b815481529060010190602001808311610f4357829003601f168201915b505050505090806002018054610f759061225d565b80601f0160208091040260200160405190810160405280929190818152602001828054610fa19061225d565b8015610fec5780601f10610fc357610100808354040283529160200191610fec565b820191905f5260205f20905b815481529060010190602001808311610fcf57829003601f168201915b5050505060038301546004840154600585015460069095015493946001600160a01b039092169390925087565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b61104e61149a565b6001600160a01b03811661107757604051631e4fbdf760e01b81525f6004820152602401610463565b611080816114c7565b50565b6110c86040518060e001604052806060815260200160608152602001606081526020015f6001600160a01b031681526020015f81526020015f81526020015f81525090565b5f828152600260205260409020546001600160a01b03166110fb5760405162461bcd60e51b81526004016104639061220d565b5f8281526009602052604090819020815160e081019092528054829082906111229061225d565b80601f016020809104026020016040519081016040528092919081815260200182805461114e9061225d565b80156111995780601f1061117057610100808354040283529160200191611199565b820191905f5260205f20905b81548152906001019060200180831161117c57829003601f168201915b505050505081526020016001820180546111b29061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546111de9061225d565b80156112295780601f1061120057610100808354040283529160200191611229565b820191905f5260205f20905b81548152906001019060200180831161120c57829003601f168201915b505050505081526020016002820180546112429061225d565b80601f016020809104026020016040519081016040528092919081815260200182805461126e9061225d565b80156112b95780601f10611290576101008083540402835291602001916112b9565b820191905f5260205f20905b81548152906001019060200180831161129c57829003601f168201915b505050918352505060038201546001600160a01b03166020820152600482015460408201526005820154606082015260069091015460809091015292915050565b5f6001600160e01b03198216632483248360e11b14806104da57506104da82611851565b5f818152600260205260408120546001600160a01b0316806104da57604051637e27328960e01b815260048101849052602401610463565b61064883838360016118a0565b5f828152600260205260408120546001600160a01b039081169083161561138f5761138f8184866119a4565b6001600160a01b038116156113c9576113aa5f855f5f6118a0565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b038516156113f7576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f6001600160a01b03821661147f576040516322718ad960e21b81525f6004820152602401610463565b506001600160a01b03165f9081526003602052604090205490565b6007546001600160a01b031633146109785760405163118cdaa760e01b8152336004820152602401610463565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6105a1828260405180602001604052805f815250611a08565b5f8281526006602052604090206115488282612386565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b0382166115b257604051630b61174360e31b81526001600160a01b0383166004820152602401610463565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561173f57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906116609088908890879087906004016124a8565b6020604051808303815f875af192505050801561169a575060408051601f3d908101601f19168201909252611697918101906124e4565b60015b611701573d8080156116c7576040519150601f19603f3d011682016040523d82523d5f602084013e6116cc565b606091505b5080515f036116f957604051633250574960e11b81526001600160a01b0385166004820152602401610463565b805160208201fd5b6001600160e01b03198116630a85bd0160e11b1461173d57604051633250574960e11b81526001600160a01b0385166004820152602401610463565b505b5050505050565b60606117518261131e565b505f828152600660205260408120805461176a9061225d565b80601f01602080910402602001604051908101604052809291908181526020018280546117969061225d565b80156117e15780601f106117b8576101008083540402835291602001916117e1565b820191905f5260205f20905b8154815290600101906020018083116117c457829003601f168201915b505050505090505f6117fd60408051602081019091525f815290565b905080515f0361180e575092915050565b8151156118405780826040516020016118289291906124ff565b60405160208183030381529060405292505050919050565b61184984611a1f565b949350505050565b5f6001600160e01b031982166380ac58cd60e01b148061188157506001600160e01b03198216635b5e139f60e01b145b806104da57506301ffc9a760e01b6001600160e01b03198316146104da565b80806118b457506001600160a01b03821615155b15611975575f6118c38461131e565b90506001600160a01b038316158015906118ef5750826001600160a01b0316816001600160a01b031614155b801561190257506119008184611019565b155b1561192b5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610463565b81156119735783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6119af838383611a90565b610648576001600160a01b0383166119dd57604051637e27328960e01b815260048101829052602401610463565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610463565b611a128383611af1565b610648335f85858561161e565b6060611a2a8261131e565b505f611a4060408051602081019091525f815290565b90505f815111611a5e5760405180602001604052805f815250611a89565b80611a6884611b52565b604051602001611a799291906124ff565b6040516020818303038152906040525b9392505050565b5f6001600160a01b038316158015906118495750826001600160a01b0316846001600160a01b03161480611ac95750611ac98484611019565b806118495750505f908152600460205260409020546001600160a01b03908116911614919050565b6001600160a01b038216611b1a57604051633250574960e11b81525f6004820152602401610463565b5f611b2683835f611363565b90506001600160a01b03811615610648576040516339e3563760e11b81525f6004820152602401610463565b60605f611b5e83611be1565b60010190505f816001600160401b03811115611b7c57611b7c611cb8565b6040519080825280601f01601f191660200182016040528015611ba6576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611bb057509392505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611c1f5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611c4b576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611c6957662386f26fc10000830492506010015b6305f5e1008310611c81576305f5e100830492506008015b6127108310611c9557612710830492506004015b60648310611ca7576064830492506002015b600a83106104da5760010192915050565b634e487b7160e01b5f52604160045260245ffd5b5f5f6001600160401b03841115611ce557611ce5611cb8565b50604051601f19601f85018116603f011681018181106001600160401b0382111715611d1357611d13611cb8565b604052838152905080828401851015611d2a575f5ffd5b838360208301375f60208583010152509392505050565b5f82601f830112611d50575f5ffd5b611a8983833560208501611ccc565b5f5f60408385031215611d70575f5ffd5b8235915060208301356001600160401b03811115611d8c575f5ffd5b611d9885828601611d41565b9150509250929050565b6001600160e01b031981168114611080575f5ffd5b5f60208284031215611dc7575f5ffd5b8135611a8981611da2565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611a896020830184611dd2565b5f60208284031215611e22575f5ffd5b5035919050565b80356001600160a01b0381168114611e3f575f5ffd5b919050565b5f5f60408385031215611e55575f5ffd5b611e5e83611e29565b946020939093013593505050565b5f5f5f60608486031215611e7e575f5ffd5b611e8784611e29565b9250611e9560208501611e29565b929592945050506040919091013590565b5f5f60408385031215611eb7575f5ffd5b82356001600160401b03811115611ecc575f5ffd5b611ed885828601611d41565b95602094909401359450505050565b5f60208284031215611ef7575f5ffd5b611a8982611e29565b5f5f5f5f5f60a08688031215611f14575f5ffd5b85356001600160401b03811115611f29575f5ffd5b611f3588828901611d41565b95505060208601356001600160401b03811115611f50575f5ffd5b611f5c88828901611d41565b9450506040860135925060608601356001600160401b03811115611f7e575f5ffd5b611f8a88828901611d41565b92505060808601356001600160401b03811115611fa5575f5ffd5b611fb188828901611d41565b9150509295509295909350565b5f60208284031215611fce575f5ffd5b81356001600160401b03811115611fe3575f5ffd5b61184984828501611d41565b602080825282518282018190525f918401906040840190835b81811015612026578351835260209384019390920191600101612008565b509095945050505050565b5f5f60408385031215612042575f5ffd5b61204b83611e29565b91506020830135801515811461205f575f5ffd5b809150509250929050565b5f5f5f5f6080858703121561207d575f5ffd5b61208685611e29565b935061209460208601611e29565b92506040850135915060608501356001600160401b038111156120b5575f5ffd5b8501601f810187136120c5575f5ffd5b6120d487823560208401611ccc565b91505092959194509250565b60e081525f6120f260e083018a611dd2565b8281036020840152612104818a611dd2565b905082810360408401526121188189611dd2565b6001600160a01b039790971660608401525050608081019390935260a083019190915260c0909101529392505050565b5f5f60408385031215612159575f5ffd5b61216283611e29565b915061217060208401611e29565b90509250929050565b602081525f825160e06020840152612195610100840182611dd2565b90506020840151601f198483030160408501526121b28282611dd2565b9150506040840151601f198483030160608501526121d08282611dd2565b91505060018060a01b036060850151166080840152608084015160a084015260a084015160c084015260c084015160e08401528091505092915050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b5f81518060208401855e5f93019283525090919050565b5f611a89828461223b565b600181811c9082168061227157607f821691505b60208210810361228f57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f5f83546122a28161225d565b6001821680156122b957600181146122ce576122fb565b60ff19831686528115158202860193506122fb565b865f5260205f205f5b838110156122f3578154888201526001909101906020016122d7565b505081860193505b509195945050505050565b5f612311828561223b565b9283525050602001919050565b5f6001820161233b57634e487b7160e01b5f52601160045260245ffd5b5060010190565b601f82111561064857805f5260205f20601f840160051c810160208510156123675750805b601f840160051c820191505b8181101561173f575f8155600101612373565b81516001600160401b0381111561239f5761239f611cb8565b6123b3816123ad845461225d565b84612342565b6020601f8211600181146123e5575f83156123ce5750848201515b5f19600385901b1c1916600184901b17845561173f565b5f84815260208120601f198516915b8281101561241457878501518255602094850194600190920191016123f4565b508482101561243157868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b60c081525f61245260c0830189611dd2565b82810360208401526124648189611dd2565b9050866040840152828103606084015261247e8187611dd2565b6080840195909552505060a00152949350505050565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906124da90830184611dd2565b9695505050505050565b5f602082840312156124f4575f5ffd5b8151611a8981611da2565b5f61184961250d838661223b565b8461223b56fea2646970667358221220ec5692f96d1d270dc9c2c061988393c84d97f92e3bcc623597bccbb57a29d12d64736f6c634300081e0033" &&
952
+ CONTRACT_BYTECODE.length > 50;
953
+ }
954
+
955
+ async function deployPublicContract() {
956
+ console.log('๐ŸŒ NZIP NFT Public Contract Deployment');
957
+ console.log('=====================================');
958
+
959
+ // Check if user has a deprecated contract configured
960
+ if (EXISTING_CONTRACT) {
961
+ console.log(`โš ๏ธ Deprecated contract detected in config: ${EXISTING_CONTRACT}`);
962
+ console.log('๐Ÿ“‹ This contract is no longer supported and should not be used.');
963
+ console.log('๐Ÿ“‹ Proceeding with new contract deployment...\n');
964
+ }
965
+
966
+ // Validate configuration
967
+ if (!PRIVATE_KEY) {
968
+ console.log('โŒ PRIVATE_KEY is required for deployment.');
969
+ console.log('๐Ÿ“ Set it in environment variable or deployment.config.js');
970
+ console.log('๐Ÿ“ Example: PRIVATE_KEY=your_private_key_without_0x_prefix');
971
+ throw new Error('โŒ PRIVATE_KEY environment variable is required');
972
+ }
973
+
974
+ if (!NETWORK_CONFIG[CHAIN_ID]) {
975
+ throw new Error(`โŒ Unsupported chain ID: ${CHAIN_ID}`);
976
+ }
977
+
978
+ const networkConfig = NETWORK_CONFIG[CHAIN_ID];
979
+ console.log(`๐ŸŒ Network: ${networkConfig.name}`);
980
+ console.log(`๐Ÿ”— RPC URL: ${networkConfig.rpcUrl}`);
981
+ console.log(`๐Ÿ” Explorer: ${networkConfig.explorerUrl}`);
982
+
983
+ // Validate contract compilation
984
+ if (!isContractReady()) {
985
+ console.log('\nโŒ Contract compilation required!');
986
+ console.log('๐Ÿ“‹ The deployment script needs compiled bytecode from NZIP-NFT.sol');
987
+ console.log('');
988
+ console.log('๐Ÿ”ง To get compiled bytecode:');
989
+ console.log('');
990
+ console.log('Option 1: Use Remix IDE (Recommended)');
991
+ console.log('1. Go to https://remix.ethereum.org');
992
+ console.log('2. Copy contract from: packages/neozipkit/contracts/src/NZIP-NFT.sol');
993
+ console.log('3. Compile with Solidity 0.8.19+');
994
+ console.log('4. Copy bytecode from compilation artifacts');
995
+ console.log('5. Replace CONTRACT_BYTECODE and CONTRACT_ABI in this script');
996
+ console.log('');
997
+ console.log('Option 2: Note about deprecated contract');
998
+ console.log('โŒ Previous contract: 0xb78CB3bcC788fca38c731b1E9D70CF60b04CA015 is DEPRECATED');
999
+ console.log('๐Ÿ“‹ You must deploy a new contract for production use!');
1000
+ console.log('');
1001
+ throw new Error('โŒ Contract bytecode not compiled. Please follow the steps above.');
1002
+ }
1003
+
1004
+ try {
1005
+ // Initialize provider and wallet
1006
+ console.log('\n๐Ÿ”‘ Initializing wallet...');
1007
+ const provider = new ethers.JsonRpcProvider(networkConfig.rpcUrl);
1008
+ const wallet = new ethers.Wallet(PRIVATE_KEY, provider);
1009
+
1010
+ console.log(`๐Ÿ‘› Deployer address: ${wallet.address}`);
1011
+
1012
+ // Check balance
1013
+ const balance = await provider.getBalance(wallet.address);
1014
+ const balanceEth = ethers.formatEther(balance);
1015
+ console.log(`๐Ÿ’ฐ Balance: ${balanceEth} ETH`);
1016
+
1017
+ if (parseFloat(balanceEth) < 0.01) {
1018
+ console.warn('โš ๏ธ Low balance detected. Make sure you have enough ETH for deployment.');
1019
+ }
1020
+
1021
+ // Deploy contract
1022
+ const result = await deployContract(
1023
+ "NZIP NFT (Public)",
1024
+ CONTRACT_BYTECODE,
1025
+ CONTRACT_ABI,
1026
+ wallet
1027
+ );
1028
+
1029
+ // Test basic functionality
1030
+ console.log('\n๐Ÿงช Testing deployed contract...');
1031
+
1032
+ try {
1033
+ const totalSupply = await result.contract.totalSupply();
1034
+ console.log(`โœ… Contract total supply: ${totalSupply}`);
1035
+ } catch (testError) {
1036
+ console.warn('โš ๏ธ Contract testing failed:', testError.message);
1037
+ }
1038
+
1039
+ // Generate deployment summary
1040
+ const summary = {
1041
+ network: networkConfig.name,
1042
+ chainId: CHAIN_ID,
1043
+ deployerAddress: wallet.address,
1044
+ deployedAt: new Date().toISOString(),
1045
+ contract: {
1046
+ name: "NZIP NFT (Public)",
1047
+ type: "public",
1048
+ address: result.address,
1049
+ transactionHash: result.transactionHash,
1050
+ explorerUrl: `${networkConfig.explorerUrl}/address/${result.address}`,
1051
+ txExplorerUrl: `${networkConfig.explorerUrl}/tx/${result.transactionHash}`,
1052
+ features: [
1053
+ "Universal verification",
1054
+ "Public blockchain metadata",
1055
+ "8-field enhanced structure",
1056
+ "Block number and hash tracking"
1057
+ ]
1058
+ }
1059
+ };
1060
+
1061
+ // Save deployment info
1062
+ const deploymentFile = `deployment-public-${networkConfig.name.toLowerCase().replace(' ', '-')}-${Date.now()}.json`;
1063
+ fs.writeFileSync(deploymentFile, JSON.stringify(summary, null, 2));
1064
+
1065
+ // Display final summary
1066
+ console.log('\n๐ŸŽ‰ PUBLIC CONTRACT DEPLOYMENT COMPLETE!');
1067
+ console.log('======================================');
1068
+ console.log(`๐Ÿ“„ Deployment summary saved to: ${deploymentFile}`);
1069
+ console.log(`๐Ÿ“‹ Contract Address: ${summary.contract.address}`);
1070
+ console.log(`๐Ÿ”— Explorer Link: ${summary.contract.explorerUrl}`);
1071
+ console.log(`๐Ÿ“œ Transaction Link: ${summary.contract.txExplorerUrl}`);
1072
+
1073
+ console.log('\nโœจ Contract Features:');
1074
+ summary.contract.features.forEach(feature => {
1075
+ console.log(` โœ… ${feature}`);
1076
+ });
1077
+
1078
+ console.log('\nโš™๏ธ Next Steps:');
1079
+ console.log('1. Verify contract on the block explorer');
1080
+ console.log('2. Update portal configuration:');
1081
+ console.log(` - File: apps/portal/src/lib/tokenization.ts`);
1082
+ console.log(` - Update CONTRACT_CONFIG.contractAddress to: "${summary.contract.address}"`);
1083
+ console.log('3. Test minting functionality');
1084
+ console.log('4. Deploy private contract if needed');
1085
+
1086
+ return summary;
1087
+
1088
+ } catch (error) {
1089
+ console.error('\nโŒ Deployment failed:', error);
1090
+ throw error;
1091
+ }
1092
+ }
1093
+
1094
+ // Main execution
1095
+ if (require.main === module) {
1096
+ deployPublicContract()
1097
+ .then((summary) => {
1098
+ console.log('\nโœ… Public contract deployment completed successfully!');
1099
+ process.exit(0);
1100
+ })
1101
+ .catch((error) => {
1102
+ console.error('\nโŒ Public contract deployment failed:', error);
1103
+ process.exit(1);
1104
+ });
1105
+ }
1106
+
1107
+ module.exports = { deployPublicContract };