Uniswap-inspired automated market-maker (AMM) protocol powered by Smart Contracts on the Orai blockchain.
Name | Description |
---|---|
oraiswap_factory |
Proxy contract to create oraiswap_pair instance |
oraiswap_oracle |
Global parameters updated by multisig wallet |
oraiswap_pair |
Logic for building liquidity pool and trade between pair |
oraiswap_router |
Facilitate multi-hop swap operations |
oraiswap_orderbook |
Orderbook implementation |
oraiswap_staking |
Stake LPs to get ORAIX reward |
oraiswap_token |
(ERC20 equivalent) token implementation, AIRI, ORAIX |
oraiswap_mixed_router |
Facilitate multi-hop swap operations between v2 & v3 |
-
oraiswap_factory
Mainnet:
orai167r4ut7avvgpp3rlzksz6vw5spmykluzagvmj3ht845fjschwugqjsqhst
-
oraiswap_oracle
-
oraiswap_pair
Mainnet (CodeID): 1502
-
oraiswap_route
Mainnet:
orai1j0r67r9k8t34pnhy00x3ftuxuwg0r6r4p8p6rrc8az0ednzr8y9s3sj2sf
-
oraiswap_orderbook
Mainnet:
orai1nt58gcu4e63v7k55phnr3gaym9tvk3q4apqzqccjuwppgjuyjy6sxk8yzp
-
oraiswap_staking
-
oraiswap_token
Mainnet (CodeID): 582
-
oraiswap_mixed_router
Mainnet:
orai1cy2pc5czxm5qlacp6j0hfq7qj9wh8zuhxgpdartcfrdljknq0arsuc4znj
You will need Rust 1.44.1+ with wasm32-unknown-unknown target installed.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
You can run unit tests on this on each contracts directory via :
cargo unit-test
cargo integration-test
# gen protobuf response.rs
cargo install protobuf-codegen
protoc --rust_out . response.proto
tee -a response.proto << END
impl ::std::convert::TryFrom<&[u8]> for MsgInstantiateContractResponse {
type Error = ::protobuf::Error;
fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
::protobuf::Message::parse_from_bytes(value)
}
}
END
# gen proto using prost
# macos
brew install protobuf
cargo install protoc-gen-prost
protoc --prost_out packages/oraiswap/src --proto_path packages/oraiswap/src -I proto packages/oraiswap/src/universal_swap_memo.proto && mv packages/oraiswap/src/_ packages/oraiswap/src/universal_swap_memo.rs