Volt Protocol contest - Sleepy's results

Inflation Protected Stablecoin.

General Information

Platform: Code4rena

Start Date: 31/03/2022

Pot Size: $75,000 USDC

Total HM: 7

Participants: 42

Period: 7 days

Judge: Jack the Pug

Total Solo HM: 5

Id: 102

League: ETH

Volt Protocol

Findings Distribution

Researcher Performance

Rank: 22/42

Findings: 2

Award: $204.69

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

125.7841 USDC - $125.78

Labels

bug
QA (Quality Assurance)

External Links

Unlocked pragma and outdated solc version

Description

Unlocked pragma enabling different solc versions i.e 0.8.0 in some and 0.8.4 in others across contracts each with their own bugs and quirks. A more recent compiler version typically results in more gas-efficient compilation and greater safety checks. Solc versions lower than 0.8.9 are typically susceptible to compiler bugs like Keccak Caching, ABI decoder bug for multi-dimensional memory arrays, signed immutables, and user-defined value types bug.

Lock the pragma and upgrade the compiler version to at least 0.8.10

Empty/Undefined logic

Description

In lines 47 and 61 of PCVDeposit.sol and CompoundPCVDepositBase.sol respectively, there are functions defined that lack any logic within (missing) curly braces.

Troublesome code

https://github.com/code-423n4/2022-03-volt/blob/f1210bf3151095e4d371c9e9d7682d9031860bbd/contracts/pcv/PCVDeposit.sol#L47 https://github.com/code-423n4/2022-03-volt/blob/f1210bf3151095e4d371c9e9d7682d9031860bbd/contracts/pcv/compound/CompoundPCVDepositBase.sol#L61

Implement the missing logic

Misleading NatSpec comment

Description

In line 14 of Core.sol and line 191 of CoreRef.solthe comments mention that thevoltand_volt` state variables are addresses of the Fei contract as a remnant of the Fei protocol it was forked from. This could cause confusion to anyone reading through the comments.

Rename the relevant sections in the comments appropriately.

Awards

78.9108 USDC - $78.91

Labels

bug
G (Gas Optimization)

External Links

Gas inefficient Variable Assignment

Description

In lines 18 to 25 of CoreRef.sol, a series of addresses are assigned to state variables. Two of these are sourced via an external call rather than argument input. This is essentially reading from cold storage(2100 gas) with an external call and then writing into storage vs writing to storage directly which is cheaper.

Troublesome code

https://github.com/code-423n4/2022-03-volt/blob/f1210bf3151095e4d371c9e9d7682d9031860bbd/contracts/refs/CoreRef.sol#L18-L25

Get rid of the external call view function calls and input the data directly.

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