Skip to content
Verified contractPartialMIT

InterestRateCalculatorZero

Address0xf7a57d5d58753f07805c97cfe362fa213f6d4e78
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
Via IR
yes
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
22,785,967
Creation transaction
0xbb0b3caa20…d64c5b06b3

src/protocol/InterestRateCalculatorZero.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

import { IRateCalculator } from "../interfaces/IRateCalculator.sol";

/// @title Calculate rates based on the underlying vaults with some floor settings
contract InterestRateCalculatorZero is IRateCalculator {

    /// @notice The ```name``` function returns the name of the rate contract
    /// @return memory name of contract
    function name() external view returns (string memory) {
        return string(abi.encodePacked("InterestRateCalculator Zero"));
    }

    /// @notice The ```version``` function returns the semantic version of the rate contract
    /// @dev Follows semantic versioning
    /// @return _major Major version
    /// @return _minor Minor version
    /// @return _patch Patch version
    function version() external pure returns (uint256 _major, uint256 _minor, uint256 _patch) {
        _major = 0;
        _minor = 0;
        _patch = 0;
    }

    /// @notice The ```getNewRate``` function calculates interest rates using underlying rates and minimums
    /// @param _vault The vault to calculate the rate for
    /// @param _deltaTime The elapsed time since last update, given in seconds
    /// @param _previousShares The number of shares at the previous timestamp, 18 decimals of precision
    /// @return _newRatePerSec The new interest rate, 18 decimals of precision
    /// @return _newShares The new number of shares, 18 decimals of precision
    function getNewRate(
        address _vault,
        uint256 _deltaTime,
        uint256 _previousShares
    ) external view returns (uint64 _newRatePerSec, uint128 _newShares) {
        return (0, uint128(_previousShares));
    }
}

src/interfaces/IRateCalculator.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

interface IRateCalculator {
    function name() external view returns (string memory);

    function version() external view returns (uint256, uint256, uint256);

    function getNewRate(
        address _vault,
        uint256 _deltaTime,
        uint256 _previousShares
    ) external view returns (uint64 _newRatePerSec, uint128 _newShares);
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "none",
    "useLiteralContent": false
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "ds-test/=node_modules/ds-test/src/",
    "forge-std/=node_modules/forge-std/src/",
    "frax-std/=node_modules/frax-standard-solidity/src/",
    "@axelar-network/=node_modules/@axelar-network/",
    "@chainlink/=node_modules/@chainlink/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@layerzerolabs/=node_modules/@layerzerolabs/",
    "@mean-finance/=node_modules/@mean-finance/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "@rari-capital/=node_modules/@rari-capital/",
    "@uniswap/=node_modules/@uniswap/",
    "base64-sol/=node_modules/base64-sol/",
    "frax-standard-solidity/=node_modules/frax-standard-solidity/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "hardhat/=node_modules/hardhat/",
    "solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
    "solidity-stringutils/=lib/surl/lib/solidity-stringutils/",
    "surl/=lib/surl/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.