# L1X VM-EVM Cross Contract Calls

L1X VM-EVM Cross Contract Calls Process Flow:

1. **Client Submission:**
   * Initiates contract deployment.
   * Initializes the contract.
   * Makes a function call to the L1X core (via the L1X node).
2. **Contract Identification by L1X Core:**
   * The L1X core discerns the type of contract from three possible options: `L1XVM`, `EVM`, and `XTALK`.
3. **Execution via the EVMContractCallTrait:**
   * If the contract type is identified as EVM, the `EVMContractCallTrait` facilitates its interaction with the Ethereum Virtual Machine (EVM) for execution.
   * This trait provides two main functionalities:
     * **Contract Deployment**: Achieved through the `execute_evm_contract_deployment(args..)` function.
     * **Contract Call**: Managed with the `execute_evm_contract_call(args...)` function.
4. **Interaction with the EVMSyncApi:**
   * The `EVMSyncApi` invokes the above functions (`execute_evm_contract_deployment` and `execute_contract_function_call`) provided by the `EVMContractCallTrait`.
5. **Feedback from EVM:**
   * Once the EVM completes the execution, it generates events or results, which are then relayed back to `L1XVM`.

### Interaction with EVM&#x20;

\
L1X core uses evm and evm\_runtime crates to interact with EVM Following diagram shows how the mint event interacts from L1X VM to L1X-EVM. Core uses Sputnik EVM\
\
\
L1X core has the execution module which facilitates to execute different contract types and can be extended via traits to support different ecosystems.

<figure><img src="https://879140870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTLmER6Ab8VaxeOI6Vla%2Fuploads%2F0z4tuLcfufdjXfTZ4vOK%2FCall%20L1X-EVM%20contract%20from%20L1X-VM%20conract.jpg?alt=media&#x26;token=541b4716-4122-4be6-a400-6fbc63dcb28f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://879140870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTLmER6Ab8VaxeOI6Vla%2Fuploads%2F0x6vOw6Kksl2o2zYdqZV%2FCall%20L1X-EVM%20contract%20from%20L1X-VM%20conract(4).jpg?alt=media&#x26;token=842cd41a-da84-4a66-9e48-f2ec3839d3f1" alt=""><figcaption></figcaption></figure>

Deployment flow

<figure><img src="https://879140870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTLmER6Ab8VaxeOI6Vla%2Fuploads%2F8SFn7zCk6EhLYUoMmwqd%2FFlowchart.jpg?alt=media&#x26;token=61c88f3f-33df-4d1e-bacb-f34995c4300f" alt=""><figcaption></figcaption></figure>
