call

Call Re-added v210 → v323, v326 → current #1

Issues an EVM call operation like an Ethereum message call .

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: developers

The Big Picture

Core EVM interaction - equivalent to eth_call/eth_sendTransaction.

Use Cases

  • Call contract functions
  • Interact with DeFi
  • Transfer ERC-20 tokens

From Chain Metadata

Issue an EVM call operation. This is similar to a message call transaction in Ethereum.

Input Parameters

#NameTypeDescription
0
source
H160 source (H160)
1
target
H160 target (H160)
2
input
Vec<u8> Vecinput (Vec<u8>)
3
value
U256 value (U256)
4
gas_limit
u64 gas_limit (u64)
5
max_fee_per_gas
U256 max_fee_per_gas (U256)
6
max_priority_fee_per_gas
Option max_priority_fee_per_gas (Option)
7
nonce
Option nonce (Option)
8
access_list
Vec<(H160, Vec<H256>)> Vecaccess_list (Vec<(H160, Vec<H256>)>)
9
authorization_list
Vec<AuthorizationListItem> Vecauthorization_list (Vec<AuthorizationListItem>)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Target contract exists
  • Sufficient gas
  • Balance for value + gas

Effects

Storage Modified

Postconditions

  • Contract executed
  • State changes applied if successful

Side Effects

  • May emit EVM.Executed/ExecutedFailed
  • May emit EVM.Log events

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Build call call
const source = 0 as any /* H160 */;
const target = 0 as any /* H160 */;
const input = 0;
const value = 0 as any /* U256 */;
const gas_limit = 0;
const max_fee_per_gas = 0 as any /* U256 */;
const max_priority_fee_per_gas = 0 as any /* Option */;
const nonce = 0 as any /* Option */;
const access_list = 0 as any /* Vec<(H160, Vec<H256>)> */;
const authorization_list = 0 as any /* Vec<AuthorizationListItem> */;

const call = api.tx[stringCamelCase("EVM")][stringCamelCase("call")](
  source,
  target,
  input,
  value,
  gas_limit,
  max_fee_per_gas,
  max_priority_fee_per_gas,
  nonce,
  access_list,
  authorization_list
);

Version History

v210 block 4,345,556 9 args
v326 block 6,608,228 10 args Current

Runtime Info

Pallet Index
22
Call Index
1
First Version
v210
Current Version
v393