Code Monkey home page Code Monkey logo

badger_governance_veto's Introduction

badger_governance_veto

Overview

The timelock is based on the OpenZeppelin timelock controller.

For a deep explanation of the TimelockController, read TimelockController

In addition to the PROPOSE_ROLE and EXECUTE_ROLE that exist on the TimelockController, we should have a VETO_ROLE. The admin permissions for this role are the same as the others.

A vetoer can dispute a proposal once proposed, but before it is executed.

Once vetoed, a proposal is ‘disputed’ and cannot be executed. The veto should notify another contract, the Supreme Court, that a proposal is disputed and that it requires additional input.

Source code changes

  1. Added VETO_ROLE.
  2. Added SUPREMECOURT_ROLE.
  3. Added CANCELLOR_ROLE.
  4. Initialized all roles in constructor.
  5. Created a mapping called disputed which tells state of operations.
  • 0- not disputed can be disputed.
  • 1- disputed operation.
  • 2- not disputed but can not be disputed, needed supreme court rejects it once.
  1. Created a Function called callDispute to dispute operation.
  2. Created an event CallDisputed, will emit after the operation is Disputed.
  3. Created a Function callDisputeResolve, which will take the supreme court's judgement as input. It will either unpause the operation or cancel it based upon judgement.
  4. Created an event CallDisputedResolved, will emit after the disputed operation is resolved.
  5. Updated beforeCall() function so that the disputed operation can not be executed.

badger_governance_veto's People

Contributors

fatimanaz avatar

Forkers

badger-finance

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.