Where are contract globals like msg.sender and block.number stored?

It is in memory or storage?

  • 1
    I can't really tell what you're asking. Could you clarify your question? – flygoing Mar 3 '18 at 0:36
  • I mean information like the "msg.sender" or "block.number" these are environment variables, we have access to these variables but where they are stored? – EricEnticman Mar 3 '18 at 13:01

These aren't stored in memory or the storage. There exists special opcodes in the EVM (machine level instructions) that push the equivalent values to the stack. See page 29 of the of the whitepaper to see all of these environment information opcodes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.