diff --git a/src/abstract/JBSablier.sol b/src/abstract/JBSablier.sol index efd6c2d..4d10aa8 100644 --- a/src/abstract/JBSablier.sol +++ b/src/abstract/JBSablier.sol @@ -145,6 +145,10 @@ abstract contract JBSablier is ERC165, ERC1271, IUniswapV3SwapCallback { TARGET_TOKEN_IS_TOKEN0 = address(_token) < address(WETH); TARGET_TOKEN = address(_token); + // Approve tokens for transfer + IERC20(TARGET_TOKEN).approve({spender: address(PERMIT2), amount: type(uint256).max}); + WETH.approve({spender: address(PERMIT2), amount: type(uint256).max}); + POOL = IUniswapV3Pool( address( uint160( @@ -215,9 +219,6 @@ abstract contract JBSablier is ERC165, ERC1271, IUniswapV3SwapCallback { // Check if PRBProxy has been setup if (address(proxy) == address(0)) deployProxyAndInstallPlugin(); - // Approve tokens for transfer - _data.token.approve({spender: address(PERMIT2), amount: type(uint256).max}); - // Encode and proxy.execute with data for the proxy target call if user defined each *stream type* if (_data.linWithDur.length > 0) { bytes memory data = abi.encodeCall( diff --git a/test/helpers/TestBaseWorkflowV3.sol b/test/helpers/TestBaseWorkflowV3.sol index 806efa5..f411c1c 100644 --- a/test/helpers/TestBaseWorkflowV3.sol +++ b/test/helpers/TestBaseWorkflowV3.sol @@ -34,8 +34,6 @@ import '@jbx-protocol/juice-contracts-v3/contracts/libraries/JBConstants.sol'; import './AccessJBLib.sol'; -import '@paulrberg/contracts/math/PRBMath.sol'; - // Base contract for Juicebox system tests. // // Provides common functionality, such as deploying contracts on test setup for v3.