Understanding the Functions
As seen in the architecture, the omnichain framework flow is divided into 2 major parts -
- Inbound Flow
- Outbound Flow
For both the above flows, there are a certain set of functions which needs to be called/implemented for flow completion. The implementation can be broken into 2 parts -
- Functions on third-party chain's contract (i.e. source and destination contracts) - the request gets initiated from the source contract and finally reaches the destination contract via Router's middleware contract. On third-party chain, contracts will need to -
- Functions on Router chain's middleware contract - the inbound request will invoke the Router chain's middleware contract which will then create an outbound request for execution on the destination chain. Post the execution of the outbound request, the middleware contract also gets the acknowledgment back on the execution status from the destination chain. On Router chain, middleware contracts will need to -
- Handle the inbound request from source chain (HandleIReceive)
- Create a outbound request for the destination chain (CrosschainCall)
- Handle the outbound acknowledgment request from destination chain (HandleIack)