Skip to content

Commit

Permalink
Merge pull request #194 from etherfi-protocol/syko/operations/20241025
Browse files Browse the repository at this point in the history
[Operation] whitelist a few functions of DelegationManager to delegate
  • Loading branch information
seongyun-ko authored Oct 25, 2024
2 parents ebd3271 + ac03679 commit 6825721
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
49 changes: 49 additions & 0 deletions operations/20241025_whitelist_DelegationManager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ "version": "1.0", "chainId": "1", "meta": { "name": "Transactions Batch", "description": "", "txBuilderVersion": "1.16.5", "createdFromSafeAddress": "0xcdd57D11476c22d265722F68390b036f3DA48c21" }, "transactions": [
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x01d5062a0000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000064c7f61eeceea9064b0000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x134008d30000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064c7f61eeceea9064b0000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x01d5062a0000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000064c7f61eec7f5480710000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x134008d30000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064c7f61eec7f5480710000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x01d5062a0000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000064c7f61eecda8be8640000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x134008d30000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064c7f61eecda8be8640000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x01d5062a0000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000064c7f61eec0dd8dd020000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x134008d30000000000000000000000008b71140ad2e5d1e7018d2a7f8a288bd3cd38916f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064c7f61eec0dd8dd020000000000000000000000000000000000000000000000000000000000000000000000000000000039053d51b77dc0d36036fc1fcc8cb819df8ef37a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
}
] }
31 changes: 31 additions & 0 deletions test/EtherFiTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,37 @@ contract TimelockTest is TestSetup {
_execute_timelock(target, data, true, true, true, true);
}
}

function test_whitelist_DelegationManager() public {
initializeRealisticFork(MAINNET_FORK);
address target = address(managerInstance);
bytes4[] memory selectors = new bytes4[](4);

// https://etherscan.io/address/0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A#writeProxyContract
selectors[0] = 0xeea9064b; // delegateTo
selectors[1] = 0x7f548071; // delegateToBySignature
selectors[2] = 0xda8be864; // undelegate
selectors[3] = 0x0dd8dd02; // queueWithdrawals

for (uint256 i = 0; i < selectors.length; i++) {
bytes memory data = abi.encodeWithSelector(EtherFiNodesManager.updateAllowedForwardedExternalCalls.selector, selectors[i], 0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A, true);
_execute_timelock(target, data, true, true, true, true);
}

vm.startPrank(owner);
IDelegationManager.SignatureWithExpiry memory signatureWithExpiry;
address delegationManager = 0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A;
uint256[] memory validatorIds = new uint256[](1);
bytes[] memory data = new bytes[](1);
validatorIds[0] = 65536;
data[0] = abi.encodeWithSelector(selectors[0], 0x67943aE8e07bFC9f5C9A90d608F7923D9C21e051, signatureWithExpiry, bytes32(0));
managerInstance.forwardExternalCall(validatorIds, data, delegationManager);

data[0] = abi.encodeWithSelector(selectors[2], managerInstance.etherfiNodeAddress(validatorIds[0]));
managerInstance.forwardExternalCall(validatorIds, data, delegationManager);

vm.stopPrank();
}
}

// {"version":"1.0","chainId":"1

0 comments on commit 6825721

Please sign in to comment.