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

chores: kill veANGLE script #44

Open
wants to merge 1 commit into
base: fix-linea
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
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libs = ["lib"]
script = "scripts"
cache_path = "cache"
gas_reports = ["*"]
via_ir = true
via_ir = false
sizes = true
optimizer = true
optimizer_runs = 1000
Expand Down
12 changes: 11 additions & 1 deletion scripts/Interfaces.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ interface IAccessControlWriteVyper {
function accept_transfer_ownership() external;
}

interface IOwnable {
function transferOwnership(address newOwner) external;

function owner() external view returns (address);
}

interface IProxyAdmin {
function upgrade(address proxy, address implementation) external;
}
Expand Down Expand Up @@ -63,7 +69,11 @@ interface IAngle {
function minter() external returns (address);
}

interface IVeAngle is IAccessControlViewVyper, IAccessControlWriteVyper {}
interface IVeAngle is IAccessControlViewVyper, IAccessControlWriteVyper {
function set_emergency_withdrawal() external;

function emergency_withdrawal() external view returns (bool);
}

interface IGaugeController is IAccessControlViewVyper, IAccessControlWriteVyper {}

Expand Down
2 changes: 1 addition & 1 deletion scripts/deployment/DeploySideChainGovernance.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract DeploySideChainGovernance is Utils {

// TODO can be modified to deploy on any chain
uint256 srcChainId = CHAIN_ETHEREUM;
uint256 destChainId = CHAIN_XLAYER;
uint256 destChainId = CHAIN_ARBITRUM;
address destSafeMultiSig = 0x60C7A25703f69a5f3fB77c694B938661761f728a; // guardian
// END

Expand Down
10 changes: 2 additions & 8 deletions scripts/proposals/Wrapper.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ contract Wrapper is Utils {
uint256 chainId
) internal returns (uint256 gas) {
vm.selectFork(forkIdentifier[chainId]);
TimelockControllerWithCounter timelock = TimelockControllerWithCounter(
payable(_chainToContract(chainId, ContractType.Timelock))
);

address sender = _chainToContract(CHAIN_SOURCE, ContractType.ProposalSender);
address receiver = _chainToContract(chainId, ContractType.ProposalReceiver);
Expand Down Expand Up @@ -172,8 +169,6 @@ contract Wrapper is Utils {
prop
);
chainIds[finalPropLength] = chainId;
finalPropLength += 1;
i += count;
} else {
vm.selectFork(forkIdentifier[chainId]);
(address target, uint256 value, bytes memory data) = wrapTimelock(chainId, prop);
Expand Down Expand Up @@ -211,10 +206,9 @@ contract Wrapper is Utils {
);

values[finalPropLength] = (nativeFee * GAS_MULTIPLIER) / BASE_GAS;

finalPropLength += 1;
i += count;
}
finalPropLength += 1;
i += count;
}
assembly ("memory-safe") {
mstore(targets, finalPropLength)
Expand Down
12 changes: 8 additions & 4 deletions scripts/proposals/payload.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"calldatas": {
"0": "0xbb5a944f00000000000000000000000000000000000000000000000000000000000000b7000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000011c00000000000000000000000000000000000000000000000000000000000001140000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d23b51d6f2cb3ec7ca9599d4332a2f10c3cfdf8500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000f648f2a0bb000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001517f000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000840b25c87b626a259ca5ac32124fa752f0230a720000000000000000000000001d941ef0d3bba4ad67dbfbcee5262f4cee53a32b0000000000000000000000000022228a2cc5e7ef0274a7baa600d44da5ab57760000000000000000000000001d941ef0d3bba4ad67dbfbcee5262f4cee53a32b000000000000000000000000004626a008b1acdc4c74ab51644093b155e59a230000000000000000000000001d941ef0d3bba4ad67dbfbcee5262f4cee53a32b0000000000000000000000001a7e4e63778b4f12a199c062f3efdd288afcbce80000000000000000000000001d941ef0d3bba4ad67dbfbcee5262f4cee53a32b0000000000000000000000000000206329b97db379d5e1bf586bbdb969c63274000000000000000000000000840b25c87b626a259ca5ac32124fa752f0230a720000000000000000000000000022228a2cc5e7ef0274a7baa600d44da5ab57760000000000000000000000000022228a2cc5e7ef0274a7baa600d44da5ab5776000000000000000000000000f1ddcaca7d17f8030ab2eb54f2d9811365efe123000000000000000000000000004626a008b1acdc4c74ab51644093b155e59a23000000000000000000000000004626a008b1acdc4c74ab51644093b155e59a23000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000006c00000000000000000000000000000000000000000000000000000000000000740000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000a200000000000000000000000000000000000000000000000000000000000000024800096300000000000000000000000004b1e2c2762667331bc91648052f646d1b0d3598400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004499a88ec40000000000000000000000000022228a2cc5e7ef0274a7baa600d44da5ab57760000000000000000000000002c28bd22ab59341892e85ad76d159d127c4b03fa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c45a44621500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b5374616b656420555344410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005737455534400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004499a88ec4000000000000000000000000004626a008b1acdc4c74ab51644093b155e59a230000000000000000000000002c28bd22ab59341892e85ad76d159d127c4b03fa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c45a44621500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b5374616b656420455552410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005737445555200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004499a88ec40000000000000000000000001a7e4e63778b4f12a199c062f3efdd288afcbce8000000000000000000000000c42b7a34cb37ee450cc8059b10d839e4753229d50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c45a44621500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000445555241000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004455552410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004499a88ec40000000000000000000000000000206329b97db379d5e1bf586bbdb969c63274000000000000000000000000c42b7a34cb37ee450cc8059b10d839e4753229d50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c45a446215000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004555344410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045553444100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024983b2d560000000000000000000000000022228a2cc5e7ef0274a7baa600d44da5ab5776000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024aa4abe7f00000000000000000000000000000000000000000000000094118d90c3e630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247ee84349000000000000000000000000a9bbbdde822789f123667044443dc7001fb43c01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024983b2d56000000000000000000000000004626a008b1acdc4c74ab51644093b155e59a23000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024aa4abe7f00000000000000000000000000000000000000000000000029f13ee872f918000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247ee84349000000000000000000000000a9bbbdde822789f123667044443dc7001fb43c01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000220001000000000000000000000000000000000000000000000000000000000005f4e7000000000000000000000000000000000000000000000000000000000000"
"0": "0xf2fde38b000000000000000000000000dc4e6dfe07efca50a197df15d9200883ef4eb1c8",
"1": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000c462dbb9ec8cd1630f1728b2cfd2769d09f0dd500000000000000000000000009d81464c7293c774203e46e3c921559c8e9d53f00000000000000000000000009d81464c7293c774203e46e3c921559c8e9d53f00000000000000000000000009d81464c7293c774203e46e3c921559c8e9d53f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000004c40d2be80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000442f2ff15db09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1000000000000000000000000dc4e6dfe07efca50a197df15d9200883ef4eb1c80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000442f2ff15dfd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f783000000000000000000000000dc4e6dfe07efca50a197df15d9200883ef4eb1c8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044d547741fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1000000000000000000000000748ba9cd5a5ddba5aba70a4ac861b2413dca443600000000000000000000000000000000000000000000000000000000"
},
"chainIds": {
"0": 59144
"0": 1,
"1": 1
},
"description": "ipfs://QmS6WCqc8pA44jJKFyXw8en1qDKkiXCdGPsWamruQyeSY2",
"targets": {
"0": "0x896D64B4B7265273dDCD00808f3579563f9790A8"
"0": "0x896D64B4B7265273dDCD00808f3579563f9790A8",
"1": "0x09D81464c7293C774203E46E3C921559c8E9D53f"
},
"values": {
"0": 710587509144021
"0": 0,
"1": 0
}
}
106 changes: 106 additions & 0 deletions scripts/proposals/veANGLE/KillveANGLE.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;

import { console } from "forge-std/console.sol";
import { Wrapper } from "../Wrapper.s.sol";
import "../../Constants.s.sol";
import { ProxyAdmin } from "oz/proxy/transparent/ProxyAdmin.sol";

contract KillveANGLE is Wrapper {
SubCall[] private subCalls;
uint256 public constant chainId = CHAIN_ETHEREUM;

function run() external {
vm.selectFork(forkIdentifier[chainId]);
address veANGLE = 0x0C462Dbb9EC8cD1630f1728B2CFD2769d09f0dd5;
address timelock = 0x09D81464c7293C774203E46E3C921559c8E9D53f;
address proposalSender = 0x896D64B4B7265273dDCD00808f3579563f9790A8;
address onchainGovernorContract = 0x748bA9Cd5a5DDba5ABA70a4aC861b2413dCa4436;
address govMultisig = 0xdC4e6DFe07EFCa50a197DF15D9200883eF4Eb1c8;

// Activate veANGLE emergency withdrawal
subCalls.push(SubCall(chainId, veANGLE, 0, abi.encodeWithSelector(IVeAngle.set_emergency_withdrawal.selector)));

// Granting the proposer role to governance msig
subCalls.push(
SubCall(
chainId,
timelock,
0,
abi.encodeWithSelector(
IAccessControl.grantRole.selector,
TimelockController(payable(timelock)).PROPOSER_ROLE(),
govMultisig
)
)
);

// Granting the canceller role to governance msig
subCalls.push(
SubCall(
chainId,
timelock,
0,
abi.encodeWithSelector(
IAccessControl.grantRole.selector,
TimelockController(payable(timelock)).CANCELLER_ROLE(),
govMultisig
)
)
);

// Revoking the proposer role to the governor contract
subCalls.push(
SubCall(
chainId,
timelock,
0,
abi.encodeWithSelector(
IAccessControl.revokeRole.selector,
TimelockController(payable(timelock)).PROPOSER_ROLE(),
onchainGovernorContract
)
)
);

// TODO: change description

string memory description = "ipfs://QmS6WCqc8pA44jJKFyXw8en1qDKkiXCdGPsWamruQyeSY2";

(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
uint256[] memory chainIds2
) = _wrap(subCalls);

// Create new arrays with length + 1
address[] memory newTargets = new address[](targets.length + 1);
uint256[] memory newValues = new uint256[](values.length + 1);
bytes[] memory newCalldatas = new bytes[](calldatas.length + 1);
uint256[] memory newChainIds = new uint256[](chainIds2.length + 1);

// Need to switch proposalSender owner

newTargets[0] = proposalSender;
newValues[0] = 0;
newCalldatas[0] = abi.encodeWithSelector(IOwnable.transferOwnership.selector, govMultisig);
newChainIds[0] = 1;

// Copy the rest of the elements
for (uint256 i = 0; i < targets.length; i++) {
newTargets[i + 1] = targets[i];
newValues[i + 1] = values[i];
newCalldatas[i + 1] = calldatas[i];
newChainIds[i + 1] = chainIds2[i];
}

// Reassign the arrays
targets = newTargets;
values = newValues;
calldatas = newCalldatas;
chainIds2 = newChainIds;

_serializeJson(targets, values, calldatas, chainIds2, description);
}
}
Loading
Loading