APE Price: $1.17 (+7.59%)

Contract

0x88C1f4EcDe714Fba062853dA1f686171f560ebAA

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo10 APE

APE Value

$11.70 (@ $1.17/APE)
Transaction Hash
Method
Block
From
To
Transfer48861042024-11-21 14:19:163 hrs ago1732198756IN
0x88C1f4Ec...1f560ebAA
10 APE0.0011546825.42069
Transfer48569282024-11-21 7:16:5610 hrs ago1732173416IN
0x88C1f4Ec...1f560ebAA
1 APE0.0033006925.42069
Transfer48551942024-11-21 6:50:4210 hrs ago1732171842IN
0x88C1f4Ec...1f560ebAA
1 APE0.0011501325.42069
Transfer48429372024-11-21 3:36:0014 hrs ago1732160160IN
0x88C1f4Ec...1f560ebAA
10 APE0.0033052425.42069
Transfer48400792024-11-21 2:51:5314 hrs ago1732157513IN
0x88C1f4Ec...1f560ebAA
10 APE0.0011546825.42069
Transfer47940492024-11-20 17:56:4823 hrs ago1732125408IN
0x88C1f4Ec...1f560ebAA
1 APE0.0033006925.42069
Transfer47905642024-11-20 17:28:5724 hrs ago1732123737IN
0x88C1f4Ec...1f560ebAA
1 APE0.0011501325.42069
Transfer47723612024-11-20 14:34:4527 hrs ago1732113285IN
0x88C1f4Ec...1f560ebAA
100 APE0.0033097925.42069
Transfer47681032024-11-20 14:01:4427 hrs ago1732111304IN
0x88C1f4Ec...1f560ebAA
100 APE0.0011592325.42069
Transfer47614082024-11-20 12:17:2029 hrs ago1732105040IN
0x88C1f4Ec...1f560ebAA
100 APE0.0033097925.42069
Transfer47606652024-11-20 12:05:1629 hrs ago1732104316IN
0x88C1f4Ec...1f560ebAA
10 APE0.0033052225.42069
Transfer47606532024-11-20 12:05:1129 hrs ago1732104311IN
0x88C1f4Ec...1f560ebAA
100 APE0.0011592325.42069
Transfer47369622024-11-20 4:46:1736 hrs ago1732077977IN
0x88C1f4Ec...1f560ebAA
10 APE0.0011546825.42069
Transfer47359062024-11-20 4:25:0837 hrs ago1732076708IN
0x88C1f4Ec...1f560ebAA
100 APE0.0033097925.42069
Transfer47341522024-11-20 3:54:0537 hrs ago1732074845IN
0x88C1f4Ec...1f560ebAA
100 APE0.0011592325.42069
Transfer47341342024-11-20 3:53:4137 hrs ago1732074821IN
0x88C1f4Ec...1f560ebAA
10 APE0.0033052225.42069
Transfer47324822024-11-20 3:21:2238 hrs ago1732072882IN
0x88C1f4Ec...1f560ebAA
1 APE0.0033006725.42069
Transfer47308452024-11-20 2:51:1138 hrs ago1732071071IN
0x88C1f4Ec...1f560ebAA
1 APE0.0011501525.42069
Transfer47306622024-11-20 2:46:4738 hrs ago1732070807IN
0x88C1f4Ec...1f560ebAA
10 APE0.0011546825.42069
Transfer47306422024-11-20 2:46:2638 hrs ago1732070786IN
0x88C1f4Ec...1f560ebAA
1 APE0.0033006725.42069
Transfer47301592024-11-20 2:37:4939 hrs ago1732070269IN
0x88C1f4Ec...1f560ebAA
1 APE0.0011501525.42069
Transfer47301342024-11-20 2:37:2539 hrs ago1732070245IN
0x88C1f4Ec...1f560ebAA
1 APE0.0033006925.42069
Transfer47240742024-11-20 0:54:2640 hrs ago1732064066IN
0x88C1f4Ec...1f560ebAA
1 APE0.0011501525.42069
Transfer47030412024-11-19 20:07:1045 hrs ago1732046830IN
0x88C1f4Ec...1f560ebAA
1 APE0.0033006725.42069
Transfer46967232024-11-19 19:11:0246 hrs ago1732043462IN
0x88C1f4Ec...1f560ebAA
1 APE0.0011501525.42069
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
48569342024-11-21 7:17:0010 hrs ago1732173420
0x88C1f4Ec...1f560ebAA
1.9816971 APE
48569282024-11-21 7:16:5610 hrs ago1732173416
0x88C1f4Ec...1f560ebAA
0.01830289 APE
48429422024-11-21 3:36:0314 hrs ago1732160163
0x88C1f4Ec...1f560ebAA
19.97544666 APE
48429372024-11-21 3:36:0014 hrs ago1732160160
0x88C1f4Ec...1f560ebAA
0.02455333 APE
47940562024-11-20 17:56:5023 hrs ago1732125410
0x88C1f4Ec...1f560ebAA
1.9816971 APE
47940492024-11-20 17:56:4823 hrs ago1732125408
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47723642024-11-20 14:34:4627 hrs ago1732113286
0x88C1f4Ec...1f560ebAA
199.9816971 APE
47723612024-11-20 14:34:4527 hrs ago1732113285
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47614132024-11-20 12:17:2329 hrs ago1732105043
0x88C1f4Ec...1f560ebAA
199.9816971 APE
47614082024-11-20 12:17:2029 hrs ago1732105040
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47606682024-11-20 12:05:1829 hrs ago1732104318
0x88C1f4Ec...1f560ebAA
19.9816971 APE
47606652024-11-20 12:05:1629 hrs ago1732104316
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47359082024-11-20 4:25:0937 hrs ago1732076709
0x88C1f4Ec...1f560ebAA
199.9816971 APE
47359062024-11-20 4:25:0837 hrs ago1732076708
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47341362024-11-20 3:53:4337 hrs ago1732074823
0x88C1f4Ec...1f560ebAA
19.9816971 APE
47341342024-11-20 3:53:4137 hrs ago1732074821
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47324842024-11-20 3:21:2338 hrs ago1732072883
0x88C1f4Ec...1f560ebAA
1.9816971 APE
47324822024-11-20 3:21:2238 hrs ago1732072882
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47306452024-11-20 2:46:2938 hrs ago1732070789
0x88C1f4Ec...1f560ebAA
1.9816971 APE
47306422024-11-20 2:46:2638 hrs ago1732070786
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47301372024-11-20 2:37:3039 hrs ago1732070250
0x88C1f4Ec...1f560ebAA
1.9816971 APE
47301342024-11-20 2:37:2539 hrs ago1732070245
0x88C1f4Ec...1f560ebAA
0.01830289 APE
47030442024-11-19 20:07:1145 hrs ago1732046831
0x88C1f4Ec...1f560ebAA
1.9816971 APE
47030412024-11-19 20:07:1045 hrs ago1732046830
0x88C1f4Ec...1f560ebAA
0.01830289 APE
46892472024-11-19 18:13:4047 hrs ago1732040020
0x88C1f4Ec...1f560ebAA
1.9816971 APE
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
HeadToHead

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, Unlicense license
File 1 of 5 : HeadToHead.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.28;

import {IEntropy} from "@pythnetwork/entropy-sdk-solidity/IEntropy.sol";
import {IEntropyConsumer} from "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol";

struct MatchedBet {
    address player1;
    uint96 requestFee;
    address player2;
    uint96 amount;
}

contract HeadToHead is IEntropyConsumer {
    error InvalidAmount();
    error NoMatchAvailable();
    error TransferFailed();

    IEntropy public constant entropy = IEntropy(0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320);
    address public constant provider = 0x52DeaA1c84233F7bb8C8A45baeDE41091c616506;

    // Maps bet amounts to pending players waiting for matches
    mapping(uint256 => address) public pendingBets;
    mapping(uint256 => MatchedBet) public matchedBets;

    event BetPlaced(address indexed player, uint256 amount);
    event BetMatched(address indexed player1, address indexed player2, uint256 amount);
    event BetResolved(address indexed winner, address indexed loser, uint256 amount);
    event BetCancelled(address indexed player, uint256 amount);

    // Automatically place bet when receiving ETH
    receive() external payable {
        _placeBet();
    }

    function entropyCallback(
        uint64 sequenceNumber,
        address,
        bytes32 randomNumber
    ) internal override {
        MatchedBet memory bet = matchedBets[sequenceNumber];

        address player1 = bet.player1;
        address player2 = bet.player2;
        uint256 requestFee = uint256(bet.requestFee);
        uint256 betAmount = uint256(bet.amount);

        // Determine winner
        address winner = uint256(randomNumber) % 2 == 0 ? player1 : player2;
        address loser = winner == player1 ? player2 : player1;

        // transfer to winner
        (bool success,) = winner.call{value: betAmount * 2 - requestFee}("");
        if (!success) revert TransferFailed();

        emit BetResolved(winner, loser, betAmount);
    }

    function _placeBet() internal {
        // Validate bet amount is a power of 10 ether
        if (msg.value == 0 || !_isPowerOfTen(msg.value)) revert InvalidAmount();

        address opponent = pendingBets[msg.value];

        if (opponent == address(0)) {
            // No match available, store as pending
            pendingBets[msg.value] = msg.sender;
            emit BetPlaced(msg.sender, msg.value);
        } else {
            // Match found! Remove pending bet and play
            pendingBets[msg.value] = address(0);
            _playGame(opponent);
        }
    }

    function _playGame(address opponent) internal {
        bytes32 pseudoRandomNumber = keccak256(abi.encodePacked(block.timestamp, block.number, msg.sender));

        // get the required fee
        uint128 requestFee = entropy.getFee(provider);

        // pay the fees and request a random number from entropy
        uint64 sequenceNumber = entropy.requestWithCallback{ value: requestFee }(
            provider,
            pseudoRandomNumber
        );

        matchedBets[sequenceNumber] = MatchedBet(msg.sender, uint96(requestFee), opponent, uint96(msg.value));

        emit BetMatched(msg.sender, opponent, msg.value);
    }

    function cancelBet(uint256 amount) external {
        if (pendingBets[amount] != msg.sender) revert NoMatchAvailable();

        pendingBets[amount] = address(0);
        (bool success,) = msg.sender.call{value: amount}("");
        if (!success) revert TransferFailed();

        emit BetCancelled(msg.sender, amount);
    }

    // This method is required by the IEntropyConsumer interface
    function getEntropy() internal view override returns (address) {
        return address(entropy);
    }

    // Helper function to check if amount is a power of 10 ether
    function _isPowerOfTen(uint256 amount) internal pure returns (bool) {
        // First check if it's in whole ether (no wei fractions)
        if (amount % 1 ether != 0) return false;

        // Convert to ether units for power of 10 check
        uint256 etherAmount = amount / 1 ether;

        // Add safety check for maximum reasonable bet
        if (etherAmount > 1e9) return false; // Max 1 billion APE

        // If not 1, keep dividing by 10 and check remainder
        while (etherAmount > 1) {
            if (etherAmount % 10 != 0) return false;
            etherAmount = etherAmount / 10;
        }

        return etherAmount == 1;
    }
}

File 2 of 5 : IEntropy.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;

import "./EntropyEvents.sol";

interface IEntropy is EntropyEvents {
    // Register msg.sender as a randomness provider. The arguments are the provider's configuration parameters
    // and initial commitment. Re-registering the same provider rotates the provider's commitment (and updates
    // the feeInWei).
    //
    // chainLength is the number of values in the hash chain *including* the commitment, that is, chainLength >= 1.
    function register(
        uint128 feeInWei,
        bytes32 commitment,
        bytes calldata commitmentMetadata,
        uint64 chainLength,
        bytes calldata uri
    ) external;

    // Withdraw a portion of the accumulated fees for the provider msg.sender.
    // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient
    // balance of fees in the contract).
    function withdraw(uint128 amount) external;

    // Withdraw a portion of the accumulated fees for provider. The msg.sender must be the fee manager for this provider.
    // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient
    // balance of fees in the contract).
    function withdrawAsFeeManager(address provider, uint128 amount) external;

    // As a user, request a random number from `provider`. Prior to calling this method, the user should
    // generate a random number x and keep it secret. The user should then compute hash(x) and pass that
    // as the userCommitment argument. (You may call the constructUserCommitment method to compute the hash.)
    //
    // This method returns a sequence number. The user should pass this sequence number to
    // their chosen provider (the exact method for doing so will depend on the provider) to retrieve the provider's
    // number. The user should then call fulfillRequest to construct the final random number.
    //
    // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value.
    // Note that excess value is *not* refunded to the caller.
    function request(
        address provider,
        bytes32 userCommitment,
        bool useBlockHash
    ) external payable returns (uint64 assignedSequenceNumber);

    // Request a random number. The method expects the provider address and a secret random number
    // in the arguments. It returns a sequence number.
    //
    // The address calling this function should be a contract that inherits from the IEntropyConsumer interface.
    // The `entropyCallback` method on that interface will receive a callback with the generated random number.
    //
    // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value.
    // Note that excess value is *not* refunded to the caller.
    function requestWithCallback(
        address provider,
        bytes32 userRandomNumber
    ) external payable returns (uint64 assignedSequenceNumber);

    // Fulfill a request for a random number. This method validates the provided userRandomness and provider's proof
    // against the corresponding commitments in the in-flight request. If both values are validated, this function returns
    // the corresponding random number.
    //
    // Note that this function can only be called once per in-flight request. Calling this function deletes the stored
    // request information (so that the contract doesn't use a linear amount of storage in the number of requests).
    // If you need to use the returned random number more than once, you are responsible for storing it.
    function reveal(
        address provider,
        uint64 sequenceNumber,
        bytes32 userRevelation,
        bytes32 providerRevelation
    ) external returns (bytes32 randomNumber);

    // Fulfill a request for a random number. This method validates the provided userRandomness
    // and provider's revelation against the corresponding commitment in the in-flight request. If both values are validated
    // and the requestor address is a contract address, this function calls the requester's entropyCallback method with the
    // sequence number, provider address and the random number as arguments. Else if the requestor is an EOA, it won't call it.
    //
    // Note that this function can only be called once per in-flight request. Calling this function deletes the stored
    // request information (so that the contract doesn't use a linear amount of storage in the number of requests).
    // If you need to use the returned random number more than once, you are responsible for storing it.
    //
    // Anyone can call this method to fulfill a request, but the callback will only be made to the original requester.
    function revealWithCallback(
        address provider,
        uint64 sequenceNumber,
        bytes32 userRandomNumber,
        bytes32 providerRevelation
    ) external;

    function getProviderInfo(
        address provider
    ) external view returns (EntropyStructs.ProviderInfo memory info);

    function getDefaultProvider() external view returns (address provider);

    function getRequest(
        address provider,
        uint64 sequenceNumber
    ) external view returns (EntropyStructs.Request memory req);

    function getFee(address provider) external view returns (uint128 feeAmount);

    function getAccruedPythFees()
        external
        view
        returns (uint128 accruedPythFeesInWei);

    function setProviderFee(uint128 newFeeInWei) external;

    function setProviderFeeAsFeeManager(
        address provider,
        uint128 newFeeInWei
    ) external;

    function setProviderUri(bytes calldata newUri) external;

    // Set manager as the fee manager for the provider msg.sender.
    // After calling this function, manager will be able to set the provider's fees and withdraw them.
    // Only one address can be the fee manager for a provider at a time -- calling this function again with a new value
    // will override the previous value. Call this function with the all-zero address to disable the fee manager role.
    function setFeeManager(address manager) external;

    function constructUserCommitment(
        bytes32 userRandomness
    ) external pure returns (bytes32 userCommitment);

    function combineRandomValues(
        bytes32 userRandomness,
        bytes32 providerRandomness,
        bytes32 blockHash
    ) external pure returns (bytes32 combinedRandomness);
}

File 3 of 5 : IEntropyConsumer.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;

abstract contract IEntropyConsumer {
    // This method is called by Entropy to provide the random number to the consumer.
    // It asserts that the msg.sender is the Entropy contract. It is not meant to be
    // override by the consumer.
    function _entropyCallback(
        uint64 sequence,
        address provider,
        bytes32 randomNumber
    ) external {
        address entropy = getEntropy();
        require(entropy != address(0), "Entropy address not set");
        require(msg.sender == entropy, "Only Entropy can call this function");

        entropyCallback(sequence, provider, randomNumber);
    }

    // getEntropy returns Entropy contract address. The method is being used to check that the
    // callback is indeed from Entropy contract. The consumer is expected to implement this method.
    // Entropy address can be found here - https://docs.pyth.network/entropy/contract-addresses
    function getEntropy() internal view virtual returns (address);

    // This method is expected to be implemented by the consumer to handle the random number.
    // It will be called by _entropyCallback after _entropyCallback ensures that the call is
    // indeed from Entropy contract.
    function entropyCallback(
        uint64 sequence,
        address provider,
        bytes32 randomNumber
    ) internal virtual;
}

File 4 of 5 : EntropyEvents.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "./EntropyStructs.sol";

interface EntropyEvents {
    event Registered(EntropyStructs.ProviderInfo provider);

    event Requested(EntropyStructs.Request request);
    event RequestedWithCallback(
        address indexed provider,
        address indexed requestor,
        uint64 indexed sequenceNumber,
        bytes32 userRandomNumber,
        EntropyStructs.Request request
    );

    event Revealed(
        EntropyStructs.Request request,
        bytes32 userRevelation,
        bytes32 providerRevelation,
        bytes32 blockHash,
        bytes32 randomNumber
    );
    event RevealedWithCallback(
        EntropyStructs.Request request,
        bytes32 userRandomNumber,
        bytes32 providerRevelation,
        bytes32 randomNumber
    );

    event ProviderFeeUpdated(address provider, uint128 oldFee, uint128 newFee);

    event ProviderUriUpdated(address provider, bytes oldUri, bytes newUri);

    event ProviderFeeManagerUpdated(
        address provider,
        address oldFeeManager,
        address newFeeManager
    );

    event Withdrawal(
        address provider,
        address recipient,
        uint128 withdrawnAmount
    );
}

File 5 of 5 : EntropyStructs.sol
// SPDX-License-Identifier: Apache 2

pragma solidity ^0.8.0;

contract EntropyStructs {
    struct ProviderInfo {
        uint128 feeInWei;
        uint128 accruedFeesInWei;
        // The commitment that the provider posted to the blockchain, and the sequence number
        // where they committed to this. This value is not advanced after the provider commits,
        // and instead is stored to help providers track where they are in the hash chain.
        bytes32 originalCommitment;
        uint64 originalCommitmentSequenceNumber;
        // Metadata for the current commitment. Providers may optionally use this field to help
        // manage rotations (i.e., to pick the sequence number from the correct hash chain).
        bytes commitmentMetadata;
        // Optional URI where clients can retrieve revelations for the provider.
        // Client SDKs can use this field to automatically determine how to retrieve random values for each provider.
        // TODO: specify the API that must be implemented at this URI
        bytes uri;
        // The first sequence number that is *not* included in the current commitment (i.e., an exclusive end index).
        // The contract maintains the invariant that sequenceNumber <= endSequenceNumber.
        // If sequenceNumber == endSequenceNumber, the provider must rotate their commitment to add additional random values.
        uint64 endSequenceNumber;
        // The sequence number that will be assigned to the next inbound user request.
        uint64 sequenceNumber;
        // The current commitment represents an index/value in the provider's hash chain.
        // These values are used to verify requests for future sequence numbers. Note that
        // currentCommitmentSequenceNumber < sequenceNumber.
        //
        // The currentCommitment advances forward through the provider's hash chain as values
        // are revealed on-chain.
        bytes32 currentCommitment;
        uint64 currentCommitmentSequenceNumber;
        // An address that is authorized to set / withdraw fees on behalf of this provider.
        address feeManager;
    }

    struct Request {
        // Storage slot 1 //
        address provider;
        uint64 sequenceNumber;
        // The number of hashes required to verify the provider revelation.
        uint32 numHashes;
        // Storage slot 2 //
        // The commitment is keccak256(userCommitment, providerCommitment). Storing the hash instead of both saves 20k gas by
        // eliminating 1 store.
        bytes32 commitment;
        // Storage slot 3 //
        // The number of the block where this request was created.
        // Note that we're using a uint64 such that we have an additional space for an address and other fields in
        // this storage slot. Although block.number returns a uint256, 64 bits should be plenty to index all of the
        // blocks ever generated.
        uint64 blockNumber;
        // The address that requested this random number.
        address requester;
        // If true, incorporate the blockhash of blockNumber into the generated random value.
        bool useBlockhash;
        // If true, the requester will be called back with the generated random value.
        bool isRequestWithCallback;
        // There are 2 remaining bytes of free space in this slot.
    }
}

Settings
{
  "remappings": [
    "@pythnetwork/entropy-sdk-solidity/=node_modules/@pythnetwork/entropy-sdk-solidity/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"NoMatchAvailable","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player1","type":"address"},{"indexed":true,"internalType":"address","name":"player2","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetMatched","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetPlaced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"loser","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetResolved","type":"event"},{"inputs":[{"internalType":"uint64","name":"sequence","type":"uint64"},{"internalType":"address","name":"provider","type":"address"},{"internalType":"bytes32","name":"randomNumber","type":"bytes32"}],"name":"_entropyCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"cancelBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"entropy","outputs":[{"internalType":"contract IEntropy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"matchedBets","outputs":[{"internalType":"address","name":"player1","type":"address"},{"internalType":"uint96","name":"requestFee","type":"uint96"},{"internalType":"address","name":"player2","type":"address"},{"internalType":"uint96","name":"amount","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pendingBets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provider","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052348015600f57600080fd5b50610a118061001f6000396000f3fe6080604052600436106100595760003560e01c806301abd6d71461006d578063085d4883146100c0578063357401f5146100e857806347ce07cc1461010857806352a5f1f814610130578063c65b4fb11461015057600080fd5b36610068576100666101e7565b005b600080fd5b34801561007957600080fd5b506100a361008836600461088e565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100cc57600080fd5b506100a37352deaa1c84233f7bb8c8a45baede41091c61650681565b3480156100f457600080fd5b5061006661010336600461088e565b6102b8565b34801561011457600080fd5b506100a37336825bf3fbdf5a29e2d5148bfe7dcf7b5639e32081565b34801561013c57600080fd5b5061006661014b3660046108bd565b6103a9565b34801561015c57600080fd5b506101ad61016b36600461088e565b600160208190526000918252604090912080549101546001600160a01b03808316926001600160601b03600160a01b9182900481169392831692919091041684565b604080516001600160a01b0395861681526001600160601b03948516602082015294909216918401919091521660608201526080016100b7565b3415806101fa57506101f834610441565b155b156102185760405163162908e360e11b815260040160405180910390fd5b346000908152602081905260409020546001600160a01b03168061028f57346000818152602081815260409182902080546001600160a01b03191633908117909155915192835290917f43e08d78302cdf9c94e1ffd293c2a3696139ee41cf3199b6f5eed9c7f6cc6090910160405180910390a250565b34600090815260208190526040902080546001600160a01b03191690556102b5816104ca565b50565b6000818152602081905260409020546001600160a01b031633146102ef576040516301ee2bad60e71b815260040160405180910390fd5b60008181526020819052604080822080546001600160a01b031916905551339083908381818185875af1925050503d8060008114610349576040519150601f19603f3d011682016040523d82523d6000602084013e61034e565b606091505b5050905080610370576040516312171d8360e31b815260040160405180910390fd5b60405182815233907f9e58f341ee6224856b97fa9bb85c38d5a631e05e8faf7bd5b756addcf00ac8439060200160405180910390a25050565b7336825bf3fbdf5a29e2d5148bfe7dcf7b5639e3206103cc565b60405180910390fd5b336001600160a01b038216146104305760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b60648201526084016103c3565b61043b848484610705565b50505050565b6000610455670de0b6b3a764000083610920565b1561046257506000919050565b6000610476670de0b6b3a76400008461094a565b9050633b9aca0081111561048d5750600092915050565b60018111156104c1576104a1600a82610920565b156104af5750600092915050565b6104ba600a8261094a565b905061048d565b60011492915050565b600042433360405160200161050493929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b60408051808303601f19018152908290528051602090910120631711922960e31b82527352deaa1c84233f7bb8c8a45baede41091c616506600483015291506000907336825bf3fbdf5a29e2d5148bfe7dcf7b5639e3209063b88c914890602401602060405180830381865afa158015610582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a6919061095e565b6040516319cb825f60e01b81527352deaa1c84233f7bb8c8a45baede41091c6165066004820152602481018490529091506000907336825bf3fbdf5a29e2d5148bfe7dcf7b5639e320906319cb825f906001600160801b0385169060440160206040518083038185885af1158015610622573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610647919061098e565b60408051608081018252338082526001600160601b0386811660208085019182526001600160a01b038b81168688018181523480871660608a0190815267ffffffffffffffff8c1660009081526001808852908c90209a519751978616600160a01b988a168902178b5592519051941693909616909402919091179590920194909455935190815293945091927f8f6aa89dd470c78d8e4fc3d277914983f5b2e18f31268b92bfac0f130e4760d3910160405180910390a350505050565b67ffffffffffffffff83166000908152600160208181526040808420815160808101835281546001600160a01b038082168084526001600160601b03600160a01b93849004811697850188905294909701549081169483018590520490911660608201819052909491929161077b600288610920565b156107865783610788565b845b90506000856001600160a01b0316826001600160a01b0316146107ab57856107ad565b845b905060006001600160a01b038316856107c78660026109ab565b6107d191906109c8565b604051600081818185875af1925050503d806000811461080d576040519150601f19603f3d011682016040523d82523d6000602084013e610812565b606091505b5050905080610834576040516312171d8360e31b815260040160405180910390fd5b816001600160a01b0316836001600160a01b03167f06c7c914495a46593321b59e2a44ae69d0d784ffb825f7ea0e3529000dd5fdd48660405161087991815260200190565b60405180910390a35050505050505050505050565b6000602082840312156108a057600080fd5b5035919050565b67ffffffffffffffff811681146102b557600080fd5b6000806000606084860312156108d257600080fd5b83356108dd816108a7565b925060208401356001600160a01b03811681146108f957600080fd5b929592945050506040919091013590565b634e487b7160e01b600052601260045260246000fd5b60008261092f5761092f61090a565b500690565b634e487b7160e01b600052601160045260246000fd5b6000826109595761095961090a565b500490565b60006020828403121561097057600080fd5b81516001600160801b038116811461098757600080fd5b9392505050565b6000602082840312156109a057600080fd5b8151610987816108a7565b80820281158282048414176109c2576109c2610934565b92915050565b818103818111156109c2576109c261093456fea26469706673582212201727a8a1fd16ba6320859d24f760d800e9d66652826e94ae01ec35a1e9facab064736f6c634300081c0033

Deployed Bytecode

0x6080604052600436106100595760003560e01c806301abd6d71461006d578063085d4883146100c0578063357401f5146100e857806347ce07cc1461010857806352a5f1f814610130578063c65b4fb11461015057600080fd5b36610068576100666101e7565b005b600080fd5b34801561007957600080fd5b506100a361008836600461088e565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100cc57600080fd5b506100a37352deaa1c84233f7bb8c8a45baede41091c61650681565b3480156100f457600080fd5b5061006661010336600461088e565b6102b8565b34801561011457600080fd5b506100a37336825bf3fbdf5a29e2d5148bfe7dcf7b5639e32081565b34801561013c57600080fd5b5061006661014b3660046108bd565b6103a9565b34801561015c57600080fd5b506101ad61016b36600461088e565b600160208190526000918252604090912080549101546001600160a01b03808316926001600160601b03600160a01b9182900481169392831692919091041684565b604080516001600160a01b0395861681526001600160601b03948516602082015294909216918401919091521660608201526080016100b7565b3415806101fa57506101f834610441565b155b156102185760405163162908e360e11b815260040160405180910390fd5b346000908152602081905260409020546001600160a01b03168061028f57346000818152602081815260409182902080546001600160a01b03191633908117909155915192835290917f43e08d78302cdf9c94e1ffd293c2a3696139ee41cf3199b6f5eed9c7f6cc6090910160405180910390a250565b34600090815260208190526040902080546001600160a01b03191690556102b5816104ca565b50565b6000818152602081905260409020546001600160a01b031633146102ef576040516301ee2bad60e71b815260040160405180910390fd5b60008181526020819052604080822080546001600160a01b031916905551339083908381818185875af1925050503d8060008114610349576040519150601f19603f3d011682016040523d82523d6000602084013e61034e565b606091505b5050905080610370576040516312171d8360e31b815260040160405180910390fd5b60405182815233907f9e58f341ee6224856b97fa9bb85c38d5a631e05e8faf7bd5b756addcf00ac8439060200160405180910390a25050565b7336825bf3fbdf5a29e2d5148bfe7dcf7b5639e3206103cc565b60405180910390fd5b336001600160a01b038216146104305760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b60648201526084016103c3565b61043b848484610705565b50505050565b6000610455670de0b6b3a764000083610920565b1561046257506000919050565b6000610476670de0b6b3a76400008461094a565b9050633b9aca0081111561048d5750600092915050565b60018111156104c1576104a1600a82610920565b156104af5750600092915050565b6104ba600a8261094a565b905061048d565b60011492915050565b600042433360405160200161050493929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b60408051808303601f19018152908290528051602090910120631711922960e31b82527352deaa1c84233f7bb8c8a45baede41091c616506600483015291506000907336825bf3fbdf5a29e2d5148bfe7dcf7b5639e3209063b88c914890602401602060405180830381865afa158015610582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a6919061095e565b6040516319cb825f60e01b81527352deaa1c84233f7bb8c8a45baede41091c6165066004820152602481018490529091506000907336825bf3fbdf5a29e2d5148bfe7dcf7b5639e320906319cb825f906001600160801b0385169060440160206040518083038185885af1158015610622573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610647919061098e565b60408051608081018252338082526001600160601b0386811660208085019182526001600160a01b038b81168688018181523480871660608a0190815267ffffffffffffffff8c1660009081526001808852908c90209a519751978616600160a01b988a168902178b5592519051941693909616909402919091179590920194909455935190815293945091927f8f6aa89dd470c78d8e4fc3d277914983f5b2e18f31268b92bfac0f130e4760d3910160405180910390a350505050565b67ffffffffffffffff83166000908152600160208181526040808420815160808101835281546001600160a01b038082168084526001600160601b03600160a01b93849004811697850188905294909701549081169483018590520490911660608201819052909491929161077b600288610920565b156107865783610788565b845b90506000856001600160a01b0316826001600160a01b0316146107ab57856107ad565b845b905060006001600160a01b038316856107c78660026109ab565b6107d191906109c8565b604051600081818185875af1925050503d806000811461080d576040519150601f19603f3d011682016040523d82523d6000602084013e610812565b606091505b5050905080610834576040516312171d8360e31b815260040160405180910390fd5b816001600160a01b0316836001600160a01b03167f06c7c914495a46593321b59e2a44ae69d0d784ffb825f7ea0e3529000dd5fdd48660405161087991815260200190565b60405180910390a35050505050505050505050565b6000602082840312156108a057600080fd5b5035919050565b67ffffffffffffffff811681146102b557600080fd5b6000806000606084860312156108d257600080fd5b83356108dd816108a7565b925060208401356001600160a01b03811681146108f957600080fd5b929592945050506040919091013590565b634e487b7160e01b600052601260045260246000fd5b60008261092f5761092f61090a565b500690565b634e487b7160e01b600052601160045260246000fd5b6000826109595761095961090a565b500490565b60006020828403121561097057600080fd5b81516001600160801b038116811461098757600080fd5b9392505050565b6000602082840312156109a057600080fd5b8151610987816108a7565b80820281158282048414176109c2576109c2610934565b92915050565b818103818111156109c2576109c261093456fea26469706673582212201727a8a1fd16ba6320859d24f760d800e9d66652826e94ae01ec35a1e9facab064736f6c634300081c0033

Deployed Bytecode Sourcemap

334:4102:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1201:11;:9;:11::i;:::-;334:4102;;;;;706:46;;;;;;;;;;-1:-1:-1;706:46:4;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;706:46:4;;;;;;-1:-1:-1;;;;;363:32:5;;;345:51;;333:2;318:18;706:46:4;;;;;;;;559:77;;;;;;;;;;;;594:42;559:77;;3211:325;;;;;;;;;;-1:-1:-1;3211:325:4;;;;;:::i;:::-;;:::i;466:87::-;;;;;;;;;;;;510:42;466:87;;307:375:3;;;;;;;;;;-1:-1:-1;307:375:3;;;;;:::i;:::-;;:::i;758:49:4:-;;;;;;;;;;-1:-1:-1;758:49:4;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;758:49:4;;;;-1:-1:-1;;;;;;;;758:49:4;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1510:32:5;;;1492:51;;-1:-1:-1;;;;;1579:39:5;;;1574:2;1559:18;;1552:67;1655:32;;;;1635:18;;;1628:60;;;;1724:39;1719:2;1704:18;;1697:67;1479:3;1464:19;758:49:4;1265:505:5;1986:580:4;2084:9;:14;;:43;;;2103:24;2117:9;2103:13;:24::i;:::-;2102:25;2084:43;2080:71;;;2136:15;;-1:-1:-1;;;2136:15:4;;;;;;;;;;;2080:71;2193:9;2162:16;2181:22;;;;;;;;;;;-1:-1:-1;;;;;2181:22:4;;2214:346;;2320:9;2308:11;:22;;;;;;;;;;;;:35;;-1:-1:-1;;;;;;2308:35:4;2333:10;2308:35;;;;;;2362:32;;1921:25:5;;;2333:10:4;;2362:32;;1894:18:5;2362:32:4;;;;;;;2016:550;1986:580::o;2214:346::-;2493:9;2514:1;2481:22;;;;;;;;;;:35;;-1:-1:-1;;;;;;2481:35:4;;;2530:19;2540:8;2530:9;:19::i;:::-;2016:550;1986:580::o;3211:325::-;3269:11;:19;;;;;;;;;;;-1:-1:-1;;;;;3269:19:4;3292:10;3269:33;3265:64;;3311:18;;-1:-1:-1;;;3311:18:4;;;;;;;;;;;3265:64;3370:1;3340:19;;;;;;;;;;;:32;;-1:-1:-1;;;;;;3340:32:4;;;3400:34;:10;;3340:19;;3370:1;3400:34;3370:1;3400:34;3340:19;3400:10;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3382:52;;;3449:7;3444:37;;3465:16;;-1:-1:-1;;;3465:16:4;;;;;;;;;;;3444:37;3497:32;;1921:25:5;;;3510:10:4;;3497:32;;1909:2:5;1894:18;3497:32:4;;;;;;;3255:281;3211:325;:::o;307:375:3:-;510:42:4;479:57:3;;;;;;;;;;;554:10;-1:-1:-1;;;;;554:21:3;;;546:69;;;;-1:-1:-1;;;546:69:3;;2721:2:5;546:69:3;;;2703:21:5;2760:2;2740:18;;;2733:30;2799:34;2779:18;;;2772:62;-1:-1:-1;;;2850:18:5;;;2843:33;2893:19;;546:69:3;2519:399:5;546:69:3;626:49;642:8;652;662:12;626:15;:49::i;:::-;429:253;307:375;;;:::o;3781:653:4:-;3843:4;3928:16;3937:7;3928:6;:16;:::i;:::-;:21;3924:39;;-1:-1:-1;3958:5:4;;3781:653;-1:-1:-1;3781:653:4:o;3924:39::-;4030:19;4052:16;4061:7;4052:6;:16;:::i;:::-;4030:38;;4152:3;4138:11;:17;4134:35;;;-1:-1:-1;4164:5:4;;3781:653;-1:-1:-1;;3781:653:4:o;4134:35::-;4283:1;4269:11;:15;4262:132;;;4304:16;4318:2;4304:11;:16;:::i;:::-;:21;4300:39;;-1:-1:-1;4334:5:4;;3781:653;-1:-1:-1;;3781:653:4:o;4300:39::-;4367:16;4381:2;4367:11;:16;:::i;:::-;4353:30;;4262:132;;;4426:1;4411:16;;3781:653;-1:-1:-1;;3781:653:4:o;2572:633::-;2628:26;2684:15;2701:12;2715:10;2667:59;;;;;;;;;3614:19:5;;;3658:2;3649:12;;3642:28;;;;3708:2;3704:15;-1:-1:-1;;3700:53:5;3695:2;3686:12;;3679:75;3779:2;3770:12;;3429:359;2667:59:4;;;;;;;-1:-1:-1;;2667:59:4;;;;;;;2657:70;;2667:59;2657:70;;;;-1:-1:-1;;;2791:24:4;;594:42;2791:24;;;345:51:5;2657:70:4;-1:-1:-1;2770:18:4;;510:42;;2791:14;;318:18:5;;2791:24:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2915:112;;-1:-1:-1;;;2915:112:4;;594:42;2915:112;;;4277:51:5;4344:18;;;4337:34;;;2770:45:4;;-1:-1:-1;2891:21:4;;510:42;;2915:27;;-1:-1:-1;;;;;2915:112:4;;;4250:18:5;;2915:112:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3068:71;;;;;;;;3079:10;3068:71;;;-1:-1:-1;;;;;3068:71:4;;;;;;;;;;-1:-1:-1;;;;;3068:71:4;;;;;;;;;3128:9;3068:71;;;;;;;;;3038:27;;;-1:-1:-1;3038:27:4;;;:11;:27;;;;;;;:101;;;;;;;-1:-1:-1;;;3038:101:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3155:43;;1921:25:5;;;3038:27:4;;-1:-1:-1;3068:71:4;;3155:43;;1894:18:5;3155:43:4;;;;;;;2618:587;;;2572:633;:::o;1225:755::-;1386:27;;;1362:21;1386:27;;;:11;:27;;;;;;;;1362:51;;;;;;;;;-1:-1:-1;;;;;1362:51:4;;;;;;-1:-1:-1;;;;;;;;1362:51:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1651:25;1675:1;1659:12;1651:25;:::i;:::-;:30;:50;;1694:7;1651:50;;;1684:7;1651:50;1634:67;;1711:13;1737:7;-1:-1:-1;;;;;1727:17:4;:6;-1:-1:-1;;;;;1727:17:4;;:37;;1757:7;1727:37;;;1747:7;1727:37;1711:53;-1:-1:-1;1806:12:4;-1:-1:-1;;;;;1823:11:4;;1858:10;1842:13;:9;1854:1;1842:13;:::i;:::-;:26;;;;:::i;:::-;1823:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1805:68;;;1888:7;1883:37;;1904:16;;-1:-1:-1;;;1904:16:4;;;;;;;;;;;1883:37;1956:5;-1:-1:-1;;;;;1936:37:4;1948:6;-1:-1:-1;;;;;1936:37:4;;1963:9;1936:37;;;;1921:25:5;;1909:2;1894:18;;1775:177;1936:37:4;;;;;;;;1352:628;;;;;;;;1225:755;;;:::o;14:180:5:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:5;;14:180;-1:-1:-1;14:180:5:o;631:129::-;716:18;709:5;705:30;698:5;695:41;685:69;;750:1;747;740:12;765:495;841:6;849;857;910:2;898:9;889:7;885:23;881:32;878:52;;;926:1;923;916:12;878:52;965:9;952:23;984:30;1008:5;984:30;:::i;:::-;1033:5;-1:-1:-1;1090:2:5;1075:18;;1062:32;-1:-1:-1;;;;;1125:33:5;;1113:46;;1103:74;;1173:1;1170;1163:12;1103:74;765:495;;1196:7;;-1:-1:-1;;;1250:2:5;1235:18;;;;1222:32;;765:495::o;2923:127::-;2984:10;2979:3;2975:20;2972:1;2965:31;3015:4;3012:1;3005:15;3039:4;3036:1;3029:15;3055:112;3087:1;3113;3103:35;;3118:18;;:::i;:::-;-1:-1:-1;3152:9:5;;3055:112::o;3172:127::-;3233:10;3228:3;3224:20;3221:1;3214:31;3264:4;3261:1;3254:15;3288:4;3285:1;3278:15;3304:120;3344:1;3370;3360:35;;3375:18;;:::i;:::-;-1:-1:-1;3409:9:5;;3304:120::o;3793:305::-;3863:6;3916:2;3904:9;3895:7;3891:23;3887:32;3884:52;;;3932:1;3929;3922:12;3884:52;3964:9;3958:16;-1:-1:-1;;;;;4007:5:5;4003:46;3996:5;3993:57;3983:85;;4064:1;4061;4054:12;3983:85;4087:5;3793:305;-1:-1:-1;;;3793:305:5:o;4382:249::-;4451:6;4504:2;4492:9;4483:7;4479:23;4475:32;4472:52;;;4520:1;4517;4510:12;4472:52;4552:9;4546:16;4571:30;4595:5;4571:30;:::i;4636:168::-;4709:9;;;4740;;4757:15;;;4751:22;;4737:37;4727:71;;4778:18;;:::i;:::-;4636:168;;;;:::o;4809:128::-;4876:9;;;4897:11;;;4894:37;;;4911:18;;:::i

Swarm Source

ipfs://1727a8a1fd16ba6320859d24f760d800e9d66652826e94ae01ec35a1e9facab0

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
[ 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.