Skip to content

Commit 3ac4613

Browse files
committed
Added getIncentivesController() getter to AToken and Variable Debt Token
1 parent de22637 commit 3ac4613

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

contracts/interfaces/IAToken.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity 0.6.12;
33

44
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
55
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
6+
import {IAaveIncentivesController} from './IAaveIncentivesController.sol';
67

78
interface IAToken is IERC20, IScaledBalanceToken {
89
/**
@@ -85,4 +86,9 @@ interface IAToken is IERC20, IScaledBalanceToken {
8586
* @return The amount transferred
8687
**/
8788
function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);
89+
90+
/**
91+
* @dev Returns the address of the incentives controller contract
92+
**/
93+
function getIncentivesController() external view returns (IAaveIncentivesController);
8894
}

contracts/interfaces/IVariableDebtToken.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
pragma solidity 0.6.12;
33

44
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
5+
import {IAaveIncentivesController} from './IAaveIncentivesController.sol';
56

67
/**
78
* @title IVariableDebtToken
@@ -52,4 +53,9 @@ interface IVariableDebtToken is IScaledBalanceToken {
5253
uint256 amount,
5354
uint256 index
5455
) external;
56+
57+
/**
58+
* @dev Returns the address of the incentives controller contract
59+
**/
60+
function getIncentivesController() external view returns (IAaveIncentivesController);
5561
}

contracts/protocol/tokenization/AToken.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {WadRayMath} from '../libraries/math/WadRayMath.sol';
99
import {Errors} from '../libraries/helpers/Errors.sol';
1010
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
1111
import {IncentivizedERC20} from './IncentivizedERC20.sol';
12+
import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
1213

1314
/**
1415
* @title Aave ERC20 AToken
@@ -229,6 +230,13 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
229230
return currentSupplyScaled.rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS));
230231
}
231232

233+
/**
234+
* @dev Returns the address of the incentives controller contract
235+
**/
236+
function getIncentivesController() external view override returns (IAaveIncentivesController) {
237+
return _incentivesController;
238+
}
239+
232240
/**
233241
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
234242
* @return the scaled total supply

contracts/protocol/tokenization/VariableDebtToken.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {IVariableDebtToken} from '../../interfaces/IVariableDebtToken.sol';
55
import {WadRayMath} from '../libraries/math/WadRayMath.sol';
66
import {Errors} from '../libraries/helpers/Errors.sol';
77
import {DebtTokenBase} from './base/DebtTokenBase.sol';
8+
import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
89

910
/**
1011
* @title VariableDebtToken
@@ -139,4 +140,12 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
139140
{
140141
return (super.balanceOf(user), super.totalSupply());
141142
}
143+
144+
/**
145+
* @dev Returns the address of the incentives controller contract
146+
* @return incentives address
147+
**/
148+
function getIncentivesController() external view override returns (IAaveIncentivesController) {
149+
return _incentivesController;
150+
}
142151
}

0 commit comments

Comments
 (0)