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

Findings: 1

Award: $16.87

🌟 Selected for report: 0

🚀 Solo Findings: 0

Use != 0 instead of > 0 when comparing unsigned integers

!= 0 will do the same as > 0 for unsigned integers, but != 0 costs less gas compared to > 0 for unsigned integers in require statements with the optimizer enabled.

Instances include :

Witch.sol:255: require(auction_.start > 0, "Vault not under auction"); Witch.sol:300: require(auction_.start > 0, "Vault not under auction"); Witch.sol:358: require(auction_.start > 0, "Vault not under auction"); Witch.sol:416: require(auction_.start > 0, "Vault not under auction");

Recommendation

It is recommended to replace > 0 with != 0, as they do the same thing for unsigned integers, and '!= 0' costs less gas compared to > 0 in require statements with the optimizer enabled, also enable the optimizer.

For example :

Witch.sol:255: require(auction_.start != 0, "Vault not under auction");

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