generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ceaea99
commit bd04f05
Showing
12 changed files
with
372 additions
and
239 deletions.
There are no files selected for viewing
75 changes: 42 additions & 33 deletions
75
...1_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol
This file contains 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 |
---|---|---|
@@ -1,46 +1,55 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; | ||
import {AaveV3PayloadArbitrum} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadArbitrum.sol'; | ||
import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; | ||
import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; | ||
import {PriceFeeds} from './Constants.sol'; | ||
|
||
/** | ||
* @title Update Price Cap Adapters (CAPO) | ||
* @author BGD Labs (@bgdlabs) | ||
* - Snapshot: TODO | ||
* - Discussion: TODO | ||
*/ | ||
contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { | ||
function execute() external { | ||
_updateV3PriceAdapters(); | ||
} | ||
|
||
function _updateV3PriceAdapters() internal { | ||
address[] memory assets = new address[](7); | ||
address[] memory sources = new address[](7); | ||
|
||
assets[0] = AaveV3ArbitrumAssets.USDC_UNDERLYING; | ||
sources[0] = PriceFeeds.ARBITRUM_V3_USDC_FEED; | ||
|
||
assets[1] = AaveV3ArbitrumAssets.USDCn_UNDERLYING; | ||
sources[1] = PriceFeeds.ARBITRUM_V3_USDC_FEED; | ||
|
||
assets[2] = AaveV3ArbitrumAssets.USDT_UNDERLYING; | ||
sources[2] = PriceFeeds.ARBITRUM_V3_USDT_FEED; | ||
|
||
assets[3] = AaveV3ArbitrumAssets.DAI_UNDERLYING; | ||
sources[3] = PriceFeeds.ARBITRUM_V3_DAI_FEED; | ||
|
||
assets[4] = AaveV3ArbitrumAssets.MAI_UNDERLYING; | ||
sources[4] = PriceFeeds.ARBITRUM_V3_MAI_FEED; | ||
|
||
assets[5] = AaveV3ArbitrumAssets.LUSD_UNDERLYING; | ||
sources[5] = PriceFeeds.ARBITRUM_V3_LUSD_FEED; | ||
|
||
assets[6] = AaveV3ArbitrumAssets.FRAX_UNDERLYING; | ||
sources[6] = PriceFeeds.ARBITRUM_V3_FRAX_FEED; | ||
|
||
AaveV3Arbitrum.ORACLE.setAssetSources(assets, sources); | ||
contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadArbitrum { | ||
function priceFeedsUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.PriceFeedUpdate[] | ||
memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](7); | ||
|
||
feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3ArbitrumAssets.USDC_UNDERLYING, | ||
priceFeed: PriceFeeds.ARBITRUM_V3_USDC_FEED | ||
}); | ||
feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3ArbitrumAssets.USDCn_UNDERLYING, | ||
priceFeed: PriceFeeds.ARBITRUM_V3_USDC_FEED | ||
}); | ||
feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3ArbitrumAssets.USDT_UNDERLYING, | ||
priceFeed: PriceFeeds.ARBITRUM_V3_USDT_FEED | ||
}); | ||
feedsUpdate[3] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3ArbitrumAssets.DAI_UNDERLYING, | ||
priceFeed: PriceFeeds.ARBITRUM_V3_DAI_FEED | ||
}); | ||
feedsUpdate[4] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3ArbitrumAssets.MAI_UNDERLYING, | ||
priceFeed: PriceFeeds.ARBITRUM_V3_MAI_FEED | ||
}); | ||
feedsUpdate[5] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3ArbitrumAssets.LUSD_UNDERLYING, | ||
priceFeed: PriceFeeds.ARBITRUM_V3_LUSD_FEED | ||
}); | ||
feedsUpdate[6] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3ArbitrumAssets.FRAX_UNDERLYING, | ||
priceFeed: PriceFeeds.ARBITRUM_V3_FRAX_FEED | ||
}); | ||
|
||
return feedsUpdate; | ||
} | ||
} |
56 changes: 33 additions & 23 deletions
56
..._Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol
This file contains 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
43 changes: 24 additions & 19 deletions
43
...241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol
This file contains 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 |
---|---|---|
@@ -1,34 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; | ||
import {AaveV3PayloadBNB} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadBNB.sol'; | ||
import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; | ||
import {AaveV3BNB, AaveV3BNBAssets} from 'aave-address-book/AaveV3BNB.sol'; | ||
import {PriceFeeds} from './Constants.sol'; | ||
|
||
/** | ||
* @title Update Price Cap Adapters (CAPO) | ||
* @author BGD Labs (@bgdlabs) | ||
* - Snapshot: TODO | ||
* - Discussion: TODO | ||
*/ | ||
contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { | ||
function execute() external { | ||
_updateV3PriceAdapters(); | ||
} | ||
|
||
function _updateV3PriceAdapters() internal { | ||
address[] memory assets = new address[](3); | ||
address[] memory sources = new address[](3); | ||
|
||
assets[0] = AaveV3BNBAssets.USDC_UNDERLYING; | ||
sources[0] = PriceFeeds.BNB_V3_USDC_FEED; | ||
|
||
assets[1] = AaveV3BNBAssets.USDT_UNDERLYING; | ||
sources[1] = PriceFeeds.BNB_V3_USDT_FEED; | ||
contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadBNB { | ||
function priceFeedsUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.PriceFeedUpdate[] | ||
memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](3); | ||
|
||
assets[2] = AaveV3BNBAssets.FDUSD_UNDERLYING; | ||
sources[2] = PriceFeeds.BNB_V3_FDUSD_FEED; | ||
feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3BNBAssets.USDC_UNDERLYING, | ||
priceFeed: PriceFeeds.BNB_V3_USDC_FEED | ||
}); | ||
feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3BNBAssets.USDT_UNDERLYING, | ||
priceFeed: PriceFeeds.BNB_V3_USDT_FEED | ||
}); | ||
feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3BNBAssets.FDUSD_UNDERLYING, | ||
priceFeed: PriceFeeds.BNB_V3_FDUSD_FEED | ||
}); | ||
|
||
AaveV3BNB.ORACLE.setAssetSources(assets, sources); | ||
return feedsUpdate; | ||
} | ||
} |
36 changes: 20 additions & 16 deletions
36
...41101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol
This file contains 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 |
---|---|---|
@@ -1,31 +1,35 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; | ||
import {AaveV3PayloadBase} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadBase.sol'; | ||
import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; | ||
import {AaveV3Base, AaveV3BaseAssets} from 'aave-address-book/AaveV3Base.sol'; | ||
import {PriceFeeds} from './Constants.sol'; | ||
|
||
/** | ||
* @title Update Price Cap Adapters (CAPO) | ||
* @author BGD Labs (@bgdlabs) | ||
* - Snapshot: TODO | ||
* - Discussion: TODO | ||
*/ | ||
contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { | ||
function execute() external { | ||
_updateV3PriceAdapters(); | ||
} | ||
|
||
function _updateV3PriceAdapters() internal { | ||
address[] memory assets = new address[](2); | ||
address[] memory sources = new address[](2); | ||
|
||
assets[0] = AaveV3BaseAssets.USDC_UNDERLYING; | ||
sources[0] = PriceFeeds.BASE_V3_USDC_FEED; | ||
contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadBase { | ||
function priceFeedsUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.PriceFeedUpdate[] | ||
memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](2); | ||
|
||
assets[1] = AaveV3BaseAssets.USDbC_UNDERLYING; | ||
sources[1] = PriceFeeds.BASE_V3_USDC_FEED; | ||
feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3BaseAssets.USDC_UNDERLYING, | ||
priceFeed: PriceFeeds.BASE_V3_USDC_FEED | ||
}); | ||
feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ | ||
asset: AaveV3BaseAssets.USDbC_UNDERLYING, | ||
priceFeed: PriceFeeds.BASE_V3_USDC_FEED | ||
}); | ||
|
||
AaveV3Base.ORACLE.setAssetSources(assets, sources); | ||
return feedsUpdate; | ||
} | ||
} |
Oops, something went wrong.