Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into bgd-labs-main
  • Loading branch information
marczeller committed Jun 2, 2024
2 parents 74025d0 + 5248d43 commit e819644
Show file tree
Hide file tree
Showing 13 changed files with 662 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Reserve changes

### Reserves altered

#### sUSD ([0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9](https://optimistic.etherscan.io/address/0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9))

| description | value before | value after |
| --- | --- | --- |
| isFrozen | true | false |
| supplyCap | 20,000,000 sUSD | 7,000,000 sUSD |
| borrowCap | 13,000,000 sUSD | 5,600,000 sUSD |
| ltv | 0 % | 60 % |
| liquidationThreshold | 75 % | 70 % |


## Raw diff

```json
{
"eModes": {
"1": {
"liquidationThreshold": {
"from": 9500,
"to": 9300
},
"ltv": {
"from": 9300,
"to": 9000
}
}
},
"reserves": {
"0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9": {
"borrowCap": {
"from": 13000000,
"to": 5600000
},
"isFrozen": {
"from": true,
"to": false
},
"liquidationThreshold": {
"from": 7500,
"to": 7000
},
"ltv": {
"from": 0,
"to": 6000
},
"supplyCap": {
"from": 20000000,
"to": 7000000
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';

import {OrbitProgramData} from './OrbitProgramData.sol';
import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol';

/// Helper interface to withdraw ETH
interface IWETH {
function withdraw(uint256) external;
}

/**
* @title Orbit Program Renewal
* @author Aave Chan Initiative
* - Snapshot: "https://snapshot.org/#/aave.eth/proposal/0x4a10e2a8ca95024d7cf0791aa82ed262c816ff0ee78bc2f3ab3487e70d731361"
* - Discussion: https://governance.aave.com/t/arfc-orbit-program-renewal-may-2024/17683
*/
contract AaveV3Ethereum_OrbitProgramRenewal_20240513 is IProposalGenericExecutor {
error EthTransferFailed(address account);
function execute() external {
// custom code goes here
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);
}

uint256 actualStreamAmount = (OrbitProgramData.STREAM_AMOUNT /
OrbitProgramData.STREAM_DURATION) * OrbitProgramData.STREAM_DURATION;

address[] memory orbitAddresses = OrbitProgramData.getOrbitAddresses();
uint256 orbitAddressesLength = orbitAddresses.length;
for (uint256 i = 0; i < orbitAddressesLength; i++) {
AaveV3Ethereum.COLLECTOR.createStream(
orbitAddresses[i],
actualStreamAmount,
AaveV3EthereumAssets.GHO_UNDERLYING,
block.timestamp,
block.timestamp + OrbitProgramData.STREAM_DURATION
);
}
}
receive() external payable {}
}
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/ProtocolV3TestBase.sol';
import {AaveV3Ethereum_OrbitProgramRenewal_20240513} from './AaveV3Ethereum_OrbitProgramRenewal_20240513.sol';

import {OrbitProgramData} from './OrbitProgramData.sol';
/**
* @dev Test for AaveV3Ethereum_OrbitProgramRenewal_20240513
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240513_AaveV3Ethereum_OrbitProgramRenewal/AaveV3Ethereum_OrbitProgramRenewal_20240513.t.sol -vv
*/
contract AaveV3Ethereum_OrbitProgramRenewal_20240513_Test is ProtocolV3TestBase {
AaveV3Ethereum_OrbitProgramRenewal_20240513 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 19862601);
proposal = new AaveV3Ethereum_OrbitProgramRenewal_20240513();
}

/**
* @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[](7);
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],
'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] + 1
);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library OrbitProgramData {
struct GasUsage {
address account;
uint256 usage;
}

uint256 public constant STREAM_DURATION = 90 days;
uint256 public constant STREAM_AMOUNT = 15_000 ether;
uint256 public constant TOTAL_WETH_REBATE = 3.381 ether;
address public constant EZREAL = 0x8659D0BB123Da6D16D9394C7838BA286c2207d0E;
address public constant STABLE_LABS = 0xECC2a9240268BC7a26386ecB49E1Befca2706AC9;
address public constant SAUCY_BLOCK = 0x08651EeE3b78254653062BA89035b8F8AdF924CE;
address public constant ARETA = 0x8b37a5Af68D315cf5A64097D96621F64b5502a22;

address public constant ACI = 0x57ab7ee15cE5ECacB1aB84EE42D5A9d0d8112922;
address public constant TOKEN_LOGIC = 0x2cc1ADE245020FC5AAE66Ad443e1F66e01c54Df1;

function getGasUsageData() internal pure returns (GasUsage[] memory) {
GasUsage[] memory usage = new GasUsage[](2);
usage[0] = GasUsage(ACI, 2.74 ether);
usage[1] = GasUsage(TOKEN_LOGIC, 0.641 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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: "Orbit Program Renewal"
author: "Aave Chan Initiative"
discussions: "https://governance.aave.com/t/arfc-orbit-program-renewal-may-2024/17683"
snapshot: "https://snapshot.org/#/aave.eth/proposal/0x4a10e2a8ca95024d7cf0791aa82ed262c816ff0ee78bc2f3ab3487e70d731361"
---

## 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.

## 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.

With the transition to Governance V3, a significant feature introduced is gasless voting via Gelato integration on the [DAO-run governance app](https://vote.onaave.com), making it easier for delegates to participate without the burden of gas costs. This innovation prompts the proposal to discontinue the general gas rebate program. However, recognizing the continued necessity for proposal creation and payload deployment activities, we propose maintaining targeted gas rebates for these specific actions.

## Specification

- **Period Coverage:** Blocks 19162697 (5th Feb 2024) to Block 19860031 (May 13th 2024)
- **Eligible Platforms:**
- EzR3al
- Stable Labs
- Saucy Block
- Areta
- **Gas Rebate:** Since this period is entirely covered by Governance V3, the Orbit program does not reimburse delegate vote gas as their vote is now subsidized by Gelato. We will continue to reimburse Service Providers for their Governance-related activity:
- ACI : 2.74 ETH
- TokenLogic : 0.641 ETH
- **Budget:** 60000 GHO and 3.381 ETH
- **Relevant Links:**

- [Script output ](https://aavechan.notion.site/Gov-V3-May-2024-Script-Output-af8acc9d53874444b9a576e2329da28a)

- [ACI’s Orbit tracker ](https://apps.aavechan.com/orbit-tracker)

## References

- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/97b44a67ed311df87102abca1944712f56b14785/src/20240513_AaveV3Ethereum_OrbitProgramRenewal/AaveV3Ethereum_OrbitProgramRenewal_20240513.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/97b44a67ed311df87102abca1944712f56b14785/src/20240513_AaveV3Ethereum_OrbitProgramRenewal/AaveV3Ethereum_OrbitProgramRenewal_20240513.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x4a10e2a8ca95024d7cf0791aa82ed262c816ff0ee78bc2f3ab3487e70d731361)
- [Discussion](https://governance.aave.com/t/arfc-orbit-program-renewal-may-2024/17683)

## Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
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/GovV3Helpers.sol';
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV3Ethereum_OrbitProgramRenewal_20240513} from './AaveV3Ethereum_OrbitProgramRenewal_20240513.sol';

/**
* @dev Deploy Ethereum
* deploy-command: make deploy-ledger contract=src/20240513_AaveV3Ethereum_OrbitProgramRenewal/OrbitProgramRenewal_20240513.s.sol:DeployEthereum chain=mainnet
* verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/OrbitProgramRenewal_20240513.s.sol/1/run-latest.json
*/
contract DeployEthereum is EthereumScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Ethereum_OrbitProgramRenewal_20240513).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/20240513_AaveV3Ethereum_OrbitProgramRenewal/OrbitProgramRenewal_20240513.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_OrbitProgramRenewal_20240513).creationCode
);
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum);

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
vm,
payloads,
GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL,
GovV3Helpers.ipfsHashFile(
vm,
'src/20240513_AaveV3Ethereum_OrbitProgramRenewal/OrbitProgramRenewal.md'
)
);
}
}
15 changes: 15 additions & 0 deletions src/20240513_AaveV3Ethereum_OrbitProgramRenewal/config.ts
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',
shortName: 'OrbitProgramRenewal',
date: '20240513',
discussion: 'https://governance.aave.com/t/arfc-orbit-program-renewal-may-2024/17683',
snapshot:
'https://snapshot.org/#/aave.eth/proposal/0x4a10e2a8ca95024d7cf0791aa82ed262c816ff0ee78bc2f3ab3487e70d731361',
votingNetwork: 'POLYGON',
},
poolOptions: {AaveV3Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 19862601}}},
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ The table below illustrates the configured risk parameters for **USDe**

## References

- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol)
- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/636bb0b17753c7e2af5d81933e7b61022e44e7e8/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/636bb0b17753c7e2af5d81933e7b61022e44e7e8/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xc1b6d0d390a2dabf81206f592f740c69163dd028dcb0f50182d0ad3a50e744b0)
- [Discussion](https://governance.aave.com/t/arfc-onboard-usde-to-aave-v3-on-ethereum/17690)

Expand Down
Loading

0 comments on commit e819644

Please sign in to comment.