Contract storage layout

For variables defined in the cadence contract, if they’re not explicitly save() to the storage path, where are they stored? For example the HelloWorld.cdc contract from the playground:

access(all) contract HelloWorld {

  // Declare a public field of type String.
  //
  // All fields must be initialized in the init() function.
  access(all) let greeting: String

  // The init() function is required if the contract contains any fields.
  init() {
      self.greeting = "Hello from account 2!"
  }

  // Public function that returns our friendly greeting!
  access(all) fun hello(): String {
      return self.greeting
  }
}

Should self.greeting field still be stored in the accout storage area somewhere? What is the storage layout then?

State that is managed by a contract is not stored in the normal storage layout of an account, meaning it is not accessible through a Path via the AuthAccount object. Contracts have their own special place in storage that is only accessible through the rules defined by the contract.

Does that help?

That’s clear to me, thank you Josh. Contracts have their own special place in storage that is only accessible through the rules defined by the contract - it’d be better if this can also be mentioned in the docs :slight_smile: