Skip to content

Gas optimization#1

Open
FinagleLord wants to merge 1 commit intodapp-org:mainfrom
FinagleLord:patch-1
Open

Gas optimization#1
FinagleLord wants to merge 1 commit intodapp-org:mainfrom
FinagleLord:patch-1

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