Merge pull request #26 from Instadapp/aave-rewards-changes

Update Aave claim
This commit is contained in:
Thrilok kumar 2021-04-14 20:46:09 +05:30 committed by GitHub
commit 96d64a1684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View File

@ -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
); );

View File

@ -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);
} }

View File

@ -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);
} }
} }