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:
The
caller_address()
API function will return the Smart-Contract A contract instance addresstransfer_from_caller()
API function will transfer tokens from Smart-Contract A balance to Smart-Contract B balancecontract_instance_address
API function will return Smart-Contract B contract instance addresscontract_owner_address
API function will return Smart-Contract B contract owner addressIf 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