-
Notifications
You must be signed in to change notification settings - Fork 75
feat: add new contract to support merkl reward claiming #112
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
base: main
Are you sure you want to change the base?
Conversation
1c758c8 to
c4178fe
Compare
f707b9d to
6069218
Compare
- inherits from ATokenVault - updates storage struct to store merkl distributor contract (consumes the first of 50 gap slots) - expose functions to set/get distributor (onlyOwner) - expose function to claim rewards from merkl distributor (onlyOwner) - add test that forks Ethereum mainnet to claim rewards
6069218 to
34ae3cb
Compare
- make comments more concise - clarify in comment that native asset can not be rescued - move custom interface into a /dependencies dir - order read/write functions on ATokenVaultMerklRewardsClaim contract and interface
- an operator will be set on the reward distributor contract - an operator can claim rewards on behalf of a user (rewards are still sent to the user i.e. the ATokenVault)
422ca9b to
896fd68
Compare
a2065b4 to
7d5c2f0
Compare
2783fa4 to
558c9ef
Compare
…ward reward tokens to
| * @param destination Address of the destination receiving the reward token | ||
| * @param amount Amount of the reward token transferred to the destination | ||
| */ | ||
| event MerklRewardsTokenForwarded(address indexed token, address indexed destination, uint256 indexed amount); |
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.
We could do smt similar to RewardsClaimed, and emit the destination, tokens array and amounts array.
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.
I have no strong preference, but I wanted to avoid emitting the event if the rewardTokensToForward array is empty. If you have a strong preference please lmk. Maybe we return early if rewardTokensToForward is empty then iterate through the tokens then emit an event at the event.
Imagine it would look like this:
event MerklRewardsTokenForwarded(address indexed destination, address[] tokens, uint256[] amounts);
We can also pass in an array of destinations to claimMerklRewards(...) if you think the flexibility would be valuable - then the single token/amount/destination event makes more sense.
Motivation
Currently there is exists no way for an ATokenVault supplying to Aave to claim Merkl rewards. This change adds a contract that inherits from the upgradeable
ATokenVaultand adds functionality to claim Merkl rewards from a distributor address. If existing ATokenVault instances want to upgrade to support these functions then it can be done as this change consumes one of the gap slots reserved for upgrades to hold the Merkl distributor address.Changes