Skip to content

This project implements a decentralized governance system using Solidity and OpenZeppelin contracts.

License

Notifications You must be signed in to change notification settings

Patrick-Ehimen/esan-DAO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solidity Governance Project

This project implements a decentralized governance system using Solidity and OpenZeppelin contracts. It includes a governance token, a governance contract, a timelock controller, and a simple storage contract.

Components

1. GovToken (src/GovToken.sol)

A governance token implemented using OpenZeppelin's ERC20, ERC20Permit, and ERC20Votes. This token is used for voting in the governance system.

2. MyGovernor (src/MyGovernor.sol)

A governance contract that allows token holders to create and vote on proposals. It extends various OpenZeppelin governance contracts such as Governor, GovernorSettings, and GovernorVotes.

3. TimeLock (src/TimeLock.sol)

A timelock controller that enforces a delay between when proposals are made and when they can be executed, enhancing the security of the governance process.

4. Box (src/Box.sol)

A simple contract that allows storing and retrieving a value. It is used to demonstrate how a governed contract might function.

Setup and Deployment

  1. Install Dependencies: Ensure you have foundry installed. Then run:
   forge install
  1. Compile Contracts: Compile the Solidity contracts using Foundry:
forge build

Security

This project uses OpenZeppelin contracts which are industry standard and audited. However, always ensure to audit and test your specific implementation thoroughly before deploying to a production environment.

License

This project is licensed under the MIT License.

# Solidity Governance Project

This project implements a decentralized governance system using Solidity and OpenZeppelin contracts. It includes a governance token, a governance contract, a timelock controller, and a simple storage contract.

## Components

### 1. GovToken (`src/GovToken.sol`)

A governance token implemented using OpenZeppelin's `ERC20`, `ERC20Permit`, and `ERC20Votes`. This token is used for voting in the governance system.

### 2. MyGovernor (`src/MyGovernor.sol`)

A governance contract that allows token holders to create and vote on proposals. It extends various OpenZeppelin governance contracts such as `Governor`, `GovernorSettings`, and `GovernorVotes`.

### 3. TimeLock (`src/TimeLock.sol`)

A timelock controller that enforces a delay between when proposals are made and when they can be executed, enhancing the security of the governance process.

### 4. Box (`src/Box.sol`)

A simple contract that allows storing and retrieving a value. It is used to demonstrate how a governed contract might function.

## Setup and Deployment

1. **Install Dependencies:**
   Ensure you have Node.js and npm installed. Then run:
   ```bash
   npm install
   ```
  1. Compile Contracts: Compile the Solidity contracts using Hardhat:

    npx hardhat compile
  2. Deploy Contracts: Deploy the contracts to a local or test Ethereum network:

    npx hardhat run scripts/deploy.js --network <network-name>
  3. Verify Contracts: After deployment, verify the contracts on Etherscan by running:

    npx hardhat verify --network <network-name> DEPLOYED_CONTRACT_ADDRESS

Usage

  • Mint GovTokens: Mint governance tokens to allow users to participate in the governance process.

    govToken.mint(userAddress, amount);
  • Create Proposals: Propose changes or actions by specifying the target contract, values, and calldata.

    myGovernor.propose(targets, values, calldatas, description);
  • Vote on Proposals: Vote on active proposals using the governance tokens.

    myGovernor.castVote(proposalId, support);
  • Execute Proposals: Once a proposal has passed and the timelock delay has elapsed, execute the proposal.

    myGovernor.execute(targets, values, calldatas, descriptionHash);

Security

This project uses OpenZeppelin contracts which are industry standard and audited. However, always ensure to audit and test your specific implementation thoroughly before deploying to a production environment.

License

This project is licensed under the MIT License.

This README provides a comprehensive overview of the project, including setup, usage, and security considerations. Adjust paths and commands as necessary based on your specific environment and deployment details.

About

This project implements a decentralized governance system using Solidity and OpenZeppelin contracts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published