From 3324edecb934eab35bd236b456f18ef301ded9a2 Mon Sep 17 00:00:00 2001 From: Khimesh Dewangan Date: Sat, 11 Jul 2026 21:12:45 +0530 Subject: [PATCH] fix(l2genesis): correct WETH initialization docs in setWETH() Updates NatSpec comment on setWETH() to accurately reflect WETH98 uses constants and pure functions with no constructor-side effects. Closes #357. --- scripts/L2Genesis.s.sol | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/L2Genesis.s.sol b/scripts/L2Genesis.s.sol index 46bb72bf..ac058df0 100644 --- a/scripts/L2Genesis.s.sol +++ b/scripts/L2Genesis.s.sol @@ -275,10 +275,15 @@ contract L2Genesis is Script { } /// @notice This predeploy is following the safety invariant #1. - /// This contract is NOT proxied and the state that is set - /// in the constructor is set manually. + /// This contract is NOT proxied. vm.getDeployedCode with vm.etch is used + /// because WETH98 has no immutables and no constructor-side effects. + /// decimals is a constant (compiled into bytecode), name/symbol are + /// pure/virtual functions, and the only storage slots are _balanceOf + /// (slot 0) and _allowance (slot 1) mappings which correctly start empty. function setWETH() internal { vm.etch(Predeploys.WETH, vm.getDeployedCode("WETH.sol:WETH")); + // WETH98 uses constants and pure functions for name/symbol/decimals, + // so there are no constructor-side effects to reinitialize via vm.store. } /// @notice This predeploy is following the safety invariant #2.