Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StkGHO Initialization proposal #170

Merged
merged 32 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
24a3f7d
Add proposal for Gho Incident Report 20231113 (#1)
parth-15 Dec 5, 2023
4aa6143
fix: Make new impl constant (#3)
miguelmtzinf Dec 6, 2023
27dd485
fix: Amend AIP text (#4)
miguelmtzinf Dec 6, 2023
2f242a6
test: Tweak default tests with borrow cap update (#5)
miguelmtzinf Dec 7, 2023
4812d01
fix: lint issue (#6)
parth-15 Dec 7, 2023
43a7687
test: Add diffs from test running (#7)
miguelmtzinf Dec 7, 2023
4c79bb9
fix: Add payload address (#8)
miguelmtzinf Dec 7, 2023
76cd4b6
fix: Fix payload address in script (#9)
miguelmtzinf Dec 7, 2023
120f564
fix: Remove unneeded diff file (#10)
miguelmtzinf Dec 7, 2023
4d6a3d9
Merge branch 'bgd-labs:main' into main
miguelmtzinf Dec 13, 2023
4cb8573
Merge branch 'bgd-labs:main' into main
miguelmtzinf Jan 16, 2024
6c5ee89
feat: added stkgho initialization proposal
The-3D Jan 18, 2024
1b99bd8
feat: fixed proposal description
The-3D Jan 18, 2024
c3d48cd
feat: removed submodule
The-3D Jan 19, 2024
7938a2d
feat: fixed deployment script
The-3D Jan 19, 2024
575b445
feat: replaced duration calculation
The-3D Jan 19, 2024
b777395
git commit remove submodule
foodaka Jan 19, 2024
79f2011
feat: fixed payload build function
The-3D Jan 19, 2024
1062d67
update proposal
foodaka Jan 19, 2024
fd43d71
chore: sync
foodaka Jan 19, 2024
6d58d1f
sync branch
foodaka Jan 19, 2024
0ac9c62
Merge pull request #12 from aave/feat/proposal-revision-stk
The-3D Jan 19, 2024
35a12a3
fix: variable name
The-3D Jan 19, 2024
5df6a3e
fix: Fix AIP payload
miguelmtzinf Jan 19, 2024
121b4f4
fix: Fix tests
miguelmtzinf Jan 19, 2024
d1e97c6
test: added further test on emission per day
The-3D Jan 19, 2024
8e940eb
refactor: removed unused constants
The-3D Jan 19, 2024
33fac26
fix: catapulta commands
The-3D Jan 19, 2024
c50ff04
fix: Add fixes to payload
miguelmtzinf Jan 19, 2024
1f79a77
fix: Rebuild proposal with autogenerate tool
miguelmtzinf Jan 19, 2024
f8490ca
Merge branch 'main' of https://github.com/aave/aave-proposals-v3 into…
miguelmtzinf Jan 19, 2024
45d813c
Merge branch 'bgd/main' into stkgho-proposal
miguelmtzinf Jan 19, 2024
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/aave-helpers"]
path = lib/aave-helpers
url = https://github.com/bgd-labs/aave-helpers
[submodule "lib/stake-token"]
sakulstra marked this conversation as resolved.
Show resolved Hide resolved
path = lib/stake-token
url = https://github.com/bgd-labs/stake-token.git
1 change: 1 addition & 0 deletions lib/stake-token
Submodule stake-token added at e6530c
33 changes: 33 additions & 0 deletions src/20240118_StkGHO_Activation/StkGHOActivation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: "GHO Safety Module Initialization"
author: "Aave_BGDLabs_ACI"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to other proposals we review, we are not to be included here. Usually who implements the proposal and who creates it are included (Aave Lab & ACI).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
author: "Aave_BGDLabs_ACI"
author: "Aave Labs & ACI"

discussions: "https://governance.aave.com/t/arfc-upgrade-safety-module-with-stkgho/15635"
---

## Simple Summary

This AIP activates the new GHO based Safety module by initiating the emission schedule approved by the community during the vote
https://snapshot.org/#/aave.eth/proposal/0x4bc99a842adab6cdd8c7d5c7a787ee4c0056be554fde0d008d53b45b3e795065

## Motivation

The GHO Safety Module will fortify the Aave Protocol’s resilience by adding a stablecoin asset, which is inherently less volatile than AAVE. This strategic move diversifies the Safety Module’s capacity to absorb shocks from various risk vectors in case of shortfall events.

## Specification

The GHO Safety module will be activated with the following parameters:

Base emission: 50 AAVE/day
Duration: Three months

## References
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here links should be included. Some default ones should have been auto-generated though.
And probably good to add stkGHO proxy additionally and link to https://github.com/bgd-labs/stake-token (the implementation)


[TBD]
Copy link
Contributor

@foodaka foodaka Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[TBD]
- https://github.com/bgd-labs/stake-token
- https://snapshot.org/#/aave.eth/proposal/0x4bc99a842adab6cdd8c7d5c7a787ee4c0056be554fde0d008d53b45b3e795065
- https://governance.aave.com/t/arfc-upgrade-safety-module-with-stkgho/15635

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@The-3D wanna add the simulated payload address?


## Disclaimer

Aave Labs, BGD Labs and ACI receive no compensation beyond Aave protocol for the creation of this proposal. BGD Labs and ACI are both delegates within the Aave ecosystem.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No point on mentioning BGD Labs here, and we are not really delegates

Copy link
Contributor

@foodaka foodaka Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Aave Labs, BGD Labs and ACI receive no compensation beyond Aave protocol for the creation of this proposal. BGD Labs and ACI are both delegates within the Aave ecosystem.
Aave Labs and ACI receive no compensation beyond Aave protocol for the creation of this proposal. ACI is a delegate within the Aave ecosystem.


## Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
58 changes: 58 additions & 0 deletions src/20240118_StkGHO_Activation/StkGHO_Activation_20240118.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol';
import {EthereumScript, PolygonScript} from 'aave-helpers/ScriptUtils.sol';
import {StkGHO_Activation_20240118} from './StkGHO_Activation_20240118.sol';

/**
* @dev Deploy Ethereum
* deploy-command: make deploy-ledger contract=src/20240102_AaveV2Polygon_ReserveFactorUpdates/ReserveFactorUpdates_20240102.s.sol:DeployPolygon chain=polygon
* verify-command: npx catapulta-verify -b broadcast/ReserveFactorUpdates_20240102.s.sol/137/run-latest.json
*/
contract DeployPolygon is PolygonScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(StkGHO_Activation_20240118).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/20240102_AaveV2Polygon_ReserveFactorUpdates/ReserveFactorUpdates_20240102.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 actionsPolygon = new IPayloadsControllerCore.ExecutionAction[](1);
actionsPolygon[0] = GovV3Helpers.buildAction(
type(StkGHO_Activation_20240118).creationCode
);
payloads[0] = GovV3Helpers.buildPolygonPayload(vm, actionsPolygon);
sakulstra marked this conversation as resolved.
Show resolved Hide resolved

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
vm,
payloads,
GovV3Helpers.ipfsHashFile(
vm,
'src/StkGHO_Activation_20240118/StkGHOActivation.md'
)
);
}
}
43 changes: 43 additions & 0 deletions src/20240118_StkGHO_Activation/StkGHO_Activation_20240118.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol';
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';
import {IAggregatedStakeToken} from 'stake-token/src/contracts/IAggregatedStakeToken.sol';
import {DistributionTypes} from 'stake-token/src/contracts/lib/DistributionTypes.sol';
import {IAaveDistributionManager} from 'stake-token/src/contracts/IAaveDistributionManager.sol';
import {AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';

/**
* @title StkGHO Activation
* @author the3d.eth
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @author the3d.eth
* @author Aave Labs & ACI

* - Snapshot: 'https://snapshot.org/#/aave.eth/proposal/0x4bc99a842adab6cdd8c7d5c7a787ee4c0056be554fde0d008d53b45b3e795065
* - Discussion: https://governance.aave.com/t/arfc-upgrade-safety-module-with-stkgho/15635
*/
contract StkGHO_Activation_20240118 is IProposalGenericExecutor {
uint256 public constant STKGHO_EMISSION_PER_SECOND = 5787037037037037; // 50 AAVE/day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in practise 500 AAVE / day no? or I'm I missing something

uint256 public constant DISTRIBUTION_DURATION = 3*30*86400; // three months
sakulstra marked this conversation as resolved.
Show resolved Hide resolved
address public constant STKGHO_PROXY = 0x1a88Df1cFe15Af22B3c4c783D4e6F7F9e0C1885d;
sakulstra marked this conversation as resolved.
Show resolved Hide resolved

function execute() external {
IAggregatedStakeToken(STKGHO_PROXY).setDistributionEnd(
block.timestamp + DISTRIBUTION_DURATION
);
DistributionTypes.AssetConfigInput[]
memory enableConfigs = new DistributionTypes.AssetConfigInput[](1);
enableConfigs[0] = DistributionTypes.AssetConfigInput({
emissionPerSecond: uint128(STKGHO_EMISSION_PER_SECOND),
totalStaked: 0, // it's overwritten internally
underlyingAsset: AaveV3Ethereum.GHO_TOKEN
sakulstra marked this conversation as resolved.
Show resolved Hide resolved
});
IAaveDistributionManager(STKGHO_PROXY).configureAssets(enableConfigs);
MiscEthereum.AAVE_ECOSYSTEM_RESERVE_CONTROLLER.approve(
MiscEthereum.ECOSYSTEM_RESERVE,
AaveV3EthereumAssets.AAVE_UNDERLYING,
STKGHO_PROXY,
STKGHO_EMISSION_PER_SECOND * DISTRIBUTION_DURATION
);
}
}
32 changes: 32 additions & 0 deletions src/20240118_StkGHO_Activation/StkGHO_Activation_20240118.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol';

import {StkGHO_Activation_20240118} from './StkGHO_Activation_20240118.sol';

/**
* @dev Test for StkGHO_Activation_20240118
* command: make test-contract filter=StkGHO_Activation_20240118
*/
contract StkGHO_Activation_20240118_Test is ProtocolV2TestBase {
struct Changes {
address asset;
uint256 reserveFactor;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
struct Changes {
address asset;
uint256 reserveFactor;
}


StkGHO_Activation_20240118 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('ethereum'), 51940815);
sakulstra marked this conversation as resolved.
Show resolved Hide resolved
proposal = new StkGHO_Activation_20240118();
}

/**
* @dev executes the generic test suite including e2e and config snapshots
*/
function test_defaultProposalExecution() public {


}
}
13 changes: 13 additions & 0 deletions src/20240118_StkGHO_Activation/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {ConfigFile} from '../../generator/types';
export const config: ConfigFile = {
rootOptions: {
pools: ['AaveV3Ethereum'],
title: 'StkGHO Activation',
shortName: 'StkGHOActivation',
date: '20240118',
author: 'Bgdlabs_Aave_ACI',
discussion: 'https://governance.aave.com/t/arfc-upgrade-safety-module-with-stkgho/15635',
snapshot: 'https://snapshot.org/#/aave.eth/proposal/0x4bc99a842adab6cdd8c7d5c7a787ee4c0056be554fde0d008d53b45b3e795065',
},
poolOptions: {AaveV3Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 51855274}}},
};