Skip to content

A permissionless, non-custodial DeFi blockchain enabling stablecoin issuance and decentralized financial applications.

Notifications You must be signed in to change notification settings

pky1987/DeFi-blockchain

Repository files navigation

DeFi Stablecoin Protocol

This project implements a decentralized stablecoin protocol with:

  • Collateralized stablecoin (DecentralizedStableCoin.sol)
  • Core engine for minting, redeeming, and liquidations (DSCEngine.sol)
  • Chainlink price feed integration (libraries/PriceFeed.sol)

Project Structure

  • contracts/ — Solidity smart contracts
  • test/ — Unit, fuzz, and invariant tests
  • script/ — Deployment and configuration scripts
  • lib/ — Local dependencies (OpenZeppelin, Chainlink, forge-std)

cargo install --path ./crates/forge --profile release --force (imp) '' git init; forge install OpenZeppelin/[email protected]; forge install smartcontractkit/chainlink-brownie-contracts ''

clone the repository

git clone https://github.com/foundry-rs/foundry.git cd foundry

install Forge

cargo install --path ./crates/forge --profile release --force --locked

install Cast

cargo install --path ./crates/cast --profile release --force --locked

install Anvil

cargo install --path ./crates/anvil --profile release --force --locked

install Chisel

cargo install --path ./crates/chisel --profile release --force --locked

''

How to Deploy

curl -L https://foundry.paradigm.xyz | iex Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm get.scoop.sh | iex scoop install foundry

  1. Install Foundry dependencies (libraries are in lib/ folder):
    forge install OpenZeppelin/openzeppelin-contracts
    forge install smartcontractkit/chainlink-brownie-contracts
  2. Compile contracts:
    forge build
  3. Deploy contracts (example using Foundry script):
    forge script script/DeployDSC.s.sol --rpc-url <YOUR_RPC_URL> --private-key <YOUR_PRIVATE_KEY> --broadcast

How to Test

Run all tests using Foundry:

forge test

How to Use

Interact with the protocol using scripts, tests, or a frontend dApp:

  • Deposit collateral tokens (WETH, WBTC)
  • Mint and burn stablecoins
  • Redeem collateral
  • Liquidate unhealthy positions

You can use the contract ABIs in artifacts/ to build a frontend (see previous answers for React/Vite/Next.js setup).


For more details, see the contract comments and test files.

About

A permissionless, non-custodial DeFi blockchain enabling stablecoin issuance and decentralized financial applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published