Sepolia Testnet

Contract

0xF9B8247b30c90f6Bfa0DfA2cA3D323BBBC3887f7

Overview

ETH Balance

0 ETH

Multichain Info

N/A
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

Contract Source Code Verified (Exact Match)

Contract Name:
EOConsumerExample

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : Consumer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IEOFeedManager {
    struct PriceFeed {
        uint256 value;
        uint256 timestamp;
    }
    function getLatestPriceFeed(uint16 symbol) external view returns (PriceFeed memory);
    function getLatestPriceFeeds(uint16[] calldata symbols) external view returns (PriceFeed[] memory);
}

contract EOConsumerExample {
    IEOFeedManager public _feedManager;
    
    /**
     * Network: Holesky
         * FeedManager: 0x723BD409703EF60d6fB9F8d986eb90099A170fd0
     */
    constructor() {
        _feedManager = IEOFeedManager(0x538DF563cc3A3b551d8d77d8a37a1F7E23644461);
    }

    // Example for using IEOFeedManager.getLatestPriceFeed with a single symbol.
    function getPrice() external view returns (IEOFeedManager.PriceFeed memory) {
        return _feedManager.getLatestPriceFeed(1); // 1 is the id for BTC:USD
    }
    
    function usePrice() external {
        IEOFeedManager.PriceFeed memory data = this.getPrice(); 
        uint256 value = data.value; 
        uint256 timestamp = data.timestamp; 
        // Do something 
        // .............
    }
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/"
  ],
  "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 ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"_feedManager","outputs":[{"internalType":"contract IEOFeedManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct IEOFeedManager.PriceFeed","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usePrice","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052348015600f57600080fd5b50600080546001600160a01b03191673538df563cc3a3b551d8d77d8a37a1f7e23644461179055610222806100456000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80637a39ed9e1461004657806398d5fdca14610050578063b0edcdb514610078575b600080fd5b61004e6100a3565b005b61005861010a565b604080518251815260209283015192810192909252015b60405180910390f35b60005461008b906001600160a01b031681565b6040516001600160a01b03909116815260200161006f565b6000306001600160a01b03166398d5fdca6040518163ffffffff1660e01b81526004016040805180830381865afa1580156100e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610106919061018f565b5050565b604080518082019091526000808252602082015260005460405163cbc2483b60e01b8152600160048201526001600160a01b039091169063cbc2483b906024016040805180830381865afa158015610166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018a919061018f565b905090565b6000604082840312156101a157600080fd5b6040516040810181811067ffffffffffffffff821117156101d257634e487b7160e01b600052604160045260246000fd5b60405282518152602092830151928101929092525091905056fea2646970667358221220dce9f5ad7909413c84790e803a3f986a0029057aa11074b24dcce776b5cf431f64736f6c63430008190033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c80637a39ed9e1461004657806398d5fdca14610050578063b0edcdb514610078575b600080fd5b61004e6100a3565b005b61005861010a565b604080518251815260209283015192810192909252015b60405180910390f35b60005461008b906001600160a01b031681565b6040516001600160a01b03909116815260200161006f565b6000306001600160a01b03166398d5fdca6040518163ffffffff1660e01b81526004016040805180830381865afa1580156100e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610106919061018f565b5050565b604080518082019091526000808252602082015260005460405163cbc2483b60e01b8152600160048201526001600160a01b039091169063cbc2483b906024016040805180830381865afa158015610166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018a919061018f565b905090565b6000604082840312156101a157600080fd5b6040516040810181811067ffffffffffffffff821117156101d257634e487b7160e01b600052604160045260246000fd5b60405282518152602092830151928101929092525091905056fea2646970667358221220dce9f5ad7909413c84790e803a3f986a0029057aa11074b24dcce776b5cf431f64736f6c63430008190033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

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.