Giter Club home page Giter Club logo

arc-timelock's Introduction

        .///.                .///.     //.            .//  `/////////////-
       `++:++`              .++:++`    :++`          `++:  `++:......---.`
      `/+: -+/`            `++- :+/`    /+/         `/+/   `++.
      /+/   :+/            /+:   /+/    `/+/        /+/`   `++.
  -::/++::`  /+:       -::/++::` `/+:    `++:      :++`    `++/:::::::::.
  -:+++::-`  `/+:      --++/---`  `++-    .++-    -++.     `++/:::::::::.
   -++.       .++-      -++`       .++.    .++.  .++-      `++.
  .++-         -++.    .++.         -++.    -++``++-       `++.
 `++:           :++`  .++-           :++`    :+//+:        `++:----------`
 -/:             :/-  -/:             :/.     ://:         `/////////////-

Aave Arc Timelock

This repo contains smart contracts to add a timelock to the Aave Arc governance process. This timelock gives a guardian address the opportunity to cancel an approved governance action prior to its execution.

The core contract is the TimelockExecutorBase, an abstract contract that contains the logic to facilitate the queueing, delay, cancellation and/or execution of sets of actions sent by the aave governance contract. This base contract is extended in the ArcTimelock contract to manage receiving calls from the governance contract and queuing them within the TimelockExecutorBase.

This repo is based on the governance-crosschain-bridges. The TimelockExecutorBase is the same as the BridgeExecutorBase contract from this repo, just renamed to meet the usecase. The governance-crosschain-bridges repo, is an audited repo, and has 100% test coverage that can be accessed and ran within that repo.

Getting Started

Setup

  • Clone the repo
  • Run npm install

Follow the next steps to setup the repository:

  • Install docker and docker-compose
  • Create an environment file named .env and fill out the environment variables per example.env
  • Make sure the information included in the environment file .config.env is correct.

Note:

If using private key instead of mnemonic, please use the full 64 character hex string, without the "0x" prefix in the .env file. Additionally, please leave the mnemonic key blank.

Running in Docker

Terminal Window 1 docker-compose up

Once Terminal Window 1 Loaded - in a separate terminal window - Terminal Window 2: docker-compose exec contracts-env bash

In Terminal Window 2, run desired scripts from npm package file (i.e npm run compile)

Compile

npm run compile

This will compile the available smart contracts.

Test

All tests will run a fork-based test with the existing deployed versions of aave governance and the aave arc market.

  • test:arc:full:fork - Runs a full test scenario, executing every action needed for the ARC market launch: deploy the ArcTimelock contract, release the market keys to the ArcTimelock, deploy the AIP payload and submit the governance proposal.

  • test:timelock:full - The ArcTimelock is set as the ArcMarketAdmin. A proposal is created, queued, voted on, and executed, passing the Aave Governance and the ArcTimelock. It uses a mock proposal to update some market parameters.

  • test:timelock:update" - The ArcTimelock is set as the ArcMarketAdmin. A proposal is created, queued, voted on, and executed, passing the Aave Governance and the ArcTimelock. It uses a mock proposal to update parameters of the ArcTimelock.

  • test:arc:keys - Run a simple test scenario for releasing the ARC market keys to the ArcTimelock.

  • test:arc:new-permission-admin - Test the addition of a new permission admin to the ARC protocol.

Arc Timelock

Deploying parameters

  • ethereumGovernanceExecutor - the address that will have permission to queue ActionSets. This should be the aave governance executor
  • delay - the time required to pass after the ActionsSet is queued, before execution
  • gracePeriod - once execution time passes, you can execute this until the grace period ends
  • minimumDelay - if the delay is updated by the guardian, it cannot be less than this minimum
  • maximumDelay - if the delay is updated by the guardian, it cannot be more than this maximum
  • guardian - the admin address of this contract with the permission to cancel ActionsSets and update the delay value

Adding a new PermissionAdmin

Adding a new permission admin to the ARC protocol needs a governance proposal to be approved by the community and the guardian.

The task full:submit-proposal-new-permission-admin lets you submit a proposal in this regard, providing the address of the new permission admin to add and the IPFS encoded hash of the AIP text.

ADMIN_ADDRESS="Your Address" IPFS_ENCODED_HASH="Your IPFS encoded hash" npm run main:proposal:submit-new-permission-admin

License

BSD-3-Clause

arc-timelock's People

Contributors

miguelmtzinf avatar oneski avatar

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.