eth_call - Moonbase RPC Method
Execute smart contract calls without creating transactions on Moonbase Alpha. Essential for reading contract state for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification.
Executes a new message call immediately without creating a transaction on Moonbase Alpha. Used for reading smart contract state.
Why Moonbase? Build on the Moonbeam testnet for risk-free EVM dApp development and deployment testing with free testnet tokens, full EVM compatibility, XCM testing capabilities, and identical feature set to Moonbeam mainnet.
Use Cases
The eth_call method is essential for:
- Reading contract state - Query view/pure functions
- Simulating transactions - Test execution without gas costs
- DeFi integrations - Check prices, balances, allowances for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification
- Complex queries - Execute multi-step contract logic
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32000 | Execution reverted | Contract function reverted |
| -32602 | Invalid parameters | Invalid data encoding |
| -32015 | VM execution error | Contract logic error |
Related Methods
eth_estimateGas- Estimate gas for transactioneth_sendRawTransaction- Send actual transaction
eth_sendTransaction
Send a transaction from an unlocked account on Moonbase Alpha. Requires the node to hold the sender's private key — intended for development and testing only.
eth_getLogs
Query event logs on Moonbase Alpha. Essential for indexing EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification on the Moonbeam testnet for risk-free EVM dApp development and deployment testing.