Invoker
The Invoker contract enables users to trigger cross-chain borrowing and collateral removal actions using the native token of any chain, not just the chain where the selected Controller contract resides.
This addresses a key UX challenge: operations like borrow
or removeCollateral
are initiated in the Controller, which may reside on a different chain from the involved SToken chain. Without the Invoker, users would need to pay gas fees in the Controller’s native token, creating unnecessary friction in cross-chain interactions.
Why It Matters
Imagine a user with assets on Polygon who wants to borrow using a Controller contract on Ethereum:
- Without the Invoker: They must pay gas fees in ETH, even though their funds are on Polygon.
- With the Invoker: They can initiate the borrow from Polygon and pay in POL.
The Invoker adds an extra cross-chain message to the process, which slightly increases fees and latency, but offers maximum flexibility and better UX.
Architecture
The Invoker
integrates with:
- The
Router
on the same chain to send the message - The
Controller
on a remote chain to initiate the operation
It acts as a secure gateway for abstracting away the complexities of where Controllers reside, letting users interact from anywhere.
Summary
The Invoker contract is a powerful tool for enhancing UX in a multi-chain DeFi environment. It enables:
-
Decoupled operations: Call borrow or removeCollateral from any chain.
-
Fee flexibility: Pay gas in the native token of your current chain.
-
Router integration: Routes cross-chain calls to the correct Controller.
-
Admin controls: Restrict supported Soul contracts with ACL roles.
By introducing a thin abstraction between the user and the Controller, the Invoker offers a smooth cross-chain experience, especially for dApps built on top of Soul.