import { DexExchangeBuildParam } from '../types'; import { OptimalRate, OptimalSwap, OptimalSwapExchange } from '@paraswap/core'; import { DepositWithdrawReturn } from '../dex/weth/types'; import { Executors, Flag } from './types'; import { DexCallDataParams, ExecutorBytecodeBuilder, SingleSwapCallDataParams } from './ExecutorBytecodeBuilder'; export type Executor03SingleSwapCallDataParams = { swap: OptimalSwap; swapExchangeIndex: number; }; export type Executor03DexCallDataParams = { swapExchange?: OptimalSwapExchange; maybeWethCallData?: DepositWithdrawReturn; }; /** * Class to build bytecode for Executor03 - simpleSwap (SINGLE_STEP) with 100% on a path and multiSwap with 100% amounts on each path (HORIZONTAL_SEQUENCE) */ export declare class Executor03BytecodeBuilder extends ExecutorBytecodeBuilder { type: Executors; /** * Executor03 Flags: * switch (flag % 4): * case 0: don't instert fromAmount * case 1: sendEth equal to fromAmount * case 2: sendEth equal to fromAmount + insert fromAmount * case 3: insert fromAmount * switch (flag % 3): * case 0: don't check balance after swap * case 1: check eth balance after swap * case 2: check destToken balance after swap */ protected buildSimpleSwapFlags(priceRoute: OptimalRate, exchangeParams: DexExchangeBuildParam[], routeIndex: number, swapIndex: number, swapExchangeIndex: number, exchangeParamIndex: number, maybeWethCallData?: DepositWithdrawReturn): { dexFlag: Flag; approveFlag: Flag; }; protected buildMultiMegaSwapFlags(priceRoute: OptimalRate, exchangeParams: DexExchangeBuildParam[], routeIndex: number, swapIndex: number, swapExchangeIndex: number, exchangeParamIndex: number, maybeWethCallData?: DepositWithdrawReturn): { dexFlag: Flag; approveFlag: Flag; }; protected buildSingleSwapCallData(params: SingleSwapCallDataParams): string; protected buildDexCallData(params: DexCallDataParams): string; getAddress(): string; buildByteCode(priceRoute: OptimalRate, exchangeParams: DexExchangeBuildParam[], sender: string, maybeWethCallData?: DepositWithdrawReturn): string; /** * Find the position of an amount in calldata, trying both positive and * negative encodings. For uint128 mode (is128), searches for 16-byte * int128 patterns and returns the 32-byte slot position for mstore. */ private findAmountPosWithFallback; /** * Find the byte position of a 128-bit amount in calldata. * Searches for both positive and negative int128 encodings. * Returns the 32-byte slot position (16 bytes before the int128 value) * so that mstore with uint128 mode writes to the correct lower 16 bytes. */ private findAmount128PosInCalldata; /** Find a hex pattern in calldata, only accepting byte-aligned matches. */ private findByteAligned; private addMetadata; }