Skip to content

Commit

Permalink
fix: N-04 Unsafe ABI Encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kelemeno committed Oct 25, 2024
1 parent fcec3d3 commit b826864
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/contracts/governance/PermanentRestriction.sol
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

0 comments on commit b826864

Please sign in to comment.