Helpers smart contracts
-
Install Osmosisd
-
Get the wasm binary executable on your local machine.
git clone https://github.com/mars-protocol/liquidaiton-helpers.git git checkout <commit-id> cargo make rust-optimizer
Note: Intel/Amd 64-bit processor is required. While there is experimental ARM support for CosmWasm/rust-optimizer, it's discouraged to use in production and the wasm bytecode will not match up to an Intel compiled wasm file.
-
Download the wasm from the chain.
osmosisd query wasm code $CODEID -- $NODE download.wasm
-
Verify that the diff is empty between them. If any value is returned, then the wasm files differ.
diff artifacts/$CONTRACTNAME.wasm download.wasm
-
Alternatively, compare the wasm files' checksums:
sha256sum artifacts/$CONTRACTNAME.wasm download.wasm
-
Install rustup. Once installed, make sure you have the wasm32 target:
rustup default stable rustup update stable rustup target add wasm32-unknown-unknown
-
Install cargo-make
cargo install --force cargo-make
-
Install Docker
-
Install Node.js v16
-
Install Yarn
-
Create the build folder:
yarn build
-
Compile all contracts:
cargo make rust-optimizer
-
Formatting:
yarn format yarn lint
This compiles and optimizes all contracts, storing them in /artifacts
directory along with checksum.txt
which contains sha256 hashes of each of the .wasm
files (The script just uses CosmWasm's rust-optimizer).
Note: Intel/Amd 64-bit processor is required. While there is experimental ARM support for CosmWasm/rust-optimizer, it's discouraged to use in production.
cargo make --makefile Makefile.toml generate-all-schemas
Creates JSON schema files for relevant contract calls, queries and query responses (See: cosmwams-schema).
Everything related to deployment must be ran from the scripts
directory:
For the Osmosis Outpost:
cd scripts
# for testnet deployment:
yarn deploy:osmosis-testnet
# for mainnet deployment:
yarn deploy:osmosis-mainnet
TBD
Contract | Address |
---|---|
liquidation-filterer | osmo1lnjyeyr5vtnsj4sv9guv7z322kmeytt3curm9u840yg2y2hk5w6qsdjjzu |
Contents of this repository are open source under GNU General Public License v3 or later.