Skip to content

Stable coin pegged to USD and collateralized by BTC and ETH.

License

Notifications You must be signed in to change notification settings

trashpirate/earn-stable-coin

Repository files navigation

EARN STABLE COIN

Version Forge Solc GitHub License

Website: nadinaoates.com LinkedIn: nadinaoates Twitter: N0_crypto

About

This repo contains a collateralized stable coin implementation. The system is desinged to be as minimal as possible, and have the tokens maintain the USD price This stablecoin has the properties:

  1. Relative Stability: Anchored or Pegged - 1 USD
    1. Chainlink Price feed
    2. Set a function to exchange Collateral -> USD
  2. Stability Mechanism (Minting): Algorithmic (Decentralized)
    1. People can only mint the stablecoin with enough collateral (coded)
  3. Collateral: Exogenous/Endogenous (Crypto)
    1. wETH
    2. wBTC

The collaterall tokens used are wrapped BTC and wrapped ETH.

TODO:

  1. Fee and interest payment with EARN token.
  2. Automatic liquidation on price drop

Installation

Install dependencies

$ make install

Usage

Before running any commands, create a .env file and add the following environment variables:

# network configs
RPC_LOCALHOST="http://127.0.0.1:8545"

# ethereum nework
RPC_ETH_SEPOLIA=<rpc url>
RPC_ETH_MAIN=<rpc url>
ETHERSCAN_KEY=<api key>

Run tests

$ forge test

Deploy contract on testnet

$ make deploy-testnet

Deploy contract on mainnet

$ make deploy-mainnet

Deployments

Testnet

Author

👤 Nadina Oates

📝 License

Copyright © 2024 Nadina Oates.

This project is MIT licensed.

About

Stable coin pegged to USD and collateralized by BTC and ETH.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published