mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
add debt tokens in reward calculation
This commit is contained in:
parent
42045b293c
commit
cf0d5f2eba
|
@ -270,10 +270,11 @@ contract AaveHelpers is DSMath {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPendingRewards(address[] memory _tokens, address user) internal view returns (uint rewards) {
|
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());
|
AaveProtocolDataProvider aaveData = AaveProtocolDataProvider(getAaveProtocolDataProvider());
|
||||||
for (uint i = 0; i < _tokens.length; i++) {
|
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);
|
rewards = AaveIncentivesInterface(getAaveIncentivesAddress()).getRewardsBalance(_atokens, user);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user