Platform: Code4rena
Start Date: 17/02/2022
Pot Size: $75,000 USDC
Total HM: 20
Participants: 39
Period: 7 days
Judges: moose-code, JasoonS
Total Solo HM: 13
Id: 89
League: ETH
Rank: 29/39
Findings: 2
Award: $240.99
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: defsec
Also found by: 0v3rf10w, 0x0x0x, 0x1f8b, 0xwags, CertoraInc, Dravee, IllIllI, Meta0xNull, Nikolay, Omik, WatchPug, bobi, cccz, csanuragjain, danb, gzeon, hubble, hyh, itsmeSTYJ, jayjonah8, kenta, kirk-baird, leastwood, pauliax, peritoflores, rfa, robee, sorrynotsorry, ye0lde
142.3223 USDC - $142.32
missing zero checks Registry.sol L#19-23
TODOs ClearingHouse.sol L#172 MarginAccount.sol L#277 AMM.sol L#142,555,
98.6676 USDC - $98.67
use uint256 for best gas saving ClearingHouse.sol L#17,18,19,20 MarginAccount.sol L#47
uint256 instead of bool ClearingHouse.sol L#79,250
Prefix increments are cheaper than postfix increments. Further more, using unchecked {++x} is even more gas efficient, and the gas saving accumulates every iteration and can make a real change ClearingHouse.sol L#122,130,170,194,251,263,278 MarginAccount.sol L#331,373,521
immutable instead of constant MarginAccount.sol L#34,15,
use calldata instead of memory
use memory instead of storage
bytes32 instead of string
#0 - atvanguard
2022-02-26T08:05:34Z
G-05 is a good suggestioin