ETH Price: $2,015.50 (+6.13%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

ContractCreator

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Starting Ind...146737932022-04-28 16:04:101402 days ago1651161850IN
0xcdcB4bA6...B55D8E6Ea
0 ETH0.0032131862.81398896
Set Starting Ind...146737862022-04-28 16:02:431402 days ago1651161763IN
0xcdcB4bA6...B55D8E6Ea
0 ETH0.0039416777.63166885
Set Provenance H...146540772022-04-25 13:30:171406 days ago1650893417IN
0xcdcB4bA6...B55D8E6Ea
0 ETH0.0018854240.91377602

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
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:
ZEN_BLOCKS_RARITY

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 3 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @creator: mhxalt.eth
/// @author: seesharp.eth

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

/// __/\\\\\\\\\\\\\\\_________________________________________/\\\\\\\\\\\\\____/\\\\\\___________________________________________________________        
///  _\////////////\\\_________________________________________\/\\\/////////\\\_\////\\\_________________________________/\\\______________________       
///   ___________/\\\/__________________________________________\/\\\_______\/\\\____\/\\\________________________________\/\\\______________________      
///    _________/\\\/_________/\\\\\\\\___/\\/\\\\\\_____________\/\\\\\\\\\\\\\\_____\/\\\________/\\\\\________/\\\\\\\\_\/\\\\\\\\_____/\\\\\\\\\\_     
///     _______/\\\/_________/\\\/////\\\_\/\\\////\\\____________\/\\\/////////\\\____\/\\\______/\\\///\\\____/\\\//////__\/\\\////\\\__\/\\\//////__    
///      _____/\\\/__________/\\\\\\\\\\\__\/\\\__\//\\\___________\/\\\_______\/\\\____\/\\\_____/\\\__\//\\\__/\\\_________\/\\\\\\\\/___\/\\\\\\\\\\_   
///       ___/\\\/___________\//\\///////___\/\\\___\/\\\___________\/\\\_______\/\\\____\/\\\____\//\\\__/\\\__\//\\\________\/\\\///\\\___\////////\\\_  
///        __/\\\\\\\\\\\\\\\__\//\\\\\\\\\\_\/\\\___\/\\\___________\/\\\\\\\\\\\\\/___/\\\\\\\\\__\///\\\\\/____\///\\\\\\\\_\/\\\_\///\\\__/\\\\\\\\\\_ 
///         _\///////////////____\//////////__\///____\///____________\/////////////____\/////////_____\/////________\////////__\///____\///__\//////////__

interface DATA_BLOCKS {
  function maxSupply() external view returns (uint256);
  function mintZenBlockActiveTs() external view returns (uint256);
}

contract ZEN_BLOCKS_RARITY is Ownable {
  uint256 public PROVENANCE_HASH = 0;
  uint256 public startingIndexBlock = 0;
  uint256 public startingIndex = 0;

  address public dataBlocksContract;

  constructor(address _dataBlocksContract) {
    dataBlocksContract = _dataBlocksContract;
  }

  function setProvenanceHash(uint256 _provenanceHash) public onlyOwner {
    require(PROVENANCE_HASH == 0, "Provenance Hash Already Set!");
    PROVENANCE_HASH = _provenanceHash;
  }

  function setStartingIndexBlock() public {
    require(startingIndexBlock == 0, "startingIndexBlock alredy set!");
    DATA_BLOCKS db = DATA_BLOCKS(dataBlocksContract);

    require(db.mintZenBlockActiveTs() == 0, "zen block minting hasn't ended");

    startingIndexBlock = block.number;
  }

  function setStartingIndex() public {
    require(startingIndexBlock != 0, "startingIndexBlock not set!");
    require(startingIndex == 0, "startingIndex already set!");

    DATA_BLOCKS db = DATA_BLOCKS(dataBlocksContract);

    uint256 maxSupplyDB = db.maxSupply();

    uint256 usedHash = uint256(blockhash(startingIndexBlock));
    // Just a sanity case in the worst case if this function is called late (EVM only stores last 256 block hashes)
    if ((block.number - startingIndexBlock) > 255) {
      usedHash = uint256(blockhash(block.number - 1));
    }
    startingIndex = usedHash % maxSupplyDB;
    // Prevent default sequence
    if (startingIndex == 0) {
        startingIndex = startingIndex + 1;
    }
  }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}

// 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": 3
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_dataBlocksContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"PROVENANCE_HASH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dataBlocksContract","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"uint256","name":"_provenanceHash","type":"uint256"}],"name":"setProvenanceHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setStartingIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setStartingIndexBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startingIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startingIndexBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260006001556000600255600060035534801561001f57600080fd5b506040516107a13803806107a183398101604081905261003e916100bc565b6100473361006c565b600480546001600160a01b0319166001600160a01b03929092169190911790556100ec565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100ce57600080fd5b81516001600160a01b03811681146100e557600080fd5b9392505050565b6106a6806100fb6000396000f3fe608060405234801561001057600080fd5b506004361061008e5760003560e01c806327c9134214610093578063715018a6146100a85780638da5cb5b146100b05780638e9917aa146100d5578063cb774d47146100e8578063d5dc3efd146100ff578063e36d649814610107578063e986655014610110578063f2fde38b14610118578063ff1b65561461012b575b600080fd5b6100a66100a1366004610572565b610134565b005b6100a66101c0565b6100b86101fb565b6040516001600160a01b0390911681526020015b60405180910390f35b6004546100b8906001600160a01b031681565b6100f160035481565b6040519081526020016100cc565b6100a661020a565b6100f160025481565b6100a661031b565b6100a661012636600461058b565b610482565b6100f160015481565b3361013d6101fb565b6001600160a01b03161461016c5760405162461bcd60e51b8152600401610163906105bb565b60405180910390fd5b600154156101bb5760405162461bcd60e51b815260206004820152601c60248201527b50726f76656e616e6365204861736820416c7265616479205365742160201b6044820152606401610163565b600155565b336101c96101fb565b6001600160a01b0316146101ef5760405162461bcd60e51b8152600401610163906105bb565b6101f96000610522565b565b6000546001600160a01b031690565b6002541561025a5760405162461bcd60e51b815260206004820152601e60248201527f7374617274696e67496e646578426c6f636b20616c72656479207365742100006044820152606401610163565b6004805460408051633c8c8bf160e21b815290516001600160a01b0390921692839263f2322fc49280830192602092918290030181865afa1580156102a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c791906105f0565b156103145760405162461bcd60e51b815260206004820152601e60248201527f7a656e20626c6f636b206d696e74696e67206861736e277420656e64656400006044820152606401610163565b5043600255565b60025460000361036b5760405162461bcd60e51b815260206004820152601b60248201527a7374617274696e67496e646578426c6f636b206e6f74207365742160281b6044820152606401610163565b600354156103b85760405162461bcd60e51b815260206004820152601a6024820152797374617274696e67496e64657820616c7265616479207365742160301b6044820152606401610163565b600480546040805163d5abeb0160e01b815290516001600160a01b0390921692600092849263d5abeb0192818101926020929091908290030181865afa158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a91906105f0565b60025490915080409060ff90610440904361061f565b11156104555761045160014361061f565b4090505b61045f8282610636565b600381905560000361047d57600354610479906001610658565b6003555b505050565b3361048b6101fb565b6001600160a01b0316146104b15760405162461bcd60e51b8152600401610163906105bb565b6001600160a01b0381166105165760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610163565b61051f81610522565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561058457600080fd5b5035919050565b60006020828403121561059d57600080fd5b81356001600160a01b03811681146105b457600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561060257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561063157610631610609565b500390565b60008261065357634e487b7160e01b600052601260045260246000fd5b500690565b6000821982111561066b5761066b610609565b50019056fea264697066735822122015778b745c4ab1bfcc7121a210bece3338aa5da6bd3489c20347e01458d7683b64736f6c634300080d0033000000000000000000000000825b8d4e1432ccbc5ab2bc24c9e65f0434dcaf37

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061008e5760003560e01c806327c9134214610093578063715018a6146100a85780638da5cb5b146100b05780638e9917aa146100d5578063cb774d47146100e8578063d5dc3efd146100ff578063e36d649814610107578063e986655014610110578063f2fde38b14610118578063ff1b65561461012b575b600080fd5b6100a66100a1366004610572565b610134565b005b6100a66101c0565b6100b86101fb565b6040516001600160a01b0390911681526020015b60405180910390f35b6004546100b8906001600160a01b031681565b6100f160035481565b6040519081526020016100cc565b6100a661020a565b6100f160025481565b6100a661031b565b6100a661012636600461058b565b610482565b6100f160015481565b3361013d6101fb565b6001600160a01b03161461016c5760405162461bcd60e51b8152600401610163906105bb565b60405180910390fd5b600154156101bb5760405162461bcd60e51b815260206004820152601c60248201527b50726f76656e616e6365204861736820416c7265616479205365742160201b6044820152606401610163565b600155565b336101c96101fb565b6001600160a01b0316146101ef5760405162461bcd60e51b8152600401610163906105bb565b6101f96000610522565b565b6000546001600160a01b031690565b6002541561025a5760405162461bcd60e51b815260206004820152601e60248201527f7374617274696e67496e646578426c6f636b20616c72656479207365742100006044820152606401610163565b6004805460408051633c8c8bf160e21b815290516001600160a01b0390921692839263f2322fc49280830192602092918290030181865afa1580156102a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c791906105f0565b156103145760405162461bcd60e51b815260206004820152601e60248201527f7a656e20626c6f636b206d696e74696e67206861736e277420656e64656400006044820152606401610163565b5043600255565b60025460000361036b5760405162461bcd60e51b815260206004820152601b60248201527a7374617274696e67496e646578426c6f636b206e6f74207365742160281b6044820152606401610163565b600354156103b85760405162461bcd60e51b815260206004820152601a6024820152797374617274696e67496e64657820616c7265616479207365742160301b6044820152606401610163565b600480546040805163d5abeb0160e01b815290516001600160a01b0390921692600092849263d5abeb0192818101926020929091908290030181865afa158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a91906105f0565b60025490915080409060ff90610440904361061f565b11156104555761045160014361061f565b4090505b61045f8282610636565b600381905560000361047d57600354610479906001610658565b6003555b505050565b3361048b6101fb565b6001600160a01b0316146104b15760405162461bcd60e51b8152600401610163906105bb565b6001600160a01b0381166105165760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610163565b61051f81610522565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561058457600080fd5b5035919050565b60006020828403121561059d57600080fd5b81356001600160a01b03811681146105b457600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561060257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561063157610631610609565b500390565b60008261065357634e487b7160e01b600052601260045260246000fd5b500690565b6000821982111561066b5761066b610609565b50019056fea264697066735822122015778b745c4ab1bfcc7121a210bece3338aa5da6bd3489c20347e01458d7683b64736f6c634300080d0033

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

000000000000000000000000825b8d4e1432ccbc5ab2bc24c9e65f0434dcaf37

-----Decoded View---------------
Arg [0] : _dataBlocksContract (address): 0x825b8d4e1432CCbC5AB2bC24C9E65F0434dCaF37

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000825b8d4e1432ccbc5ab2bc24c9e65f0434dcaf37


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