OriginProtocol / origin-dollar

OUSD and OETH are stablecoins that passively accrue yield while you are holding it
https://originprotocol.com
MIT License
119 stars 80 forks source link

Use transition governance when needed #2079

Closed shahthepro closed 4 months ago

shahthepro commented 4 months ago

To test it, you can create a test proposal like:

const addresses = require("../../utils/addresses");
const { deploymentWithGovernanceProposal } = require("../../utils/deploy");

module.exports = deploymentWithGovernanceProposal(
  {
    deployName: "100_test_governance",
    forceDeploy: false,
    // forceSkip: true,
    onlyOnFork: true, // this is only executed in forked environment
    reduceQueueTime: true, // just to solve the issue of later active proposals failing
  },
  async ({ ethers }) => {
    const PROPOSER_ROLE =
      "0xb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1"; // keccak256("PROPOSER_ROLE");
    const EXECUTOR_ROLE =
      "0xd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63"; // keccak256("EXECUTOR_ROLE");
    const CANCELLER_ROLE =
      "0xfd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f783"; // keccak256("CANCELLER_ROLE");
    const cTimelock = await ethers.getContractAt(
      "ITimelockController",
      addresses.mainnet.Timelock
    );

    return {
      name: "TEST PROPOSAL",
      actions: [
        {
          contract: cTimelock,
          signature: "revokeRole(bytes32,address)",
          args: [PROPOSER_ROLE, addresses.mainnet.Guardian],
        },
        {
          contract: cTimelock,
          signature: "revokeRole(bytes32,address)",
          args: [EXECUTOR_ROLE, addresses.mainnet.Guardian],
        },
        {
          contract: cTimelock,
          signature: "revokeRole(bytes32,address)",
          args: [CANCELLER_ROLE, addresses.mainnet.Guardian],
        },
      ],
    };
  }
);

If you made a contract change, make sure to complete the checklist below before merging it in master.

Refer to our documentation for more details about contract security best practices.

Contract change checklist:

github-actions[bot] commented 4 months ago
Warnings
:warning: :eyes: This PR needs at least 2 reviewers

Generated by :no_entry_sign: dangerJS against b0f69ce6abf4c61143d711913ecee95c255b6d91

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 60.54%. Comparing base (60d7e8f) to head (b0f69ce).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2079 +/- ## ======================================== Coverage 60.54% 60.54% ======================================== Files 59 59 Lines 3021 3021 Branches 779 590 -189 ======================================== Hits 1829 1829 Misses 1189 1189 Partials 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.