File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/contracts/extensions/paraswap-adapters Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -75,8 +75,7 @@ abstract contract BaseParaSwapBuyAdapter is BaseParaSwapAdapter {
7575 require (balanceBeforeAssetFrom >= maxAmountToSwap, 'INSUFFICIENT_BALANCE_BEFORE_SWAP ' );
7676 uint256 balanceBeforeAssetTo = assetToSwapTo.balanceOf (address (this ));
7777
78- address tokenTransferProxy = augustus.getTokenTransferProxy ();
79- assetToSwapFrom.safeApprove (tokenTransferProxy, maxAmountToSwap);
78+ assetToSwapFrom.safeApprove (address (augustus), maxAmountToSwap);
8079
8180 if (toAmountOffset != 0 ) {
8281 // Ensure 256 bit (32 bytes) toAmountOffset value is within bounds of the
@@ -102,7 +101,7 @@ abstract contract BaseParaSwapBuyAdapter is BaseParaSwapAdapter {
102101 }
103102
104103 // Reset allowance
105- assetToSwapFrom.safeApprove (tokenTransferProxy , 0 );
104+ assetToSwapFrom.safeApprove (address (augustus) , 0 );
106105
107106 uint256 balanceAfterAssetFrom = assetToSwapFrom.balanceOf (address (this ));
108107 amountSold = balanceBeforeAssetFrom - balanceAfterAssetFrom;
Original file line number Diff line number Diff line change @@ -72,9 +72,7 @@ abstract contract BaseParaSwapSellAdapter is BaseParaSwapAdapter {
7272 require (balanceBeforeAssetFrom >= amountToSwap, 'INSUFFICIENT_BALANCE_BEFORE_SWAP ' );
7373 uint256 balanceBeforeAssetTo = assetToSwapTo.balanceOf (address (this ));
7474
75- address tokenTransferProxy = augustus.getTokenTransferProxy ();
76- assetToSwapFrom.safeApprove (tokenTransferProxy, 0 );
77- assetToSwapFrom.safeApprove (tokenTransferProxy, amountToSwap);
75+ assetToSwapFrom.safeApprove (address (augustus), amountToSwap);
7876
7977 if (fromAmountOffset != 0 ) {
8078 // Ensure 256 bit (32 bytes) fromAmount value is within bounds of the
@@ -99,6 +97,9 @@ abstract contract BaseParaSwapSellAdapter is BaseParaSwapAdapter {
9997 }
10098 }
10199
100+ // Reset allowance
101+ assetToSwapFrom.safeApprove (address (augustus), 0 );
102+
102103 require (
103104 assetToSwapFrom.balanceOf (address (this )) == balanceBeforeAssetFrom - amountToSwap,
104105 'WRONG_BALANCE_AFTER_SWAP '
You can’t perform that action at this time.
0 commit comments