Skip to main content

IGenericButtonswapRouterErrors

Errors

NonWETHSender

Thrown when ETH is sent by address other than WETH contract

error NonWETHSender(address sender);

Parameters

NameTypeDescription
senderaddressThe sender of the ETH

NonWethToken

WETH transfer failed

Thrown when a different token address is provided where WETH address is expected\

error NonWethToken(address weth, address token);

Parameters

NameTypeDescription
wethaddressThe address of WETH
tokenaddressThe address of the token

NonEthToken

Thrown when input is a token instead of should be ETH (0x address)

error NonEthToken(address token);

Parameters

NameTypeDescription
tokenaddressThe address of the token

IncorrectButtonUnderlying

Thrown when the underlying token doesn't match that of the buttonToken

error IncorrectButtonUnderlying(address buttonToken, address underlyingToken, address token);

Parameters

NameTypeDescription
buttonTokenaddressThe address of the buttonToken
underlyingTokenaddressThe address of the underlying token
tokenaddressThe address of the token provided

IncorrectBalance

Thrown when the amountIn doesn't match the router's current balance of IERC20 token

error IncorrectBalance(address token, uint256 balance, uint256 amountIn);

Parameters

NameTypeDescription
tokenaddressThe address of the token
balanceuint256The balance of the token
amountInuint256

ExcessiveInputAmount

Thrown when the calculated input amount exceeds the specified maximum

error ExcessiveInputAmount(uint256 amountInMax, uint256 amount);

Parameters

NameTypeDescription
amountInMaxuint256The maximum amount of input token
amountuint256The amount of input token

InsufficientOutputAmount

Thrown when insufficient tokens are returned in an operation

error InsufficientOutputAmount(uint256 amountOutMin, uint256 amount);

Parameters

NameTypeDescription
amountOutMinuint256The minimum amount of output token
amountuint256The amount of output token

Expired

Thrown when the deadline is exceeded

error Expired(uint256 deadline, uint256 timestamp);

Parameters

NameTypeDescription
deadlineuint256The deadline
timestampuint256The current timestamp