Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use SafeERC20 #176

Merged
merged 2 commits into from
Jul 6, 2023
Merged

fix: use SafeERC20 #176

merged 2 commits into from
Jul 6, 2023

Conversation

grothem
Copy link
Contributor

@grothem grothem commented Jul 5, 2023

  • Use v1.19.0 of @aave/core-v3, which has SafeERC20 dependency
  • Changed paraswap adapter contracts to use safeApprove instead of approve

@height
Copy link

height bot commented Jul 5, 2023

This pull request has been linked to 1 task:

💡Tip: Add "Close T-12904" to the pull request title or description, to a commit message, or in a comment to mark this task as "Done" when the pull request is merged.

@grothem
Copy link
Contributor Author

grothem commented Jul 5, 2023

Link T-12904

@@ -3,12 +3,12 @@ pragma solidity ^0.8.10;

import {DataTypes} from '@aave/core-v3/contracts/protocol/libraries/types/DataTypes.sol';
import {FlashLoanSimpleReceiverBase} from '@aave/core-v3/contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol';
import {GPv2SafeERC20} from '@aave/core-v3/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep using GPv2SafeERC20 for transfers, cause its more gas effective. So add SafeERC20 and use it only for safeApprove calls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@miguelmtzinf
Copy link
Collaborator

Closes #174

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f526d94) 55.78% compared to head (4e3d5eb) 55.78%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #176   +/-   ##
=======================================
  Coverage   55.78%   55.78%           
=======================================
  Files          25       25           
  Lines         968      968           
  Branches      123      123           
=======================================
  Hits          540      540           
  Misses        428      428           
Impacted Files Coverage Δ
...racts/adapters/paraswap/BaseParaSwapBuyAdapter.sol 100.00% <100.00%> (ø)
...acts/adapters/paraswap/BaseParaSwapSellAdapter.sol 100.00% <100.00%> (ø)
...adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol 100.00% <100.00%> (ø)
...ntracts/adapters/paraswap/ParaSwapRepayAdapter.sol 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@miguelmtzinf miguelmtzinf merged commit f5d0af9 into master Jul 6, 2023
1 check passed
@miguelmtzinf miguelmtzinf deleted the fix/use-safe-erc20 branch July 6, 2023 16:23
@Vergoris06
Copy link

  • Use v1.19.0 of @aave/core-v3, which has SafeERC20 dependency
  • Changed paraswap adapter contracts to use safeApprove instead of approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants