IRouter Interface
TheIRouter
interface defines the functions available in the Router contract, which serves as a central entry point for user interactions with the Satoshi Perps protocol.
Plugin Management
Token Operations
ETH Handling
Access Verification
Usage Notes
- Before a plugin can execute actions on behalf of a user, the user must first register it using
addPlugin()
and then approve it usingapprovePlugin()
. - The Router delegates actual execution to the Vault but serves as a security layer and convenience wrapper.
- ETH handling functions provide convenience methods for working with ETH in a WETH-based system.
Security Considerations
- Only approved plugins can execute actions on behalf of users
- Users should only approve trusted plugins as they will have significant control over the user’s funds
- The Router does not hold user funds; it merely facilitates transfers and approvals