IGenericButtonswapRouter
Inherits: IGenericButtonswapRouterErrors
Functions
factory
Returns the address of the Buttonswap Factory
function factory() external view returns (address factory);
Returns
Name | Type | Description |
---|---|---|
factory | address | The address of the Buttonswap Factory |
WETH
Returns the address of the WETH token
function WETH() external view returns (address WETH);
Returns
Name | Type | Description |
---|---|---|
WETH | address | The address of the WETH token |
swapExactTokensForTokens
function swapExactTokensForTokens(
address tokenIn,
uint256 amountIn,
uint256 amountOutMin,
SwapStep[] calldata swapSteps,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
swapTokensForExactTokens
swapExactTokensForTokens( 510**18, 510**18, [ IGenericButtonswapRouter.SwapStep(ButtonswapOperations.Swap.WRAP_ETH, address(0), address(weth)), IGenericButtonswapRouter.SwapStep(ButtonSwapOperation.Swap.SWAP, address(weth), address(stETH)) ], toAddress, deadline );
function swapTokensForExactTokens(
address tokenIn,
uint256 amountOut,
uint256 amountInMax,
SwapStep[] calldata swapSteps,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
addLiquidity
swapTokensForExactTokens( 510**18, 510**18, [ IGenericButtonswapRouter.SwapStep(ButtonSwapOperation.Swap.SWAP, address(steth), address(buttonRocketEth)) IGenericButtonswapRouter.SwapStep(ButtonswapOperations.Swap.UNWRAP_BUTTON, address(buttonRocketEth), address(rocketETH)), ], toAddress, deadline );
function addLiquidity(
AddLiquidityStep calldata addLiquidityStep,
SwapStep[] calldata swapStepsA,
SwapStep[] calldata swapStepsB,
uint16 movingAveragePrice0ThresholdBps,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
removeLiquidity
addLiquidity( IGenericButtonswapRouter.AddLiquidityStep( ButtonswapOperations.AddLiquidity.ADD_LIQUIDITY, address(weth), address(buttonRocketEth), 4000 10**18, 2 1018, 3800 * 1018, 1 * 10**18, ), [ IGenericButtonswapRouter.SwapStep(ButtonSwapOperation.Swap.WRAP_WETH, address(0), address(weth)) IGenericButtonswapRouter.SwapStep(ButtonswapOperations.Swap.WRAP_BUTTON, address(weth), address(buttonWeth)), ], [ IGenericButtonswapRouter.SwapStep(ButtonSwapOperation.Swap.WRAP_BUTTON, address(rocketETH), address(buttonRocketEth)) ], toAddress, deadline );
function removeLiquidity(
RemoveLiquidityStep calldata removeLiquidityStep,
SwapStep[] calldata swapStepsA,
SwapStep[] calldata swapStepsB,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
Structs
SwapStep
struct SwapStep {
ButtonswapOperations.Swap operation;
address tokenOut;
}
AddLiquidityStep
struct AddLiquidityStep {
ButtonswapOperations.AddLiquidity operation;
address tokenA;
address tokenB;
uint256 amountADesired;
uint256 amountBDesired;
uint256 amountAMin;
uint256 amountBMin;
}
RemoveLiquidityStep
struct RemoveLiquidityStep {
ButtonswapOperations.RemoveLiquidity operation;
address tokenA;
address tokenB;
uint256 liquidity;
uint256 amountAMin;
uint256 amountBMin;
}