Get Storage At
Read a storage slot at an address with getStorageAt
Loading...
Read a storage slot at an address with getStorageAt
GetStorageAt returns the raw 32-byte value at a storage slot for a given address. Uses eth_getStorageAt. Useful for low-level storage layout inspection.
import ( "github.com/ethereum/go-ethereum/common" "github.com/ChefBingbong/viem-go/actions/public")value, err := public.GetStorageAt(ctx, publicClient, public.GetStorageAtParameters{ Address: common.HexToAddress("0x..."), Slot: common.HexToHash("0x0"),})if err != nil { log.Fatal(err)}// value is []byte (up to 32 bytes); nil means zero/emptycommon.Addresscommon.Hashcommon.HexToHash("0x0") for slot 0).*uint64BlockTag"latest"([]byte, error). The value is the raw bytes at that slot (up to 32 bytes). nil means zero/empty.