Swaps
The wrapper contract can be used to directly swap to or from RBTC without requiring an additional transaction to wrap or unwrap WRBTC.
convertByPath converts the token to any other token in the sovryn swap network by following a predefined conversion path and transfers the result tokens to a target account. Please note that either the source or target token address has to be WRBTC. If the source is not RBTC, the wrapper contract should already have been given allowance of the source token. The wrapping or unwrapping of WRBTC is handled the wrapper contract.
function convertByPath(IERC20Token[] memory _path, uint256 _amount, uint256 _minReturn)
returns(uint256)
Arguments
_amount
uint256
amount to convert from, in the source token
_minReturn
uint256
if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero
Returns
The amount of tokens to receive from the conversion.
Last updated