Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xe3dD4369...A2942aC33 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DefaultReserveInterestRateStrategy
Compiler Version
v0.8.10+commit.fc410830
Contract Source Code (Solidity Standard Json-Input format)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: BUSL-1.1pragma solidity ^0.8.10;import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';import {WadRayMath} from '../libraries/math/WadRayMath.sol';import {PercentageMath} from '../libraries/math/PercentageMath.sol';import {DataTypes} from '../libraries/types/DataTypes.sol';import {Errors} from '../libraries/helpers/Errors.sol';import {IDefaultInterestRateStrategy} from '../../interfaces/IDefaultInterestRateStrategy.sol';import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol';import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol';/*** @title DefaultReserveInterestRateStrategy contract* @author Aave* @notice Implements the calculation of the interest rates depending on the reserve state* @dev The model of interest rate is based on 2 slopes, one before the `OPTIMAL_USAGE_RATIO`* point of usage and another from that one to 100%.* - An instance of this same contract, can't be used across different Aave markets, due to the caching* of the PoolAddressesProvider*/contract DefaultReserveInterestRateStrategy is IDefaultInterestRateStrategy {using WadRayMath for uint256;using PercentageMath for uint256;/// @inheritdoc IDefaultInterestRateStrategy
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPL-3.0pragma solidity ^0.8.0;/*** @dev Interface of the ERC20 standard as defined in the EIP.*/interface IERC20 {/*** @dev Returns the amount of tokens in existence.*/function totalSupply() external view returns (uint256);/*** @dev Returns the amount of tokens owned by `account`.*/function balanceOf(address account) external view returns (uint256);/*** @dev Moves `amount` tokens from the caller's account to `recipient`.** Returns a boolean value indicating whether the operation succeeded.** Emits a {Transfer} event.*/function transfer(address recipient, uint256 amount) external returns (bool);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPL-3.0pragma solidity ^0.8.0;import {IReserveInterestRateStrategy} from './IReserveInterestRateStrategy.sol';import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';/*** @title IDefaultInterestRateStrategy* @author Aave* @notice Defines the basic interface of the DefaultReserveInterestRateStrategy*/interface IDefaultInterestRateStrategy is IReserveInterestRateStrategy {/*** @notice Returns the usage ratio at which the pool aims to obtain most competitive borrow rates.* @return The optimal usage ratio, expressed in ray.*/function OPTIMAL_USAGE_RATIO() external view returns (uint256);/*** @notice Returns the optimal stable to total debt ratio of the reserve.* @return The optimal stable to total debt ratio, expressed in ray.*/function OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO() external view returns (uint256);/*** @notice Returns the excess usage ratio above the optimal.
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPL-3.0pragma solidity ^0.8.0;/*** @title IPoolAddressesProvider* @author Aave* @notice Defines the basic interface for a Pool Addresses Provider.*/interface IPoolAddressesProvider {/*** @dev Emitted when the market identifier is updated.* @param oldMarketId The old id of the market* @param newMarketId The new id of the market*/event MarketIdSet(string indexed oldMarketId, string indexed newMarketId);/*** @dev Emitted when the pool is updated.* @param oldAddress The old address of the Pool* @param newAddress The new address of the Pool*/event PoolUpdated(address indexed oldAddress, address indexed newAddress);/*** @dev Emitted when the pool configurator is updated.* @param oldAddress The old address of the PoolConfigurator
12345678910111213141516171819202122// SPDX-License-Identifier: AGPL-3.0pragma solidity ^0.8.0;import {DataTypes} from '../protocol/libraries/types/DataTypes.sol';/*** @title IReserveInterestRateStrategy* @author Aave* @notice Interface for the calculation of the interest rates*/interface IReserveInterestRateStrategy {/*** @notice Calculates the interest rates depending on the reserve's state and configurations* @param params The parameters needed to calculate interest rates* @return liquidityRate The liquidity rate expressed in rays* @return stableBorrowRate The stable borrow rate expressed in rays* @return variableBorrowRate The variable borrow rate expressed in rays*/function calculateInterestRates(DataTypes.CalculateInterestRatesParams memory params) external view returns (uint256, uint256, uint256);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: BUSL-1.1pragma solidity ^0.8.0;/*** @title Errors library* @author Aave* @notice Defines the error messages emitted by the different contracts of the Aave protocol*/library Errors {string public constant CALLER_NOT_POOL_ADMIN = '1'; // 'The caller of the function is not a pool admin'string public constant CALLER_NOT_EMERGENCY_ADMIN = '2'; // 'The caller of the function is not an emergency admin'string public constant CALLER_NOT_POOL_OR_EMERGENCY_ADMIN = '3'; // 'The caller of the function is not a pool or emergency admin'string public constant CALLER_NOT_RISK_OR_POOL_ADMIN = '4'; // 'The caller of the function is not a risk or pool admin'string public constant CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN = '5'; // 'The caller of the function is not an asset listing or pool admin'string public constant CALLER_NOT_BRIDGE = '6'; // 'The caller of the function is not a bridge'string public constant ADDRESSES_PROVIDER_NOT_REGISTERED = '7'; // 'Pool addresses provider is not registered'string public constant INVALID_ADDRESSES_PROVIDER_ID = '8'; // 'Invalid id for the pool addresses provider'string public constant NOT_CONTRACT = '9'; // 'Address is not a contract'string public constant CALLER_NOT_POOL_CONFIGURATOR = '10'; // 'The caller of the function is not the pool configurator'string public constant CALLER_NOT_ATOKEN = '11'; // 'The caller of the function is not an AToken'string public constant INVALID_ADDRESSES_PROVIDER = '12'; // 'The address of the pool addresses provider is invalid'string public constant INVALID_FLASHLOAN_EXECUTOR_RETURN = '13'; // 'Invalid return value of the flashloan executor function'string public constant RESERVE_ALREADY_ADDED = '14'; // 'Reserve has already been added to reserve list'string public constant NO_MORE_RESERVES_ALLOWED = '15'; // 'Maximum amount of reserves in the pool reached'string public constant EMODE_CATEGORY_RESERVED = '16'; // 'Zero eMode category is reserved for volatile heterogeneous assets'string public constant INVALID_EMODE_CATEGORY_ASSIGNMENT = '17'; // 'Invalid eMode category assignment to asset'
1234567891011121314151617181920212223242526// SPDX-License-Identifier: BUSL-1.1pragma solidity ^0.8.0;/*** @title PercentageMath library* @author Aave* @notice Provides functions to perform percentage calculations* @dev Percentages are defined by default with 2 decimals of precision (100.00). The precision is indicated by PERCENTAGE_FACTOR* @dev Operations are rounded. If a value is >=.5, will be rounded up, otherwise rounded down.*/library PercentageMath {// Maximum percentage factor (100.00%)uint256 internal constant PERCENTAGE_FACTOR = 1e4;// Half percentage factor (50.00%)uint256 internal constant HALF_PERCENTAGE_FACTOR = 0.5e4;/*** @notice Executes a percentage multiplication* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328* @param value The value of which the percentage needs to be calculated* @param percentage The percentage of the value to be calculated* @return result value percentmul percentage*/function percentMul(uint256 value, uint256 percentage) internal pure returns (uint256 result) {// to avoid overflow, value <= (type(uint256).max - HALF_PERCENTAGE_FACTOR) / percentage
1234567891011121314151617181920212223242526// SPDX-License-Identifier: BUSL-1.1pragma solidity ^0.8.0;/*** @title WadRayMath library* @author Aave* @notice Provides functions to perform calculations with Wad and Ray units* @dev Provides mul and div function for wads (decimal numbers with 18 digits of precision) and rays (decimal numbers* with 27 digits of precision)* @dev Operations are rounded. If a value is >=.5, will be rounded up, otherwise rounded down.*/library WadRayMath {// HALF_WAD and HALF_RAY expressed with extended notation as constant with operations are not supported in Yul assemblyuint256 internal constant WAD = 1e18;uint256 internal constant HALF_WAD = 0.5e18;uint256 internal constant RAY = 1e27;uint256 internal constant HALF_RAY = 0.5e27;uint256 internal constant WAD_RAY_RATIO = 1e9;/*** @dev Multiplies two wad, rounding half up to the nearest wad* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328* @param a Wad* @param b Wad
1234567891011121314151617181920212223242526// SPDX-License-Identifier: BUSL-1.1pragma solidity ^0.8.0;library DataTypes {struct ReserveData {//stores the reserve configurationReserveConfigurationMap configuration;//the liquidity index. Expressed in rayuint128 liquidityIndex;//the current supply rate. Expressed in rayuint128 currentLiquidityRate;//variable borrow index. Expressed in rayuint128 variableBorrowIndex;//the current variable borrow rate. Expressed in rayuint128 currentVariableBorrowRate;//the current stable borrow rate. Expressed in rayuint128 currentStableBorrowRate;//timestamp of last updateuint40 lastUpdateTimestamp;//the id of the reserve. Represents the position in the list of the active reservesuint16 id;//aToken addressaddress aTokenAddress;//stableDebtToken addressaddress stableDebtTokenAddress;//variableDebtToken address
12345678910111213141516171819202122232425{"evmVersion": "berlin","libraries": {},"metadata": {"bytecodeHash": "ipfs","useLiteralContent": true},"optimizer": {"enabled": true,"runs": 100000},"remappings": [],"outputSelection": {"*": {"*": ["evm.bytecode","evm.deployedBytecode","devdoc","userdoc","metadata","abi"]}}}
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IPoolAddressesProvider","name":"provider","type":"address"},{"internalType":"uint256","name":"optimalUsageRatio","type":"uint256"},{"internalType":"uint256","name":"baseVariableBorrowRate","type":"uint256"},{"internalType":"uint256","name":"variableRateSlope1","type":"uint256"},{"internalType":"uint256","name":"variableRateSlope2","type":"uint256"},{"internalType":"uint256","name":"stableRateSlope1","type":"uint256"},{"internalType":"uint256","name":"stableRateSlope2","type":"uint256"},{"internalType":"uint256","name":"baseStableRateOffset","type":"uint256"},{"internalType":"uint256","name":"stableRateExcessOffset","type":"uint256"},{"internalType":"uint256","name":"optimalStableToTotalDebtRatio","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ADDRESSES_PROVIDER","outputs":[{"internalType":"contract IPoolAddressesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EXCESS_STABLE_TO_TOTAL_DEBT_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EXCESS_USAGE_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPTIMAL_USAGE_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"unbacked","type":"uint256"},{"internalType":"uint256","name":"liquidityAdded","type":"uint256"},{"internalType":"uint256","name":"liquidityTaken","type":"uint256"},{"internalType":"uint256","name":"totalStableDebt","type":"uint256"},{"internalType":"uint256","name":"totalVariableDebt","type":"uint256"},{"internalType":"uint256","name":"averageStableBorrowRate","type":"uint256"},{"internalType":"uint256","name":"reserveFactor","type":"uint256"},{"internalType":"address","name":"reserve","type":"address"},{"internalType":"address","name":"aToken","type":"address"}],"internalType":"struct DataTypes.CalculateInterestRatesParams","name":"params","type":"tuple"}],"name":"calculateInterestRates","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseStableBorrowRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseVariableBorrowRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxVariableBorrowRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStableRateExcessOffset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStableRateSlope1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStableRateSlope2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVariableRateSlope1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVariableRateSlope2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a58987091161008c578063bc62690811610066578063bc6269081461026f578063d5cd739114610295578063f4202409146102bb578063fe5fd698146102e157600080fd5b8063a589870914610212578063a9c622f814610240578063acd786861461026757600080fd5b806334762ca5116100c857806334762ca51461019657806354c365c6146101bc5780636fb92589146101e357806380031e371461020a57600080fd5b80630542975c146100ef5780630b3429a21461014057806314e32da414610170575b600080fd5b6101167f0000000000000000000000007d41c82384019cc7014d338e18d9d6a33ddea5ba81565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000021165458500521280000005b604051908152602001610137565b7f000000000000000000000000000000000000000001f04ef12cb04cf158000000610162565b7f0000000000000000000000000000000000000000000000000000000000000000610162565b6101627f000000000000000000000000000000000000000001f04ef12cb04cf15800000081565b6101627f000000000000000000000000000000000000000000a56fa5b99019a5c800000081565b610162610308565b610225610220366004610adb565b610384565b60408051938452602084019290925290820152606001610137565b6101627f0000000000000000000000000000000000000000014adf4b7320334b9000000081565b6101626108bf565b7f000000000000000000000000000000000000000000422ca8b0a00a4250000000610162565b7f0000000000000000000000000000000000000000000422ca8b0a00a425000000610162565b7f000000000000000000000000000000000000000001f04ef12cb04cf158000000610162565b6101627f00000000000000000000000000000000000000000295be96e64066972000000081565b60007f000000000000000000000000000000000000000001f04ef12cb04cf1580000006103757f00000000000000000000000000000000000000000021165458500521280000007f0000000000000000000000000000000000000000000000000000000000000000610b8f565b61037f9190610b8f565b905090565b60008060006103d86040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b846080015185606001516103ec9190610b8f565b6020820152600060808201527f000000000000000000000000000000000000000000000000000000000000000060408201526104266108bf565b606082015260208101511561055d57602081015160608601516104489161090b565b60e08083019190915260408087015160208801519288015161010089015192517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff938416600482015291939216906370a0823190602401602060405180830381865afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f79190610ba7565b6105019190610b8f565b61050b9190610bc0565b808252602082015161051c91610b8f565b610100820181905260208201516105329161090b565b60a082015284516101008201516105579161054c91610b8f565b60208301519061090b565b60c08201525b7f000000000000000000000000000000000000000001f04ef12cb04cf1580000008160a0015111156106be5760006105e57f0000000000000000000000000000000000000000014adf4b7320334b900000007f000000000000000000000000000000000000000001f04ef12cb04cf1580000008460a001516105df9190610bc0565b9061090b565b90506106117f000000000000000000000000000000000000000001f04ef12cb04cf1580000008261094a565b61063b907f0000000000000000000000000000000000000000000422ca8b0a00a425000000610b8f565b8260600181815161064c9190610b8f565b9052506106797f000000000000000000000000000000000000000001f04ef12cb04cf1580000008261094a565b6106a3907f0000000000000000000000000000000000000000002116545850052128000000610b8f565b826040018181516106b49190610b8f565b9052506107989050565b6107197f000000000000000000000000000000000000000001f04ef12cb04cf1580000006105df8360a001517f0000000000000000000000000000000000000000000422ca8b0a00a42500000061094a90919063ffffffff16565b8160600181815161072a9190610b8f565b90525060a0810151610783907f000000000000000000000000000000000000000001f04ef12cb04cf158000000906105df907f00000000000000000000000000000000000000000021165458500521280000009061094a565b816040018181516107949190610b8f565b9052505b7f000000000000000000000000000000000000000000a56fa5b99019a5c80000008160e00151111561085c57600061081a7f00000000000000000000000000000000000000000295be96e6406697200000007f000000000000000000000000000000000000000000a56fa5b99019a5c80000008460e001516105df9190610bc0565b90506108467f000000000000000000000000000000000000000000422ca8b0a00a42500000008261094a565b826060018181516108579190610b8f565b905250505b6108a18560c001516127106108719190610bc0565b61089b8360c0015161089589606001518a6080015187604001518c60a001516109a1565b9061094a565b90610a08565b60808201819052606082015160409092015190969195509350915050565b600061037f7f000000000000000000000000000000000000000000084595161401484a0000007f0000000000000000000000000000000000000000002116545850052128000000610b8f565b600081156b033b2e3c9fd0803ce80000006002840419048411171561092f57600080fd5b506b033b2e3c9fd0803ce80000009190910260028204010490565b600081157ffffffffffffffffffffffffffffffffffffffffffe6268e1b017bfe18bffffff8390048411151761097f57600080fd5b506b033b2e3c9fd0803ce800000091026b019d971e4fe8401e74000000010490565b6000806109ae8587610b8f565b9050806109bf576000915050610a00565b60006109ce8561089588610a4b565b905060006109df856108958a610a4b565b905060006109f96109ef85610a4b565b6105df8486610b8f565b9450505050505b949350505050565b600081157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec7783900484111517610a3d57600080fd5b506127109102611388010490565b633b9aca008181029081048214610a6157600080fd5b919050565b604051610120810167ffffffffffffffff81118282101715610ab1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b803573ffffffffffffffffffffffffffffffffffffffff81168114610a6157600080fd5b60006101208284031215610aee57600080fd5b610af6610a66565b823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c0820152610b4260e08401610ab7565b60e0820152610100610b55818501610ab7565b908201529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610ba257610ba2610b60565b500190565b600060208284031215610bb957600080fd5b5051919050565b600082821015610bd257610bd2610b60565b50039056fea26469706673582212202429128531aba381237b8b5630526b46e16fae03dbb463f5a83786873419101a64736f6c634300080a0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 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.