Answers for "Which variables get stored where in solidity?"

1

Which variables get stored where in solidity?

State variables (declared directly in the smart contract) always storage.
Function arguments. Always memory (with array types like string this needs to be stated explicitly)
Local variables (in functions) of the types struct, array or mapping are stored either in memory or storage. The place needs to be stated explicitly when declaring the variable.
Local variables (in functions) of value types (e. g. uint32) always in stack
Posted by: Guest on April-10-2022

Code answers related to "Which variables get stored where in solidity?"

Browse Popular Code Answers by Language