post https://example.com/api/rest/v1/capital/contract-instances//evm/call
This endpoint executes a read-only call on an EVM contract.
Contract Instance ID
The contract instance ID in the path parameter can be obtained by querying the contract instances info endpoint:
GET /api/rest/v1/capital/contract-instances/info?address=<contract_address>&limit=10
Request Body Parameters
fromAddressID
(uint64): (optional) the id of the caller addressdata
(string): ABI encoded method ID and parameters. This is the encoded function call data that will be executed on the contract.
ABI Encoded Method ID and Parameters
The data
parameter follows the ABI encoding specification. For more details, see:
https://docs.soliditylang.org/en/latest/abi-spec.html
EXAMPLE: Calling balanceOf(address) function
- Function: balanceOf(address)
- Address: 0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae
Encoded Data Breakdown
-
Function selector (first 4 bytes of keccak256 hash of "balanceOf(address)"):
0x70a08231
-
Address parameter (32 bytes, padded):
000000000000000000000000de0b295669a9fd93d5f28d9ec85e40f4cb697bae
-
Complete encoded call data:
0x70a08231000000000000000000000000de0b295669a9fd93d5f28d9ec85e40f4cb697bae