Code Monkey home page Code Monkey logo

saddle-contract's Introduction

saddle-contract

codecov CI

The smart contracts behind saddle.finance ๐Ÿค 

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

$ npm run start

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

Deploying contracts to local fork of Mainnet

In order to successfully fork the 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

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.