Skip to content

EthFund smart contract is a decentralized funding platform that allows users to contribute Ether (ETH) to a project or individual. It uses Chainlink price feeds to ensure contributions meet a minimum USD threshold and leverages OpenZeppelin's libraries for secure smart contract development on the Ethereum blockchain.

License

Notifications You must be signed in to change notification settings

obinnafranklinduru/ethfund

Repository files navigation

EthFund

EthFund is a decentralized funding platform built on the Ethereum blockchain that allows users to contribute Ether (ETH) to projects or individuals. The smart contract leverages Chainlink price feeds to ensure contributions meet a minimum USD threshold. It is built using Solidity and utilizes OpenZeppelin's libraries for secure and efficient smart contract development.

Contract Details

Features

  • Contribute Ether (ETH) to projects or individuals.
  • Minimum contribution amount enforced via Chainlink price feeds.
  • Only the contract owner can withdraw funds.
  • Pausable contract functionality.
  • Secure smart contract development with OpenZeppelin libraries.

Table of Contents

Getting Started

Requirements

  • Git
    • Ensure Git is installed by running git --version.
  • Foundry
    • Ensure Foundry is installed by running forge --version.
  • Make
    • Ensure Make is installed by running make --version.

Installation

Clone the repository and remove dependencies:

git clone https://github.com/obinnafranklinduru/ethfund
cd ethfund
make remove

install dependencies:

make install

Update dependencies to the latest versions:

make update

Deployment

Ensure you have the necessary environment variables set in a .env file:

SEPOLIA_RPC_URL=<your_sepolia_rpc_url>
PRIVATE_KEY=<your_private_key>
ETHERSCAN_API_KEY=<your_etherscan_api_key>

Deploy the contract using the Makefile:

make deploy ARGS="--network sepolia"

Usage

Funding a Project

Users can fund a project by sending Ether (ETH) to the contract. The contract ensures the minimum contribution amount is met.

function fund() public payable whenNotPaused {
    require(msg.value >= MINIMUM_USD, "You need to spend more ETH!");
    // Function logic...
}

Withdrawing Funds

Only the contract owner can withdraw funds from the contract.

function withdraw() public payable onlyOwner nonReentrant whenNotPaused {
    // Function logic...
}

Testing

Run tests to ensure the contract functions as expected.

make test

Limitations

  • The contract only supports contributions in ETH. It does not allow for contributions in other cryptocurrencies or tokens, limiting its flexibility.

Contributing

PRs are welcome!

git clone https://github.com/obinnafranklinduru/ethfund
cd ethfund
make help

About

EthFund smart contract is a decentralized funding platform that allows users to contribute Ether (ETH) to a project or individual. It uses Chainlink price feeds to ensure contributions meet a minimum USD threshold and leverages OpenZeppelin's libraries for secure smart contract development on the Ethereum blockchain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published