ETH Price: $2,934.39 (+0.46%)
Gas: 29 Gwei

Contract

0x7E59780463e9fd543E725902f81BC4a51b1634eC
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

TokenTracker

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Verify176665992023-07-10 23:44:47225 days 7 hrs ago1689032687IN
0x7E5978...1b1634eC
0 ETH0.000637815.12028426
0x60806040176426442023-07-07 14:53:35228 days 16 hrs ago1688741615IN
 Create: PingPong
0 ETH0.0217235154.94533314

Latest 1 internal transaction

Advanced mode:
Parent Txn Hash Block From To Value
176426442023-07-07 14:53:35228 days 16 hrs ago1688741615
0x7E5978...1b1634eC
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PingPong

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 1 : PingPong.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface IStarknetCore {
    function consumeMessageFromL2(uint256, uint256[] calldata)
        external
        returns (bytes32);
}

// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong
// ping pong ping pong ping pong ping pong ping pong ping pong ping pong ping pong

/// @title PingPong
/// @author exp.table
contract PingPong {

    IStarknetCore constant starknetCore = IStarknetCore(0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4);
    uint256 constant pong = 0x012d8ab4947254afb512883d7d768d17436c9057a1ae21e53389603266c397f7;
    address a;

    constructor(bytes memory bytecode) {
        assembly {
            sstore(a.slot, create(0, add(bytecode, 0x20), mload(bytecode)))
        }
    }
    
    function name() external pure returns (string memory) {
        return "Ping Pong";
    }

    function generate(address _seed) external view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(_seed, block.number)));
    }

    function verify(uint256 _start, uint256 _solution) external returns (bool success) {
        uint256[] memory payload = new uint256[](3);
        payload[0] = _start >> 128;
        payload[1] = _start & 340282366920938463463374607431768211455;
        payload[2] = _solution;

        starknetCore.consumeMessageFromL2(pong, payload);

        (, bytes memory result) = a.call(abi.encode(_solution));
        success = abi.decode(result, (bool));
    }

    function gist() external pure returns (string memory) {
        return "9761e3575eb6439a1fab1d834ddc18aa";
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "foundry-huff/=lib/foundry-huff/src/",
    "solidity-stringutils/=lib/foundry-huff/lib/solidity-stringutils/",
    "solmate/=lib/solmate/src/",
    "stringutils/=lib/foundry-huff/lib/solidity-stringutils/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "metadata": {
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes","name":"bytecode","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_seed","type":"address"}],"name":"generate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gist","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_solution","type":"uint256"}],"name":"verify","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161064038038061064083398101604081905261002f91610057565b8051602082016000f060005550610120565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561006a57600080fd5b82516001600160401b038082111561008157600080fd5b818501915085601f83011261009557600080fd5b8151818111156100a7576100a7610041565b604051601f8201601f19908116603f011681019083821181831017156100cf576100cf610041565b8160405282815288868487010111156100e757600080fd5b600093505b8284101561010957848401860151818501870152928501926100ec565b600086848301015280965050505050505092915050565b6105118061012f6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806306fdde03146100515780632fa61cd81461009c57806341161b10146100fe578063d4570efd14610121575b600080fd5b60408051808201909152600981527f50696e6720506f6e67000000000000000000000000000000000000000000000060208201525b6040516100939190610375565b60405180910390f35b6100f06100aa3660046103a8565b6040516bffffffffffffffffffffffff19606083901b16602082015243603482015260009060540160408051601f19818403018152919052805160209091012092915050565b604051908152602001610093565b61011161010c3660046103e5565b61015a565b6040519015158152602001610093565b6040805180820190915260208082527f393736316533353735656236343339613166616231643833346464633138616190820152610086565b6040805160038082526080820190925260009182919060208201606080368337019050509050608084901c8160008151811061019857610198610407565b602002602001018181525050836fffffffffffffffffffffffffffffffff16816001815181106101ca576101ca610407565b60200260200101818152505082816002815181106101ea576101ea610407565b60209081029190910101526040517f2c9dd5c000000000000000000000000000000000000000000000000000000000815273c662c410c0ecf747543f5ba90660f6abebd9c8c490632c9dd5c090610267907f012d8ab4947254afb512883d7d768d17436c9057a1ae21e53389603266c397f7908590600401610436565b6020604051808303816000875af1158015610286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102aa9190610484565b5060008054604080516020810187905273ffffffffffffffffffffffffffffffffffffffff909216910160408051601f19818403018152908290526102ee9161049d565b6000604051808303816000865af19150503d806000811461032b576040519150601f19603f3d011682016040523d82523d6000602084013e610330565b606091505b509150508080602001905181019061034891906104b9565b95945050505050565b60005b8381101561036c578181015183820152602001610354565b50506000910152565b6020815260008251806020840152610394816040850160208701610351565b601f01601f19169190910160400192915050565b6000602082840312156103ba57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146103de57600080fd5b9392505050565b600080604083850312156103f857600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156104775784518352938301939183019160010161045b565b5090979650505050505050565b60006020828403121561049657600080fd5b5051919050565b600082516104af818460208701610351565b9190910192915050565b6000602082840312156104cb57600080fd5b815180151581146103de57600080fdfea2646970667358221220a67b4ee6c7aa58e491e52cb94b2a5fa2e3a697fd056e9b2d8b002ca56ae23abb64736f6c634300081400330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a60118060093d393df360003560f01c60ac1460005260206000f3000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806306fdde03146100515780632fa61cd81461009c57806341161b10146100fe578063d4570efd14610121575b600080fd5b60408051808201909152600981527f50696e6720506f6e67000000000000000000000000000000000000000000000060208201525b6040516100939190610375565b60405180910390f35b6100f06100aa3660046103a8565b6040516bffffffffffffffffffffffff19606083901b16602082015243603482015260009060540160408051601f19818403018152919052805160209091012092915050565b604051908152602001610093565b61011161010c3660046103e5565b61015a565b6040519015158152602001610093565b6040805180820190915260208082527f393736316533353735656236343339613166616231643833346464633138616190820152610086565b6040805160038082526080820190925260009182919060208201606080368337019050509050608084901c8160008151811061019857610198610407565b602002602001018181525050836fffffffffffffffffffffffffffffffff16816001815181106101ca576101ca610407565b60200260200101818152505082816002815181106101ea576101ea610407565b60209081029190910101526040517f2c9dd5c000000000000000000000000000000000000000000000000000000000815273c662c410c0ecf747543f5ba90660f6abebd9c8c490632c9dd5c090610267907f012d8ab4947254afb512883d7d768d17436c9057a1ae21e53389603266c397f7908590600401610436565b6020604051808303816000875af1158015610286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102aa9190610484565b5060008054604080516020810187905273ffffffffffffffffffffffffffffffffffffffff909216910160408051601f19818403018152908290526102ee9161049d565b6000604051808303816000865af19150503d806000811461032b576040519150601f19603f3d011682016040523d82523d6000602084013e610330565b606091505b509150508080602001905181019061034891906104b9565b95945050505050565b60005b8381101561036c578181015183820152602001610354565b50506000910152565b6020815260008251806020840152610394816040850160208701610351565b601f01601f19169190910160400192915050565b6000602082840312156103ba57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146103de57600080fd5b9392505050565b600080604083850312156103f857600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156104775784518352938301939183019160010161045b565b5090979650505050505050565b60006020828403121561049657600080fd5b5051919050565b600082516104af818460208701610351565b9190910192915050565b6000602082840312156104cb57600080fd5b815180151581146103de57600080fdfea2646970667358221220a67b4ee6c7aa58e491e52cb94b2a5fa2e3a697fd056e9b2d8b002ca56ae23abb64736f6c63430008140033

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

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a60118060093d393df360003560f01c60ac1460005260206000f3000000000000

-----Decoded View---------------
Arg [0] : bytecode (bytes): 0x60118060093d393df360003560f01c60ac1460005260206000f3

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 000000000000000000000000000000000000000000000000000000000000001a
Arg [2] : 60118060093d393df360003560f01c60ac1460005260206000f3000000000000


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

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.