Skip to content
Closed
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
115 changes: 115 additions & 0 deletions script/NoDelayTimelock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.12;

/// @notice Modified version of our mainnet timelock for use on Holesky
/// Specifically, this removes SafeMath and changes `MINIMUM_DELAY` to `0 days`
///
/// See original version here: https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/Timelock.sol
contract NoDelayTimelock {

event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint indexed newDelay);
event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);

uint public constant GRACE_PERIOD = 14 days;
uint public constant MINIMUM_DELAY = 0;
uint public constant MAXIMUM_DELAY = 30 days;

address public admin;
address public pendingAdmin;
uint public delay;

mapping (bytes32 => bool) public queuedTransactions;


constructor(address admin_, uint delay_) {
require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");

admin = admin_;
delay = delay_;
}

fallback() external payable { }

receive() external payable { }

function setDelay(uint delay_) public {
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
delay = delay_;

emit NewDelay(delay);
}

function acceptAdmin() public {
require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
admin = msg.sender;
pendingAdmin = address(0);

emit NewAdmin(admin);
}

function setPendingAdmin(address pendingAdmin_) public {
require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
pendingAdmin = pendingAdmin_;

emit NewPendingAdmin(pendingAdmin);
}

function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {
require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
require(eta >= getBlockTimestamp() + delay, "Timelock::queueTransaction: Estimated execution block must satisfy delay.");

bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = true;

emit QueueTransaction(txHash, target, value, signature, data, eta);
return txHash;
}

function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public {
require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin.");

bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = false;

emit CancelTransaction(txHash, target, value, signature, data, eta);
}

function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) {
require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin.");

bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued.");
require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock.");
require(getBlockTimestamp() <= eta + GRACE_PERIOD, "Timelock::executeTransaction: Transaction is stale.");

queuedTransactions[txHash] = false;

bytes memory callData;

if (bytes(signature).length == 0) {
callData = data;
} else {
callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);
}

// solium-disable-next-line security/no-call-value
(bool success, bytes memory returnData) = target.call{value: value}(callData);
require(success, "Timelock::executeTransaction: Transaction execution reverted.");

emit ExecuteTransaction(txHash, target, value, signature, data, eta);

return returnData;
}

function getBlockTimestamp() internal view returns (uint) {
// solium-disable-next-line security/no-block-members
return block.timestamp;
}
}
18 changes: 13 additions & 5 deletions script/configs/holesky.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
"pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7",
"pauserRegistry": "0x85Ef7299F8311B25642679edBF02B62FA2212F06",
"proxyAdmin": "0xDB023566064246399b4AE851197a97729C93A6cf",
"timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D"
"timelock": "0xFddd03C169E3FD9Ea4a9548dDC4BedC6502FE239",
"foundationMultisig": "0x7Cb5d96A8D67304E51E022979Eb9C63a17484076",
"timelockController": "0x5e83c7d195318A5acf46B29E5810DdC323b2F6fD",
"timelockController_BEIGEN": "0xE4Babe38afBdc3F67B3E179519F0277c75D0E537",
"protocolCouncilMultisig": "0xd140eE77d9e62901d8cEFf199d3ef4Dd1F4Eaff4",
"beigenExecutorMultisig": "0xe5806869775B50a4938F9553759Ba609C02D5e63"
},
"core": {
"avsDirectory": {
Expand All @@ -41,7 +46,7 @@
},
"rewardsCoordinator": {
"proxy": "0xAcc1fb458a1317E886dB376Fc8141540537E68fE",
"impl": "0x1a17df4170099577b79038fd310f3ff62f79752e",
"impl": "0x1131D88143a35011E35263b43eC66cDd27025584",
"pendingImpl": "0x0000000000000000000000000000000000000000"
},
"slasher": {
Expand Down Expand Up @@ -106,19 +111,22 @@
"proxy": "0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27",
"impl": "0x4500927874Ad41538c1bEF2F5278E7a86DF6bce8",
"pendingImpl": "0x0000000000000000000000000000000000000000",
"proxyAdmin": "0x67482666771e82c9a73bb9e9a22b2b597f448bbf"
"proxyAdmin": "0x6B04F84780CdD42d02b079d1e7a36887bBff8679",
"timelockController": "0x1554003905e391d99126fF6b9f4ef6A425D8004a"
},
"EIGEN": {
"proxy": "0x3B78576F7D6837500bA3De27A60c7f594934027E",
"impl": "0x083bC9e0DCF2C3e13E24686e5202232995578c5a",
"pendingImpl": "0x0000000000000000000000000000000000000000",
"proxyAdmin": "0x67482666771e82c9a73bb9e9a22b2b597f448bbf"
"proxyAdmin": "0x67482666771e82c9a73bb9e9a22b2b597f448bbf",
"timelockController": "0xf74BAF5e332D4B5F65cB85F863466d745a74918e"
},
"eigenStrategy": {
"proxy": "0x43252609bff8a13dFe5e057097f2f45A24387a84",
"impl": "0x94650e09a471CEF96e7966cabf26718FBf352697",
"pendingImpl": "0x0000000000000000000000000000000000000000"
}
}
},
"emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2"
}
}
18 changes: 13 additions & 5 deletions script/configs/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
"pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390",
"pauserRegistry": "0x0c431C66F4dE941d089625E5B423D00707977060",
"proxyAdmin": "0x8b9566AdA63B64d1E1dcF1418b43fd1433b72444",
"timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF"
"timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF",
"foundationMultisig": "0xbb00DDa2832850a43840A3A86515E3Fe226865F2",
"timelockController": "0xC06Fd4F821eaC1fF1ae8067b36342899b57BAa2d",
"timelockController_BEIGEN": "0x738130BC8eADe1Bc65A9c056DEa636835896bc53",
"protocolCouncilMultisig": "0x461854d84Ee845F905e0eCf6C288DDEEb4A9533F",
"beigenExecutorMultisig": "0x942eaF324971440384e4cA0ffA39fC3bb369D67d"
},
"core": {
"avsDirectory": {
Expand All @@ -41,7 +46,7 @@
},
"rewardsCoordinator": {
"proxy": "0x7750d328b314EfFa365A0402CcfD489B80B0adda",
"impl": "0x5bf7c13D5FAdba224ECB3D5C0a67A231D1628785",
"impl": "0xb6738A8E7793D44c5895B6A6F2a62F6bF86Ba8d2",
"pendingImpl": "0x0000000000000000000000000000000000000000"
},
"slasher": {
Expand Down Expand Up @@ -106,19 +111,22 @@
"proxy": "0x83E9115d334D248Ce39a6f36144aEaB5b3456e75",
"impl": "0xB91c69Af3eE022bd0a59Da082945914BFDcEFFE3",
"pendingImpl": "0x0000000000000000000000000000000000000000",
"proxyAdmin": "0x3f5Ab2D4418d38568705bFd6672630fCC3435CC9"
"proxyAdmin": "0x3f5Ab2D4418d38568705bFd6672630fCC3435CC9",
"timelockController": "0xd6EC41E453C5E7dA5494f4d51A053Ab571712E6f"
},
"EIGEN": {
"proxy": "0xec53bf9167f50cdeb3ae105f56099aaab9061f83",
"impl": "0x7ec354c84680112d3cff1544ec1eb19ca583700b",
"pendingImpl": "0x0000000000000000000000000000000000000000",
"proxyAdmin": "0xB8915E195121f2B5D989Ec5727fd47a5259F1CEC"
"proxyAdmin": "0xB8915E195121f2B5D989Ec5727fd47a5259F1CEC",
"timelockController": "0x2520C6b2C1FBE1813AB5c7c1018CDa39529e9FF2"
},
"eigenStrategy": {
"proxy": "0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7",
"impl": "0x27e7a3a81741b9fcc5ad7edcbf9f8a72a5c00428",
"pendingImpl": "0x0000000000000000000000000000000000000000"
}
}
},
"emptyContract": "0x1f96861fEFa1065a5A96F20Deb6D8DC3ff48F7f9"
}
}
80 changes: 0 additions & 80 deletions script/configs/mainnet/mainnet-addresses.config.json

This file was deleted.

26 changes: 17 additions & 9 deletions script/configs/preprod.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@
},
"deployment": {
"admin": {
"communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479",
"executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479",
"operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479",
"pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479",
"communityMultisig": "0x42789cCdE6486b81c7D41Fa3759A8BB74D7909DB",
"executorMultisig": "0x84E5e0D6f6c3153057bd5d661Be1ff1766cEac08",
"operationsMultisig": "0x6d609cD2812bDA02a75dcABa7DaafE4B20Ff5608",
"pauserMultisig": "0x546D3b66B27dCb94777d7eFC3825b10675FE5D95",
"pauserRegistry": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1",
"proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B",
"timelock": "0x0000000000000000000000000000000000000000"
"timelock": "0x079D1e99a13EF1D01475c71A2AD43ff1cB971968",
"foundationMultisig": "0x9c36f012585c8bb4247eEe18C01Cdfc5f2e90336",
"timelockController": "0x7c66A1e862E11C4887270aBd649157ACe837A2D0",
"timelockController_BEIGEN": "0x68fa0fB9eDe34745C41d85E2766ee32eBc6cEF0e",
"protocolCouncilMultisig": "0x314A6B61B5CBFA79dc7b2c0416e039822E886b54",
"beigenExecutorMultisig": "0xFbb2c01A19A85c4C648186a97d879EEA25cE1397"
},
"core": {
"avsDirectory": {
Expand All @@ -42,7 +47,7 @@
},
"rewardsCoordinator": {
"proxy": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0",
"impl": "0x7523b42b081C30fA245AA4039c645e36746fC400",
"impl": "0xe1200ACdeC6aEf63005bba5F0f48cd719CC37040",
"pendingImpl": "0x0000000000000000000000000000000000000000"
},
"slasher": {
Expand Down Expand Up @@ -108,19 +113,22 @@
"proxy": "0xA72942289a043874249E60469F68f08B8c6ECCe8",
"impl": "0xd5FdabDac3d8ACeAB7BFfDDFA18877A4c5D5Aa82",
"pendingImpl": "0x0000000000000000000000000000000000000000",
"proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B"
"proxyAdmin": "0xA518479dd419ad182746B231920A314B4b1b64f5",
"timelockController": "0xeB3DEac9d24660921aFfEEEA9ee8aB81C623da10"
},
"EIGEN": {
"proxy": "0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926",
"impl": "0x95a7431400F362F3647a69535C5666cA0133CAA0",
"pendingImpl": "0x0000000000000000000000000000000000000000",
"proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B"
"proxyAdmin": "0x3D8E4aa92Cba327226273DF0b565A2b0AD112deF",
"timelockController": "0x313360df34C8896ED117e863e7B2F2d4Aa7727FA"
},
"eigenStrategy": {
"proxy": "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2",
"impl": "0x59D13E7Fb0bC0e57c1fc6594ff701592A6e4dD2B",
"pendingImpl": "0x0000000000000000000000000000000000000000"
}
}
},
"emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2"
}
}
Loading
Loading