# Function getStateAllocations

- getStateAllocations(contracts, referenceDeclarations, userDefinedTypes, storageAllocations, existingAllocations?): StateAllocations

- This function gets allocations for the state variables of the contracts; this is distinct from getStorageAllocations, which gets allocations for storage structs.

  While mostly state variables are kept in storage, constant ones are not. And immutable ones, once those are introduced, will be kept in code! (But those don't exist yet so this function doesn't handle them yet.)

  #### Parameters

  - ##### contracts: ContractAllocationInfo[]

  - ##### referenceDeclarations: {
    [compilationId: string]: AstNodes;
    }

    - ##### [compilationId: string]: AstNodes

  - ##### userDefinedTypes: TypesById

  - ##### storageAllocations: StorageAllocations

  - ##### existingAllocations: StateAllocations = {}

  #### Returns StateAllocations

  - Defined in codec/lib/storage/allocate/index.ts:100

Generated using TypeDoc