diff --git a/contracts/prebuilts/account/utils/UniswapHelper.sol b/contracts/prebuilts/account/utils/UniswapHelper.sol index 39b541621..7063ce3f0 100644 --- a/contracts/prebuilts/account/utils/UniswapHelper.sol +++ b/contracts/prebuilts/account/utils/UniswapHelper.sol @@ -19,6 +19,7 @@ abstract contract UniswapHelper { uint256 minSwapAmount; uint24 uniswapPoolFee; uint8 slippage; + bool wethIsNativeAsset; } /// @notice The Uniswap V3 SwapRouter contract @@ -85,6 +86,9 @@ abstract contract UniswapHelper { } function unwrapWeth(uint256 amount) internal { + if (uniswapHelperConfig.wethIsNativeAsset) { + return; + } IPeripheryPayments(address(uniswap)).unwrapWETH9(amount, address(this)); } diff --git a/src/test/smart-wallet/token-paymaster/TokenPaymaster.t.sol b/src/test/smart-wallet/token-paymaster/TokenPaymaster.t.sol index fed3bf3d5..4fcbe9907 100644 --- a/src/test/smart-wallet/token-paymaster/TokenPaymaster.t.sol +++ b/src/test/smart-wallet/token-paymaster/TokenPaymaster.t.sol @@ -115,7 +115,8 @@ contract TokenPaymasterTest is BaseTest { UniswapHelper.UniswapHelperConfig memory uniswapHelperConfig = UniswapHelper.UniswapHelperConfig({ minSwapAmount: 1, slippage: 5, - uniswapPoolFee: 3 + uniswapPoolFee: 3, + wethIsNativeAsset: false }); paymaster = new TokenPaymaster(