StateManager
Extends
Properties
_baseState
_baseState:
BaseState
The internal state representation
Source
packages/state/src/StateManager.ts:10
getAccountAddresses()
getAccountAddresses: () => `0x${string}`[]
Returns contract addresses
Returns
`0x${string}`[]
Source
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
Source
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>
Source
packages/state/src/StateManager.ts:11
Methods
checkpoint()
checkpoint():
Promise<void>
Returns
Promise<void>
Inherited from
EvmStateManagerInterface.checkpoint
Source
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
Source
packages/state/src/StateManager.ts:27
clearContractStorage()
clearContractStorage(
address):Promise<void>
Parameters
• address: EthjsAddress
Returns
Promise<void>
Inherited from
EvmStateManagerInterface.clearContractStorage
Source
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
Source
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>
Source
packages/state/src/StateManager.ts:19
deleteAccount()
deleteAccount(
address):Promise<void>
Parameters
• address: EthjsAddress
Returns
Promise<void>
Inherited from
EvmStateManagerInterface.deleteAccount
Source
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>
Source
packages/state/src/StateManager.ts:23
dumpStorage()
dumpStorage(
address):Promise<StorageDump>
Parameters
• address: EthjsAddress
Returns
Promise<StorageDump>
Inherited from
EvmStateManagerInterface.dumpStorage
Source
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
Source
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
Source
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
Source
node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:53
getAppliedKey()?
optionalgetAppliedKey(address):Uint8Array
Parameters
• address: Uint8Array
Returns
Uint8Array
Inherited from
EvmStateManagerInterface.getAppliedKey
Source
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
Source
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
Source
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
Source
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
Source
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
Source
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
Source
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
Source
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
Source
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
Source
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
Source
node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:64
saveStateRoot()
Experimental
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
Source
packages/state/src/StateManager.ts:33
setStateRoot()
setStateRoot(
stateRoot,clearCache?):Promise<void>
Parameters
• stateRoot: Uint8Array
• clearCache?: boolean
Returns
Promise<void>
Inherited from
EvmStateManagerInterface.setStateRoot
Source
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
Inherited from
EvmStateManagerInterface.shallowCopy
Source
node_modules/.pnpm/@ethereumjs+common@4.3.0/node_modules/@ethereumjs/common/dist/esm/interfaces.d.ts:81