StateManager
Extends
Properties
_baseState
_baseState:
BaseState
The internal state representation
Defined in
packages/state/src/StateManager.ts:10
getAccountAddresses()
getAccountAddresses: () =>
Set<`0x${string}`>
Returns contract addresses
Returns
Set<`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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:136
ready()
ready: () =>
Promise<true>
Returns
Promise<true>
Defined in
packages/state/src/StateManager.ts:11
Methods
checkChunkWitnessPresent()?
optionalcheckChunkWitnessPresent(contract,programCounter):Promise<boolean>
Parameters
• contract: EthjsAddress
• programCounter: number
Returns
Promise<boolean>
Inherited from
EvmStateManagerInterface.checkChunkWitnessPresent
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:133
checkpoint()
checkpoint():
Promise<void>
Returns
Promise<void>
Inherited from
EvmStateManagerInterface.checkpoint
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:124
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:123
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:116
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:140
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:141
generateCanonicalGenesis()
generateCanonicalGenesis(
initState):Promise<void>
Parameters
• initState: any
Returns
Promise<void>
Inherited from
EvmStateManagerInterface.generateCanonicalGenesis
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:142
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:114
getAppliedKey()?
optionalgetAppliedKey(address):Uint8Array
Parameters
• address: Uint8Array
Returns
Uint8Array
Inherited from
EvmStateManagerInterface.getAppliedKey
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:132
getContractCode()
getContractCode(
address):Promise<Uint8Array>
Parameters
• address: EthjsAddress
Returns
Promise<Uint8Array>
Inherited from
EvmStateManagerInterface.getContractCode
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:119
getContractCodeSize()?
optionalgetContractCodeSize(address):Promise<number>
Parameters
• address: EthjsAddress
Returns
Promise<number>
Inherited from
EvmStateManagerInterface.getContractCodeSize
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:120
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:121
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:143
getStateRoot()
getStateRoot():
Promise<Uint8Array>
Returns
Promise<Uint8Array>
Inherited from
EvmStateManagerInterface.getStateRoot
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:127
hasStateRoot()
hasStateRoot(
root):Promise<boolean>
Parameters
• root: Uint8Array
Returns
Promise<boolean>
Inherited from
EvmStateManagerInterface.hasStateRoot
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:130
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:117
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:115
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:118
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:122
revert()
revert():
Promise<void>
Returns
Promise<void>
Inherited from
EvmStateManagerInterface.revert
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:126
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.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:128
shallowCopy()
shallowCopy(
downlevelCaches?):EvmStateManagerInterface
Parameters
• downlevelCaches?: boolean
Returns
Inherited from
EvmStateManagerInterface.shallowCopy
Defined in
node_modules/.pnpm/@ethereumjs+common@4.4.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:144