Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/aave-address-book
Submodule aave-address-book updated 401 files
57 changes: 56 additions & 1 deletion scripts/DeployMegaEth.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ import {AaveV3MegaEth} from 'aave-address-book/AaveV3MegaEth.sol';

import {OneUSDFixedAdapter} from '../src/contracts/misc-adapters/OneUSDFixedAdapter.sol';
import {CLRatePriceCapAdapter} from '../src/contracts/CLRatePriceCapAdapter.sol';
import {PriceCapAdapterStable, IPriceCapAdapterStable} from '../src/contracts/PriceCapAdapterStable.sol';
import {
PriceCapAdapterStable,
IPriceCapAdapterStable
} from '../src/contracts/PriceCapAdapterStable.sol';
import {IPriceCapAdapter, IChainlinkAggregator} from '../src/interfaces/IPriceCapAdapter.sol';

library CapAdaptersCodeMegaEth {
address public constant BTC_USD_PRICE_FEED = 0xc6E3007B597f6F5a6330d43053D1EF73cCbbE721;
address public constant ETH_USD_PRICE_FEED = 0xcA4e254D95637DE95E2a2F79244b03380d697feD;
address public constant USDT_USD_PRICE_FEED = 0xA533f4164d8d9F8C3995FC83F2f022a622d1765D;
address public constant USDC_USD_PRICE_FEED = 0x28AccABca356675fC4089eD24A3B8ADe8C5780C0;
// Deterministic address of USDCAdapterCode() (Capped USDC/USD), used as stcUSD base feed
address public constant USDC_CAPO_PRICE_FEED = 0x9182ACce3C6456955877c0BBE56107bC7239FE07;
address public constant wstETH_stETH_Exchange_Rate = 0xe020C0Abc50E6581A95cb79Ff1021728C9Ec0640;
address public constant rsETH_ETH_Exchange_Rate = 0x1de97D40C58AA167b7eaEB922f9801bcd0B12781;
address public constant ezETH_ETH_Exchange_Rate = 0x6d924215a8A8e48651F774312b7bA549c1E09df9;
address public constant stcUSD_cUSD_Exchange_Rate = 0x7055a15452B19D193fbA6ec2FF6bf7B515cf577d;
Comment thread
DhairyaSethi marked this conversation as resolved.

function USDT0AdapterCode() internal pure returns (bytes memory) {
return
Expand Down Expand Up @@ -48,6 +55,21 @@ library CapAdaptersCodeMegaEth {
);
}

function USDCAdapterCode() internal pure returns (bytes memory) {
return
abi.encodePacked(
type(PriceCapAdapterStable).creationCode,
abi.encode(
IPriceCapAdapterStable.CapAdapterStableParams({
aclManager: AaveV3MegaEth.ACL_MANAGER,
assetToUsdAggregator: IChainlinkAggregator(USDC_USD_PRICE_FEED),
adapterDescription: 'Capped USDC/USD',
priceCap: int256(1.04 * 1e8)
})
)
);
}

function oneUSDFixedAdapterCode() internal pure returns (bytes memory) {
return abi.encodePacked(type(OneUSDFixedAdapter).creationCode);
}
Expand Down Expand Up @@ -114,6 +136,27 @@ library CapAdaptersCodeMegaEth {
)
);
}

function stcUSDAdapterCode() internal pure returns (bytes memory) {
return
abi.encodePacked(
type(CLRatePriceCapAdapter).creationCode,
abi.encode(
IPriceCapAdapter.CapAdapterParams({
aclManager: AaveV3MegaEth.ACL_MANAGER,
baseAggregatorAddress: USDC_CAPO_PRICE_FEED,
Comment thread
DhairyaSethi marked this conversation as resolved.
Outdated
ratioProviderAddress: stcUSD_cUSD_Exchange_Rate,
pairDescription: 'Capped stcUSD / USDC / USD',
minimumSnapshotDelay: 14 days,
priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({
snapshotRatio: 1_063267641637362909,
snapshotTimestamp: 1779797011, // 26 May 2026 (Block: 17000000)
maxYearlyRatioGrowthPercent: 10_50
})
})
)
);
}
}

contract DeployUSDT0MegaEth is MegaEthScript {
Expand All @@ -128,6 +171,12 @@ contract DeployUSDeMegaEth is MegaEthScript {
}
}

contract DeployUSDCMegaEth is MegaEthScript {
function run() external broadcast {
GovV3Helpers.deployDeterministic(CapAdaptersCodeMegaEth.USDCAdapterCode());
}
}

contract DeployOneUSDFixedAdapterMegaEth is MegaEthScript {
function run() external broadcast {
GovV3Helpers.deployDeterministic(CapAdaptersCodeMegaEth.oneUSDFixedAdapterCode());
Expand All @@ -151,3 +200,9 @@ contract DeployEzEthMegaEth is MegaEthScript {
GovV3Helpers.deployDeterministic(CapAdaptersCodeMegaEth.ezEthAdapterCode());
}
}

contract DeployStcUSDMegaEth is MegaEthScript {
function run() external broadcast {
GovV3Helpers.deployDeterministic(CapAdaptersCodeMegaEth.stcUSDAdapterCode());
}
}
Loading