Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FEI #12

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .fei.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DEFAULT_GAS_PRICE= 50 GWEI by default

TOKEN=0x956F47F50A910163D8BF957Cf5846D573E7f87CA
ATOKEN=0xAcF35Af93a65904C50ED93dfb010bAAdEBb4ccF0
STABLE_DEBT_TOKEN=0x1B669D5034143E272b5Ff548f2878735A2F3505A
VARIABLE_DEBT_TOKEN=0x1DdcF68f4C2600CBE534212765F964342a2faf02
INTEREST_STRATEGY=0xF0bA2a8c12A2354c075b363765EAe825619bd490
LTV=0
LIQUIDATION_THRESHOLD=0
LIQUIDATION_BONUS=0
RESERVE_FACTOR=2000
DECIMALS=18
ENABLE_BORROW=true
ENABLE_AS_COLLATERAL=false
ENABLE_STABLE_BORROW=false
IPFS_HASH=QmbfLFGJdZQn21pwJGQzVnFqLk4vXHTmHUhio8ArWmvVqZ
CHAINLINK_ORACLE_PROXY=0x7F0D2c2838c6AC24443d13e23d99490017bDe370

# By default executor and governance addresses set to mainnet addresses
# Uncomment the following for kovan
#AAVE_SHORT_EXECUTOR=0x2012b02574f32a96b9cfb8ba7fdfd589d5c70f50
#AAVE_GOVERNANCE_V2=0xc2ebab3bac8f2f5028f5c7317027a41ebfca31d2
44 changes: 44 additions & 0 deletions contracts/assetListing/interfaces/IAaveDistributionManager.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.5;
pragma experimental ABIEncoderV2;

interface IAaveDistributionManager {

event AssetConfigUpdated(address indexed asset, uint256 emission);
event AssetIndexUpdated(address indexed asset, uint256 index);
event UserIndexUpdated(address indexed user, address indexed asset, uint256 index);
event DistributionEndUpdated(uint256 newDistributionEnd);

/**
* @dev Sets the end date for the distribution
* @param distributionEnd The end date timestamp
**/
function setDistributionEnd(uint256 distributionEnd) external;

/**
* @dev Gets the end date for the distribution
* @return The end of the distribution
**/
function getDistributionEnd() external view returns (uint256);

/**
* @dev for backwards compatibility with the previous DistributionManager used
* @return The end of the distribution
**/
function DISTRIBUTION_END() external view returns(uint256);

/**
* @dev Returns the data of an user on a distribution
* @param user Address of the user
* @param asset The address of the reference asset of the distribution
* @return The new index
**/
function getUserAssetData(address user, address asset) external view returns (uint256);

/**
* @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);
}
104 changes: 104 additions & 0 deletions contracts/assetListing/interfaces/IAaveIncentivesController.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.5;

pragma experimental ABIEncoderV2;

import {IAaveDistributionManager} from '../interfaces/IAaveDistributionManager.sol';

interface IAaveIncentivesController is IAaveDistributionManager {

event RewardsAccrued(address indexed user, uint256 amount);

event RewardsClaimed(
address indexed user,
address indexed to,
address indexed claimer,
uint256 amount
);

event ClaimerSet(address indexed user, address indexed claimer);

/**
* @dev Whitelists an address to claim the rewards on behalf of another address
* @param user The address of the user
* @param claimer The address of the claimer
*/
function setClaimer(address user, address claimer) external;

/**
* @dev Returns the whitelisted claimer for a certain address (0x0 if not set)
* @param user The address of the user
* @return The claimer address
*/
function getClaimer(address user) external view returns (address);

/**
* @dev Configure assets for a certain rewards emission
* @param assets The assets to incentivize
* @param emissionsPerSecond The emission for each asset
*/
function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond)
external;


/**
* @dev Called by the corresponding asset on any update that affects the rewards distribution
* @param asset The address of the user
* @param userBalance The balance of the user of the asset in the lending pool
* @param totalSupply The total supply of the asset in the lending pool
**/
function handleAction(
address asset,
uint256 userBalance,
uint256 totalSupply
) external;

/**
* @dev Returns the total of rewards of an user, already accrued + not yet accrued
* @param user The address of the user
* @return The rewards
**/
function getRewardsBalance(address[] calldata assets, address user)
external
view
returns (uint256);

/**
* @dev Claims reward for an user, on all the assets of the lending pool, accumulating the pending rewards
* @param amount Amount of rewards to claim
* @param to Address that will be receiving the rewards
* @return Rewards claimed
**/
function claimRewards(
address[] calldata assets,
uint256 amount,
address to
) external returns (uint256);

/**
* @dev Claims reward for an user on behalf, on all the assets of the lending pool, accumulating the pending rewards. The caller must
* be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager
* @param amount Amount of rewards to claim
* @param user Address to check and claim rewards
* @param to Address that will be receiving the rewards
* @return Rewards claimed
**/
function claimRewardsOnBehalf(
address[] calldata assets,
uint256 amount,
address user,
address to
) external returns (uint256);

/**
* @dev returns the unclaimed rewards of the user
* @param user the address of the user
* @return the unclaimed user rewards
*/
function getUserUnclaimedRewards(address user) external view returns (uint256);

/**
* @dev for backward compatibility with previous implementation of the Incentives controller
*/
function REWARD_TOKEN() external view returns (address);
}
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if (process.env.SKIP_LOAD !== 'true') {
require('./tasks/list-new-asset.ts');
require('./tasks/list-rai.ts');
require('./tasks/list-bond.ts');
require('./tasks/list-fei.ts');
}

export const BUIDLEREVM_CHAIN_ID = 31337;
Expand Down
Loading