Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: script for slashing manager removal from registry #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ jobs:
- name: Run Forge tests
env:
INFURA_TOKEN: ${{ secrets.INFURA_TOKEN }}
IS_CI: true
run: forge test -vvv
id: test
42 changes: 42 additions & 0 deletions scripts/deployers/rm-slashingManager/generatePayload.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {Script, stdJson, console} from "lib/forge-std/src/Script.sol";

// These imports get generated by npm run generate:interfaces
import {Governance} from "../../helpers/interfaces/Governance.generated.sol";
import {Registry} from "../../helpers/interfaces/Registry.generated.sol";

contract DeployFix is Script {
using stdJson for string;

Registry registry = Registry(0x33a02E6cC863D393d6Bf231B697b82F6e499cA71);

bytes32 private constant SLASHING_MANAGER = keccak256("slashingManager");

address governance = 0x6e7a5820baD6cebA8Ef5ea69c0C92EbbDAc9CE48;

address timelock = 0xCaf0aa768A3AE1297DF20072419Db8Bb8b5C8cEf;

function run() public {
console.log("Generating payload \n");
bytes memory payloadRegistry =
abi.encodeCall(Governance.update, (address(registry), abi.encodeCall(Registry.updateContractMap, (SLASHING_MANAGER, address(0x00)))));

console.log("Send: ");
console.logBytes(payloadRegistry);
console.log("to: ", governance);

uint256 mainnetFork;
mainnetFork = vm.createFork(vm.rpcUrl("mainnet"));
vm.selectFork(mainnetFork);
assert(registry.getSlashingManagerAddress() == 0x01F645DcD6C796F6BC6C982159B32fAaaebdC96A);
assert(registry.contractMap(SLASHING_MANAGER) == 0x01F645DcD6C796F6BC6C982159B32fAaaebdC96A);

vm.prank(timelock);
(bool success, /* bytes memory res */ ) = governance.call(payloadRegistry);
assert(success);
assert(registry.getSlashingManagerAddress() == address(0x00));
assert(registry.contractMap(SLASHING_MANAGER) == address(0x00));
}
}
1 change: 1 addition & 0 deletions test/foundry/ForkupgradeMPT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ contract ForkupgradeMPT is Test {
}

function test_UpgradeMPT() public {
vm.skip(vm.envBool("IS_CI"));
assertEq(vm.activeFork(), mainnetFork);

string memory input = vm.readFile("scripts/deployers/mpt-fix/input.json");
Expand Down
Loading