Skip to content

Why _castToPure in console.sol can convert a view method into pure method? #5116

Discussion options

You must be logged in to vote

Will there be any changes to this method in the process?

Perhaps it uses a bit more gas (I don't know if the compiler will optimize this), but otherwise there is no functionality change.

Is there any solidity feature involved in this?

No, it's assembly hackery.

and where can I learn about it?

https://twitter.com/devtooligan/status/1654945451584667648
https://gist.github.com/devtooligan/9031f859469138307d0976455b7ddffa

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kanej
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants