diff --git a/scripts/DeployBnb.s.sol b/scripts/DeployBnb.s.sol index daeb753..512a793 100644 --- a/scripts/DeployBnb.s.sol +++ b/scripts/DeployBnb.s.sol @@ -28,14 +28,29 @@ library CapAdaptersCodeBnb { int256(1.04 * 1e8) ) ); + bytes public constant FDUSD_ADAPTER_CODE = + abi.encodePacked( + type(PriceCapAdapterStable).creationCode, + abi.encode( + AaveV3BNB.ACL_MANAGER, + AaveV3BNBAssets.FDUSD_ORACLE, + 'Capped fdUSD/USD', + int256(1.04 * 1e8) + ) + ); } contract DeployBnbAdaptersAndPayload { function _deploy() internal returns (address) { AaveV3BnbPayload.Adapters memory adapters; - adapters.usdtAdapter = GovV3Helpers.deployDeterministic(CapAdaptersCodeBnb.USDT_ADAPTER_CODE); - adapters.usdcAdapter = GovV3Helpers.deployDeterministic(CapAdaptersCodeBnb.USDC_ADAPTER_CODE); + adapters.usdtAdapter = GovV3Helpers.predictDeterministicAddress( + CapAdaptersCodeBnb.USDT_ADAPTER_CODE + ); + adapters.usdcAdapter = GovV3Helpers.predictDeterministicAddress( + CapAdaptersCodeBnb.USDC_ADAPTER_CODE + ); + adapters.fdusdAdapter = GovV3Helpers.deployDeterministic(CapAdaptersCodeBnb.FDUSD_ADAPTER_CODE); return GovV3Helpers.deployDeterministic( diff --git a/src/contracts/payloads/AaveV3BnbPayload.sol b/src/contracts/payloads/AaveV3BnbPayload.sol index 929fda4..3df43e8 100644 --- a/src/contracts/payloads/AaveV3BnbPayload.sol +++ b/src/contracts/payloads/AaveV3BnbPayload.sol @@ -8,24 +8,30 @@ contract AaveV3BnbPayload is AaveV3PayloadBnb { struct Adapters { address usdtAdapter; address usdcAdapter; + address fdusdAdapter; } address public immutable USDT_ADAPTER; address public immutable USDC_ADAPTER; + address public immutable FDUSD_ADAPTER; constructor(Adapters memory adapters) { USDT_ADAPTER = adapters.usdtAdapter; USDC_ADAPTER = adapters.usdcAdapter; + FDUSD_ADAPTER = adapters.fdusdAdapter; } function priceFeedsUpdates() public view override returns (IEngine.PriceFeedUpdate[] memory) { - IEngine.PriceFeedUpdate[] memory updates = new IEngine.PriceFeedUpdate[](2); + IEngine.PriceFeedUpdate[] memory updates = new IEngine.PriceFeedUpdate[](3); updates[0].asset = AaveV3BNBAssets.USDT_UNDERLYING; updates[0].priceFeed = USDT_ADAPTER; updates[1].asset = AaveV3BNBAssets.USDC_UNDERLYING; updates[1].priceFeed = USDC_ADAPTER; + updates[1].asset = AaveV3BNBAssets.FDUSD_UNDERLYING; + updates[1].priceFeed = FDUSD_ADAPTER; + return updates; } }