Platform: Code4rena
Start Date: 14/07/2022
Pot Size: $25,000 USDC
Total HM: 2
Participants: 63
Period: 3 days
Judge: PierrickGT
Total Solo HM: 1
Id: 147
League: ETH
Rank: 52/63
Findings: 1
Award: $16.99
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x29A, 0xKitsune, 0xNazgul, Aymen0909, Chom, Deivitto, ElKu, JC, JohnSmith, Kaiziron, Limbooo, MadWookie, Meera, ReyAdmirado, Rohan16, Sm4rty, SooYa, TomJ, Trumpero, Waze, __141345__, ajtra, ak1, antonttc, bulej93, c3phas, cRat1st0s, csanuragjain, defsec, durianSausage, fatherOfBlocks, gogo, hake, hickuphh3, ignacio, joestakey, karanctf, kyteg, m_Rassska, pashov, rajatbeladiya, rbserver, robee, rokinot, samruna, sashik_eth, simon135, tofunmi
16.9868 USDC - $16.99
-------- gas ---------
Unnecessary default assignments, you can just declare and it will save gas and have the same meaning.
Witch.sol (L#63) : uint128 public auctioneerReward = 0.01e18;
Using != 0 is slightly cheaper than > 0. (see https://github.com/code-423n4/2021-12-maple-findings/issues/75 for similar issue)
Witch.sol, 393: change 'liquidatorCut > 0' to 'liquidatorCut != 0' Witch.sol, 398: change 'auctioneerCut > 0' to 'auctioneerCut != 0'
uint256 Witch.sol._calcPayout - unnecessary casting uint256(artIn)
The following functions are used exactly once. Therefore you can inline them and save gas and improve code clearness.
Witch.sol, _auctionStarted
You calculate the power of 10 every time you use it instead of caching it once as a constant variable and using it instead. Fix the following code lines:
Witch.sol, 232 : You should cache the used power of 10 as constant state variable since it's used several times (2): if (art < debt.min * (10**debt.dec)) art = balances.art;
Witch.sol, 437 : You should cache the used power of 10 as constant state variable since it's used several times (2): auction_.art - artIn >= debt.min * (10**debt.dec),