Skip to content

Commit

Permalink
fix: add final amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Apr 11, 2024
1 parent 2ca2e4d commit b90d29e
Show file tree
Hide file tree
Showing 5 changed files with 1,624 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma solidity ^0.8.17;

import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';
import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol';
Expand Down Expand Up @@ -49,21 +49,21 @@ contract AaveV2Ethereum_InterimAAMPLDistribution_20240409 is IProposalGenericExe
IDistributionCreator public constant DISTRIBUTION_CREATOR =
IDistributionCreator(0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd);
address public constant REWARD_TOKEN = AaveV2EthereumAssets.USDC_UNDERLYING;
uint256 public constant REWARD_AMOUNT = 300_000e6;
string public constant FILE_URL = 'TODO';
uint256 public constant REWARD_AMOUNT_PLUS_FEES = 298_543_522_440;
string public constant FILE_URL =
'https://angle-blog.infura-ipfs.io/ipfs/Qmb9uJbEdppQsL8W4aVKxREoHo42iXtcp4CV1FLE5tY8Rt';

function execute() external {
// 1. send funds to executor
// 0.5% fee for angle merkle distributor
uint256 amountPlusFee = REWARD_AMOUNT + (REWARD_AMOUNT * 5) / 1000;
AaveV2Ethereum.COLLECTOR.transfer(
AaveV2EthereumAssets.USDC_A_TOKEN,
address(this),
amountPlusFee + 1 // account for imprecision on transfer
REWARD_AMOUNT_PLUS_FEES + 1 // account for imprecision on transfer
);
AaveV2Ethereum.POOL.withdraw(REWARD_TOKEN, amountPlusFee, address(this));
AaveV2Ethereum.POOL.withdraw(REWARD_TOKEN, REWARD_AMOUNT_PLUS_FEES, address(this));
// 2. approve to merkl
IERC20(REWARD_TOKEN).approve(0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd, amountPlusFee);
IERC20(REWARD_TOKEN).approve(address(DISTRIBUTION_CREATOR), REWARD_AMOUNT_PLUS_FEES);
// 3. accept tos
DISTRIBUTION_CREATOR.acceptConditions();
// 4.create campaign
Expand All @@ -72,7 +72,7 @@ contract AaveV2Ethereum_InterimAAMPLDistribution_20240409 is IProposalGenericExe
campaignId: '',
creator: address(0),
rewardToken: REWARD_TOKEN,
amount: amountPlusFee,
amount: REWARD_AMOUNT_PLUS_FEES,
campaignType: 4,
startTimestamp: uint32(block.timestamp + 2 hours),
duration: 1 hours,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ contract AaveV2Ethereum_InterimAAMPLDistribution_20240409_Test is ProtocolV2Test

IDistributionCreator.CampaignParameters memory campaign = proposal
.DISTRIBUTION_CREATOR()
.campaign(bytes32(0xf9c2eb37d44c3495bb42c51d2483f332ace5f1a0e02d828a3bc6f32e5d02ab30));
.campaign(bytes32(0xf202b6960fcee67260b0d7251d8eabba7b65d7a092357b57092d7e2f4a556f76));

assertEq(campaign.creator, GovernanceV3Ethereum.EXECUTOR_LVL_1);
assertEq(campaign.rewardToken, AaveV2EthereumAssets.USDC_UNDERLYING);
// assertEq(campaign.amount, 300_000e6);
assertLe(campaign.amount, 300_000e6);
assertEq(campaign.campaignType, 4);
assertGt(campaign.startTimestamp, block.timestamp);
assertEq(campaign.duration, 3600);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ With [aip 72](https://vote.onaave.com/proposal/?proposalId=72&ipfsHash=0xaa46d2c

## Specification

The proposal will perform the following steps upon execution:
The distribution will be done via the [Merkl](https://app.merkl.xyz/) platform by Angle Labs, specialised on these operations and used before in other Aave DAO proposals, like the Merit program.

- withdraw 301.5k USDC from the collector (300k for the distribution and 1.5k as fee for angle labs)
Users with a balance below 30$ will be excluded from this initial distribution as the gas-cost for claiming would not offset set amount claimed.

Therefore the proposal will perform the following steps upon execution:

- withdraw USDC from the collector (298.5k including a 0.5% fee for angle labs)
- approve the full amount to [0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd](https://etherscan.io/address/0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd) which is the distribution creator by angle labs
- sign the tos of https://app.merkl.xyz/
- sign the tos of https://app.merkl.xyz/ via a onchain transaction
- create a campaign to distribute funds to the affected users

2 hours after proposal execution, users will be able to claim the USDC on https://app.merkl.xyz/
Expand All @@ -34,7 +38,8 @@ The proposal will perform the following steps upon execution:
- Tests: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240409_AaveV2Ethereum_InterimAAMPLDistribution/AaveV2Ethereum_InterimAAMPLDistribution_20240409.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xb7226dd6441b67225924082215f7a512bfd98252897ee43a879084e07ab53607)
- [Discussion](https://governance.aave.com/t/arfc-aampl-interim-distribution/17184)
- [Distribution](todo - link to the ipfs used by merkl)
- [Distribution:IPFS](https://angle-blog.infura-ipfs.io/ipfs/Qmb9uJbEdppQsL8W4aVKxREoHo42iXtcp4CV1FLE5tY8Rt)
- [Distribution:formatted](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240409_AaveV2Ethereum_InterimAAMPLDistribution/distribution.mht)

## Copyright

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';
import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol';
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol';
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV2Ethereum_InterimAAMPLDistribution_20240409} from './AaveV2Ethereum_InterimAAMPLDistribution_20240409.sol';
Expand Down
Loading

0 comments on commit b90d29e

Please sign in to comment.