Skip to content

A stable coin where users can deposit wrapped eth and wrapped btc in order to receive a token that will be pegged to the USD.

License

Notifications You must be signed in to change notification settings

andrei2308/DeFi-Stablecoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeFi Stablecoin - Bitoiu

This project implements a decentralized stablecoin system, allowing users to deposit wrapped ETH (WETH) and wrapped BTC (WBTC) as collateral to mint a USD-pegged token.

Table of Contents

About

This project enables users to deposit WETH and WBTC as collateral to mint a stablecoin pegged to the USD. The system includes functionalities for collateral management, stablecoin minting, and liquidation mechanisms to maintain stability.

Getting Started

Requirements

  • Git: Ensure Git is installed by running git --version.
  • Foundry: Verify installation with forge --version.
  • Make: For running predefined scripts in the Makefile.

Quickstart

git clone https://github.com/andrei2308/DeFi-Stablecoin.git
cd DeFi-Stablecoin
make build

Usage

Starting a Local Node

To start a local Ethereum node:

make anvil

Deployment

With the local node running, deploy the contracts:

make deploy

To deploy to a specific network, use:

make deploy ARGS="--network <network_name>"

Testing

Run the test suite:

make test

Test Coverage

Generate a test coverage report:

make coverage

Deployment to Testnet or Mainnet

Environment Variables

Set the following environment variables, preferably in a .env file:

  • RPC_URL: URL of the Ethereum node (e.g., from Alchemy).
  • PRIVATE_KEY: Your Ethereum account's private key (ensure this account does not hold real funds during development).

Obtaining Testnet ETH

Acquire testnet ETH from faucets.chain.link and verify the balance in your wallet.

Deployment Command

Deploy to a network (e.g., Sepolia):

make deploy ARGS="--network sepolia"

Interacting with the Contracts

Use the predefined Makefile scripts or cast commands to interact with the deployed contracts. Example commands:

  • Mint WETH:

    make mint-weth
  • Approve WETH:

    make approve-weth
  • Deposit and Mint Stablecoin:

    make mint-stablecoin

Gas Estimation

Estimate gas costs:

make gas

Review the .gas-snapshot file for details.

Formatting

Ensure code consistency:

make fmt

About

A stable coin where users can deposit wrapped eth and wrapped btc in order to receive a token that will be pegged to the USD.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published