Transfers are created by xApps calling xcall on the Spoke contracts:

   * @notice creates a xcall new intent
   * @param _destination the destination chainId
   * @param _to The destination address of the intent
   * @param _inputAsset The asset address on origin
   * @param _outputAsset The asset address on destination
   * @param _amount The amount of the asset
   * @param _data The data of the intent
   * @return _intentId The ID of the intent
   * @return _intent The intent object
  function xcall(
    uint32 _destination,
    address _to,
    address _inputAsset,
    address _outputAsset,
    uint256 _amount,
    bytes calldata _data
  ) external returns (bytes32 _intentId, Intent memory _intent);

Routers will watch for XCalled events, calculate the cost of execution, and submit a bid to the Auctioneer on the clearing chain. The Auctioneer selects the router by honoring the bid with the lowest fees.

Once the auction period elapses, the winning router will call execute on the Spoke contracts:

   * @notice executes an intent
   * @param _intent The intent structure
   * @param _fee The fee paid to cover relaying the message
   * @return _fillMessage The enqueued fill message
  function execute(Intent calldata _intent, uint256 _fee) external returns (FillMessage memory _fillMessage);

xcall and execute thinly wrap the newIntent and fillIntent functions. Once both messages arrive on the clearing chain, the transfer can be settled to the winning router.

What if no routers bid?

If no routers bid, users can increase the fees going to the solver by calling bumpTransfer with the native or input asset on the origin chain.

What if the winning router fails to execute?

The winning router will have a predefined window to execute the transfer. The timestamp of execution will be passed back to the clearing chain in the dispatched FillMessage for enforcement.

If this window elapses and the router fails to execute, the intent will be open to any router who will take the MAX_FEE as defined by the protocol plus any added fees.

Last updated