Skip to content

056xyz/StableCoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decentralized StableCoin (DSC)

  • This project is meant to be a stablecoin where users can deposit WETH and WBTC in exchange for a token that will be pegged to the USD.

Mechanism:

  1. Relative stability: Anchored or pegged -> 1.00$
    1. Chainlink Price feed.
    2. Set a function to exchange ETH & BTC -> $$$
  2. Stability Mechanism (Minting): Algorithmic(Decentralized)
    1. People can only mint stablecoin with enough collateral.
  3. Collateral: Exogenous(Crypto)
    1. wETH
    2. wBTC

Quickstart

git clone https://github.com/056xyz/StableCoin.git
cd StableCoin
forge build

Usage

Start a local node

make anvil

Deploy

This will default to your local node. You need to have it running in another terminal in order for it to deploy.

make deploy

Deploy - Other Network

  1. Setup environment variables
  2. Get testnet ETH
  3. Deploy
make deploy ARGS="--network sepolia"

Scripts

For example, on Sepolia:

  1. Get some WETH
cast send 0xdd13E55209Fd76AfE204dBda4007C227904f0a81 "deposit()" --value 0.1ether --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY
  1. Approve the WETH
cast send 0xdd13E55209Fd76AfE204dBda4007C227904f0a81 "approve(address,uint256)" 0x091EA0838eBD5b7ddA2F2A641B068d6D59639b98 1000000000000000000 --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY
  1. Deposit and Mint DSC
cast send 0x091EA0838eBD5b7ddA2F2A641B068d6D59639b98 "depositCollateralAndMintDsc(address,uint256,uint256)" 0xdd13E55209Fd76AfE204dBda4007C227904f0a81 100000000000000000 10000000000000000 --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published