mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Merge pull request #26 from Instadapp/aave-rewards-changes
Update Aave claim
This commit is contained in:
commit
96d64a1684
|
@ -4,7 +4,6 @@ contract Events {
|
||||||
event LogClaimed(
|
event LogClaimed(
|
||||||
address[] assets,
|
address[] assets,
|
||||||
uint256 amt,
|
uint256 amt,
|
||||||
bool stake,
|
|
||||||
uint256 getId,
|
uint256 getId,
|
||||||
uint256 setId
|
uint256 setId
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,7 +4,6 @@ interface AaveIncentivesInterface {
|
||||||
function claimRewards(
|
function claimRewards(
|
||||||
address[] calldata assets,
|
address[] calldata assets,
|
||||||
uint256 amount,
|
uint256 amount,
|
||||||
address to,
|
address to
|
||||||
bool stake
|
|
||||||
) external returns (uint256);
|
) external returns (uint256);
|
||||||
}
|
}
|
|
@ -12,14 +12,12 @@ abstract contract IncentivesResolver is Helpers, Events {
|
||||||
* @notice Claim Pending Rewards from Aave incentives contract.
|
* @notice Claim Pending Rewards from Aave incentives contract.
|
||||||
* @param assets The list of assets supplied and borrowed.
|
* @param assets The list of assets supplied and borrowed.
|
||||||
* @param amt The amount of reward to claim. (uint(-1) for max)
|
* @param amt The amount of reward to claim. (uint(-1) for max)
|
||||||
* @param stake Whether to stake the claimed rewards or not.
|
|
||||||
* @param getId ID to retrieve amt.
|
* @param getId ID to retrieve amt.
|
||||||
* @param setId ID stores the amount of rewards claimed.
|
* @param setId ID stores the amount of rewards claimed.
|
||||||
*/
|
*/
|
||||||
function claim(
|
function claim(
|
||||||
address[] calldata assets,
|
address[] calldata assets,
|
||||||
uint256 amt,
|
uint256 amt,
|
||||||
bool stake,
|
|
||||||
uint256 getId,
|
uint256 getId,
|
||||||
uint256 setId
|
uint256 setId
|
||||||
) external payable returns (string memory _eventName, bytes memory _eventParam) {
|
) external payable returns (string memory _eventName, bytes memory _eventParam) {
|
||||||
|
@ -27,12 +25,12 @@ abstract contract IncentivesResolver is Helpers, Events {
|
||||||
|
|
||||||
require(assets.length > 0, "invalid-assets");
|
require(assets.length > 0, "invalid-assets");
|
||||||
|
|
||||||
_amt = incentives.claimRewards(assets, _amt, address(this), stake);
|
_amt = incentives.claimRewards(assets, _amt, address(this));
|
||||||
|
|
||||||
setUint(setId, _amt);
|
setUint(setId, _amt);
|
||||||
|
|
||||||
_eventName = "LogClaimed(address[],uint256,bool,uint256,uint256)";
|
_eventName = "LogClaimed(address[],uint256,uint256,uint256)";
|
||||||
_eventParam = abi.encode(assets, _amt, stake, getId, setId);
|
_eventParam = abi.encode(assets, _amt, getId, setId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user