Skip to main content

Contracts

The protocol works with several contracts, each designed to handle a specific set of features. The core contracts are the factory, router and the paircontract. Although we also have to consider the cw-20 contract.

Both the factory and router contract are each a single instance, meaning there will only be one valid address for each, but the pair contract is different. This will have many instances, all of them created by the factory contract and one of them will be created for each token pair pool reserves.

The interaction flow is shown below:


The contracts can be found in our GitHub repository.

Deployments

All HaloTrade contracts are deployed and verified in Aura Mainnet as well as Aura Euphoria Staging Network and Aura Serenity Testnet.

  • Factory:
    • Code ID: 18
    • Address: aura18qwll06qjgkfl5s5ym4rtpz8jy2tl849ghgx402tm4w9v55wu5asn0mqhv
  • Router:
    • Code ID: 16
    • Address: aura10lfagekpspw59za99x98tuxfsegx3v5sxycntqnfd4vj7e6xzq0skguqty

Requirements

To build the contracts and run the tests shown on this section, you must have the following installed:

Building

All contracts are writen in CosmWasm and can be compiled with Rust 1.66.0+ with wasm32-unknown-unknown target installed properly. You can learn more about this subject in the official Aura Network Documentation.

You can compile the contracts using cargo as shown below.

cargo build

The optimizer version utilized to build it is optimizer_version = '0.12.11', and the built .wasm file is stored in target/wasm32-unknown-unknown/release/<CONTRACT_NAME>.wasm. We recommend using --no-wasm-opt for development purposes.

Tests

A full suite of tests for the contracts are defined in the ./tests directory in the repository, and it can be run with the following command:

RUST_BACKTRACE=1 cargo unit-test

This will build the contracts and run the defined unit tests to ensure everything is working as expected.

Overview

Reference for the core HaloTrade contracts are disclosed in detail in the content of this section, you can take a look here: