minor fixing

This commit is contained in:
pradyuman-verma 2022-05-12 01:03:33 +05:30
parent 7b3b5035e3
commit fc0c7f7910
No known key found for this signature in database
GPG Key ID: E36FD6BC8923221F

View File

@ -36,8 +36,10 @@ contract Helpers is DSMath, Basic {
IHopRouter router = IHopRouter(params.router);
uint256 nativeTokenAmt = isNative ? params.amount : 0;
TokenInterface tokenContract = TokenInterface(params.token);
approve(tokenContract, params.router, params.amount);
if (!isNative) {
TokenInterface tokenContract = TokenInterface(params.token);
approve(tokenContract, params.router, params.amount);
}
router.swapAndSend{ value: nativeTokenAmt }(
params.targetChainId,