Update claim

This commit is contained in:
Mubaris NK 2021-04-14 20:23:26 +05:30
parent 51a324473a
commit 1ad2361789
No known key found for this signature in database
GPG Key ID: 9AC09AD0F8D68561
3 changed files with 4 additions and 8 deletions

View File

@ -4,7 +4,6 @@ contract Events {
event LogClaimed(
address[] assets,
uint256 amt,
bool stake,
uint256 getId,
uint256 setId
);

View File

@ -4,7 +4,6 @@ interface AaveIncentivesInterface {
function claimRewards(
address[] calldata assets,
uint256 amount,
address to,
bool stake
address to
) external returns (uint256);
}

View File

@ -12,14 +12,12 @@ abstract contract IncentivesResolver is Helpers, Events {
* @notice Claim Pending Rewards from Aave incentives contract.
* @param assets The list of assets supplied and borrowed.
* @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 setId ID stores the amount of rewards claimed.
*/
function claim(
address[] calldata assets,
uint256 amt,
bool stake,
uint256 getId,
uint256 setId
) 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");
_amt = incentives.claimRewards(assets, _amt, address(this), stake);
_amt = incentives.claimRewards(assets, _amt, address(this));
setUint(setId, _amt);
_eventName = "LogClaimed(address[],uint256,bool,uint256,uint256)";
_eventParam = abi.encode(assets, _amt, stake, getId, setId);
_eventName = "LogClaimed(address[],uint256,uint256,uint256)";
_eventParam = abi.encode(assets, _amt, getId, setId);
}
}