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

refactor: use immutable properties where possible #5

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

0x-r4bbit
Copy link
Member

This commit changes a few token properties to be immutable as this reduces gas costs even further.

This was reported by Slither.

A gas report with changes in gas cost is attached.

MasterToken masterToken = new MasterToken(_masterName, _masterSymbol, _masterBaseTokenURI, address(this));
emit MasterTokenCreated(address(masterToken));
MasterToken _masterToken = new MasterToken(_masterName, _masterSymbol, _masterBaseTokenURI, address(this));
emit MasterTokenCreated(address(_masterToken));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn't strictly necessary, but slither complained that masterToken would shadow BaseToken.masterToken, so I guess it wouldn't hurt to make slither happy here..

@0x-r4bbit 0x-r4bbit force-pushed the refactor/gas-optimizations branch from 91c076b to c5aabdb Compare September 4, 2023 10:35
@0x-r4bbit 0x-r4bbit force-pushed the refactor/use-immutable branch from 29d606d to eba81f7 Compare September 4, 2023 10:36
@0x-r4bbit 0x-r4bbit force-pushed the refactor/gas-optimizations branch from c5aabdb to 5a0eded Compare September 5, 2023 14:45
@0x-r4bbit 0x-r4bbit force-pushed the refactor/use-immutable branch from eba81f7 to b21d7da Compare September 5, 2023 14:48
@0x-r4bbit 0x-r4bbit force-pushed the refactor/gas-optimizations branch from 5a0eded to 8c6da1a Compare September 8, 2023 10:37
@0x-r4bbit 0x-r4bbit force-pushed the refactor/use-immutable branch from b21d7da to c3a67d2 Compare September 8, 2023 10:38
@0x-r4bbit 0x-r4bbit force-pushed the refactor/gas-optimizations branch from 8c6da1a to 1707f9e Compare September 19, 2023 14:27
@0x-r4bbit 0x-r4bbit force-pushed the refactor/use-immutable branch from c3a67d2 to 9d8d19d Compare September 19, 2023 14:28
@0x-r4bbit 0x-r4bbit changed the base branch from refactor/gas-optimizations to main September 20, 2023 05:30
This commit changes a few token properties to be `immutable` as this
reduces gas costs even further.

This was reported by Slither.

A gas report with changes in gas cost is attached.
@0x-r4bbit 0x-r4bbit force-pushed the refactor/use-immutable branch from 9d8d19d to d316475 Compare September 22, 2023 10:24
@0x-r4bbit 0x-r4bbit merged commit e7d799b into main Sep 22, 2023
6 checks passed
@0x-r4bbit 0x-r4bbit deleted the refactor/use-immutable branch September 22, 2023 10:32
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.

1 participant