Skip to content

umashankar-tech/Simple-dapp-defi-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple DeFi App

FRONT END REPO: https://github.com/umashankar-tech/Simple-Defi-Dapp-Frontend

This project demonstrates a simple DeFi smart contract workflow using Foundry, including local deployment with Anvil and integration with a React frontend.

Features

alt text

  • Solidity Smart Contract: SimplePayableAndWithdrawal.sol for basic payable and withdrawal functionality.
  • Testing: Comprehensive tests using Forge.
  • Local Blockchain: Anvil for local development and testing.
  • Deployment Scripts: Automated deployment with Forge scripts.
  • Frontend Integration: Designed for easy ABI and address export to React apps.

Getting Started

Prerequisites

  • Foundry (includes Forge & Anvil)
  • Node.js (for React frontend)

Build & Test

forge build
forge test

Run Local Blockchain

anvil

Deploy Contract

forge script script/DeploySimplePayableAndWithdrawal.s.sol --rpc-url http://127.0.0.1:8545 --private-key <your_private_key> --broadcast

Get ABI for Frontend

After deployment, the ABI is generated at:

out/SimplePayableAndWithdrawal.sol/SimplePayableAndWithdrawal.json

Copy the "abi" section from this file for use in your React app.

Example: Using ABI in React

import contractAbi from './abi/SimplePayableAndWithdrawal.json';
// Use contractAbi.abi with ethers.js or web3.js

Project Structure

  • src/ – Solidity contracts
  • script/ – Deployment scripts
  • test/ – Contract tests
  • out/ – Build artifacts (including ABI)
  • broadcast/ – Deployment logs

Resources


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published