From 43b1830f092cb438a45909c5ef402bb32834fb17 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Tue, 4 Aug 2020 17:26:45 +0200 Subject: [PATCH] scripts: Remove staking from wasmd --- scripts/wasmd/contracts/checksums.sha256 | 1 - scripts/wasmd/contracts/staking.wasm | 3 -- scripts/wasmd/deploy_staking.js | 65 ------------------------ scripts/wasmd/init.sh | 1 - 4 files changed, 70 deletions(-) delete mode 100644 scripts/wasmd/contracts/staking.wasm delete mode 100755 scripts/wasmd/deploy_staking.js diff --git a/scripts/wasmd/contracts/checksums.sha256 b/scripts/wasmd/contracts/checksums.sha256 index 20fa2c37..1d16d387 100644 --- a/scripts/wasmd/contracts/checksums.sha256 +++ b/scripts/wasmd/contracts/checksums.sha256 @@ -1,3 +1,2 @@ 0f14abcc6fed08f2dd06896db974989db97dbcc6e8e30188b73fe5ab427c7785 cw-erc20.wasm ebc2b11e2afa50d5dcd4234840cd581e948a59d888bb8d651598bba3732cd8ee cw-nameservice.wasm -9430a98aa5bb765aa56f683290340e34e230822a4e356d566b54b9b5cf01ab30 staking.wasm diff --git a/scripts/wasmd/contracts/staking.wasm b/scripts/wasmd/contracts/staking.wasm deleted file mode 100644 index b7ed883e..00000000 --- a/scripts/wasmd/contracts/staking.wasm +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9430a98aa5bb765aa56f683290340e34e230822a4e356d566b54b9b5cf01ab30 -size 213411 diff --git a/scripts/wasmd/deploy_staking.js b/scripts/wasmd/deploy_staking.js deleted file mode 100755 index dad46c12..00000000 --- a/scripts/wasmd/deploy_staking.js +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env node - -/* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); -const { coins, Secp256k1Wallet } = require("@cosmjs/launchpad"); -const fs = require("fs"); - -const httpUrl = "http://localhost:1317"; -const alice = { - mnemonic: "enlist hip relief stomach skate base shallow young switch frequent cry park", - address0: "cosmos14qemq0vw6y3gc3u3e0aty2e764u4gs5le3hada", -}; - -const codeMeta = { - source: "", // not intended to be published - builder: "cosmwasm/rust-optimizer:0.8.0", -}; - -// To get the proper validator address, run the demo chain (./scripts/wasmd/start.sh), then run: -// curl http://localhost:1317/staking/validators | jq '.result[0].operator_address' -const bounty = { - label: "Bounty", - initMsg: { - name: "Bounty", - symbol: "BOUNTY", - decimals: 3, - validator: "cosmosvaloper1e9zn2ueue2m0edjhmsgsf03yfcmeg7m7xh5xu5", - exit_tax: "0.005", // 0.5 % - min_withdrawal: "7", - }, -}; - -const fees = { - upload: { - amount: coins(25000, "ucosm"), - gas: "1500000", // 1.5 million - }, -}; - -async function main() { - const wallet = await Secp256k1Wallet.fromMnemonic(alice.mnemonic); - const client = new SigningCosmWasmClient(httpUrl, alice.address0, wallet, fees); - - const wasm = fs.readFileSync(__dirname + "/contracts/staking.wasm"); - const uploadReceipt = await client.upload(wasm, codeMeta, "Upload Staking code"); - console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`); - - for (const { label, initMsg } of [bounty]) { - const { contractAddress } = await client.instantiate(uploadReceipt.codeId, initMsg, label, { - memo: `Create an staking instance "${label}"`, - }); - console.info(`Contract "${label}" instantiated at ${contractAddress}`); - } -} - -main().then( - () => { - console.info("Done deploying staking instances."); - process.exit(0); - }, - (error) => { - console.error(error); - process.exit(1); - }, -); diff --git a/scripts/wasmd/init.sh b/scripts/wasmd/init.sh index 48a2e687..26356a50 100755 --- a/scripts/wasmd/init.sh +++ b/scripts/wasmd/init.sh @@ -26,4 +26,3 @@ SCRIPT_DIR="$(realpath "$(dirname "$0")")" ) "$SCRIPT_DIR/deploy_erc20.js" "$SCRIPT_DIR/deploy_nameservice.js" -"$SCRIPT_DIR/deploy_staking.js"