Changing the abi.encode function to abi.encodePacked 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.
L1GraphTokenGateway.sol:249: return abi.encode(seqNum);
L1GraphTokenGateway.sol:342: abi.encode(emptyBytes, _data)
GraphTokenUpgradeable.sol:88: abi.encode(PERMIT_TYPEHASH, _owner, _spender, _value, nonces[_owner], _deadline)
GraphTokenUpgradeable.sol:162: abi.encode(
L2GraphTokenGateway.sol:174: return abi.encode(id);
L2GraphTokenGateway.sol:275: abi.encode(0, _data) // we don't need to track exitNums (b/c we have no fast exits) so we always use 0
[G-1] Variable == false|0 -> !variable or variable == true -> variable
[G-2] Use
!= 0
instead of> 0
[G-3] Use
abi.encodePacked
for gas optimizationChanging the abi.encode function to abi.encodePacked 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.