
export const factoryAbi = [
]

export const queryHelperAbi = [
    'function getRoutes(address tokenA,address tokenB) view returns((uint8,uint24,address)[])',
]

export const uniswapV3PoolAbi = [
    // {
    //         // the current price
    //         uint160 sqrtPriceX96;
    //         // the current tick
    //         int24 tick;
    //         // the most-recently updated index of the observations array
    //         uint16 observationIndex;
    //         // the current maximum number of observations that are being stored
    //         uint16 observationCardinality;
    //         // the next maximum number of observations to store, triggered in observations.write
    //         uint16 observationCardinalityNext;
    //         // the current protocol fee as a percentage of the swap fee taken on withdrawal
    //         // represented as an integer denominator (1/x)%
    //         uint8 feeProtocol;
    //         // whether the pool is locked
    //         bool unlocked;
    //     }
    'function slot0() view returns(uint160,int24,uint16,uint16,uint16,uint8,bool)',
    'function token0() view returns(address)',
    'function token1() view returns(address)',
]

export const erc20Abi = [
    'function name() view returns (string)',
    'function symbol() view returns (string)',
    'function decimals() view returns (uint8)',
    'function totalSupply() view returns (uint256)',
    'function balanceOf(address) view returns (uint256)',
    'function transfer(address,uint256) returns (bool)',
    'function transferFrom(address,address,uint256) returns (bool)',
    'function approve(address,uint256) returns (bool success)',
    'function allowance(address,address) view returns (uint256)',
    'event Transfer(address indexed,address indexed,uint256)',
    'event Approval(address indexed,address indexed,uint256)',
]

export const mockErc20Abi = [...erc20Abi,
    'function mint(address,uint256)',
]

const Route = '(uint8 exchange, uint24 fee)'
const Tranche = `( 
    uint16  fraction,
    bool   startTimeIsRelative,
    bool   endTimeIsRelative,
    bool   minIsBarrier,
    bool   maxIsBarrier,
    bool   marketOrder,
    bool   _reserved5,
    bool   _reserved6,
    bool   _reserved7,
    uint8  _reserved8,
    uint32 _reserved16,
    uint32 startTime,
    uint32 endTime,
    uint32 minIntercept,
    uint32 minSlope,
    uint32 maxIntercept,
    uint32 maxSlope
)`
const SwapOrder = `(
    address tokenIn,
    address tokenOut,
    ${Route} route,
    uint256 amount,
    uint256 minFillAmount,
    bool amountIsInput,
    bool outputDirectlyToOwner,
    uint64 chainOrder,
    ${Tranche}[] tranches
)`

export const vaultAbi = [
    'function version() view returns (uint8)',
    'function withdraw(uint256 amount)',
    'function withdrawTo(address payable recipient, uint256 amount)',
    'function withdraw(address token, uint256 amount)',
    'function withdrawTo(address token, address recipient, uint256 amount)',
    'function numSwapOrders() view returns (uint64 num)',
    `function placeOrder(${SwapOrder})`,
    `function placeOrders(${SwapOrder}[], uint8 ocoMode)`,
    'function cancelOrder(uint64 orderIndex)',
    'function cancelAll()',
    // `function swapOrderStatus(uint64 orderIndex) view returns (${SwapOrderStatus} memory status)`,
    'function orderCanceled(uint64 orderIndex) view returns (bool)',
]
