Skip to content

Commit

Permalink
fix: Remove unnecessary approval
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Sep 3, 2024
1 parent 0e4d27b commit b7c586f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion contracts/adapters/paraswap/BaseParaSwapBuyAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ abstract contract BaseParaSwapBuyAdapter is BaseParaSwapAdapter {
uint256 balanceBeforeAssetTo = assetToSwapTo.balanceOf(address(this));

address tokenTransferProxy = augustus.getTokenTransferProxy();
assetToSwapFrom.safeApprove(tokenTransferProxy, 0);
assetToSwapFrom.safeApprove(tokenTransferProxy, maxAmountToSwap);

if (toAmountOffset != 0) {
Expand Down
3 changes: 0 additions & 3 deletions contracts/adapters/paraswap/BaseParaSwapSellAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ abstract contract BaseParaSwapSellAdapter is BaseParaSwapAdapter {
revert(0, returndatasize())
}
}

// Reset allowance
assetToSwapFrom.safeApprove(tokenTransferProxy, 0);

require(
assetToSwapFrom.balanceOf(address(this)) == balanceBeforeAssetFrom - amountToSwap,
Expand Down

0 comments on commit b7c586f

Please sign in to comment.