Merge pull request #17 from Instadapp/aave-ve-update

add debt tokens in reward calculation
This commit is contained in:
Thrilok kumar 2021-04-19 18:06:52 +05:30 committed by GitHub
commit a2f7d63e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,10 +270,11 @@ contract AaveHelpers is DSMath {
}
function getPendingRewards(address[] memory _tokens, address user) internal view returns (uint rewards) {
address[] memory _atokens = new address[](_tokens.length);
uint arrLength = 2 * _tokens.length;
address[] memory _atokens = new address[](arrLength);
AaveProtocolDataProvider aaveData = AaveProtocolDataProvider(getAaveProtocolDataProvider());
for (uint i = 0; i < _tokens.length; i++) {
(_atokens[i],,) = aaveData.getReserveTokensAddresses(_tokens[i]);
(_atokens[2*i],,_atokens[2*i + 1]) = aaveData.getReserveTokensAddresses(_tokens[i]);
}
rewards = AaveIncentivesInterface(getAaveIncentivesAddress()).getRewardsBalance(_atokens, user);
}