- 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.
- Relative stability: Anchored or pegged -> 1.00$
- Chainlink Price feed.
- Set a function to exchange ETH & BTC -> $$$
- Stability Mechanism (Minting): Algorithmic(Decentralized)
- People can only mint stablecoin with enough collateral.
- Collateral: Exogenous(Crypto)
- wETH
- wBTC
git clone https://github.com/056xyz/StableCoin.git
cd StableCoin
forge build
make anvil
This will default to your local node. You need to have it running in another terminal in order for it to deploy.
make deploy
- Setup environment variables
- Get testnet ETH
- Deploy
make deploy ARGS="--network sepolia"
For example, on Sepolia:
- Get some WETH
cast send 0xdd13E55209Fd76AfE204dBda4007C227904f0a81 "deposit()" --value 0.1ether --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY
- Approve the WETH
cast send 0xdd13E55209Fd76AfE204dBda4007C227904f0a81 "approve(address,uint256)" 0x091EA0838eBD5b7ddA2F2A641B068d6D59639b98 1000000000000000000 --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY
- Deposit and Mint DSC
cast send 0x091EA0838eBD5b7ddA2F2A641B068d6D59639b98 "depositCollateralAndMintDsc(address,uint256,uint256)" 0xdd13E55209Fd76AfE204dBda4007C227904f0a81 100000000000000000 10000000000000000 --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY