generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Aave ParaSwap Adapters #27
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
Open
miguelmtzinf
wants to merge
8
commits into
bgd-labs:main
Choose a base branch
from
aave:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
744e1ee
feat: revamp of paraswap adapters (#12)
miguelmtzinf ac087c4
fix: rename variable in psp.js (#14)
parth-15 cb77b7f
fix: move common function to base contract (#13)
parth-15 820705a
fix: Resolve conflicts agains BGD upstream remote main chain (#15)
miguelmtzinf 9b3f933
Merge branch 'main' into fix/upstream-conflicts
miguelmtzinf 7ae5938
Merge pull request #16 from aave/fix/upstream-conflicts
miguelmtzinf 530cde1
chore: add dependency-review action workflow
absis 8f1e84a
Merge pull request #20 from aave/francesc/devops-980-implement-depend…
absis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: 'Dependency Review' | ||
| on: [pull_request] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 'Checkout Repository' | ||
| uses: actions/checkout@v5 | ||
| - name: 'Dependency Review' | ||
| uses: actions/dependency-review-action@v4 | ||
| with: | ||
| comment-summary-in-pr: on-failure | ||
| fail-on-severity: moderate | ||
| license-check: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,3 +15,4 @@ node_modules | |
|
|
||
| # ignore foundry deploy artifacts | ||
| broadcast/ | ||
|
|
||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule aave-address-book
updated
166 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.10; | ||
|
|
||
| import {IPoolAddressesProvider} from '@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol'; | ||
| import {DataTypes, ILendingPool} from 'aave-address-book/AaveV2.sol'; | ||
| import {IParaSwapAugustusRegistry} from './dependencies/paraswap/IParaSwapAugustusRegistry.sol'; | ||
| import {BaseParaSwapAdapter} from './base/BaseParaSwapAdapter.sol'; | ||
| import {ParaSwapLiquiditySwapAdapter} from './base/ParaSwapLiquiditySwapAdapter.sol'; | ||
|
|
||
| /** | ||
| * @title ParaSwapLiquiditySwapAdapterV2 | ||
| * @notice ParaSwap Adapter to perform a swap of collateral from one asset to another. | ||
| * @dev It is specifically designed for Aave V2 | ||
| * @author Aave Labs | ||
| **/ | ||
| contract ParaSwapLiquiditySwapAdapterV2 is ParaSwapLiquiditySwapAdapter { | ||
| /** | ||
| * @dev Constructor | ||
| * @param addressesProvider The address of the Aave PoolAddressesProvider contract | ||
| * @param pool The address of the Aave Pool contract | ||
| * @param augustusRegistry The address of the Paraswap AugustusRegistry contract | ||
| * @param owner The address of the owner | ||
| */ | ||
| constructor( | ||
| IPoolAddressesProvider addressesProvider, | ||
| address pool, | ||
| IParaSwapAugustusRegistry augustusRegistry, | ||
| address owner | ||
| ) ParaSwapLiquiditySwapAdapter(addressesProvider, pool, augustusRegistry, owner) { | ||
| // Intentionally left blank | ||
| } | ||
|
|
||
| /// @inheritdoc BaseParaSwapAdapter | ||
sakulstra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| function _getReserveData( | ||
| address asset | ||
| ) internal view override returns (address, address, address) { | ||
| DataTypes.ReserveData memory reserveData = ILendingPool(address(POOL)).getReserveData(asset); | ||
| return ( | ||
| reserveData.variableDebtTokenAddress, | ||
| reserveData.stableDebtTokenAddress, | ||
| reserveData.aTokenAddress | ||
| ); | ||
| } | ||
|
|
||
| /// @inheritdoc BaseParaSwapAdapter | ||
| function _supply( | ||
| address asset, | ||
| uint256 amount, | ||
| address to, | ||
| uint16 referralCode | ||
| ) internal override { | ||
| ILendingPool(address(POOL)).deposit(asset, amount, to, referralCode); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.