L1X VM Cross-Contract Calls

eBPF runtime allows a smart-contract to call another smart-contract's function. The smart-contract is halted until the called smart-contract finishes execution.

When Smart-Contract A calls Smart-Contract B, the is Smart-Contract B is executed in the following context:

  1. The caller_address() API function will return the Smart-Contract A contract instance address

  2. transfer_from_caller() API function will transfer tokens from Smart-Contract A balance to Smart-Contract B balance

  3. contract_instance_address API function will return Smart-Contract B contract instance address

  4. contract_owner_address API function will return Smart-Contract B contract owner address

  5. If Smart-Contract A has been called in read-only context then Smart-Contract B will be called in the same context. It means Smart-Contract B will not be able to modify its own persistent storage.

Diagram

Last updated