From ac169b282278e63b8b12d4a555e1ccb9306805ae Mon Sep 17 00:00:00 2001 From: Rozengarden Date: Thu, 21 Mar 2024 00:37:07 +0100 Subject: [PATCH 1/2] Payload for listing sfrxETH nedd collector funding & capo feed address --- ...AaveV3Ethereum_SfrxETHListing_20240321.sol | 65 +++++++++++++++++++ ...veV3Ethereum_SfrxETHListing_20240321.t.sol | 38 +++++++++++ .../SfrxETHListing.md | 61 +++++++++++++++++ .../SfrxETHListing_20240321.s.sol | 55 ++++++++++++++++ .../config.ts | 55 ++++++++++++++++ 5 files changed, 274 insertions(+) create mode 100644 src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol create mode 100644 src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.t.sol create mode 100644 src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md create mode 100644 src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing_20240321.s.sol create mode 100644 src/20240321_AaveV3Ethereum_SfrxETHListing/config.ts diff --git a/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol b/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol new file mode 100644 index 000000000..0094af973 --- /dev/null +++ b/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum, AaveV3EthereumEModes} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveV3PayloadEthereum} from 'aave-helpers/v3-config-engine/AaveV3PayloadEthereum.sol'; +import {EngineFlags} from 'aave-helpers/v3-config-engine/EngineFlags.sol'; +import {IAaveV3ConfigEngine} from 'aave-helpers/v3-config-engine/IAaveV3ConfigEngine.sol'; +import {IV3RateStrategyFactory} from 'aave-helpers/v3-config-engine/IV3RateStrategyFactory.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; +import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol'; + +/** + * @title sfrxETH Listing + * @author Aave Chan Initiative + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3 + * - Discussion: https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673 + */ +contract AaveV3Ethereum_SfrxETHListing_20240321 is AaveV3PayloadEthereum { + using SafeERC20 for IERC20; + + address public constant sfrxETH = 0xac3E018457B222d93114458476f3E3416Abbe38F; + uint256 public constant sfrxETH_SEED_AMOUNT = 1e16; + + function _postExecute() internal override { + IERC20(sfrxETH).forceApprove(address(AaveV3Ethereum.POOL), sfrxETH_SEED_AMOUNT); + AaveV3Ethereum.POOL.supply(sfrxETH, sfrxETH_SEED_AMOUNT, address(AaveV3Ethereum.COLLECTOR), 0); + } + + function newListings() public pure override returns (IAaveV3ConfigEngine.Listing[] memory) { + IAaveV3ConfigEngine.Listing[] memory listings = new IAaveV3ConfigEngine.Listing[](1); + + listings[0] = IAaveV3ConfigEngine.Listing({ + asset: sfrxETH, + assetSymbol: 'sfrxETH', + priceFeed: 0x0000000000000000000000000000000000000000, + eModeCategory: AaveV3EthereumEModes.ETH_CORRELATED, + enabledToBorrow: EngineFlags.ENABLED, + stableRateModeEnabled: EngineFlags.DISABLED, + borrowableInIsolation: EngineFlags.DISABLED, + withSiloedBorrowing: EngineFlags.DISABLED, + flashloanable: EngineFlags.ENABLED, + ltv: 74_50, + liqThreshold: 77_00, + liqBonus: 5_00, + reserveFactor: 15_00, + supplyCap: 55_000, + borrowCap: 5_500, + debtCeiling: 0, + liqProtocolFee: 10_00, + rateStrategyParams: IV3RateStrategyFactory.RateStrategyParams({ + optimalUsageRatio: _bpsToRay(45_00), + baseVariableBorrowRate: _bpsToRay(0), + variableRateSlope1: _bpsToRay(7_00), + variableRateSlope2: _bpsToRay(300_00), + stableRateSlope1: _bpsToRay(0), + stableRateSlope2: _bpsToRay(0), + baseStableRateOffset: _bpsToRay(0), + stableRateExcessOffset: _bpsToRay(0), + optimalStableToTotalDebtRatio: _bpsToRay(0) + }) + }); + + return listings; + } +} diff --git a/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.t.sol b/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.t.sol new file mode 100644 index 000000000..14b904711 --- /dev/null +++ b/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.t.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_SfrxETHListing_20240321} from './AaveV3Ethereum_SfrxETHListing_20240321.sol'; + +/** + * @dev Test for AaveV3Ethereum_SfrxETHListing_20240321 + * command: make test-contract filter=AaveV3Ethereum_SfrxETHListing_20240321 + */ +contract AaveV3Ethereum_SfrxETHListing_20240321_Test is ProtocolV3TestBase { + AaveV3Ethereum_SfrxETHListing_20240321 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 19479117); + proposal = new AaveV3Ethereum_SfrxETHListing_20240321(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest('AaveV3Ethereum_SfrxETHListing_20240321', AaveV3Ethereum.POOL, address(proposal)); + } + + function test_collectorHassfrxETHFunds() public { + GovV3Helpers.executePayload(vm, address(proposal)); + (address aTokenAddress, , ) = AaveV3Ethereum + .AAVE_PROTOCOL_DATA_PROVIDER + .getReserveTokensAddresses(proposal.sfrxETH()); + assertGe(IERC20(aTokenAddress).balanceOf(address(AaveV3Ethereum.COLLECTOR)), 10 ** 16); + } +} diff --git a/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md b/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md new file mode 100644 index 000000000..b5a485af0 --- /dev/null +++ b/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md @@ -0,0 +1,61 @@ +--- +title: "sfrxETH Listing" +author: "Aave Chan Initiative" +discussions: "https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673" +snapshot: "https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3" +--- + +## Simple Summary + +This ARFC proposes the addition of sfrxETH from Frax to Aave V3 Ethereum to enhance LST liquidity and asset diversity. + +## Motivation + +sFrxETH is the Staked version of FrxETH from the Frax Ecosystem. Users can freely mint frxETH in exchange for ETH deposits. + +The Aave-Chan Initiative supports LST diversity in Aave V3 as shown with our historical support of cbETH, rETH, and, parallel to this proposal, our support for ETHx. + +This proposal is a reboot of [ARC Proposal: Onboarding sfrxETH from Frax Protocol to Aave V3 Ethereum Market 10 ](https://governance.aave.com/t/arc-proposal-onboarding-sfrxeth-from-frax-protocol-to-aave-v3-ethereum-market/11510) from January. More details for sFrxETH can be found in the first proposal. + +## Specification + +The table below illustrates the configured risk parameters for [sfrxETH](https://etherscan.io/token/0xac3e018457b222d93114458476f3e3416abbe38f) + +| Parameter | Value | +| ---------------------------------- | -----------------------------------------: | +| Isolation Mode | true | +| Borrowable | ENABLED | +| Collateral Enabled | true | +| Supply Cap (sfrxETH) | 55,000 | +| Borrow Cap (sfrxETH) | 5,500 | +| Debt Ceiling | USD 0 | +| LTV | 74.5 % | +| LT | 77 % | +| Liquidation Bonus | 5 % | +| Liquidation Protocol Fee | 10 % | +| Reserve Factor | 15 % | +| Base Variable Borrow Rate | 0 % | +| Variable Slope 1 | 7 % | +| Variable Slope 2 | 300 % | +| Uoptimal | 45 % | +| Stable Borrowing | DISABLED | +| Stable Slope1 | 0 % | +| Stable Slope2 | 0 % | +| Base Stable Rate Offset | 0 % | +| Stable Rate Excess Offset | 0 % | +| Optimal Stable To Total Debt Ratio | 0 % | +| Flashloanable | ENABLED | +| Siloed Borrowing | DISABLED | +| Borrowable in Isolation | DISABLED | +| Oracle | 0x0000000000000000000000000000000000000000 | + +## References + +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.t.sol) +- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3) +- [Discussion](https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing_20240321.s.sol b/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing_20240321.s.sol new file mode 100644 index 000000000..faec168ff --- /dev/null +++ b/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing_20240321.s.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV3Ethereum_SfrxETHListing_20240321} from './AaveV3Ethereum_SfrxETHListing_20240321.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing_20240321.s.sol:DeployEthereum chain=mainnet + * verify-command: npx catapulta-verify -b broadcast/SfrxETHListing_20240321.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_SfrxETHListing_20240321).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing_20240321.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsEthereum[0] = GovV3Helpers.buildAction( + type(AaveV3Ethereum_SfrxETHListing_20240321).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovV3Helpers.ipfsHashFile(vm, 'src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md') + ); + } +} diff --git a/src/20240321_AaveV3Ethereum_SfrxETHListing/config.ts b/src/20240321_AaveV3Ethereum_SfrxETHListing/config.ts new file mode 100644 index 000000000..0a128ea13 --- /dev/null +++ b/src/20240321_AaveV3Ethereum_SfrxETHListing/config.ts @@ -0,0 +1,55 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + configFile: 'src/20240321_AaveV3Ethereum_SfrxETHListing/config.ts', + force: true, + author: 'Aave Chan Initiative', + pools: ['AaveV3Ethereum'], + title: 'sfrxETH Listing', + shortName: 'SfrxETHListing', + date: '20240321', + discussion: 'https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673', + snapshot: + 'https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3', + }, + poolOptions: { + AaveV3Ethereum: { + configs: { + ASSET_LISTING: [ + { + assetSymbol: 'sfrxETH', + decimals: 18, + priceFeed: '0x0000000000000000000000000000000000000000', + ltv: '74.5', + liqThreshold: '77', + liqBonus: '5', + debtCeiling: '0', + liqProtocolFee: '10', + enabledToBorrow: 'ENABLED', + flashloanable: 'ENABLED', + stableRateModeEnabled: 'DISABLED', + borrowableInIsolation: 'DISABLED', + withSiloedBorrowing: 'DISABLED', + reserveFactor: '15', + supplyCap: '55000', + borrowCap: '5500', + rateStrategyParams: { + optimalUtilizationRate: '45', + baseVariableBorrowRate: '0', + variableRateSlope1: '7', + variableRateSlope2: '300', + stableRateSlope1: '0', + stableRateSlope2: '0', + baseStableRateOffset: '0', + stableRateExcessOffset: '0', + optimalStableToTotalDebtRatio: '0', + }, + eModeCategory: 'AaveV3EthereumEModes.ETH_CORRELATED', + asset: '0xac3E018457B222d93114458476f3E3416Abbe38F', + }, + ], + }, + cache: {blockNumber: 19479117}, + }, + }, +}; From af20b5980334868b323b52f945f04d9d6450b7f5 Mon Sep 17 00:00:00 2001 From: marczeller Date: Mon, 25 Mar 2024 09:30:52 +0000 Subject: [PATCH 2/2] minor changes --- .../AaveV3Ethereum_SfrxETHListing_20240321.sol | 2 +- src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol b/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol index 0094af973..ab64eab62 100644 --- a/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol +++ b/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol @@ -10,7 +10,7 @@ import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol'; /** - * @title sfrxETH Listing + * @title sfrxETH Onboarding * @author Aave Chan Initiative * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3 * - Discussion: https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673 diff --git a/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md b/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md index b5a485af0..937ec36ef 100644 --- a/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md +++ b/src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md @@ -1,5 +1,5 @@ --- -title: "sfrxETH Listing" +title: "sfrxETH Onboarding" author: "Aave Chan Initiative" discussions: "https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673" snapshot: "https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3"