Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(protocol): make sure init() covers logics in init2(), init3().. #18292

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading