bootfinance / boot-customswap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

boot-customswap

This is a heavily modified fork of saddle smart contracts that implements a dual curve and temporal parameter ramp features šŸ¤ 

The contracts are compiled with Hardhat, and tested using Waffle and TypeScript.

Installation

$ npm i

Usage

Build

$ npm run build

Test

$ npm test

Coverage

$ npm run coverage

Deploying contracts to localhost Hardhat EVM

$ npx hardhat node
$ npx hardhat run --network localhost deployment/hardhat/swap.ts

deployment/hardhat/swap-forkMainnet.ts is also available for forking the mainnet contracts into the hardhat network.

You can connect to this RPC server via localhost:8545.

Deploying contracts to Rinkeby Testnet

  • Environment variables
    • Create a .env file with its values:
DEPLOYER_PRIVATE_KEY_RINKEBY=<private_key_without_0x>
INFURA_API_KEY=<SECRET_KEY>
REPORT_GAS=<true_or_false>

BTC tokens pool

$ npx hardhat run deployment/rinkeby/swap-btc.ts --network rinkeby

FRAX-FXS pool

$ npx hardhat run deployment/rinkeby/swap-frax.ts --network rinkeby

Generating GitBook docs

$ npx solidity-docgen --templates=templates

The output in the docs folder should be copied to the appropriate folder in the saddle-docs repo.

Running Slither

Slither is a Solidity static analysis framework. To run it locally:

$ pip3 install slither-analyzer
$ slither .

Slither is configured to run as a GitHub Action and error on any high findings.

Brownie

It is recommended that you create a virtualenv with direnv or other suitable shell helpers when developing or running the brownie tests and other Python based tools. Make sure your Python 3.7+ virtualenv is configured and activated before running these commands.

Also, since Brownie uses Ganache, make sure you have npm 14+ installed.

$ pip install -r requirements.txt
$ brownie test

About

License:Apache License 2.0


Languages

Language:TypeScript 56.9%Language:Solidity 32.2%Language:Python 10.0%Language:Vyper 0.6%Language:Handlebars 0.2%