ETH Price: $2,008.75 (-0.28%)

Contract

0xf77e132799DBB0d83A4fB7df10DA04849340311A
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x73CB2C1E...bbefb3BFc
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
WSTETHExchangeRateOracle

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 2 : WSTETHExchangeRateOracle.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

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

interface ILidoStakedEth {
    function getPooledEthByShares(uint256 shares) external view returns (uint256);
}

/**
 *  @title WSTETHExchangeRateOracle
 *  @dev   Provides wstETH / USD by multiplying the wstETH exchange rate by ETH / USD.
 *         This provides a "non-market" price. Any depeg event will be ignored.
 */
contract WSTETHExchangeRateOracle {

    /// @notice Lido staked eth token contract.
    ILidoStakedEth public immutable steth;

    /// @notice The price source for ETH / USD.
    IPriceSource public immutable ethSource;

    constructor(address _steth, address _ethSource) {
        // 8 decimals required as AaveOracle assumes this
        require(IPriceSource(_ethSource).decimals() == 8, "WSTETHExchangeRateOracle/invalid-decimals");
        
        steth     = ILidoStakedEth(_steth);
        ethSource = IPriceSource(_ethSource);
    }

    function latestAnswer() external view returns (int256) {
        int256 ethUsd       = ethSource.latestAnswer();
        int256 exchangeRate = int256(steth.getPooledEthByShares(1e18));

        if (ethUsd <= 0 || exchangeRate <= 0) {
            return 0;
        }

        return exchangeRate * ethUsd / 1e18;
    }

    function decimals() external pure returns (uint8) {
        return 8;
    }

}

File 2 of 2 : IPriceSource.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

interface IPriceSource {
    function latestAnswer() external view returns (int256);
    function decimals() external view returns (uint8);
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc20-helpers/=lib/erc20-helpers/src/",
    "forge-std/=lib/forge-std/src/",
    "sparklend-v1-core/=lib/sparklend-v1-core/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "sparklend-address-registry/=lib/sparklend-address-registry/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "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":"_steth","type":"address"},{"internalType":"address","name":"_ethSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"ethSource","outputs":[{"internalType":"contract IPriceSource","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"steth","outputs":[{"internalType":"contract ILidoStakedEth","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063313ce5671461005157806350d25bcd146100655780635b7312a21461007b578063953d7ee2146100ba575b600080fd5b604051600881526020015b60405180910390f35b61006d6100e1565b60405190815260200161005c565b6100a27f00000000000000000000000000480cd3ed33de45555410ba71b2f932a14b1cf281565b6040516001600160a01b03909116815260200161005c565b6100a27f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8481565b6000807f00000000000000000000000000480cd3ed33de45555410ba71b2f932a14b1cf26001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101669190610241565b604051630f451f7160e31b8152670de0b6b3a764000060048201529091506000906001600160a01b037f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe841690637a28fb8890602401602060405180830381865afa1580156101d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fc9190610241565b905060008213158061020f575060008113155b1561021d5760009250505090565b670de0b6b3a76400006102308383610270565b61023a91906102a6565b9250505090565b60006020828403121561025357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820260008212600160ff1b8414161561028c5761028c61025a565b81810583148215176102a0576102a061025a565b92915050565b6000826102c357634e487b7160e01b600052601260045260246000fd5b600160ff1b8214600019841416156102dd576102dd61025a565b50059056fea2646970667358221220f2fc978b8cb723d39affb5b5cce3ac5cafffaa4017cb510a83a84644401acbb864736f6c63430008140033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.