Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramarti committed Dec 17, 2024
1 parent 0d3f31e commit 0ac4627
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 10 additions & 5 deletions contracts/script/GenerateAlloc.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ contract GenerateAlloc is Script {
return "./odyssey-testnet-alloc.json";
} else if (block.chainid == ChainIds.LOCAL) {
return "./local-alloc.json";
} else if (block.chainid == ChainIds.MAINNET) {
} else if (block.chainid == ChainIds.FOUNDRY) {
return "./foundry-alloc.json";
} else if (block.chainid == ChainIds.STORY_MAINNET) {
return "./mainnet-alloc.json";
} else {
revert("Unsupported chain id");
Expand All @@ -105,7 +107,10 @@ contract GenerateAlloc is Script {
} else if (block.chainid == ChainIds.LOCAL) {
// Local
return 10 seconds;
} else if (block.chainid == ChainIds.MAINNET) {
} else if (block.chainid == ChainIds.FOUNDRY) {
// Foundry
return 10 seconds;
} else if (block.chainid == ChainIds.STORY_MAINNET) {
// Mainnet
return 2 days;
} else {
Expand Down Expand Up @@ -133,7 +138,7 @@ contract GenerateAlloc is Script {
}
require(timelockGuardian != address(0), "canceller not set");

if (block.chainid == ChainIds.MAINNET) {
if (block.chainid == ChainIds.STORY_MAINNET) {
require(!KEEP_TIMELOCK_ADMIN_ROLE, "Timelock admin role not allowed on mainnet");
} else {
console2.log("Will timelock admin role be assigned?", KEEP_TIMELOCK_ADMIN_ROLE);
Expand Down Expand Up @@ -194,8 +199,7 @@ contract GenerateAlloc is Script {
/// @notice Deploy TimelockController to manage upgrades and admin actions
/// @dev this is a deterministic deployment, not a predeploy (won't show in genesis file).
function deployTimelock() internal {
// We deploy this with Create3 because we can't set storage variables in constructor with vm.etch

// WARNING: Make sure protocolAdmin and timelockGuardian are multisigs on mainnet
uint256 minDelay = getTimelockMinDelay();
address[] memory proposers = new address[](1);
proposers[0] = protocolAdmin;
Expand All @@ -208,6 +212,7 @@ contract GenerateAlloc is Script {
abi.encode(minDelay, proposers, executors, protocolAdmin)
);
bytes32 salt = keccak256("STORY_TIMELOCK_CONTROLLER");
// We deploy this with Create3 because we can't set storage variables in constructor with vm.etch
timelock = Create3(Predeploys.Create3).deploy(salt, creationCode);
vm.stopPrank();
bytes32 cancellerRole = TimelockController(payable(timelock)).CANCELLER_ROLE();
Expand Down
5 changes: 3 additions & 2 deletions contracts/script/utils/ChainIds.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
pragma solidity ^0.8.23;

library ChainIds {
uint256 public constant MAINNET = 1111; // TBD
uint256 public constant STORY_MAINNET = 1415; // TBD
uint256 public constant ILIAD = 1513;
uint256 public constant MININET = 1512;
uint256 public constant ODYSSEY_DEVNET = 1315;
uint256 public constant ODYSSEY_TESTNET = 1516;
uint256 public constant LOCAL = 31337;
uint256 public constant LOCAL = 1511;
uint256 public constant FOUNDRY = 31337;
}

0 comments on commit 0ac4627

Please sign in to comment.