|
| 1 | +// SPDX-License-Identifier: BUSL-1.1 |
| 2 | +pragma solidity ^0.8.0; |
| 3 | + |
| 4 | +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; |
| 5 | +import {MantleScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; |
| 6 | +import {AaveV3Mantle} from 'aave-address-book/AaveV3Mantle.sol'; |
| 7 | +import {PriceCapAdapterStable, IPriceCapAdapterStable} from '../src/contracts/PriceCapAdapterStable.sol'; |
| 8 | +import {IPriceCapAdapter, IChainlinkAggregator} from '../src/interfaces/IPriceCapAdapter.sol'; |
| 9 | + |
| 10 | +library CapAdaptersCodeMantle { |
| 11 | + address public constant USDC_PRICE_FEED = 0x22b422CECb0D4Bd5afF3EA999b048FA17F5263bD; |
| 12 | + address public constant USDT_PRICE_FEED = 0xd86048D5e4fe96157CE03Ae519A9045bEDaa6551; |
| 13 | + |
| 14 | + function USDCAdapterCode() internal pure returns (bytes memory) { |
| 15 | + return |
| 16 | + abi.encodePacked( |
| 17 | + type(PriceCapAdapterStable).creationCode, |
| 18 | + abi.encode( |
| 19 | + IPriceCapAdapterStable.CapAdapterStableParams({ |
| 20 | + aclManager: AaveV3Mantle.ACL_MANAGER, |
| 21 | + assetToUsdAggregator: IChainlinkAggregator(USDC_PRICE_FEED), |
| 22 | + adapterDescription: 'Capped USDC/USD', |
| 23 | + priceCap: int256(1.04 * 1e8) |
| 24 | + }) |
| 25 | + ) |
| 26 | + ); |
| 27 | + } |
| 28 | + |
| 29 | + function USDTAdapterCode() internal pure returns (bytes memory) { |
| 30 | + return |
| 31 | + abi.encodePacked( |
| 32 | + type(PriceCapAdapterStable).creationCode, |
| 33 | + abi.encode( |
| 34 | + IPriceCapAdapterStable.CapAdapterStableParams({ |
| 35 | + aclManager: AaveV3Mantle.ACL_MANAGER, |
| 36 | + assetToUsdAggregator: IChainlinkAggregator(USDT_PRICE_FEED), |
| 37 | + adapterDescription: 'Capped USDT/USD', |
| 38 | + priceCap: int256(1.04 * 1e8) |
| 39 | + }) |
| 40 | + ) |
| 41 | + ); |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +contract DeployUSDCMantle is MantleScript { |
| 46 | + function run() external broadcast { |
| 47 | + GovV3Helpers.deployDeterministic(CapAdaptersCodeMantle.USDCAdapterCode()); |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +contract DeployUSDTMantle is MantleScript { |
| 52 | + function run() external broadcast { |
| 53 | + GovV3Helpers.deployDeterministic(CapAdaptersCodeMantle.USDTAdapterCode()); |
| 54 | + } |
| 55 | +} |
| 56 | + |
0 commit comments