Skip to content

Commit

Permalink
feat(protocol): make sure init() covers logics in init2(), `init3…
Browse files Browse the repository at this point in the history
…()`.. (#18292)
  • Loading branch information
dantaik authored Oct 25, 2024
1 parent ae0a9da commit 9d06958
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/protocol/contracts/layer1/based/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/shared/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
7 changes: 3 additions & 4 deletions packages/protocol/contracts/shared/common/AddressManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9d06958

Please sign in to comment.