Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit: Inefficient Boolean Mappings #182

Closed
Orland0x opened this issue Jun 13, 2023 · 1 comment · Fixed by #208
Closed

audit: Inefficient Boolean Mappings #182

Orland0x opened this issue Jun 13, 2023 · 1 comment · Fixed by #208
Assignees

Comments

@Orland0x
Copy link
Contributor

Various contracts have mappings which map to a boolean value. In Solidity, this is inefficient, because writing to such a mapping incurs an additional storage read. It is more gas-efficient to map to a type which occupies the entire size of the storage slot, e.g. a uint256.

@pscott
Copy link
Collaborator

pscott commented Jun 16, 2023

FIX: use uint256 in mappings and introduce the constants TRUE and FALSE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants