Platform: Code4rena
Start Date: 05/01/2023
Pot Size: $90,500 USDC
Total HM: 55
Participants: 103
Period: 14 days
Judge: Picodes
Total Solo HM: 18
Id: 202
League: ETH
Rank: 95/103
Findings: 1
Award: $36.79
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: c3phas
Also found by: 0x1f8b, 0xAgro, 0xSmartContract, 0xackermann, 0xkato, Aymen0909, Bnke0x0, CloudX, IllIllI, PaludoX0, Rageur, Rahoz, RaymondFam, ReyAdmirado, Rolezn, SadBase, SaeedAlipoor01988, caventa, chaduke, chrisdior4, fatherOfBlocks, fs0c, kaden, nogo, pfapostol, shark, synackrst
36.79 USDC - $36.79
<x> += <y>
costs more gas than <x> = <x> + <y>
for state variablesUsing the addition operator instead of plus-equals saves gas
make the variables outside and only give them value inside
what
data
payout
j
auctionStack
owed
payee
spent
oldLength
&&
saves gasthis will have a large deployment gas cost but with enough runtime calls the split require version will be 3 gas cheaper
There is a chance that the first part will be true so the second part doesn’t need to be checked, so it is better to use the part that we have instead of the part that needs to be called.
switch the sides because we already have liquidator
we have recovered
so switch
Not inlining costs 20 to 40 gas because of two extra JUMP instructions and additional stack operations needed for function calls.
_execute
_generateValidOrderParameters
_listUnderlyingOnSeaport
_settleAuction
_increaseOpenLiens
_handleStrategistInterestReward
_executeCommitment
_transferAndDepositAssetIfAble
Contracts are allowed to override their parents’ functions and change the visibility from external to public and can save gas by doing so.
ROUTER()
IMPL_TYPE()
safeBatchTransferFrom()
getFinalAuctionEnd
getWithdrawRatio()
getWithdrawRatio()
file()
getConduitKey
pre calculate type casts and operations and only give the result to variables instead of doing it at the start of the contracts every time the contract is made
pre calculate the uint256(keccak256("some string")) - 1
and give the answer to the constant
pre calculate keccak256()
#0 - c4-judge
2023-01-25T23:32:30Z
Picodes marked the issue as grade-b