Coder Social home page Coder Social logo

allo-protocol-contracts's Introduction

Allo Procotol Contracts

This project is built using hardhat. All the contracts required to run / manage a round can be found here. If you come across any vulnerabilities, do create an issue / raise a PR to help improve the contracts. ^_^

Directory Structure

.
├── contracts                           # Smart contracts
├   ├── utils                           # useful utils
├   ├── program                         # program contracts
├   ├   ├── ProgramFactory.sol          # factory contract which deploys program
├   ├   ├── ProgramImplementation.sol   # program contract
├   ├── round                           # round contracts
├   ├   ├── RoundFactory.sol            # factory contract which deploys round
├   ├   ├── RoundImplementation.sol     # round contract 
├   ├── votingStrategy                  # voting strategy
├   ├   ├── IVotingStrategy.sol         # voting strategy interface
├   ├   ├── QuadraticFundingVotingStrategy.sol      # QF voting strategy
├── scripts                             # Deploy scripts for smart contracts
├── docs                                # documentation 
├── test                                # Test for smart contracts
├── .env.example                        # .env template
├── .eslintrc.js                        # Eslint config
├── .prettierrc                         # Prettier config
├── .solhint.json                       # Solhint config
├── hardhat.config.json                 # Hardhat configuration
├── package.json                        # Package configuration
├── tsconfig.json                       # Typescript configuration
└── README.md

Terminology

  • Program Operators: wallets that have the permission to create & manage the program
  • Program: maintained by Program Operators which together form a team
  • Round Operators: wallets that have the permission to create & manage the round
  • Round: created by a Program and deal with everything relating to running a round
  • Voter: wallet who cast a vote to a grant during the round
Deploy Steps

To know how the contracts should be setup, refer DEPLOY_STEPS.md

Chain Deployment List

To know the addresses are deployed on which network. refer CHAINS.md

Development

s To contribute to this project, fork the project and follow the instructions at DEV.md

This is built and maintained using hardhat

General Setup

These steps would have to be done per chain but there are intended to be deployed only once

Program

  1. Deploy ProgramFactory
  2. Deploy ProgramImplementation
  3. Link ProgramImplementation to ProgramFactory contract

Round

  1. Deploying all voting strategy (contracts under votingStrategy/)
  2. Deploy RoundFactory
  3. Deploy RoundImplementation
  4. Link RoundImplementation to RoundFactory contract

Program Setup

  1. To create a program, you would not deploy a contract but instead, rely on the create function on the ProgramFactory to create a clone of the already deployed ProgramImplementation contract
  2. Any interaction in terms of updating parameters etc can be performed against the ProgramImplementation contract itself

The ProgramFactory enables us to have upgradable contracts on ProgramImplementation

Round Setup

  1. To create a round, you would not deploy a contract but instead, rely on the create function on the RoundFactory to create a new RoundImplementation contract.
  2. The user would have to choose a voting strategy like QuadraticFundingVotingStrategy (already deployed via instruction mention in DEPLOY_STEPS.md)
  3. Any interaction in terms of updating parameters etc can be performed against the RoundImplementation contract itself

The RoundFactory enables us to have upgradable contracts on RoundImplementation.

Deploy Steps

To know how the contracts should be setup, refer DEPLOY_STEPS.md

Chain Deployment List

To know the addresses are deployed on which network. refer CHAINS.md

Development

To contribute to this project, fork the project and follow the instructions at DEV.md

Contract Documentation

The contract documentation has been generated using primitive-dodoc and can be found over at docs/contracts

allo-protocol-contracts's People

Contributors

thelostone-mc avatar t-proctor avatar qedk avatar chibie avatar bhargavaparoksham avatar gravityblast avatar 0xkurt avatar vacekj avatar codenamejason avatar shavinac avatar owocki avatar carlbarrdahl avatar lukedowell avatar boudra avatar hmrtn avatar omahs avatar

allo-protocol-contracts's Issues

Improve DirectStrategy

The current version of the DirectStrategy used for Direct Grants round is very basic and needs to be improved mostly around the payment logic.
Some missing functionalities:

  • to have 2 different flows
    • using a Safe: the strategy can behave as a SafeModule
    • using an external account that previously approve the strategy to spend its tokens (EOA or smart contract)
  • implement round fee logic
  • try to use ETH as payment token

Create DirectStrategy

Create a new contract DirectStrategy which would be used as the strategy for a RoundImplementation:

  • This contract should contain the necessary logic for paying grants to accepted application
  • Payments should flow from an external account to the applicant account

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.