Content pfp
Content
@
https://opensea.io/collection/dev-21
0 reply
0 recast
2 reactions

Paul Berg pfp
Paul Berg
@prberg
Random Solidity tip: Be careful when using immutables in the declaration of other constants or immutables. The order of immutable variable declarations MATTERS.
1 reply
1 recast
24 reactions

Mo pfp
Mo
@meb
Question; what’s the use case in solidity for using immutable instead of constants?
1 reply
0 recast
0 reaction

I. Christwin〔▸‿◂〕💡 pfp
I. Christwin〔▸‿◂〕💡
@ichristwin.eth
They are similar in that the contract code can't update them. Constant variables are embedded in the contract code as it complies so you have to define their values before compilation runs. However immutable variables are set in code during bytecode deployment, so you can wait until your constructor runs, to set their values.
0 reply
0 recast
3 reactions