1inch Fusion+

FusionTaker implementation of taker provides an ability to take asset using 1inch Fusion+ protocol.

The taker comes with FusionGiver contract that serves as starting point of the take process. First, solver calls fillOrder contract function, that has the same parameters as the one in IOrderMixin interface of Limit Order Protocol. The order must contain post-interaction to deploy EscrowSrc via escrow factory with pool asset deposit to it from the maker. The FusionGiver becomes 1inch taker of the order, providing the original taker with IEscrowSrc required functionality - withdraw, cancel, rescue (calls should be to the FusionGiver contract). Public phases can be called directly on the escrow contract.

Once source escrow is created, the solver obtains proof of SrcEscrowCreated event and calls the take function of the pool with FusionTaker as taker and corresponding takerData. After validation, EscrowDst deploy is called on factory with FusionTaker assigned as 1inch order taker. Pool asset is transferred then to the escrow contract.

Then the order proceeds according to the 1inch Fusion+ protocol. On success, the maker asset in source chain is transferred to the pool (transiting though FusionGiver contract if it's a public withdraw), on cancel - back to the maker. On destination chain, cancellation returns asset back to pool (possibly though FusionTaker), on success - to a specified receiver.

Last updated