From 1b10d22ca2a2a25cbf4476e8b7eb7ab7d17d694e Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 5 Feb 2024 08:25:47 +0100 Subject: [PATCH] feat: stk abpt upgrade (#168) * feat: add stkABPT proposal * fix: add specification header * Update src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration.md * Update src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration.md --- .../StkABPTBalancerV2Migration.md | 34 +++++++++++++ .../StkABPTBalancerV2Migration_20240118.s.sol | 50 +++++++++++++++++++ .../config.ts | 15 ++++++ 3 files changed, 99 insertions(+) create mode 100644 src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration.md create mode 100644 src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration_20240118.s.sol create mode 100644 src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/config.ts diff --git a/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration.md b/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration.md new file mode 100644 index 000000000..61e2e1dab --- /dev/null +++ b/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration.md @@ -0,0 +1,34 @@ +--- +title: "stkABPT Balancer V2 migration" +author: "BGD Labs @bgdlabs" +discussions: "https://governance.aave.com/t/bgd-abpt-balancer-v2-migration-plan/8381/7#abpt-balancer-v1-v2-migration-update-1" +snapshot: "https://snapshot.org/#/aave.eth/proposal/0x33cdbe42706aa449c2e7d55d6c1e81da4bf3f153bb5c1010df71e8ab296fe525" +--- + +## Simple Summary + +Deprecate the `stkABPT` Balancer v1 safety module in favor of a new `AAVE_wstETH_BPT_V2` Balancer v2 safety module. + +## Motivation + +The ABPT(AAVE/WETH) pool was created in January 2021, so it runs on the Balancer v1 system. +The community decided that an upgrade to Balancer v2 and a yield optimized AAVE/wstETH pool. + +## Specification + +Therefore this proposal: + +- Upgrades the existing `stkABPT` to allow immediate withdrawal without cooldown and disable slashing. +- Stops AAVE reward emission on `stkABPT`. +- Starts AAVE reward emission on the new `stkAAVE_wstETH_BPT_V2`. + +## References + +- Implementation: [StakeToken](https://github.com/bgd-labs/stake-token/blob/main/src/contracts/StakeToken.sol),[Payload](https://github.com/bgd-labs/abpt-migration/blob/main/src/contracts/ProposalPayload.sol) +- Tests: [StakeToken](https://github.com/bgd-labs/stake-token/tree/main/tests), [Payload](https://github.com/bgd-labs/abpt-migration/tree/main/tests) +- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x33cdbe42706aa449c2e7d55d6c1e81da4bf3f153bb5c1010df71e8ab296fe525) +- [Discussion](https://governance.aave.com/t/bgd-abpt-balancer-v2-migration-plan/8381/7#abpt-balancer-v1-v2-migration-update-1) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration_20240118.s.sol b/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration_20240118.s.sol new file mode 100644 index 000000000..24521f3d1 --- /dev/null +++ b/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration_20240118.s.sol @@ -0,0 +1,50 @@ +// 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'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration_20240118.s.sol:DeployEthereum chain=mainnet + * verify-command: npx catapulta-verify -b broadcast/StkABPTBalancerV2Migration_20240118.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(0xFfC6788753444Ad4023C9fc0D5820E3a1887519B); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration_20240118.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(0xFfC6788753444Ad4023C9fc0D5820E3a1887519B); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/StkABPTBalancerV2Migration.md' + ) + ); + } +} diff --git a/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/config.ts b/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/config.ts new file mode 100644 index 000000000..61b37b953 --- /dev/null +++ b/src/20240118_AaveSafetyModule_StkABPTBalancerV2Migration/config.ts @@ -0,0 +1,15 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + author: 'BGD Labs @bgdlabs', + pools: ['AaveSafetyModule'], + title: 'stkABPT Balancer V2 migration', + shortName: 'StkABPTBalancerV2Migration', + date: '20240118', + discussion: + 'https://governance.aave.com/t/bgd-abpt-balancer-v2-migration-plan/8381/7#abpt-balancer-v1-v2-migration-update-1', + snapshot: + 'https://snapshot.org/#/aave.eth/proposal/0x33cdbe42706aa449c2e7d55d6c1e81da4bf3f153bb5c1010df71e8ab296fe525', + }, + poolOptions: {AaveSafetyModule: {configs: {OTHERS: {}}, cache: {blockNumber: 19034613}}}, +};