Skip to content

Commit

Permalink
scripts to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
lacsomot committed Mar 11, 2024
1 parent 675f162 commit 0885b18
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 0 deletions.
Binary file added scripts/bytecode/cw20_base.wasm
Binary file not shown.
Binary file added scripts/bytecode/cw20_ics20.wasm
Binary file not shown.
13 changes: 13 additions & 0 deletions scripts/deploy_ics20.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

rollappd tx wasm store ./scripts/bytecode/cw20_ics20.wasm --from rol-user --gas 5000000 --yes

sleep 5

rollappd tx wasm instantiate 2 '{"default_timeout":1000,"gov_contract":"rol1h9htcc6hntfh02x5jrtkya6f3vzcycu27zm3um","allowlist":[{"contract":"rol14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9syy8zyg"}]}' --label ics20 --no-admin --from rol-user --gas 50000000 --yes
contract=$(rollappd q wasm list-contract-by-code 2 --output json | jq -r '.contracts[0]' )

echo "ICS20 contract deployed at: $contract"

# Query rol-user balances
# rollappd q wasm contract-state smart $contract '{"balance":{"address":"rol1h9htcc6hntfh02x5jrtkya6f3vzcycu27zm3um"}}'
14 changes: 14 additions & 0 deletions scripts/deploy_token.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

rollappd tx wasm store ./scripts/bytecode/cw20_base.wasm --from rol-user --gas 5000000 --yes

sleep 5

rollappd tx wasm instantiate 1 '{"name":"test","symbol":"test","decimals":6,"initial_balances":[{"address":"rol1h9htcc6hntfh02x5jrtkya6f3vzcycu27zm3um","amount":"100000000"}]}' --label test --no-admin --from rol-user --yes

contract=$(rollappd q wasm list-contract-by-code 1 --output json | jq -r '.contracts[0]' )

echo "Token contract deployed at: $contract"

# Query rol-user balances
# rollappd q wasm contract-state smart $contract '{"balance":{"address":"rol1h9htcc6hntfh02x5jrtkya6f3vzcycu27zm3um"}}'
20 changes: 20 additions & 0 deletions scripts/download_releases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck > /dev/null && shellcheck "$0"

if [ $# -ne 1 ]; then
echo "Usage: ./download_releases.sh RELEASE_TAG"
exit 1
fi

# eg. v0.13.1
tag="$1"

for contract in cw20_base cw20_ics20; do
url="https://github.com/CosmWasm/cosmwasm-plus/releases/download/${tag}/${contract}.wasm"
echo "Downloading $url ..."
wget -O "scripts/bytecode/${contract}.wasm" "$url"
done

rm -f scripts/version.txt
echo "$tag" >scripts/version.txt
1 change: 1 addition & 0 deletions scripts/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.0.0

0 comments on commit 0885b18

Please sign in to comment.