From 5327898beda98a7677179601f6b9e2a81c139fe6 Mon Sep 17 00:00:00 2001 From: Luke Schoen Date: Sun, 3 Nov 2024 21:21:38 +0530 Subject: [PATCH] use secretjs beta whilst testnet being updated. fixes uploading Nunya secret contract --- _SETUP.md | 4 + .../secret-contracts-scripts/package.json | 2 +- .../secret-contracts-scripts/src/index.ts | 9 +- yarn.lock | 248 ++++++++++++++++-- 4 files changed, 232 insertions(+), 31 deletions(-) diff --git a/_SETUP.md b/_SETUP.md index 63d7048..c99721f 100644 --- a/_SETUP.md +++ b/_SETUP.md @@ -85,9 +85,13 @@ docker rmi sco > IMPORTANT: Prior to Instantiation step it is necessary to deploy the EVM Gateway ``` +yarn install yarn run secret:clean:uploadContract yarn run secret:start:uploadContract ``` + +> IMPORTANT: If deployment of the code with `await secretjs.tx.compute.storeCode` is unsuccessful, then check if Beta version of secretjs is necessary incase the Secret Testnet is being upgraded. + * Query Pubkey ``` yarn run secret:queryPubkey diff --git a/packages/secret-contracts-scripts/package.json b/packages/secret-contracts-scripts/package.json index 5b94756..2cb9192 100644 --- a/packages/secret-contracts-scripts/package.json +++ b/packages/secret-contracts-scripts/package.json @@ -17,7 +17,7 @@ "@types/node": "^22.7.4", "dotenv": "^16.4.5", "ethers": "^5.7.2", - "secretjs": "^1.12.5", + "secretjs": "1.15.0-beta.0", "typescript": "^5.6.2" } } diff --git a/packages/secret-contracts-scripts/src/index.ts b/packages/secret-contracts-scripts/src/index.ts index 3e5b322..7d0609b 100644 --- a/packages/secret-contracts-scripts/src/index.ts +++ b/packages/secret-contracts-scripts/src/index.ts @@ -31,6 +31,7 @@ const gatewayHash = "ad8ca07ffba1cb26ebf952c29bc4eced8319c171430993e5b5089887f27b3f70"; const gatewayPublicKey = "0x046d0aac3ef10e69055e934ca899f508ba516832dc74aa4ed4d741052ed5a568774d99d3bfed641a7935ae73aac8e34938db747c2f0e8b2aa95c25d069a575cc8b"; +const nunyaBusinessContractAddress = ""; // Secret Mainnet // reference: https://docs.scrt.network/secret-network-documentation/confidential-computing-layer/ethereum-evm-developer-toolkit/supported-networks/secret-gateway/secretpath-mainnet-secret-4-contracts @@ -71,6 +72,7 @@ async function main () { gateway_address: String, gateway_hash: String, gateway_key: String, + nunya_business_contract_address: any, count: Number, }; @@ -123,7 +125,11 @@ async function main () { tx?.arrayLog?.find((log: any) => log?.type === "message" && log?.key === "code_id")?.value ); - console.log("tx.rawLog: ", tx?.rawLog); + if (tx?.rawLog) { + console.log("tx.rawLog: ", tx?.rawLog); + } else { + console.log("tx: ", tx); + } console.log("codeId: ", codeId); @@ -163,6 +169,7 @@ async function main () { gateway_address: gatewayAddress, gateway_hash: gatewayHash, gateway_key: gatewayPublicKeyBytes, + nunya_business_contract_address: nunyaBusinessContractAddress, count: 1, }; diff --git a/yarn.lock b/yarn.lock index d309b4f..30d40a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -234,23 +234,91 @@ __metadata: languageName: node linkType: hard -"@cosmjs/encoding@npm:0.27.1": - version: 0.27.1 - resolution: "@cosmjs/encoding@npm:0.27.1" +"@cosmjs/amino@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/amino@npm:0.32.4" + dependencies: + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + checksum: 10/2644d268c10990ad3c6509f241c3b789064d1e38046ad80aed306c3cc17c70ffb7198f3fd19b515b5e22cea483062d0f5bf74bc1963a840534dfc495a3233827 + languageName: node + linkType: hard + +"@cosmjs/crypto@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/crypto@npm:0.32.4" + dependencies: + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + "@noble/hashes": "npm:^1" + bn.js: "npm:^5.2.0" + elliptic: "npm:^6.5.4" + libsodium-wrappers-sumo: "npm:^0.7.11" + checksum: 10/68b78aa5c91bdd81cefdd629d2574bdd2e41bcd27b38b18b86a38fa768b1096930313bcea5bb8479f32358ac4465d6e583f4cc253b942af428cf98cf4e84d4b1 + languageName: node + linkType: hard + +"@cosmjs/encoding@npm:0.32.3": + version: 0.32.3 + resolution: "@cosmjs/encoding@npm:0.32.3" dependencies: base64-js: "npm:^1.3.0" bech32: "npm:^1.1.4" readonly-date: "npm:^1.0.0" - checksum: 10/d6cfa41fd6ee88c166490cdfda02f70d25a8c2fae809e87715f8fd0e090b8337d646a71d2c8f7657776da67921ff8610997e45b3b36df43c8b389ae75b619b73 + checksum: 10/b83ba95496e588ffb01c67ebcbc65f4dc4a83d0306875672d298f5f72626c977a4047f9e116ffbe66a40b81e61d3616d437469edf6c9b2b1fa36a73194e21708 languageName: node linkType: hard -"@cosmjs/math@npm:0.27.1": - version: 0.27.1 - resolution: "@cosmjs/math@npm:0.27.1" +"@cosmjs/encoding@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/encoding@npm:0.32.4" + dependencies: + base64-js: "npm:^1.3.0" + bech32: "npm:^1.1.4" + readonly-date: "npm:^1.0.0" + checksum: 10/592f1ec81f9a4216fa047f65b6f8f5c00b3dc41f19f22e590d98954810f22b247137e7a8de62e7c93bcc7a557fd2c8d87cefee5b39a951a848790259b8e95db7 + languageName: node + linkType: hard + +"@cosmjs/math@npm:0.32.3": + version: 0.32.3 + resolution: "@cosmjs/math@npm:0.32.3" + dependencies: + bn.js: "npm:^5.2.0" + checksum: 10/7bd48d19bda6dec115a66322403305f0618646363d518980d299cb659223da4f1e62c189553a7a488eeef74ef2d066a0f5b29cd8c2f6bc41e54619d4993c4ace + languageName: node + linkType: hard + +"@cosmjs/math@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/math@npm:0.32.4" dependencies: bn.js: "npm:^5.2.0" - checksum: 10/d02cd8c8260c77dd9c4943b32deee2411420b24502a4856070083f39911b921af959d7686d3f475c5859eaa2b15306eb15279ce6f1a87e337e7c31c12b009730 + checksum: 10/1b67f46cb8ace0dcd01bc4a63bc935d48624de5a342144944d1c45d7b49fa3f83f052dc70be20b39314611c6b31a6b6ad0ff1c7d655cf5f6a4dc28e22759588f + languageName: node + linkType: hard + +"@cosmjs/proto-signing@npm:^0.32.3": + version: 0.32.4 + resolution: "@cosmjs/proto-signing@npm:0.32.4" + dependencies: + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + cosmjs-types: "npm:^0.9.0" + checksum: 10/6369d26a2949236a525162358fdd78ffefc13710db279be764d22f79e103941f7681e86dd4a770b87c41b9bfb0fa162ccb629c70b6b7b8de49e7e7393f7353da + languageName: node + linkType: hard + +"@cosmjs/utils@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/utils@npm:0.32.4" + checksum: 10/92f4d0878bedda53d113894ebadd31a6d189fdd45f2f884049ee99c2d7f907703b6dc40c8bc9b88b912443c38f3dbf77a9474183f41b85dec1f9ef3bec9d86c4 languageName: node linkType: hard @@ -1435,7 +1503,7 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.5.0, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:~1.5.0": +"@noble/hashes@npm:1.5.0, @noble/hashes@npm:^1, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:~1.5.0": version: 1.5.0 resolution: "@noble/hashes@npm:1.5.0" checksum: 10/da7fc7af52af7afcf59810a7eea6155075464ff462ffda2572dc6d57d53e2669b1ea2ec774e814f6273f1697e567f28d36823776c9bf7068cba2a2855140f26e @@ -3991,6 +4059,13 @@ __metadata: languageName: node linkType: hard +"@yarnpkg/lockfile@npm:^1.1.0": + version: 1.1.0 + resolution: "@yarnpkg/lockfile@npm:1.1.0" + checksum: 10/cd19e1114aaf10a05126aeea8833ef4ca8af8a46e88e12884f8359d19333fd19711036dbc2698dbe937f81f037070cf9a8da45c2e8c6ca19cafd7d15659094ed + languageName: node + linkType: hard + "abbrev@npm:1": version: 1.1.1 resolution: "abbrev@npm:1.1.1" @@ -4656,13 +4731,6 @@ __metadata: languageName: node linkType: hard -"bech32@npm:2.0.0": - version: 2.0.0 - resolution: "bech32@npm:2.0.0" - checksum: 10/fa15acb270b59aa496734a01f9155677b478987b773bf701f465858bf1606c6a970085babd43d71ce61895f1baa594cb41a2cd1394bd2c6698f03cc2d811300e - languageName: node - linkType: hard - "big-integer@npm:1.6.51": version: 1.6.51 resolution: "big-integer@npm:1.6.51" @@ -5189,6 +5257,13 @@ __metadata: languageName: node linkType: hard +"ci-info@npm:^3.7.0": + version: 3.9.0 + resolution: "ci-info@npm:3.9.0" + checksum: 10/75bc67902b4d1c7b435497adeb91598f6d52a3389398e44294f6601b20cfef32cf2176f7be0eb961d9e085bb333a8a5cae121cb22f81cf238ae7f58eb80e9397 + languageName: node + linkType: hard + "cipher-base@npm:^1.0.0, cipher-base@npm:^1.0.1, cipher-base@npm:^1.0.3": version: 1.0.4 resolution: "cipher-base@npm:1.0.4" @@ -5531,6 +5606,13 @@ __metadata: languageName: node linkType: hard +"cosmjs-types@npm:^0.9.0": + version: 0.9.0 + resolution: "cosmjs-types@npm:0.9.0" + checksum: 10/c61137bf0aba5c4b73f5191590472e6de61203c3e3dc0081643ac388c9f27f65de052298a0c6b239543adaba7829f5ff9c9fb95ab44d7b4186b080b8478e3b27 + languageName: node + linkType: hard + "crc-32@npm:^1.2.0": version: 1.2.2 resolution: "crc-32@npm:1.2.2" @@ -7573,6 +7655,15 @@ __metadata: languageName: node linkType: hard +"find-yarn-workspace-root@npm:^2.0.0": + version: 2.0.0 + resolution: "find-yarn-workspace-root@npm:2.0.0" + dependencies: + micromatch: "npm:^4.0.2" + checksum: 10/7fa7942849eef4d5385ee96a0a9a5a9afe885836fd72ed6a4280312a38690afea275e7d09b343fe97daf0412d833f8ac4b78c17fc756386d9ebebf0759d707a7 + languageName: node + linkType: hard + "flat-cache@npm:^3.0.4": version: 3.2.0 resolution: "flat-cache@npm:3.2.0" @@ -7714,7 +7805,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^9.1.0": +"fs-extra@npm:^9.0.0, fs-extra@npm:^9.1.0": version: 9.1.0 resolution: "fs-extra@npm:9.1.0" dependencies: @@ -8154,7 +8245,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 10/bf152d0ed1dc159239db1ba1f74fdbc40cb02f626770dcd5815c427ce0688c2635a06ed69af364396da4636d0408fcf7d4afdf7881724c3307e46aff30ca49e2 @@ -9103,7 +9194,7 @@ __metadata: languageName: node linkType: hard -"is-wsl@npm:^2.2.0": +"is-wsl@npm:^2.1.1, is-wsl@npm:^2.2.0": version: 2.2.0 resolution: "is-wsl@npm:2.2.0" dependencies: @@ -9374,6 +9465,18 @@ __metadata: languageName: node linkType: hard +"json-stable-stringify@npm:^1.0.2": + version: 1.1.1 + resolution: "json-stable-stringify@npm:1.1.1" + dependencies: + call-bind: "npm:^1.0.5" + isarray: "npm:^2.0.5" + jsonify: "npm:^0.0.1" + object-keys: "npm:^1.1.1" + checksum: 10/60853c1f63451319b5c7953465a555aa816cf84e60e3ca36b6c05225d8fdc4615127fb4ecb92f9f5ad880c552ab8cbae9a519f78b995e7788d6d89e57afafdeb + languageName: node + linkType: hard + "json-stream-stringify@npm:^3.1.4": version: 3.1.6 resolution: "json-stream-stringify@npm:3.1.6" @@ -9417,6 +9520,13 @@ __metadata: languageName: node linkType: hard +"jsonify@npm:^0.0.1": + version: 0.0.1 + resolution: "jsonify@npm:0.0.1" + checksum: 10/7b86b6f4518582ff1d8b7624ed6c6277affd5246445e864615dbdef843a4057ac58587684faf129ea111eeb80e01c15f0a4d9d03820eb3f3985fa67e81b12398 + languageName: node + linkType: hard + "jsonschema@npm:^1.2.4, jsonschema@npm:^1.4.1": version: 1.4.1 resolution: "jsonschema@npm:1.4.1" @@ -9471,6 +9581,15 @@ __metadata: languageName: node linkType: hard +"klaw-sync@npm:^6.0.0": + version: 6.0.0 + resolution: "klaw-sync@npm:6.0.0" + dependencies: + graceful-fs: "npm:^4.1.11" + checksum: 10/0da397f8961313c3ef8f79fb63af9002cde5a8fb2aeb1a37351feff0dd6006129c790400c3f5c3b4e757bedcabb13d21ec0a5eaef5a593d59515d4f2c291e475 + languageName: node + linkType: hard + "language-subtag-registry@npm:^0.3.20": version: 0.3.23 resolution: "language-subtag-registry@npm:0.3.23" @@ -9507,6 +9626,22 @@ __metadata: languageName: node linkType: hard +"libsodium-sumo@npm:^0.7.15": + version: 0.7.15 + resolution: "libsodium-sumo@npm:0.7.15" + checksum: 10/2600d208fca1bbad8a727d9f4b3e9bead92e338be74e40d52c7b53d1b5f6b611a24cad885ae4d5268d923e66379509b4efe7db3010480f382fca8d75853c1454 + languageName: node + linkType: hard + +"libsodium-wrappers-sumo@npm:^0.7.11": + version: 0.7.15 + resolution: "libsodium-wrappers-sumo@npm:0.7.15" + dependencies: + libsodium-sumo: "npm:^0.7.15" + checksum: 10/060cc18069e633b0038c5eb5751b9ab0574469a5f2e272ec6ea845de627c46af5c22644f64bb9cd0b2891c118159b0c1f4e7b796232ad8cb9420dc6db92b3fa8 + languageName: node + linkType: hard + "lilconfig@npm:2.1.0, lilconfig@npm:^2.1.0": version: 2.1.0 resolution: "lilconfig@npm:2.1.0" @@ -10807,6 +10942,16 @@ __metadata: languageName: node linkType: hard +"open@npm:^7.4.2": + version: 7.4.2 + resolution: "open@npm:7.4.2" + dependencies: + is-docker: "npm:^2.0.0" + is-wsl: "npm:^2.1.1" + checksum: 10/4fc02ed3368dcd5d7247ad3566433ea2695b0713b041ebc0eeb2f0f9e5d4e29fc2068f5cdd500976b3464e77fe8b61662b1b059c73233ccc601fe8b16d6c1cd6 + languageName: node + linkType: hard + "open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" @@ -10988,6 +11133,31 @@ __metadata: languageName: node linkType: hard +"patch-package@npm:^8.0.0": + version: 8.0.0 + resolution: "patch-package@npm:8.0.0" + dependencies: + "@yarnpkg/lockfile": "npm:^1.1.0" + chalk: "npm:^4.1.2" + ci-info: "npm:^3.7.0" + cross-spawn: "npm:^7.0.3" + find-yarn-workspace-root: "npm:^2.0.0" + fs-extra: "npm:^9.0.0" + json-stable-stringify: "npm:^1.0.2" + klaw-sync: "npm:^6.0.0" + minimist: "npm:^1.2.6" + open: "npm:^7.4.2" + rimraf: "npm:^2.6.3" + semver: "npm:^7.5.3" + slash: "npm:^2.0.0" + tmp: "npm:^0.0.33" + yaml: "npm:^2.2.2" + bin: + patch-package: index.js + checksum: 10/8714322c35b29266e71c82d58443ce5322400a546a3327f1b8907b8eeb7e366dff33c4fdfbd25e3f0b3a9927189c26e9ac60636ca1e4140d6dbc11cca10f9b5d + languageName: node + linkType: hard + "path-browserify@npm:^1.0.1": version: 1.0.1 resolution: "path-browserify@npm:1.0.1" @@ -12121,6 +12291,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^2.6.3": + version: 2.7.1 + resolution: "rimraf@npm:2.7.1" + dependencies: + glob: "npm:^7.1.3" + bin: + rimraf: ./bin.js + checksum: 10/4586c296c736483e297da7cffd19475e4a3e41d07b1ae124aad5d687c79e4ffa716bdac8732ed1db942caf65271cee9dd39f8b639611de161a2753e2112ffe1d + languageName: node + linkType: hard + "rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" @@ -12326,20 +12507,21 @@ __metadata: "@types/node": "npm:^22.7.4" dotenv: "npm:^16.4.5" ethers: "npm:^5.7.2" - secretjs: "npm:^1.12.5" + secretjs: "npm:1.15.0-beta.0" typescript: "npm:^5.6.2" languageName: unknown linkType: soft -"secretjs@npm:^1.12.5": - version: 1.12.5 - resolution: "secretjs@npm:1.12.5" +"secretjs@npm:1.15.0-beta.0": + version: 1.15.0-beta.0 + resolution: "secretjs@npm:1.15.0-beta.0" dependencies: - "@cosmjs/encoding": "npm:0.27.1" - "@cosmjs/math": "npm:0.27.1" + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/encoding": "npm:0.32.3" + "@cosmjs/math": "npm:0.32.3" + "@cosmjs/proto-signing": "npm:^0.32.3" "@noble/hashes": "npm:1.0.0" "@noble/secp256k1": "npm:1.7.0" - bech32: "npm:2.0.0" big-integer: "npm:1.6.51" bignumber.js: "npm:9.0.2" bip32: "npm:2.0.6" @@ -12349,9 +12531,10 @@ __metadata: google-protobuf: "npm:^3.14.0" miscreant: "npm:0.3.2" pako: "npm:2.0.4" + patch-package: "npm:^8.0.0" protobufjs: "npm:7.2.5" secure-random: "npm:1.1.2" - checksum: 10/18cdf023bbfc4ac0875c653bef9bf4464391dd8fa4de69b562edfcc03ec9d1add423bd1100dcaa7786195430c3a1688a228be1fc11cc55893bb21acbc1e71d0c + checksum: 10/4d102b580719775c9a08af8d7d45951b94f0092c7ecc83d6d272184d7c75aba3b64c4be4eacaf9d897934cef5475685bd26b7805f9e7bd6bf71c2e1d253f4a0e languageName: node linkType: hard @@ -12391,7 +12574,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.4, semver@npm:^7.6.3": +"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -12547,6 +12730,13 @@ __metadata: languageName: node linkType: hard +"slash@npm:^2.0.0": + version: 2.0.0 + resolution: "slash@npm:2.0.0" + checksum: 10/512d4350735375bd11647233cb0e2f93beca6f53441015eea241fe784d8068281c3987fbaa93e7ef1c38df68d9c60013045c92837423c69115297d6169aa85e6 + languageName: node + linkType: hard + "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -13310,7 +13500,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:0.0.33": +"tmp@npm:0.0.33, tmp@npm:^0.0.33": version: 0.0.33 resolution: "tmp@npm:0.0.33" dependencies: