From 580660821716d94ded20e25cc69f5ffa647bc813 Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:47:24 +0530 Subject: [PATCH 1/2] Update whale address --- tests/staking/MigratorForkTest.t.sol | 6 +++++- tests/staking/ZapperForkTest.t.sol | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/staking/MigratorForkTest.t.sol b/tests/staking/MigratorForkTest.t.sol index 62fc160a..217ad230 100644 --- a/tests/staking/MigratorForkTest.t.sol +++ b/tests/staking/MigratorForkTest.t.sol @@ -23,7 +23,7 @@ contract MigratorForkTest is Test { IMintableERC20 public ogn; uint256 constant OGN_EPOCH = 1717041600; // May 30, 2024 GMT - address public ogvWhale = 0x24dD9AEAf497c11eE3A0ac2E6E6e014e12799c4E; + address public ogvWhale = 0xD066c92d5dD4fD19E7F053Cf63EBB01Aaaa233CE; constructor() { deployManager = new DeployManager(); @@ -46,6 +46,10 @@ contract MigratorForkTest is Test { ogv.approve(address(veogv), type(uint256).max); vm.stopPrank(); + vm.startPrank(Addresses.TIMELOCK); + ogn.mint(ogvWhale, 10_000_000 ether); // Mint some OGV for the whale + vm.stopPrank(); + vm.warp(OGN_EPOCH + 100 days); if (veogv.balanceOf(ogvWhale) == 0) { diff --git a/tests/staking/ZapperForkTest.t.sol b/tests/staking/ZapperForkTest.t.sol index 34942ad6..263b984d 100644 --- a/tests/staking/ZapperForkTest.t.sol +++ b/tests/staking/ZapperForkTest.t.sol @@ -51,6 +51,10 @@ contract ZapperForkTest is Test { ogv.approve(address(veogv), type(uint256).max); vm.stopPrank(); + vm.startPrank(Addresses.TIMELOCK); + ogn.mint(ogvWhale, 10_000_000 ether); // Mint some OGV for the whale + vm.stopPrank(); + vm.warp(OGN_EPOCH + 100 days); if (veogv.balanceOf(ogvWhale) == 0) { From 810e1294682518f19b6ac1f3ca70dc9f28d8944a Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:20:27 +0530 Subject: [PATCH 2/2] Tooling fixes --- contracts/utils/GovFive.sol | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/contracts/utils/GovFive.sol b/contracts/utils/GovFive.sol index 50fa84a9..37cf86f4 100644 --- a/contracts/utils/GovFive.sol +++ b/contracts/utils/GovFive.sol @@ -49,8 +49,7 @@ library GovFive { GovFiveAction memory propAction = prop.actions[i]; targets[i] = propAction.receiver; - payloads[i] = - abi.encodePacked(abi.encodePacked(bytes4(keccak256(bytes(propAction.fullsig)))), propAction.data); + payloads[i] = abi.encodePacked(bytes4(keccak256(bytes(propAction.fullsig))), propAction.data); } bytes32 salt = keccak256(bytes(prop.description)); @@ -58,17 +57,19 @@ library GovFive { TimelockController timelock = TimelockController(payable(Addresses.TIMELOCK)); receiver = Addresses.TIMELOCK; - opHash = timelock.hashOperationBatch(targets, values, payloads, hex"", salt); + opHash = timelock.hashOperationBatch(targets, values, payloads, bytes32(0), salt); if (timelock.isOperation(opHash)) { bytes4 executeSig = bytes4(keccak256(bytes("executeBatch(address[],uint256[],bytes[],bytes32,bytes32)"))); - payload = abi.encodePacked(executeSig, abi.encode(targets, values, payloads, hex"", salt)); + console.log("Yet to be exeucted."); + payload = abi.encodePacked(executeSig, abi.encode(targets, values, payloads, bytes32(0), salt)); } else { bytes4 scheduleSig = - bytes4(keccak256(bytes("scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,delay)"))); + bytes4(keccak256(bytes("scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,uint256)"))); - payload = abi.encodePacked(scheduleSig, abi.encode(targets, values, payloads, hex"", salt, 2 days)); + console.log("Yet to be scheduled."); + payload = abi.encodePacked(scheduleSig, abi.encode(targets, values, payloads, bytes32(0), salt, 2 days)); } } @@ -112,6 +113,10 @@ library GovFive { console.log("Scheduling..."); (bool success, bytes memory data) = receiver.call(payload); + if (!success || !timelock.isOperationDone(opHash)) { + revert("Failed to schedule"); + } + (receiver, payload, opHash) = getSafeTxData(prop); } @@ -124,6 +129,12 @@ library GovFive { (bool success, bytes memory data) = receiver.call(payload); + if (!success || !timelock.isOperationDone(opHash)) { + revert("Failed to execute"); + } + + console.log("Executed"); + vm.stopPrank(); }