White-Whale-Defi-Platform / white-whale-core

Core contracts for White Whale, The Interchain Liquidity Protocol for the Cosmos.
https://whitewhale.money
MIT License
36 stars 23 forks source link
arbitrage arbitrage-bot blockchain cosmwasm flashloan ibc smart-contracts

White Whale Migaloo

codecov CII Best Practices Discord badge Twitter handle first-timers-only PRs Welcome

Getting started

To get started with migaloo-core, please go through the contributing guide to see the different ways to contribute to the project.

Resources

  1. Website
  2. LitePaper
  3. Docs
  4. Discord
  5. Twitter
  6. Telegram

Deployed contracts

White Whale Migaloo is a protocol that exists across multiple chains. You can find contract addresses for different chain deployments in the documentation.

Building and Deploying Migaloo

To build and deploy Migaloo's smart contracts, there are a series of deployment scripts under scripts/. You need at least Rust v1.65.0 to compile the contracts.

Build scripts

Deployment scripts

The deployment scripts are found under scripts/deployment/. The following is the structure found on under this folder:

.
├── deploy_env
│   ├── base_env.sh
│   ├── chain_env.sh
│   ├── mainnets
│   │   ├── chihuahua.env
│   │   ├── juno.env
│   │   └── terra.env
│   ├── mnemonics
│   │   ├── deployer_mnemonic_testnet.txt
│   │   └── deployer_mnemonic.txt
│   └── testnets
│       ├── archway.env
│       ├── injective.env
│       ├── juno.env
│       ├── local.env
│       └── terra.env
├── deploy_liquidity_hub.sh
├── deploy_pool.sh
├── deploy_vault.sh
├── input
│   ├── pool.json
│   └── vault.json
├── output
│   ├── uni-5_liquidity_hub_contracts.json
│   ├── uni-5_pools.json
│   └── uni-5_vaults.json
└── wallet_importer.sh

There are three main scripts: deploy_liquidity_hub.sh, deploy_pool.sh and deploy_vault.sh. The rest of the scripts in there are used as auxiliary scripts by the main three listed before.

The deploy_env/ folder contains env files defining the parameters for the blockchain where the deployment is going to occur, whether it is a mainnet or testnet deployment.

The input/ folder is used for adding json files containing the config parameters when deploying pools or vaults. The output/ folder is where the scripts will write the data regarding the deployment, in json format. The name of the file follows the following nomenclature: "chain_id"_liquidity_hub_contracts, "chain_id"_pools, "chain_id"_vaults.

Notice that to deploy a pool or vault you need to have deployed the pool or vault factory respectively.

Here are some examples:

scripts/deployment/deploy_liquidity_hub.sh -c juno -d all
scripts/deployment/deploy_liquidity_hub.sh -c juno -d vault-network
scripts/deployment/deploy_pool-sh -c juno -p scripts/deployment/input/pool.json
scripts/deployment/deploy_vault-sh -c juno -v scripts/deployment/input/vault.json

Testing Migaloo

To run the tests, run cargo test. You can also run cargo tarpaulin -v to get test code coverage.

Disclaimer

Use the contracts and the White Whale app at your own risk!

Audit

Migaloo core contracts have been audited by SCV-Security. The report can be found here.

Contributing

Contributing Guide

Code of Conduct

Security Policies and Procedures

License