functions outboundTransfer and finalizeInboundTransfer in L1LPTGateway.sol and L2LPTGateway.sol have the argument address _l1Token but they require it to always be the state variable l1Lpt which makes the argument redundant since its better to just copy the variable instead of receiving it in the function arguments and than checking its validation.
Proof of Concept
having an extra argument in the function waste more gas than saving the state variable in a memory variable (instead of calldata int the function argument)
Checked on Remix, save over 300 gas every function call. which is a lot
Tools Used
Manual code review
Recommended Mitigation Steps
remove the argument from the function declaration and create a local variable and set it to l1Lpt instead
Handle
egjlmn1
Vulnerability details
Impact
functions
outboundTransfer
andfinalizeInboundTransfer
inL1LPTGateway.sol
andL2LPTGateway.sol
have the argumentaddress _l1Token
but they require it to always be the state variablel1Lpt
which makes the argument redundant since its better to just copy the variable instead of receiving it in the function arguments and than checking its validation.Proof of Concept
having an extra argument in the function waste more gas than saving the state variable in a memory variable (instead of calldata int the function argument) Checked on Remix, save over 300 gas every function call. which is a lot
Tools Used
Manual code review
Recommended Mitigation Steps
remove the argument from the function declaration and create a local variable and set it to
l1Lpt
instead