submitFastBid

Kairos transactions, or fastBids, are calls to the FastLane Auction Handler's submitFastBid function, which then calls the fastLaneCall function in the searcher's own contract.

function submitFastBid(
    uint256 fastGasPrice, 
    address searcherToAddress,
    bytes calldata searcherCallData 
) external payable
  1. fastGasPrice (type uint256): The price per gas (in gwei) that the searcher is bidding. The final bid amount to be paid by the searcher is the gas consumption of fastLaneCall * fastGasPrice.

  2. searcherToAddress (type address): The address of the searcher’s smart contract (or proxy contract, if applicable).

  3. searcherCallData (type bytes): The data used to call the searcher’s smart contract.

Example:

const { ethers } = require('ethers');
const abi = require('./FastLaneAuctionHandlerAbi.json');

const PRIVATE_KEY = '0xMyPrivateKey';
const signer = new ethers.Wallet(PRIVATE_KEY);

const fastGasPrice = 10 * 1e9; // 10 gwei

// Your contract,
// Implementing `fastLaneCall(address,uint256,bytes) external payable returns (bool, bytes)`
const searcherContract = '0xeA26974363EC1dBc132C99cF9A29273B17254aE3';

// FastLane Current Contract
const auctionHandler = '0xf5DF545113DeE4DF10f8149090Aa737dDC05070a';

// Assuming as a searcher I intend to use _searcherCallDataBytes
// when received on my searcher contract `fastLaneCall(` callback
// to then trigger searcherContract.doMEV(uint256,string);

// See: Searcher Call Data section of the docs for more informations
const searcherAbi = [`function doMEV(uint256, string)`];

const iface = new ethers.utils.Interface(searcherAbi);

// Grab bytes for doMEV(uint256, string)
const searcherCallDataBytes = iface.encodeFunctionData('doMEV', [
  ethers.utils.parseEther('1.0'),
  'hello'
]);

const AuctionHandlerContract = new ethers.Contract(auctionHandler, abi, signer);

async function createKairosTransaction() {
  const tx = await AuctionHandlerContract.populateTransaction.submitFastBid(
    fastGasPrice,
    searcherContract,
    searcherCallDataBytes
  );

  tx.chainId = 137;
  const signedSearcherTx = await signer.signTransaction(tx);
  console.log(
    'Precomputed searcherTxHash:',
    ethers.utils.keccak256(signedSearcherTx)
  );

  console.log(signedSearcherTx);
  return signedSearcherTx;
}

createKairosTransaction();

Last updated