Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0xaBc99f366D2bE1f4e5b8DFC0F561a751dd836246
Balance 0 ETH
Nonce 1
Code Size 1076 bytes
Indexed Transactions 0 (1 on-chain, 1.6% indexed)
External Etherscan · Sourcify

Contract Bytecode

1076 bytes
Copy Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632616501d14610067578063313ce567146100a157806367e828bf146100bb578063a384d6ff146100fa578063b09ad8a014610121578063c89d5b8b14610148575b600080fd5b61008e7f000000000000000000000000000000000000000000000000006a94d74f43000081565b6040519081526020015b60405180910390f35b6100a9610150565b60405160ff9091168152602001610098565b6100e27f00000000000000000000000008669c836f41aead03e3ef81a59f3b8e72ec417a81565b6040516001600160a01b039091168152602001610098565b61008e7f00000000000000000000000000000000000000000000000000470de4df82000081565b61008e7f00000000000000000000000000000000000000000000000000c3663566a5800081565b61008e6101d9565b60007f00000000000000000000000008669c836f41aead03e3ef81a59f3b8e72ec417a6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d491906103bb565b905090565b60007f00000000000000000000000008669c836f41aead03e3ef81a59f3b8e72ec417a6001600160a01b031663c89d5b8b6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610255575060408051601f3d908101601f19168201909252610252918101906103e5565b60015b610318573d808015610283576040519150601f19603f3d011682016040523d82523d6000602084013e610288565b606091505b5060008151116102f15760405162461bcd60e51b815260206004820152602a60248201527f43617070656446616c6c6261636b52617465536f757263652f7a65726f2d6c656044820152693733ba3416b2b93937b960b11b606482015260840160405180910390fd5b7f000000000000000000000000000000000000000000000000006a94d74f43000091505090565b7f00000000000000000000000000000000000000000000000000470de4df820000811015610367577f00000000000000000000000000000000000000000000000000470de4df82000091505090565b7f00000000000000000000000000000000000000000000000000c3663566a580008111156103b6577f00000000000000000000000000000000000000000000000000c3663566a5800091505090565b919050565b6000602082840312156103cd57600080fd5b815160ff811681146103de57600080fd5b9392505050565b6000602082840312156103f757600080fd5b505191905056fea2646970667358221220527ef4314bbeacd67bfbb52452d3f8f36b6aa5cbf9b044648753be0d3032e36464736f6c63430008140033

Verified Source Code Full Match

Compiler: v0.8.20+commit.a1b79de6 EVM: paris Optimization: Yes (200 runs)
CappedFallbackRateSource.sol 52 lines
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

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

/**
 * @title  CappedFallbackRateSource
 * @notice Wraps another rate source, caps the rate and protects against reverts with a fallback value.
 */
contract CappedFallbackRateSource is IRateSource {

    IRateSource public immutable source;
    uint256     public immutable lowerBound;
    uint256     public immutable upperBound;
    uint256     public immutable defaultRate;

    constructor(
        address _source,
        uint256 _lowerBound,
        uint256 _upperBound,
        uint256 _defaultRate
    ) {
        require(_lowerBound <= _upperBound,                                 "CappedFallbackRateSource/invalid-bounds");
        require(_defaultRate >= _lowerBound && _defaultRate <= _upperBound, "CappedFallbackRateSource/invalid-default-rate");

        source      = IRateSource(_source);
        lowerBound  = _lowerBound;
        upperBound  = _upperBound;
        defaultRate = _defaultRate;
    }

    function getAPR() external override view returns (uint256) {
        try source.getAPR() returns (uint256 rate) {
            if      (rate < lowerBound) return lowerBound;
            else if (rate > upperBound) return upperBound;

            return rate;
        } catch (bytes memory err) {
            // This is a special case where you can trigger the catch in the try-catch by messing with the gas limit to
            // revert with out of gas (OOG) inside the inner loop. The refund may be enough to cover the remainder of
            // the execution so we need to check that the revert error is not empty (OOG) to prevent abuse.
            require(err.length > 0, "CappedFallbackRateSource/zero-length-error");

            return defaultRate;
        }
    }

    function decimals() external view override returns (uint8) {
        return source.decimals();
    }

}
IRateSource.sol 7 lines
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

interface IRateSource {
    function getAPR() external view returns (uint256);
    function decimals() external view returns (uint8);
}

Read Contract

decimals 0x313ce567 → uint8
defaultRate 0x2616501d → uint256
getAPR 0xc89d5b8b → uint256
lowerBound 0xa384d6ff → uint256
source 0x67e828bf → address
upperBound 0xb09ad8a0 → uint256

Recent Transactions

This address has 1 on-chain transactions, but only 1.6% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →