so it want to answer Matt Jafarzadeh question: so when we declare a global variable and then call it in a function its gets saved to storage. Does it get overwritten or saves another value in different place? Answer: when a state variable is assigned globally with storage, it takes a slot in evm storage where each slot is of 32bytes, when ever a variable gets updated inside a function the storage slot allotted for that variable will get updated and value will be OverWritten, this is done by evm to make efficent use of storage and maintain consitency.
wait a minute, 31:13 line 17 "s_index += index" meaning that you want to add "index" to storage variable "s_index", but after that you change it to "currentIndex += index", isn't it completely different than the previous? because now you don't change the storage variable anymore?
The questions asked in this live is really very standard! Nice to hear to the answers for the questions
Thank you!
Thank you Patrick I have learnt a lot.
so it want to answer Matt Jafarzadeh question:
so when we declare a global variable and then call it in a function its gets saved to storage. Does it get overwritten or saves another value in different place?
Answer: when a state variable is assigned globally with storage, it takes a slot in evm storage where each slot is of 32bytes, when ever a variable gets updated inside a function the storage slot allotted for that variable will get updated and value will be OverWritten, this is done by evm to make efficent use of storage and maintain consitency.
wonderful efforts ..many thxs for the content
thanks heaps, explained very well
wait a minute, 31:13 line 17 "s_index += index" meaning that you want to add "index" to storage variable "s_index", but after that you change it to "currentIndex += index", isn't it completely different than the previous? because now you don't change the storage variable anymore?
constants are stored in CODE along with bytecode.
Where can we get the ppt ?
Can you share the slides? Thank you very much.
261