Skip to content

poemwiki/DAO-contracts

 
 

Repository files navigation

PoemWiki DAO Contarcts

Getting Started

Work with this repo in the browser (optional)

Open in Gitpod

It's recommended that you've gone through the hardhat getting started documentation before proceeding here.

Requirements

  • git
    • You'll know you did it right if you can run git --version and you see a response like git version x.x.x
  • Nodejs
    • You'll know you've installed nodejs right if you can run:
      • node --versionand get an ouput like: vx.x.x
  • Yarn instead of npm
    • You'll know you've installed yarn right if you can run:
      • yarn --version And get an output like: x.x.x
      • You might need to install it with npm

Installation

  1. Clone this repo:
git clone https://github.com/PatrickAlphaC/dao-template
cd dao-template
  1. Install dependencies
yarn

or

npm i 
  1. Run the test suite (which also has all the functionality)
yarn hardhat test

or

npx hardhat test

If you want to deploy to a testnet: 4. Add a .env file with the same contents of .env.example, but replaced with your variables. WARNING WARNING WARNING

DO NOT PUSH YOUR PRIVATE_KEY TO GITHUB

  1. Deploy to testnet e.g. goerli
npm run deploy goerli
  1. Verify contracts at 0x... through etherscan API
npm run verify goerli 0x...

Usage

On-Chain Governance Example

Here is the rundown of what the test suite does.

  1. We will deploy an ERC20 token that we will use to govern our DAO.
  2. We will deploy our Governence contract
    1. Note: The Governance contract is in charge of proposals
  3. We will deploy a simple Box contract, which will be owned by our Governence contract!.
  4. We will submit a proposal to mint some token to an address.
  5. We will then vote on that proposal.
  6. We will then execute the proposal if passed.

You can also use the Openzeppelin contract wizard to get other contracts to work with variations of this governance contract.

Roadmap

  • Upgradeable contracts with the TransparentUpgradeableProxy pattern
  • [] Add tests

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Acknowledgments

(back to top)

You can check out the openzeppelin javascript tests for a full suite of an example of what is possible.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 70.6%
  • Solidity 28.7%
  • Shell 0.7%