Git Product home page Git Product logo

fundraise's Introduction

Fundraise.sol

This project is unaudited. Please audit before deploying to mainnet.

No Audit


Motivation

During memecoin season, a lot of projects hype their contribution address to a private EOA with no soft/hard caps and people "ape in". Management of these funds can be mismanaged and token distribution cannot be easily checked.

If a project does not go ahead (ie: meet their soft-cap) they rely on the meme coin creators to not rug and send back the ETH.

What if there was a better way? We are working with programmable money after all!

Features

  • Deployer sets min and max contribution limits that are enforced!
  • Deployer sets the soft-cap and hard-cap limits, these have enforced rules!
  • Deployer cannot withdraw the ETH until they have met the soft-cap!
  • Disallow contributions from exchanges!
  • Users can withdraw their contributions (partial or full) until soft-cap is reached!

Soft-Cap

This is the amount of ETH to have raised before the deployer/owner can withdraw anything. Before hitting the soft-cap, the contributors can withdraw a partial or their full contributions.

Hard-Cap

This is the amount of ETH the contract wants to raise and will not accept any ETH after this has been hit.

Offchain Indexer

When someone contributes to the fundraise or withdraws their ETH, an event is emitted. You can listen for this event.

event Contributed(
    address indexed sender,     # the address of the contributor
    bool indexed isDeposit,     # true if deposit, false is withdraw
    uint256 amount,             # the eth value of the transaction sent by the user
    uint256 totalAmount         # the total amount contributed by the user
);

Interface

// cast interface <(cat ./out/Fundraise.sol/Fundraise.json | jq .abi)


interface Interface {
    event Contributed(address indexed sender, bool indexed isDeposit, uint256 amount, uint256 totalAmount);
    event Fundrasing(bool isOpen);

    function amountRaised() external view returns (uint256);
    function contribute() external payable;
    function contributions(address) external view returns (uint256);
    function contributionsOf(address _contributor) external view returns (uint256);
    function fundraiseHardCapWei() external view returns (uint256);
    function fundraiseSoftCapWei() external view returns (uint256);
    function maxContributionWei() external view returns (uint256);
    function minContributionWei() external view returns (uint256);
    function owner() external view returns (address);
    function ownerWithdraw() external;
    function totalRaised() external view returns (uint256);
    function userWithdraw(uint256 _amt) external;
}

fundraise's People

Contributors

409h avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.