cosmjs-util/scripts/guide.md
2020-02-11 12:01:01 +01:00

920 B

Setup

node ./scripts/cosm/deploy_erc20.js

Make account

cd packages/cli
./bin/cosmwasm-cli --init examples/helpers.ts

Now, check it and init/execute contracts:

const account = (await client.authAccounts(faucetAddress)).result.value;
account

client.listCodeInfo()
client.listContractAddresses()

// query this contract
const addr = (await client.listContractAddresses())[0]
const info = await client.getContractInfo(addr)
info.init_msg

// try some actions
client.queryContractSmart(addr, { balance: { address: faucetAddress } })

// make a new contract
const initMsg = { name: "Foo Coin", symbol: "FOO", decimals: 2, initial_balances: [{address: faucetAddress, amount: "123456789"}]}
const foo = await instantiateContract(client, pen, 1, initMsg);

client.queryContractSmart(foo, { balance: { address: faucetAddress } })

// TODO: unused account
// TODO: execute and send tokens