Why _castToPure in console.sol can convert a view method into pure method? #5116
-
Hi folks, I have a question when I read the console.sol. There is a method which can convert a view method into a pure one. Will there be any changes to this method in the process? Is there any solidity feature involved in this? and where can I learn about it?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Perhaps it uses a bit more gas (I don't know if the compiler will optimize this), but otherwise there is no functionality change.
No, it's assembly hackery.
https://twitter.com/devtooligan/status/1654945451584667648 |
Beta Was this translation helpful? Give feedback.
Perhaps it uses a bit more gas (I don't know if the compiler will optimize this), but otherwise there is no functionality change.
No, it's assembly hackery.
https://twitter.com/devtooligan/status/1654945451584667648
https://gist.github.com/devtooligan/9031f859469138307d0976455b7ddffa