Giter Site home page Giter Site logo

jhweintraub / erc-6506 Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 2.24 MB

Official reference implementation for ERC-6505, the standard for P2P Escrowed Governance-Incentives.

License: GNU General Public License v3.0

Solidity 100.00%
dao-design-pattern erc ethereum

erc-6506's Introduction

ERC-6506 - The P2P Escrowed Governance-Incentive Standard

Official reference implementation for ERC-6505, the standard for P2P Escrowed Governance-Incentives. This repository contains the most up-to-date version of the EIP, example implementations, and relevant unit tests.

ERC-6506 was designed to be a modular system. Through a series of abstract contracts, your base implementation can pick and choose its functionality.

Some of the options include

  1. Transparent vs. Private Incentives
  2. On Chain vs. Off Chain Voting
  3. Optional dispute mechanisms for when certain cases can't be resolved independently.

This repo contains four different types of escrowed-incentives and their associated tests, written with Foundry.

  1. Transparent On-Chain
  2. Private On-Chain
  3. Transparent off-Chain
  4. Private off-chain.

A transparent Incentive is one where all the data is committed to on chain, and viewable by everyone. The user provides all the data in the beginning and the hash-committment is calculated and stored on-chain alongside the underlying data. Private incentives are the opposite. When the user creates an incentive, they only provide the committment. The committment does not need to be revealed until either the recipient claims the incentive tokens, or the incentivizer attempts to claw-back their tokens due to non-compliance.

An on-chain incentive is relatively simple. When voting is done entirely on-chain, the system merely checks the voting contract to confirm proof-of-vote. Good examples include Curve governance. Off-chain voting on the other hand refers to voting systems such as Snapshot. On-Chain voting preserves the escrow guarantee, but uses optimistic fraud-proofs and challenge windows to ensure compliance. In order for a user to claim their incentive, the dispute window must have successfully closed without a valid fraud-proof being submitted. Full details on this implementation can be found in the full specification document for EIP-6505. As a PoC, the On-Chain incentive tests were built with the OpenZeppelin GovernorBravo library. Live implementations should be sure to perform integration tests with actually deployed governance systems.

This document is meant as a proof-of-concept and should not be used for live-production.

This repository uses an external library I wrote, SnapshotSignatureVerifier for verifying signatures in accordance with EIP-712

Commit-Reveal Scheme Structure

Reveal Structure

Dispute Mechanism

erc-6506's People

Contributors

jhweintraub avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pynchmeister

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.