Yield Witch v2 contest - SooYa'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: 31/63

Findings: 2

Award: $55.89

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Awards

39.022 USDC - $39.02

Labels

bug
QA (Quality Assurance)
sponsor confirmed
old-submission-method

External Links

Wrong Comment in SetLimit Function

There is a wrong comment in SetLimit function. The comment doesn't explain the parameters used in the function. this can confuse the reader when reading the code. The comment is located below: https://github.com/code-423n4/2022-07-yield/blob/main/contracts/Witch.sol#L118-L122

#0 - alcueca

2022-07-22T14:46:12Z

Thanks

> 0 is less efficient than != 0 for unsigned integers (with proof)

!= 0 costs less gas compared to > 0 for unsigned integers in require statements with the optimizer enabled (6 gas)

Proof: While it may seem that > 0 is cheaper than !=, this is only true without the optimizer enabled and outside a require statement. If you enable the optimizer at 10k AND you’re in a require statement, this will save gas. You can see this tweet for more proofs: https://twitter.com/gzeon/status/1485428085885640706 I suggest changing > 0 with != 0 here:

https://github.com/code-423n4/2022-07-yield/blob/main/contracts/Witch.sol#L300 https://github.com/code-423n4/2022-07-yield/blob/main/contracts/Witch.sol#L358 https://github.com/code-423n4/2022-07-yield/blob/main/contracts/Witch.sol#L416

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