From 07139bce49596f2d9aeb568860b415d29296fa8b Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Sat, 2 Oct 2021 22:04:37 +0200 Subject: [PATCH] Remove unused cw1/cw3 contract deployments --- .../cosmwasm-stargate/src/testutils.spec.ts | 16 --- scripts/wasmd/contracts/checksums.sha256 | 2 - scripts/wasmd/contracts/cw1_subkeys.wasm | 3 - .../wasmd/contracts/cw3_fixed_multisig.wasm | 3 - scripts/wasmd/contracts/download.sh | 4 - scripts/wasmd/deploy_cw1.js | 75 ------------ scripts/wasmd/deploy_cw3.js | 114 ------------------ scripts/wasmd/init.sh | 2 - 8 files changed, 219 deletions(-) delete mode 100644 scripts/wasmd/contracts/cw1_subkeys.wasm delete mode 100644 scripts/wasmd/contracts/cw3_fixed_multisig.wasm delete mode 100755 scripts/wasmd/deploy_cw1.js delete mode 100755 scripts/wasmd/deploy_cw3.js diff --git a/packages/cosmwasm-stargate/src/testutils.spec.ts b/packages/cosmwasm-stargate/src/testutils.spec.ts index faefc347..8687e7ed 100644 --- a/packages/cosmwasm-stargate/src/testutils.spec.ts +++ b/packages/cosmwasm-stargate/src/testutils.spec.ts @@ -149,22 +149,6 @@ export const deployedIbcReflect = { ], }; -/** Deployed as part of scripts/wasmd/init.sh */ -export const deployedCw3 = { - codeId: 3, - instances: [ - "wasm1xqeym28j9xgv0p93pwwt6qcxf9tdvf9z83duy9", // Multisig (1/3) - "wasm1jka38ckju8cpjap00jf9xdvdyttz9cauchu0zl", // Multisig (2/3) - "wasm12dnl585uxzddjw9hw4ca694f054shgpgffnawy", // Multisig (uneven weights) - ], -}; - -/** Deployed as part of scripts/wasmd/init.sh */ -export const deployedCw1 = { - codeId: 4, - instances: ["wasm1vs2vuks65rq7xj78mwtvn7vvnm2gn7ad78g6yp"], -}; - export function wasmdEnabled(): boolean { return !!process.env.WASMD_ENABLED; } diff --git a/scripts/wasmd/contracts/checksums.sha256 b/scripts/wasmd/contracts/checksums.sha256 index 609f983b..b9c557ef 100644 --- a/scripts/wasmd/contracts/checksums.sha256 +++ b/scripts/wasmd/contracts/checksums.sha256 @@ -1,4 +1,2 @@ -37f868eda7a723a769f6ff77cc27435455c3cff7b14481a114895d3d93cf8326 cw1_subkeys.wasm -203ceb9ffa61fdcb34b859a4d1249bec517112ecbaf9a9092b3787dc8199dde6 cw3_fixed_multisig.wasm 716a97b1c086e0d7769ae7887edaa0e34faba2d7b8cda07f741f9fbf95706e8c hackatom.wasm 0a127c6e04c8aad95dd3d50177e95b6116606546f0a4fc894ba82a29ce3b6fc1 ibc_reflect.wasm diff --git a/scripts/wasmd/contracts/cw1_subkeys.wasm b/scripts/wasmd/contracts/cw1_subkeys.wasm deleted file mode 100644 index b8330ea3..00000000 --- a/scripts/wasmd/contracts/cw1_subkeys.wasm +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:37f868eda7a723a769f6ff77cc27435455c3cff7b14481a114895d3d93cf8326 -size 308909 diff --git a/scripts/wasmd/contracts/cw3_fixed_multisig.wasm b/scripts/wasmd/contracts/cw3_fixed_multisig.wasm deleted file mode 100644 index 4b761782..00000000 --- a/scripts/wasmd/contracts/cw3_fixed_multisig.wasm +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:203ceb9ffa61fdcb34b859a4d1249bec517112ecbaf9a9092b3787dc8199dde6 -size 288088 diff --git a/scripts/wasmd/contracts/download.sh b/scripts/wasmd/contracts/download.sh index 80d7e8f8..a063c8d1 100755 --- a/scripts/wasmd/contracts/download.sh +++ b/scripts/wasmd/contracts/download.sh @@ -3,12 +3,8 @@ # This must get from 2-3 different repos, fix the versions here: COSMWASM_VERSION="v0.16.0" -PLUS_VERSION="v0.8.0-rc1" curl -sS -L -O "https://github.com/CosmWasm/cosmwasm/releases/download/${COSMWASM_VERSION}/hackatom.wasm" curl -sS -L -O "https://github.com/CosmWasm/cosmwasm/releases/download/${COSMWASM_VERSION}/ibc_reflect.wasm" -curl -sS -L -O "https://github.com/CosmWasm/cosmwasm-plus/releases/download/${PLUS_VERSION}/cw1_subkeys.wasm" -curl -sS -L -O "https://github.com/CosmWasm/cosmwasm-plus/releases/download/${PLUS_VERSION}/cw3_fixed_multisig.wasm" - sha256sum *.wasm >checksums.sha256 diff --git a/scripts/wasmd/deploy_cw1.js b/scripts/wasmd/deploy_cw1.js deleted file mode 100755 index 39656937..00000000 --- a/scripts/wasmd/deploy_cw1.js +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env -S yarn node - -/* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-stargate"); -const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing"); -const { GasPrice, calculateFee } = require("@cosmjs/stargate"); -const fs = require("fs"); - -const endpoint = "http://localhost:26659"; -const alice = { - mnemonic: "enlist hip relief stomach skate base shallow young switch frequent cry park", - address0: "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk", - // address1: "wasm1hhg2rlu9jscacku2wwckws7932qqqu8xm5ca8y", - // address2: "wasm1xv9tklw7d82sezh9haa573wufgy59vmwnxhnsl", - // address3: "wasm17yg9mssjenmc3jkqth6ulcwj9cxujrxxg9nmzk", - // address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j", -}; - -async function main() { - const gasPrice = GasPrice.fromString("0.025ucosm"); - const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" }); - const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet); - - const wasm = fs.readFileSync(__dirname + "/contracts/cw1_subkeys.wasm"); - const uploadFee = calculateFee(1_500_000, gasPrice); - const uploadReceipt = await client.upload( - alice.address0, - wasm, - uploadFee, - "Upload CW1 subkeys contract", - ); - console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`); - - const initMsg = { - admins: [alice.address0], - mutable: true, - }; - const label = "Subkey test"; - const instantiateFee = calculateFee(500_000, gasPrice); - const { contractAddress } = await client.instantiate( - alice.address0, - uploadReceipt.codeId, - initMsg, - label, - instantiateFee, - { - memo: `Create a CW1 instance for ${alice.address0}`, - admin: alice.address0, - }, - ); - const sendFee = calculateFee(80_000, gasPrice); - await client.sendTokens( - alice.address0, - contractAddress, - [ - { - amount: "1000", - denom: "ucosm", - }, - ], - sendFee, - ); - console.info(`Contract instantiated for ${alice.address0} subkey at ${contractAddress}`); -} - -main().then( - () => { - console.info("All done, let the coins flow."); - process.exit(0); - }, - (error) => { - console.error(error); - process.exit(1); - }, -); diff --git a/scripts/wasmd/deploy_cw3.js b/scripts/wasmd/deploy_cw3.js deleted file mode 100755 index 9d7271ea..00000000 --- a/scripts/wasmd/deploy_cw3.js +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env -S yarn node - -/* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-stargate"); -const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing"); -const { GasPrice, calculateFee } = require("@cosmjs/stargate"); -const fs = require("fs"); - -const endpoint = "http://localhost:26659"; -const alice = { - mnemonic: "enlist hip relief stomach skate base shallow young switch frequent cry park", - address0: "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk", - address1: "wasm1hhg2rlu9jscacku2wwckws7932qqqu8xm5ca8y", - address2: "wasm1xv9tklw7d82sezh9haa573wufgy59vmwnxhnsl", - address3: "wasm17yg9mssjenmc3jkqth6ulcwj9cxujrxxg9nmzk", - address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j", -}; - -const initData = [ - { - admin: alice.address0, - label: "Multisig (1/3)", - initMsg: { - voters: [ - { addr: alice.address0, weight: 1 }, - { addr: alice.address1, weight: 1 }, - { addr: alice.address2, weight: 1 }, - ], - required_weight: 1, - max_voting_period: { height: 12345 }, - }, - }, - { - admin: alice.address0, - label: "Multisig (2/3)", - initMsg: { - voters: [ - { addr: alice.address0, weight: 1 }, - { addr: alice.address1, weight: 1 }, - { addr: alice.address2, weight: 1 }, - ], - required_weight: 2, - max_voting_period: { height: 12345 }, - }, - }, - { - admin: alice.address0, - label: "Multisig (uneven weights)", - initMsg: { - voters: [ - { addr: alice.address0, weight: 1 }, - { addr: alice.address1, weight: 2 }, - { addr: alice.address2, weight: 3 }, - ], - required_weight: 3, - max_voting_period: { height: 12345 }, - }, - }, -]; - -async function main() { - const gasPrice = GasPrice.fromString("0.025ucosm"); - const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" }); - const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet); - - const wasm = fs.readFileSync(__dirname + "/contracts/cw3_fixed_multisig.wasm"); - const uploadFee = calculateFee(1_500_000, gasPrice); - const uploadReceipt = await client.upload( - alice.address0, - wasm, - uploadFee, - "Upload CW3 fixed multisig contract", - ); - console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`); - - const instantiateFee = calculateFee(500_000, gasPrice); - const sendFee = calculateFee(80_000, gasPrice); - for (const { admin, initMsg, label } of initData) { - const { contractAddress } = await client.instantiate( - alice.address0, - uploadReceipt.codeId, - initMsg, - label, - instantiateFee, - { - memo: `Create a CW3 instance for ${initMsg.symbol}`, - admin: admin, - }, - ); - await client.sendTokens( - alice.address0, - contractAddress, - [ - { - amount: "1000", - denom: "ucosm", - }, - ], - sendFee, - ); - console.info(`Contract instantiated for ${label} at ${contractAddress}`); - } -} - -main().then( - () => { - console.info("All done, let the coins flow."); - process.exit(0); - }, - (error) => { - console.error(error); - process.exit(1); - }, -); diff --git a/scripts/wasmd/init.sh b/scripts/wasmd/init.sh index 6d73b2a0..9202cac3 100755 --- a/scripts/wasmd/init.sh +++ b/scripts/wasmd/init.sh @@ -27,5 +27,3 @@ SCRIPT_DIR="$(realpath "$(dirname "$0")")" ) "$SCRIPT_DIR/deploy_hackatom.js" "$SCRIPT_DIR/deploy_ibc_reflect.js" -# "$SCRIPT_DIR/deploy_cw3.js" -# "$SCRIPT_DIR/deploy_cw1.js"