Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 72086613 | 968 days ago | 0 ETH | ||||
| 72086613 | 968 days ago | 0 ETH | ||||
| 72086613 | 968 days ago | 0 ETH | ||||
| 72086613 | 968 days ago | 0 ETH | ||||
| 72086136 | 968 days ago | 0 ETH | ||||
| 72086136 | 968 days ago | 0 ETH | ||||
| 72086136 | 968 days ago | 0 ETH | ||||
| 72086136 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH | ||||
| 72086088 | 968 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DefaultReserveInterestRateStrategy
Compiler Version
v0.8.12+commit.f00d7308
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import {IReserveInterestRateStrategy} from "../../interfaces/IReserveInterestRateStrategy.sol";
import {WadRayMath} from "../libraries/math/WadRayMath.sol";
import {PercentageMath} from "../libraries/math/PercentageMath.sol";
import {ILendingPoolAddressesProvider} from "../../interfaces/ILendingPoolAddressesProvider.sol";
import {ILendingRateOracle} from "../../interfaces/ILendingRateOracle.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @title DefaultReserveInterestRateStrategy contract
* @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_UTILIZATION_RATE`
* point of utilization 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 LendingPoolAddressesProvider
* @author Aave
**/
contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
using WadRayMath for uint256;
using SafeMath for uint256;
using PercentageMath for uint256;
/**
* @dev this constant represents the utilization rate at which the pool aims to obtain most competitive borrow rates.
* Expressed in ray
**/
uint256 public immutable OPTIMAL_UTILIZATION_RATE;
/**
* @dev This constant represents the excess utilization rate above the optimal. It's always equal to
* 1-optimal utilization rate. Added as a constant here for gas optimizations.
* Expressed in ray
**/
uint256 public immutable EXCESS_UTILIZATION_RATE;
ILendingPoolAddressesProvider public immutable addressesProvider;
// Base variable borrow rate when Utilization rate = 0. Expressed in ray
uint256 internal immutable _baseVariableBorrowRate;
// Slope of the variable interest curve when utilization rate > 0 and <= OPTIMAL_UTILIZATION_RATE. Expressed in ray
uint256 internal immutable _variableRateSlope1;
// Slope of the variable interest curve when utilization rate > OPTIMAL_UTILIZATION_RATE. Expressed in ray
uint256 internal immutable _variableRateSlope2;
// Slope of the stable interest curve when utilization rate > 0 and <= OPTIMAL_UTILIZATION_RATE. Expressed in ray
uint256 internal immutable _stableRateSlope1;
// Slope of the stable interest curve when utilization rate > OPTIMAL_UTILIZATION_RATE. Expressed in ray
uint256 internal immutable _stableRateSlope2;
constructor(
ILendingPoolAddressesProvider provider,
uint256 optimalUtilizationRate_,
uint256 baseVariableBorrowRate_,
uint256 variableRateSlope1_,
uint256 variableRateSlope2_,
uint256 stableRateSlope1_,
uint256 stableRateSlope2_
) {
OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate_;
EXCESS_UTILIZATION_RATE = WadRayMath.ray().sub(optimalUtilizationRate_);
addressesProvider = provider;
_baseVariableBorrowRate = baseVariableBorrowRate_;
_variableRateSlope1 = variableRateSlope1_;
_variableRateSlope2 = variableRateSlope2_;
_stableRateSlope1 = stableRateSlope1_;
_stableRateSlope2 = stableRateSlope2_;
}
function variableRateSlope1() external view returns (uint256) {
return _variableRateSlope1;
}
function variableRateSlope2() external view returns (uint256) {
return _variableRateSlope2;
}
function stableRateSlope1() external view returns (uint256) {
return _stableRateSlope1;
}
function stableRateSlope2() external view returns (uint256) {
return _stableRateSlope2;
}
function baseVariableBorrowRate() external view override returns (uint256) {
return _baseVariableBorrowRate;
}
function getMaxVariableBorrowRate() external view override returns (uint256) {
return _baseVariableBorrowRate.add(_variableRateSlope1).add(_variableRateSlope2);
}
/**
* @dev Calculates the interest rates depending on the reserve's state and configurations
* @param reserve The address of the reserve
* @param liquidityAdded The liquidity added during the operation
* @param liquidityTaken The liquidity taken during the operation
* @param totalStableDebt The total borrowed from the reserve a stable rate
* @param totalVariableDebt The total borrowed from the reserve at a variable rate
* @param averageStableBorrowRate The weighted average of all the stable rate loans
* @param reserveFactor The reserve portion of the interest that goes to the treasury of the market
* @return The liquidity rate, the stable borrow rate and the variable borrow rate
**/
function calculateInterestRates(
address reserve,
address aToken,
uint256 liquidityAdded,
uint256 liquidityTaken,
uint256 totalStableDebt,
uint256 totalVariableDebt,
uint256 averageStableBorrowRate,
uint256 reserveFactor
) external view override returns (uint256, uint256, uint256) {
uint256 availableLiquidity = IERC20(reserve).balanceOf(aToken);
//avoid stack too deep
availableLiquidity = availableLiquidity.add(liquidityAdded).sub(liquidityTaken);
return
calculateInterestRates(
reserve,
availableLiquidity,
totalStableDebt,
totalVariableDebt,
averageStableBorrowRate,
reserveFactor
);
}
struct CalcInterestRatesLocalVars {
uint256 totalDebt;
uint256 currentVariableBorrowRate;
uint256 currentStableBorrowRate;
uint256 currentLiquidityRate;
uint256 utilizationRate;
}
/**
* @dev Calculates the interest rates depending on the reserve's state and configurations.
* NOTE This function is kept for compatibility with the previous DefaultInterestRateStrategy interface.
* New protocol implementation uses the new calculateInterestRates() interface
* @param reserve The address of the reserve
* @param availableLiquidity The liquidity available in the corresponding aToken
* @param totalStableDebt The total borrowed from the reserve a stable rate
* @param totalVariableDebt The total borrowed from the reserve at a variable rate
* @param averageStableBorrowRate The weighted average of all the stable rate loans
* @param reserveFactor The reserve portion of the interest that goes to the treasury of the market
* @return The liquidity rate, the stable borrow rate and the variable borrow rate
**/
function calculateInterestRates(
address reserve,
uint256 availableLiquidity,
uint256 totalStableDebt,
uint256 totalVariableDebt,
uint256 averageStableBorrowRate,
uint256 reserveFactor
) public view override returns (uint256, uint256, uint256) {
CalcInterestRatesLocalVars memory vars;
vars.totalDebt = totalStableDebt.add(totalVariableDebt);
vars.currentVariableBorrowRate = 0;
vars.currentStableBorrowRate = 0;
vars.currentLiquidityRate = 0;
vars.utilizationRate = vars.totalDebt == 0 ? 0 : vars.totalDebt.rayDiv(availableLiquidity.add(vars.totalDebt));
vars.currentStableBorrowRate = ILendingRateOracle(addressesProvider.getLendingRateOracle()).getMarketBorrowRate(
reserve
);
if (vars.utilizationRate > OPTIMAL_UTILIZATION_RATE) {
uint256 excessUtilizationRateRatio = vars.utilizationRate.sub(OPTIMAL_UTILIZATION_RATE).rayDiv(
EXCESS_UTILIZATION_RATE
);
vars.currentStableBorrowRate = vars.currentStableBorrowRate.add(_stableRateSlope1).add(
_stableRateSlope2.rayMul(excessUtilizationRateRatio)
);
vars.currentVariableBorrowRate = _baseVariableBorrowRate.add(_variableRateSlope1).add(
_variableRateSlope2.rayMul(excessUtilizationRateRatio)
);
} else {
vars.currentStableBorrowRate = vars.currentStableBorrowRate.add(
_stableRateSlope1.rayMul(vars.utilizationRate.rayDiv(OPTIMAL_UTILIZATION_RATE))
);
vars.currentVariableBorrowRate = _baseVariableBorrowRate.add(
vars.utilizationRate.rayMul(_variableRateSlope1).rayDiv(OPTIMAL_UTILIZATION_RATE)
);
}
vars.currentLiquidityRate = _getOverallBorrowRate(
totalStableDebt,
totalVariableDebt,
vars.currentVariableBorrowRate,
averageStableBorrowRate
).rayMul(vars.utilizationRate).percentMul(PercentageMath.PERCENTAGE_FACTOR.sub(reserveFactor));
return (vars.currentLiquidityRate, vars.currentStableBorrowRate, vars.currentVariableBorrowRate);
}
/**
* @dev Calculates the overall borrow rate as the weighted average between the total variable debt and total stable debt
* @param totalStableDebt The total borrowed from the reserve a stable rate
* @param totalVariableDebt The total borrowed from the reserve at a variable rate
* @param currentVariableBorrowRate The current variable borrow rate of the reserve
* @param currentAverageStableBorrowRate The current weighted average of all the stable rate loans
* @return The weighted averaged borrow rate
**/
function _getOverallBorrowRate(
uint256 totalStableDebt,
uint256 totalVariableDebt,
uint256 currentVariableBorrowRate,
uint256 currentAverageStableBorrowRate
) internal pure returns (uint256) {
uint256 totalDebt = totalStableDebt.add(totalVariableDebt);
if (totalDebt == 0) return 0;
uint256 weightedVariableRate = totalVariableDebt.wadToRay().rayMul(currentVariableBorrowRate);
uint256 weightedStableRate = totalStableDebt.wadToRay().rayMul(currentAverageStableBorrowRate);
uint256 overallBorrowRate = weightedVariableRate.add(weightedStableRate).rayDiv(totalDebt.wadToRay());
return overallBorrowRate;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
/**
* @title LendingPoolAddressesProvider contract
* @dev Main registry of addresses part of or connected to the protocol, including permissioned roles
* - Acting also as factory of proxies and admin of those, so with right to change its implementations
* - Owned by the Aave Governance
* @author Aave
**/
interface ILendingPoolAddressesProvider {
event MarketIdSet(string newMarketId);
event LendingPoolUpdated(address indexed newAddress);
event ConfigurationAdminUpdated(address indexed newAddress);
event EmergencyAdminUpdated(address indexed newAddress);
event LendingPoolConfiguratorUpdated(address indexed newAddress);
event LendingPoolCollateralManagerUpdated(address indexed newAddress);
event PriceOracleUpdated(address indexed newAddress);
event LendingRateOracleUpdated(address indexed newAddress);
event ProxyCreated(bytes32 id, address indexed newAddress);
event AddressSet(bytes32 id, address indexed newAddress, bool hasProxy);
function getMarketId() external view returns (string memory);
function setMarketId(string calldata marketId) external;
function setAddress(bytes32 id, address newAddress) external;
function setAddressAsProxy(bytes32 id, address impl) external;
function getAddress(bytes32 id) external view returns (address);
function getLendingPool() external view returns (address);
function setLendingPoolImpl(address pool) external;
function getLendingPoolConfigurator() external view returns (address);
function setLendingPoolConfiguratorImpl(address configurator) external;
function getLendingPoolCollateralManager() external view returns (address);
function setLendingPoolCollateralManager(address manager) external;
function getPoolAdmin() external view returns (address);
function setPoolAdmin(address admin) external;
function getEmergencyAdmin() external view returns (address);
function setEmergencyAdmin(address admin) external;
function getPriceOracle() external view returns (address);
function setPriceOracle(address priceOracle) external;
function getLendingRateOracle() external view returns (address);
function setLendingRateOracle(address lendingRateOracle) external;
function getLiquidationFeeTo() external view returns (address);
function setLiquidationFeeTo(address liquidationFeeTo) external;
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
/**
* @title ILendingRateOracle interface
* @notice Interface for the Aave borrow rate oracle. Provides the average market borrow rate to be used as a base for the stable borrow rate calculations
**/
interface ILendingRateOracle {
/**
@dev returns the market borrow rate in ray
**/
function getMarketBorrowRate(address asset) external view returns (uint256);
/**
@dev sets the market borrow rate. Rate value must be in ray
**/
function setMarketBorrowRate(address asset, uint256 rate) external;
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
/**
* @title IReserveInterestRateStrategyInterface interface
* @dev Interface for the calculation of the interest rates
* @author Aave
*/
interface IReserveInterestRateStrategy {
function baseVariableBorrowRate() external view returns (uint256);
function getMaxVariableBorrowRate() external view returns (uint256);
function calculateInterestRates(
address reserve,
uint256 availableLiquidity,
uint256 totalStableDebt,
uint256 totalVariableDebt,
uint256 averageStableBorrowRate,
uint256 reserveFactor
) external view returns (uint256, uint256, uint256);
function calculateInterestRates(
address reserve,
address aToken,
uint256 liquidityAdded,
uint256 liquidityTaken,
uint256 totalStableDebt,
uint256 totalVariableDebt,
uint256 averageStableBorrowRate,
uint256 reserveFactor
) external view returns (uint256 liquidityRate, uint256 stableBorrowRate, uint256 variableBorrowRate);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
/**
* @title Errors library
* @author Aave
* @notice Defines the error messages emitted by the different contracts of the Aave protocol
* @dev Error messages prefix glossary:
* - VL = ValidationLogic
* - MATH = Math libraries
* - CT = Common errors between tokens (AToken, VariableDebtToken and StableDebtToken)
* - AT = AToken
* - SDT = StableDebtToken
* - VDT = VariableDebtToken
* - LP = LendingPool
* - LPAPR = LendingPoolAddressesProviderRegistry
* - LPC = LendingPoolConfiguration
* - RL = ReserveLogic
* - LPCM = LendingPoolCollateralManager
* - P = Pausable
*/
library Errors {
//common errors
string public constant CALLER_NOT_POOL_ADMIN = "33"; // 'The caller must be the pool admin'
string public constant BORROW_ALLOWANCE_NOT_ENOUGH = "59"; // User borrows on behalf, but allowance are too small
//contract specific errors
string public constant VL_INVALID_AMOUNT = "1"; // 'Amount must be greater than 0'
string public constant VL_NO_ACTIVE_RESERVE = "2"; // 'Action requires an active reserve'
string public constant VL_RESERVE_FROZEN = "3"; // 'Action cannot be performed because the reserve is frozen'
string public constant VL_CURRENT_AVAILABLE_LIQUIDITY_NOT_ENOUGH = "4"; // 'The current liquidity is not enough'
string public constant VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE = "5"; // 'User cannot withdraw more than the available balance'
string public constant VL_TRANSFER_NOT_ALLOWED = "6"; // 'Transfer cannot be allowed.'
string public constant VL_BORROWING_NOT_ENABLED = "7"; // 'Borrowing is not enabled'
string public constant VL_INVALID_INTEREST_RATE_MODE_SELECTED = "8"; // 'Invalid interest rate mode selected'
string public constant VL_COLLATERAL_BALANCE_IS_0 = "9"; // 'The collateral balance is 0'
string public constant VL_HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = "10"; // 'Health factor is lesser than the liquidation threshold'
string public constant VL_COLLATERAL_CANNOT_COVER_NEW_BORROW = "11"; // 'There is not enough collateral to cover a new borrow'
string public constant VL_STABLE_BORROWING_NOT_ENABLED = "12"; // stable borrowing not enabled
string public constant VL_COLLATERAL_SAME_AS_BORROWING_CURRENCY = "13"; // collateral is (mostly) the same currency that is being borrowed
string public constant VL_AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = "14"; // 'The requested amount is greater than the max loan size in stable rate mode
string public constant VL_NO_DEBT_OF_SELECTED_TYPE = "15"; // 'for repayment of stable debt, the user needs to have stable debt, otherwise, he needs to have variable debt'
string public constant VL_NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = "16"; // 'To repay on behalf of an user an explicit amount to repay is needed'
string public constant VL_NO_STABLE_RATE_LOAN_IN_RESERVE = "17"; // 'User does not have a stable rate loan in progress on this reserve'
string public constant VL_NO_VARIABLE_RATE_LOAN_IN_RESERVE = "18"; // 'User does not have a variable rate loan in progress on this reserve'
string public constant VL_UNDERLYING_BALANCE_NOT_GREATER_THAN_0 = "19"; // 'The underlying balance needs to be greater than 0'
string public constant VL_DEPOSIT_ALREADY_IN_USE = "20"; // 'User deposit is already being used as collateral'
string public constant LP_NOT_ENOUGH_STABLE_BORROW_BALANCE = "21"; // 'User does not have any stable rate loan for this reserve'
string public constant LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = "22"; // 'Interest rate rebalance conditions were not met'
string public constant LP_LIQUIDATION_CALL_FAILED = "23"; // 'Liquidation call failed'
string public constant LP_NOT_ENOUGH_LIQUIDITY_TO_BORROW = "24"; // 'There is not enough liquidity available to borrow'
string public constant LP_REQUESTED_AMOUNT_TOO_SMALL = "25"; // 'The requested amount is too small for a FlashLoan.'
string public constant LP_INCONSISTENT_PROTOCOL_ACTUAL_BALANCE = "26"; // 'The actual balance of the protocol is inconsistent'
string public constant LP_CALLER_NOT_LENDING_POOL_CONFIGURATOR = "27"; // 'The caller of the function is not the lending pool configurator'
string public constant LP_INCONSISTENT_FLASHLOAN_PARAMS = "28";
string public constant CT_CALLER_MUST_BE_LENDING_POOL = "29"; // 'The caller of this function must be a lending pool'
string public constant CT_CANNOT_GIVE_ALLOWANCE_TO_HIMSELF = "30"; // 'User cannot give allowance to himself'
string public constant CT_TRANSFER_AMOUNT_NOT_GT_0 = "31"; // 'Transferred amount needs to be greater than zero'
string public constant RL_RESERVE_ALREADY_INITIALIZED = "32"; // 'Reserve has already been initialized'
string public constant LPC_RESERVE_LIQUIDITY_NOT_0 = "34"; // 'The liquidity of the reserve needs to be 0'
string public constant LPC_INVALID_ATOKEN_POOL_ADDRESS = "35"; // 'The liquidity of the reserve needs to be 0'
string public constant LPC_INVALID_STABLE_DEBT_TOKEN_POOL_ADDRESS = "36"; // 'The liquidity of the reserve needs to be 0'
string public constant LPC_INVALID_VARIABLE_DEBT_TOKEN_POOL_ADDRESS = "37"; // 'The liquidity of the reserve needs to be 0'
string public constant LPC_INVALID_STABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = "38"; // 'The liquidity of the reserve needs to be 0'
string public constant LPC_INVALID_VARIABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = "39"; // 'The liquidity of the reserve needs to be 0'
string public constant LPC_INVALID_ADDRESSES_PROVIDER_ID = "40"; // 'The liquidity of the reserve needs to be 0'
string public constant LPC_INVALID_CONFIGURATION = "75"; // 'Invalid risk parameters for the reserve'
string public constant LPC_CALLER_NOT_EMERGENCY_ADMIN = "76"; // 'The caller must be the emergency admin'
string public constant LPAPR_PROVIDER_NOT_REGISTERED = "41"; // 'Provider is not registered'
string public constant LPCM_HEALTH_FACTOR_NOT_BELOW_THRESHOLD = "42"; // 'Health factor is not below the threshold'
string public constant LPCM_COLLATERAL_CANNOT_BE_LIQUIDATED = "43"; // 'The collateral chosen cannot be liquidated'
string public constant LPCM_SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = "44"; // 'User did not borrow the specified currency'
string public constant LPCM_NOT_ENOUGH_LIQUIDITY_TO_LIQUIDATE = "45"; // "There isn't enough liquidity available to liquidate"
string public constant LPCM_NO_ERRORS = "46"; // 'No errors'
string public constant LP_INVALID_FLASHLOAN_MODE = "47"; //Invalid flashloan mode selected
string public constant MATH_MULTIPLICATION_OVERFLOW = "48";
string public constant MATH_ADDITION_OVERFLOW = "49";
string public constant MATH_DIVISION_BY_ZERO = "50";
string public constant RL_LIQUIDITY_INDEX_OVERFLOW = "51"; // Liquidity index overflows uint128
string public constant RL_VARIABLE_BORROW_INDEX_OVERFLOW = "52"; // Variable borrow index overflows uint128
string public constant RL_LIQUIDITY_RATE_OVERFLOW = "53"; // Liquidity rate overflows uint128
string public constant RL_VARIABLE_BORROW_RATE_OVERFLOW = "54"; // Variable borrow rate overflows uint128
string public constant RL_STABLE_BORROW_RATE_OVERFLOW = "55"; // Stable borrow rate overflows uint128
string public constant CT_INVALID_MINT_AMOUNT = "56"; //invalid amount to mint
string public constant LP_FAILED_REPAY_WITH_COLLATERAL = "57";
string public constant CT_INVALID_BURN_AMOUNT = "58"; //invalid amount to burn
string public constant LP_FAILED_COLLATERAL_SWAP = "60";
string public constant LP_INVALID_EQUAL_ASSETS_TO_SWAP = "61";
string public constant LP_REENTRANCY_NOT_ALLOWED = "62";
string public constant LP_CALLER_MUST_BE_AN_ATOKEN = "63";
string public constant LP_IS_PAUSED = "64"; // 'Pool is paused'
string public constant LP_NO_MORE_RESERVES_ALLOWED = "65";
string public constant LP_INVALID_FLASH_LOAN_EXECUTOR_RETURN = "66";
string public constant RC_INVALID_LTV = "67";
string public constant RC_INVALID_LIQ_THRESHOLD = "68";
string public constant RC_INVALID_LIQ_BONUS = "69";
string public constant RC_INVALID_DECIMALS = "70";
string public constant RC_INVALID_RESERVE_FACTOR = "71";
string public constant LPAPR_INVALID_ADDRESSES_PROVIDER_ID = "72";
string public constant VL_INCONSISTENT_FLASHLOAN_PARAMS = "73";
string public constant LP_INCONSISTENT_PARAMS_LENGTH = "74";
string public constant UL_INVALID_INDEX = "77";
string public constant LP_NOT_CONTRACT = "78";
string public constant SDT_STABLE_DEBT_OVERFLOW = "79";
string public constant SDT_BURN_EXCEEDS_BALANCE = "80";
enum CollateralManagerErrors {
NO_ERROR,
NO_COLLATERAL_AVAILABLE,
COLLATERAL_CANNOT_BE_LIQUIDATED,
CURRRENCY_NOT_BORROWED,
HEALTH_FACTOR_ABOVE_THRESHOLD,
NOT_ENOUGH_LIQUIDITY,
NO_ACTIVE_RESERVE,
HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD,
INVALID_EQUAL_ASSETS_TO_SWAP,
FROZEN_RESERVE
}
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import {Errors} from "../helpers/Errors.sol";
/**
* @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 half up
**/
library PercentageMath {
uint256 constant PERCENTAGE_FACTOR = 1e4; //percentage plus two decimals
uint256 constant HALF_PERCENT = PERCENTAGE_FACTOR / 2;
/**
* @dev Executes a percentage multiplication
* @param value The value of which the percentage needs to be calculated
* @param percentage The percentage of the value to be calculated
* @return The percentage of value
**/
function percentMul(uint256 value, uint256 percentage) internal pure returns (uint256) {
if (value == 0 || percentage == 0) {
return 0;
}
require(value <= (type(uint256).max - HALF_PERCENT) / percentage, Errors.MATH_MULTIPLICATION_OVERFLOW);
return (value * percentage + HALF_PERCENT) / PERCENTAGE_FACTOR;
}
/**
* @dev Executes a percentage division
* @param value The value of which the percentage needs to be calculated
* @param percentage The percentage of the value to be calculated
* @return The value divided the percentage
**/
function percentDiv(uint256 value, uint256 percentage) internal pure returns (uint256) {
require(percentage != 0, Errors.MATH_DIVISION_BY_ZERO);
uint256 halfPercentage = percentage / 2;
require(value <= (type(uint256).max - halfPercentage) / PERCENTAGE_FACTOR, Errors.MATH_MULTIPLICATION_OVERFLOW);
return (value * PERCENTAGE_FACTOR + halfPercentage) / percentage;
}
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import {Errors} from "../helpers/Errors.sol";
/**
* @title WadRayMath library
* @author Aave
* @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits)
**/
library WadRayMath {
uint256 internal constant WAD = 1e18;
uint256 internal constant halfWAD = WAD / 2;
uint256 internal constant RAY = 1e27;
uint256 internal constant halfRAY = RAY / 2;
uint256 internal constant WAD_RAY_RATIO = 1e9;
/**
* @return One ray, 1e27
**/
function ray() internal pure returns (uint256) {
return RAY;
}
/**
* @return One wad, 1e18
**/
function wad() internal pure returns (uint256) {
return WAD;
}
/**
* @return Half ray, 1e27/2
**/
function halfRay() internal pure returns (uint256) {
return halfRAY;
}
/**
* @return Half ray, 1e18/2
**/
function halfWad() internal pure returns (uint256) {
return halfWAD;
}
/**
* @dev Multiplies two wad, rounding half up to the nearest wad
* @param a Wad
* @param b Wad
* @return The result of a*b, in wad
**/
function wadMul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 0) {
return 0;
}
require(a <= (type(uint256).max - halfWAD) / b, Errors.MATH_MULTIPLICATION_OVERFLOW);
return (a * b + halfWAD) / WAD;
}
/**
* @dev Divides two wad, rounding half up to the nearest wad
* @param a Wad
* @param b Wad
* @return The result of a/b, in wad
**/
function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, Errors.MATH_DIVISION_BY_ZERO);
uint256 halfB = b / 2;
require(a <= (type(uint256).max - halfB) / WAD, Errors.MATH_MULTIPLICATION_OVERFLOW);
return (a * WAD + halfB) / b;
}
/**
* @dev Multiplies two ray, rounding half up to the nearest ray
* @param a Ray
* @param b Ray
* @return The result of a*b, in ray
**/
function rayMul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 0) {
return 0;
}
require(a <= (type(uint256).max - halfRAY) / b, Errors.MATH_MULTIPLICATION_OVERFLOW);
return (a * b + halfRAY) / RAY;
}
/**
* @dev Divides two ray, rounding half up to the nearest ray
* @param a Ray
* @param b Ray
* @return The result of a/b, in ray
**/
function rayDiv(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, Errors.MATH_DIVISION_BY_ZERO);
uint256 halfB = b / 2;
require(a <= (type(uint256).max - halfB) / RAY, Errors.MATH_MULTIPLICATION_OVERFLOW);
return (a * RAY + halfB) / b;
}
/**
* @dev Casts ray down to wad
* @param a Ray
* @return a casted to wad, rounded half up to the nearest wad
**/
function rayToWad(uint256 a) internal pure returns (uint256) {
uint256 halfRatio = WAD_RAY_RATIO / 2;
uint256 result = halfRatio + a;
require(result >= halfRatio, Errors.MATH_ADDITION_OVERFLOW);
return result / WAD_RAY_RATIO;
}
/**
* @dev Converts wad up to ray
* @param a Wad
* @return a converted in ray
**/
function wadToRay(uint256 a) internal pure returns (uint256) {
uint256 result = a * WAD_RAY_RATIO;
require(result / WAD_RAY_RATIO == a, Errors.MATH_MULTIPLICATION_OVERFLOW);
return result;
}
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 1000
},
"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 ILendingPoolAddressesProvider","name":"provider","type":"address"},{"internalType":"uint256","name":"optimalUtilizationRate_","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"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EXCESS_UTILIZATION_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPTIMAL_UTILIZATION_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addressesProvider","outputs":[{"internalType":"contract ILendingPoolAddressesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseVariableBorrowRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"reserve","type":"address"},{"internalType":"address","name":"aToken","type":"address"},{"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"}],"name":"calculateInterestRates","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"reserve","type":"address"},{"internalType":"uint256","name":"availableLiquidity","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"}],"name":"calculateInterestRates","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxVariableBorrowRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stableRateSlope1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stableRateSlope2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"variableRateSlope1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"variableRateSlope2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
61018060405234801561001157600080fd5b50604051610f83380380610f83833981016040819052610030916100b3565b85608081815250506100608661004e61009060201b61080b1760201c565b6100a060201b61081b1790919060201c565b60a0526001600160a01b0390961660c05260e0939093526101009190915261012052610140525061016052610141565b6b033b2e3c9fd0803ce800000090565b60006100ac828461011c565b9392505050565b600080600080600080600060e0888a0312156100ce57600080fd5b87516001600160a01b03811681146100e557600080fd5b602089015160408a015160608b015160808c015160a08d015160c0909d0151949e939d50919b909a50909850965090945092505050565b60008282101561013c57634e487b7160e01b600052601160045260246000fd5b500390565b60805160a05160c05160e05161010051610120516101405161016051610d6761021c6000396000818161024d01526105e001526000818160d00152818161061001526106fa01526000818161015a0152818161033f0152610641015260008181610180015281816103840152818161068c01526107640152600081816101e8015281816103630152818161066b015261078a015260008181610211015261043d015260008181610108015261057a0152600081816101c40152818161054e0152818161059e015281816106c6015261073e0152610d676000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c806380031e3711610081578063b25895441161005b578063b2589544146101e6578063c72c4d101461020c578063ccab01a31461024b57600080fd5b806380031e37146101a45780639584df28146101ac578063a15f30ac146101bf57600080fd5b806329db497d116100b257806329db497d1461012a57806365614f81146101585780637b832f581461017e57600080fd5b80630bdf953f146100ce5780631731987314610103575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040519081526020015b60405180910390f35b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b61013d610138366004610b62565b610271565b604080519384526020840192909252908201526060016100fa565b7f00000000000000000000000000000000000000000000000000000000000000006100f0565b7f00000000000000000000000000000000000000000000000000000000000000006100f0565b6100f0610338565b61013d6101ba366004610bcd565b6103b3565b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f0565b6102337f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100fa565b7f00000000000000000000000000000000000000000000000000000000000000006100f0565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301526000918291829182918d16906370a0823190602401602060405180830381865afa1580156102d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fd9190610c19565b90506103138961030d838d610830565b9061081b565b90506103238c828a8a8a8a6103b3565b93509350935050985098509895505050505050565b60006103ae7f00000000000000000000000000000000000000000000000000000000000000006103a87f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610830565b90610830565b905090565b60008060006103ea6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6103f48888610830565b8082526000602083018190526040830181905260608301521561042f57805161042a90610422908b90610830565b82519061083c565b610432565b60005b8160800181815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633618abba6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bd9190610c32565b6040517fbb85c0bb0000000000000000000000000000000000000000000000000000000081526001600160a01b038c81166004830152919091169063bb85c0bb90602401602060405180830381865afa15801561051e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105429190610c19565b604082015260808101517f000000000000000000000000000000000000000000000000000000000000000010156106bb5760006105d67f00000000000000000000000000000000000000000000000000000000000000006105d07f0000000000000000000000000000000000000000000000000000000000000000856080015161081b90919063ffffffff16565b9061083c565b90506106346106057f00000000000000000000000000000000000000000000000000000000000000008361093e565b60408401516103a8907f0000000000000000000000000000000000000000000000000000000000000000610830565b60408301526106b06106667f00000000000000000000000000000000000000000000000000000000000000008361093e565b6103a87f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610830565b6020830152506107b5565b61072a61071f6106f87f0000000000000000000000000000000000000000000000000000000000000000846080015161083c90919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000009061093e565b604083015190610830565b604082015260808101516107af90610788907f0000000000000000000000000000000000000000000000000000000000000000906105d0907f000000000000000000000000000000000000000000000000000000000000000061093e565b7f000000000000000000000000000000000000000000000000000000000000000090610830565b60208201525b6107e86107c46127108761081b565b6107e283608001516107dc8c8c87602001518d6109f9565b9061093e565b90610a5e565b606082018190526040820151602090920151909b919a5098509650505050505050565b6b033b2e3c9fd0803ce800000090565b60006108278284610c6c565b90505b92915050565b60006108278284610c83565b60408051808201909152600281527f353000000000000000000000000000000000000000000000000000000000000060208201526000908261089a5760405162461bcd60e51b81526004016108919190610c9b565b60405180910390fd5b5060006108a8600284610cf0565b90506b033b2e3c9fd0803ce80000006108c382600019610c6c565b6108cd9190610cf0565b84111560405180604001604052806002815260200161068760f31b815250906109095760405162461bcd60e51b81526004016108919190610c9b565b5082816109226b033b2e3c9fd0803ce800000087610d12565b61092c9190610c83565b6109369190610cf0565b949350505050565b600082158061094b575081155b156109585750600061082a565b8161097060026b033b2e3c9fd0803ce8000000610cf0565b61097c90600019610c6c565b6109869190610cf0565b83111560405180604001604052806002815260200161068760f31b815250906109c25760405162461bcd60e51b81526004016108919190610c9b565b506b033b2e3c9fd0803ce80000006109db600282610cf0565b6109e58486610d12565b6109ef9190610c83565b6108279190610cf0565b600080610a068686610830565b905080610a17576000915050610936565b6000610a26856107dc88610ae7565b90506000610a37856107dc8a610ae7565b90506000610a51610a4785610ae7565b6105d08585610830565b9998505050505050505050565b6000821580610a6b575081155b15610a785750600061082a565b81610a866002612710610cf0565b610a9290600019610c6c565b610a9c9190610cf0565b83111560405180604001604052806002815260200161068760f31b81525090610ad85760405162461bcd60e51b81526004016108919190610c9b565b506127106109db600282610cf0565b600080610af8633b9aca0084610d12565b905082610b09633b9aca0083610cf0565b1460405180604001604052806002815260200161068760f31b81525090610b435760405162461bcd60e51b81526004016108919190610c9b565b5092915050565b6001600160a01b0381168114610b5f57600080fd5b50565b600080600080600080600080610100898b031215610b7f57600080fd5b8835610b8a81610b4a565b97506020890135610b9a81610b4a565b979a9799505050506040860135956060810135956080820135955060a0820135945060c0820135935060e0909101359150565b60008060008060008060c08789031215610be657600080fd5b8635610bf181610b4a565b9860208801359850604088013597606081013597506080810135965060a00135945092505050565b600060208284031215610c2b57600080fd5b5051919050565b600060208284031215610c4457600080fd5b8151610c4f81610b4a565b9392505050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c7e57610c7e610c56565b500390565b60008219821115610c9657610c96610c56565b500190565b600060208083528351808285015260005b81811015610cc857858101830151858201604001528201610cac565b81811115610cda576000604083870101525b50601f01601f1916929092016040019392505050565b600082610d0d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610d2c57610d2c610c56565b50029056fea264697066735822122028f85bc23a656cb5dacfa877d213f18edcb0b3168de2306571f14cc4ec4839fb64736f6c634300080c0033000000000000000000000000091d52cace1edc5527c99cdcfa6937c1635330e4000000000000000000000000000000000000000001f04ef12cb04cf158000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031a17e847807b1bc00000000000000000000000000000000000000000000000219aada9b14535aca00000000000000000000000000000000000000000000000031a17e847807b1bc00000000000000000000000000000000000000000000000219aada9b14535aca000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100c95760003560e01c806380031e3711610081578063b25895441161005b578063b2589544146101e6578063c72c4d101461020c578063ccab01a31461024b57600080fd5b806380031e37146101a45780639584df28146101ac578063a15f30ac146101bf57600080fd5b806329db497d116100b257806329db497d1461012a57806365614f81146101585780637b832f581461017e57600080fd5b80630bdf953f146100ce5780631731987314610103575b600080fd5b7f00000000000000000000000000000000000000000031a17e847807b1bc0000005b6040519081526020015b60405180910390f35b6100f07f0000000000000000000000000000000000000000014adf4b7320334b9000000081565b61013d610138366004610b62565b610271565b604080519384526020840192909252908201526060016100fa565b7f00000000000000000000000000000000000000000219aada9b14535aca0000006100f0565b7f00000000000000000000000000000000000000000031a17e847807b1bc0000006100f0565b6100f0610338565b61013d6101ba366004610bcd565b6103b3565b6100f07f000000000000000000000000000000000000000001f04ef12cb04cf15800000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f0565b6102337f000000000000000000000000091d52cace1edc5527c99cdcfa6937c1635330e481565b6040516001600160a01b0390911681526020016100fa565b7f00000000000000000000000000000000000000000219aada9b14535aca0000006100f0565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301526000918291829182918d16906370a0823190602401602060405180830381865afa1580156102d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fd9190610c19565b90506103138961030d838d610830565b9061081b565b90506103238c828a8a8a8a6103b3565b93509350935050985098509895505050505050565b60006103ae7f00000000000000000000000000000000000000000219aada9b14535aca0000006103a87f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000031a17e847807b1bc000000610830565b90610830565b905090565b60008060006103ea6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6103f48888610830565b8082526000602083018190526040830181905260608301521561042f57805161042a90610422908b90610830565b82519061083c565b610432565b60005b8160800181815250507f000000000000000000000000091d52cace1edc5527c99cdcfa6937c1635330e46001600160a01b0316633618abba6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bd9190610c32565b6040517fbb85c0bb0000000000000000000000000000000000000000000000000000000081526001600160a01b038c81166004830152919091169063bb85c0bb90602401602060405180830381865afa15801561051e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105429190610c19565b604082015260808101517f000000000000000000000000000000000000000001f04ef12cb04cf15800000010156106bb5760006105d67f0000000000000000000000000000000000000000014adf4b7320334b900000006105d07f000000000000000000000000000000000000000001f04ef12cb04cf158000000856080015161081b90919063ffffffff16565b9061083c565b90506106346106057f00000000000000000000000000000000000000000219aada9b14535aca0000008361093e565b60408401516103a8907f00000000000000000000000000000000000000000031a17e847807b1bc000000610830565b60408301526106b06106667f00000000000000000000000000000000000000000219aada9b14535aca0000008361093e565b6103a87f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000031a17e847807b1bc000000610830565b6020830152506107b5565b61072a61071f6106f87f000000000000000000000000000000000000000001f04ef12cb04cf158000000846080015161083c90919063ffffffff16565b7f00000000000000000000000000000000000000000031a17e847807b1bc0000009061093e565b604083015190610830565b604082015260808101516107af90610788907f000000000000000000000000000000000000000001f04ef12cb04cf158000000906105d0907f00000000000000000000000000000000000000000031a17e847807b1bc00000061093e565b7f000000000000000000000000000000000000000000000000000000000000000090610830565b60208201525b6107e86107c46127108761081b565b6107e283608001516107dc8c8c87602001518d6109f9565b9061093e565b90610a5e565b606082018190526040820151602090920151909b919a5098509650505050505050565b6b033b2e3c9fd0803ce800000090565b60006108278284610c6c565b90505b92915050565b60006108278284610c83565b60408051808201909152600281527f353000000000000000000000000000000000000000000000000000000000000060208201526000908261089a5760405162461bcd60e51b81526004016108919190610c9b565b60405180910390fd5b5060006108a8600284610cf0565b90506b033b2e3c9fd0803ce80000006108c382600019610c6c565b6108cd9190610cf0565b84111560405180604001604052806002815260200161068760f31b815250906109095760405162461bcd60e51b81526004016108919190610c9b565b5082816109226b033b2e3c9fd0803ce800000087610d12565b61092c9190610c83565b6109369190610cf0565b949350505050565b600082158061094b575081155b156109585750600061082a565b8161097060026b033b2e3c9fd0803ce8000000610cf0565b61097c90600019610c6c565b6109869190610cf0565b83111560405180604001604052806002815260200161068760f31b815250906109c25760405162461bcd60e51b81526004016108919190610c9b565b506b033b2e3c9fd0803ce80000006109db600282610cf0565b6109e58486610d12565b6109ef9190610c83565b6108279190610cf0565b600080610a068686610830565b905080610a17576000915050610936565b6000610a26856107dc88610ae7565b90506000610a37856107dc8a610ae7565b90506000610a51610a4785610ae7565b6105d08585610830565b9998505050505050505050565b6000821580610a6b575081155b15610a785750600061082a565b81610a866002612710610cf0565b610a9290600019610c6c565b610a9c9190610cf0565b83111560405180604001604052806002815260200161068760f31b81525090610ad85760405162461bcd60e51b81526004016108919190610c9b565b506127106109db600282610cf0565b600080610af8633b9aca0084610d12565b905082610b09633b9aca0083610cf0565b1460405180604001604052806002815260200161068760f31b81525090610b435760405162461bcd60e51b81526004016108919190610c9b565b5092915050565b6001600160a01b0381168114610b5f57600080fd5b50565b600080600080600080600080610100898b031215610b7f57600080fd5b8835610b8a81610b4a565b97506020890135610b9a81610b4a565b979a9799505050506040860135956060810135956080820135955060a0820135945060c0820135935060e0909101359150565b60008060008060008060c08789031215610be657600080fd5b8635610bf181610b4a565b9860208801359850604088013597606081013597506080810135965060a00135945092505050565b600060208284031215610c2b57600080fd5b5051919050565b600060208284031215610c4457600080fd5b8151610c4f81610b4a565b9392505050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c7e57610c7e610c56565b500390565b60008219821115610c9657610c96610c56565b500190565b600060208083528351808285015260005b81811015610cc857858101830151858201604001528201610cac565b81811115610cda576000604083870101525b50601f01601f1916929092016040019392505050565b600082610d0d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610d2c57610d2c610c56565b50029056fea264697066735822122028f85bc23a656cb5dacfa877d213f18edcb0b3168de2306571f14cc4ec4839fb64736f6c634300080c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000091d52cace1edc5527c99cdcfa6937c1635330e4000000000000000000000000000000000000000001f04ef12cb04cf158000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031a17e847807b1bc00000000000000000000000000000000000000000000000219aada9b14535aca00000000000000000000000000000000000000000000000031a17e847807b1bc00000000000000000000000000000000000000000000000219aada9b14535aca000000
-----Decoded View---------------
Arg [0] : provider (address): 0x091d52CacE1edc5527C99cDCFA6937C1635330E4
Arg [1] : optimalUtilizationRate_ (uint256): 600000000000000000000000000
Arg [2] : baseVariableBorrowRate_ (uint256): 0
Arg [3] : variableRateSlope1_ (uint256): 60000000000000000000000000
Arg [4] : variableRateSlope2_ (uint256): 650000000000000000000000000
Arg [5] : stableRateSlope1_ (uint256): 60000000000000000000000000
Arg [6] : stableRateSlope2_ (uint256): 650000000000000000000000000
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000091d52cace1edc5527c99cdcfa6937c1635330e4
Arg [1] : 000000000000000000000000000000000000000001f04ef12cb04cf158000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 00000000000000000000000000000000000000000031a17e847807b1bc000000
Arg [4] : 00000000000000000000000000000000000000000219aada9b14535aca000000
Arg [5] : 00000000000000000000000000000000000000000031a17e847807b1bc000000
Arg [6] : 00000000000000000000000000000000000000000219aada9b14535aca000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.