Cyferio storage contract which enables saving arbitrary data into Babylon with bitcoin timestamped, and checking whether data is Bitcoin finalized.
Not for production. Best used as example.
Also part of e2e test-suite.
Explorer: https://www.babylonexplorer.com/
- Optimize contract
cargo run-script optimize
- Store contract
babylond tx wasm store ./artifacts/storage_contract-aarch64.wasm --from=user --gas=auto --gas-prices=1ubbn --gas-adjustment=1.3 --chain-id="euphrates-0.5.0" -b=sync --yes --log_format=json --node=https://rpc-euphrates.devnet.babylonlabs.io
- Get code id
curl -s -X GET "https://lcd-euphrates.devnet.babylonlabs.io/cosmwasm/wasm/v1/code" -H "accept: application/json" | jq -r '.'
codeId=$(curl -s -X GET "https://lcd-euphrates.devnet.babylonlabs.io/cosmwasm/wasm/v1/code" -H "accept: application/json" | jq -r '.code_infos[-1].code_id'); echo $codeId
- Instantiate contract
babylond tx wasm instantiate $codeId '{}' --from=user --no-admin --label="cyferio_storage" --gas-prices=1ubbn --gas-adjustment=1.3 --chain-id="euphrates-0.5.0" -b=sync --yes --log_format=json --node=https://rpc-euphrates.devnet.babylonlabs.io
- Get contract address
curl -s -X GET "https://lcd-euphrates.devnet.babylonlabs.io/cosmwasm/wasm/v1/code/$codeId/contracts" -H "accept: application/json" | jq -r '.'
address="$(curl -s -X GET "https://lcd-euphrates.devnet.babylonlabs.io/cosmwasm/wasm/v1/code/$codeId/contracts" -H "accept: application/json" | jq -r '.contracts[-1]')"; echo $address
- Execute contract
data='hello world'
dataHex=$(echo -n $data | xxd -ps -c0)
executeMsg="{ \"save_data\": { \"save_data\": { \"data\": \"$dataHex\", \"da_height\": 0 } } }"; echo $executeMsg
babylond tx wasm execute $address "$executeMsg" --from=user --gas-prices=1ubbn --gas-adjustment=1.3 --chain-id="euphrates-0.5.0" -b=sync --yes --log_format=json --node=https://rpc-euphrates.devnet.babylonlabs.io
- Query contract
babylond query wasm contract-state smart $address '{ "query_data": { "query_data": { "da_height": 0 } } }' --node=https://rpc-euphrates.devnet.babylonlabs.io -o json | jq -r '.'