S Price: $0.06737 (-2.79%)
Gas: 55 Gwei

Contract

0x9883B5b90380B18E291547849E09BE23993D7A61

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StableIRM

Compiler Version
v0.8.30+commit.73712a01

Optimization Enabled:
Yes with 100000 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.30;

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

/**
 * Base jump/kink IRM (fixed params via overrides).
 * APR and utilization are WAD (1e18 = 100%).
 *
 * r(util) =
 *   if util <= uOpt:  r0 + s1 * (util / uOpt)
 *   else:             r0 + s1 + s2 * ((util - uOpt) / (1 - uOpt))
 * capped at rMax
 */
abstract contract JumpIRMBase is IIRM {
    uint256 internal constant WAD = 1e18;

    function uOptWad() internal pure virtual returns (uint256);

    function r0Wad() internal pure virtual returns (uint256);

    function s1Wad() internal pure virtual returns (uint256);

    function s2Wad() internal pure virtual returns (uint256);

    function rMaxWad() internal pure virtual returns (uint256);

    /// @inheritdoc IIRM
    function borrowAPR(
        address, /*asset*/
        uint256 utilWad
    )
        external
        pure
        override
        returns (uint256)
    {
        if (utilWad > WAD) utilWad = WAD;

        uint256 uOpt = uOptWad();
        uint256 r0 = r0Wad();
        uint256 s1 = s1Wad();
        uint256 s2 = s2Wad();
        uint256 rMax = rMaxWad();

        uint256 out;
        if (utilWad <= uOpt) {
            // r0 + s1 * (util / uOpt)
            uint256 add = (s1 * utilWad) / uOpt;
            out = r0 + add;
        } else {
            // r0 + s1 + s2 * ((util - uOpt) / (1 - uOpt))
            uint256 num = utilWad - uOpt;
            uint256 den = (WAD - uOpt);
            uint256 add2 = (s2 * num) / den;
            out = r0 + s1 + add2;
        }
        return out <= rMax ? out : rMax;
    }
}

/**
 * =========================
 *  1) Stables (USDC/DAI/USDT)
 *  U* = 0.85, r0 = 1.5%, s1 = 10%, s2 = 80%, rMax = 250%
 *  =========================
 */
contract StableIRM is JumpIRMBase {
    function uOptWad() internal pure override returns (uint256) {
        return 0.85e18;
    }

    function r0Wad() internal pure override returns (uint256) {
        return 0.015e18;
    } // 1.5%

    function s1Wad() internal pure override returns (uint256) {
        return 0.1e18;
    } // +10% to kink

    function s2Wad() internal pure override returns (uint256) {
        return 0.8e18;
    } // +80% after kink

    function rMaxWad() internal pure override returns (uint256) {
        return 2.5e18;
    } // cap 250%
}

/**
 * =========================
 *  2) Majors (S/ETH/WBTC etc.)
 *  U* = 0.78, r0 = 1.0%, s1 = 6%, s2 = 60%, rMax = 200%
 *  =========================
 */
contract MajorIRM is JumpIRMBase {
    function uOptWad() internal pure override returns (uint256) {
        return 0.78e18;
    }

    function r0Wad() internal pure override returns (uint256) {
        return 0.01e18;
    } // 1.0%

    function s1Wad() internal pure override returns (uint256) {
        return 0.06e18;
    } // +6%

    function s2Wad() internal pure override returns (uint256) {
        return 0.6e18;
    } // +60%

    function rMaxWad() internal pure override returns (uint256) {
        return 2.0e18;
    } // cap 200%
}

/**
 * =========================
 *  3) Long-tail / higher risk
 *  U* = 0.65, r0 = 6%, s1 = 20%, s2 = 150%, rMax = 400%
 *  =========================
 */
contract LongTailIRM is JumpIRMBase {
    function uOptWad() internal pure override returns (uint256) {
        return 0.65e18;
    }

    function r0Wad() internal pure override returns (uint256) {
        return 0.06e18;
    } // 6.0%

    function s1Wad() internal pure override returns (uint256) {
        return 0.2e18;
    } // +20%

    function s2Wad() internal pure override returns (uint256) {
        return 1.5e18;
    } // +150%

    function rMaxWad() internal pure override returns (uint256) {
        return 4.0e18;
    } // cap 400%
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.30;

interface IIRM {
    /// @notice Return borrow APR (WAD, 1e18 = 100%) for `asset` at utilization `utilWad` (0..1e18)
    function borrowAPR(address asset, uint256 utilWad) external view returns (uint256 aprWad);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "none",
    "appendCBOR": false
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": true
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"utilWad","type":"uint256"}],"name":"borrowAPR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]

608080604052346015576101d1908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c636367979314610024575f80fd5b346101cd5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101cd5760043573ffffffffffffffffffffffffffffffffffffffff8116036101cd57602435670de0b6b3a764000081116101be575b670bcbce7f1b150000811161012c578067016345785d8a0000029067016345785d8a00008204036100ff57670bcbce7f1b150000900466354a6ba7a18000018066354a6ba7a18000116100ff575b6722b1c8c1227a000081116100ee576020905b604051908152f35b5060206722b1c8c1227a00006100e6565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7ffffffffffffffffffffffffffffffffffffffffffffffffff4343180e4eb000081019081116100ff5780670b1a2bc2ec5000000290670b1a2bc2ec5000008204036100ff57670214e8348c4f000090046701988fe4052b8000908101809111156100d3577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b50670de0b6b3a7640000610085565b5f80fd

Deployed Bytecode

0x60806040526004361015610011575f80fd5b5f3560e01c636367979314610024575f80fd5b346101cd5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101cd5760043573ffffffffffffffffffffffffffffffffffffffff8116036101cd57602435670de0b6b3a764000081116101be575b670bcbce7f1b150000811161012c578067016345785d8a0000029067016345785d8a00008204036100ff57670bcbce7f1b150000900466354a6ba7a18000018066354a6ba7a18000116100ff575b6722b1c8c1227a000081116100ee576020905b604051908152f35b5060206722b1c8c1227a00006100e6565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7ffffffffffffffffffffffffffffffffffffffffffffffffff4343180e4eb000081019081116100ff5780670b1a2bc2ec5000000290670b1a2bc2ec5000008204036100ff57670214e8348c4f000090046701988fe4052b8000908101809111156100d3577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b50670de0b6b3a7640000610085565b5f80fd

Block Transaction Gas Used Reward
view all blocks ##produced##

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.