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

Gas optimization #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

FinagleLord
Copy link

"Under the hood of solidity, Booleans (bool) are uint8 which means they use 8 bits of storage. A Boolean can only have two values: True or False. This means that you can store a boolean in only a single bit." So I adjusted "unlocked" to uint256 to save some gas :)

"Under the hood of solidity, Booleans (bool) are uint8 which means they use 8 bits of storage. A Boolean can only have two values: True or False. This means that you can store a boolean in only a single bit." So I adjusted "unlocked" to uint256 to save some gas :)
@transmissions11
Copy link

transmissions11 commented Aug 20, 2021

does the require still work with a uint? wouldn't you have to change it to == 1

also uint256 is the standard naming convention in this repo over uint ;p

@d-xo
Copy link
Contributor

d-xo commented Aug 20, 2021

also uint256 is the standard naming convention in this repo over uint ;p

I definitely prefer uint, if I've used uint256 anywhere then it's a mistake hehe

@FinagleLord
Copy link
Author

lol i actually noticed i missed changing it over to == 1 for the pull request when i went to push something of mine xD

@transmissions11
Copy link

transmissions11 commented Aug 20, 2021

also uint256 is the standard naming convention in this repo over uint ;p

I definitely prefer uint, if I've used uint256 anywhere then it's a mistake hehe

Oh oop! Sorry used to my fork which uses 256 lol

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 this pull request may close these issues.

3 participants