Compound Governor Bravo
Overview
function name() public pure override returns (string memory) { return "ADJUST_WETH_IR_CURVE"; }function description() public pure override returns (string memory) { return "Mock proposal to adjust the IR Curve for Compound v3 WETH on Mainnet"; }function build() public override buildModifier(addresses.getAddress("COMPOUND_TIMELOCK_BRAVO")) { /// STATICCALL -- not recorded for the run stage // get configurator address ICompoundConfigurator configurator = ICompoundConfigurator( addresses.getAddress("COMPOUND_CONFIGURATOR") ); // get comet address address comet = addresses.getAddress("COMPOUND_COMET"); /// CALLS -- mutative and recorded // set borrow kink to 0.75 * 1e18 configurator.setBorrowKink(comet, kink); // set supply kink to 0.75 * 1e18 configurator.setSupplyKink(comet, kink); }function run() public override { // Create and select the mainnet fork for proposal execution. primaryForkId = vm.createFork("mainnet"); vm.selectFork(primaryForkId); uint256[] memory chainIds = new uint256[](1); chainIds[0] = 1; // Set the addresses object by reading addresses from the JSON file. setAddresses( new Addresses( vm.envOr("ADDRESSES_PATH", string("./addresses")), chainIds ) ); // Set Governor Bravo. This address is used for proposal simulation and checking the on-chain proposal state. setGovernor(addresses.getAddress("COMPOUND_GOVERNOR_BRAVO")); // Call the run function of the parent contract 'Proposal.sol'. super.run(); }function validate() public view override { // get configurator address ICompoundConfigurator configurator = ICompoundConfigurator( addresses.getAddress("COMPOUND_CONFIGURATOR") ); // get comet address address comet = addresses.getAddress("COMPOUND_COMET"); // get comet configuration ICompoundConfigurator.Configuration memory config = configurator .getConfiguration(comet); // ensure supply kink is set to 0.75 * 1e18 assertEq(config.supplyKink, kink); // ensure borrow kink is set to 0.75 * 1e18 assertEq(config.borrowKink, kink); }
Running the Proposal
Last updated