ETH Price: $1,976.21 (+0.77%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Amount:Between 1-10
Reset Filter

Transaction Hash
Method
Block
From
To

There are no matching entries

Update your filters to view other transactions

Amount:Between 1-10
Reset Filter

Advanced mode:
Parent Transaction Hash Method Block
From
To

There are no matching entries

Update your filters to view other transactions

View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Contract Source Code Verified (Exact Match)

Contract Name:
ezETHValueStrategy

Compiler Version
v0.8.27+commit.40a35a09

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.27;

import "../../Errors/Errors.sol";
import { ICachedRateProvider } from "../interfaces/ICachedRateProvider.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../interfaces/IDelegateStrategy.sol";

/**
 * @author  Renzo Protocol
 * @title   ezETHValueStrategy
 * @dev     This contract provides ETH value for ezETH holdings.
 * @notice  Simple strategy that returns the ETH value of ezETH balance using a cached rate provider.
 *          This strategy only tracks value and does not perform any operations.
 */
contract ezETHValueStrategy is IDelegateStrategy {
    /// @notice ezETH token
    IERC20 public immutable ezEthToken;

    /// @notice WETH token (underlying asset)
    IERC20 public immutable wethToken;

    /// @notice Cached rate provider for ezETH/ETH exchange rate
    ICachedRateProvider public immutable cachedRateProvider;

    /// @notice Cache duration in seconds (60 seconds = 1 minute)
    uint256 public constant RATE_CACHE_DURATION = 60;

    /**
     * @notice Constructor
     * @param _ezEthToken Address of the ezETH token
     * @param _wethToken Address of the WETH token
     * @param _cachedRateProvider Address of the cached rate provider
     */
    constructor(address _ezEthToken, address _wethToken, address _cachedRateProvider) {
        if (_ezEthToken == address(0)) revert InvalidZeroInput();
        if (_wethToken == address(0)) revert InvalidZeroInput();
        if (_cachedRateProvider == address(0)) revert InvalidZeroInput();

        ezEthToken = IERC20(_ezEthToken);
        wethToken = IERC20(_wethToken);
        cachedRateProvider = ICachedRateProvider(_cachedRateProvider);
    }

    /**
     * @notice Returns the ETH value of ezETH holdings
     * @dev Converts ezETH balance to WETH value using the cached rate provider
     * @param _asset The underlying asset - must be WETH
     * @return uint256 The value of ezETH holdings in WETH terms
     */
    function underlyingValue(address _asset) external view returns (uint256) {
        // Enforce asset must be WETH
        if (_asset != address(wethToken)) {
            revert InvalidAsset();
        }

        // Get the ezETH balance in this contract
        uint256 ezEthBalance = ezEthToken.balanceOf(address(this));

        // If no ezETH balance, return 0
        if (ezEthBalance == 0) {
            return 0;
        }

        // Get the ezETH to ETH exchange rate with 60 second cache (rate is in 18 decimals)
        uint256 ezEthRate = cachedRateProvider.getRateView(RATE_CACHE_DURATION);

        // Convert ezETH to WETH value
        // ezETH has 18 decimals and WETH has 18 decimals
        // rate is in 18 decimals: 1 ezETH = ezEthRate ETH / 1e18
        uint256 wethValue = (ezEthBalance * ezEthRate) / 1e18;

        return wethValue;
    }

    /**
     * @notice Forces an update of the cached rate
     * @dev Calls forceUpdate on the cached rate provider to refresh the cache immediately
     * @return uint256 The newly fetched rate
     */
    function forceRateUpdate() external returns (uint256) {
        return cachedRateProvider.forceUpdate();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 3 of 6 : Errors.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.27;

/**
 * @title Errors
 * @author Renzo Protocol
 * @notice This contract defines custom errors used throughout the LiquidVaults protocol
 * @dev All errors are defined as custom errors for gas efficiency
 */

/// @dev Error when Zero Input value
error InvalidZeroInput();

/// @dev Error when caller is not Rebalance admin
error NotRebalanceAdmin();

/// @dev Error when caller is not Exchange rate admin
error NotExchangeRateAdmin();

/// @dev Error when array lengths do not match
error MismatchedArrayLengths();

/// @dev Error when admin tries to execute Non whitelisted strategy
error UnAuthorizedStrategy(address strategy);

/// @dev Error when owner tries to remove non zero underlying delegate strategy
error NonZeroUnderlyingDelegateStrategy();

/// @dev Error when Withdrawal is not claimable
error WithdrawalNotClaimable();

/// @dev Error when caller try to claim invalidWithdrawIndex
error InvalidWithdrawIndex();

/// @dev Error when called is not vault
error NotUnderlyingVault();

/// @dev Error when caller is not Withdraw Queue
error NotWithdrawQueue();

/// @dev Error when caller tries to create already existing vault
error VaultAlreadyCreated();

/// @dev Error when caller is not whitelisted
error NotWhitelisted();

/// @dev Error when fee bps out of range
error InvalidFeeBps();

/// @dev Error when caller does not have pauser role
error NotPauser();

/// @dev Error when eulerswap param is invalid
error InvalidEquilibriumReserve();

/// @dev Error when pool is already installed for the euler account
error PoolAlreadyInstalled();

/// @dev Error when unexpected asset address is passed in
error InvalidAsset();

/// @dev Error when no pool is installed for the euler account when it is expected
error NoPoolInstalled();

/// @dev Error when caller is not order admin
error NotOrderAdmin();

/// @dev Error when market is not supported
error MarketNotSupported();

/// @dev Error when order already exists
error OrderAlreadyExists();

/// @dev Error when order does not exist
error OrderDoesNotExist();

/// @dev Error when decimals are invalid
error InvalidDecimals();

/// @dev Error when caller is not owner
error NotOwner();

/// @dev Error when active withdrawal is in progress
error ActiveWithdrawalInProgress();

/// @dev Error when no active withdrawal is in progress
error NoActiveWithdrawalInProgress();

/// @dev Error when active deposit is in progress
error ActiveDepositInProgress();

/// @dev Error when expected amount is invalid
error InvalidExpectedAmount();

/// @dev Error when no active deposit is in progress
error NoActiveDepositInProgress();

/// @dev Error when Oracle Price is invalid
error InvalidOraclePrice();

/// @dev Error when superstate deposit address is already set
error SuperstateAddressAlreadySet();

/// @dev Error when current tick has changed
error InvalidTick();

/// @dev Error when debt value is greater than collateral value
error InvalidDebtValue();

/// @dev Error when referral code is invalid
error InvalidReferralCode();

/// @dev Error when interest rate mode is invalid
error InvalidInterestRateMode();

/// @dev Error when market does not exist
error MarketNotExists();
/// @dev Error when caller is not minter
error NotMinter();

/// @dev Error when order has expired
error OrderExpired();

/// @dev Error when order amount is less than minimum required
error InvalidOrderAmount();

/// @dev Error when payment amount provided is not sufficient
error InsufficientPaymentAmount();

/// @dev Error when invalid fee
error InvalidFee();

/// @dev Error when market is not configured when try to remove
error MarketNotConfigured();

/// @dev Error when market is already configured when try to add
error MarketAlreadyConfigured();

/// @dev Error when new min order amount is less than processing fee
error InvalidMinOrderAmount();

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.27;

import { IRateProvider } from "./IRateProvider.sol";

/**
 * @title ICachedRateProvider
 * @notice Interface for the CachedRateProvider contract
 */
interface ICachedRateProvider {
    /**
     * @notice Emitted when the rate is updated from the provider
     * @param newRate The newly fetched rate
     * @param timestamp The timestamp when the rate was updated
     */
    event RateUpdated(uint256 newRate, uint256 timestamp);

    /**
     * @notice Get the rate with caching logic
     * @param allowedCacheSeconds Maximum age of cache in seconds before refresh is needed
     * @return The current rate
     */
    function getRate(uint256 allowedCacheSeconds) external returns (uint256);

    /**
     * @notice Get the rate with caching logic (view-compatible version)
     * @dev Returns cached rate if available, otherwise calls underlying provider without updating cache
     * @param allowedCacheSeconds Maximum age of cache in seconds before considering stale
     * @return The rate (cached if fresh, or from provider if stale/unavailable)
     */
    function getRateView(uint256 allowedCacheSeconds) external view returns (uint256);

    /**
     * @notice Force an immediate rate update regardless of cache state
     * @return The newly fetched rate
     */
    function forceUpdate() external returns (uint256);

    /**
     * @notice Get the underlying rate provider
     * @return The rate provider contract
     */
    function rateProvider() external view returns (IRateProvider);

    /**
     * @notice Get the last cached rate value
     * @return The cached rate
     */
    function cachedRate() external view returns (uint256);

    /**
     * @notice Get the timestamp when the rate was last updated
     * @return The last update timestamp
     */
    function lastUpdateTimestamp() external view returns (uint256);
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.27;

/**
 * @title IDelegateStrategy
 * @author Renzo Protocol
 * @notice Interface that all delegate strategies must implement
 * @dev Delegate strategies are external contracts that manage vault assets in various DeFi protocols
 */
interface IDelegateStrategy {
    /**
     * @notice Returns the value of assets managed by this strategy
     * @dev WARNING: Don't use balanceOf(this) to avoid double counting
     * @param _asset The asset address to query the value for
     * @return The total value of the specified asset managed by this strategy
     */
    function underlyingValue(address _asset) external view returns (uint256);
}

File 6 of 6 : IRateProvider.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity 0.8.27;

interface IRateProvider {
    function getRate() external view returns (uint256);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_ezEthToken","type":"address"},{"internalType":"address","name":"_wethToken","type":"address"},{"internalType":"address","name":"_cachedRateProvider","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidAsset","type":"error"},{"inputs":[],"name":"InvalidZeroInput","type":"error"},{"inputs":[],"name":"RATE_CACHE_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cachedRateProvider","outputs":[{"internalType":"contract ICachedRateProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ezEthToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forceRateUpdate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"underlyingValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60e060405234801561001057600080fd5b5060405161059138038061059183398101604081905261002f916100dd565b6001600160a01b0383166100565760405163862a606760e01b815260040160405180910390fd5b6001600160a01b03821661007d5760405163862a606760e01b815260040160405180910390fd5b6001600160a01b0381166100a45760405163862a606760e01b815260040160405180910390fd5b6001600160a01b0392831660805290821660a0521660c052610120565b80516001600160a01b03811681146100d857600080fd5b919050565b6000806000606084860312156100f257600080fd5b6100fb846100c1565b9250610109602085016100c1565b9150610117604085016100c1565b90509250925092565b60805160a05160c05161042961016860003960008181606c0152818161023501526102d601526000818160f8015261012e01526000818160b0015261019601526104296000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063044365a7146100675780631dca98e6146100ab5780632f9ef012146100d25780634b57b0be146100f3578063b95a17411461011a578063cf5adee914610122575b600080fd5b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6100e56100e036600461035d565b61012a565b6040519081526020016100a2565b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6100e5603c81565b6100e56102d2565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161461017e57604051636448d6e960e11b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156101e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610209919061038d565b90508060000361021c5750600092915050565b6040516383c7a8a760e01b8152603c60048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906383c7a8a790602401602060405180830381865afa158015610284573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a8919061038d565b90506000670de0b6b3a76400006102bf83856103a6565b6102c991906103d1565b95945050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633acaa0d76040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610358919061038d565b905090565b60006020828403121561036f57600080fd5b81356001600160a01b038116811461038657600080fd5b9392505050565b60006020828403121561039f57600080fd5b5051919050565b80820281158282048414176103cb57634e487b7160e01b600052601160045260246000fd5b92915050565b6000826103ee57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220ec3f71c61b626159c47339da7cc65d325dd60ac164a127b4f5bbe33edb3a088f64736f6c634300081b0033000000000000000000000000bf5495efe5db9ce00f80364c8b423567e58d2110000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000004709ab91123f7dbb4b6c4a02c94e855678404fc7

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063044365a7146100675780631dca98e6146100ab5780632f9ef012146100d25780634b57b0be146100f3578063b95a17411461011a578063cf5adee914610122575b600080fd5b61008e7f0000000000000000000000004709ab91123f7dbb4b6c4a02c94e855678404fc781565b6040516001600160a01b0390911681526020015b60405180910390f35b61008e7f000000000000000000000000bf5495efe5db9ce00f80364c8b423567e58d211081565b6100e56100e036600461035d565b61012a565b6040519081526020016100a2565b61008e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6100e5603c81565b6100e56102d2565b60007f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316826001600160a01b03161461017e57604051636448d6e960e11b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000907f000000000000000000000000bf5495efe5db9ce00f80364c8b423567e58d21106001600160a01b0316906370a0823190602401602060405180830381865afa1580156101e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610209919061038d565b90508060000361021c5750600092915050565b6040516383c7a8a760e01b8152603c60048201526000907f0000000000000000000000004709ab91123f7dbb4b6c4a02c94e855678404fc76001600160a01b0316906383c7a8a790602401602060405180830381865afa158015610284573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a8919061038d565b90506000670de0b6b3a76400006102bf83856103a6565b6102c991906103d1565b95945050505050565b60007f0000000000000000000000004709ab91123f7dbb4b6c4a02c94e855678404fc76001600160a01b0316633acaa0d76040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610358919061038d565b905090565b60006020828403121561036f57600080fd5b81356001600160a01b038116811461038657600080fd5b9392505050565b60006020828403121561039f57600080fd5b5051919050565b80820281158282048414176103cb57634e487b7160e01b600052601160045260246000fd5b92915050565b6000826103ee57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220ec3f71c61b626159c47339da7cc65d325dd60ac164a127b4f5bbe33edb3a088f64736f6c634300081b0033

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

000000000000000000000000bf5495efe5db9ce00f80364c8b423567e58d2110000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000004709ab91123f7dbb4b6c4a02c94e855678404fc7

-----Decoded View---------------
Arg [0] : _ezEthToken (address): 0xbf5495Efe5DB9ce00f80364C8B423567e58d2110
Arg [1] : _wethToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _cachedRateProvider (address): 0x4709ab91123f7Dbb4B6C4a02C94E855678404Fc7

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000bf5495efe5db9ce00f80364c8b423567e58d2110
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000004709ab91123f7dbb4b6c4a02c94e855678404fc7


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.