Contract
This document is a contract description for optimal trade exchange. Developers, for in-depth code details and operational guidelines, please consult our GitHub repository.
Address
Aggregator Contract: 0x8af1C50eCD5167B97e14Fc25235580c84d5ea22F
Fuctions
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.0;
interface IAggregator {
struct MultiPathSwapOut {
bytes[][] paths;
address recipient;
uint256 deadline;
address tokenIn;
address tokenOut;
uint256[] amountIns;
uint256 amountOutMinimum;
}
function multiPathSwapOut(
MultiPathSwapOut calldata params
)
external
payable
returns (
uint256 amountIn,
uint256 amountOut,
uint256 onlyOnePathAmountOut
);
}multiPathSwapOut
Used for exchanging an exact amount of tokens.
Utilized for optimal trade exchange.
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.0;
interface IWeswapV2Router {
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactWEMIXForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapExactTokensForWEMIX(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
}swapExactTokensForTokens
Used for exchanging a precise amount of tokens for different tokens.
swapExactWEMIXForTokens
Utilized for exchanging a precise amount of WEMIX for other tokens.
swapExactTokensForWEMIX
Used for exchanging a precise amount of tokens for WEMIX.
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.0;
interface IWeswapV3Router {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
function exactInputSingle(
ExactInputSingleParams calldata params
) external payable returns (uint256 amountOut);
struct ExactInputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
}
function exactInput(
ExactInputParams calldata params
) external payable returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
uint160 sqrtPriceLimitX96;
}
}exactInputSingle
Used for exchanging tokens through a single path.
Utilized for exchanging a precise amount of tokens for different tokens.
exactInput
Used for exchanging tokens through multiple paths.
Utilized for exchanging a precise amount of tokens for different tokens.
Last updated