Skip to content

Decentralized ETH fundraising smart contract with Chainlink price feed integration, owner withdrawals, and Foundry-based tests.

License

Notifications You must be signed in to change notification settings

vyqno/SeedRaise

Repository files navigation

🚀 SeedRaise

Solidity    OpenZeppelin    Foundry    License

A modern fundraising smart contract with price conversion and Chainlink priceFeed integration


🎯 Overview

SeedRaise is a simple fundraising contract built with modern Solidity practices, OpenZeppelin contracts, and Foundry. It leverages Chainlink price feeds for ETH/USD conversion, allowing users to contribute ETH with real-time USD equivalence.

Key Highlights

  • Minimum USD Contribution: Enforced via Chainlink price feed
  • Owner withdrawal
  • Price conversion utility
  • Comprehensive test coverage

🔥 Features

Feature Description Status
Fundraising Accept ETH contributions with USD minimum
Price Conversion Real-time ETH/USD conversion via Chainlink
Owner Withdraw Only owner can withdraw funds
Test Coverage Foundry-based tests for all core logic
OpenZeppelin Security Uses OpenZeppelin contracts for safety

📄 Contract Details

Core Information

Contract Name: SeedRaise
Minimum USD: $50 (configurable)
Price Feed: Chainlink AggregatorV3Interface
Owner: Deployer address

📁 Project Structure

SeedRaise/
├── 📁 broadcast/                           # Foundry deployment broadcasts
├── 📁 cache/                               # Build cache files
├── 📁 lib/                                 # Dependencies (forge-std, openzeppelin, chainlink)
├── 📁 script/                              # Deployment scripts
│   ├── 📄 DeploySeedRaise.s.sol            # Main deployment script
│   └── 📄 DeploymentHelperConfig.s.sol     # Helper config script
├── 📁 src/                                 # Smart contracts source code
│   ├── 📄 SeedRaise.sol                    # Main fundraising contract
│   └── 📄 PriceConverter.sol               # Price conversion library
├── 📁 test/                                # Test files
│   └── 📄 TestSeedRaise.t.sol              # Core functionality tests
├── 📄 foundry.lock                         # Foundry dependencies lock file
├── 📄 foundry.toml                         # Foundry configuration
├── 📄 Makefile                             # Build and deployment commands
└── 📄 README.md                            # Project documentation

Key Directories

Directory Purpose
src/ Contains main smart contracts (SeedRaise.sol, PriceConverter.sol)
script/ Deployment scripts for different networks
test/ Comprehensive test suite
lib/ External dependencies (OpenZeppelin, Forge-std, Chainlink)
broadcast/ Deployment transaction records

🌐 Deployment Information

🔗 Sepolia Testnet Deployment

Parameter Value
Network Sepolia Testnet
Contract Address 0xFC911c925D25A38297b794248f2C5497D181C2f8
Transaction Hash 0x4b3cc955ab964f0d9f15034180db01829fce4902ce19112a39308e2d37e70194
Block Number 9,369,736
Deployment Date October 8, 2025
Price Feed 0x694AA1769357215DE4FAC081bf1f309aDC325306

View on Etherscan


🔗 Polygon Amoy Deployment

Parameter Value
Network Polygon Amoy Testnet
Contract Address 0x73Bc0123F2454561a9A63740cdF0918f7F0193FC
Transaction Hash 0xe5c31bda5438c17f11848ffdc5d0bd801640c7bb2a7ba410d547091db8a4508a
Price Feed 0xF0d50568e3A7e8259E16663972b11910F89BD8e7

🧪 Testing

Test Coverage Summary

TestSeedRaise Gas Report

Test Name Gas Used
testAddsFunderToArrayOfFunders 174,710
testContributeUpdatesDataStructures 108,871
testDeploymentDetails 10,396
testFundFailsWithoutEnoughETH 28,739
testGetETHprice 29,553
testGetVersion 15,565
testOthersCanWithdraw 108,071
testOwnerCanWithdraw 148,407
testPriceFeedSetCorrectly 25,175

🛠️ Installation

Prerequisites

Setup

# Clone the repository
git clone <repository-url>
cd SeedRaise

# Install dependencies
forge install

# Compile contracts
forge build

# Run tests
forge test

💻 Usage

Deploying the Contract

  1. Set up environment variables:
export PRIVATE_KEY=<your_private_key>
export SEPOLIA_ETH_RPC_URL=<your_sepolia_rpc_url>
export ETHERSCAN_API_KEY=<your_etherscan_api_key>
  1. Deploy to Sepolia:
make deploy-sepolia

🤝 Connect With Me

GitHub    X (Twitter)

Let's raise some ETH!


📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


About

Decentralized ETH fundraising smart contract with Chainlink price feed integration, owner withdrawals, and Foundry-based tests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published