IAutoSwapperWstethSdex

Git Source

Interface for the AutoSwapperWstethSdex contract that provides automated token swapping functionality.

Functions

swapWstethToSdex

Swap wstETH to SDEX.

function swapWstethToSdex() external;

sweep

Admin function to send the contract token balance to a specified address.

function sweep(address token, address to, uint256 amount) external;

Parameters

NameTypeDescription
tokenaddressThe address of the token to send.
toaddressThe recipient address.
amountuint256The amount of tokens to send.

updateSwapSlippage

Updates the allowed slippage percentage for swaps.

function updateSwapSlippage(uint256 swapSlippage) external;

Parameters

NameTypeDescription
swapSlippageuint256The new slippage value (in basis points).

Events

FailedSwap

Emitted when a swap fails.

event FailedSwap();

SwapSlippageUpdated

Emitted when the swap slippage percentage is updated.

event SwapSlippageUpdated(uint256 newSwapSlippage);

Parameters

NameTypeDescription
newSwapSlippageuint256The new swap slippage (in basis points).

Errors

AutoSwapperSwapFailed

Thrown when a swap fails.

error AutoSwapperSwapFailed();

AutoSwapperInvalidSwapSlippage

Thrown when slippage configuration is invalid.

error AutoSwapperInvalidSwapSlippage();

AutoSwapperInvalidCaller

Thrown when the caller is not authorized to perform the operation.

error AutoSwapperInvalidCaller();