-
Notifications
You must be signed in to change notification settings - Fork 16
Update L12-Gas-optimizations.md #2
base: main
Are you sure you want to change the base?
Conversation
Hello @malik672, a few things here. For one, please keep the Gas emoji. Next, do not delete the Conclusion part, keep that. Also, can you fix grammar and punctuation in the additions that you made after |
|
||
## Declaring the constructor payable | ||
Declaring the constructor as payable can potentially save a small amount of gas when deploying a contract in Solidity. This is because the Solidity compiler will skip a set of opcodes that check whether the constructor is payable at runtime if the constructor is declared as payable, resulting in a smaller contract bytecode and fewer gas units required to execute it.What this actually does is that it skips this set of opcodes : | ||
* ```CALLVALUE``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the effort for this. I think it would be really cool if we dived into a bit of Yul in the Advanced Section or made another for Yul.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the effort for this. I think it would be really cool if we dived into a bit of Yul in the Advanced Section or made another for Yul.
yeah, we should do this, how should we do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave in small content for people to be interested in this and make a sub-course for Yul?
Since Yul is almost like a language on its own, it deserves its own space, but making the content for Yul will be difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets take this discussion to discord, would make it more easier
will do this |
added more gas savings tip