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

fix: N-04 Unsafe ABI Encoding #989

Draft
wants to merge 2 commits into
base: library-fix-review
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix: N-04 Unsafe ABI Encoding
  • Loading branch information
kelemeno committed Oct 25, 2024
commit 780b0277f0c09d262b0774cc51f6db03a4efeed0
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ contract PermanentRestriction is IRestriction, IPermanentRestriction, Ownable2St

// Note, that we do not use an explicit call here to ensure that the function does not panic in case of
// incorrect `_chain` address.
(bool success, bytes memory data) = _chain.staticcall(abi.encodeWithSelector(IGetters.getChainId.selector));
(bool success, bytes memory data) = _chain.staticcall(abi.encodeCall(IGetters.getChainId));
if (!success || data.length < 32) {
revert NotAHyperchain(_chain);
}
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/upgrades/GatewayUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract GatewayUpgrade is BaseZkSyncUpgrade, Initializable {
);
// slither-disable-next-line controlled-delegatecall
(bool success, ) = THIS_ADDRESS.delegatecall(
abi.encodeWithSelector(IGatewayUpgrade.upgradeExternal.selector, proposedUpgrade)
abi.encodeCall(IGatewayUpgrade.upgradeExternal, proposedUpgrade)
);
// solhint-disable-next-line gas-custom-errors
require(success, "GatewayUpgrade: upgrade failed");
Expand Down
Loading