MENU

Practical Solidity Experiment #20

Do you need to zero-initialize every element when you allocate a new memory array in Solidity? They are saying all differently. YES – The memory may or may not be zeroed out. Because of this, one should not expect the free memory to point to zeroed out memory. NO – As all variables in Solidity, the elements of newly allocated arrays are always initialized with the default value. These two answers are written on Solidity official doc. Much confused! And as always, I decided to make an experiment to give myself a clear answer. It passes without an exception.As you see, it’s redundant to initialize the newly created array. – Tonyhttps://github.com/maAPPsDEV
Read More ›