Run through the full script

This commit is contained in:
Ethan Frey
2020-02-11 12:01:01 +01:00
parent 1bea452fbc
commit ec9a1eab92
2 changed files with 33 additions and 8 deletions
+32 -7
View File
@@ -1,22 +1,37 @@
## Setup
Start chain:
```sh
./scripts/cosm/start.sh
```
```sh
cd packages/cli
./bin/cosmwasm-cli --init examples/helpers.ts
```
```js
const account = (await client.authAccounts(faucetAddress)).result.value;
account
client.listCodeInfo()
client.listContractAddresses()
```
## Deploy Contract
```sh
node ./scripts/cosm/deploy_erc20.js
```
## Make account
```sh
cd packages/cli
./bin/cosmwasm-cli --init examples/helpers.ts
```
Now, check it and init/execute contracts:
```js
const account = (await client.authAccounts(faucetAddress)).result.value;
account
// see it is now deployed
client.listCodeInfo()
client.listContractAddresses()
@@ -34,6 +49,16 @@ const foo = await instantiateContract(client, pen, 1, initMsg);
client.queryContractSmart(foo, { balance: { address: faucetAddress } })
const rcpt = await randomAddress();
rcpt
client.queryContractSmart(foo, { balance: { address: rcpt } })
const execMsg = { transfer: {recipient: rcpt, amount: "808"}}
const exec = await executeContract(client, pen, foo, execMsg);
exec
client.queryContractSmart(foo, { balance: { address: rcpt } })
// TODO: unused account
// TODO: execute and send tokens
```