1.12.721 ID in operation_results array determines the operation execution result ID. An object with said ID stores the information about the deployed contract. get_object method can be used to get said object.
unlocked >>> get_object 1.12.722
The first element of the contracts_id array is the contract ID. Contract ID is used to call it.
There are two types of contract calls - a call without changing the contract's state (to receive values of variables and methods) and a call that would change the contract's state (sending a transaction).
Get ERC20 Token Balance
Fetching an account's balance in token doesn't require a transaction, hence the call_contract_no_changing_state method is used:
The last argument in the method is the hash of the contract's called method and the argument joined with the arguments that were passed along with the call. In this case 70a08231 is the hash of balanceOf(address) method, and 0000000000000000000000000000000000000000000000000000000000000536 is the "address" (derived from account ID), the balance of which we need are trying to get (zeroes are added to increase the size of the address to 32 bytes). This address belongs to Echo account 1.2.1334. More information on converting the IDs to address formats can be found in EVM. Introduction .
The result of executing the call is "0000000000000000000000000000000000000000000000000000000000002710" string, which equaks the balance of 10000 tokens that were added to the account's balance on contract deployment.
Transfer ERC20 Token
Token transfer is an operation that requires a transaction. call_contract method is used for it:
As a result of the transfer, the contract calls an event Transfer(address indexed from, address indexed to, uint256 value); event. The logs can be viewed via getContractResult method, and adding operation execution result ID to argument: