FRAX Price: $1.03 (+6.65%)

Contract

0xd295936C8Bb465ADd1eC756a51698127CB4F4910

Overview

FRAX Balance | FXTL Balance

0 FRAX | 108,126 FXTL

FRAX Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

> 10 Token Transfers found.

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.20+commit.a1b79de6

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
shanghai 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 "src/contracts/utils/ERC165Storage.sol";
import { FixedPointMathLib } from "@solmate/utils/FixedPointMathLib.sol";

contract FraxtalERC4626TransportOracle is Timelock2Step, ERC165Storage {
    address public priceSource;
    uint96 public lastL1Block;

    // sUSDe variables
    uint256 public totalSupply; // slot 6
    uint256 public totalAssetsBalance; // Balance of contract in asset
    uint256 public lastDistributionTimestamp; // slot 14
    uint256 public vestingAmount; // slot 13

    /// @notice The vesting period of lastDistributionAmount over which it increasingly becomes available to stakers
    uint256 private constant VESTING_PERIOD = 8 hours;

    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 = "sUSDe/USDe: Rate Transport";
    }

    function name() external pure returns (string memory _name) {
        _name = "sUSDe/USDe: 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 Conforms to the ERC4626 Interface
    function pricePerShare() public view returns (uint256) {
        uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
        return supply == 0 ? 1e18 : uint256(1e18).mulDivDown(totalAssets(), supply);
    }

    /**
     * @notice Returns the amount of USDe tokens that are vested in the contract.
     * @dev Taken from: https://etherscan.deth.net/token/0x9d39a5de30e57443bff2a8307a4256c8797a3497#readContract
     */
    function totalAssets() public view returns (uint256) {
        return totalAssetsBalance - getUnvestedAmount();
    }

    /**
     * @notice Returns the amount of USDe tokens that are unvested in the contract.
     * @dev Taken from: https://etherscan.deth.net/token/0x9d39a5de30e57443bff2a8307a4256c8797a3497#readContract
     */
    function getUnvestedAmount() public view returns (uint256) {
        uint256 timeSinceLastDistribution = block.timestamp - lastDistributionTimestamp;
        if (timeSinceLastDistribution >= VESTING_PERIOD) {
            return 0;
        }

        uint256 deltaT;
        unchecked {
            deltaT = (VESTING_PERIOD - timeSinceLastDistribution);
        }
        return (deltaT * vestingAmount) / VESTING_PERIOD;
    }

    /// @notice Internal function returns the current derived price
    function _getPrices() internal view returns (bool isBadData, uint256 _priceLow, uint256 _priceHigh) {
        uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
        uint256 underlyingPerAsset = supply == 0 ? 1e18 : uint256(1e18).mulDivDown(totalAssets(), supply);
        _priceLow = _priceHigh = underlyingPerAsset;
        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();
    }

    /// @dev Adheres to chainlink's AggregatorV3Interface
    /// @return roundId The l1Block corresponding to the last time the oracle was proofed
    /// @return answer The price of sfrxEth in frxEth
    /// @return startedAt The current timestamp
    /// @return updatedAt The current timestamp
    /// @return answeredInRound The l1Block corresponding to the last time the oracle was proofed
    function latestRoundData()
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
    {
        answeredInRound = roundId = uint80(lastL1Block);
        startedAt = updatedAt = block.timestamp;
        answer = int256(pricePerShare());
        if (answer < 0) revert CastError();
        if (roundId < 0) revert CastError();
    }

    // ====================================================================
    // Relay functions from merkle prover
    // ====================================================================

    function updateSUSDeVaultData(
        uint96 _l1BlockNumber,
        uint256 _totalSupply,
        uint256 _totalAssets,
        uint256 _vestingAmount,
        uint256 _lastDistributionTimestamp
    ) external {
        if (msg.sender != priceSource) revert OnlyPriceSource();
        if (_l1BlockNumber < lastL1Block) revert StalePush();
        totalAssetsBalance = _totalAssets;
        totalSupply = _totalSupply;
        vestingAmount = _vestingAmount;
        lastDistributionTimestamp = _lastDistributionTimestamp;
        lastL1Block = _l1BlockNumber;
        emit VaultDataUpdated(_totalSupply, _totalAssets, vestingAmount, lastDistributionTimestamp);
    }

    // ====================================================================
    // 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 totalAssetBalance,
        uint256 vestingAmount,
        uint256 lastDistributionTimestamp
    );
    // ====================================================================
    // Errors
    // ====================================================================

    error OnlyPriceSource();
    error SamePriceSource();
    error StalePush();
    error CastError();
}

// 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 } from "@openzeppelin/contracts/utils/introspection/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 (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @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": "shanghai",
  "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":"CastError","type":"error"},{"inputs":[],"name":"OnlyPendingTimelock","type":"error"},{"inputs":[],"name":"OnlyPriceSource","type":"error"},{"inputs":[],"name":"OnlyTimelock","type":"error"},{"inputs":[],"name":"SamePriceSource","type":"error"},{"inputs":[],"name":"StalePush","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":"totalAssetBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vestingAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastDistributionTimestamp","type":"uint256"}],"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":"getUnvestedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastDistributionTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastL1Block","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"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":"pricePerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"_newPriceSource","type":"address"}],"name":"setPriceSource","outputs":[],"stateMutability":"nonpayable","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":"totalAssetsBalance","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":"uint96","name":"_l1BlockNumber","type":"uint96"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"uint256","name":"_totalAssets","type":"uint256"},{"internalType":"uint256","name":"_vestingAmount","type":"uint256"},{"internalType":"uint256","name":"_lastDistributionTimestamp","type":"uint256"}],"name":"updateSUSDeVaultData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vestingAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561000f575f80fd5b50604051610dce380380610dce83398101604081905261002e91610177565b600180546001600160a01b031916331790556100498261007f565b610059632fa3fc3160e21b6100da565b600380546001600160a01b0319166001600160a01b0392909216919091179055506101a8565b6001546040516001600160a01b038084169216907f31b6c5a04b069b6ec1b3cef44c4e7c1eadd721349cda9823d0b1877b3551cdc6905f90a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160e01b031980821690036101385760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015260640160405180910390fd5b6001600160e01b0319165f908152600260205260409020805460ff19166001179055565b80516001600160a01b0381168114610172575f80fd5b919050565b5f8060408385031215610188575f80fd5b6101918361015c565b915061019f6020840161015c565b90509250929050565b610c19806101b55f395ff3fe608060405234801561000f575f80fd5b5060043610610178575f3560e01c80634bc66f32116100d2578063bd9a548b11610088578063e7c2a60811610063578063e7c2a6081461036d578063f6ccaad414610375578063feaf968c1461037d575f80fd5b8063bd9a548b1461032c578063bda5310714610351578063d2e1fe5414610364575f80fd5b80637284e416116100b85780637284e416146101c3578063770b1c8f146102d757806399530b0614610324575f80fd5b80634bc66f32146102af5780634f8b4ae7146102cf575f80fd5b806318160ddd1161013257806327b8b9121161010d57806327b8b91214610278578063313ce5671461028d578063450140951461029c575f80fd5b806318160ddd1461024657806320531bc91461024f578063209509331461026f575f80fd5b806301ffc9a71161016257806301ffc9a7146101a057806306fdde03146101c3578063090f3f5014610202575f80fd5b8062728f761461017c57806301e1d11414610198575b5f80fd5b61018560075481565b6040519081526020015b60405180910390f35b6101856103bc565b6101b36101ae366004610a4b565b6103d7565b604051901515815260200161018f565b604080518082018252601a81527f73555344652f555344653a2052617465205472616e73706f72740000000000006020820152905161018f9190610a91565b5f546102219073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161018f565b61018560045481565b6003546102219073ffffffffffffffffffffffffffffffffffffffff1681565b61018560065481565b61028b610286366004610afa565b61045e565b005b6040516012815260200161018f565b61028b6102aa366004610b4a565b6105bb565b6001546102219073ffffffffffffffffffffffffffffffffffffffff1681565b61028b6105cf565b600354610307907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff909116815260200161018f565b6101856105f3565b61033461062e565b60408051931515845260208401929092529082015260600161018f565b61028b61035f366004610b4a565b610645565b61018560055481565b610185610656565b61028b61069d565b6103856106ad565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a00161018f565b5f6103c5610656565b6005546103d29190610baa565b905090565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061045857507fffffffff0000000000000000000000000000000000000000000000000000000082165f9081526002602052604090205460ff165b92915050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146104af576040517f2937b3e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003546bffffffffffffffffffffffff7401000000000000000000000000000000000000000090910481169086161015610515576040517f011d308100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058390556004849055600782905560068190556003805473ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000006bffffffffffffffffffffffff8816021790556040805185815260208101859052908101839052606081018290527f5a2111426a4f4dd03f6ba500e2f1865d284b3578a750153416beb0dd1c13d7f69060800160405180910390a15050505050565b6105c3610725565b6105cc81610776565b50565b6105d7610725565b6105df6107ea565b6105e85f610776565b6105f15f61083a565b565b6004545f90801561061e576106196106096103bc565b670de0b6b3a764000090836108c7565b610628565b670de0b6b3a76400005b91505090565b5f805f6106396108e5565b91959094509092509050565b61064d610725565b6105cc8161092d565b5f80600654426106669190610baa565b90506170808110610678575f91505090565b6007546170808281039161068c9083610bbd565b6106969190610bd4565b9250505090565b6106a56107ea565b6105f1610a1b565b6003547401000000000000000000000000000000000000000090046bffffffffffffffffffffffff165f4280836106e26105f3565b93505f84121561071e576040517f811752de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9091929394565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105f1576040517f1c0be90a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560015460405192939116917f162998b90abc2507f3953aa797827b03a14c42dbd9a35f09feaf02e0d592773a9190a350565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146105f1576040517ff5c49e6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f31b6c5a04b069b6ec1b3cef44c4e7c1eadd721349cda9823d0b1877b3551cdc6905f90a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b8282028115158415858304851417166108de575f80fd5b0492915050565b6004545f9081908190818115610915576109106109006103bc565b670de0b6b3a764000090846108c7565b61091f565b670de0b6b3a76400005b5f9690955085945092505050565b60035473ffffffffffffffffffffffffffffffffffffffff9081169082168103610983576040517f22ba75b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8084168252841660208201527f964298b435edfc268e11aa89b342ef1ddac566da6759b6dd15d7aad58a1dc935910160405180910390a150600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105f13361083a565b5f60208284031215610a5b575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610a8a575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610abc57858101830151858201604001528201610aa0565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b5f805f805f60a08688031215610b0e575f80fd5b85356bffffffffffffffffffffffff81168114610b29575f80fd5b97602087013597506040870135966060810135965060800135945092505050565b5f60208284031215610b5a575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a8a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8181038181111561045857610458610b7d565b808202811582820484141761045857610458610b7d565b5f82610c07577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000814000a000000000000000000000000c16068d1ca7e24e20e56bb70af4d00d92aa4f0b2000000000000000000000000c2b984e37d1caf5eef82d9d892287361058955e9

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610178575f3560e01c80634bc66f32116100d2578063bd9a548b11610088578063e7c2a60811610063578063e7c2a6081461036d578063f6ccaad414610375578063feaf968c1461037d575f80fd5b8063bd9a548b1461032c578063bda5310714610351578063d2e1fe5414610364575f80fd5b80637284e416116100b85780637284e416146101c3578063770b1c8f146102d757806399530b0614610324575f80fd5b80634bc66f32146102af5780634f8b4ae7146102cf575f80fd5b806318160ddd1161013257806327b8b9121161010d57806327b8b91214610278578063313ce5671461028d578063450140951461029c575f80fd5b806318160ddd1461024657806320531bc91461024f578063209509331461026f575f80fd5b806301ffc9a71161016257806301ffc9a7146101a057806306fdde03146101c3578063090f3f5014610202575f80fd5b8062728f761461017c57806301e1d11414610198575b5f80fd5b61018560075481565b6040519081526020015b60405180910390f35b6101856103bc565b6101b36101ae366004610a4b565b6103d7565b604051901515815260200161018f565b604080518082018252601a81527f73555344652f555344653a2052617465205472616e73706f72740000000000006020820152905161018f9190610a91565b5f546102219073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161018f565b61018560045481565b6003546102219073ffffffffffffffffffffffffffffffffffffffff1681565b61018560065481565b61028b610286366004610afa565b61045e565b005b6040516012815260200161018f565b61028b6102aa366004610b4a565b6105bb565b6001546102219073ffffffffffffffffffffffffffffffffffffffff1681565b61028b6105cf565b600354610307907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff909116815260200161018f565b6101856105f3565b61033461062e565b60408051931515845260208401929092529082015260600161018f565b61028b61035f366004610b4a565b610645565b61018560055481565b610185610656565b61028b61069d565b6103856106ad565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a00161018f565b5f6103c5610656565b6005546103d29190610baa565b905090565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061045857507fffffffff0000000000000000000000000000000000000000000000000000000082165f9081526002602052604090205460ff165b92915050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146104af576040517f2937b3e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003546bffffffffffffffffffffffff7401000000000000000000000000000000000000000090910481169086161015610515576040517f011d308100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058390556004849055600782905560068190556003805473ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000006bffffffffffffffffffffffff8816021790556040805185815260208101859052908101839052606081018290527f5a2111426a4f4dd03f6ba500e2f1865d284b3578a750153416beb0dd1c13d7f69060800160405180910390a15050505050565b6105c3610725565b6105cc81610776565b50565b6105d7610725565b6105df6107ea565b6105e85f610776565b6105f15f61083a565b565b6004545f90801561061e576106196106096103bc565b670de0b6b3a764000090836108c7565b610628565b670de0b6b3a76400005b91505090565b5f805f6106396108e5565b91959094509092509050565b61064d610725565b6105cc8161092d565b5f80600654426106669190610baa565b90506170808110610678575f91505090565b6007546170808281039161068c9083610bbd565b6106969190610bd4565b9250505090565b6106a56107ea565b6105f1610a1b565b6003547401000000000000000000000000000000000000000090046bffffffffffffffffffffffff165f4280836106e26105f3565b93505f84121561071e576040517f811752de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9091929394565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105f1576040517f1c0be90a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560015460405192939116917f162998b90abc2507f3953aa797827b03a14c42dbd9a35f09feaf02e0d592773a9190a350565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146105f1576040517ff5c49e6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f31b6c5a04b069b6ec1b3cef44c4e7c1eadd721349cda9823d0b1877b3551cdc6905f90a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b8282028115158415858304851417166108de575f80fd5b0492915050565b6004545f9081908190818115610915576109106109006103bc565b670de0b6b3a764000090846108c7565b61091f565b670de0b6b3a76400005b5f9690955085945092505050565b60035473ffffffffffffffffffffffffffffffffffffffff9081169082168103610983576040517f22ba75b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8084168252841660208201527f964298b435edfc268e11aa89b342ef1ddac566da6759b6dd15d7aad58a1dc935910160405180910390a150600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105f13361083a565b5f60208284031215610a5b575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610a8a575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610abc57858101830151858201604001528201610aa0565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b5f805f805f60a08688031215610b0e575f80fd5b85356bffffffffffffffffffffffff81168114610b29575f80fd5b97602087013597506040870135966060810135965060800135945092505050565b5f60208284031215610b5a575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a8a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8181038181111561045857610458610b7d565b808202811582820484141761045857610458610b7d565b5f82610c07577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000814000a

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

000000000000000000000000c16068d1ca7e24e20e56bb70af4d00d92aa4f0b2000000000000000000000000c2b984e37d1caf5eef82d9d892287361058955e9

-----Decoded View---------------
Arg [0] : _timelock (address): 0xc16068d1ca7E24E20e56bB70af4D00D92AA4f0b2
Arg [1] : _priceSource (address): 0xc2B984E37D1CAf5Eef82D9D892287361058955E9

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c16068d1ca7e24e20e56bb70af4d00d92aa4f0b2
Arg [1] : 000000000000000000000000c2b984e37d1caf5eef82d9d892287361058955e9


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

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.