DefaultRouter
Inherits: DefaultAdapter
Base contract for all Synapse Routers, that is able to natively work with Default Pools due to the fact that it inherits from DefaultAdapter.
Functions
_doSwap
Performs a "swap from tokenIn" following instructions from query
.
query
will include the router adapter to use, and the exact type of "tokenIn -> tokenOut swap"
should be encoded in query.rawParams
.
function _doSwap(
address recipient,
address tokenIn,
uint256 amountIn,
SwapQuery memory query
)
internal
returns (address tokenOut, uint256 amountOut);
_pullToken
Pulls a requested token from the user to the requested recipient. Or, if msg.value was provided, check that ETH_ADDRESS was used and msg.value is correct.
function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled);