eth_call - Execute Smart Contract Calls
Execute smart contract functions without creating a transaction on Neuroweb Mainnet. Essential for reading contract state.
Save 80% on `eth_call` Requests
Alchemy = $11.70 per million eth_call requests
Quicknode = $12.40 per million eth_call requests
Dwellir = $2 per million eth_call requests
Quicknode is 6X more expensive for eth_calls!
Executes a new message call immediately without creating a transaction on the blockchain. Used for reading smart contract state.
When to Use This Method
eth_call is essential for:
- Reading Contract State - Query view/pure functions
- Simulating Transactions - Test execution without gas costs
- DeFi Integrations - Check prices, balances, allowances
- Complex Queries - Execute multi-step contract logic
Common Use Cases
1. DeFi Price Queries
// Uniswap V3 Pool Price Query
async function getPoolPrice(poolAddress) {
const poolABI = [
"function slot0() view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)",
"function token0() view returns (address)",
"function token1() view returns (address)"
];
const pool = new Contract(poolAddress, poolABI, provider);
const [slot0, token0, token1] = await Promise.all([
pool.slot0(),
pool.token0(),
pool.token1()
]);
// Calculate price from sqrtPriceX96
const sqrtPriceX96 = slot0.sqrtPriceX96;
const price = (Number(sqrtPriceX96) / (2 ** 96)) ** 2;
return {
token0: token0,
token1: token1,
price: price,
tick: slot0.tick
};
}2. Multi-Contract Queries
// Batch multiple contract calls
async function multicall(calls) {
const multicallABI = [
"function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"
];
const multicallAddress = "0xcA11bde05977b3631167028862bE2a173976CA11"; // Neuroweb Multicall3
const multicall = new Contract(multicallAddress, multicallABI, provider);
const results = await multicall.aggregate(calls);
return results.returnData;
}3. Access Control Checks
// Check permissions before transaction
async function checkPermissions(contractAddress, userAddress, role) {
const accessControlABI = [
"function hasRole(bytes32 role, address account) view returns (bool)",
"function getRoleAdmin(bytes32 role) view returns (bytes32)"
];
const contract = new Contract(contractAddress, accessControlABI, provider);
const hasRole = await contract.hasRole(role, userAddress);
return hasRole;
}eth_sendTransaction - Send transaction (wal...
Not supported on shared NeuroWeb endpoints; sign locally and submit with eth_sendRawTransaction.
eth_getLogs - Query Event Logs
Query and filter event logs from smart contracts on Neuroweb Mainnet. Essential for tracking events, monitoring contracts, and building event-driven applications.