Skip to content

Commit 737c0fb

Browse files
committed
Replace timelock wrappers with a calldata generator
1 parent 914de30 commit 737c0fb

11 files changed

Lines changed: 1485 additions & 2913 deletions

deploy/L2PASSpell.sol

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ contract L2PASSpell {
2727
address public immutable beamState;
2828
address public immutable configurator;
2929
address public immutable timelock;
30-
address public immutable wrapper;
3130

32-
constructor(address beamState_, address configurator_, address timelock_, address wrapper_) {
31+
constructor(address beamState_, address configurator_, address timelock_) {
3332
beamState = beamState_;
3433
configurator = configurator_;
3534
timelock = timelock_;
36-
wrapper = wrapper_;
3735
}
3836

3937
function init(
@@ -49,6 +47,5 @@ contract L2PASSpell {
4947
});
5048

5149
PASInit.init(pas, minDelay, coreCouncil, cancellers, pausers);
52-
PASInit.initTimelockWrapper(pas, wrapper, coreCouncil);
5350
}
5451
}

deploy/PASDeploy.sol

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import { PASInstance } from "./PASInstance.sol";
2121
import { BeamState } from "src/BeamState.sol";
2222
import { Configurator } from "src/Configurator.sol";
2323
import { Timelock } from "src/timelock/Timelock.sol";
24-
import { TimelockWrapperMainnet } from "src/timelock/TimelockWrapperMainnet.sol";
25-
import { TimelockWrapperForeign } from "src/timelock/TimelockWrapperForeign.sol";
24+
import { TimelockCalldataGenerator } from "src/timelock/TimelockCalldataGenerator.sol";
2625
import { PASMom } from "src/PASMom.sol";
2726

2827
library PASDeploy {
@@ -53,29 +52,13 @@ library PASDeploy {
5352
PASMom(mom).setOwner(owner);
5453
}
5554

56-
function deployTimelockWrapperMainnet(
57-
address deployer,
58-
address owner,
59-
address timelock,
60-
address beamState
61-
) internal returns (address timelockWrapperMainnet) {
62-
timelockWrapperMainnet = address(new TimelockWrapperMainnet(
63-
timelock,
64-
beamState
65-
));
66-
ScriptTools.switchOwner(timelockWrapperMainnet, deployer, owner);
67-
}
68-
69-
function deployTimelockWrapperForeign(
70-
address deployer,
71-
address owner,
55+
function deployTimelockCalldataGenerator(
7256
address timelock,
7357
address beamState
74-
) internal returns (address timelockWrapperForeign) {
75-
timelockWrapperForeign = address(new TimelockWrapperForeign(
58+
) internal returns (address timelockCalldataGenerator) {
59+
timelockCalldataGenerator = address(new TimelockCalldataGenerator(
7660
timelock,
7761
beamState
7862
));
79-
ScriptTools.switchOwner(timelockWrapperForeign, deployer, owner);
8063
}
8164
}

deploy/PASInit.sol

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ interface TimelockLike {
5555
function grantRole(bytes32, address) external;
5656
}
5757

58-
interface TimelockWrapperLike {
59-
function timelock() external view returns (address);
60-
function beamState() external view returns (address);
61-
function kiss(address) external;
62-
}
63-
6458
interface PASMomLike {
6559
function beamState() external view returns (address);
6660
function timelock() external view returns (address);
@@ -198,24 +192,4 @@ library PASInit {
198192

199193
dss.chainlog.setAddress(key, address(mom));
200194
}
201-
202-
function initTimelockWrapper(
203-
PASInstance memory pasInstance,
204-
address timelockWrapper_,
205-
address coreCouncil
206-
) internal {
207-
TimelockLike timelock = TimelockLike(pasInstance.timelock);
208-
TimelockWrapperLike timelockWrapper = TimelockWrapperLike(timelockWrapper_);
209-
210-
// --- Sanity checks ---
211-
212-
require(timelockWrapper.timelock() == pasInstance.timelock, "PASInit/wrapper-timelock-mismatch");
213-
require(timelockWrapper.beamState() == pasInstance.beamState, "PASInit/wrapper-beamState-mismatch");
214-
215-
// --- Set permissions ---
216-
217-
// Grant the coreCouncil as the proposer through the wrapper
218-
timelock.grantRole(timelock.PROPOSER_ROLE(), address(timelockWrapper));
219-
timelockWrapper.kiss(coreCouncil);
220-
}
221195
}

0 commit comments

Comments
 (0)