Using Native Atomic Composability
Cross-interface calls go through the gateway contract of the caller's interface. The sections below describe how to initiate a cross-interface call from each interface.
EVM to Michelson
The EVM-to-Michelson gateway is a precompile deployed at:
0xff00000000000000000000000000000000000007
callMichelson
Call a Michelson contract by providing:
| Parameter | Type | Description |
|---|---|---|
destination | address | The KT1 contract address on the Michelson interface |
entrypoint | string | The target entrypoint name |
data | bytes | Michelson-encoded parameters |
interface IRuntimeGateway {
function callMichelson(
address destination,
string calldata entrypoint,
bytes calldata data
) external payable;
}
IRuntimeGateway gateway = IRuntimeGateway(
0xff00000000000000000000000000000000000007
);
gateway.callMichelson(kt1Address, "default", michelsonParams);
The data parameter must be encoded in Michelson binary format. On-chain encoding libraries are available to help construct these payloads from within Solidity contracts.
FA1.2 wrapper
For calling FA1.2 token contracts specifically, a convenience precompile is available at:
0xff00000000000000000000000000000000ffff09
This precompile provides approve and transfer methods that handle Michelson parameter encoding automatically, without requiring manual binary encoding.
Michelson to EVM
The Michelson-to-EVM gateway is an enshrined contract deployed at:
KT18oDJJKXMKhfE1bSuAPGp92pYcwVDiqsPw
call_evm
Call an EVM contract by providing the same parameters as the EVM-to-Michelson gateway: the destination address, entrypoint selector, and ABI-encoded data. Additionally, it accepts as an optional parameter a callback, which takes the form of a Michelson contract address. This addresses the specifics of Michelson, in which contract calls do not return a value.
ERC-20 wrapper
For calling ERC-20 token contracts specifically, a convenience contract is available at:
KT18oDJJKXMKhfE1bSuAPGp92pYcwVKvCChb
This contract provides approve and transfer methods with a Michelson-friendly interface.
Return values
Return values from cross-interface calls are encoded in the callee's native format:
- EVM → Michelson: The Michelson return value is ABI-encoded as bytes and returned to the calling Solidity contract. For non-effectful calls (read-only views), use the
call_viewentry point on the Michelson gateway. - Michelson → EVM: The EVM return value (ABI-encoded bytes) is passed back to a callback contract specified via the
KT1<MERG>%with_resultentrypoint. The callback contract must implement handling for the raw bytes.
On-chain libraries for encoding and decoding across runtimes are provided to simplify this.
Gas and fees
When making a cross-interface call, the caller does not set an explicit gas limit for the callee — the runtime converts the caller's remaining gas automatically using the conversion coefficient. See Resources for details.
Fees for cross-interface transactions follow the same structure as single-interface transactions. The total fee covers execution in both runtimes.