Logic Context
In Coco, the power of Logic Context allows effortless access to data associated with the invoked or deployed logic. With a simple one-liner, developers can retrieve crucial information, including addresses, stored tokens, and other relevant values tied to the logic.
Logic context only has the __addr__
method defined on it.
Participant Context
Coco is a context-oriented programming language that facilitates smooth communication and interaction between participants in a logic call. By accessing the participant context, developers can retrieve vital information like funds, addresses, and other values, streamlining the logic flow.
Only
Sender
participant context is supported, Receiver
participant context is not supported yet in cocolang v0.3.0coco MyContract
endpoint invokable LogicAddress() -> (addr Address):
addr = Address(MyContract)
endpoint invokable Reflect() -> (addr Address):
yield addr Address(Sender)