FRAX Price: $0.85 (-15.86%)

Contract

0x8865435777730eAAbAAF2d1F55F115a87AbCf91A

Overview

FRAX Balance | FXTL Balance

0 FRAX | 383,800 FXTL

FRAX Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Transfer Timeloc...72133812024-07-17 17:31:13556 days ago1721237473IN
0x88654357...87AbCf91A
0 FRAX0.000001420.00000025
Set Price Source19867012024-03-18 17:48:33677 days ago1710784113IN
0x88654357...87AbCf91A
0 FRAX0.000004240.00010025

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:
FraxtalERC4626TransportOracle

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;

// ====================================================================
// |     ______                   _______                             |
// |    / _____________ __  __   / ____(_____  ____ _____  ________   |
// |   / /_  / ___/ __ `| |/_/  / /_  / / __ \/ __ `/ __ \/ ___/ _ \  |
// |  / __/ / /  / /_/ _>  <   / __/ / / / / / /_/ / / / / /__/  __/  |
// | /_/   /_/   \__,_/_/|_|  /_/   /_/_/ /_/\__,_/_/ /_/\___/\___/   |
// |                                                                  |
// ====================================================================
// ================= FraxtalERC4626TransportOracle ====================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance

// ====================================================================
import { Timelock2Step } from "frax-std/access-control/v1/Timelock2Step.sol";
import { ITimelock2Step } from "frax-std/access-control/v1/interfaces/ITimelock2Step.sol";
import { ERC165Storage } from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";
import { FixedPointMathLib } from "@solmate/utils/FixedPointMathLib.sol";

/// @title ClFraxOracle
/// @notice Drop in replacement for a chainlink oracle for price of ETH in USD
/// @dev High/low prices will be equivalent and return the L1 CL Oracle result
contract FraxtalERC4626TransportOracle is Timelock2Step, ERC165Storage {
    address public priceSource;
    uint256 public storedTotalAssets;
    uint256 public totalSupply;
    uint256 public lastRewardAmount;
    uint256 public rewardsCycleEnd;
    uint256 public lastSync;

    using FixedPointMathLib for uint256;

    constructor(address _timelock, address _priceSource) {
        _setTimelock({ _newTimelock: _timelock });
        _registerInterface({ interfaceId: type(ITimelock2Step).interfaceId });
        priceSource = _priceSource;
    }

    // ====================================================================
    // Internal Configuration Setters
    // ====================================================================

    /// @notice The ```_setPriceSource``` function sets the price source
    /// @param _newPriceSource The new price source
    function _setPriceSource(address _newPriceSource) internal {
        address _priceSource = priceSource;
        if (_priceSource == _newPriceSource) revert SamePriceSource();
        emit SetPriceSource({ oldPriceSource: _priceSource, newPriceSource: _newPriceSource });
        priceSource = _newPriceSource;
    }

    // ====================================================================
    // Configuration Setters
    // ====================================================================

    /// @notice The ```setPriceSource``` function sets the price source
    /// @dev Requires msg.sender to be the timelock address
    /// @param _newPriceSource The new price source address
    function setPriceSource(address _newPriceSource) external {
        _requireTimelock();
        _setPriceSource({ _newPriceSource: _newPriceSource });
    }

    // ====================================================================
    // View Helpers
    // ====================================================================

    /// @notice The ```description``` function returns the description of the contract
    /// @return _description The description of the contract
    function description() external pure returns (string memory _description) {
        _description = "sfrxEth/frxEth: Rate Transport";
    }

    function name() external pure returns (string memory _name) {
        _name = "sfrxEth/frxEth: Rate Transport";
    }

    /// @notice The ```decimals``` function returns same decimals value as CL Oracle
    /// @return _decimals The decimals corresponding to the CL answer being transported to L2
    /// @dev Needed for ingesting CL feed into Frax Oracles
    function decimals() external pure returns (uint8 _decimals) {
        _decimals = 18;
    }

    /// @notice Compute the amount of tokens available to share holders.
    ///         Increases linearly during a reward distribution period from the sync call, not the cycle start.
    function totalAssets() public view returns (uint256) {
        // cache global vars
        uint256 storedTotalAssets_ = storedTotalAssets;
        uint256 lastRewardAmount_ = lastRewardAmount;
        uint256 rewardsCycleEnd_ = rewardsCycleEnd;
        uint256 lastSync_ = lastSync;

        if (block.timestamp >= rewardsCycleEnd_) {
            // no rewards or rewards fully unlocked
            // entire reward amount is available
            return storedTotalAssets_ + lastRewardAmount_;
        }

        // rewards not fully unlocked
        // add unlocked rewards to stored total
        uint256 unlockedRewards = (lastRewardAmount_ * (block.timestamp - lastSync_)) / (rewardsCycleEnd_ - lastSync_);
        return storedTotalAssets_ + unlockedRewards;
    }

    function _getPrices() internal view returns (bool isBadData, uint256 _priceLow, uint256 _priceHigh) {
        uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
        uint256 frxEthPerSfrxEth = supply == 0 ? 1e18 : uint256(1e18).mulDivDown(totalAssets(), supply);
        _priceLow = _priceHigh = frxEthPerSfrxEth;
        isBadData = false;
    }

    /// @notice The ```getPrices``` function is intended to return two prices from different oracles
    /// @return isBadData is true when data is stale or otherwise bad
    /// @return _priceLow is the lower of the two prices
    /// @return _priceHigh is the higher of the two prices
    function getPrices() external view returns (bool isBadData, uint256 _priceLow, uint256 _priceHigh) {
        (isBadData, _priceLow, _priceHigh) = _getPrices();
    }

    // ====================================================================
    // Relay functions from merkle proover
    // ====================================================================

    function updateErc4262VaultData(
        uint256 _totalSupply,
        uint256 _totalAssets,
        uint192 _lastRewardsAmount,
        uint32 _rewardsCycleEnd,
        uint32 _lastSync
    ) external {
        if (msg.sender != priceSource) revert OnlyPriceSource();
        lastRewardAmount = _lastRewardsAmount;
        lastSync = _lastSync;
        rewardsCycleEnd = _rewardsCycleEnd;
        storedTotalAssets = _totalAssets;
        totalSupply = _totalSupply;
        emit VaultDataUpdated(_totalSupply, _totalAssets, _lastRewardsAmount, _rewardsCycleEnd, _lastSync);
    }

    // ====================================================================
    // Events
    // ====================================================================

    /// @notice The ```SetPriceSource``` event is emitted when the price source is set
    /// @param oldPriceSource The old price source address
    /// @param newPriceSource The new price source address
    event SetPriceSource(address oldPriceSource, address newPriceSource);
    event VaultDataUpdated(
        uint256 totalSupply,
        uint256 totalStoredAssets,
        uint192 lastRewards,
        uint32 rewardsCycleEnd,
        uint32 lastSync
    );
    // ====================================================================
    // Errors
    // ====================================================================

    error OnlyPriceSource();
    error SamePriceSource();
}

// SPDX-License-Identifier: ISC
pragma solidity >=0.8.0;

// ====================================================================
// |     ______                   _______                             |
// |    / _____________ __  __   / ____(_____  ____ _____  ________   |
// |   / /_  / ___/ __ `| |/_/  / /_  / / __ \/ __ `/ __ \/ ___/ _ \  |
// |  / __/ / /  / /_/ _>  <   / __/ / / / / / /_/ / / / / /__/  __/  |
// | /_/   /_/   \__,_/_/|_|  /_/   /_/_/ /_/\__,_/_/ /_/\___/\___/   |
// |                                                                  |
// ====================================================================
// ========================== Timelock2Step ===========================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance

// Primary Author
// Drake Evans: https://github.com/DrakeEvans

// Reviewers
// Dennis: https://github.com/denett

// ====================================================================

/// @title Timelock2Step
/// @author Drake Evans (Frax Finance) https://github.com/drakeevans
/// @dev Inspired by the OpenZeppelin's Ownable2Step contract
/// @notice  An abstract contract which contains 2-step transfer and renounce logic for a timelock address
abstract contract Timelock2Step {
    /// @notice The pending timelock address
    address public pendingTimelockAddress;

    /// @notice The current timelock address
    address public timelockAddress;

    constructor() {
        timelockAddress = msg.sender;
    }

    /// @notice Emitted when timelock is transferred
    error OnlyTimelock();

    /// @notice Emitted when pending timelock is transferred
    error OnlyPendingTimelock();

    /// @notice The ```TimelockTransferStarted``` event is emitted when the timelock transfer is initiated
    /// @param previousTimelock The address of the previous timelock
    /// @param newTimelock The address of the new timelock
    event TimelockTransferStarted(address indexed previousTimelock, address indexed newTimelock);

    /// @notice The ```TimelockTransferred``` event is emitted when the timelock transfer is completed
    /// @param previousTimelock The address of the previous timelock
    /// @param newTimelock The address of the new timelock
    event TimelockTransferred(address indexed previousTimelock, address indexed newTimelock);

    /// @notice The ```_isSenderTimelock``` function checks if msg.sender is current timelock address
    /// @return Whether or not msg.sender is current timelock address
    function _isSenderTimelock() internal view returns (bool) {
        return msg.sender == timelockAddress;
    }

    /// @notice The ```_requireTimelock``` function reverts if msg.sender is not current timelock address
    function _requireTimelock() internal view {
        if (msg.sender != timelockAddress) revert OnlyTimelock();
    }

    /// @notice The ```_isSenderPendingTimelock``` function checks if msg.sender is pending timelock address
    /// @return Whether or not msg.sender is pending timelock address
    function _isSenderPendingTimelock() internal view returns (bool) {
        return msg.sender == pendingTimelockAddress;
    }

    /// @notice The ```_requirePendingTimelock``` function reverts if msg.sender is not pending timelock address
    function _requirePendingTimelock() internal view {
        if (msg.sender != pendingTimelockAddress) revert OnlyPendingTimelock();
    }

    /// @notice The ```_transferTimelock``` function initiates the timelock transfer
    /// @dev This function is to be implemented by a public function
    /// @param _newTimelock The address of the nominated (pending) timelock
    function _transferTimelock(address _newTimelock) internal {
        pendingTimelockAddress = _newTimelock;
        emit TimelockTransferStarted(timelockAddress, _newTimelock);
    }

    /// @notice The ```_acceptTransferTimelock``` function completes the timelock transfer
    /// @dev This function is to be implemented by a public function
    function _acceptTransferTimelock() internal {
        pendingTimelockAddress = address(0);
        _setTimelock(msg.sender);
    }

    /// @notice The ```_setTimelock``` function sets the timelock address
    /// @dev This function is to be implemented by a public function
    /// @param _newTimelock The address of the new timelock
    function _setTimelock(address _newTimelock) internal {
        emit TimelockTransferred(timelockAddress, _newTimelock);
        timelockAddress = _newTimelock;
    }

    /// @notice The ```transferTimelock``` function initiates the timelock transfer
    /// @dev Must be called by the current timelock
    /// @param _newTimelock The address of the nominated (pending) timelock
    function transferTimelock(address _newTimelock) external virtual {
        _requireTimelock();
        _transferTimelock(_newTimelock);
    }

    /// @notice The ```acceptTransferTimelock``` function completes the timelock transfer
    /// @dev Must be called by the pending timelock
    function acceptTransferTimelock() external virtual {
        _requirePendingTimelock();
        _acceptTransferTimelock();
    }

    /// @notice The ```renounceTimelock``` function renounces the timelock after setting pending timelock to current timelock
    /// @dev Pending timelock must be set to current timelock before renouncing, creating a 2-step renounce process
    function renounceTimelock() external virtual {
        _requireTimelock();
        _requirePendingTimelock();
        _transferTimelock(address(0));
        _setTimelock(address(0));
    }
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;

interface ITimelock2Step {
    event TimelockTransferStarted(address indexed previousTimelock, address indexed newTimelock);
    event TimelockTransferred(address indexed previousTimelock, address indexed newTimelock);

    function acceptTransferTimelock() external;

    function pendingTimelockAddress() external view returns (address);

    function renounceTimelock() external;

    function timelockAddress() external view returns (address);

    function transferTimelock(address _newTimelock) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Storage.sol)

pragma solidity ^0.8.0;

import "./ERC165.sol";

/**
 * @dev Storage based implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165Storage is ERC165 {
    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return super.supportsInterface(interfaceId) || _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
    /*//////////////////////////////////////////////////////////////
                    SIMPLIFIED FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.

    function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
    }

    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
    }

    function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
    }

    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
    }

    /*//////////////////////////////////////////////////////////////
                    LOW LEVEL FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function mulDivDown(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // Divide z by the denominator.
            z := div(z, denominator)
        }
    }

    function mulDivUp(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // First, divide z - 1 by the denominator and add 1.
            // We allow z - 1 to underflow if z is 0, because we multiply the
            // end result by 0 if z is zero, ensuring we return 0 if z is zero.
            z := mul(iszero(iszero(z)), add(div(sub(z, 1), denominator), 1))
        }
    }

    function rpow(
        uint256 x,
        uint256 n,
        uint256 scalar
    ) internal pure returns (uint256 z) {
        assembly {
            switch x
            case 0 {
                switch n
                case 0 {
                    // 0 ** 0 = 1
                    z := scalar
                }
                default {
                    // 0 ** n = 0
                    z := 0
                }
            }
            default {
                switch mod(n, 2)
                case 0 {
                    // If n is even, store scalar in z for now.
                    z := scalar
                }
                default {
                    // If n is odd, store x in z for now.
                    z := x
                }

                // Shifting right by 1 is like dividing by 2.
                let half := shr(1, scalar)

                for {
                    // Shift n right by 1 before looping to halve it.
                    n := shr(1, n)
                } n {
                    // Shift n right by 1 each iteration to halve it.
                    n := shr(1, n)
                } {
                    // Revert immediately if x ** 2 would overflow.
                    // Equivalent to iszero(eq(div(xx, x), x)) here.
                    if shr(128, x) {
                        revert(0, 0)
                    }

                    // Store x squared.
                    let xx := mul(x, x)

                    // Round to the nearest number.
                    let xxRound := add(xx, half)

                    // Revert if xx + half overflowed.
                    if lt(xxRound, xx) {
                        revert(0, 0)
                    }

                    // Set x to scaled xxRound.
                    x := div(xxRound, scalar)

                    // If n is even:
                    if mod(n, 2) {
                        // Compute z * x.
                        let zx := mul(z, x)

                        // If z * x overflowed:
                        if iszero(eq(div(zx, x), z)) {
                            // Revert if x is non-zero.
                            if iszero(iszero(x)) {
                                revert(0, 0)
                            }
                        }

                        // Round to the nearest number.
                        let zxRound := add(zx, half)

                        // Revert if zx + half overflowed.
                        if lt(zxRound, zx) {
                            revert(0, 0)
                        }

                        // Return properly scaled zxRound.
                        z := div(zxRound, scalar)
                    }
                }
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                        GENERAL NUMBER UTILITIES
    //////////////////////////////////////////////////////////////*/

    function sqrt(uint256 x) internal pure returns (uint256 z) {
        assembly {
            // Start off with z at 1.
            z := 1

            // Used below to help find a nearby power of 2.
            let y := x

            // Find the lowest power of 2 that is at least sqrt(x).
            if iszero(lt(y, 0x100000000000000000000000000000000)) {
                y := shr(128, y) // Like dividing by 2 ** 128.
                z := shl(64, z) // Like multiplying by 2 ** 64.
            }
            if iszero(lt(y, 0x10000000000000000)) {
                y := shr(64, y) // Like dividing by 2 ** 64.
                z := shl(32, z) // Like multiplying by 2 ** 32.
            }
            if iszero(lt(y, 0x100000000)) {
                y := shr(32, y) // Like dividing by 2 ** 32.
                z := shl(16, z) // Like multiplying by 2 ** 16.
            }
            if iszero(lt(y, 0x10000)) {
                y := shr(16, y) // Like dividing by 2 ** 16.
                z := shl(8, z) // Like multiplying by 2 ** 8.
            }
            if iszero(lt(y, 0x100)) {
                y := shr(8, y) // Like dividing by 2 ** 8.
                z := shl(4, z) // Like multiplying by 2 ** 4.
            }
            if iszero(lt(y, 0x10)) {
                y := shr(4, y) // Like dividing by 2 ** 4.
                z := shl(2, z) // Like multiplying by 2 ** 2.
            }
            if iszero(lt(y, 0x8)) {
                // Equivalent to 2 ** z.
                z := shl(1, z)
            }

            // Shifting right by 1 is like dividing by 2.
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))

            // Compute a rounded down version of z.
            let zRoundDown := div(x, z)

            // If zRoundDown is smaller, use it.
            if lt(zRoundDown, z) {
                z := zRoundDown
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "ds-test/=node_modules/ds-test/src/",
    "forge-std/=node_modules/forge-std/src/",
    "frax-std/=node_modules/frax-standard-solidity/src/",
    "script/=src/script/",
    "src/=src/",
    "test/=src/test/",
    "interfaces/=src/contracts/interfaces/",
    "arbitrum/=node_modules/@arbitrum/",
    "rlp/=node_modules/solidity-rlp/contracts/",
    "@solmate/=node_modules/@rari-capital/solmate/src/",
    "@arbitrum/=node_modules/@arbitrum/",
    "@chainlink/=node_modules/@chainlink/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@mean-finance/=node_modules/@mean-finance/",
    "@offchainlabs/=node_modules/@offchainlabs/",
    "@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/=node_modules/hardhat/",
    "prb-math/=node_modules/prb-math/",
    "solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
    "solidity-rlp/=node_modules/solidity-rlp/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "none",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_timelock","type":"address"},{"internalType":"address","name":"_priceSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyPendingTimelock","type":"error"},{"inputs":[],"name":"OnlyPriceSource","type":"error"},{"inputs":[],"name":"OnlyTimelock","type":"error"},{"inputs":[],"name":"SamePriceSource","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPriceSource","type":"address"},{"indexed":false,"internalType":"address","name":"newPriceSource","type":"address"}],"name":"SetPriceSource","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousTimelock","type":"address"},{"indexed":true,"internalType":"address","name":"newTimelock","type":"address"}],"name":"TimelockTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousTimelock","type":"address"},{"indexed":true,"internalType":"address","name":"newTimelock","type":"address"}],"name":"TimelockTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalStoredAssets","type":"uint256"},{"indexed":false,"internalType":"uint192","name":"lastRewards","type":"uint192"},{"indexed":false,"internalType":"uint32","name":"rewardsCycleEnd","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"lastSync","type":"uint32"}],"name":"VaultDataUpdated","type":"event"},{"inputs":[],"name":"acceptTransferTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"_decimals","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"_description","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getPrices","outputs":[{"internalType":"bool","name":"isBadData","type":"bool"},{"internalType":"uint256","name":"_priceLow","type":"uint256"},{"internalType":"uint256","name":"_priceHigh","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSync","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"_name","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"pendingTimelockAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceSource","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsCycleEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newPriceSource","type":"address"}],"name":"setPriceSource","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storedTotalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timelockAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newTimelock","type":"address"}],"name":"transferTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"uint256","name":"_totalAssets","type":"uint256"},{"internalType":"uint192","name":"_lastRewardsAmount","type":"uint192"},{"internalType":"uint32","name":"_rewardsCycleEnd","type":"uint32"},{"internalType":"uint32","name":"_lastSync","type":"uint32"}],"name":"updateErc4262VaultData","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051610c68380380610c6883398101604081905261002f9161017b565b600180546001600160a01b0319163317905561004a82610080565b61005a632fa3fc3160e21b6100dc565b600380546001600160a01b0319166001600160a01b0392909216919091179055506101ae565b6001546040516001600160a01b038084169216907f31b6c5a04b069b6ec1b3cef44c4e7c1eadd721349cda9823d0b1877b3551cdc690600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160e01b0319808216900361013a5760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015260640160405180910390fd5b6001600160e01b0319166000908152600260205260409020805460ff19166001179055565b80516001600160a01b038116811461017657600080fd5b919050565b6000806040838503121561018e57600080fd5b6101978361015f565b91506101a56020840161015f565b90509250929050565b610aab806101bd6000396000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c80634f8b4ae7116100cd578063bafedcaa11610081578063bda5310711610066578063bda53107146102e0578063e7ff69f1146102f3578063f6ccaad4146102fc57600080fd5b8063bafedcaa146102b2578063bd9a548b146102bb57600080fd5b80636917516b116100b25780636917516b146102965780636a5f11e51461029f5780637284e4161461019457600080fd5b80634f8b4ae71461028557806361c1c5e91461028d57600080fd5b806318160ddd11610124578063313ce56711610109578063313ce5671461024157806345014095146102505780634bc66f321461026557600080fd5b806318160ddd1461021857806320531bc91461022157600080fd5b806301e1d1141461015657806301ffc9a71461017157806306fdde0314610194578063090f3f50146101d3575b600080fd5b61015e610304565b6040519081526020015b60405180910390f35b61018461017f36600461087d565b610370565b6040519015158152602001610168565b604080518082018252601e81527f736672784574682f6672784574683a2052617465205472616e73706f727400006020820152905161016891906108c6565b6000546101f39073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610168565b61015e60055481565b6003546101f39073ffffffffffffffffffffffffffffffffffffffff1681565b60405160128152602001610168565b61026361025e366004610932565b6103f9565b005b6001546101f39073ffffffffffffffffffffffffffffffffffffffff1681565b61026361040d565b61015e60045481565b61015e60085481565b6102636102ad366004610981565b610433565b61015e60065481565b6102c3610516565b604080519315158452602084019290925290820152606001610168565b6102636102ee366004610932565b61052f565b61015e60075481565b610263610540565b600454600654600754600854600093929190428211610330576103278385610a26565b94505050505090565b600061033c8284610a39565b6103468342610a39565b6103509086610a4c565b61035a9190610a63565b90506103668186610a26565b9550505050505090565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614806103f357507fffffffff00000000000000000000000000000000000000000000000000000000821660009081526002602052604090205460ff165b92915050565b610401610550565b61040a816105a1565b50565b610415610550565b61041d610616565b61042760006105a1565b6104316000610667565b565b60035473ffffffffffffffffffffffffffffffffffffffff163314610484576040517f2937b3e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b77ffffffffffffffffffffffffffffffffffffffffffffffff8316600681905563ffffffff8281166008819055908416600781905560048790556005889055604080518981526020810189905290810193909352606083015260808201527f8a6cc650575476fcc43e8cf622758b7e3f879b1ebf5981bed582a1afadf3c6269060a00160405180910390a15050505050565b60008060006105236106f5565b91959094509092509050565b610537610550565b61040a8161073f565b610548610616565b61043161082d565b60015473ffffffffffffffffffffffffffffffffffffffff163314610431576040517f1c0be90a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560015460405192939116917f162998b90abc2507f3953aa797827b03a14c42dbd9a35f09feaf02e0d592773a9190a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314610431576040517ff5c49e6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f31b6c5a04b069b6ec1b3cef44c4e7c1eadd721349cda9823d0b1877b3551cdc690600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6005546000908190819081811561072657610721610711610304565b670de0b6b3a7640000908461085e565b610730565b670de0b6b3a76400005b60009690955085945092505050565b60035473ffffffffffffffffffffffffffffffffffffffff9081169082168103610795576040517f22ba75b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8084168252841660208201527f964298b435edfc268e11aa89b342ef1ddac566da6759b6dd15d7aad58a1dc935910160405180910390a150600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561043133610667565b82820281151584158583048514171661087657600080fd5b0492915050565b60006020828403121561088f57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146108bf57600080fd5b9392505050565b600060208083528351808285015260005b818110156108f3578581018301518582016040015282016108d7565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561094457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146108bf57600080fd5b803563ffffffff8116811461097c57600080fd5b919050565b600080600080600060a0868803121561099957600080fd5b8535945060208601359350604086013577ffffffffffffffffffffffffffffffffffffffffffffffff811681146109cf57600080fd5b92506109dd60608701610968565b91506109eb60808701610968565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103f3576103f36109f7565b818103818111156103f3576103f36109f7565b80820281158282048414176103f3576103f36109f7565b600082610a99577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000813000a00000000000000000000000031562ae726afebe25417df01bedc72ef489f45b3000000000000000000000000ed403d48e2bc946438b5686aa1ad65056ccf9512

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101515760003560e01c80634f8b4ae7116100cd578063bafedcaa11610081578063bda5310711610066578063bda53107146102e0578063e7ff69f1146102f3578063f6ccaad4146102fc57600080fd5b8063bafedcaa146102b2578063bd9a548b146102bb57600080fd5b80636917516b116100b25780636917516b146102965780636a5f11e51461029f5780637284e4161461019457600080fd5b80634f8b4ae71461028557806361c1c5e91461028d57600080fd5b806318160ddd11610124578063313ce56711610109578063313ce5671461024157806345014095146102505780634bc66f321461026557600080fd5b806318160ddd1461021857806320531bc91461022157600080fd5b806301e1d1141461015657806301ffc9a71461017157806306fdde0314610194578063090f3f50146101d3575b600080fd5b61015e610304565b6040519081526020015b60405180910390f35b61018461017f36600461087d565b610370565b6040519015158152602001610168565b604080518082018252601e81527f736672784574682f6672784574683a2052617465205472616e73706f727400006020820152905161016891906108c6565b6000546101f39073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610168565b61015e60055481565b6003546101f39073ffffffffffffffffffffffffffffffffffffffff1681565b60405160128152602001610168565b61026361025e366004610932565b6103f9565b005b6001546101f39073ffffffffffffffffffffffffffffffffffffffff1681565b61026361040d565b61015e60045481565b61015e60085481565b6102636102ad366004610981565b610433565b61015e60065481565b6102c3610516565b604080519315158452602084019290925290820152606001610168565b6102636102ee366004610932565b61052f565b61015e60075481565b610263610540565b600454600654600754600854600093929190428211610330576103278385610a26565b94505050505090565b600061033c8284610a39565b6103468342610a39565b6103509086610a4c565b61035a9190610a63565b90506103668186610a26565b9550505050505090565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614806103f357507fffffffff00000000000000000000000000000000000000000000000000000000821660009081526002602052604090205460ff165b92915050565b610401610550565b61040a816105a1565b50565b610415610550565b61041d610616565b61042760006105a1565b6104316000610667565b565b60035473ffffffffffffffffffffffffffffffffffffffff163314610484576040517f2937b3e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b77ffffffffffffffffffffffffffffffffffffffffffffffff8316600681905563ffffffff8281166008819055908416600781905560048790556005889055604080518981526020810189905290810193909352606083015260808201527f8a6cc650575476fcc43e8cf622758b7e3f879b1ebf5981bed582a1afadf3c6269060a00160405180910390a15050505050565b60008060006105236106f5565b91959094509092509050565b610537610550565b61040a8161073f565b610548610616565b61043161082d565b60015473ffffffffffffffffffffffffffffffffffffffff163314610431576040517f1c0be90a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560015460405192939116917f162998b90abc2507f3953aa797827b03a14c42dbd9a35f09feaf02e0d592773a9190a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314610431576040517ff5c49e6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f31b6c5a04b069b6ec1b3cef44c4e7c1eadd721349cda9823d0b1877b3551cdc690600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6005546000908190819081811561072657610721610711610304565b670de0b6b3a7640000908461085e565b610730565b670de0b6b3a76400005b60009690955085945092505050565b60035473ffffffffffffffffffffffffffffffffffffffff9081169082168103610795576040517f22ba75b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8084168252841660208201527f964298b435edfc268e11aa89b342ef1ddac566da6759b6dd15d7aad58a1dc935910160405180910390a150600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561043133610667565b82820281151584158583048514171661087657600080fd5b0492915050565b60006020828403121561088f57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146108bf57600080fd5b9392505050565b600060208083528351808285015260005b818110156108f3578581018301518582016040015282016108d7565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561094457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146108bf57600080fd5b803563ffffffff8116811461097c57600080fd5b919050565b600080600080600060a0868803121561099957600080fd5b8535945060208601359350604086013577ffffffffffffffffffffffffffffffffffffffffffffffff811681146109cf57600080fd5b92506109dd60608701610968565b91506109eb60808701610968565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103f3576103f36109f7565b818103818111156103f3576103f36109f7565b80820281158282048414176103f3576103f36109f7565b600082610a99577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000813000a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000031562ae726afebe25417df01bedc72ef489f45b3000000000000000000000000ed403d48e2bc946438b5686aa1ad65056ccf9512

-----Decoded View---------------
Arg [0] : _timelock (address): 0x31562ae726AFEBe25417df01bEdC72EF489F45b3
Arg [1] : _priceSource (address): 0xeD403d48e2bC946438B5686AA1AD65056Ccf9512

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000031562ae726afebe25417df01bedc72ef489f45b3
Arg [1] : 000000000000000000000000ed403d48e2bc946438b5686aa1ad65056ccf9512


Block Transaction Difficulty 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
[ 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.