ETH Price: $2,167.62 (+4.18%)

Contract

0x1985bE727eCBA7654d20D451BA84c08320B05e6e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Latest Answe...219759822025-03-04 20:41:237 hrs ago1741120883IN
0x1985bE72...320B05e6e
0 ETH0.000034530.8556815
Set Latest Answe...219752552025-03-04 18:15:4710 hrs ago1741112147IN
0x1985bE72...320B05e6e
0 ETH0.000072841.80530613
Set Latest Answe...219745982025-03-04 16:03:5912 hrs ago1741104239IN
0x1985bE72...320B05e6e
0 ETH0.000093862.32540544
Set Latest Answe...219737592025-03-04 13:15:2315 hrs ago1741094123IN
0x1985bE72...320B05e6e
0 ETH0.000055061.36435602
Set Latest Answe...219692862025-03-03 22:16:4730 hrs ago1741040207IN
0x1985bE72...320B05e6e
0 ETH0.000061421.52177459
Set Latest Answe...219681892025-03-03 18:36:2334 hrs ago1741026983IN
0x1985bE72...320B05e6e
0 ETH0.000295047.30970056
Set Latest Answe...219677482025-03-03 17:07:5935 hrs ago1741021679IN
0x1985bE72...320B05e6e
0 ETH0.000045341.12333458
Set Latest Answe...219672092025-03-03 15:19:3537 hrs ago1741015175IN
0x1985bE72...320B05e6e
0 ETH0.000125233.10264593

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
219307482025-02-26 13:16:476 days ago1740575807  Contract Creation0 ETH
Loading...
Loading

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

Contract Name:
SwarmPriceFeed

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : SwarmPriceFeed.sol
//SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/access/Ownable.sol";

contract SwarmPriceFeed is Ownable {
    string public description;

    uint256 private _latestOffchainTimestamp;

    uint256 public latestTimestamp;
    uint256 public latestAnswer;

    uint8 public decimals;

    event DescriptionUpdated(string oldDescription, string newDescription);
    event LatestAnswerUpdated(uint256 latestAnswer, uint256 latestTimestamp);
    event DecimalsUpdated(uint8 oldDecimals, uint8 newDecimals);

    constructor(
        string memory _initialDescription,
        uint256 _initialLatestAnswer,
        uint256 _initialLatestOffchainTimestamp,
        uint8 _initialDecimals
    ) {
        setDescription(_initialDescription);
        setLatestAnswer(_initialLatestAnswer, _initialLatestOffchainTimestamp);
        setDecimals(_initialDecimals);
    }

    function setDescription(string memory _description) public onlyOwner {
        emit DescriptionUpdated(description, _description);

        description = _description;
    }

    function setLatestAnswer(uint256 _answer, uint256 _offChaintimestamp) public onlyOwner {
        require(_offChaintimestamp > _latestOffchainTimestamp, "OFF_CHAIN_TIMESTAMP_TOO_OLD");
        require(_offChaintimestamp <= block.timestamp + 60, "OFF_CHAIN_TIMESTAMP_TOO_FAR_IN_FUTURE");

        emit LatestAnswerUpdated(_answer, block.timestamp);

        _latestOffchainTimestamp = _offChaintimestamp;

        latestAnswer = _answer;
        latestTimestamp = block.timestamp;
    }

    function setDecimals(uint8 _decimals) public onlyOwner {
        emit DecimalsUpdated(decimals, _decimals);

        decimals = _decimals;
    }

    function latestRoundData() external view returns (uint256, uint256, uint256, uint256, uint256) {
        return (0, latestAnswer, latestTimestamp, latestTimestamp, 0);
    }
}

File 2 of 3 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 3 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"string","name":"_initialDescription","type":"string"},{"internalType":"uint256","name":"_initialLatestAnswer","type":"uint256"},{"internalType":"uint256","name":"_initialLatestOffchainTimestamp","type":"uint256"},{"internalType":"uint8","name":"_initialDecimals","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"oldDecimals","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"newDecimals","type":"uint8"}],"name":"DecimalsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oldDescription","type":"string"},{"indexed":false,"internalType":"string","name":"newDescription","type":"string"}],"name":"DescriptionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"latestAnswer","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"latestTimestamp","type":"uint256"}],"name":"LatestAnswerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_decimals","type":"uint8"}],"name":"setDecimals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_answer","type":"uint256"},{"internalType":"uint256","name":"_offChaintimestamp","type":"uint256"}],"name":"setLatestAnswer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638205bf6a116100715780638205bf6a1461011b5780638da5cb5b1461012457806390c3f38f1461013f578063a5d1045e14610152578063f2fde38b14610165578063feaf968c1461017857600080fd5b8063313ce567146100ae57806350d25bcd146100d2578063715018a6146100e95780637284e416146100f35780637a1395aa14610108575b600080fd5b6005546100bb9060ff1681565b60405160ff90911681526020015b60405180910390f35b6100db60045481565b6040519081526020016100c9565b6100f16101ac565b005b6100fb6101c0565b6040516100c99190610572565b6100f161011636600461058c565b61024e565b6100db60035481565b6000546040516001600160a01b0390911681526020016100c9565b6100f161014d3660046105c5565b6102ad565b6100f1610160366004610676565b6102ff565b6100f1610173366004610698565b610409565b600454600354600091908083604080519586526020860194909452928401919091526060830152608082015260a0016100c9565b6101b4610482565b6101be60006104dc565b565b600180546101cd906106c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101f9906106c1565b80156102465780601f1061021b57610100808354040283529160200191610246565b820191906000526020600020905b81548152906001019060200180831161022957829003601f168201915b505050505081565b610256610482565b6005546040805160ff928316815291831660208301527fbb300b99407e7132db221db848f03bdc0743c8712b9c492868b94f4fb579d761910160405180910390a16005805460ff191660ff92909216919091179055565b6102b5610482565b7fe21432e1fe2b572d5803dd7316b7a854952317b42017f920a616ec70cdb8a5c16001826040516102e79291906106fb565b60405180910390a160016102fb82826107e9565b5050565b610307610482565b600254811161035d5760405162461bcd60e51b815260206004820152601b60248201527f4f46465f434841494e5f54494d455354414d505f544f4f5f4f4c44000000000060448201526064015b60405180910390fd5b61036842603c6108a9565b8111156103c55760405162461bcd60e51b815260206004820152602560248201527f4f46465f434841494e5f54494d455354414d505f544f4f5f4641525f494e5f46604482015264555455524560d81b6064820152608401610354565b604080518381524260208201527f94af36721dc550f26f3a1b4b6cfc3ac5df582d97238423685104cbd067602d3c910160405180910390a160025560045542600355565b610411610482565b6001600160a01b0381166104765760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610354565b61047f816104dc565b50565b6000546001600160a01b031633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610354565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000815180845260005b8181101561055257602081850181015186830182015201610536565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610585602083018461052c565b9392505050565b60006020828403121561059e57600080fd5b813560ff8116811461058557600080fd5b634e487b7160e01b600052604160045260246000fd5b6000602082840312156105d757600080fd5b813567ffffffffffffffff808211156105ef57600080fd5b818401915084601f83011261060357600080fd5b813581811115610615576106156105af565b604051601f8201601f19908116603f0116810190838211818310171561063d5761063d6105af565b8160405282815287602084870101111561065657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806040838503121561068957600080fd5b50508035926020909101359150565b6000602082840312156106aa57600080fd5b81356001600160a01b038116811461058557600080fd5b600181811c908216806106d557607f821691505b6020821081036106f557634e487b7160e01b600052602260045260246000fd5b50919050565b60408152600080845461070d816106c1565b806040860152606060018084166000811461072f57600181146107495761077a565b60ff1985168884015283151560051b88018301955061077a565b8960005260208060002060005b868110156107715781548b8201870152908401908201610756565b8a018501975050505b50505050508281036020840152610791818561052c565b95945050505050565b601f8211156107e457600081815260208120601f850160051c810160208610156107c15750805b601f850160051c820191505b818110156107e0578281556001016107cd565b5050505b505050565b815167ffffffffffffffff811115610803576108036105af565b6108178161081184546106c1565b8461079a565b602080601f83116001811461084c57600084156108345750858301515b600019600386901b1c1916600185901b1785556107e0565b600085815260208120601f198616915b8281101561087b5788860151825594840194600190910190840161085c565b50858210156108995787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156108ca57634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220840841599e3a11cb53bf4304381745b215f2fc537414228e6f7b8b4d9350ab3f64736f6c63430008130033

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
[ Download: CSV Export  ]
[ 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.