Commit 0ed1ac11 authored by Mark Tyneway's avatar Mark Tyneway Committed by Maurelian

contracts-bedrock: L2StandardBridge `initialize()`

Adds an `initialize()` function to the `L2StandardBridge`
implementation. This standardizes on having noop init functions
for L2 contracts. They are set in genesis state directly so the initialize
function should never execute. Keeping it there is more transparent.
Otherwise one may forget that it is initializable. The `_initialized`
storage slot MUST be set during L2 genesis generation.
parent afbe2e89
This diff is collapsed.
...@@ -523,6 +523,13 @@ ...@@ -523,6 +523,13 @@
"stateMutability": "payable", "stateMutability": "payable",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "l1TokenBridge", "name": "l1TokenBridge",
......
...@@ -61,6 +61,10 @@ contract L2StandardBridge is StandardBridge, ISemver { ...@@ -61,6 +61,10 @@ contract L2StandardBridge is StandardBridge, ISemver {
StandardBridge(payable(Predeploys.L2_CROSS_DOMAIN_MESSENGER), _otherBridge) StandardBridge(payable(Predeploys.L2_CROSS_DOMAIN_MESSENGER), _otherBridge)
{ } { }
/// @notice Initializes the contract. This is a noop in the implementation but included to ensure that
/// the contract cannot be initialized a second time.
function initialize() public initializer { }
/// @notice Allows EOAs to bridge ETH by sending directly to the bridge. /// @notice Allows EOAs to bridge ETH by sending directly to the bridge.
receive() external payable override onlyEOA { receive() external payable override onlyEOA {
_initiateWithdrawal( _initiateWithdrawal(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment