You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the initialize function in the constructor() while passing address(0) as parameters will render contract unusable.
Summary
Passing address(0) as parameters when calling the initialize function from the constructor(0) will lock the contract and the right addresses cannot be set again.
Vulnerability Detail
The bug affects; L2StandardBridge.sol, L1StandardBridge.sol, L1crossDomainMessenger.sol and L2crossDomainMessenger.sol and optimismportal2.sol. The initialie() function in these contracts implements the initializer modifier which ensures that the initialize function can only be called once. The bug here is that the initialize function is called in the constructor() using null addresses as parameters and since the initialize function cannot be called again, the contract becomes locked.
Impact
Contracts are initialized with the zero address which renders them unusable.
Use proper addresses in initializing the contracts instead of the zero address
The text was updated successfully, but these errors were encountered:
sherlock-admin4
changed the title
Faint Chartreuse Pelican - Calling the initialize function in the constructor() while passing address(0) as parameters will render contract unusable.
oxchryston - Calling the initialize function in the constructor() while passing address(0) as parameters will render contract unusable.
Oct 12, 2024
oxchryston
Medium
Calling the initialize function in the constructor() while passing address(0) as parameters will render contract unusable.
Summary
Passing address(0) as parameters when calling the
initialize
function from the constructor(0) will lock the contract and the right addresses cannot be set again.Vulnerability Detail
The bug affects; L2StandardBridge.sol, L1StandardBridge.sol, L1crossDomainMessenger.sol and L2crossDomainMessenger.sol and optimismportal2.sol. The
initialie()
function in these contracts implements theinitializer
modifier which ensures that the initialize function can only be called once. The bug here is that the initialize function is called in the constructor() using null addresses as parameters and since the initialize function cannot be called again, the contract becomes locked.Impact
Contracts are initialized with the zero address which renders them unusable.
Code Snippet
Code Links
https://github.com/sherlock-audit/2024-08-tokamak-network/blob/main/tokamak-thanos/packages/tokamak/contracts-bedrock/src/L1/OptimismPortal2.sol#L153
https://github.com/sherlock-audit/2024-08-tokamak-network/blob/main/tokamak-thanos/packages/tokamak/contracts-bedrock/src/L1/OptimismPortal2.sol#L169
Tool used
Manual Review
Recommendation
Use proper addresses in initializing the contracts instead of the zero address
The text was updated successfully, but these errors were encountered: