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

Can transform platformID_ into a constant #1

Open
cleanunicorn opened this issue Apr 1, 2020 · 0 comments
Open

Can transform platformID_ into a constant #1

cleanunicorn opened this issue Apr 1, 2020 · 0 comments

Comments

@cleanunicorn
Copy link

bytes32 platformID_ = 0x4d616b65724d4344000000000000000000000000000000000000000000000000; // MakerMCD

It will reduce gas cost because it will not use SLOAD to retrieve from the contract storage and will be saved as a value in the contract bytecode; and will be PUSH32'd onto the stack when needed.

PUSH32 = 3 GAS
vs
SLOAD = 200 GAS

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

No branches or pull requests

1 participant