Giter Site home page Giter Site logo

fgrust / endaoment-contracts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from endaoment/endaoment-contracts

0.0 0.0 0.0 3.76 MB

Solidity contracts for Endaoment's on-chain Donor-Advised Fund

License: Other

JavaScript 60.16% Solidity 39.27% Shell 0.57%

endaoment-contracts's Introduction

Endaoment Contracts

Endaoment is a public, tax-exempt 501(c)(3) charity providing smart contract powered Donor-Advised Funds.

The solidity contracts in this repository govern the creation, operation and flow-of-funds of Endaoment's Donor-Advised Funds and Nonprofit Organization Escrow Contracts.


Table of Contents


Usage

These contracts should be used exclusively in conjunction with the Endaoment Client (repo) and Endaoment API (repo), in order to replicate proper behavior.

Installation

To install, clone this repository using:

git clone https://github.com/endaoment/endaoment-contracts.git

Then run:

npm install

Once installed, in the project directory run:

npm run build   

Builds all contracts in /contracts directory using oz compile.

Outputs: /artifcts, /build and /cache to root directory.

Testing

After installation, run:

npm run test

Launches the test runner and runs the associated test suite.

Contracts

The Endaoment ecosystem uses serveral contracts to govern the movement of finances between DAFs and organizations:

EndaomentAdmin.sol

In order to comply with US nonprofit regulations and increase system security, Endaoment uses several different Admin accounts to manage actions throughout the gifting and grantmaking processes.

The EndaomentAdmin contract creates the Roles necessary to execute the oversight of the Endaoment ecosystem, as well as providing for the ability to change or pause the current holder of a given role.

Several "getter" functions are also available to allow for querying of current role status or holder.

EndaomentAdminStorage.sol

To prevent an attacker from deploying their own EndaomentAdmin contract and representing themselves as the EndaomentAdmin, both FundFactory and OrgFactory use EndaomentAdminStorage to allow Fund and Org contracts to keep a record of the current and correct EndaomentAdmin contract for overseeing actions.

Administratable.sol

Provides an interface containing key modifiers for administering the FundFactory and OrgFactory that reference the EndaomentAdmin contract.

FundFactory.sol

Provides method for creating/deploying a new Fund contract.

Fund.sol

Provides all methods for the administration of any specific Fund in the Endaoment ecosystem.

Includes a Grants mapping that allows for the manager to create a new Grant recommendation data struct whereby they provide a recipeint organization address to send funds from their DAF. Any new Grant must have a recipient that was created by decalred OrgFactory role in the enumerated EndaomentAdmin. If approved, the amount of tokens prescribed in the Grant struct is transferred to the desired recipient.

OrgFactory.sol

Provides method for creating/deploying a new Org contract. Methods are also available for toggling an Org contract address to allowed/disallowed. A mappoing is present to allow individual addresses to be checked if they came from the OrgFactory.

Org.sol

Provides all methods for the administration of any specific Org in the Endaoment ecosystem.

Includes a Claims mapping that allows for any address to create a new Claim data struct whereby they provide a orgWallet address and contact info. If a Claim is approved, a subset of Admin accounts can release granted funds from the Org contract to the desired wallet via the cashOutOrg() method.


Additional Documentation

Full technical documentation of our contracts can be found in our doucmentation repository:

Other Resources:

License

BSD 3-Clause

Responsible Disclosue

If you discover a vulnerability, we would like to know about it so we can take steps to address it as quickly as possible.

Please do the following:

  • E-mail your findings to [email protected]. Encrypt your findings using our PGP key to prevent this critical information from falling into the wrong hands,
  • Do not take advantage of the vulnerability or problem you have discovered, for example by downloading more data than necessary to demonstrate the vulnerability or deleting or modifying other people's data,
  • Do not reveal the problem to others until it has been resolved,
  • Do not use attacks on physical security, social engineering, distributed denial of service, spam or applications of third parties, and
  • Do provide sufficient information to reproduce the problem, so we will be able to resolve it as quickly as possible. Usually, the IP address or the URL of the affected system and a description of the vulnerability will be sufficient, but complex vulnerabilities may require further explanation.

What we promise:

  • We will respond to your report within 3 business days with our evaluation of the report and an expected resolution date,
  • If you have followed the instructions above, we will not take any legal action against you in regard to the report,
  • We will handle your report with strict confidentiality, and not pass on your personal details to third parties without your permission,
  • We will keep you informed of the progress towards resolving the problem,
  • In the public information concerning the problem reported, we will give your name as the discoverer of the problem (unless you desire otherwise), and
  • As a token of our gratitude for your assistance, we offer a reward for every report of a security problem that was not yet known to us. The amount of the reward will be determined based on the severity of the leak and the quality of the report.
  • We strive to resolve all problems as quickly as possible, and we would like to play an active role in the ultimate publication on the problem after it is resolved.

endaoment-contracts's People

Contributors

apbendi avatar cantelopepeel avatar mds1 avatar rheeger avatar wildmolasses 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.