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: 14/27
Findings: 2
Award: $245.24
🌟 Selected for report: 2
🚀 Solo Findings: 0
🌟 Selected for report: Tomio
0.8082 LPT - $29.97
82.4134 USDC - $82.41
Tomio
expensive gas
https://github.com/livepeer/arbitrum-lpt-bridge/blob/main/contracts/L1/gateway/L1LPTGateway.sol#L227
Remix
change to bytes memory emptyBytes;
#0 - yondonfu
2022-01-31T23:46:02Z
🌟 Selected for report: Tomio
0.8082 LPT - $29.97
82.4134 USDC - $82.41
Tomio
save in memory can save more gas instead of double storage call
Remix
add l2SupplyFromL1
to memory
example:
uint256 savel2SupplyFromL1 = l2SupplyFromL1; if (_amount > savel2SupplyFromL1) { savel2SupplyFromL1 = 0; } else { savel2SupplyFromL1 -= _amount; }
#0 - yondonfu
2022-01-31T23:46:24Z
0.1473 LPT - $5.46
15.0198 USDC - $15.02
Tomio
Expensive gas
Remix
call balance instead of address(this).balance can save gas
function withdrawETHToL1Migrator() external onlyL1Migrator returns (uint256) { uint256 balance = address(this).balance; // call() should be safe from re-entrancy here because the L1Migrator and l1MigratorAddr are trusted (bool ok, ) = l1MigratorAddr.call.value(balance)(""); require(ok, "BridgeMinter#withdrawETHToL1Migrator: FAIL_CALL"); return balance; }
#0 - yondonfu
2022-01-23T00:53:32Z