bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": ["0x4200000000000000000000000000000000000006", "0x0", "latest"],
"id": "getblock.io"
}'
javascriptconst axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'eth_getStorageAt',
params: [
'0x4200000000000000000000000000000000000006',
'0x0',
'latest'
],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
console.log('Storage Value:', response.data.result);
pythonimport requests
response = requests.post(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'eth_getStorageAt',
'params': [
'0x4200000000000000000000000000000000000006',
'0x0',
'latest'
],
'id': 'getblock.io'
}
)
result = response.json()
print(f'Storage Value: {result["result"]}')
rustuse reqwest::Client;
use serde_json::{json, Value};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let response = client
.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
.header("Content-Type", "application/json")
.json(&json!({
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x4200000000000000000000000000000000000006",
"0x0",
"latest"
],
"id": "getblock.io"
}))
.send()
.await?
.json::<Value>()
.await?;
println!("Storage Value: {}", response["result"]);
Ok(())
}
javascriptconst { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');
async function getStorageAt(address, slot) {
const value = await provider.getStorage(address, slot);
console.log('Storage Value:', value);
return value;
}
// Read slot 0
getStorageAt('0x4200000000000000000000000000000000000006', 0);
// Read EIP-1967 implementation slot (for proxy contracts)
async function getProxyImplementation(proxyAddress) {
// EIP-1967 implementation slot
const implSlot = '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc';
const value = await provider.getStorage(proxyAddress, implSlot);
const implAddress = '0x' + value.slice(26); // Extract address from 32-byte value
console.log('Implementation:', implAddress);
return implAddress;
}
// Calculate storage slot for mapping
function getMappingSlot(mappingSlot, key) {
const paddedKey = ethers.zeroPadValue(key, 32);
const paddedSlot = ethers.zeroPadValue(ethers.toBeHex(mappingSlot), 32);
return ethers.keccak256(paddedKey + paddedSlot.slice(2));
}
javascriptimport { createPublicClient, http, keccak256, pad, toHex, concat } from 'viem';
import { base } from 'viem/chains';
const client = createPublicClient({
chain: base,
transport: http('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/')
});
async function getStorageAt(address, slot) {
const value = await client.getStorageAt({
address: address,
slot: toHex(slot, { size: 32 })
});
console.log('Storage Value:', value);
return value;
}
// Read slot 0
getStorageAt('0x4200000000000000000000000000000000000006', 0n);
// Read EIP-1967 implementation slot
async function getProxyImplementation(proxyAddress) {
const implSlot = '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc';
const value = await client.getStorageAt({
address: proxyAddress,
slot: implSlot
});
const implAddress = '0x' + value.slice(26);
console.log('Implementation:', implAddress);
return implAddress;
}