mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Added getIncentivesController() getter to AToken and Variable Debt Token
This commit is contained in:
parent
de22637c31
commit
3ac461315f
|
@ -3,6 +3,7 @@ pragma solidity 0.6.12;
|
||||||
|
|
||||||
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
|
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||||
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
|
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
|
||||||
|
import {IAaveIncentivesController} from './IAaveIncentivesController.sol';
|
||||||
|
|
||||||
interface IAToken is IERC20, IScaledBalanceToken {
|
interface IAToken is IERC20, IScaledBalanceToken {
|
||||||
/**
|
/**
|
||||||
|
@ -85,4 +86,9 @@ interface IAToken is IERC20, IScaledBalanceToken {
|
||||||
* @return The amount transferred
|
* @return The amount transferred
|
||||||
**/
|
**/
|
||||||
function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);
|
function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Returns the address of the incentives controller contract
|
||||||
|
**/
|
||||||
|
function getIncentivesController() external view returns (IAaveIncentivesController);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
pragma solidity 0.6.12;
|
pragma solidity 0.6.12;
|
||||||
|
|
||||||
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
|
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
|
||||||
|
import {IAaveIncentivesController} from './IAaveIncentivesController.sol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title IVariableDebtToken
|
* @title IVariableDebtToken
|
||||||
|
@ -52,4 +53,9 @@ interface IVariableDebtToken is IScaledBalanceToken {
|
||||||
uint256 amount,
|
uint256 amount,
|
||||||
uint256 index
|
uint256 index
|
||||||
) external;
|
) external;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Returns the address of the incentives controller contract
|
||||||
|
**/
|
||||||
|
function getIncentivesController() external view returns (IAaveIncentivesController);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import {WadRayMath} from '../libraries/math/WadRayMath.sol';
|
||||||
import {Errors} from '../libraries/helpers/Errors.sol';
|
import {Errors} from '../libraries/helpers/Errors.sol';
|
||||||
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
|
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
|
||||||
import {IncentivizedERC20} from './IncentivizedERC20.sol';
|
import {IncentivizedERC20} from './IncentivizedERC20.sol';
|
||||||
|
import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title Aave ERC20 AToken
|
* @title Aave ERC20 AToken
|
||||||
|
@ -229,6 +230,13 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
|
||||||
return currentSupplyScaled.rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS));
|
return currentSupplyScaled.rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Returns the address of the incentives controller contract
|
||||||
|
**/
|
||||||
|
function getIncentivesController() external view override returns (IAaveIncentivesController) {
|
||||||
|
return _incentivesController;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
|
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
|
||||||
* @return the scaled total supply
|
* @return the scaled total supply
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {IVariableDebtToken} from '../../interfaces/IVariableDebtToken.sol';
|
||||||
import {WadRayMath} from '../libraries/math/WadRayMath.sol';
|
import {WadRayMath} from '../libraries/math/WadRayMath.sol';
|
||||||
import {Errors} from '../libraries/helpers/Errors.sol';
|
import {Errors} from '../libraries/helpers/Errors.sol';
|
||||||
import {DebtTokenBase} from './base/DebtTokenBase.sol';
|
import {DebtTokenBase} from './base/DebtTokenBase.sol';
|
||||||
|
import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title VariableDebtToken
|
* @title VariableDebtToken
|
||||||
|
@ -139,4 +140,12 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
|
||||||
{
|
{
|
||||||
return (super.balanceOf(user), super.totalSupply());
|
return (super.balanceOf(user), super.totalSupply());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Returns the address of the incentives controller contract
|
||||||
|
* @return incentives address
|
||||||
|
**/
|
||||||
|
function getIncentivesController() external view override returns (IAaveIncentivesController) {
|
||||||
|
return _incentivesController;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user