Giter VIP home page Giter VIP logo

funddao's Introduction

FundDao

Contract Features

  • The contract enables users to deposit and withdraw funds.
  • The contract utilizes a fee structure, with fee percentages designated for the developer (dev), fund operations (fund), owner, and shareholders.
  • The contract also allows the owner to execute token swaps via the Uniswap v2 Router.
  • Additionally, the owner can transfer tokens or ETH to a recipient address.

Contract Overview

Data Structures

  • Depositor: A struct representing a depositor with fields for the deposited amount, payout, and an active status flag.
  • depositors: A mapping to associate an address with its respective Depositor struct.
  • depositorsList: An array to keep track of all active depositors.

Functionality

  • constructor: Sets initial values for the dev, fund, and owner addresses.
  • onlyDev, onlyAdmin, onlyOwner: Modifiers that limit function access to specific roles.
  • updateDev, updateFund, updateOwner: Functions to update addresses for the dev, fund, and owner, respectively.
  • updateFees: Function to adjust the percentages allocated to dev, fund, owner, and shareholders from profits.
  • updateWithdrawal: Function to control whether withdrawals are allowed.
  • transferTokens, transferEth: Functions for the owner to transfer tokens or ETH to a recipient.
  • swap: Function for the owner to perform token swaps using the Uniswap V2 Router.
  • deposit: Allows users to deposit funds into the contract.
  • withdraw: Allows users to withdraw their profits and optionally their deposited funds, provided withdrawals are allowed.
  • distributeProfits: Distributes profits between dev, fund, owner, and depositors according to their respective fee percentages.
  • receive: A fallback function that allows direct ETH deposits.

Dependencies

  • OpenZeppelin Contracts: A library for secure smart contract development.
  • Uniswap V2 Router: Interfaces to interact with the Uniswap v2 Router contract for token swaps.

License

The smart contract is released under the MIT License.

funddao's People

Contributors

tristanh00 avatar

Watchers

 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.