Changing the abi.encode function to abi.encodePacked at line 355 of L1Migrator can save gas since the abi.encode function pads extra null bytes at the end of the call data, which is unnecessary. Also, in general, abi.encodePacked is more gas-efficient.
Handle
defsec
Vulnerability details
Impact
Changing the abi.encode function to abi.encodePacked at line 355 of L1Migrator can save gas since the abi.encode function pads extra null bytes at the end of the call data, which is unnecessary. Also, in general, abi.encodePacked is more gas-efficient.
Proof of Concept
https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L1/gateway/L1Migrator.sol#L355
Tools Used
Code Review
Recommended Mitigation Steps
Change abi.encode to abi.encodePacked at line 355.