ETH Price: $3,381.48 (+4.53%)
Gas: 3 Gwei

Contract

0x596e3f6241Cf1435F91363cB023Def2329363410
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040190076292024-01-14 20:52:35196 days ago1705265555IN
 Create: BlockPrice
0 ETH0.0020836320.98678061

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BlockPrice

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license
File 1 of 1 : BlockPrice.sol
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.20;

contract BlockPrice {
    event Sample(uint256 price);
    uint256 public lastSample;

    function writePrice() external {
        lastSample = getBlockPrice();
        emit Sample(lastSample);
    }

    function getBlockPrice() public view returns (uint256) {
        return block.basefee;
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Sample","type":"event"},{"inputs":[],"name":"getBlockPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSample","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"writePrice","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052348015600e575f80fd5b5060d48061001b5f395ff3fe6080604052348015600e575f80fd5b5060043610603a575f3560e01c806310ca212a14603e578063af6f855d146057578063d77385c614605f575b5f80fd5b60455f5481565b60405190815260200160405180910390f35b605d6064565b005b486045565b485f8190556040519081527f43505e8565af2714277d8f0b7a8cd2021c606580589ad154a21aada8bddfc4b69060200160405180910390a156fea2646970667358221220a537fd9e5281c23995fc6609800317d42ce0875d14b5b4bee0c011b8d45506a164736f6c63430008140033

Deployed Bytecode

0x6080604052348015600e575f80fd5b5060043610603a575f3560e01c806310ca212a14603e578063af6f855d146057578063d77385c614605f575b5f80fd5b60455f5481565b60405190815260200160405180910390f35b605d6064565b005b486045565b485f8190556040519081527f43505e8565af2714277d8f0b7a8cd2021c606580589ad154a21aada8bddfc4b69060200160405180910390a156fea2646970667358221220a537fd9e5281c23995fc6609800317d42ce0875d14b5b4bee0c011b8d45506a164736f6c63430008140033

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  ]

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.