generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Merit Program Allowances #233
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/20240306_AaveV3Ethereum_MeritApprovals/AaveV3Ethereum_MeritApprovals_20240306.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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; | ||
import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; | ||
|
||
/** | ||
* @title Merit Approvals | ||
* @author karpatkey_TokenLogic_ACI | ||
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0xc80da83fadfe4f8a4c56e1643895cb7e9b1af1d9dcd374f1b41ded5c95b42f68 | ||
* - Discussion: https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646 | ||
*/ | ||
contract AaveV3Ethereum_MeritApprovals_20240306 is IProposalGenericExecutor { | ||
uint256 public constant GHO_ALLOWANCE = 2_900_000 ether; | ||
uint256 public constant WETH_V3_ALLOWANCE = 600 ether; | ||
address public constant MERIT_WALLET = 0xdeadD8aB03075b7FBA81864202a2f59EE25B312b; | ||
|
||
function execute() external { | ||
AaveV3Ethereum.COLLECTOR.approve( | ||
AaveV3EthereumAssets.GHO_UNDERLYING, | ||
MERIT_WALLET, | ||
GHO_ALLOWANCE | ||
); | ||
AaveV3Ethereum.COLLECTOR.approve( | ||
AaveV3EthereumAssets.WETH_A_TOKEN, | ||
MERIT_WALLET, | ||
WETH_V3_ALLOWANCE | ||
); | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
src/20240306_AaveV3Ethereum_MeritApprovals/AaveV3Ethereum_MeritApprovals_20240306.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,70 @@ | ||
// 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 {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
|
||
import {AaveV3Ethereum_MeritApprovals_20240306} from './AaveV3Ethereum_MeritApprovals_20240306.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Ethereum_MeritApprovals_20240306 | ||
* command: make test-contract filter=AaveV3Ethereum_MeritApprovals_20240306 | ||
*/ | ||
contract AaveV3Ethereum_MeritApprovals_20240306_Test is ProtocolV3TestBase { | ||
AaveV3Ethereum_MeritApprovals_20240306 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('mainnet'), 19377425); | ||
proposal = new AaveV3Ethereum_MeritApprovals_20240306(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
assertEq( | ||
IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).allowance( | ||
address(AaveV3Ethereum.COLLECTOR), | ||
proposal.MERIT_WALLET() | ||
), | ||
0 | ||
); | ||
assertEq( | ||
IERC20(AaveV3EthereumAssets.WETH_A_TOKEN).allowance( | ||
address(AaveV3Ethereum.COLLECTOR), | ||
proposal.MERIT_WALLET() | ||
), | ||
0 | ||
); | ||
|
||
executePayload(vm, address(proposal)); | ||
|
||
assertEq( | ||
IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).allowance( | ||
address(AaveV3Ethereum.COLLECTOR), | ||
proposal.MERIT_WALLET() | ||
), | ||
proposal.GHO_ALLOWANCE() | ||
); | ||
assertEq( | ||
IERC20(AaveV3EthereumAssets.WETH_A_TOKEN).allowance( | ||
address(AaveV3Ethereum.COLLECTOR), | ||
proposal.MERIT_WALLET() | ||
), | ||
proposal.WETH_V3_ALLOWANCE() | ||
); | ||
|
||
vm.startPrank(proposal.MERIT_WALLET()); | ||
IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).transferFrom( | ||
address(AaveV3Ethereum.COLLECTOR), | ||
proposal.MERIT_WALLET(), | ||
2_000_000 ether | ||
); | ||
IERC20(AaveV3EthereumAssets.WETH_A_TOKEN).transferFrom( | ||
address(AaveV3Ethereum.COLLECTOR), | ||
proposal.MERIT_WALLET(), | ||
500 ether | ||
); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/20240306_AaveV3Ethereum_MeritApprovals/MeritApprovals.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,32 @@ | ||
--- | ||
title: "Merit Approvals" | ||
author: "karpatkey_TokenLogic_ACI" | ||
discussions: "https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646" | ||
snapshot: "https://snapshot.org/#/aave.eth/proposal/0xc80da83fadfe4f8a4c56e1643895cb7e9b1af1d9dcd374f1b41ded5c95b42f68" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
“Merit” proposes a merkle-tree-based periodic airdrop system, designed to reward Aave-aligned user behaviors and enhance protocol competitiveness, with a defined budget for the initial 90-day period. | ||
|
||
## Motivation | ||
|
||
Addressing the competitive DeFi landscape, “Merit” seeks to elevate Aave’s appeal and efficiency through a rewarding mechanism that prioritizes DAO-beneficial actions, distinguishing Aave from competitors employing artificial incentive methods. | ||
|
||
## Specification | ||
|
||
Merit SAFE: ‘0xdeadD8aB03075b7FBA81864202a2f59EE25B312b’ | ||
|
||
- Approve 2.9M GHO | ||
- Approve 600 wEthWETH | ||
efecarranza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## References | ||
|
||
- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_AaveV3Ethereum_MeritApprovals/AaveV3Ethereum_MeritApprovals_20240306.sol) | ||
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_AaveV3Ethereum_MeritApprovals/AaveV3Ethereum_MeritApprovals_20240306.t.sol) | ||
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xc80da83fadfe4f8a4c56e1643895cb7e9b1af1d9dcd374f1b41ded5c95b42f68) | ||
- [Discussion](https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
55 changes: 55 additions & 0 deletions
55
src/20240306_AaveV3Ethereum_MeritApprovals/MeritApprovals_20240306.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,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_MeritApprovals_20240306} from './AaveV3Ethereum_MeritApprovals_20240306.sol'; | ||
|
||
/** | ||
* @dev Deploy Ethereum | ||
* deploy-command: make deploy-ledger contract=src/20240306_AaveV3Ethereum_MeritApprovals/MeritApprovals_20240306.s.sol:DeployEthereum chain=mainnet | ||
* verify-command: npx catapulta-verify -b broadcast/MeritApprovals_20240306.s.sol/1/run-latest.json | ||
*/ | ||
contract DeployEthereum is EthereumScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
address payload0 = GovV3Helpers.deployDeterministic( | ||
type(AaveV3Ethereum_MeritApprovals_20240306).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/20240306_AaveV3Ethereum_MeritApprovals/MeritApprovals_20240306.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_MeritApprovals_20240306).creationCode | ||
); | ||
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); | ||
|
||
// create proposal | ||
vm.startBroadcast(); | ||
GovV3Helpers.createProposal( | ||
vm, | ||
payloads, | ||
GovV3Helpers.ipfsHashFile(vm, 'src/20240306_AaveV3Ethereum_MeritApprovals/MeritApprovals.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,15 @@ | ||
import {ConfigFile} from '../../generator/types'; | ||
export const config: ConfigFile = { | ||
rootOptions: { | ||
pools: ['AaveV3Ethereum'], | ||
title: 'Merit Approvals', | ||
shortName: 'MeritApprovals', | ||
date: '20240306', | ||
author: 'karpatkey_TokenLogic_ACI', | ||
discussion: | ||
'https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646', | ||
snapshot: | ||
'https://snapshot.org/#/aave.eth/proposal/0xc80da83fadfe4f8a4c56e1643895cb7e9b1af1d9dcd374f1b41ded5c95b42f68', | ||
}, | ||
poolOptions: {AaveV3Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 19377425}}}, | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as on any other aip, please use etherscan links for addresses so it's easier to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added