xWinSwapV3Pancake
SwapMethod
enum SwapMethod {
UNISWAPV2,
UNISWAPV3,
UNISWAPV3Multihop
}
SwapInfo
struct SwapInfo {
address router;
address[] path;
bytes multihopPath;
uint24 slippage;
uint24 poolFee;
enum xWinSwapV3Pancake.SwapMethod swapMethod;
}
Received
event Received(address, uint256)
receive
receive() external payable
onlyExecutor
modifier onlyExecutor()
swapData
mapping(address => mapping(address => struct xWinSwapV3Pancake.SwapInfo)) swapData
Mapping containing swapInfo, for swap pair fromToken, toToken
executors
mapping(address => bool) executors
priceMaster
contract IxWinPriceMaster priceMaster
initialize
function initialize() external
swapTokenToToken
function swapTokenToToken(uint256 _amount, address _fromToken, address _toToken) external returns (uint256)
Swap tokens using xWin Swap with slippage
Parameters
swapTokenToToken
function swapTokenToToken(uint256 _amount, address _fromToken, address _toToken, uint32 _slippage) public returns (uint256)
Swap tokens using xWin Swap with slippage
Parameters
internalSwap
function internalSwap(uint256 _amount, address _fromToken, address _toToken, address recipient, uint32 _slippage) internal returns (uint256)
_swapV2
function _swapV2(address _fromToken, uint256 amountIn, address[] path, address router, address destination, uint256 amountOutQuote) internal returns (uint256)
_swapV3
function _swapV3(uint256 _amount, address _fromToken, address _toToken, address _recipient, address routerV3, uint256 amountOutQuote, uint24 poolFee) internal returns (uint256)
_swapV3Multihop
function _swapV3Multihop(uint256 _amount, address _fromToken, address _recipient, address routerV3, uint256 amountOutQuote, bytes multihopPath) internal returns (uint256)
getSwapData
function getSwapData(address _fromtoken, address _totoken) external view returns (struct xWinSwapV3Pancake.SwapInfo _swapInfo)
View function to get swapInfo for a swap pair
Parameters
Return Values
struct xWinSwapV3Pancake.SwapInfo
SwapInfo for the swap pair
addTokenPath
function addTokenPath(address _fromtoken, address _totoken, address _router, address[] path, bytes _pathData, uint24 _slippage, uint24 _fee, enum xWinSwapV3Pancake.SwapMethod _swapMethod) external
_xWinStratSwap
function _xWinStratSwap(uint256 _amount, address _fromToken, address _toToken, uint32 _slippage) internal returns (bool, uint256)
adminMoveToken
function adminMoveToken(address _tokenAddress) public
setPriceMaster
function setPriceMaster(address _newPriceMaster) external
setExecutor
function setExecutor(address _address, bool _allow) external
depositToStrategy
function depositToStrategy(uint256 _amount, address _strat, uint32 _slippage) internal returns (uint256)
withdrawFromStrategy
function withdrawFromStrategy(uint256 _amount, address _strat, uint32 _slippage) internal returns (uint256)
Last updated