@@ -8,20 +8,12 @@ import {IERC20} from "@openzeppelin/interfaces/IERC20.sol";
88
99import {ATokenVault} from "./ATokenVault.sol " ;
1010import {IATokenVaultMerklRewardClaimer} from "./interfaces/IATokenVaultMerklRewardClaimer.sol " ;
11-
12- interface IMerklDistributor {
13- function claim (
14- address [] calldata users ,
15- address [] calldata tokens ,
16- uint256 [] calldata amounts ,
17- bytes32 [][] calldata proofs
18- ) external ;
19- }
11+ import {IMerklDistributor} from "./dependencies/merkl/DistributorInterface.sol " ;
2012
2113/**
2214 * @title ATokenVaultMerklRewardClaimer
2315 * @author Aave Protocol
24- * @notice A contract that allows the owner to claim Merkl rewards for the ATokenVault
16+ * @notice ATokenVault, with Merkl reward claiming capability
2517 */
2618contract ATokenVaultMerklRewardClaimer is ATokenVault , IATokenVaultMerklRewardClaimer {
2719 /**
@@ -34,19 +26,6 @@ contract ATokenVaultMerklRewardClaimer is ATokenVault, IATokenVaultMerklRewardCl
3426 ATokenVault (underlying, referralCode, poolAddressesProvider)
3527 {}
3628
37- /// @inheritdoc IATokenVaultMerklRewardClaimer
38- function getMerklDistributor () external view override returns (address ) {
39- return _s.merklDistributor;
40- }
41-
42- /// @inheritdoc IATokenVaultMerklRewardClaimer
43- function setMerklDistributor (address merklDistributor ) external override onlyOwner {
44- require (merklDistributor != address (0 ), "ZERO_ADDRESS_NOT_VALID " );
45- address currentMerklDistributor = _s.merklDistributor;
46- _s.merklDistributor = merklDistributor;
47- emit MerklDistributorUpdated (currentMerklDistributor, merklDistributor);
48- }
49-
5029 /// @inheritdoc IATokenVaultMerklRewardClaimer
5130 function claimMerklRewards (address [] calldata rewardTokens , uint256 [] calldata amounts , bytes32 [][] calldata proofs )
5231 public
@@ -63,7 +42,7 @@ contract ATokenVaultMerklRewardClaimer is ATokenVault, IATokenVaultMerklRewardCl
6342
6443 // The claim function does not return a list of tokens and amounts actually received.
6544 // It is possible for rewards to be in aTokens, the underlying asset or some other token.
66- // If necessary the owner can use IATokenVault.emergencyRescue(...) to rescue the non-aToken rewards.
45+ // If necessary the owner can use IATokenVault.emergencyRescue(...) to rescue the non-aToken rewards and non-native rewards .
6746 IMerklDistributor (_s.merklDistributor).claim (users, rewardTokens, amounts, proofs);
6847 // Do not attempt to accrue yield as it can be delegated to subsequent calls to this contract.
6948 // We do not need to accrue before claiming because new shares are not granted anywhere (rewards are socialized across all current share holders).
@@ -72,4 +51,17 @@ contract ATokenVaultMerklRewardClaimer is ATokenVault, IATokenVaultMerklRewardCl
7251
7352 emit MerklRewardsClaimed (rewardTokens, amounts);
7453 }
54+
55+ /// @inheritdoc IATokenVaultMerklRewardClaimer
56+ function setMerklDistributor (address merklDistributor ) external override onlyOwner {
57+ require (merklDistributor != address (0 ), "ZERO_ADDRESS_NOT_VALID " );
58+ address currentMerklDistributor = _s.merklDistributor;
59+ _s.merklDistributor = merklDistributor;
60+ emit MerklDistributorUpdated (currentMerklDistributor, merklDistributor);
61+ }
62+
63+ /// @inheritdoc IATokenVaultMerklRewardClaimer
64+ function getMerklDistributor () external view override returns (address ) {
65+ return _s.merklDistributor;
66+ }
7567}
0 commit comments