mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feat: Updated to new interface of Incentives Controller
This commit is contained in:
parent
8000d838a3
commit
2a19131b7a
|
@ -3,19 +3,9 @@ pragma solidity 0.6.12;
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
interface IAaveIncentivesController {
|
interface IAaveIncentivesController {
|
||||||
struct AssetData {
|
|
||||||
uint104 emissionPerSecond;
|
|
||||||
uint104 index;
|
|
||||||
uint40 lastUpdateTimestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
event RewardsAccrued(address indexed user, uint256 amount);
|
event RewardsAccrued(address indexed user, uint256 amount);
|
||||||
|
|
||||||
event RewardsClaimed(
|
event RewardsClaimed(address indexed user, address indexed to, uint256 amount);
|
||||||
address indexed user,
|
|
||||||
address indexed to,
|
|
||||||
uint256 amount
|
|
||||||
);
|
|
||||||
|
|
||||||
event RewardsClaimed(
|
event RewardsClaimed(
|
||||||
address indexed user,
|
address indexed user,
|
||||||
|
@ -26,7 +16,19 @@ interface IAaveIncentivesController {
|
||||||
|
|
||||||
event ClaimerSet(address indexed user, address indexed claimer);
|
event ClaimerSet(address indexed user, address indexed claimer);
|
||||||
|
|
||||||
function assets(address underlying) external view returns (AssetData memory assets);
|
/*
|
||||||
|
* @dev Returns the configuration of the distribution for a certain asset
|
||||||
|
* @param asset The address of the reference asset of the distribution
|
||||||
|
* @return The asset index, the emission per second and the last updated timestamp
|
||||||
|
**/
|
||||||
|
function getAssetData(address asset)
|
||||||
|
external
|
||||||
|
view
|
||||||
|
returns (
|
||||||
|
uint256,
|
||||||
|
uint256,
|
||||||
|
uint256
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Whitelists an address to claim the rewards on behalf of another address
|
* @dev Whitelists an address to claim the rewards on behalf of another address
|
||||||
|
@ -50,7 +52,6 @@ interface IAaveIncentivesController {
|
||||||
function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond)
|
function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond)
|
||||||
external;
|
external;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Called by the corresponding asset on any update that affects the rewards distribution
|
* @dev Called by the corresponding asset on any update that affects the rewards distribution
|
||||||
* @param asset The address of the user
|
* @param asset The address of the user
|
||||||
|
@ -116,12 +117,12 @@ interface IAaveIncentivesController {
|
||||||
function getUserAssetData(address user, address asset) external view returns (uint256);
|
function getUserAssetData(address user, address asset) external view returns (uint256);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev for backward compatibility with previous implementation of the Incentives controller
|
* @dev for backward compatibility with previous implementation of the Incentives controller
|
||||||
*/
|
*/
|
||||||
function REWARD_TOKEN() external view returns (address);
|
function REWARD_TOKEN() external view returns (address);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev for backward compatibility with previous implementation of the Incentives controller
|
* @dev for backward compatibility with previous implementation of the Incentives controller
|
||||||
*/
|
*/
|
||||||
function PRECISION() external view returns (uint8);
|
function PRECISION() external view returns (uint8);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,21 +131,23 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
||||||
);
|
);
|
||||||
|
|
||||||
// incentives
|
// incentives
|
||||||
IAaveIncentivesController.AssetData memory tokenIncentivesInfo =
|
(
|
||||||
incentivesController.assets(reserveData.aTokenAddress);
|
reserveData.aEmissionPerSecond,
|
||||||
reserveData.aEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
|
reserveData.aIncentivesLastUpdateTimestamp,
|
||||||
reserveData.aIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
|
reserveData.aTokenIncentivesIndex
|
||||||
reserveData.aTokenIncentivesIndex = tokenIncentivesInfo.index;
|
) = incentivesController.getAssetData(reserveData.aTokenAddress);
|
||||||
|
|
||||||
tokenIncentivesInfo = incentivesController.assets(reserveData.stableDebtTokenAddress);
|
(
|
||||||
reserveData.sEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
|
reserveData.sEmissionPerSecond,
|
||||||
reserveData.sIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
|
reserveData.sIncentivesLastUpdateTimestamp,
|
||||||
reserveData.sTokenIncentivesIndex = tokenIncentivesInfo.index;
|
reserveData.sTokenIncentivesIndex
|
||||||
|
) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress);
|
||||||
|
|
||||||
tokenIncentivesInfo = incentivesController.assets(reserveData.variableDebtTokenAddress);
|
(
|
||||||
reserveData.vEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
|
reserveData.vEmissionPerSecond,
|
||||||
reserveData.vIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
|
reserveData.vIncentivesLastUpdateTimestamp,
|
||||||
reserveData.vTokenIncentivesIndex = tokenIncentivesInfo.index;
|
reserveData.vTokenIncentivesIndex
|
||||||
|
) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress);
|
||||||
|
|
||||||
if (user != address(0)) {
|
if (user != address(0)) {
|
||||||
// incentives
|
// incentives
|
||||||
|
|
|
@ -43,9 +43,9 @@ interface IUiPoolDataProvider {
|
||||||
uint256 stableRateSlope1;
|
uint256 stableRateSlope1;
|
||||||
uint256 stableRateSlope2;
|
uint256 stableRateSlope2;
|
||||||
// incentives
|
// incentives
|
||||||
uint128 aEmissionPerSecond;
|
uint256 aEmissionPerSecond;
|
||||||
uint128 vEmissionPerSecond;
|
uint256 vEmissionPerSecond;
|
||||||
uint128 sEmissionPerSecond;
|
uint256 sEmissionPerSecond;
|
||||||
uint256 aIncentivesLastUpdateTimestamp;
|
uint256 aIncentivesLastUpdateTimestamp;
|
||||||
uint256 vIncentivesLastUpdateTimestamp;
|
uint256 vIncentivesLastUpdateTimestamp;
|
||||||
uint256 sIncentivesLastUpdateTimestamp;
|
uint256 sIncentivesLastUpdateTimestamp;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user