Skip to content

StateManager

Extends

Properties

_baseState

_baseState: BaseState

The internal state representation

Defined in

packages/state/src/StateManager.ts:10


getAccountAddresses()

getAccountAddresses: () => `0x${string}`[]

Returns contract addresses

Returns

`0x${string}`[]

Defined in

packages/state/src/StateManager.ts:15


originalStorageCache

originalStorageCache: object

clear()

Returns

void

get()

Parameters

address: EthjsAddress

key: Uint8Array

Returns

Promise<Uint8Array>

Inherited from

EvmStateManagerInterface.originalStorageCache

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:73


ready()

ready: () => Promise<true>

Returns

Promise<true>

Defined in

packages/state/src/StateManager.ts:11

Methods

checkpoint()

checkpoint(): Promise<void>

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.checkpoint

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:62


clearCaches()

clearCaches(): void

Resets all internal caches

Returns

void

Defined in

packages/state/src/StateManager.ts:27


clearContractStorage()

clearContractStorage(address): Promise<void>

Parameters

address: EthjsAddress

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.clearContractStorage

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:61


commit()

commit(createNewStateRoot?): Promise<void>

Commits the current state.

Parameters

createNewStateRoot?: boolean

Whether to create a new state root Defaults to true. This api is not stable

Returns

Promise<void>

Overrides

EvmStateManagerInterface.commit

Defined in

packages/state/src/StateManager.ts:37


deepCopy()

deepCopy(): Promise<StateManager>

Returns a new instance of the ForkStateManager with the same opts and all storage copied over

Returns

Promise<StateManager>

Defined in

packages/state/src/StateManager.ts:19


deleteAccount()

deleteAccount(address): Promise<void>

Parameters

address: EthjsAddress

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.deleteAccount

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:55


dumpCanonicalGenesis()

dumpCanonicalGenesis(): Promise<TevmState>

Dumps the state of the state manager as a TevmState

Returns

Promise<TevmState>

Defined in

packages/state/src/StateManager.ts:23


dumpStorage()

dumpStorage(address): Promise<StorageDump>

Parameters

address: EthjsAddress

Returns

Promise<StorageDump>

Inherited from

EvmStateManagerInterface.dumpStorage

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:77


dumpStorageRange()

dumpStorageRange(address, startKey, limit): Promise<StorageRange>

Parameters

address: EthjsAddress

startKey: bigint

limit: number

Returns

Promise<StorageRange>

Inherited from

EvmStateManagerInterface.dumpStorageRange

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:78


generateCanonicalGenesis()

generateCanonicalGenesis(initState): Promise<void>

Parameters

initState: any

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.generateCanonicalGenesis

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:79


getAccount()

getAccount(address): Promise<undefined | EthjsAccount>

Parameters

address: EthjsAddress

Returns

Promise<undefined | EthjsAccount>

Inherited from

EvmStateManagerInterface.getAccount

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:53


getAppliedKey()?

optional getAppliedKey(address): Uint8Array

Parameters

address: Uint8Array

Returns

Uint8Array

Inherited from

EvmStateManagerInterface.getAppliedKey

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:70


getContractCode()

getContractCode(address): Promise<Uint8Array>

Parameters

address: EthjsAddress

Returns

Promise<Uint8Array>

Inherited from

EvmStateManagerInterface.getContractCode

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:58


getContractStorage()

getContractStorage(address, key): Promise<Uint8Array>

Parameters

address: EthjsAddress

key: Uint8Array

Returns

Promise<Uint8Array>

Inherited from

EvmStateManagerInterface.getContractStorage

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:59


getProof()

getProof(address, storageSlots?): Promise<Proof>

Parameters

address: EthjsAddress

storageSlots?: Uint8Array[]

Returns

Promise<Proof>

Inherited from

EvmStateManagerInterface.getProof

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:80


getStateRoot()

getStateRoot(): Promise<Uint8Array>

Returns

Promise<Uint8Array>

Inherited from

EvmStateManagerInterface.getStateRoot

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:65


hasStateRoot()

hasStateRoot(root): Promise<boolean>

Parameters

root: Uint8Array

Returns

Promise<boolean>

Inherited from

EvmStateManagerInterface.hasStateRoot

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:68


modifyAccountFields()

modifyAccountFields(address, accountFields): Promise<void>

Parameters

address: EthjsAddress

accountFields: Partial<Pick<EthjsAccount, "nonce" | "balance" | "storageRoot" | "codeHash">>

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.modifyAccountFields

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:56


putAccount()

putAccount(address, account?): Promise<void>

Parameters

address: EthjsAddress

account?: EthjsAccount

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.putAccount

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:54


putContractCode()

putContractCode(address, value): Promise<void>

Parameters

address: EthjsAddress

value: Uint8Array

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.putContractCode

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:57


putContractStorage()

putContractStorage(address, key, value): Promise<void>

Parameters

address: EthjsAddress

key: Uint8Array

value: Uint8Array

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.putContractStorage

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:60


revert()

revert(): Promise<void>

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.revert

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:64


saveStateRoot()

saveStateRoot(root, state): void

Saves a state root to the state root mapping THis API is considered unstable

Parameters

root: Uint8Array

state: TevmState

Returns

void

Defined in

packages/state/src/StateManager.ts:33


setStateRoot()

setStateRoot(stateRoot, clearCache?): Promise<void>

Parameters

stateRoot: Uint8Array

clearCache?: boolean

Returns

Promise<void>

Inherited from

EvmStateManagerInterface.setStateRoot

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:66


shallowCopy()

shallowCopy(downlevelCaches?): EvmStateManagerInterface

Parameters

downlevelCaches?: boolean

Returns

EvmStateManagerInterface

Inherited from

EvmStateManagerInterface.shallowCopy

Defined in

node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:81