15,000 USDC
View results
Submission Details
Severity: gas
Valid

Multiple address `mappings` can be combined into a single `mapping`

Summary

Vulnerability Details

Saves a storage slot for the mapping.
Depending on the circumstances and sizes of types,
can avoid a Gsset (20000 gas) per mapping combined. Reads and subsequent writes can also
be cheaper when a function requires both values and they both fit in the same storage slot.
Finally, if both fields are accessed in the same function, can save ~42 gas per access
due to not having to recalculate the key’s keccak256 hash (Gkeccak256 - 30 gas) and
that calculation’s associated stack operations.

There is 1 instance of this issue:

Impact

save gas

Tools Used

Recommendations

Multiple address mappings can be combined into a single mapping of
an address to a struct, where appropriate.

Support

FAQs

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