Skip to content
Cive

getStorageRoot

Get the storage root of the contract address.

Usage

import {  } from "./client";
const  = await .({
  : "cfx:...",
});
 
Output: {
delta: "0x0240a5a3486ac1cee71db22b8e12f1bb6ac9f207ecd81b06031c407663c20a94",
intermediate: "0x314a41f277b678a1dc811a1fc0393b6d30c35e900cb27762ec9e9042bfdbdd49",
snapshot: 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470,
}

Returns

StorageRoot

Parameters

address

  • Type: Address

The address to check for collateral storage

const storage = await publicClient.getStorageRoot({
  address: "cfx:...", 
});

epochTag (optional)

  • Type: latest_state| latest_confirmed| latest_checkpoint | earliest
  • Defaut: latest_state
const storage = await publicClient.getStorageRoot({
  address: "cfx:...",
  epochTag: "latest_state", 
});

epochNumber (optional)

  • Type: bigint
const storage = await publicClient.getStorageRoot({
  address: "cfx:...",
  epochNumber: 1n, 
});

JSON-RPC Method

cfx_getStorageRoot