Giter Club home page Giter Club 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.

saddle-contract's People

Contributors

alphastorm avatar dependabot[bot] avatar guoyiteng avatar hammeiam avatar mhluongo avatar penandlim avatar sandrasong avatar stefanionescu avatar stobiewan avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

stobiewan

saddle-contract's Issues

Adapt a Saddle Pool to Work with RAI

Prize Bounty

1700 RAI

Challenge Description

Adapt the Saddle pool contracts so that they can work with the RAI stablecoin.

At the moment, Saddle works with like assets such as DAI, USDC, USDT etc where the contracts assume the same peg. Reflexer would like to integrate RAI in Saddle but there's an issue: RAI is not pegged to $1. Instead, RAI has a "moving peg" called the redemption price.

In order to fetch RAI's redemption price, one has to first update it and then retrieve it. This is why the redemption price getter is not a view function. To make it easier to fetch the redemption price, you can use this contract that stores a slightly older version of the price or you can update and fetch the latest price from here.

Submission Requirements

You must write thorough tests for all contracts you work on. You must also describe in detail all the modifications you brought to vanilla Saddle contracts as well as describe the test cases you covered.

Lastly, your final submission must be in a PR where you acknowledge that the code will be under Saddle's license.

Submission Deadline

26th of October 2021

Winner Announcement Date

The submission will be reviewed between 27th-28th of October. The announcements and payouts will occur by 29th of October.

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.