Overview
S Balance
0 S
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 | |||
---|---|---|---|---|---|---|
5573855 | 8 days ago | Contract Creation | 0 S |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x307510F3...e087c343A The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
InterestRateModelV2Config
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; import {IInterestRateModelV2Config} from "../interfaces/IInterestRateModelV2Config.sol"; import {IInterestRateModelV2} from "../interfaces/IInterestRateModelV2.sol"; /// @title InterestRateModelV2Config /// @notice Please never deploy config manually, always use factory, because factory does necessary checks. contract InterestRateModelV2Config is IInterestRateModelV2Config { // uopt ∈ (0, 1) – optimal utilization; int256 internal immutable _UOPT; // ucrit ∈ (uopt, 1) – threshold of large utilization; int256 internal immutable _UCRIT; // ulow ∈ (0, uopt) – threshold of low utilization int256 internal immutable _ULOW; // ki > 0 – integrator gain int256 internal immutable _KI; // kcrit > 0 – proportional gain for large utilization int256 internal immutable _KCRIT; // klow ≥ 0 – proportional gain for low utilization int256 internal immutable _KLOW; // klin ≥ 0 – coefficient of the lower linear bound int256 internal immutable _KLIN; // beta ≥ 0 - a scaling factor int256 internal immutable _BETA; // initial value for ri, ri ≥ 0 – initial value of the integrator int112 internal immutable _RI; // initial value for Tcrit, Tcrit ≥ 0 - the time during which the utilization exceeds the critical value int112 internal immutable _TCRIT; constructor(IInterestRateModelV2.Config memory _config) { _UOPT = _config.uopt; _UCRIT = _config.ucrit; _ULOW = _config.ulow; _KI = _config.ki; _KCRIT = _config.kcrit; _KLOW = _config.klow; _KLIN = _config.klin; _BETA = _config.beta; _RI = _config.ri; _TCRIT = _config.Tcrit; } /// @inheritdoc IInterestRateModelV2Config function getConfig() external view virtual returns (IInterestRateModelV2.Config memory config) { config.uopt = _UOPT; config.ucrit = _UCRIT; config.ulow = _ULOW; config.ki = _KI; config.kcrit = _KCRIT; config.klow = _KLOW; config.klin = _KLIN; config.beta = _BETA; config.ri = _RI; config.Tcrit = _TCRIT; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import {IInterestRateModelV2} from "./IInterestRateModelV2.sol"; interface IInterestRateModelV2Config { /// @return config returns immutable IRM configuration that is present in contract function getConfig() external view returns (IInterestRateModelV2.Config memory config); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import {IInterestRateModelV2Config} from "./IInterestRateModelV2Config.sol"; interface IInterestRateModelV2 { struct Config { // uopt ∈ (0, 1) – optimal utilization; int256 uopt; // ucrit ∈ (uopt, 1) – threshold of large utilization; int256 ucrit; // ulow ∈ (0, uopt) – threshold of low utilization int256 ulow; // ki > 0 – integrator gain int256 ki; // kcrit > 0 – proportional gain for large utilization int256 kcrit; // klow ≥ 0 – proportional gain for low utilization int256 klow; // klin ≥ 0 – coefficient of the lower linear bound int256 klin; // beta ≥ 0 - a scaling factor int256 beta; // ri ≥ 0 – initial value of the integrator int112 ri; // Tcrit ≥ 0 - initial value of the time during which the utilization exceeds the critical value int112 Tcrit; } struct Setup { // ri ≥ 0 – the integrator int112 ri; // Tcrit ≥ 0 - the time during which the utilization exceeds the critical value int112 Tcrit; // flag that informs if setup is initialized bool initialized; } /* solhint-enable */ error AddressZero(); error DeployConfigFirst(); error AlreadyInitialized(); error InvalidBeta(); error InvalidKcrit(); error InvalidKi(); error InvalidKlin(); error InvalidKlow(); error InvalidTcrit(); error InvalidTimestamps(); error InvalidUcrit(); error InvalidUlow(); error InvalidUopt(); error InvalidRi(); /// @dev Get config for given asset in a Silo. /// @param _silo Silo address for which config should be set /// @return Config struct for asset in Silo function getConfig(address _silo) external view returns (Config memory); /// @notice get the flag to detect rcomp restriction (zero current interest) due to overflow /// overflow boolean flag to detect rcomp restriction function overflowDetected(address _silo, uint256 _blockTimestamp) external view returns (bool overflow); /// @dev pure function that calculates current annual interest rate /// @param _c configuration object, IInterestRateModel.Config /// @param _totalBorrowAmount current total borrows for asset /// @param _totalDeposits current total deposits for asset /// @param _interestRateTimestamp timestamp of last interest rate update /// @param _blockTimestamp current block timestamp /// @return rcur current annual interest rate (1e18 == 100%) function calculateCurrentInterestRate( Config calldata _c, uint256 _totalDeposits, uint256 _totalBorrowAmount, uint256 _interestRateTimestamp, uint256 _blockTimestamp ) external pure returns (uint256 rcur); /// @dev pure function that calculates interest rate based on raw input data /// @param _c configuration object, IInterestRateModel.Config /// @param _totalBorrowAmount current total borrows for asset /// @param _totalDeposits current total deposits for asset /// @param _interestRateTimestamp timestamp of last interest rate update /// @param _blockTimestamp current block timestamp /// @return rcomp compounded interest rate from last update until now (1e18 == 100%) /// @return ri current integral part of the rate /// @return Tcrit time during which the utilization exceeds the critical value /// @return overflow boolean flag to detect rcomp restriction function calculateCompoundInterestRateWithOverflowDetection( Config memory _c, uint256 _totalDeposits, uint256 _totalBorrowAmount, uint256 _interestRateTimestamp, uint256 _blockTimestamp ) external pure returns ( uint256 rcomp, int256 ri, int256 Tcrit, bool overflow ); /// @dev pure function that calculates interest rate based on raw input data /// @param _c configuration object, IInterestRateModel.Config /// @param _totalBorrowAmount current total borrows for asset /// @param _totalDeposits current total deposits for asset /// @param _interestRateTimestamp timestamp of last interest rate update /// @param _blockTimestamp current block timestamp /// @return rcomp compounded interest rate from last update until now (1e18 == 100%) /// @return ri current integral part of the rate /// @return Tcrit time during which the utilization exceeds the critical value function calculateCompoundInterestRate( Config memory _c, uint256 _totalDeposits, uint256 _totalBorrowAmount, uint256 _interestRateTimestamp, uint256 _blockTimestamp ) external pure returns (uint256 rcomp, int256 ri, int256 Tcrit); }
{ "remappings": [ "forge-std/=gitmodules/forge-std/src/", "silo-foundry-utils/=gitmodules/silo-foundry-utils/contracts/", "properties/=gitmodules/crytic/properties/contracts/", "silo-core/=silo-core/", "silo-oracles/=silo-oracles/", "silo-vaults/=silo-vaults/", "ve-silo/=ve-silo/", "@openzeppelin/=gitmodules/openzeppelin-contracts-5/contracts/", "morpho-blue/=gitmodules/morpho-blue/src/", "openzeppelin5/=gitmodules/openzeppelin-contracts-5/contracts/", "openzeppelin5-upgradeable/=gitmodules/openzeppelin-contracts-upgradeable-5/contracts/", "chainlink/=gitmodules/chainlink/contracts/src/", "chainlink-ccip/=gitmodules/chainlink-ccip/contracts/src/", "uniswap/=gitmodules/uniswap/", "@uniswap/v3-core/=gitmodules/uniswap/v3-core/", "balancer-labs/v2-solidity-utils/=external/balancer-v2-monorepo/pkg/solidity-utils/contracts/", "balancer-labs/v2-interfaces/=external/balancer-v2-monorepo/pkg/interfaces/contracts/", "balancer-labs/v2-liquidity-mining/=external/balancer-v2-monorepo/pkg/liquidity-mining/contracts/", "@balancer-labs/=node_modules/@balancer-labs/", "@ensdomains/=node_modules/@ensdomains/", "@openzeppelin/contracts-upgradeable/=gitmodules/openzeppelin-contracts-upgradeable-5/contracts/", "@openzeppelin/contracts/=gitmodules/openzeppelin-contracts-5/contracts/", "@solidity-parser/=node_modules/@solidity-parser/", "ERC4626/=gitmodules/crytic/properties/lib/ERC4626/contracts/", "crytic/=gitmodules/crytic/", "ds-test/=gitmodules/openzeppelin-contracts-5/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=gitmodules/openzeppelin-contracts-5/lib/erc4626-tests/", "halmos-cheatcodes/=gitmodules/morpho-blue/lib/halmos-cheatcodes/src/", "hardhat/=node_modules/hardhat/", "openzeppelin-contracts-5/=gitmodules/openzeppelin-contracts-5/", "openzeppelin-contracts-upgradeable-5/=gitmodules/openzeppelin-contracts-upgradeable-5/", "openzeppelin-contracts/=gitmodules/openzeppelin-contracts-upgradeable-5/lib/openzeppelin-contracts/", "prettier-plugin-solidity/=node_modules/prettier-plugin-solidity/", "proposals/=node_modules/proposals/", "solmate/=gitmodules/crytic/properties/lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"components":[{"internalType":"int256","name":"uopt","type":"int256"},{"internalType":"int256","name":"ucrit","type":"int256"},{"internalType":"int256","name":"ulow","type":"int256"},{"internalType":"int256","name":"ki","type":"int256"},{"internalType":"int256","name":"kcrit","type":"int256"},{"internalType":"int256","name":"klow","type":"int256"},{"internalType":"int256","name":"klin","type":"int256"},{"internalType":"int256","name":"beta","type":"int256"},{"internalType":"int112","name":"ri","type":"int112"},{"internalType":"int112","name":"Tcrit","type":"int112"}],"internalType":"struct IInterestRateModelV2.Config","name":"_config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"getConfig","outputs":[{"components":[{"internalType":"int256","name":"uopt","type":"int256"},{"internalType":"int256","name":"ucrit","type":"int256"},{"internalType":"int256","name":"ulow","type":"int256"},{"internalType":"int256","name":"ki","type":"int256"},{"internalType":"int256","name":"kcrit","type":"int256"},{"internalType":"int256","name":"klow","type":"int256"},{"internalType":"int256","name":"klin","type":"int256"},{"internalType":"int256","name":"beta","type":"int256"},{"internalType":"int112","name":"ri","type":"int112"},{"internalType":"int112","name":"Tcrit","type":"int112"}],"internalType":"struct IInterestRateModelV2.Config","name":"config","type":"tuple"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063c3f909d41461002d575b5f5ffd5b61003561004b565b6040516100429190610222565b60405180910390f35b61009d6040518061014001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f600d0b81526020015f600d0b81525090565b7f0000000000000000000000000000000000000000000000000cc47f20295c000181527f0000000000000000000000000000000000000000000000000d2f13f7789f000060208201527f0000000000000000000000000000000000000000000000000cc47f20295c000060408201527f0000000000000000000000000000000000000000000000000000000000032f8360608201527f0000000000000000000000000000000000000000000000000000001dda61324f60808201527f000000000000000000000000000000000000000000000000000003143e53015560a08201527f00000000000000000000000000000000000000000000000000000000b8e572c460c08201527f0000000000000000000000000000000000000000000000000000080b406308c560e08201527f0000000000000000000000000000000000000000000000000000000000000000600d90810b6101008301527f0000000000000000000000000000000000000000000000000000000000000000900b61012082015290565b5f61014082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161028a610100840182600d0b9052565b506101208301516102a1610120840182600d0b9052565b509291505056fea2646970667358221220b115e739af79140490d56798607b39258eac5f9c54365bedb6b20f53dfb5988564736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.