Add More Method For Enhancing Gas Efficiency Ref#454 - #491
Conversation
This reverts commit a7c5299.
Add Inline Assembly Optimizations, Explicit Use of staticcall
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| - **Gas Efficiency**: For functions that only need to read data from the blockchain, `staticcall` is more gas-efficient than a regular call. | ||
| - **Security**: By preventing state changes, `staticcall` ensures that the called function cannot alter the contract's state or the state of other contracts. This makes contracts more predictable and secure. | ||
|
|
||
| You're right; the example provided for demonstrating the benefits of `staticcall` might not fully showcase its advantages, especially since `staticcall` is implicitly used in Solidity for `view` and `pure` functions. To better illustrate the benefits, let's delve into a scenario where the explicit use of `staticcall` can optimize gas consumption, particularly when interacting with contracts in a more granular manner. |
There was a problem hiding this comment.
This looks rather strange, like the answer chatgpt gave you
There was a problem hiding this comment.
However, many of the words generated by chatgpt are nonsense and repetitive. I think it is not suitable to be placed directly in the document.
There was a problem hiding this comment.
Yes, I generate some of the code snippet with Cody, failed to review that, I will fix that🤔
|
I think it is better to keep the gas optimization suggestions simple and direct. Many common sense contents in contract development should not be mentioned repeatedly. |
darwintree
left a comment
There was a problem hiding this comment.
Would follow @jackleeio 's opinion because he's working on this issue
|
In addition, I think the title should be kept as short and concise as possible, because if the title is too long, it will affect the reading experience when displayed in the sidebar. |
Pre-flight checklist
This change is