[Docs] Improve docs for inter contract invocations
The documentation does not say much about entry points when discussing invocation of other contracts. https://ligolang.org/docs/advanced/entrypoints-contracts#inter-contract-invocations
Basically, now, it only shows how to resolve a default entry point from an address using Tezos.get_contract_opt
. It's not completely obvious what it means to get a contract of type parameter contract option
.
I think it could be improved in the following ways.
First, from Slack conversations with @tomjack (an example of what happens if Tezos.get_contract_opt
returns a contract of type nat contract
):
Tezos.get_contract_opt addr : nat
contract option meansCONTRACT nat
. It can work in three different ways:
The contract is just parameter
nat
, like you said.The contract has a
nat %default
entrypoint:parameter (or (nat %default) ...)
The address has an entrypoint
"KT1...%entry"
and the contract has a matching entrypoint:parameter (or (nat %entry) ...)
Second, the description of get_entrypoint_opt
from the reference manual API/Tezos https://ligolang.org/docs/reference/current-reference/ can be incorporated (and extended) into the contract invocations section.