Skip to content

Commit 9ef5981

Browse files
authored
contracts-bedrock: weth predeploy version (ethereum-optimism#10441)
Updates the weth predeploy to be versioned. Even though the weth predeploy is not proxied, adding a version safely lets us make small modifications to it in the future such as updating the version of `solc` that is used to compile it and be able to be aware offchain of the version that the chain has without needing to keep a registry of codehashes.
1 parent 6471017 commit 9ef5981

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

packages/contracts-bedrock/semver-lock.json

+4
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@
9999
"initCodeHash": "0xd62e193d89b1661d34031227a45ce1eade9c2a89b0bd7f362f511d03cceef294",
100100
"sourceCodeHash": "0xa304b4b556162323d69662b4dd9a1d073d55ec661494465489bb67f1e465e7b3"
101101
},
102+
"src/L2/WETH.sol": {
103+
"initCodeHash": "0xde72ae96910e95249623c2d695749847e4c4adeaf96a7a35033afd77318a528a",
104+
"sourceCodeHash": "0xbe200a6cb297a3ca1a7d174a9c886e3f17eb8edf617ad014a2ac4f6c2e2ac7f1"
105+
},
102106
"src/Safe/DeputyGuardianModule.sol": {
103107
"initCodeHash": "0x433eb7488e613a51c7ff05a76bbecf47f5beac8b8614f5c50001f99e39ae7ed2",
104108
"sourceCodeHash": "0x2919835fc15c166a027b2ff1cf801c847f139948baf2df0db3d02ac3017c09d9"

packages/contracts-bedrock/snapshots/abi/WETH.json

+13
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,19 @@
186186
"stateMutability": "nonpayable",
187187
"type": "function"
188188
},
189+
{
190+
"inputs": [],
191+
"name": "version",
192+
"outputs": [
193+
{
194+
"internalType": "string",
195+
"name": "",
196+
"type": "string"
197+
}
198+
],
199+
"stateMutability": "view",
200+
"type": "function"
201+
},
189202
{
190203
"inputs": [
191204
{

packages/contracts-bedrock/src/L2/WETH.sol

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ pragma solidity 0.8.15;
44
import { WETH98 } from "src/dispute/weth/WETH98.sol";
55
import { Predeploys } from "src/libraries/Predeploys.sol";
66
import { L1Block } from "src/L2/L1Block.sol";
7+
import { ISemver } from "src/universal/ISemver.sol";
78

89
/// @title WETH contract that reads the name and symbol from the L1Block contract.
910
/// Allows for nice rendering of token names for chains using custom gas token.
10-
contract WETH is WETH98 {
11+
contract WETH is WETH98, ISemver {
12+
/// @custom:semver 1.0.0
13+
string public constant version = "1.0.0";
14+
1115
/// @notice Returns the name of the wrapped native asset. Will be "Wrapped Ether"
1216
/// if the native asset is Ether.
1317
function name() external view override returns (string memory name_) {

0 commit comments

Comments
 (0)