Yield Witch v2 contest - ak1's results

Fixed-rate borrowing and lending on Ethereum

General Information

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

Yield

Findings Distribution

Researcher Performance

Rank: 11/63

Findings: 2

Award: $95.50

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

77.0681 USDC - $77.07

Labels

bug
QA (Quality Assurance)
sponsor confirmed

External Links

Low risk, non-critical

Quality coding :

  1. Line number 191, 192 can be above Line number 202, https://github.com/code-423n4/2022-07-yield/blob/6ab092b8c10e4dabb470918ae15c6451c861655f/contracts/Witch.sol#L191-L192

    https://github.com/code-423n4/2022-07-yield/blob/6ab092b8c10e4dabb470918ae15c6451c861655f/contracts/Witch.sol#L202

    Because, balances and debt are used after this line 202 only. This could save the execution cost. Its type of gas savings too. I believe this is better way of coding.

  2. Comment could be corrected as under-collateralized in, https://github.com/code-423n4/2022-07-yield/blob/6ab092b8c10e4dabb470918ae15c6451c861655f/contracts/Witch.sol#L14

  3. initialization : its better to initialize as zero in below line of code. Relying on the unknown storage data could be risky. https://github.com/code-423n4/2022-07-yield/blob/6ab092b8c10e4dabb470918ae15c6451c861655f/contracts/Witch.sol#L133

  4. variable name suggestion in below line of code. https://github.com/code-423n4/2022-07-yield/blob/6ab092b8c10e4dabb470918ae15c6451c861655f/contracts/Witch.sol#L99-L100 proportion = VaultProportion, initialOffer = ColletralProportion

  5. code simplification: https://github.com/code-423n4/2022-07-yield/blob/6ab092b8c10e4dabb470918ae15c6451c861655f/contracts/Witch.sol#L303-L309 Since artIn already knw from the line - 303, I would write the condition as below instead of using the ternary operator. Because the code could simple and readable. if( artIn > auction_.art ) artIn = auction_.art;

  6. I would suggest the contract name as LiquidEngine.sol instead of Witch.sol Similarly, the variable , otherWitches could be OtherLiquidEngine Function name, setAnotherWitch could be seAnotherLiquidEngine

  7. Its better to use the same datatype in all places. I see there are too many castings. it could tough to track each of the casting to verify appropriate data type during coding. There could be possibility of missing in some places.

  8. For more decentralization: It could better if the governor related cautions is displayed in front end. For example, displaying the auctioner reward in front end.

#0 - alcueca

2022-07-22T14:27:17Z

Useful report with original though behind it, thank you.

#0 - alcueca

2022-07-22T14:23:16Z

Thanks!

#1 - JeeberC4

2022-07-27T20:53:13Z

Renamed for warden as they did not have another Gas report.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter