From fc0c7f7910a475a87264bea8293633d05039d128 Mon Sep 17 00:00:00 2001 From: pradyuman-verma Date: Thu, 12 May 2022 01:03:33 +0530 Subject: [PATCH] minor fixing --- contracts/polygon/connectors/hop/helpers.sol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contracts/polygon/connectors/hop/helpers.sol b/contracts/polygon/connectors/hop/helpers.sol index 5f3d306a..cc74905a 100644 --- a/contracts/polygon/connectors/hop/helpers.sol +++ b/contracts/polygon/connectors/hop/helpers.sol @@ -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,