From f656aa7e6d334359ea644419de68b226fc9f0f60 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 24 Oct 2024 14:58:52 +0800 Subject: [PATCH 1/2] slightly improve address manager's init function --- .../protocol/contracts/shared/common/AddressManager.sol | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/protocol/contracts/shared/common/AddressManager.sol b/packages/protocol/contracts/shared/common/AddressManager.sol index ad064952fe2..d16e9f97c55 100644 --- a/packages/protocol/contracts/shared/common/AddressManager.sol +++ b/packages/protocol/contracts/shared/common/AddressManager.sol @@ -24,10 +24,9 @@ contract AddressManager is EssentialContract, IAddressManager { error AM_ADDRESS_ALREADY_SET(); /// @notice Initializes the contract. - /// @param _owner The owner of this contract. msg.sender will be used if this value is zero. - function init(address _owner) external initializer { - __Essential_init(_owner); - addressManager = address(this); + /// @param _owner The owner of this contract. + function init(address _owner) external reinitializer(2) { + __Essential_init(_owner, address(this)); } function init2() external onlyOwner reinitializer(2) { From 7afce44f4356ac5b741fd4a66e572cfb782048e7 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 24 Oct 2024 15:04:39 +0800 Subject: [PATCH 2/2] more --- packages/protocol/contracts/layer1/based/TaikoL1.sol | 2 +- packages/protocol/contracts/shared/bridge/Bridge.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/TaikoL1.sol b/packages/protocol/contracts/layer1/based/TaikoL1.sol index c9bf899783e..9864fd037fc 100644 --- a/packages/protocol/contracts/layer1/based/TaikoL1.sol +++ b/packages/protocol/contracts/layer1/based/TaikoL1.sol @@ -49,7 +49,7 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents { bool _toPause ) external - initializer + reinitializer(2) { __Essential_init(_owner, _rollupAddressManager); LibUtils.init(state, getConfig(), _genesisBlockHash); diff --git a/packages/protocol/contracts/shared/bridge/Bridge.sol b/packages/protocol/contracts/shared/bridge/Bridge.sol index d160c5a7436..813445ef678 100644 --- a/packages/protocol/contracts/shared/bridge/Bridge.sol +++ b/packages/protocol/contracts/shared/bridge/Bridge.sol @@ -104,7 +104,7 @@ contract Bridge is EssentialContract, IBridge { /// @notice Initializes the contract. /// @param _owner The owner of this contract. msg.sender will be used if this value is zero. /// @param _sharedAddressManager The address of the {AddressManager} contract. - function init(address _owner, address _sharedAddressManager) external initializer { + function init(address _owner, address _sharedAddressManager) external reinitializer(2) { __Essential_init(_owner, _sharedAddressManager); }