-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for deploying to testnet
- Loading branch information
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
MSG=$(cat <<EOF | ||
{ | ||
"fair_burn": "stars177jd3r8aul2dgt9pj77x8zem3au46ee2cj4srxwqdw4lkpd7tsqquz2r2d", | ||
"royalty_registry": "stars1crgx0f70fzksa57hq87wtl8f04h0qyk5la0hk0fu8dyhl67ju80qaxzr5z", | ||
"marketplace": "stars18cszlvm6pze0x9sz32qnjq4vtd45xehqs8dq7cwy8yhq35wfnn3qgzs5gu", | ||
"pair_creation_fee": { | ||
"denom": "ustars", | ||
"amount": "1000000" | ||
}, | ||
"fair_burn_fee_percent": "0.01", | ||
"max_royalty_fee_percent": "0.05", | ||
"max_swap_fee_percent": "0.1", | ||
"code_ids": { | ||
"infinity_factory": 2894, | ||
"infinity_global": 2895, | ||
"infinity_index": 2896, | ||
"infinity_pair": 2897, | ||
"infinity_router": 2898 | ||
}, | ||
"min_prices":[ | ||
{ | ||
"denom": "ustars", | ||
"amount": "1000000" | ||
} | ||
] | ||
} | ||
EOF | ||
) | ||
|
||
CODE_ID=2893 | ||
|
||
LABEL="Infinity Builder" | ||
|
||
ADMIN="stars19mmkdpvem2xvrddt8nukf5kfpjwfslrsu7ugt5" | ||
FROM="hot-wallet" | ||
|
||
CHAIN_ID="elgafar-1" | ||
NODE="https://rpc.elgafar-1.stargaze-apis.com:443" | ||
|
||
starsd tx wasm instantiate $CODE_ID "$MSG" \ | ||
--label "$LABEL" \ | ||
--admin "$ADMIN" \ | ||
--from "$FROM" \ | ||
--keyring-backend test \ | ||
--chain-id "$CHAIN_ID" \ | ||
--node "$NODE" \ | ||
--gas-prices 0.1ustars \ | ||
--gas-adjustment 1.7 \ | ||
--gas auto \ | ||
-b block \ | ||
-o json | jq . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to download infinity wasm files from github | ||
# and store them on Stargaze testnet. | ||
|
||
VERSION=v0.1.0 | ||
|
||
CONTRACTS=( | ||
"infinity_builder" | ||
"infinity_factory" | ||
"infinity_global" | ||
"infinity_index" | ||
"infinity_pair" | ||
"infinity_router" | ||
) | ||
|
||
FROM="hot-wallet" | ||
CHAIN_ID="elgafar-1" | ||
NODE="https://rpc.elgafar-1.stargaze-apis.com:443" | ||
|
||
for contract in "${CONTRACTS[@]}"; do | ||
contract_tmp=$(echo $contract | tr '_' '-') | ||
|
||
# If file exists then skip | ||
if [ -f "./artifacts/${contract}.wasm" ]; then | ||
echo "Skipping ${contract}.wasm" | ||
continue | ||
fi | ||
|
||
url=https://github.com/tasiov/infinity-swap/releases/download/${VERSION}/${contract}.wasm | ||
echo "Downloading $url" | ||
response_code=$(curl -L --output "./artifacts/${contract}.wasm" --write-out "%{http_code}" "${url}") | ||
|
||
# Check if the download was successful | ||
if [ "$response_code" -ne 200 ]; then | ||
echo "Error downloading ${contract}.wasm. HTTP status code: ${response_code}" | ||
rm "./artifacts/${contract}.wasm" | ||
exit 1 | ||
fi | ||
done | ||
|
||
echo "Uploading wasm files to Stargaze testnet" | ||
|
||
for contract in "${CONTRACTS[@]}"; do | ||
starsd tx wasm store artifacts/${contract}.wasm \ | ||
--from $FROM \ | ||
--chain-id "$CHAIN_ID" \ | ||
--node "$NODE" \ | ||
--keyring-backend test \ | ||
--gas-prices 0.1ustars \ | ||
--gas-adjustment 1.7 \ | ||
--gas auto \ | ||
-b block \ | ||
-y | ||
done |