OrderSpoke
The OrderSpoke
smart contract acts as a decentralized mechanism to securely manage order fills and handle token transfers from solver entities directly to users. It integrates with LayerZero's omnichain technology to communicate between multiple blockchain environments.
Upon creation, it instantiates an Executor
contract responsible to execute the hooks in a safe way.
The main tasks of the order spoke are:
Order Validation: Ensures orders meet conditions such as expiration deadlines, duplication prevention and primary filler restrictions.
Funds Transfer: Handles secure transfers of output tokens from the solver to the user.
Hooks Execution: Executes additional external calls if specified in the order.
Cross-chain Settlement: Sends confirmation messages to the originating chain OrderSpoke using LayerZero's messaging service upon successful order fill.
Events
OrderFilled:
Triggered after successful order execution.
TokenSweep: Emitted when tokens mistakenly sent to the contract are recovered by the owner.
Custom Errors
OrderAlreadyFilled
OrderExpired: Raised when attempting to execute an order past its deadline.
RestrictedToPrimaryFiller: Triggered when an unauthorized address attempts order execution within the primary filler exclusivity period.
ExternalCallFailed: Occurs when external hook calls do not successfully execute.
Last updated