Contract 0x328e89be1ca9e6b33fad9502d7341a6438c58ab2 1

Contract Overview

Balance:
0 MATIC
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x7ce9fd98fdfb857178842751042b5c5ceefda4c50c2d9bd484a104ab438d2a43Store361270992023-05-27 23:52:3628 secs ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x3a43e5ec4c1f0782f35051ff3661b3fb20d364b5e84086dee38ab91456485ccfStore361270982023-05-27 23:52:3430 secs ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0xd5935a7fc5b1fa0162d768da493f85f05a2155d5642798ee3d2b8573a02e3454Store361270862023-05-27 23:52:0856 secs ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x1c053f6db6665183daf203dcc9d3f19a1503b572f3d721ecab20ffc22614e5d8Store361270852023-05-27 23:52:0658 secs ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x34f3999bb0fc588236f40cec00f36f8356ffa407a35e1b6658c154437b6c4953Store361270842023-05-27 23:52:041 min ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0xbfbfbb85fe131dcbc2d3f6244fce480923ce21f9df17d90fc8376a0eab882f5eStore361270752023-05-27 23:51:461 min ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x0f7fac5d1bc2abb0cc7e8247302b892d54cefb42ab13bb2148872b358296f307Store361270752023-05-27 23:51:461 min ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0xa47c263ab3a6d96fafbccc370ef444e815797d0b95bf29e0d449be2cccb16692Store361270752023-05-27 23:51:461 min ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x075d9d554c349264fd793d351d3d014912e86d7072c922b2b1d4cfe45cf3d901Store361270732023-05-27 23:51:421 min ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x83c4018fa37f46dccfcaf8dafa788d10322348df6e9cfe07d860f724e831edcbStore361270732023-05-27 23:51:421 min ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x77877cdf6c110db52be05a26970a54e76cfcaf312eb437e0085b0adbcd719042Store361270562023-05-27 23:51:061 min ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.000102812422.352525463
0x5f9d485b2ba209cd38d21ef015d17438fe04d588653e480dbc87629648730df5Store361270292023-05-27 23:50:082 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0001028124192.352525445
0xa9589b5af2cf32db855d1d395f5ea97b688f5ff50f934309c8a2be360b99d17aStore361270282023-05-27 23:50:062 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000939322942.149332882
0x860f3632b77d2f51c41bf2705986fd85ca0a8638216cdf7e56aecbb07f8324a4Store361270272023-05-27 23:50:043 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000939322942.149332882
0xe7697dd1b0f3f0ea22545725620d7c6581803a69ba86d5b409d70c67c47ba5d7Store361270142023-05-27 23:49:363 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000934658362.138659512
0xcd4eb6cac51cc794a30d48b64a25396f9a239a6df2e5eb4b7654dec45b7b6371Store361270142023-05-27 23:49:363 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000934658362.138659512
0xa0b9f2e5c3cf156b52a923371ffc2567ee37a581fd8f8c8d7647653d59df445cStore361270132023-05-27 23:49:343 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000934658362.138659512
0xcb9f270f8edbc27bdf6bb86e25095fa6f387c00821a0795fc45492b696182bbfStore361270122023-05-27 23:49:323 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.00096752583622.138659512
0x9929e818d98bef1d5a68e4f53a4292a0509bf0ddbac44fbe36c64c5b8f6376c4Store361270062023-05-27 23:49:183 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000934658362.138659512
0x9684e19ad3e99620e3d65f8012ec67befddc03c4538f2a81e7d1563312df7b34Store361270022023-05-27 23:49:103 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000935506422.140600016
0x10092ecc20b1b6118147589156331176c58583a61de0c268036dbd6b887291bbStore361270022023-05-27 23:49:103 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000935506422.140600016
0x68ab4a1c1293acfdbe410c456fd146bafd1e3e28f0eaab16cb0c14e8c41daaf9Store361270002023-05-27 23:49:063 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000935506422.140600016
0x565bb1f632837f0d6a79bf04e543dd5915332076e703fcc994d3b34252ddeb55Store361269922023-05-27 23:48:504 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000934658362.138659512
0x445f78c500526ebb773ef8989e6544da74e230929767803ed055d4e5ea06936bStore361269922023-05-27 23:48:504 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000934658362.138659512
0x4804cceca7105f4dbe90aed2c378d29aece4ab54f60bd07c6ec43e69536c094fStore361269902023-05-27 23:48:444 mins ago0xfcac0f9ad36f8bc8460d5615ef1e57a3a10a37fa IN  0x328e89be1ca9e6b33fad9502d7341a6438c58ab20 MATIC0.0000934658362.138659512
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BlockhashStore

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at polygonscan.com on 2022-01-21
*/

// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;

/**
 * @title BlockhashStore
 * @notice This contract provides a way to access blockhashes older than
 *   the 256 block limit imposed by the BLOCKHASH opcode.
 *   You may assume that any blockhash stored by the contract is correct.
 *   Note that the contract depends on the format of serialized Ethereum
 *   blocks. If a future hardfork of Ethereum changes that format, the 
 *   logic in this contract may become incorrect and an updated version 
 *   would have to be deployed.
 */
contract BlockhashStore {

  mapping(uint => bytes32) internal s_blockhashes;

  /**
   * @notice stores blockhash of a given block, assuming it is available through BLOCKHASH
   * @param n the number of the block whose blockhash should be stored
   */
  function store(uint256 n) public {
    bytes32 h = blockhash(n);
    require(h != 0x0, "blockhash(n) failed");
    s_blockhashes[n] = h;
  }


  /**
   * @notice stores blockhash of the earliest block still available through BLOCKHASH.
   */
  function storeEarliest() external {
    store(block.number - 256);
  }

  /**
   * @notice stores blockhash after verifying blockheader of child/subsequent block
   * @param n the number of the block whose blockhash should be stored
   * @param header the rlp-encoded blockheader of block n+1. We verify its correctness by checking
   *   that it hashes to a stored blockhash, and then extract parentHash to get the n-th blockhash.
   */
  function storeVerifyHeader(uint256 n, bytes memory header) public {
    require(keccak256(header) == s_blockhashes[n + 1], "header has unknown blockhash");

    // At this point, we know that header is the correct blockheader for block n+1.

    // The header is an rlp-encoded list. The head item of that list is the 32-byte blockhash of the parent block.
    // Based on how rlp works, we know that blockheaders always have the following form:
    // 0xf9____a0PARENTHASH...
    //   ^ ^   ^
    //   | |   |
    //   | |   +--- PARENTHASH is 32 bytes. rlpenc(PARENTHASH) is 0xa || PARENTHASH.
    //   | |
    //   | +--- 2 bytes containing the sum of the lengths of the encoded list items
    //   |
    //   +--- 0xf9 because we have a list and (sum of lengths of encoded list items) fits exactly into two bytes.
    //
    // As a consequence, the PARENTHASH is always at offset 4 of the rlp-encoded block header.

    bytes32 parentHash;
    assembly {
      parentHash := mload(add(header, 36)) // 36 = 32 byte offset for length prefix of ABI-encoded array
                                           //    +  4 byte offset of PARENTHASH (see above)
    }

    s_blockhashes[n] = parentHash;
  }

  /**
   * @notice gets a blockhash from the store. If no hash is known, this function reverts.
   * @param n the number of the block whose blockhash should be returned
   */
  function getBlockhash(uint256 n) external view returns (bytes32) {
    bytes32 h = s_blockhashes[n];
    require(h != 0x0, "blockhash not found in store");
    return h;
  }
}

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"getBlockhash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"store","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storeEarliest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"},{"internalType":"bytes","name":"header","type":"bytes"}],"name":"storeVerifyHeader","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506103bf806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80636057361d1461005157806383b6d6b71461007f578063e9413d3814610089578063fadff0e1146100cb575b600080fd5b61007d6004803603602081101561006757600080fd5b8101908080359060200190929190505050610190565b005b61008761022a565b005b6100b56004803603602081101561009f57600080fd5b8101908080359060200190929190505050610239565b6040518082815260200191505060405180910390f35b61018e600480360360408110156100e157600080fd5b81019080803590602001909291908035906020019064010000000081111561010857600080fd5b82018360208201111561011a57600080fd5b8035906020019184600183028401116401000000008311171561013c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506102d3565b005b6000814090506000801b81141561020f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f626c6f636b68617368286e29206661696c65640000000000000000000000000081525060200191505060405180910390fd5b80600080848152602001908152602001600020819055505050565b6102376101004303610190565b565b6000806000808481526020019081526020016000205490506000801b8114156102ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f626c6f636b68617368206e6f7420666f756e6420696e2073746f72650000000081525060200191505060405180910390fd5b80915050919050565b60008060018401815260200190815260200160002054818051906020012014610364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f6865616465722068617320756e6b6e6f776e20626c6f636b686173680000000081525060200191505060405180910390fd5b600060248201519050806000808581526020019081526020016000208190555050505056fea2646970667358221220c419b68bf6aa54294c9e4f07d7d523dcd3d47e82fdd0d7a42b95e9eb986b346564736f6c63430006060033

Deployed ByteCode Sourcemap

557:2559:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;557:2559:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;820:144:0;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;820:144:0;;;;;;;;;;;;;;;;;:::i;:::-;;1074:72;;;:::i;:::-;;2936:177;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;2936:177:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1524:1227;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;1524:1227:0;;;;;;;;;;;;;;;;;;;27:11:-1;14;11:28;8:2;;;52:1;49;42:12;8:2;1524:1227:0;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;1524:1227:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1524:1227:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1524:1227:0;;;;;;;;;;;;;;;:::i;:::-;;820:144;860:9;882:1;872:12;860:24;;904:3;899:8;;:1;:8;;891:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;957:1;938:13;:16;952:1;938:16;;;;;;;;;;;:20;;;;820:144;;:::o;1074:72::-;1115:25;1136:3;1121:12;:18;1115:5;:25::i;:::-;1074:72::o;2936:177::-;2992:7;3008:9;3020:13;:16;3034:1;3020:16;;;;;;;;;;;;3008:28;;3056:3;3051:8;;:1;:8;;3043:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3106:1;3099:8;;;2936:177;;;:::o;1524:1227::-;1626:13;:20;1644:1;1640;:5;1626:20;;;;;;;;;;;;1615:6;1605:17;;;;;;:41;1597:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2467:18;2542:2;2534:6;2530:15;2524:22;2510:36;;2735:10;2716:13;:16;2730:1;2716:16;;;;;;;;;;;:29;;;;1524:1227;;;:::o

Swarm Source

ipfs://c419b68bf6aa54294c9e4f07d7d523dcd3d47e82fdd0d7a42b95e9eb986b3465
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading