ETH Price: $2,188.56 (+1.90%)

Contract

0xde9991F5Bde6593214Cb13D74b2BCA7ad586e528
 
Transaction Hash
Method
Block
From
To
Claim197176932024-04-23 11:07:35316 days ago1713870455IN
0xde9991F5...ad586e528
0 ETH0.0010251311.01495487
Publish Results197176892024-04-23 11:06:47316 days ago1713870407IN
0xde9991F5...ad586e528
0 ETH0.0013797211.77702076
Close Raffle197176812024-04-23 11:05:11316 days ago1713870311IN
0xde9991F5...ad586e528
0 ETH0.0035803311.48447865
Init Raffle197176802024-04-23 11:04:59316 days ago1713870299IN
0xde9991F5...ad586e528
0 ETH0.0018778210.94943156
Claim197176672024-04-23 11:02:23316 days ago1713870143IN
0xde9991F5...ad586e528
0 ETH0.0012379912.64963511
Publish Results197176602024-04-23 11:00:59316 days ago1713870059IN
0xde9991F5...ad586e528
0 ETH0.001543813.17754796
Close Raffle197176092024-04-23 10:50:47316 days ago1713869447IN
0xde9991F5...ad586e528
0 ETH0.0046815615.01684564
Init Raffle197175942024-04-23 10:47:47316 days ago1713869267IN
0xde9991F5...ad586e528
0 ETH0.0027150315.8311069
Publish Results191256182024-01-31 9:37:59399 days ago1706693879IN
0xde9991F5...ad586e528
0 ETH0.0010220519.71855313
Publish Results191199102024-01-30 14:25:59400 days ago1706624759IN
0xde9991F5...ad586e528
0 ETH0.003578222.77690103
Close Raffle191198252024-01-30 14:08:47400 days ago1706623727IN
0xde9991F5...ad586e528
0 ETH0.0098108731.46991306
Close Raffle191198192024-01-30 14:07:35400 days ago1706623655IN
0xde9991F5...ad586e528
0 ETH0.0103050335.30888028
Close Raffle191197782024-01-30 13:59:11400 days ago1706623151IN
0xde9991F5...ad586e528
0 ETH0.0079697527.30732861
Init Raffle190703802024-01-23 15:52:11407 days ago1706025131IN
0xde9991F5...ad586e528
0 ETH0.0045230226.37330386
Claim190618252024-01-22 10:56:47408 days ago1705921007IN
0xde9991F5...ad586e528
0 ETH0.0021201418.44121406
Publish Results190562752024-01-21 15:56:35409 days ago1705852595IN
0xde9991F5...ad586e528
0 ETH0.0023490814.92679835
Close Raffle190562572024-01-21 15:52:59409 days ago1705852379IN
0xde9991F5...ad586e528
0 ETH0.0047808515.33533778
Init Raffle190558052024-01-21 14:22:35409 days ago1705846955IN
0xde9991F5...ad586e528
0 ETH0.0025643214.95230646
Publish Results190473742024-01-20 10:07:23410 days ago1705745243IN
0xde9991F5...ad586e528
0 ETH0.0024740115.74341788
Close Raffle190473612024-01-20 10:04:35410 days ago1705745075IN
0xde9991F5...ad586e528
0 ETH0.0058338717.74002145
Init Raffle190430132024-01-19 19:30:59410 days ago1705692659IN
0xde9991F5...ad586e528
0 ETH0.0057527635.37312353

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x0aAefCBe...bd05C2B0e
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
PudgRaffle

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion
File 1 of 11 : PudgRaffle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/interfaces/IERC721.sol";
import "@chainlink/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol";

import "./interfaces/IPudgRaffle.sol";

contract PudgRaffle is VRFV2WrapperConsumerBase, Ownable, IPudgRaffle {
    mapping(uint256 roundId => Raffle) public raffles;
    mapping(uint256 vrfRequestId => uint256) private _roundIds;
    uint256 public lastRound;

    uint256 public claimPeriod = 7 days;

    // Chainlink VRF variables
    uint16 private _vrfMinConfirmations;
    uint32 private _vrfCallbackGasLimit;
    uint256 private _vrfResponseTime;
    uint256 private _vrfResponseDeadline;

    constructor(
        address _link,
        address _vrfV2Wrapper,
        uint32 vrfCallbackGasLimit,
        uint16 vrfMinConfirmations
    ) VRFV2WrapperConsumerBase(_link, _vrfV2Wrapper) {
        _vrfMinConfirmations = vrfMinConfirmations;
        _vrfCallbackGasLimit = vrfCallbackGasLimit;
        _vrfResponseTime = 1 hours;
    }

    function getRaffle(uint256 roundId) external view override returns (Raffle memory) {
        return raffles[roundId];
    }

    function getLatestRounds(uint256 numRounds) external view returns (Raffle[] memory) {
        if (lastRound < numRounds) {
            numRounds = lastRound;
        }

        Raffle[] memory latestRaffles = new Raffle[](numRounds);

        for (uint256 i = lastRound; i > lastRound - numRounds; i--) {
            latestRaffles[i] = raffles[i];
        }

        return latestRaffles;
    }

    function setVRFMinConfirmations(uint16 vrfMinConfirmations) external onlyOwner {
        if (vrfMinConfirmations == 0) revert InvalidMinConfirmations();
        _vrfMinConfirmations = vrfMinConfirmations;
    }

    function setVRFCallbackGasLimit(uint32 vrfCallbackGasLimit) external onlyOwner {
        if (vrfCallbackGasLimit == 0) revert InvalidCallbackGasLimit();
        _vrfCallbackGasLimit = vrfCallbackGasLimit;
    }

    function setClaimPeriod(uint256 _claimPeriod) external onlyOwner {
        if (_claimPeriod == 0) revert InvalidClaimPeriod();
        claimPeriod = _claimPeriod;
    }

    function setVRFResponseTime(uint256 vrfResponseTime) external onlyOwner {
        if (vrfResponseTime == 0) revert InvalidVRFResponseTime();
        _vrfResponseTime = vrfResponseTime;
    }

    function claim(uint256 roundId) external override {
        Raffle memory raffle = raffles[roundId];
        if (raffle.receiver == address(0)) revert ReceiverNotPublished();
        if (raffle.receiver != msg.sender) revert InvalidClaimer(msg.sender);
        if (raffle.claimedBlock != 0) revert AlreadyClaimed();
        if (block.timestamp > raffle.claimDeadline) revert ClaimPeriodEnded(raffle.claimDeadline);

        raffle.claimedBlock = block.number;
        raffles[roundId] = raffle;

        IERC721(raffle.nftContract).safeTransferFrom(address(this), msg.sender, raffle.nftId);

        emit Claimed(roundId, msg.sender);
    }

    function initRaffle(
        address nftContract,
        uint256 nftId,
        uint256 minSnapshotTimestamp,
        uint256 maxSnapshotTimestamp
    ) external override onlyOwner returns (uint256 roundId) {
        if (minSnapshotTimestamp < block.timestamp) revert InvalidSnapshotMinTimestamp(minSnapshotTimestamp);
        if (maxSnapshotTimestamp < minSnapshotTimestamp) revert InvalidSnapshotMaxTimestamp(maxSnapshotTimestamp);
        if (IERC721(nftContract).ownerOf(nftId) != address(this)) revert InvalidNftId(nftId);
        if (lastRound != 0) {
            Raffle memory lastRaffle = raffles[lastRound];
            bool isVrfFailure = lastRaffle.vrfRequestId != 0 &&
                lastRaffle.vrfNumber == 0 &&
                block.timestamp > _vrfResponseDeadline;

            if (isVrfFailure) {
                emit RaffleFailed(lastRound);
            } else if (lastRaffle.receiver == address(0)) {
                revert PreviousRaffleNotConcluded();
            }
        }

        lastRound++;

        raffles[lastRound] = Raffle({
            ipfsHash: "",
            receiver: address(0),
            nftId: nftId,
            nftContract: nftContract,
            minSnapshotTimestamp: minSnapshotTimestamp,
            maxSnapshotTimestamp: maxSnapshotTimestamp,
            snapshotBlock: 0,
            claimDeadline: 0,
            claimedBlock: 0,
            vrfRequestId: 0,
            vrfNumber: 0,
            randomNumber: 0
        });

        emit RaffleInitiated(lastRound, nftContract, nftId);

        return lastRound;
    }

    function closeRaffle(uint256 roundId) external override onlyOwner returns (uint256 vrfRequestId) {
        Raffle memory raffle = raffles[roundId];
        if (raffle.minSnapshotTimestamp == 0) revert InvalidRound(roundId);
        if (raffle.vrfRequestId != 0) revert RaffleAlreadyClosed(roundId);

        uint256 fee = VRF_V2_WRAPPER.calculateRequestPrice(_vrfCallbackGasLimit);
        if (LINK.balanceOf(address(this)) < fee) revert InsufficientLINK();

        // Request randomness from Chainlink VRF
        vrfRequestId = requestRandomness(_vrfCallbackGasLimit, _vrfMinConfirmations, 1);

        raffle.vrfRequestId = vrfRequestId;
        _vrfResponseDeadline = block.timestamp + _vrfResponseTime;
        raffles[roundId] = raffle;
        _roundIds[vrfRequestId] = roundId;

        emit RaffleClosed(roundId, vrfRequestId);

        return vrfRequestId;
    }

    function publishResults(
        uint256 roundId,
        bytes32 ipfsHash,
        address receiver,
        uint256 snapshotBlock,
        uint256 randomNumber
    ) external override onlyOwner {
        Raffle memory raffle = raffles[roundId];
        if (raffle.vrfNumber == 0) revert VrfRequestNotCompleted();
        if (raffle.receiver != address(0)) revert ReceiverAlreadyPublished();

        raffle.ipfsHash = ipfsHash;
        raffle.receiver = receiver;
        raffle.snapshotBlock = snapshotBlock;
        raffle.claimDeadline = block.timestamp + claimPeriod;
        raffle.randomNumber = randomNumber;
        raffles[roundId] = raffle;

        emit ResultsPublished(roundId, receiver);
    }

    // solhint-disable-next-line private-vars-leading-underscore
    function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
        uint256 roundId = _roundIds[requestId];
        raffles[roundId].vrfNumber = randomWords[0];
    }

    function onERC721Received(address, address, uint256, bytes calldata) external pure override returns (bytes4) {
        return IERC721Receiver.onERC721Received.selector;
    }
}

File 2 of 11 : VRFV2WrapperInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface VRFV2WrapperInterface {
  /**
   * @return the request ID of the most recent VRF V2 request made by this wrapper. This should only
   * be relied option within the same transaction that the request was made.
   */
  function lastRequestId() external view returns (uint256);

  /**
   * @notice Calculates the price of a VRF request with the given callbackGasLimit at the current
   * @notice block.
   *
   * @dev This function relies on the transaction gas price which is not automatically set during
   * @dev simulation. To estimate the price at a specific gas price, use the estimatePrice function.
   *
   * @param _callbackGasLimit is the gas limit used to estimate the price.
   */
  function calculateRequestPrice(uint32 _callbackGasLimit) external view returns (uint256);

  /**
   * @notice Estimates the price of a VRF request with a specific gas limit and gas price.
   *
   * @dev This is a convenience function that can be called in simulation to better understand
   * @dev pricing.
   *
   * @param _callbackGasLimit is the gas limit used to estimate the price.
   * @param _requestGasPriceWei is the gas price in wei used for the estimation.
   */
  function estimateRequestPrice(uint32 _callbackGasLimit, uint256 _requestGasPriceWei) external view returns (uint256);
}

File 3 of 11 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);

  function transferFrom(address from, address to, uint256 value) external returns (bool success);
}

File 4 of 11 : VRFV2WrapperConsumerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../shared/interfaces/LinkTokenInterface.sol";
import "../interfaces/VRFV2WrapperInterface.sol";

/** *******************************************************************************
 * @notice Interface for contracts using VRF randomness through the VRF V2 wrapper
 * ********************************************************************************
 * @dev PURPOSE
 *
 * @dev Create VRF V2 requests without the need for subscription management. Rather than creating
 * @dev and funding a VRF V2 subscription, a user can use this wrapper to create one off requests,
 * @dev paying up front rather than at fulfillment.
 *
 * @dev Since the price is determined using the gas price of the request transaction rather than
 * @dev the fulfillment transaction, the wrapper charges an additional premium on callback gas
 * @dev usage, in addition to some extra overhead costs associated with the VRFV2Wrapper contract.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFV2WrapperConsumerBase. The consumer must be funded
 * @dev with enough LINK to make the request, otherwise requests will revert. To request randomness,
 * @dev call the 'requestRandomness' function with the desired VRF parameters. This function handles
 * @dev paying for the request based on the current pricing.
 *
 * @dev Consumers must implement the fullfillRandomWords function, which will be called during
 * @dev fulfillment with the randomness result.
 */
abstract contract VRFV2WrapperConsumerBase {
  LinkTokenInterface internal immutable LINK;
  VRFV2WrapperInterface internal immutable VRF_V2_WRAPPER;

  /**
   * @param _link is the address of LinkToken
   * @param _vrfV2Wrapper is the address of the VRFV2Wrapper contract
   */
  constructor(address _link, address _vrfV2Wrapper) {
    LINK = LinkTokenInterface(_link);
    VRF_V2_WRAPPER = VRFV2WrapperInterface(_vrfV2Wrapper);
  }

  /**
   * @dev Requests randomness from the VRF V2 wrapper.
   *
   * @param _callbackGasLimit is the gas limit that should be used when calling the consumer's
   *        fulfillRandomWords function.
   * @param _requestConfirmations is the number of confirmations to wait before fulfilling the
   *        request. A higher number of confirmations increases security by reducing the likelihood
   *        that a chain re-org changes a published randomness outcome.
   * @param _numWords is the number of random words to request.
   *
   * @return requestId is the VRF V2 request ID of the newly created randomness request.
   */
  function requestRandomness(
    uint32 _callbackGasLimit,
    uint16 _requestConfirmations,
    uint32 _numWords
  ) internal returns (uint256 requestId) {
    LINK.transferAndCall(
      address(VRF_V2_WRAPPER),
      VRF_V2_WRAPPER.calculateRequestPrice(_callbackGasLimit),
      abi.encode(_callbackGasLimit, _requestConfirmations, _numWords)
    );
    return VRF_V2_WRAPPER.lastRequestId();
  }

  /**
   * @notice fulfillRandomWords handles the VRF V2 wrapper response. The consuming contract must
   * @notice implement it.
   *
   * @param _requestId is the VRF V2 request ID.
   * @param _randomWords is the randomness result.
   */
  function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal virtual;

  function rawFulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) external {
    require(msg.sender == address(VRF_V2_WRAPPER), "only VRF V2 wrapper can fulfill");
    fulfillRandomWords(_requestId, _randomWords);
  }
}

File 5 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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);
    }
}

File 6 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

File 7 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 8 of 11 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 9 of 11 : Context.sol
// 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;
    }
}

File 10 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 11 of 11 : IPudgRaffle.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.21;

import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

interface IPudgRaffle is IERC721Receiver {
    struct Raffle {
        bytes32 ipfsHash;
        address receiver;
        uint256 nftId;
        address nftContract;
        uint256 minSnapshotTimestamp;
        uint256 maxSnapshotTimestamp;
        uint256 snapshotBlock;
        uint256 claimDeadline;
        uint256 claimedBlock;
        uint256 vrfRequestId;
        uint256 vrfNumber;
        uint256 randomNumber;
    }

    function getRaffle(uint256 roundId) external view returns (Raffle memory);

    function getLatestRounds(uint256 numRounds) external view returns (Raffle[] memory);

    function claim(uint256 roundId) external;

    function initRaffle(
        address nftContract,
        uint256 pudgyId,
        uint256 minSnapshotTimestamp,
        uint256 maxSnapshotTimestamp
    ) external returns (uint256 roundId);

    function closeRaffle(uint256 roundId) external returns (uint256 vrfRequestId);

    function publishResults(
        uint256 roundId,
        bytes32 ipfsHash,
        address receiver,
        uint256 snapshotBlock,
        uint256 randomNumber
    ) external;

    event Claimed(uint256 indexed roundId, address indexed winner);
    event RaffleInitiated(uint256 indexed roundId, address indexed nftContract, uint256 nftId);
    event RaffleClosed(uint256 indexed roundId, uint256 vrfRequestId);
    event RaffleFailed(uint256 indexed roundId);
    event ResultsPublished(uint256 indexed roundId, address indexed receiver);

    error InvalidRound(uint256 roundId);
    error ReceiverNotPublished();
    error InvalidClaimer(address claimer);
    error AlreadyClaimed();
    error ClaimPeriodEnded(uint256 claimDeadline);
    error InsufficientLINK();
    error ReceiverAlreadyPublished();
    error InvalidMinConfirmations();
    error InvalidCallbackGasLimit();
    error InvalidClaimPeriod();
    error InvalidVRFResponseTime();
    error InvalidNftId(uint256 nftId);
    error RaffleAlreadyClosed(uint256 roundId);
    error VrfRequestNotCompleted();
    error InvalidSnapshotMinTimestamp(uint256 minSnapshotTimestamp);
    error InvalidSnapshotMaxTimestamp(uint256 maxSnapshotTimestamp);
    error PreviousRaffleNotConcluded();
}

Settings
{
  "evmVersion": "paris",
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_link","type":"address"},{"internalType":"address","name":"_vrfV2Wrapper","type":"address"},{"internalType":"uint32","name":"vrfCallbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"vrfMinConfirmations","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[{"internalType":"uint256","name":"claimDeadline","type":"uint256"}],"name":"ClaimPeriodEnded","type":"error"},{"inputs":[],"name":"InsufficientLINK","type":"error"},{"inputs":[],"name":"InvalidCallbackGasLimit","type":"error"},{"inputs":[],"name":"InvalidClaimPeriod","type":"error"},{"inputs":[{"internalType":"address","name":"claimer","type":"address"}],"name":"InvalidClaimer","type":"error"},{"inputs":[],"name":"InvalidMinConfirmations","type":"error"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"InvalidNftId","type":"error"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"InvalidRound","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxSnapshotTimestamp","type":"uint256"}],"name":"InvalidSnapshotMaxTimestamp","type":"error"},{"inputs":[{"internalType":"uint256","name":"minSnapshotTimestamp","type":"uint256"}],"name":"InvalidSnapshotMinTimestamp","type":"error"},{"inputs":[],"name":"InvalidVRFResponseTime","type":"error"},{"inputs":[],"name":"PreviousRaffleNotConcluded","type":"error"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"RaffleAlreadyClosed","type":"error"},{"inputs":[],"name":"ReceiverAlreadyPublished","type":"error"},{"inputs":[],"name":"ReceiverNotPublished","type":"error"},{"inputs":[],"name":"VrfRequestNotCompleted","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":true,"internalType":"address","name":"winner","type":"address"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vrfRequestId","type":"uint256"}],"name":"RaffleClosed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"RaffleFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"RaffleInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"}],"name":"ResultsPublished","type":"event"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"closeRaffle","outputs":[{"internalType":"uint256","name":"vrfRequestId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numRounds","type":"uint256"}],"name":"getLatestRounds","outputs":[{"components":[{"internalType":"bytes32","name":"ipfsHash","type":"bytes32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"minSnapshotTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxSnapshotTimestamp","type":"uint256"},{"internalType":"uint256","name":"snapshotBlock","type":"uint256"},{"internalType":"uint256","name":"claimDeadline","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"vrfRequestId","type":"uint256"},{"internalType":"uint256","name":"vrfNumber","type":"uint256"},{"internalType":"uint256","name":"randomNumber","type":"uint256"}],"internalType":"struct IPudgRaffle.Raffle[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRaffle","outputs":[{"components":[{"internalType":"bytes32","name":"ipfsHash","type":"bytes32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"minSnapshotTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxSnapshotTimestamp","type":"uint256"},{"internalType":"uint256","name":"snapshotBlock","type":"uint256"},{"internalType":"uint256","name":"claimDeadline","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"vrfRequestId","type":"uint256"},{"internalType":"uint256","name":"vrfNumber","type":"uint256"},{"internalType":"uint256","name":"randomNumber","type":"uint256"}],"internalType":"struct IPudgRaffle.Raffle","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"minSnapshotTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxSnapshotTimestamp","type":"uint256"}],"name":"initRaffle","outputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bytes32","name":"ipfsHash","type":"bytes32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"snapshotBlock","type":"uint256"},{"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"publishResults","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"raffles","outputs":[{"internalType":"bytes32","name":"ipfsHash","type":"bytes32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"minSnapshotTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxSnapshotTimestamp","type":"uint256"},{"internalType":"uint256","name":"snapshotBlock","type":"uint256"},{"internalType":"uint256","name":"claimDeadline","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"vrfRequestId","type":"uint256"},{"internalType":"uint256","name":"vrfNumber","type":"uint256"},{"internalType":"uint256","name":"randomNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_requestId","type":"uint256"},{"internalType":"uint256[]","name":"_randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_claimPeriod","type":"uint256"}],"name":"setClaimPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"vrfCallbackGasLimit","type":"uint32"}],"name":"setVRFCallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"vrfMinConfirmations","type":"uint16"}],"name":"setVRFMinConfirmations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vrfResponseTime","type":"uint256"}],"name":"setVRFResponseTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101165760003560e01c80637a8e4e3b116100a25780639e988f65116100715780639e988f65146102ea578063d2c04f4314610306578063e4dafec914610322578063eedcf57414610352578063f2fde38b1461036e57610116565b80637a8e4e3b146102745780637dc2cd981461029057806382bc07e6146102ae5780638da5cb5b146102cc57610116565b8063379607f5116100e9578063379607f5146101b357806339a4ca70146101cf5780635822db4a146101ff5780635d4bc0ce1461022f578063715018a61461026a57610116565b8063150b7a021461011b5780631fe543e31461014b578063234d000114610167578063332501cc14610197575b600080fd5b61013560048036038101906101309190612252565b61038a565b6040516101429190612315565b60405180910390f35b6101656004803603810190610160919061247f565b61039f565b005b610181600480360381019061017c91906124db565b61043b565b60405161018e9190612517565b60405180910390f35b6101b160048036038101906101ac9190612568565b610941565b005b6101cd60048036038101906101c891906124db565b610cec565b005b6101e960048036038101906101e491906125e3565b611160565b6040516101f69190612517565b60405180910390f35b610219600480360381019061021491906124db565b6116fc565b604051610226919061281d565b60405180910390f35b610249600480360381019061024491906124db565b6118ed565b6040516102619c9b9a9998979695949392919061285d565b60405180910390f35b61027261198d565b005b61028e600480360381019061028991906124db565b6119a1565b005b6102986119ed565b6040516102a59190612517565b60405180910390f35b6102b66119f3565b6040516102c39190612517565b60405180910390f35b6102d46119f9565b6040516102e19190612917565b60405180910390f35b61030460048036038101906102ff919061296c565b611a22565b005b610320600480360381019061031b91906124db565b611a88565b005b61033c600480360381019061033791906124db565b611ad4565b6040516103499190612a8f565b60405180910390f35b61036c60048036038101906103679190612ae7565b611c12565b005b61038860048036038101906103839190612b14565b611c7e565b005b600063150b7a0260e01b905095945050505050565b7f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042490612b9e565b60405180910390fd5b6104378282611d01565b5050565b6000610445611d54565b60006001600084815260200190815260200160002060405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b82015481525050905060008160800151036105c157826040517fddb31b640000000000000000000000000000000000000000000000000000000081526004016105b89190612517565b60405180910390fd5b60008161012001511461060b57826040517f5a050a200000000000000000000000000000000000000000000000000000000081526004016106029190612517565b60405180910390fd5b60007f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df673ffffffffffffffffffffffffffffffffffffffff16634306d354600560029054906101000a900463ffffffff166040518263ffffffff1660e01b81526004016106789190612bcd565b602060405180830381865afa158015610695573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b99190612bfd565b9050807f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107159190612917565b602060405180830381865afa158015610732573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107569190612bfd565b101561078e576040517f01dfa6bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107bc600560029054906101000a900463ffffffff16600560009054906101000a900461ffff166001611dd2565b92508282610120018181525050600654426107d79190612c59565b60078190555081600160008681526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015560608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0155905050836002600085815260200190815260200160002081905550837f2bd3d30947506c7122360988393aeb63a8d6ced5195942b7a1bf2966ee3b6eba846040516109329190612517565b60405180910390a25050919050565b610949611d54565b60006001600087815260200190815260200160002060405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250509050600081610140015103610abb576040517f4bc6c5fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1614610b25576040517f8a4b087c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8481600001818152505083816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828160c001818152505060045442610b7f9190612c59565b8160e0018181525050818161016001818152505080600160008881526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015560608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b01559050508373ffffffffffffffffffffffffffffffffffffffff16867f5ae897b202b1e3024e21cb2c5477c54aa1b2f80bf0aaf0eed1cf8bb4a9c6f2f560405160405180910390a3505050505050565b60006001600083815260200190815260200160002060405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250509050600073ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1603610e89576040517f96b9e44d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1614610efd57336040517ff0ae4757000000000000000000000000000000000000000000000000000000008152600401610ef49190612917565b60405180910390fd5b600081610100015114610f3c576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060e00151421115610f89578060e001516040517f859305b2000000000000000000000000000000000000000000000000000000008152600401610f809190612517565b60405180910390fd5b438161010001818152505080600160008481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015560608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0155905050806060015173ffffffffffffffffffffffffffffffffffffffff166342842e0e303384604001516040518463ffffffff1660e01b81526004016110e693929190612c8d565b600060405180830381600087803b15801561110057600080fd5b505af1158015611114573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff16827f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a2121260405160405180910390a35050565b600061116a611d54565b428310156111af57826040517f21b672790000000000000000000000000000000000000000000000000000000081526004016111a69190612517565b60405180910390fd5b828210156111f457816040517fa2faed5a0000000000000000000000000000000000000000000000000000000081526004016111eb9190612517565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b81526004016112449190612517565b602060405180830381865afa158015611261573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112859190612cd9565b73ffffffffffffffffffffffffffffffffffffffff16146112dd57836040517fec3c7e310000000000000000000000000000000000000000000000000000000081526004016112d49190612517565b60405180910390fd5b6000600354146114ef57600060016000600354815260200190815260200160002060405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b8201548152505090506000808261012001511415801561143857506000826101400151145b8015611445575060075442115b90508015611481576003547f2c3932269cf93987422cdb12a1e2a615cb87c5b4e135a302c68c440532d2721960405160405180910390a26114ec565b600073ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff16036114eb576040517fb722493300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505b6003600081548092919061150290612d06565b919050555060405180610180016040528060008019168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001600081526020016000815260200160008152602001600081526020016000815260200160008152506001600060035481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015560608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b01559050508473ffffffffffffffffffffffffffffffffffffffff166003547f030dac51ccec960084b8d6c8c1f15c952ff74b1d21ac51bc53a19e037ef19932866040516116e79190612517565b60405180910390a36003549050949350505050565b606081600354101561170e5760035491505b60008267ffffffffffffffff81111561172a57611729612341565b5b60405190808252806020026020018201604052801561176357816020015b6117506120b5565b8152602001906001900390816117485790505b509050600060035490505b8360035461177c9190612d4e565b8111156118e3576001600082815260200190815260200160002060405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250508282815181106118c5576118c4612d82565b5b602002602001018190525080806118db90612db1565b91505061176e565b5080915050919050565b60016020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600401549080600501549080600601549080600701549080600801549080600901549080600a01549080600b015490508c565b611995611d54565b61199f6000611fe9565b565b6119a9611d54565b600081036119e3576040517f7eb159b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060068190555050565b60045481565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611a2a611d54565b60008161ffff1603611a68576040517f7752aa4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600560006101000a81548161ffff021916908361ffff16021790555050565b611a90611d54565b60008103611aca576040517fc70b002a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060048190555050565b611adc6120b5565b6001600083815260200190815260200160002060405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250509050919050565b611c1a611d54565b60008163ffffffff1603611c5a576040517ffe7036d700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600560026101000a81548163ffffffff021916908363ffffffff16021790555050565b611c86611d54565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611cf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cec90612e4c565b60405180910390fd5b611cfe81611fe9565b50565b60006002600084815260200190815260200160002054905081600081518110611d2d57611d2c612d82565b5b602002602001015160016000838152602001908152602001600020600a0181905550505050565b611d5c6120ad565b73ffffffffffffffffffffffffffffffffffffffff16611d7a6119f9565b73ffffffffffffffffffffffffffffffffffffffff1614611dd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc790612eb8565b60405180910390fd5b565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16634000aea07f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df67f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df673ffffffffffffffffffffffffffffffffffffffff16634306d354886040518263ffffffff1660e01b8152600401611e8a9190612bcd565b602060405180830381865afa158015611ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ecb9190612bfd565b878787604051602001611ee093929190612ee7565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401611f0d93929190612f9d565b6020604051808303816000875af1158015611f2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f509190613013565b507f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe09190612bfd565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b60405180610180016040528060008019168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061218482612159565b9050919050565b61219481612179565b811461219f57600080fd5b50565b6000813590506121b18161218b565b92915050565b6000819050919050565b6121ca816121b7565b81146121d557600080fd5b50565b6000813590506121e7816121c1565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112612212576122116121ed565b5b8235905067ffffffffffffffff81111561222f5761222e6121f2565b5b60208301915083600182028301111561224b5761224a6121f7565b5b9250929050565b60008060008060006080868803121561226e5761226d61214f565b5b600061227c888289016121a2565b955050602061228d888289016121a2565b945050604061229e888289016121d8565b935050606086013567ffffffffffffffff8111156122bf576122be612154565b5b6122cb888289016121fc565b92509250509295509295909350565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61230f816122da565b82525050565b600060208201905061232a6000830184612306565b92915050565b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61237982612330565b810181811067ffffffffffffffff8211171561239857612397612341565b5b80604052505050565b60006123ab612145565b90506123b78282612370565b919050565b600067ffffffffffffffff8211156123d7576123d6612341565b5b602082029050602081019050919050565b60006123fb6123f6846123bc565b6123a1565b9050808382526020820190506020840283018581111561241e5761241d6121f7565b5b835b81811015612447578061243388826121d8565b845260208401935050602081019050612420565b5050509392505050565b600082601f830112612466576124656121ed565b5b81356124768482602086016123e8565b91505092915050565b600080604083850312156124965761249561214f565b5b60006124a4858286016121d8565b925050602083013567ffffffffffffffff8111156124c5576124c4612154565b5b6124d185828601612451565b9150509250929050565b6000602082840312156124f1576124f061214f565b5b60006124ff848285016121d8565b91505092915050565b612511816121b7565b82525050565b600060208201905061252c6000830184612508565b92915050565b6000819050919050565b61254581612532565b811461255057600080fd5b50565b6000813590506125628161253c565b92915050565b600080600080600060a086880312156125845761258361214f565b5b6000612592888289016121d8565b95505060206125a388828901612553565b94505060406125b4888289016121a2565b93505060606125c5888289016121d8565b92505060806125d6888289016121d8565b9150509295509295909350565b600080600080608085870312156125fd576125fc61214f565b5b600061260b878288016121a2565b945050602061261c878288016121d8565b935050604061262d878288016121d8565b925050606061263e878288016121d8565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61267f81612532565b82525050565b61268e81612179565b82525050565b61269d816121b7565b82525050565b610180820160008201516126ba6000850182612676565b5060208201516126cd6020850182612685565b5060408201516126e06040850182612694565b5060608201516126f36060850182612685565b5060808201516127066080850182612694565b5060a082015161271960a0850182612694565b5060c082015161272c60c0850182612694565b5060e082015161273f60e0850182612694565b50610100820151612754610100850182612694565b50610120820151612769610120850182612694565b5061014082015161277e610140850182612694565b50610160820151612793610160850182612694565b50505050565b60006127a583836126a3565b6101808301905092915050565b6000602082019050919050565b60006127ca8261264a565b6127d48185612655565b93506127df83612666565b8060005b838110156128105781516127f78882612799565b9750612802836127b2565b9250506001810190506127e3565b5085935050505092915050565b6000602082019050818103600083015261283781846127bf565b905092915050565b61284881612532565b82525050565b61285781612179565b82525050565b600061018082019050612873600083018f61283f565b612880602083018e61284e565b61288d604083018d612508565b61289a606083018c61284e565b6128a7608083018b612508565b6128b460a083018a612508565b6128c160c0830189612508565b6128ce60e0830188612508565b6128dc610100830187612508565b6128ea610120830186612508565b6128f8610140830185612508565b612906610160830184612508565b9d9c50505050505050505050505050565b600060208201905061292c600083018461284e565b92915050565b600061ffff82169050919050565b61294981612932565b811461295457600080fd5b50565b60008135905061296681612940565b92915050565b6000602082840312156129825761298161214f565b5b600061299084828501612957565b91505092915050565b610180820160008201516129b06000850182612676565b5060208201516129c36020850182612685565b5060408201516129d66040850182612694565b5060608201516129e96060850182612685565b5060808201516129fc6080850182612694565b5060a0820151612a0f60a0850182612694565b5060c0820151612a2260c0850182612694565b5060e0820151612a3560e0850182612694565b50610100820151612a4a610100850182612694565b50610120820151612a5f610120850182612694565b50610140820151612a74610140850182612694565b50610160820151612a89610160850182612694565b50505050565b600061018082019050612aa56000830184612999565b92915050565b600063ffffffff82169050919050565b612ac481612aab565b8114612acf57600080fd5b50565b600081359050612ae181612abb565b92915050565b600060208284031215612afd57612afc61214f565b5b6000612b0b84828501612ad2565b91505092915050565b600060208284031215612b2a57612b2961214f565b5b6000612b38848285016121a2565b91505092915050565b600082825260208201905092915050565b7f6f6e6c792056524620563220777261707065722063616e2066756c66696c6c00600082015250565b6000612b88601f83612b41565b9150612b9382612b52565b602082019050919050565b60006020820190508181036000830152612bb781612b7b565b9050919050565b612bc781612aab565b82525050565b6000602082019050612be26000830184612bbe565b92915050565b600081519050612bf7816121c1565b92915050565b600060208284031215612c1357612c1261214f565b5b6000612c2184828501612be8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c64826121b7565b9150612c6f836121b7565b9250828201905080821115612c8757612c86612c2a565b5b92915050565b6000606082019050612ca2600083018661284e565b612caf602083018561284e565b612cbc6040830184612508565b949350505050565b600081519050612cd38161218b565b92915050565b600060208284031215612cef57612cee61214f565b5b6000612cfd84828501612cc4565b91505092915050565b6000612d11826121b7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d4357612d42612c2a565b5b600182019050919050565b6000612d59826121b7565b9150612d64836121b7565b9250828203905081811115612d7c57612d7b612c2a565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612dbc826121b7565b915060008203612dcf57612dce612c2a565b5b600182039050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612e36602683612b41565b9150612e4182612dda565b604082019050919050565b60006020820190508181036000830152612e6581612e29565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ea2602083612b41565b9150612ead82612e6c565b602082019050919050565b60006020820190508181036000830152612ed181612e95565b9050919050565b612ee181612932565b82525050565b6000606082019050612efc6000830186612bbe565b612f096020830185612ed8565b612f166040830184612bbe565b949350505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f58578082015181840152602081019050612f3d565b60008484015250505050565b6000612f6f82612f1e565b612f798185612f29565b9350612f89818560208601612f3a565b612f9281612330565b840191505092915050565b6000606082019050612fb2600083018661284e565b612fbf6020830185612508565b8181036040830152612fd18184612f64565b9050949350505050565b60008115159050919050565b612ff081612fdb565b8114612ffb57600080fd5b50565b60008151905061300d81612fe7565b92915050565b6000602082840312156130295761302861214f565b5b600061303784828501612ffe565b9150509291505056fea2646970667358221220e61921f31fc3fbf461dd3b404b281355c06ccab17df84065db16ea81eb712d9f64736f6c63430008150033

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.