Skip to content

saddle-finance/saddle-contract

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

…rder contracts (#810)

* WIP deployscripts for sUSDC ChildGauge, and rewarder contracts

* deploy scripts for fUSDCGauge V3 and 3rd party rewards

* deployed all contract to mainnet and arbitrum
5d538c4

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

saddle-contract

codecov CI

The smart contracts behind saddle.finance 🤠

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

Installation

$ npm ci --legacy-peer-deps

Usage

Build

$ npm run build

Test

$ npm test

Coverage

$ npm run coverage

Deploying contracts to localhost Hardhat EVM

$ npx hardhat node

You can connect to this RPC server via http://localhost:8545 with chain ID of 31337

Deploying contracts to local fork of a network

In order to successfully fork a network, the networks have to be defined in hardhat.config.ts with valid RPC URLs. In case of mainnet, ALCHEMY_API must be set to a valid URL in the .env file.

ALCHEMY_API="https://eth-mainnet.alchemyapi.io/v2/XXXXXXXXXXXX"
$ npm run fork --network=mainnet

You can connect to this RPC server via http://localhost:8545 with chain ID of the network.

Additionally, you can choose a block number to fork from by setting FORK_BLOCK_NUMBER env variable.

Deploying contracts to Ropsten

In order to successfully deploy to Ropsten, ALCHEMY_API_ROPSTEN must be set to a valid URL in the .env file. MNEMONIC_TEST_ACCOUNT must be set and the accounts must have some rEth for successful deployments.

ALCHEMY_API="https://eth-ropsten.alchemyapi.io/v2/XXXXXXXXXXXX"
MNEMONIC_TEST_ACCOUNT="seed phrase"

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.