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.
$ npm i
$ npm run build
$ npm test
$ npm run coverage
$ 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
.
- Environment variables
- Create a
.env
file with its values:
- Create a
DEPLOYER_PRIVATE_KEY_RINKEBY=<private_key_without_0x>
INFURA_API_KEY=<SECRET_KEY>
REPORT_GAS=<true_or_false>
$ npx hardhat run deployment/rinkeby/swap-btc.ts --network rinkeby
$ npx hardhat run deployment/rinkeby/swap-frax.ts --network rinkeby
$ npx solidity-docgen --templates=templates
The output in the docs
folder should be copied to the appropriate folder in the saddle-docs repo.
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.
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