# Contract storage layout

**URL:** <https://forum.flow.com/t/contract-storage-layout/2373>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [September 8, 2021, 1:26pm UTC](https://forum.flow.com/t/contract-storage-layout/2373 "2021-09-08T13:26:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dryrunner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/dryrunner/32/641_2.png) [@dryrunner](https://forum.flow.com/u/dryrunner)\
**Post date:** [September 8, 2021, 1:26pm UTC](https://forum.flow.com/t/contract-storage-layout/2373/1 "2021-09-08T13:26:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [September 13, 2021, 4:04pm UTC](https://forum.flow.com/t/contract-storage-layout/2373/2 "2021-09-13T16:04:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dryrunner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/dryrunner/32/641_2.png) [@dryrunner](https://forum.flow.com/u/dryrunner)\
**Post date:** [September 13, 2021, 8:52pm UTC](https://forum.flow.com/t/contract-storage-layout/2373/3 "2021-09-13T20:52:24Z")

</div>

> [@flowjosh](#):
>
> Contracts have their own special place in storage that is only accessible through the rules defined by the contract.

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 🙂
