forked from bgd-labs/aave-proposals-v3
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Aavechan] Orbit Renewal 2024Q3 (bgd-labs#444)
* feat: Orbit program Q3 2024 * feat: additional compensation * Update src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024.md * Update src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024.md * Update src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024.md Co-authored-by: sendra <[email protected]> * Update src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.sol Co-authored-by: Ian Flexa <[email protected]> * revert * Revert "Update src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.sol" This reverts commit 161ee2d. * update lib --------- Co-authored-by: Marc Zeller <[email protected]> Co-authored-by: sendra <[email protected]> Co-authored-by: Ian Flexa <[email protected]> Co-authored-by: marczeller <[email protected]>
- Loading branch information
1 parent
48f2495
commit fb4a864
Showing
6 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
...3Ethereum_OrbitProgramRenewalQ32024/AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; | ||
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; | ||
import {CollectorUtils} from 'aave-helpers/src/CollectorUtils.sol'; | ||
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; | ||
|
||
import {OrbitProgramData} from './OrbitProgramData.sol'; | ||
|
||
// Helper interface to withdraw ETH | ||
interface IWETH { | ||
function withdraw(uint256) external; | ||
} | ||
|
||
/** | ||
* @title Orbit Program Renewal - Q3 2024 | ||
* @author Aave Chan Initiative | ||
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0xea325542397fce607755f6c14be407f60a71a81f3a23c6b3a67e298b9dd8c091 | ||
* - Discussion: https://governance.aave.com/t/arfc-orbit-program-renewal-q3-2024/18834 | ||
*/ | ||
contract AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905 is IProposalGenericExecutor { | ||
error EthTransferFailed(address account); | ||
|
||
function execute() external { | ||
AaveV3Ethereum.COLLECTOR.transfer( | ||
AaveV3EthereumAssets.WETH_UNDERLYING, | ||
address(this), | ||
OrbitProgramData.TOTAL_WETH_REBATE | ||
); | ||
|
||
IWETH(AaveV3EthereumAssets.WETH_UNDERLYING).withdraw(OrbitProgramData.TOTAL_WETH_REBATE); | ||
|
||
OrbitProgramData.GasUsage[] memory usage = OrbitProgramData.getGasUsageData(); | ||
uint256 usageLength = usage.length; | ||
for (uint256 i = 0; i < usageLength; i++) { | ||
(bool ok, ) = usage[i].account.call{value: usage[i].usage}(''); | ||
if (!ok) revert EthTransferFailed(usage[i].account); | ||
} | ||
|
||
address[] memory orbitAddresses = OrbitProgramData.getOrbitAddresses(); | ||
uint256 orbitAddressesLength = orbitAddresses.length; | ||
for (uint256 i = 0; i < orbitAddressesLength; i++) { | ||
AaveV3Ethereum.COLLECTOR.transfer( | ||
AaveV3EthereumAssets.GHO_UNDERLYING, | ||
orbitAddresses[i], | ||
OrbitProgramData.OVERDUE_AMOUNT | ||
); | ||
CollectorUtils.stream( | ||
AaveV3Ethereum.COLLECTOR, | ||
CollectorUtils.CreateStreamInput({ | ||
underlying: AaveV3EthereumAssets.GHO_UNDERLYING, | ||
receiver: orbitAddresses[i], | ||
amount: OrbitProgramData.STREAM_AMOUNT, | ||
start: block.timestamp, | ||
duration: OrbitProgramData.STREAM_DURATION | ||
}) | ||
); | ||
} | ||
} | ||
|
||
receive() external payable {} | ||
} |
84 changes: 84 additions & 0 deletions
84
...thereum_OrbitProgramRenewalQ32024/AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3Ethereum, AaveV3EthereumAssets} 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/src/ProtocolV3TestBase.sol'; | ||
import {AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905} from './AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.sol'; | ||
|
||
import {OrbitProgramData} from './OrbitProgramData.sol'; | ||
/** | ||
* @dev Test for AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905 | ||
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.t.sol -vv | ||
*/ | ||
contract AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905_Test is ProtocolV3TestBase { | ||
AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('mainnet'), 20685166); | ||
proposal = new AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
uint256 collectorWethBalanceBefore = IERC20(AaveV3EthereumAssets.WETH_UNDERLYING).balanceOf( | ||
address(AaveV3Ethereum.COLLECTOR) | ||
); | ||
|
||
uint256[] memory ethBalancesBeforeUsers = new uint256[](3); | ||
OrbitProgramData.GasUsage[] memory usage = OrbitProgramData.getGasUsageData(); | ||
for (uint256 i = 0; i < usage.length; i++) { | ||
ethBalancesBeforeUsers[i] = usage[i].account.balance; | ||
} | ||
|
||
uint256[] memory ghoBalancesBeforeUsers = new uint256[](4); | ||
address[] memory ghoPaymentAddresses = OrbitProgramData.getOrbitAddresses(); | ||
for (uint256 i = 0; i < ghoPaymentAddresses.length; i++) { | ||
ghoBalancesBeforeUsers[i] = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf( | ||
ghoPaymentAddresses[i] | ||
); | ||
} | ||
|
||
uint256 nextStreamId = AaveV3Ethereum.COLLECTOR.getNextStreamId(); | ||
vm.expectRevert(); | ||
AaveV3Ethereum.COLLECTOR.getStream(nextStreamId); | ||
|
||
executePayload(vm, address(proposal)); | ||
|
||
assertEq( | ||
IERC20(AaveV3EthereumAssets.WETH_UNDERLYING).balanceOf(address(AaveV3Ethereum.COLLECTOR)), | ||
collectorWethBalanceBefore - OrbitProgramData.TOTAL_WETH_REBATE, | ||
'WETH balance of Collector is not equal to previous minus to withdraw' | ||
); | ||
|
||
for (uint256 i = 0; i < usage.length; i++) { | ||
assertGt( | ||
usage[i].account.balance, | ||
ethBalancesBeforeUsers[i], | ||
'REBATE recipient balance is not greater than before' | ||
); | ||
} | ||
|
||
vm.warp(block.timestamp + 7 days); | ||
|
||
/// Their GHO balance has increased and call also withdraw from stream as it now exists | ||
for (uint256 i = 0; i < ghoPaymentAddresses.length; i++) { | ||
assertEq( | ||
IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(ghoPaymentAddresses[i]), | ||
ghoBalancesBeforeUsers[i] + OrbitProgramData.OVERDUE_AMOUNT, | ||
'GHO balance of Orbit recipient is not greater than before' | ||
); | ||
|
||
vm.prank(ghoPaymentAddresses[i]); | ||
AaveV3Ethereum.COLLECTOR.withdrawFromStream(nextStreamId + i, 1); | ||
assertEq( | ||
IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(ghoPaymentAddresses[i]), | ||
ghoBalancesBeforeUsers[i] + OrbitProgramData.OVERDUE_AMOUNT + 1 | ||
); | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramData.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
library OrbitProgramData { | ||
struct GasUsage { | ||
address account; | ||
uint256 usage; | ||
} | ||
|
||
// stream information | ||
uint256 public constant STREAM_DURATION = 90 days; | ||
uint256 public constant STREAM_AMOUNT = 15_000 ether; | ||
uint256 public constant OVERDUE_AMOUNT = 2_200 ether; | ||
// stream receivers | ||
address public constant EZREAL = 0x8659D0BB123Da6D16D9394C7838BA286c2207d0E; | ||
address public constant STABLE_LABS = 0xECC2a9240268BC7a26386ecB49E1Befca2706AC9; | ||
address public constant SAUCY_BLOCK = 0x08651EeE3b78254653062BA89035b8F8AdF924CE; | ||
address public constant ARETA = 0x8b37a5Af68D315cf5A64097D96621F64b5502a22; | ||
|
||
// fee rebate information | ||
uint256 public constant TOTAL_WETH_REBATE = 4.3 ether; | ||
// fee rebate receivers | ||
address public constant ACI = 0x57ab7ee15cE5ECacB1aB84EE42D5A9d0d8112922; | ||
address public constant TOKEN_LOGIC = 0x2cc1ADE245020FC5AAE66Ad443e1F66e01c54Df1; | ||
address public constant CATAPULTA = 0x020E4359255f907DF480EbFfc8a7b7beac0c0216; | ||
|
||
function getGasUsageData() internal pure returns (GasUsage[] memory) { | ||
GasUsage[] memory usage = new GasUsage[](3); | ||
usage[0] = GasUsage(ACI, 2.91 ether); | ||
usage[1] = GasUsage(TOKEN_LOGIC, 0.72 ether); | ||
usage[2] = GasUsage(CATAPULTA, 0.67 ether); | ||
|
||
return usage; | ||
} | ||
|
||
function getOrbitAddresses() internal pure returns (address[] memory) { | ||
address[] memory streamAddresses = new address[](4); | ||
streamAddresses[0] = EZREAL; | ||
streamAddresses[1] = STABLE_LABS; | ||
streamAddresses[2] = SAUCY_BLOCK; | ||
streamAddresses[3] = ARETA; | ||
|
||
return streamAddresses; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: "Orbit Program Renewal - Q3 2024" | ||
author: "Aave Chan Initiative" | ||
discussions: "https://governance.aave.com/t/arfc-orbit-program-renewal-q3-2024/18834" | ||
snapshot: "https://snapshot.org/#/aave.eth/proposal/0xea325542397fce607755f6c14be407f60a71a81f3a23c6b3a67e298b9dd8c091" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
Proposing the renewal of the Orbit program for recognized delegates, compensating them with GHO and ETH reimbursement of Gas costs , associated with their governance activity during part of Q3 2024 ( From 2024-05-13 to 2024-08-30). | ||
|
||
To compensate the missed compensation between the previous round of Orbit and the current one, a one-off compensation of 2200 GHO (worth 13 days of stream) is implemented. | ||
|
||
## Motivation | ||
|
||
Orbit recognizes the added value of the Delegates in the decentralization & diversity of the Aave DAO. This compensation allows them to focus on aave and keep their contribution efforts to our governance. The ACI proposes the extension of Orbit for a new quarter, Q3 2024, from 2024-05-13 to 2024-08-30. | ||
An additional compensation is provided to account for the gap in distribution. | ||
|
||
**Gas Rebate:** | ||
|
||
Initially meant to reimburse gas cost associated with governance voting, the gas rebate has been entirely focused on service provider gas reimbursement since the launch of Aave governance V3, we propose to segregate these payments after this proposal to keep focus and consistency in the Orbit program. | ||
|
||
Gas reimbursements from service providers activity are proposed to be managed by Aave Finance service providers in their monthly treasury management update. | ||
|
||
## Specification | ||
|
||
- **Period Coverage:** Blocks 19860032 (May 13th 2024) to Block 20639896 (August 30th 2024) | ||
- **Eligible Platforms:** | ||
- EzR3al | ||
- StableNode | ||
- Saucy Block | ||
- Areta | ||
- **Gas Rebate:** Last service provider gas rebate using orbit: | ||
- ACI : 2.91 ETH | ||
- Catapulta: 0.67 ETH | ||
- TokenLogic: 0.72 ETH | ||
- **Budget:** 68800 GHO and 4.3 ETH | ||
- **Relevant Links:** | ||
- [Script output ](https://www.notion.so/Gov-V3-August-2024-script-Output-55c7ee78d48a4126a295f74a0dbf883c?pvs=21) | ||
- [ACI’s Orbit tracker ](https://dapps.aavechan.com/orbit-tracker) | ||
|
||
## References | ||
|
||
- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.sol) | ||
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.t.sol) | ||
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xea325542397fce607755f6c14be407f60a71a81f3a23c6b3a67e298b9dd8c091) | ||
- [Discussion](https://governance.aave.com/t/arfc-orbit-program-renewal-q3-2024/18834) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
60 changes: 60 additions & 0 deletions
60
...0240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024_20240905.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol'; | ||
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; | ||
import {EthereumScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; | ||
import {AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905} from './AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905.sol'; | ||
|
||
/** | ||
* @dev Deploy Ethereum | ||
* deploy-command: make deploy-ledger contract=src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024_20240905.s.sol:DeployEthereum chain=mainnet | ||
* verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/OrbitProgramRenewalQ32024_20240905.s.sol/1/run-latest.json | ||
*/ | ||
contract DeployEthereum is EthereumScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
address payload0 = GovV3Helpers.deployDeterministic( | ||
type(AaveV3Ethereum_OrbitProgramRenewalQ32024_20240905).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/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024_20240905.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_OrbitProgramRenewalQ32024_20240905).creationCode | ||
); | ||
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); | ||
|
||
// create proposal | ||
vm.startBroadcast(); | ||
GovV3Helpers.createProposal( | ||
vm, | ||
payloads, | ||
GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, | ||
GovV3Helpers.ipfsHashFile( | ||
vm, | ||
'src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/OrbitProgramRenewalQ32024.md' | ||
) | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/20240905_AaveV3Ethereum_OrbitProgramRenewalQ32024/config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {ConfigFile} from '../../generator/types'; | ||
export const config: ConfigFile = { | ||
rootOptions: { | ||
author: 'Aave Chan Initiative', | ||
pools: ['AaveV3Ethereum'], | ||
title: 'Orbit Program Renewal - Q3 2024', | ||
shortName: 'OrbitProgramRenewalQ32024', | ||
date: '20240905', | ||
discussion: 'https://governance.aave.com/t/arfc-orbit-program-renewal-q3-2024/18834', | ||
snapshot: | ||
'https://snapshot.org/#/aave.eth/proposal/0xea325542397fce607755f6c14be407f60a71a81f3a23c6b3a67e298b9dd8c091', | ||
votingNetwork: 'POLYGON', | ||
}, | ||
poolOptions: {AaveV3Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 20685166}}}, | ||
}; |