Platform: Code4rena
Start Date: 13/01/2022
Pot Size: $75,000 USDC
Total HM: 9
Participants: 27
Period: 7 days
Judge: leastwood
Total Solo HM: 5
Id: 73
League: ETH
Rank: 16/27
Findings: 1
Award: $112.38
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: egjlmn1
0.8082 LPT - $29.97
82.4134 USDC - $82.41
egjlmn1
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.
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
Manual code review
remove the argument from the function declaration and create a local variable and set it to l1Lpt
instead
#0 - yondonfu
2022-01-24T02:37:39Z
Won't change because the arg is needed for the Arbitrum GatewayRouter contracts on L1 and L2.