NEWTON

NEWTON


Popular tags

    Does writing it to zero actually do something?

    Asked

    4 months ago

    14

    views


    0

    Hey, As each storage value is by default initialized to 0, does writing it to zero actually do something? Does it use storage in layer 1 with value 0? Or does it just do nothing? Should I check that the value I want to write is different than 0 before writing it otherwise I will waste storage?

    The same idea: does writing a storage value to 0 free storage on l1

      cairocairo-lang

    Newton

    asked

    4 months ago


    2 answers

    0

    nope in l1 the default is 0 you can test yourself on remix:

    address public uninitialized;

    answered

    4 months ago

    0

    Hey, 0 is the default value of any storage variable. Rewriting an existing value is free (at least in storage cost).

    answered

    4 months ago

    Your answer

    NEWTON

    NEWTON