Skip to content

Commit

Permalink
Add scripts for creating mainnet proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
tasiov committed Jul 27, 2023
1 parent 14c3c45 commit 961d926
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/reserve-auction/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stargaze-reserve-auction"
version = "1.0.0"
version = "1.0.1"
authors = [
"Shane Vitarana <[email protected]>",
"Tasio Victoria <[email protected]>",
Expand Down
3 changes: 3 additions & 0 deletions scripts/markdown/migrateContractReserveAuctionV1.0.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Migrate Contract

By voting YES on this proposal, you agree to migrate the Stargaze Reserve Auction contract from V1.0.0 to V1.0.1. The migrate code ID of the contract uploaded in proposal #185.
42 changes: 42 additions & 0 deletions scripts/markdown/storeWasmCodeReserveAuctionV1.0.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Store WASM Code

This uploads the code for Stargaze Live Auction v1.0.1

The source code is available at https://github.com/public-awesome/marketplace/releases/tag/stargaze_reserve_auction-v1.0.1

This patch follows the release of Reserve Auctions on mainnet to fix a few items outlined below:

- fix usage of seller_funds_recipient address
- add more attributes to certain contract events

### Compile Instructions

```sh
docker run --rm -v "$(pwd)":/code --platform linux/amd64 \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/workspace-optimizer:0.12.13
```

This results in the following SHA256 checksum:

```
4e77dfe1830d5a33058502d19ef990773f45acfee7862ebb5355626c75bd0eb1 stargaze_reserve_auction.wasm
```

### Verify On-chain Contract

```sh
starsd q gov proposal $id --output json \
| jq -r '.content.wasm_byte_code' \
| base64 -d \
| gzip -dc \
| sha256sum

```

### Verify Local Contract

```
sha256sum artifacts/stargaze_reserve_auction.wasm
```
39 changes: 23 additions & 16 deletions scripts/reserve-auction/migrate.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
RESERVE_AUCTION_ADDRESS=stars1pl77jpe2rrmtppv5tvs7d0g6xjq6smqxd879snksf2jwmuvxl6qs0jtvyt
# MSG=$(cat <<EOF
# {
# "fair_burn": "stars1mp4dg9mst3hxn5xvcd9zllyx6gguu5jsp5tyt9nsfrtghhwj2akqudhls8"
# }

# EOF
# )

# starsd tx wasm migrate $RESERVE_AUCTION_ADDRESS 2355 "$MSG" \
# --from testnet-1 --gas-prices 0.1ustars --gas-adjustment 1.7 --gas auto \
# -b block -o json | jq .

RESERVE_AUCTION="stars1dnadsd7tx0dmnpp26ms7d66zsp7tduygwjgfjzueh0lg9t5lq5vq9kn47c"
NEW_CODE_ID=123
MSG=$(cat <<EOF
{
"config": {}
}
}
EOF
)

starsd query wasm contract-state smart $RESERVE_AUCTION_ADDRESS "$MSG" -o json | jq .
TITLE="Stargaze Live Auction v1.0.1"
MARKDOWN="scripts/markdown/migrateContractReserveAuctionV1.0.1.md"
DESCRIPTION=$(cat "$MARKDOWN" | base64 | tr -d '\n')

FROM="hot-wallet"
DEPOSIT="10000000000ustars"

CHAIN_ID="stargaze-1"
NODE="https://rpc.stargaze-apis.com:443"

starsd tx gov submit-proposal migrate-contract "$RESERVE_AUCTION" $NEW_CODE_ID "$MSG" \
--title "$TITLE" \
--description "$(echo "$DESCRIPTION" | base64 --decode)" \
--from "$FROM" \
--deposit "$DEPOSIT" \
--chain-id "$CHAIN_ID" \
--node "$NODE" \
--gas-prices 1ustars \
--gas auto \
--gas-adjustment 1.5
8 changes: 4 additions & 4 deletions scripts/reserve-auction/wasm_store.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ set -eux

CONTRACT=artifacts/stargaze_reserve_auction.wasm

TITLE="Stargaze Live Auction v1.0.0"
MARKDOWN="scripts/markdown/stargaze_reserve_auction-v1.0.0.md"
TITLE="Stargaze Live Auction v1.0.1"
MARKDOWN="scripts/markdown/storeWasmCodeReserveAuctionv1.0.1.md"
DESCRIPTION=$(cat "$MARKDOWN" | base64 | tr -d '\n')
SOURCE="https://github.com/public-awesome/core/releases/tag/stargaze_reserve_auction-v1.0.0"
SOURCE="https://github.com/public-awesome/marketplace/releases/tag/stargaze_reserve_auction-v1.0.1"
BUILDER="cosmwasm/workspace-optimizer:0.12.13"
HASH="f7cdf509a1889e21399c33eee9e68ac328abd4a456142db080d760d15135fe56"
HASH="4e77dfe1830d5a33058502d19ef990773f45acfee7862ebb5355626c75bd0eb1"

FROM="hot-wallet"
DEPOSIT="10000000000ustars"
Expand Down

0 comments on commit 961d926

Please sign in to comment.