The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

State variables can be packed into fewer storage slots

Summary

State variables can be packed into fewer storage slots

Vulnerability Details

Each slot saved can avoid an extra Gsset (20000 gas). Reads and writes (if two variables that occupy the same slot are written by the same function) will have a cheaper gas consumption.

File: contracts/SmartVaultV3.sol
/// @audit 7 slots -> 6 slots by new order:
/*
* bytes32 NATIVE (32 Bytes)
* uint256 minted (32 Bytes)
* address manager (20 Bytes)
* IEUROs EUROs (20 Bytes)
* IPriceCalculator calculator (20 Bytes)
* bool liquidated (1 Byte)
* address owner (20 Bytes)
*/
14: contract SmartVaultV3 is ISmartVault {

Github: [14]

Impact

It is using 1 extra slot which costs more GAS

Tools Used

Manual Review

Recommendations

Change the order of state variables as provided above

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.