Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
7408285 | 11 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Name:
EmissionManager
Compiler Version
v0.8.22+commit.4fc1097e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; import {AggregatorInterface} from '../dependencies/chainlink/AggregatorInterface.sol'; import {IEmissionManager} from './interfaces/IEmissionManager.sol'; import {ITransferStrategyBase} from './interfaces/ITransferStrategyBase.sol'; import {IRewardsController} from './interfaces/IRewardsController.sol'; import {RewardsDataTypes} from './libraries/RewardsDataTypes.sol'; /** * @title EmissionManager * @author Aave * @notice It manages the list of admins of reward emissions and provides functions to control reward emissions. */ contract EmissionManager is Ownable, IEmissionManager { // reward => emissionAdmin mapping(address => address) internal _emissionAdmins; IRewardsController internal _rewardsController; /** * @dev Only emission admin of the given reward can call functions marked by this modifier. **/ modifier onlyEmissionAdmin(address reward) { require(msg.sender == _emissionAdmins[reward], 'ONLY_EMISSION_ADMIN'); _; } /** * Constructor. * @param owner The address of the owner */ constructor(address owner) { transferOwnership(owner); } /// @inheritdoc IEmissionManager function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external override { for (uint256 i = 0; i < config.length; i++) { require(_emissionAdmins[config[i].reward] == msg.sender, 'ONLY_EMISSION_ADMIN'); } _rewardsController.configureAssets(config); } /// @inheritdoc IEmissionManager function setTransferStrategy( address reward, ITransferStrategyBase transferStrategy ) external override onlyEmissionAdmin(reward) { _rewardsController.setTransferStrategy(reward, transferStrategy); } /// @inheritdoc IEmissionManager function setRewardOracle( address reward, AggregatorInterface rewardOracle ) external override onlyEmissionAdmin(reward) { _rewardsController.setRewardOracle(reward, rewardOracle); } /// @inheritdoc IEmissionManager function setDistributionEnd( address asset, address reward, uint32 newDistributionEnd ) external override onlyEmissionAdmin(reward) { _rewardsController.setDistributionEnd(asset, reward, newDistributionEnd); } /// @inheritdoc IEmissionManager function setEmissionPerSecond( address asset, address[] calldata rewards, uint88[] calldata newEmissionsPerSecond ) external override { for (uint256 i = 0; i < rewards.length; i++) { require(_emissionAdmins[rewards[i]] == msg.sender, 'ONLY_EMISSION_ADMIN'); } _rewardsController.setEmissionPerSecond(asset, rewards, newEmissionsPerSecond); } /// @inheritdoc IEmissionManager function setClaimer(address user, address claimer) external override onlyOwner { _rewardsController.setClaimer(user, claimer); } /// @inheritdoc IEmissionManager function setEmissionAdmin(address reward, address admin) external override onlyOwner { address oldAdmin = _emissionAdmins[reward]; _emissionAdmins[reward] = admin; emit EmissionAdminUpdated(reward, oldAdmin, admin); } /// @inheritdoc IEmissionManager function setRewardsController(address controller) external override onlyOwner { _rewardsController = IRewardsController(controller); } /// @inheritdoc IEmissionManager function getRewardsController() external view override returns (IRewardsController) { return _rewardsController; } /// @inheritdoc IEmissionManager function getEmissionAdmin(address reward) external view override returns (address) { return _emissionAdmins[reward]; } }
// SPDX-License-Identifier: MIT // Chainlink Contracts v0.8 pragma solidity ^0.8.0; interface AggregatorInterface { function decimals() external view returns (uint8); function description() external view returns (string memory); function getRoundData( uint80 _roundId ) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestAnswer() external view returns (int256); function latestTimestamp() external view returns (uint256); function latestRound() external view returns (uint256); function getAnswer(uint256 roundId) external view returns (int256); function getTimestamp(uint256 roundId) external view returns (uint256); event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt); event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import './Context.sol'; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {AggregatorInterface} from '../../dependencies/chainlink/AggregatorInterface.sol'; import {RewardsDataTypes} from '../libraries/RewardsDataTypes.sol'; import {ITransferStrategyBase} from './ITransferStrategyBase.sol'; import {IRewardsController} from './IRewardsController.sol'; /** * @title IEmissionManager * @author Aave * @notice Defines the basic interface for the Emission Manager */ interface IEmissionManager { /** * @dev Emitted when the admin of a reward emission is updated. * @param reward The address of the rewarding token * @param oldAdmin The address of the old emission admin * @param newAdmin The address of the new emission admin */ event EmissionAdminUpdated( address indexed reward, address indexed oldAdmin, address indexed newAdmin ); /** * @dev Configure assets to incentivize with an emission of rewards per second until the end of distribution. * @dev Only callable by the emission admin of the given rewards * @param config The assets configuration input, the list of structs contains the following fields: * uint104 emissionPerSecond: The emission per second following rewards unit decimals. * uint256 totalSupply: The total supply of the asset to incentivize * uint40 distributionEnd: The end of the distribution of the incentives for an asset * address asset: The asset address to incentivize * address reward: The reward token address * ITransferStrategy transferStrategy: The TransferStrategy address with the install hook and claim logic. * AggregatorInterface rewardOracle: The Price Oracle of a reward to visualize the incentives at the UI Frontend. * Must follow Chainlink Aggregator AggregatorInterface interface to be compatible. */ function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external; /** * @dev Sets a TransferStrategy logic contract that determines the logic of the rewards transfer * @dev Only callable by the emission admin of the given reward * @param reward The address of the reward token * @param transferStrategy The address of the TransferStrategy logic contract */ function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy) external; /** * @dev Sets an Aave Oracle contract to enforce rewards with a source of value. * @dev Only callable by the emission admin of the given reward * @notice At the moment of reward configuration, the Incentives Controller performs * a check to see if the reward asset oracle is compatible with AggregatorInterface proxy. * This check is enforced for integrators to be able to show incentives at * the current Aave UI without the need to setup an external price registry * @param reward The address of the reward to set the price aggregator * @param rewardOracle The address of price aggregator that follows AggregatorInterface interface */ function setRewardOracle(address reward, AggregatorInterface rewardOracle) external; /** * @dev Sets the end date for the distribution * @dev Only callable by the emission admin of the given reward * @param asset The asset to incentivize * @param reward The reward token that incentives the asset * @param newDistributionEnd The end date of the incentivization, in unix time format **/ function setDistributionEnd(address asset, address reward, uint32 newDistributionEnd) external; /** * @dev Sets the emission per second of a set of reward distributions * @param asset The asset is being incentivized * @param rewards List of reward addresses are being distributed * @param newEmissionsPerSecond List of new reward emissions per second */ function setEmissionPerSecond( address asset, address[] calldata rewards, uint88[] calldata newEmissionsPerSecond ) external; /** * @dev Whitelists an address to claim the rewards on behalf of another address * @dev Only callable by the owner of the EmissionManager * @param user The address of the user * @param claimer The address of the claimer */ function setClaimer(address user, address claimer) external; /** * @dev Updates the admin of the reward emission * @dev Only callable by the owner of the EmissionManager * @param reward The address of the reward token * @param admin The address of the new admin of the emission */ function setEmissionAdmin(address reward, address admin) external; /** * @dev Updates the address of the rewards controller * @dev Only callable by the owner of the EmissionManager * @param controller the address of the RewardsController contract */ function setRewardsController(address controller) external; /** * @dev Returns the rewards controller address * @return The address of the RewardsController contract */ function getRewardsController() external view returns (IRewardsController); /** * @dev Returns the admin of the given reward emission * @param reward The address of the reward token * @return The address of the emission admin */ function getEmissionAdmin(address reward) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {IRewardsDistributor} from './IRewardsDistributor.sol'; import {ITransferStrategyBase} from './ITransferStrategyBase.sol'; import {AggregatorInterface} from '../../dependencies/chainlink/AggregatorInterface.sol'; import {RewardsDataTypes} from '../libraries/RewardsDataTypes.sol'; /** * @title IRewardsController * @author Aave * @notice Defines the basic interface for a Rewards Controller. */ interface IRewardsController is IRewardsDistributor { /** * @dev Emitted when a new address is whitelisted as claimer of rewards on behalf of a user * @param user The address of the user * @param claimer The address of the claimer */ event ClaimerSet(address indexed user, address indexed claimer); /** * @dev Emitted when rewards are claimed * @param user The address of the user rewards has been claimed on behalf of * @param reward The address of the token reward is claimed * @param to The address of the receiver of the rewards * @param claimer The address of the claimer * @param amount The amount of rewards claimed */ event RewardsClaimed( address indexed user, address indexed reward, address indexed to, address claimer, uint256 amount ); /** * @dev Emitted when a transfer strategy is installed for the reward distribution * @param reward The address of the token reward * @param transferStrategy The address of TransferStrategy contract */ event TransferStrategyInstalled(address indexed reward, address indexed transferStrategy); /** * @dev Emitted when the reward oracle is updated * @param reward The address of the token reward * @param rewardOracle The address of oracle */ event RewardOracleUpdated(address indexed reward, address indexed rewardOracle); /** * @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 Sets a TransferStrategy logic contract that determines the logic of the rewards transfer * @param reward The address of the reward token * @param transferStrategy The address of the TransferStrategy logic contract */ function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy) external; /** * @dev Sets an Aave Oracle contract to enforce rewards with a source of value. * @notice At the moment of reward configuration, the Incentives Controller performs * a check to see if the reward asset oracle is compatible with IEACAggregator proxy. * This check is enforced for integrators to be able to show incentives at * the current Aave UI without the need to setup an external price registry * @param reward The address of the reward to set the price aggregator * @param rewardOracle The address of price aggregator that follows AggregatorInterface interface */ function setRewardOracle(address reward, AggregatorInterface rewardOracle) external; /** * @dev Get the price aggregator oracle address * @param reward The address of the reward * @return The price oracle of the reward */ function getRewardOracle(address reward) external view returns (address); /** * @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 Returns the Transfer Strategy implementation contract address being used for a reward address * @param reward The address of the reward * @return The address of the TransferStrategy contract */ function getTransferStrategy(address reward) external view returns (address); /** * @dev Configure assets to incentivize with an emission of rewards per second until the end of distribution. * @param config The assets configuration input, the list of structs contains the following fields: * uint104 emissionPerSecond: The emission per second following rewards unit decimals. * uint256 totalSupply: The total supply of the asset to incentivize * uint40 distributionEnd: The end of the distribution of the incentives for an asset * address asset: The asset address to incentivize * address reward: The reward token address * ITransferStrategy transferStrategy: The TransferStrategy address with the install hook and claim logic. * AggregatorInterface rewardOracle: The Price Oracle of a reward to visualize the incentives at the UI Frontend. * Must follow Chainlink Aggregator AggregatorInterface interface to be compatible. */ function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external; /** * @dev Called by the corresponding asset on transfer hook in order to update the rewards distribution. * @dev The units of `totalSupply` and `userBalance` should be the same. * @param user The address of the user whose asset balance has changed * @param totalSupply The total supply of the asset prior to user balance change * @param userBalance The previous user balance prior to balance change **/ function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; /** * @dev Claims reward for a user to the desired address, on all the assets of the pool, accumulating the pending rewards * @param assets List of assets to check eligible distributions before claiming rewards * @param amount The amount of rewards to claim * @param to The address that will be receiving the rewards * @param reward The address of the reward token * @return The amount of rewards claimed **/ function claimRewards( address[] calldata assets, uint256 amount, address to, address reward ) external returns (uint256); /** * @dev Claims reward for a user on behalf, on all the assets of the pool, accumulating the pending rewards. The * caller must be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager * @param assets The list of assets to check eligible distributions before claiming rewards * @param amount The amount of rewards to claim * @param user The address to check and claim rewards * @param to The address that will be receiving the rewards * @param reward The address of the reward token * @return The amount of rewards claimed **/ function claimRewardsOnBehalf( address[] calldata assets, uint256 amount, address user, address to, address reward ) external returns (uint256); /** * @dev Claims reward for msg.sender, on all the assets of the pool, accumulating the pending rewards * @param assets The list of assets to check eligible distributions before claiming rewards * @param amount The amount of rewards to claim * @param reward The address of the reward token * @return The amount of rewards claimed **/ function claimRewardsToSelf( address[] calldata assets, uint256 amount, address reward ) external returns (uint256); /** * @dev Claims all rewards for a user to the desired address, on all the assets of the pool, accumulating the pending rewards * @param assets The list of assets to check eligible distributions before claiming rewards * @param to The address that will be receiving the rewards * @return rewardsList List of addresses of the reward tokens * @return claimedAmounts List that contains the claimed amount per reward, following same order as "rewardList" **/ function claimAllRewards( address[] calldata assets, address to ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts); /** * @dev Claims all rewards for a user on behalf, on all the assets of the pool, accumulating the pending rewards. The caller must * be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager * @param assets The list of assets to check eligible distributions before claiming rewards * @param user The address to check and claim rewards * @param to The address that will be receiving the rewards * @return rewardsList List of addresses of the reward tokens * @return claimedAmounts List that contains the claimed amount per reward, following same order as "rewardsList" **/ function claimAllRewardsOnBehalf( address[] calldata assets, address user, address to ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts); /** * @dev Claims all reward for msg.sender, on all the assets of the pool, accumulating the pending rewards * @param assets The list of assets to check eligible distributions before claiming rewards * @return rewardsList List of addresses of the reward tokens * @return claimedAmounts List that contains the claimed amount per reward, following same order as "rewardsList" **/ function claimAllRewardsToSelf( address[] calldata assets ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; /** * @title IRewardsDistributor * @author Aave * @notice Defines the basic interface for a Rewards Distributor. */ interface IRewardsDistributor { /** * @dev Emitted when the configuration of the rewards of an asset is updated. * @param asset The address of the incentivized asset * @param reward The address of the reward token * @param oldEmission The old emissions per second value of the reward distribution * @param newEmission The new emissions per second value of the reward distribution * @param oldDistributionEnd The old end timestamp of the reward distribution * @param newDistributionEnd The new end timestamp of the reward distribution * @param assetIndex The index of the asset distribution */ event AssetConfigUpdated( address indexed asset, address indexed reward, uint256 oldEmission, uint256 newEmission, uint256 oldDistributionEnd, uint256 newDistributionEnd, uint256 assetIndex ); /** * @dev Emitted when rewards of an asset are accrued on behalf of a user. * @param asset The address of the incentivized asset * @param reward The address of the reward token * @param user The address of the user that rewards are accrued on behalf of * @param assetIndex The index of the asset distribution * @param userIndex The index of the asset distribution on behalf of the user * @param rewardsAccrued The amount of rewards accrued */ event Accrued( address indexed asset, address indexed reward, address indexed user, uint256 assetIndex, uint256 userIndex, uint256 rewardsAccrued ); /** * @dev Sets the end date for the distribution * @param asset The asset to incentivize * @param reward The reward token that incentives the asset * @param newDistributionEnd The end date of the incentivization, in unix time format **/ function setDistributionEnd(address asset, address reward, uint32 newDistributionEnd) external; /** * @dev Sets the emission per second of a set of reward distributions * @param asset The asset is being incentivized * @param rewards List of reward addresses are being distributed * @param newEmissionsPerSecond List of new reward emissions per second */ function setEmissionPerSecond( address asset, address[] calldata rewards, uint88[] calldata newEmissionsPerSecond ) external; /** * @dev Gets the end date for the distribution * @param asset The incentivized asset * @param reward The reward token of the incentivized asset * @return The timestamp with the end of the distribution, in unix time format **/ function getDistributionEnd(address asset, address reward) external view returns (uint256); /** * @dev Returns the index of a user on a reward distribution * @param user Address of the user * @param asset The incentivized asset * @param reward The reward token of the incentivized asset * @return The current user asset index, not including new distributions **/ function getUserAssetIndex( address user, address asset, address reward ) external view returns (uint256); /** * @dev Returns the configuration of the distribution reward for a certain asset * @param asset The incentivized asset * @param reward The reward token of the incentivized asset * @return The index of the asset distribution * @return The emission per second of the reward distribution * @return The timestamp of the last update of the index * @return The timestamp of the distribution end **/ function getRewardsData( address asset, address reward ) external view returns (uint256, uint256, uint256, uint256); /** * @dev Calculates the next value of an specific distribution index, with validations. * @param asset The incentivized asset * @param reward The reward token of the incentivized asset * @return The old index of the asset distribution * @return The new index of the asset distribution **/ function getAssetIndex(address asset, address reward) external view returns (uint256, uint256); /** * @dev Returns the list of available reward token addresses of an incentivized asset * @param asset The incentivized asset * @return List of rewards addresses of the input asset **/ function getRewardsByAsset(address asset) external view returns (address[] memory); /** * @dev Returns the list of available reward addresses * @return List of rewards supported in this contract **/ function getRewardsList() external view returns (address[] memory); /** * @dev Returns the accrued rewards balance of a user, not including virtually accrued rewards since last distribution. * @param user The address of the user * @param reward The address of the reward token * @return Unclaimed rewards, not including new distributions **/ function getUserAccruedRewards(address user, address reward) external view returns (uint256); /** * @dev Returns a single rewards balance of a user, including virtually accrued and unrealized claimable rewards. * @param assets List of incentivized assets to check eligible distributions * @param user The address of the user * @param reward The address of the reward token * @return The rewards amount **/ function getUserRewards( address[] calldata assets, address user, address reward ) external view returns (uint256); /** * @dev Returns a list all rewards of a user, including already accrued and unrealized claimable rewards * @param assets List of incentivized assets to check eligible distributions * @param user The address of the user * @return The list of reward addresses * @return The list of unclaimed amount of rewards **/ function getAllUserRewards( address[] calldata assets, address user ) external view returns (address[] memory, uint256[] memory); /** * @dev Returns the decimals of an asset to calculate the distribution delta * @param asset The address to retrieve decimals * @return The decimals of an underlying asset */ function getAssetDecimals(address asset) external view returns (uint8); /** * @dev Returns the address of the emission manager * @return The address of the EmissionManager */ function EMISSION_MANAGER() external view returns (address); /** * @dev Returns the address of the emission manager. * Deprecated: This getter is maintained for compatibility purposes. Use the `EMISSION_MANAGER()` function instead. * @return The address of the EmissionManager */ function getEmissionManager() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; interface ITransferStrategyBase { event EmergencyWithdrawal( address indexed caller, address indexed token, address indexed to, uint256 amount ); /** * @dev Perform custom transfer logic via delegate call from source contract to a TransferStrategy implementation * @param to Account to transfer rewards * @param reward Address of the reward token * @param amount Amount to transfer to the "to" address parameter * @return Returns true bool if transfer logic succeeds */ function performTransfer(address to, address reward, uint256 amount) external returns (bool); /** * @return Returns the address of the Incentives Controller */ function getIncentivesController() external view returns (address); /** * @return Returns the address of the Rewards admin */ function getRewardsAdmin() external view returns (address); /** * @dev Perform an emergency token withdrawal only callable by the Rewards admin * @param token Address of the token to withdraw funds from this contract * @param to Address of the recipient of the withdrawal * @param amount Amount of the withdrawal */ function emergencyWithdrawal(address token, address to, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {ITransferStrategyBase} from '../interfaces/ITransferStrategyBase.sol'; import {AggregatorInterface} from '../../dependencies/chainlink/AggregatorInterface.sol'; library RewardsDataTypes { struct RewardsConfigInput { uint88 emissionPerSecond; uint256 totalSupply; uint32 distributionEnd; address asset; address reward; ITransferStrategyBase transferStrategy; AggregatorInterface rewardOracle; } struct UserAssetBalance { address asset; uint256 userBalance; uint256 totalSupply; } struct UserData { // Liquidity index of the reward distribution for the user uint104 index; // Amount of accrued rewards for the user since last user index update uint128 accrued; } struct RewardData { // Liquidity index of the reward distribution uint104 index; // Amount of reward tokens distributed per second uint88 emissionPerSecond; // Timestamp of the last reward index update uint32 lastUpdateTimestamp; // The end of the distribution of rewards (in seconds) uint32 distributionEnd; // Map of user addresses and their rewards data (userAddress => userData) mapping(address => UserData) usersData; } struct AssetData { // Map of reward token addresses and their data (rewardTokenAddress => rewardData) mapping(address => RewardData) rewards; // List of reward token addresses for the asset mapping(uint128 => address) availableRewards; // Count of reward tokens for the asset uint128 availableRewardsCount; // Number of decimals of the asset uint8 decimals; } }
{ "remappings": [ "solidity-utils/=lib/solidity-utils/src/", "forge-std/=lib/forge-std/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "openzeppelin-contracts-upgradeable/=lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/", "@openzeppelin/contracts-upgradeable/=lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/", "erc4626-tests/=lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "halmos-cheatcodes/=lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": false, "libraries": { "src/contracts/protocol/libraries/logic/BorrowLogic.sol": { "BorrowLogic": "0x62325c94E1c49dcDb5937726aB5D8A4c37bCAd36" }, "src/contracts/protocol/libraries/logic/BridgeLogic.sol": { "BridgeLogic": "0x621Ef86D8A5C693a06295BC288B95C12D4CE4994" }, "src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol": { "ConfiguratorLogic": "0x09e88e877B39D883BAFd46b65E7B06CC56963041" }, "src/contracts/protocol/libraries/logic/EModeLogic.sol": { "EModeLogic": "0xC31d2362fAeD85dF79d0bec99693D0EB0Abd3f74" }, "src/contracts/protocol/libraries/logic/FlashLoanLogic.sol": { "FlashLoanLogic": "0x34039100cc9584Ae5D741d322e16d0d18CEE8770" }, "src/contracts/protocol/libraries/logic/LiquidationLogic.sol": { "LiquidationLogic": "0x4731bF01583F991278692E8727d0700a00A1fBBf" }, "src/contracts/protocol/libraries/logic/PoolLogic.sol": { "PoolLogic": "0xf8C97539934ee66a67C26010e8e027D77E821B0C" }, "src/contracts/protocol/libraries/logic/SupplyLogic.sol": { "SupplyLogic": "0x185477906B46D9b8DE0DEB73A1bBfb87b5b51BC3" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"reward","type":"address"},{"indexed":true,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"EmissionAdminUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"components":[{"internalType":"uint88","name":"emissionPerSecond","type":"uint88"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint32","name":"distributionEnd","type":"uint32"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"reward","type":"address"},{"internalType":"contract ITransferStrategyBase","name":"transferStrategy","type":"address"},{"internalType":"contract AggregatorInterface","name":"rewardOracle","type":"address"}],"internalType":"struct RewardsDataTypes.RewardsConfigInput[]","name":"config","type":"tuple[]"}],"name":"configureAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"reward","type":"address"}],"name":"getEmissionAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardsController","outputs":[{"internalType":"contract IRewardsController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"claimer","type":"address"}],"name":"setClaimer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"reward","type":"address"},{"internalType":"uint32","name":"newDistributionEnd","type":"uint32"}],"name":"setDistributionEnd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"reward","type":"address"},{"internalType":"address","name":"admin","type":"address"}],"name":"setEmissionAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[]","name":"rewards","type":"address[]"},{"internalType":"uint88[]","name":"newEmissionsPerSecond","type":"uint88[]"}],"name":"setEmissionPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"reward","type":"address"},{"internalType":"contract AggregatorInterface","name":"rewardOracle","type":"address"}],"name":"setRewardOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"setRewardsController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"reward","type":"address"},{"internalType":"contract ITransferStrategyBase","name":"transferStrategy","type":"address"}],"name":"setTransferStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b50604051610f13380380610f1383398101604081905261002e91610173565b5f80546001600160a01b031916339081178255604051909182915f80516020610ef3833981519152908290a3506100648161006a565b506101a0565b5f546001600160a01b031633146100c85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b03811661012d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100bf565b5f80546040516001600160a01b03808516939216915f80516020610ef383398151915291a35f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f60208284031215610183575f80fd5b81516001600160a01b0381168114610199575f80fd5b9392505050565b610d46806101ad5f395ff3fe608060405234801561000f575f80fd5b50600436106100cb575f3560e01c8063bee36bb311610088578063e15ac62311610063578063e15ac623146101a0578063f2fde38b146101b3578063f5cf673b146101c6578063f996868b146101d9575f80fd5b8063bee36bb314610169578063c5a7b5381461017c578063de2627381461018f575f80fd5b8063529b1e87146100cf5780635453ba1014610116578063715018a61461012b5780638da5cb5b14610133578063955c2ad714610143578063a286c6b414610156575b5f80fd5b6100fa6100dd36600461085c565b6001600160a01b039081165f908152600160205260409020541690565b6040516001600160a01b03909116815260200160405180910390f35b61012961012436600461087e565b6101ec565b005b610129610297565b5f546001600160a01b03166100fa565b610129610151366004610950565b610308565b61012961016436600461087e565b6103e3565b61012961017736600461085c565b61046f565b61012961018a366004610a71565b6104ba565b6002546001600160a01b03166100fa565b6101296101ae36600461087e565b610568565b6101296101c136600461085c565b6105dc565b6101296101d436600461087e565b6106c3565b6101296101e7366004610afd565b610752565b6001600160a01b038281165f90815260016020526040902054839116331461022f5760405162461bcd60e51b815260040161022690610b7a565b60405180910390fd5b6002546040516305453ba160e41b81526001600160a01b038581166004830152848116602483015290911690635453ba10906044015b5f604051808303815f87803b15801561027c575f80fd5b505af115801561028e573d5f803e3d5ffd5b50505050505050565b5f546001600160a01b031633146102c05760405162461bcd60e51b815260040161022690610ba7565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f5b815181101561038257336001600160a01b031660015f84848151811061033257610332610bdc565b602090810291909101810151608001516001600160a01b039081168352908201929092526040015f2054161461037a5760405162461bcd60e51b815260040161022690610b7a565b60010161030a565b5060025460405163955c2ad760e01b81526001600160a01b039091169063955c2ad7906103b3908490600401610bf0565b5f604051808303815f87803b1580156103ca575f80fd5b505af11580156103dc573d5f803e3d5ffd5b5050505050565b5f546001600160a01b0316331461040c5760405162461bcd60e51b815260040161022690610ba7565b6001600160a01b038083165f8181526001602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917fda40ea421dd7e42cf8be71255facac4fdc12a3f70f4d5fd373cb16cec4cb53849190a4505050565b5f546001600160a01b031633146104985760405162461bcd60e51b815260040161022690610ba7565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038281165f9081526001602052604090205483911633146104f45760405162461bcd60e51b815260040161022690610b7a565b6002546040516318b4f6a760e31b81526001600160a01b038681166004830152858116602483015263ffffffff851660448301529091169063c5a7b538906064015f604051808303815f87803b15801561054c575f80fd5b505af115801561055e573d5f803e3d5ffd5b5050505050505050565b6001600160a01b038281165f9081526001602052604090205483911633146105a25760405162461bcd60e51b815260040161022690610b7a565b60025460405163e15ac62360e01b81526001600160a01b03858116600483015284811660248301529091169063e15ac62390604401610265565b5f546001600160a01b031633146106055760405162461bcd60e51b815260040161022690610ba7565b6001600160a01b03811661066a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610226565b5f80546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b031633146106ec5760405162461bcd60e51b815260040161022690610ba7565b60025460405163f5cf673b60e01b81526001600160a01b03848116600483015283811660248301529091169063f5cf673b906044015f604051808303815f87803b158015610738575f80fd5b505af115801561074a573d5f803e3d5ffd5b505050505050565b5f5b838110156107c8573360015f87878581811061077257610772610bdc565b9050602002016020810190610787919061085c565b6001600160a01b03908116825260208201929092526040015f205416146107c05760405162461bcd60e51b815260040161022690610b7a565b600101610754565b5060025460405163f996868b60e01b81526001600160a01b039091169063f996868b906108019088908890889088908890600401610c97565b5f604051808303815f87803b158015610818575f80fd5b505af115801561082a573d5f803e3d5ffd5b505050505050505050565b6001600160a01b0381168114610849575f80fd5b50565b803561085781610835565b919050565b5f6020828403121561086c575f80fd5b813561087781610835565b9392505050565b5f806040838503121561088f575f80fd5b823561089a81610835565b915060208301356108aa81610835565b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b60405160e0810167ffffffffffffffff811182821017156108ec576108ec6108b5565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561091b5761091b6108b5565b604052919050565b80356affffffffffffffffffffff81168114610857575f80fd5b803563ffffffff81168114610857575f80fd5b5f6020808385031215610961575f80fd5b823567ffffffffffffffff80821115610978575f80fd5b818501915085601f83011261098b575f80fd5b81358181111561099d5761099d6108b5565b6109ab848260051b016108f2565b818152848101925060e09182028401850191888311156109c9575f80fd5b938501935b82851015610a655780858a0312156109e4575f80fd5b6109ec6108c9565b6109f586610923565b815286860135878201526040610a0c81880161093d565b90820152606086810135610a1f81610835565b908201526080610a3087820161084c565b9082015260a0610a4187820161084c565b9082015260c0610a5287820161084c565b90820152845293840193928501926109ce565b50979650505050505050565b5f805f60608486031215610a83575f80fd5b8335610a8e81610835565b92506020840135610a9e81610835565b9150610aac6040850161093d565b90509250925092565b5f8083601f840112610ac5575f80fd5b50813567ffffffffffffffff811115610adc575f80fd5b6020830191508360208260051b8501011115610af6575f80fd5b9250929050565b5f805f805f60608688031215610b11575f80fd5b8535610b1c81610835565b9450602086013567ffffffffffffffff80821115610b38575f80fd5b610b4489838a01610ab5565b90965094506040880135915080821115610b5c575f80fd5b50610b6988828901610ab5565b969995985093965092949392505050565b60208082526013908201527227a7262cafa2a6a4a9a9a4a7a72fa0a226a4a760691b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f919060409081850190868401855b82811015610c8a57815180516affffffffffffffffffffff16855286810151878601528581015163ffffffff16868601526060808201516001600160a01b039081169187019190915260808083015182169087015260a08083015182169087015260c091820151169085015260e09093019290850190600101610c0c565b5091979650505050505050565b6001600160a01b038681168252606060208084018290529083018690525f91879160808501845b89811015610ce5578435610cd181610835565b841682529382019390820190600101610cbe565b508581036040870152868152810192508691505f5b86811015610d2a576affffffffffffffffffffff610d1784610923565b1684529281019291810191600101610cfa565b5091999850505050505050505056fea164736f6c6343000816000a8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0000000000000000000000000f49821d13c14d13639b11939250ae3ed00db4f48
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106100cb575f3560e01c8063bee36bb311610088578063e15ac62311610063578063e15ac623146101a0578063f2fde38b146101b3578063f5cf673b146101c6578063f996868b146101d9575f80fd5b8063bee36bb314610169578063c5a7b5381461017c578063de2627381461018f575f80fd5b8063529b1e87146100cf5780635453ba1014610116578063715018a61461012b5780638da5cb5b14610133578063955c2ad714610143578063a286c6b414610156575b5f80fd5b6100fa6100dd36600461085c565b6001600160a01b039081165f908152600160205260409020541690565b6040516001600160a01b03909116815260200160405180910390f35b61012961012436600461087e565b6101ec565b005b610129610297565b5f546001600160a01b03166100fa565b610129610151366004610950565b610308565b61012961016436600461087e565b6103e3565b61012961017736600461085c565b61046f565b61012961018a366004610a71565b6104ba565b6002546001600160a01b03166100fa565b6101296101ae36600461087e565b610568565b6101296101c136600461085c565b6105dc565b6101296101d436600461087e565b6106c3565b6101296101e7366004610afd565b610752565b6001600160a01b038281165f90815260016020526040902054839116331461022f5760405162461bcd60e51b815260040161022690610b7a565b60405180910390fd5b6002546040516305453ba160e41b81526001600160a01b038581166004830152848116602483015290911690635453ba10906044015b5f604051808303815f87803b15801561027c575f80fd5b505af115801561028e573d5f803e3d5ffd5b50505050505050565b5f546001600160a01b031633146102c05760405162461bcd60e51b815260040161022690610ba7565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f5b815181101561038257336001600160a01b031660015f84848151811061033257610332610bdc565b602090810291909101810151608001516001600160a01b039081168352908201929092526040015f2054161461037a5760405162461bcd60e51b815260040161022690610b7a565b60010161030a565b5060025460405163955c2ad760e01b81526001600160a01b039091169063955c2ad7906103b3908490600401610bf0565b5f604051808303815f87803b1580156103ca575f80fd5b505af11580156103dc573d5f803e3d5ffd5b5050505050565b5f546001600160a01b0316331461040c5760405162461bcd60e51b815260040161022690610ba7565b6001600160a01b038083165f8181526001602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917fda40ea421dd7e42cf8be71255facac4fdc12a3f70f4d5fd373cb16cec4cb53849190a4505050565b5f546001600160a01b031633146104985760405162461bcd60e51b815260040161022690610ba7565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038281165f9081526001602052604090205483911633146104f45760405162461bcd60e51b815260040161022690610b7a565b6002546040516318b4f6a760e31b81526001600160a01b038681166004830152858116602483015263ffffffff851660448301529091169063c5a7b538906064015f604051808303815f87803b15801561054c575f80fd5b505af115801561055e573d5f803e3d5ffd5b5050505050505050565b6001600160a01b038281165f9081526001602052604090205483911633146105a25760405162461bcd60e51b815260040161022690610b7a565b60025460405163e15ac62360e01b81526001600160a01b03858116600483015284811660248301529091169063e15ac62390604401610265565b5f546001600160a01b031633146106055760405162461bcd60e51b815260040161022690610ba7565b6001600160a01b03811661066a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610226565b5f80546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b031633146106ec5760405162461bcd60e51b815260040161022690610ba7565b60025460405163f5cf673b60e01b81526001600160a01b03848116600483015283811660248301529091169063f5cf673b906044015f604051808303815f87803b158015610738575f80fd5b505af115801561074a573d5f803e3d5ffd5b505050505050565b5f5b838110156107c8573360015f87878581811061077257610772610bdc565b9050602002016020810190610787919061085c565b6001600160a01b03908116825260208201929092526040015f205416146107c05760405162461bcd60e51b815260040161022690610b7a565b600101610754565b5060025460405163f996868b60e01b81526001600160a01b039091169063f996868b906108019088908890889088908890600401610c97565b5f604051808303815f87803b158015610818575f80fd5b505af115801561082a573d5f803e3d5ffd5b505050505050505050565b6001600160a01b0381168114610849575f80fd5b50565b803561085781610835565b919050565b5f6020828403121561086c575f80fd5b813561087781610835565b9392505050565b5f806040838503121561088f575f80fd5b823561089a81610835565b915060208301356108aa81610835565b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b60405160e0810167ffffffffffffffff811182821017156108ec576108ec6108b5565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561091b5761091b6108b5565b604052919050565b80356affffffffffffffffffffff81168114610857575f80fd5b803563ffffffff81168114610857575f80fd5b5f6020808385031215610961575f80fd5b823567ffffffffffffffff80821115610978575f80fd5b818501915085601f83011261098b575f80fd5b81358181111561099d5761099d6108b5565b6109ab848260051b016108f2565b818152848101925060e09182028401850191888311156109c9575f80fd5b938501935b82851015610a655780858a0312156109e4575f80fd5b6109ec6108c9565b6109f586610923565b815286860135878201526040610a0c81880161093d565b90820152606086810135610a1f81610835565b908201526080610a3087820161084c565b9082015260a0610a4187820161084c565b9082015260c0610a5287820161084c565b90820152845293840193928501926109ce565b50979650505050505050565b5f805f60608486031215610a83575f80fd5b8335610a8e81610835565b92506020840135610a9e81610835565b9150610aac6040850161093d565b90509250925092565b5f8083601f840112610ac5575f80fd5b50813567ffffffffffffffff811115610adc575f80fd5b6020830191508360208260051b8501011115610af6575f80fd5b9250929050565b5f805f805f60608688031215610b11575f80fd5b8535610b1c81610835565b9450602086013567ffffffffffffffff80821115610b38575f80fd5b610b4489838a01610ab5565b90965094506040880135915080821115610b5c575f80fd5b50610b6988828901610ab5565b969995985093965092949392505050565b60208082526013908201527227a7262cafa2a6a4a9a9a4a7a72fa0a226a4a760691b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f919060409081850190868401855b82811015610c8a57815180516affffffffffffffffffffff16855286810151878601528581015163ffffffff16868601526060808201516001600160a01b039081169187019190915260808083015182169087015260a08083015182169087015260c091820151169085015260e09093019290850190600101610c0c565b5091979650505050505050565b6001600160a01b038681168252606060208084018290529083018690525f91879160808501845b89811015610ce5578435610cd181610835565b841682529382019390820190600101610cbe565b508581036040870152868152810192508691505f5b86811015610d2a576affffffffffffffffffffff610d1784610923565b1684529281019291810191600101610cfa565b5091999850505050505050505056fea164736f6c6343000816000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f49821d13c14d13639b11939250ae3ed00db4f48
-----Decoded View---------------
Arg [0] : owner (address): 0xf49821D13c14D13639b11939250AE3ED00DB4f48
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000f49821d13c14d13639b11939250ae3ed00db4f48
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.