ETH Price: $3,270.23 (+0.73%)
Gas: 1 Gwei

Contract

0x1315702452066cF245C327671f2e4Ed4E4646407
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy Tickets151006552022-07-08 7:46:54750 days ago1657266414IN
0x13157024...4E4646407
0 ETH0.0018678112.98158329
Buy Tickets151000242022-07-08 5:24:02750 days ago1657257842IN
0x13157024...4E4646407
0 ETH0.0031802322.983563
Buy Tickets150998772022-07-08 4:49:20750 days ago1657255760IN
0x13157024...4E4646407
0 ETH0.0033389124.1303409
Buy Tickets150955952022-07-07 13:00:44750 days ago1657198844IN
0x13157024...4E4646407
0 ETH0.0044158531.91336728
Buy Tickets150951642022-07-07 11:20:32750 days ago1657192832IN
0x13157024...4E4646407
0 ETH0.0026038618.81816284
Buy Tickets150944512022-07-07 8:43:36751 days ago1657183416IN
0x13157024...4E4646407
0 ETH0.0014638910.57956548
Buy Tickets150942932022-07-07 8:15:17751 days ago1657181717IN
0x13157024...4E4646407
0 ETH0.0027239519.68604965
Buy Tickets150939302022-07-07 6:56:06751 days ago1657176966IN
0x13157024...4E4646407
0 ETH0.001961612.61725949
Buy Tickets150897532022-07-06 15:26:02751 days ago1657121162IN
0x13157024...4E4646407
0 ETH0.0058020241.93122436
Buy Tickets150885312022-07-06 10:59:16752 days ago1657105156IN
0x13157024...4E4646407
0 ETH0.0028130520.32997116
Buy Tickets150852322022-07-05 22:30:01752 days ago1657060201IN
0x13157024...4E4646407
0 ETH0.0084118860.79271297
Create Raffle150831912022-07-05 14:54:15752 days ago1657032855IN
0x13157024...4E4646407
0 ETH0.0022971229.90274672
Buy Tickets150824432022-07-05 12:13:04752 days ago1657023184IN
0x13157024...4E4646407
0 ETH0.0016824512.15912404
Buy Tickets150815462022-07-05 9:01:52753 days ago1657011712IN
0x13157024...4E4646407
0 ETH0.003856327.86951717
Buy Tickets150812732022-07-05 7:58:49753 days ago1657007929IN
0x13157024...4E4646407
0 ETH0.0018874313.64047412
Buy Tickets150808642022-07-05 6:24:02753 days ago1657002242IN
0x13157024...4E4646407
0 ETH0.0026302419.00880574
Buy Tickets150805842022-07-05 5:17:36753 days ago1656998256IN
0x13157024...4E4646407
0 ETH0.0018420711.84841419
Create Raffle150721872022-07-03 22:08:25754 days ago1656886105IN
0x13157024...4E4646407
0 ETH0.002063326.85891844
Buy Tickets150636332022-07-02 14:25:45755 days ago1656771945IN
0x13157024...4E4646407
0 ETH0.0024086217.40716667
Buy Tickets150610272022-07-02 4:52:56756 days ago1656737576IN
0x13157024...4E4646407
0 ETH0.0016699412.0687078
Buy Tickets150602852022-07-02 2:15:30756 days ago1656728130IN
0x13157024...4E4646407
0 ETH0.0025875118.69998153
Buy Tickets150593322022-07-01 22:47:25756 days ago1656715645IN
0x13157024...4E4646407
0 ETH0.0033830224.4491458
Buy Tickets150589172022-07-01 21:13:51756 days ago1656710031IN
0x13157024...4E4646407
0 ETH0.0027050128.75566871
Buy Tickets150571102022-07-01 14:25:03756 days ago1656685503IN
0x13157024...4E4646407
0 ETH0.0038804228.04383869
Buy Tickets150561072022-07-01 10:34:45757 days ago1656671685IN
0x13157024...4E4646407
0 ETH0.0027573919.92772845
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RaffleParty

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 10000 runs

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

import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";

import "../interfaces/IConfetti.sol";
import "../interfaces/IParty.sol";
import "../interfaces/IRPSeeder.sol";

/**
 * @title
 * @author xanewok.eth
 * @dev
 */
contract RaffleParty is Context, Pausable, AccessControlEnumerable {
    using Strings for uint256;

    IConfetti public immutable _confetti;
    IParty public immutable _party;
    IRPSeeder public immutable _rpSeeder;

    Raffle[] public _raffles;

    string private _baseRaffleURI;

    bytes32 public constant RAFFLE_CREATOR_ROLE =
        keccak256("RAFFLE_CREATOR_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    event RaffleCreated(uint256 indexed raffleId, address indexed creator);

    struct Raffle {
        uint128 cost;
        uint32 endingSeedRound;
        uint32 winnerCount;
        uint32 maxEntries;
        uint32 totalTicketsBought;
        mapping(address => uint32) ticketsBought;
        address[] participants;
    }

    constructor(
        IConfetti confetti,
        IParty party,
        IRPSeeder rpSeeder,
        address admin,
        string memory baseRaffleURI
    ) {
        _setupRole(DEFAULT_ADMIN_ROLE, admin);

        _setupRole(RAFFLE_CREATOR_ROLE, admin);
        _setupRole(PAUSER_ROLE, admin);

        _party = party;
        _confetti = confetti;
        _rpSeeder = rpSeeder;
        _baseRaffleURI = baseRaffleURI;
    }

    function createRaffle(
        uint32 endingSeedRound,
        uint128 cost,
        uint32 maxEntries,
        uint32 winnerCount
    ) public onlyRole(RAFFLE_CREATOR_ROLE) whenNotPaused {
        // Mitigate possible front-running - disallow the txn about a minute
        // before the seeder can request randomness. The RP seeder is pre-configured
        // to require 3 block confirmations, so 60 seconds makes sense (< 3 * 14s)
        require(getSeed(endingSeedRound) == 0, "Raffle finished");
        require(
            endingSeedRound > _rpSeeder.getBatch() ||
                _rpSeeder.getNextAvailableBatch() > (block.timestamp + 60),
            "Not enough time before next seed"
        );

        Raffle storage newRaffle = _raffles.push();
        // Max entries being 0 means "unlimited" raffle tickets
        newRaffle.maxEntries = maxEntries == 0 ? type(uint32).max : maxEntries;
        newRaffle.cost = cost;
        newRaffle.endingSeedRound = endingSeedRound;
        newRaffle.winnerCount = winnerCount;

        emit RaffleCreated(_raffles.length - 1, _msgSender());
    }

    function setRaffleEndingSeed(uint256 raffleId, uint32 endingSeedRound)
        public
        onlyRole(RAFFLE_CREATOR_ROLE)
        whenNotPaused
    {
        require(getSeed(endingSeedRound) == 0, "Raffle finished");
        require(
            endingSeedRound > _rpSeeder.getBatch() ||
                _rpSeeder.getNextAvailableBatch() > (block.timestamp + 60),
            "Not enough time before next seed"
        );

        getRaffleSafe(raffleId).endingSeedRound = endingSeedRound;
    }

    function buyTickets(uint256 raffleId, uint32 count) public whenNotPaused {
        require(count > 0, "Need to buy at least 1 ticket");
        Raffle storage raffle = getRaffleSafe(raffleId);
        require(getSeed(raffle.endingSeedRound) == 0, "Raffle finished");
        // Mitigate possible front-running - disallow the txn about a minute
        // before the seeder can request randomness. The RP seeder is pre-configured
        // to require 3 block confirmations, so 60 seconds makes sense (< 3 * 14s)
        require(
            raffle.endingSeedRound > _rpSeeder.getBatch() ||
                _rpSeeder.getNextAvailableBatch() > (block.timestamp + 60),
            "Not enough time before next seed"
        );
        // TODO: Investigate making this check dynamic/different per raffle
        require(_party.getUserHero(_msgSender()) != 0, "No hero staked");

        uint32 ticketsLeft = raffle.maxEntries - raffle.totalTicketsBought;
        require(ticketsLeft > 0, "Sold out");
        // We can't buy more tickets than there are left
        uint32 ticketCount = count > ticketsLeft ? ticketsLeft : count;

        uint256 cost = ticketCount * raffle.cost;
        if (cost > 0) {
            _confetti.burnFrom(_msgSender(), cost);
        }
        if (raffle.ticketsBought[_msgSender()] == 0) {
            raffle.participants.push(_msgSender());
        }
        // SAFETY: We always buy up to `maxEntries` tickets in total thanks to
        // the clamping done when calculating `ticketCount` above and all of
        // these types are `uint32`
        unchecked {
            raffle.ticketsBought[_msgSender()] += ticketCount;
            raffle.totalTicketsBought += ticketCount;
        }
    }

    /// @dev This is a naive, expensive version that should be only read off-chain.
    /// This simply creates a shuffled list of raffle ticket winners - the caller
    /// is responsible to handle players that have already won, verify their
    /// eligibility for the raffle and so on.
    function raffleWinners(uint256 raffleId)
        public
        view
        returns (address[] memory)
    {
        Raffle storage raffle = getRaffleSafe(raffleId);
        uint256 seed = getSeed(raffle.endingSeedRound);
        require(seed != 0, "Raffle not finished");

        // NOTE: This is *very* naive. Ideally, we could create a tree where we
        // can maintain a O(lg N) lookup on the ticket number (where nodes store
        // the total tickets in their subtrees) and apply a pseudorandom permutation
        // function.
        // This way, the memory cost would be 2*|participants| rather than
        // |totalTickets|
        address[] memory tickets = new address[](raffle.totalTicketsBought);
        // SAFETY: The local ticket counters are `uint256`, while the ticket
        // counters in the storage are `uint32`; same goes for the loop indices.
        uint256 ticketsAssigned = 0;
        unchecked {
            for (uint256 i = 0; i < raffle.participants.length; i++) {
                address participant = raffle.participants[i];

                uint256 ticketsBought = raffle.ticketsBought[participant];
                for (uint256 j = 0; j < ticketsBought; j++) {
                    tickets[ticketsAssigned + j] = participant;
                }
                ticketsAssigned += ticketsBought;
            }
        }

        return shuffledAddresses(tickets, seed);
    }

    function setBaseRaffleURI(string memory uri) external {
        _baseRaffleURI = uri;
    }

    function raffleURI(uint256 raffleId) external view returns (string memory) {
        getRaffleSafe(raffleId);

        return
            bytes(_baseRaffleURI).length > 0
                ? string(abi.encodePacked(_baseRaffleURI, raffleId.toString()))
                : "";
    }

    function pause() external onlyRole(PAUSER_ROLE) whenNotPaused {
        _pause();
    }

    function unpause() external onlyRole(PAUSER_ROLE) whenPaused {
        _unpause();
    }

    // Accessors

    function getRaffleSafe(uint256 raffleId)
        private
        view
        returns (Raffle storage)
    {
        require(raffleId < _raffles.length, "Raffle doesn't exist");
        return _raffles[raffleId];
    }

    function getRaffleCount() public view returns (uint256) {
        return _raffles.length;
    }

    function getRaffleParticipants(uint256 raffleId)
        public
        view
        returns (address[] memory)
    {
        return getRaffleSafe(raffleId).participants;
    }

    function getRaffleParticipantsPaged(
        uint256 raffleId,
        uint32 skipPages,
        uint32 pageSize
    ) public view returns (address[] memory) {
        address[] memory participants = getRaffleSafe(raffleId).participants;

        if (pageSize == 0) {
            return participants;
        } else {
            // Starting index, including
            uint256 start = Math.min(skipPages * pageSize, participants.length);
            // End index, excluding
            uint256 end = Math.min(start + pageSize, participants.length);
            address[] memory returned = new address[](end - start);
            // SAFETY: `start` won't ever be bigger than `type(uint64).max`, `end`
            // won't be bigger than `type(uint64).max + type(uint32).max`, and so
            // `start + i` is bounded by about `type(uint64).max`; `i` has to fit
            // in `uint32`.
            unchecked {
                for (uint256 i = 0; i < returned.length; i++) {
                    returned[i] = participants[start + i];
                }
            }
            return returned;
        }
    }

    function getRaffleView(uint256 raffleId)
        public
        view
        returns (
            uint128 cost,
            uint32 endingSeedRound,
            uint32 maxEntries,
            uint32 winnerCount,
            uint32 totalTicketsBought
        )
    {
        Raffle storage raffle = getRaffleSafe(raffleId);
        return (
            raffle.cost,
            raffle.endingSeedRound,
            raffle.maxEntries,
            raffle.winnerCount,
            raffle.totalTicketsBought
        );
    }

    function getUserTicketsBought(uint256 raffleId, address user)
        public
        view
        returns (uint256)
    {
        return getRaffleSafe(raffleId).ticketsBought[user];
    }

    // Utility functions

    /// @notice Return generated random words for a given seed round
    function getSeed(uint256 roundNum) public view returns (uint256) {
        bytes32 reqId = _rpSeeder.getReqByBatch(roundNum);
        return _rpSeeder.getRandomness(reqId);
    }

    /// @return Randomly shuffled addresses from the given ones, using supplied seed
    /// @dev Knuth shuffle
    function shuffledAddresses(address[] memory addresses, uint256 seed)
        public
        pure
        returns (address[] memory)
    {
        address[] memory shuffled = addresses;

        uint256 pick;
        for (uint256 i = 0; i < addresses.length - 1; i++) {
            // Randomly pick a value from i (incl.) till the end of the array
            // To further increase randomness entropy, add the current player address
            // and the current iteration
            pick =
                uint256(keccak256(abi.encodePacked(i, addresses[i], seed))) %
                (addresses.length - i);

            (shuffled[i], shuffled[i + pick]) = (
                // Save the randomly picked number as the i-th address in the sequence
                shuffled[i + pick],
                // Return the original value to the pool that we pick from
                shuffled[i]
            );
        }

        return shuffled;
    }
}

File 2 of 18 : AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}

File 3 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 18 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 5 of 18 : 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 6 of 18 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 7 of 18 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 8 of 18 : IConfetti.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IConfetti is IERC20 {
    function mint(address to, uint256 amount) external;

    function burn(uint256 amount) external;

    function burnFrom(address from, uint256 amount) external;
}

File 9 of 18 : IParty.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../lib/Stats.sol";

interface IParty {
    event Equipped(address indexed user, uint8 item, uint8 slot, uint256 id);

    event Unequipped(address indexed user, uint8 item, uint8 slot, uint256 id);

    event DamageUpdated(address indexed user, uint32 damageCurr);

    struct PartyData {
        uint256 hero;
        mapping(uint256 => uint256) fighters;
    }

    struct Action {
        ActionType action;
        uint256 id;
        uint8 slot;
    }

    enum Property {
        HERO,
        FIGHTER
    }

    enum ActionType {
        UNEQUIP,
        EQUIP
    }

    function act(
        Action[] calldata heroActions,
        Action[] calldata fighterActions
    ) external;

    function equip(
        Property item,
        uint256 id,
        uint8 slot
    ) external;

    function unequip(Property item, uint8 slot) external;

    function enhance(
        Property item,
        uint8 slot,
        uint256 burnTokenId
    ) external;

    function getUserHero(address user) external view returns (uint256);

    function getUserFighters(address user)
        external
        view
        returns (uint256[] memory);

    function getDamage(address user) external view returns (uint32);
}

File 10 of 18 : IRPSeeder.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Access to the batch seeder used by the Raid Party game
interface IRPSeeder {
    function getBatch() external view returns (uint256);

    function getReqByBatch(uint256 batch) external view returns (bytes32);

    function getNextAvailableBatch() external view returns (uint256);

    function getRandomness(bytes32 key) external view returns (uint256);

    function executeRequestMulti() external;
}

File 11 of 18 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 12 of 18 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 13 of 18 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 14 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 15 of 18 : Stats.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library Stats {
    struct HeroStats {
        uint8 dmgMultiplier;
        uint8 partySize;
        uint8 enhancement;
    }

    struct FighterStats {
        uint32 dmg;
        uint8 enhancement;
    }

    struct EquipmentStats {
        uint32 dmg;
        uint8 dmgMultiplier;
        uint8 slot;
    }
}

File 16 of 18 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 17 of 18 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 18 of 18 : 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);
}

Settings
{
  "remappings": [
    "@chainlink/=lib/chainlink/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "chainlink/=lib/chainlink/",
    "ds-test/=lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "src/=src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london"
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IConfetti","name":"confetti","type":"address"},{"internalType":"contract IParty","name":"party","type":"address"},{"internalType":"contract IRPSeeder","name":"rpSeeder","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"string","name":"baseRaffleURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":true,"internalType":"address","name":"creator","type":"address"}],"name":"RaffleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RAFFLE_CREATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_confetti","outputs":[{"internalType":"contract IConfetti","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_party","outputs":[{"internalType":"contract IParty","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_raffles","outputs":[{"internalType":"uint128","name":"cost","type":"uint128"},{"internalType":"uint32","name":"endingSeedRound","type":"uint32"},{"internalType":"uint32","name":"winnerCount","type":"uint32"},{"internalType":"uint32","name":"maxEntries","type":"uint32"},{"internalType":"uint32","name":"totalTicketsBought","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_rpSeeder","outputs":[{"internalType":"contract IRPSeeder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"},{"internalType":"uint32","name":"count","type":"uint32"}],"name":"buyTickets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"endingSeedRound","type":"uint32"},{"internalType":"uint128","name":"cost","type":"uint128"},{"internalType":"uint32","name":"maxEntries","type":"uint32"},{"internalType":"uint32","name":"winnerCount","type":"uint32"}],"name":"createRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRaffleCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"}],"name":"getRaffleParticipants","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"},{"internalType":"uint32","name":"skipPages","type":"uint32"},{"internalType":"uint32","name":"pageSize","type":"uint32"}],"name":"getRaffleParticipantsPaged","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"}],"name":"getRaffleView","outputs":[{"internalType":"uint128","name":"cost","type":"uint128"},{"internalType":"uint32","name":"endingSeedRound","type":"uint32"},{"internalType":"uint32","name":"maxEntries","type":"uint32"},{"internalType":"uint32","name":"winnerCount","type":"uint32"},{"internalType":"uint32","name":"totalTicketsBought","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundNum","type":"uint256"}],"name":"getSeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"getUserTicketsBought","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"}],"name":"raffleURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"}],"name":"raffleWinners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseRaffleURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"raffleId","type":"uint256"},{"internalType":"uint32","name":"endingSeedRound","type":"uint32"}],"name":"setRaffleEndingSeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256","name":"seed","type":"uint256"}],"name":"shuffledAddresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e06040523480156200001157600080fd5b5060405162003657380380620036578339810160408190526200003491620002fe565b6000805460ff191681556200004a9083620000dc565b620000767f186b684b5b4a3fd78fe68f385d558ec599346451ea9615d30d7820029c6f15c483620000dc565b620000a27f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a83620000dc565b6001600160a01b0380851660a052858116608052831660c0528051620000d090600490602084019062000229565b50505050505062000470565b620000e88282620000ec565b5050565b6200010382826200012f60201b62001dce1760201c565b60008281526002602090815260409091206200012a91839062001e8d620001b7821b17901c565b505050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16620000e85760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000620001ce836001600160a01b038416620001d7565b90505b92915050565b60008181526001830160205260408120546200022057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001d1565b506000620001d1565b828054620002379062000434565b90600052602060002090601f0160209004810192826200025b5760008555620002a6565b82601f106200027657805160ff1916838001178555620002a6565b82800160010185558215620002a6579182015b82811115620002a657825182559160200191906001019062000289565b50620002b4929150620002b8565b5090565b5b80821115620002b45760008155600101620002b9565b6001600160a01b0381168114620002e557600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156200031757600080fd5b85516200032481620002cf565b809550506020808701516200033981620002cf565b60408801519095506200034c81620002cf565b60608801519094506200035f81620002cf565b60808801519093506001600160401b03808211156200037d57600080fd5b818901915089601f8301126200039257600080fd5b815181811115620003a757620003a7620002e8565b604051601f8201601f19908116603f01168101908382118183101715620003d257620003d2620002e8565b816040528281528c86848701011115620003eb57600080fd5b600093505b828410156200040f5784840186015181850187015292850192620003f0565b82841115620004215760008684830101525b8096505050505050509295509295909350565b600181811c908216806200044957607f821691505b6020821081036200046a57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c051613171620004e6600039600081816103ad015281816109ec01528181610a9401528181611104015281816111c1015281816118800152818161192801528181611c490152611ce601526000818161024a01526112b301526000818161038601526114d801526131716000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80637a5b3baf1161010f578063b89e0887116100a2578063d547741f11610071578063d547741f146104e4578063e0d4ea37146104f7578063e63ab1e91461050a578063f39224c71461053157600080fd5b8063b89e088714610484578063c9c3582614610497578063ca15c873146104be578063cd8a6460146104d157600080fd5b806395fd42a1116100de57806395fd42a114610443578063a217fddf14610456578063a6c4054d1461045e578063a6e3295b1461047157600080fd5b80637a5b3baf146103cf5780638456cb59146103e25780639010d07c146103ea57806391d14854146103fd57600080fd5b806335b3ef891161018757806346d23ee21161015657806346d23ee2146103635780635c975abb1461037657806364bddca8146103815780636bfa6b30146103a857600080fd5b806335b3ef89146102dc57806336568abe146102ef5780633f4ba83a14610302578063433959f71461030a57600080fd5b80631a4347da116101c35780631a4347da146102455780631d8c608614610291578063248a9ca3146102a35780632f2ff15d146102c757600080fd5b806301ffc9a7146101ea5780630c212c141461021257806311e5b16a14610232575b600080fd5b6101fd6101f83660046128a9565b610551565b60405190151581526020015b60405180910390f35b610225610220366004612992565b6105ad565b6040516102099190612a45565b610225610240366004612a9f565b610715565b61026c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610209565b6003545b604051908152602001610209565b6102956102b1366004612a9f565b6000908152600160208190526040909120015490565b6102da6102d5366004612ab8565b6108e6565b005b6102da6102ea366004612af8565b610911565b6102da6102fd366004612ab8565b610bc6565b6102da610c5f565b61031d610318366004612a9f565b610ce6565b604080516fffffffffffffffffffffffffffffffff909616865263ffffffff9485166020870152928416928501929092528216606084015216608082015260a001610209565b610225610371366004612b1b565b610d96565b60005460ff166101fd565b61026c7f000000000000000000000000000000000000000000000000000000000000000081565b61026c7f000000000000000000000000000000000000000000000000000000000000000081565b6102da6103dd366004612b57565b610f29565b6102da610f3c565b61026c6103f8366004612c0a565b610fc1565b6101fd61040b366004612ab8565b600091825260016020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6102da610451366004612af8565b610fd9565b610295600081565b61031d61046c366004612a9f565b61167e565b61022561047f366004612a9f565b61172a565b6102da610492366004612c2c565b6117a5565b6102957f186b684b5b4a3fd78fe68f385d558ec599346451ea9615d30d7820029c6f15c481565b6102956104cc366004612a9f565b611b80565b6102956104df366004612ab8565b611b97565b6102da6104f2366004612ab8565b611bda565b610295610505366004612a9f565b611c00565b6102957f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b61054461053f366004612a9f565b611d66565b6040516102099190612cc7565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f0000000000000000000000000000000000000000000000000000000014806105a757506105a782611eaf565b92915050565b6060826000805b600186516105c29190612d47565b81101561070b578086516105d69190612d47565b818783815181106105e9576105e9612d5e565b60200260200101518760405160200161063a9392919092835260609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166020830152603482015260540190565b6040516020818303038152906040528051906020012060001c61065d9190612dbc565b91508261066a8383612dd0565b8151811061067a5761067a612d5e565b602002602001015183828151811061069457610694612d5e565b60200260200101518483815181106106ae576106ae612d5e565b602002602001018585856106c29190612dd0565b815181106106d2576106d2612d5e565b73ffffffffffffffffffffffffffffffffffffffff9384166020918202929092010152911690528061070381612de8565b9150506105b4565b5090949350505050565b6060600061072283611f46565b805490915060009061074d90700100000000000000000000000000000000900463ffffffff16611c00565b9050806000036107a45760405162461bcd60e51b815260206004820152601360248201527f526166666c65206e6f742066696e69736865640000000000000000000000000060448201526064015b60405180910390fd5b81546000907c0100000000000000000000000000000000000000000000000000000000900463ffffffff1667ffffffffffffffff8111156107e7576107e76128eb565b604051908082528060200260200182016040528015610810578160200160208202803683370190505b5090506000805b60028501548110156108d157600085600201828154811061083a5761083a612d5e565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1680835260018901909152604082205490925063ffffffff16905b818110156108c25782868287018151811061089557610895612d5e565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101610878565b50929092019150600101610817565b506108dc82846105ad565b9695505050505050565b6000828152600160208190526040909120015461090281611fc2565b61090c8383611fcc565b505050565b7f186b684b5b4a3fd78fe68f385d558ec599346451ea9615d30d7820029c6f15c461093b81611fc2565b60005460ff161561098e5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b61099d8263ffffffff16611c00565b156109ea5760405162461bcd60e51b815260206004820152600f60248201527f526166666c652066696e69736865640000000000000000000000000000000000604482015260640161079b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633b1fee6c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a799190612e20565b8263ffffffff161180610b235750610a9242603c612dd0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633c099fce6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612e20565b115b610b6f5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682074696d65206265666f7265206e6578742073656564604482015260640161079b565b81610b7984611f46565b805463ffffffff92909216700100000000000000000000000000000000027fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff909216919091179055505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610c515760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161079b565b610c5b8282611fee565b5050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c8981611fc2565b60005460ff16610cdb5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161079b565b610ce3612010565b50565b60038181548110610cf657600080fd5b60009182526020909120600390910201546fffffffffffffffffffffffffffffffff8116915063ffffffff7001000000000000000000000000000000008204811691740100000000000000000000000000000000000000008104821691780100000000000000000000000000000000000000000000000082048116917c010000000000000000000000000000000000000000000000000000000090041685565b60606000610da385611f46565b600201805480602002602001604051908101604052809291908181526020018280548015610e0757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ddc575b505050505090508263ffffffff16600003610e23579050610f22565b6000610e3f610e328587612e39565b63ffffffff1683516120d7565b90506000610e5d610e5663ffffffff871684612dd0565b84516120d7565b90506000610e6b8383612d47565b67ffffffffffffffff811115610e8357610e836128eb565b604051908082528060200260200182016040528015610eac578160200160208202803683370190505b50905060005b8151811015610f16578481850181518110610ecf57610ecf612d5e565b6020026020010151828281518110610ee957610ee9612d5e565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101610eb2565b509350610f2292505050565b9392505050565b8051610c5b906004906020840190612810565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610f6681611fc2565b60005460ff1615610fb95760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b610ce36120ed565b6000828152600260205260408120610f229083612193565b60005460ff161561102c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b60008163ffffffff16116110825760405162461bcd60e51b815260206004820152601d60248201527f4e65656420746f20627579206174206c656173742031207469636b6574000000604482015260640161079b565b600061108d83611f46565b80549091506110b590700100000000000000000000000000000000900463ffffffff16611c00565b156111025760405162461bcd60e51b815260206004820152600f60248201527f526166666c652066696e69736865640000000000000000000000000000000000604482015260640161079b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633b1fee6c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561116d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111919190612e20565b8154700100000000000000000000000000000000900463ffffffff16118061125057506111bf42603c612dd0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633c099fce6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e9190612e20565b115b61129c5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682074696d65206265666f7265206e6578742073656564604482015260640161079b565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663722a145d336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015611342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113669190612e20565b6000036113b55760405162461bcd60e51b815260206004820152600e60248201527f4e6f206865726f207374616b6564000000000000000000000000000000000000604482015260640161079b565b80546000906114089063ffffffff7c010000000000000000000000000000000000000000000000000000000082048116917801000000000000000000000000000000000000000000000000900416612e65565b905060008163ffffffff16116114605760405162461bcd60e51b815260206004820152600860248201527f536f6c64206f7574000000000000000000000000000000000000000000000000604482015260640161079b565b60008163ffffffff168463ffffffff161161147b578361147d565b815b83549091506000906114a7906fffffffffffffffffffffffffffffffff1663ffffffff8416612e8a565b6fffffffffffffffffffffffffffffffff16905080156115845773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166379cc6790336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401600060405180830381600087803b15801561156b57600080fd5b505af115801561157f573d6000803e3d6000fd5b505050505b33600090815260018501602052604081205463ffffffff1690036115e257600284018054600181018255600091825260209091200180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790555b50336000908152600184016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000811663ffffffff918216840182161790915583547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81167c01000000000000000000000000000000000000000000000000000000009182900483169093019091160217909155505050565b60008060008060008061169087611f46565b546fffffffffffffffffffffffffffffffff81169863ffffffff7001000000000000000000000000000000008304811699507801000000000000000000000000000000000000000000000000830481169850740100000000000000000000000000000000000000008304811697507c0100000000000000000000000000000000000000000000000000000000909204909116945092505050565b606061173582611f46565b60020180548060200260200160405190810160405280929190818152602001828054801561179957602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161176e575b50505050509050919050565b7f186b684b5b4a3fd78fe68f385d558ec599346451ea9615d30d7820029c6f15c46117cf81611fc2565b60005460ff16156118225760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b6118318563ffffffff16611c00565b1561187e5760405162461bcd60e51b815260206004820152600f60248201527f526166666c652066696e69736865640000000000000000000000000000000000604482015260640161079b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633b1fee6c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190d9190612e20565b8563ffffffff1611806119b7575061192642603c612dd0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633c099fce6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b59190612e20565b115b611a035760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682074696d65206265666f7265206e6578742073656564604482015260640161079b565b600380546001810182556000829052027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0163ffffffff841615611a475783611a4d565b63ffffffff5b81546fffffffffffffffffffffffffffffffff87167fffffffff00000000ffffffff0000000000000000000000000000000000000000909116780100000000000000000000000000000000000000000000000063ffffffff938416027fffffffffffffffffffffffff000000000000000000000000000000000000000016171770010000000000000000000000000000000088831602177fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000918516919091021781553373ffffffffffffffffffffffffffffffffffffffff166001600380549050611b4f9190612d47565b6040517f832bd4f409009d1b1093221b1a5e841f08c4dd4dc4304c18d95a505b611ce05890600090a3505050505050565b60008181526002602052604081206105a79061219f565b6000611ba283611f46565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600191909101602052604090205463ffffffff16905092915050565b60008281526001602081905260409091200154611bf681611fc2565b61090c8383611fee565b6040517f591c0e1c00000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063591c0e1c90602401602060405180830381865afa158015611c90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb49190612e20565b6040517f05b19402000000000000000000000000000000000000000000000000000000008152600481018290529091507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906305b1940290602401602060405180830381865afa158015611d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f229190612e20565b6060611d7182611f46565b50600060048054611d8190612eb9565b905011611d9d57604051806020016040528060008152506105a7565b6004611da8836121a9565b604051602001611db9929190612f28565b60405160208183030381529060405292915050565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c5b57600082815260016020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000610f228373ffffffffffffffffffffffffffffffffffffffff84166122e6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806105a757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146105a7565b6003546000908210611f9a5760405162461bcd60e51b815260206004820152601460248201527f526166666c6520646f65736e2774206578697374000000000000000000000000604482015260640161079b565b60038281548110611fad57611fad612d5e565b90600052602060002090600302019050919050565b610ce38133612335565b611fd68282611dce565b600082815260026020526040902061090c9082611e8d565b611ff882826123ed565b600082815260026020526040902061090c90826124a8565b60005460ff166120625760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161079b565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b60008183106120e65781610f22565b5090919050565b60005460ff16156121405760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120ad3390565b6000610f2283836124ca565b60006105a7825490565b6060816000036121ec57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612216578061220081612de8565b915061220f9050600a83613005565b91506121f0565b60008167ffffffffffffffff811115612231576122316128eb565b6040519080825280601f01601f19166020018201604052801561225b576020820181803683370190505b5090505b84156122de57612270600183612d47565b915061227d600a86612dbc565b612288906030612dd0565b60f81b81838151811061229d5761229d612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506122d7600a86613005565b945061225f565b949350505050565b600081815260018301602052604081205461232d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105a7565b5060006105a7565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c5b5761238d8173ffffffffffffffffffffffffffffffffffffffff1660146124f4565b6123988360206124f4565b6040516020016123a9929190613019565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905262461bcd60e51b825261079b91600401612cc7565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610c5b57600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f228373ffffffffffffffffffffffffffffffffffffffff841661271d565b60008260000182815481106124e1576124e1612d5e565b9060005260206000200154905092915050565b6060600061250383600261309a565b61250e906002612dd0565b67ffffffffffffffff811115612526576125266128eb565b6040519080825280601f01601f191660200182016040528015612550576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061258757612587612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106125ea576125ea612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061262684600261309a565b612631906001612dd0565b90505b60018111156126ce577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061267257612672612d5e565b1a60f81b82828151811061268857612688612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936126c7816130d7565b9050612634565b508315610f225760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161079b565b60008181526001830160205260408120548015612806576000612741600183612d47565b855490915060009061275590600190612d47565b90508181146127ba57600086600001828154811061277557612775612d5e565b906000526020600020015490508087600001848154811061279857612798612d5e565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806127cb576127cb61310c565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105a7565b60009150506105a7565b82805461281c90612eb9565b90600052602060002090601f01602090048101928261283e5760008555612884565b82601f1061285757805160ff1916838001178555612884565b82800160010185558215612884579182015b82811115612884578251825591602001919060010190612869565b50612890929150612894565b5090565b5b808211156128905760008155600101612895565b6000602082840312156128bb57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f2257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612961576129616128eb565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461298d57600080fd5b919050565b600080604083850312156129a557600080fd5b823567ffffffffffffffff808211156129bd57600080fd5b818501915085601f8301126129d157600080fd5b81356020828211156129e5576129e56128eb565b8160051b92506129f681840161291a565b8281529284018101928181019089851115612a1057600080fd5b948201945b84861015612a3557612a2686612969565b82529482019490820190612a15565b9997909101359750505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612a9357835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612a61565b50909695505050505050565b600060208284031215612ab157600080fd5b5035919050565b60008060408385031215612acb57600080fd5b82359150612adb60208401612969565b90509250929050565b803563ffffffff8116811461298d57600080fd5b60008060408385031215612b0b57600080fd5b82359150612adb60208401612ae4565b600080600060608486031215612b3057600080fd5b83359250612b4060208501612ae4565b9150612b4e60408501612ae4565b90509250925092565b60006020808385031215612b6a57600080fd5b823567ffffffffffffffff80821115612b8257600080fd5b818501915085601f830112612b9657600080fd5b813581811115612ba857612ba86128eb565b612bd8847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161291a565b91508082528684828501011115612bee57600080fd5b8084840185840137600090820190930192909252509392505050565b60008060408385031215612c1d57600080fd5b50508035926020909101359150565b60008060008060808587031215612c4257600080fd5b612c4b85612ae4565b935060208501356fffffffffffffffffffffffffffffffff81168114612c7057600080fd5b9250612c7e60408601612ae4565b9150612c8c60608601612ae4565b905092959194509250565b60005b83811015612cb2578181015183820152602001612c9a565b83811115612cc1576000848401525b50505050565b6020815260008251806020840152612ce6816040850160208701612c97565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015612d5957612d59612d18565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612dcb57612dcb612d8d565b500690565b60008219821115612de357612de3612d18565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612e1957612e19612d18565b5060010190565b600060208284031215612e3257600080fd5b5051919050565b600063ffffffff80831681851681830481118215151615612e5c57612e5c612d18565b02949350505050565b600063ffffffff83811690831681811015612e8257612e82612d18565b039392505050565b60006fffffffffffffffffffffffffffffffff80831681851681830481118215151615612e5c57612e5c612d18565b600181811c90821680612ecd57607f821691505b602082108103612f06577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60008151612f1e818560208601612c97565b9290920192915050565b600080845481600182811c915080831680612f4457607f831692505b60208084108203612f7c577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b818015612f905760018114612fbf57612fec565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00861689528489019650612fec565b60008b81526020902060005b86811015612fe45781548b820152908501908301612fcb565b505084890196505b505050505050612ffc8185612f0c565b95945050505050565b60008261301457613014612d8d565b500490565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613051816017850160208801612c97565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161308e816028840160208801612c97565b01602801949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130d2576130d2612d18565b500290565b6000816130e6576130e6612d18565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220e19522301b67b4c500761396d91192c9d8278c8ed3f1c919e4986b56f094bab064736f6c634300080d0033000000000000000000000000cfef8857e9c80e3440a823971420f7fa5f62f020000000000000000000000000d311bdacb151b72bddfee9cbdc414af22a5e38dc000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff718000000000000000000000000cf2d2da4c2f9b0675a197febc6708704834f9c2400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001e68747470733a2f2f6170692e726169642e70617274792f726166666c652f0000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80637a5b3baf1161010f578063b89e0887116100a2578063d547741f11610071578063d547741f146104e4578063e0d4ea37146104f7578063e63ab1e91461050a578063f39224c71461053157600080fd5b8063b89e088714610484578063c9c3582614610497578063ca15c873146104be578063cd8a6460146104d157600080fd5b806395fd42a1116100de57806395fd42a114610443578063a217fddf14610456578063a6c4054d1461045e578063a6e3295b1461047157600080fd5b80637a5b3baf146103cf5780638456cb59146103e25780639010d07c146103ea57806391d14854146103fd57600080fd5b806335b3ef891161018757806346d23ee21161015657806346d23ee2146103635780635c975abb1461037657806364bddca8146103815780636bfa6b30146103a857600080fd5b806335b3ef89146102dc57806336568abe146102ef5780633f4ba83a14610302578063433959f71461030a57600080fd5b80631a4347da116101c35780631a4347da146102455780631d8c608614610291578063248a9ca3146102a35780632f2ff15d146102c757600080fd5b806301ffc9a7146101ea5780630c212c141461021257806311e5b16a14610232575b600080fd5b6101fd6101f83660046128a9565b610551565b60405190151581526020015b60405180910390f35b610225610220366004612992565b6105ad565b6040516102099190612a45565b610225610240366004612a9f565b610715565b61026c7f000000000000000000000000d311bdacb151b72bddfee9cbdc414af22a5e38dc81565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610209565b6003545b604051908152602001610209565b6102956102b1366004612a9f565b6000908152600160208190526040909120015490565b6102da6102d5366004612ab8565b6108e6565b005b6102da6102ea366004612af8565b610911565b6102da6102fd366004612ab8565b610bc6565b6102da610c5f565b61031d610318366004612a9f565b610ce6565b604080516fffffffffffffffffffffffffffffffff909616865263ffffffff9485166020870152928416928501929092528216606084015216608082015260a001610209565b610225610371366004612b1b565b610d96565b60005460ff166101fd565b61026c7f000000000000000000000000cfef8857e9c80e3440a823971420f7fa5f62f02081565b61026c7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71881565b6102da6103dd366004612b57565b610f29565b6102da610f3c565b61026c6103f8366004612c0a565b610fc1565b6101fd61040b366004612ab8565b600091825260016020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6102da610451366004612af8565b610fd9565b610295600081565b61031d61046c366004612a9f565b61167e565b61022561047f366004612a9f565b61172a565b6102da610492366004612c2c565b6117a5565b6102957f186b684b5b4a3fd78fe68f385d558ec599346451ea9615d30d7820029c6f15c481565b6102956104cc366004612a9f565b611b80565b6102956104df366004612ab8565b611b97565b6102da6104f2366004612ab8565b611bda565b610295610505366004612a9f565b611c00565b6102957f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b61054461053f366004612a9f565b611d66565b6040516102099190612cc7565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f0000000000000000000000000000000000000000000000000000000014806105a757506105a782611eaf565b92915050565b6060826000805b600186516105c29190612d47565b81101561070b578086516105d69190612d47565b818783815181106105e9576105e9612d5e565b60200260200101518760405160200161063a9392919092835260609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166020830152603482015260540190565b6040516020818303038152906040528051906020012060001c61065d9190612dbc565b91508261066a8383612dd0565b8151811061067a5761067a612d5e565b602002602001015183828151811061069457610694612d5e565b60200260200101518483815181106106ae576106ae612d5e565b602002602001018585856106c29190612dd0565b815181106106d2576106d2612d5e565b73ffffffffffffffffffffffffffffffffffffffff9384166020918202929092010152911690528061070381612de8565b9150506105b4565b5090949350505050565b6060600061072283611f46565b805490915060009061074d90700100000000000000000000000000000000900463ffffffff16611c00565b9050806000036107a45760405162461bcd60e51b815260206004820152601360248201527f526166666c65206e6f742066696e69736865640000000000000000000000000060448201526064015b60405180910390fd5b81546000907c0100000000000000000000000000000000000000000000000000000000900463ffffffff1667ffffffffffffffff8111156107e7576107e76128eb565b604051908082528060200260200182016040528015610810578160200160208202803683370190505b5090506000805b60028501548110156108d157600085600201828154811061083a5761083a612d5e565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1680835260018901909152604082205490925063ffffffff16905b818110156108c25782868287018151811061089557610895612d5e565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101610878565b50929092019150600101610817565b506108dc82846105ad565b9695505050505050565b6000828152600160208190526040909120015461090281611fc2565b61090c8383611fcc565b505050565b7f186b684b5b4a3fd78fe68f385d558ec599346451ea9615d30d7820029c6f15c461093b81611fc2565b60005460ff161561098e5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b61099d8263ffffffff16611c00565b156109ea5760405162461bcd60e51b815260206004820152600f60248201527f526166666c652066696e69736865640000000000000000000000000000000000604482015260640161079b565b7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71873ffffffffffffffffffffffffffffffffffffffff16633b1fee6c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a799190612e20565b8263ffffffff161180610b235750610a9242603c612dd0565b7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71873ffffffffffffffffffffffffffffffffffffffff16633c099fce6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612e20565b115b610b6f5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682074696d65206265666f7265206e6578742073656564604482015260640161079b565b81610b7984611f46565b805463ffffffff92909216700100000000000000000000000000000000027fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff909216919091179055505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610c515760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161079b565b610c5b8282611fee565b5050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c8981611fc2565b60005460ff16610cdb5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161079b565b610ce3612010565b50565b60038181548110610cf657600080fd5b60009182526020909120600390910201546fffffffffffffffffffffffffffffffff8116915063ffffffff7001000000000000000000000000000000008204811691740100000000000000000000000000000000000000008104821691780100000000000000000000000000000000000000000000000082048116917c010000000000000000000000000000000000000000000000000000000090041685565b60606000610da385611f46565b600201805480602002602001604051908101604052809291908181526020018280548015610e0757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ddc575b505050505090508263ffffffff16600003610e23579050610f22565b6000610e3f610e328587612e39565b63ffffffff1683516120d7565b90506000610e5d610e5663ffffffff871684612dd0565b84516120d7565b90506000610e6b8383612d47565b67ffffffffffffffff811115610e8357610e836128eb565b604051908082528060200260200182016040528015610eac578160200160208202803683370190505b50905060005b8151811015610f16578481850181518110610ecf57610ecf612d5e565b6020026020010151828281518110610ee957610ee9612d5e565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101610eb2565b509350610f2292505050565b9392505050565b8051610c5b906004906020840190612810565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610f6681611fc2565b60005460ff1615610fb95760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b610ce36120ed565b6000828152600260205260408120610f229083612193565b60005460ff161561102c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b60008163ffffffff16116110825760405162461bcd60e51b815260206004820152601d60248201527f4e65656420746f20627579206174206c656173742031207469636b6574000000604482015260640161079b565b600061108d83611f46565b80549091506110b590700100000000000000000000000000000000900463ffffffff16611c00565b156111025760405162461bcd60e51b815260206004820152600f60248201527f526166666c652066696e69736865640000000000000000000000000000000000604482015260640161079b565b7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71873ffffffffffffffffffffffffffffffffffffffff16633b1fee6c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561116d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111919190612e20565b8154700100000000000000000000000000000000900463ffffffff16118061125057506111bf42603c612dd0565b7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71873ffffffffffffffffffffffffffffffffffffffff16633c099fce6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e9190612e20565b115b61129c5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682074696d65206265666f7265206e6578742073656564604482015260640161079b565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d311bdacb151b72bddfee9cbdc414af22a5e38dc1663722a145d336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015611342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113669190612e20565b6000036113b55760405162461bcd60e51b815260206004820152600e60248201527f4e6f206865726f207374616b6564000000000000000000000000000000000000604482015260640161079b565b80546000906114089063ffffffff7c010000000000000000000000000000000000000000000000000000000082048116917801000000000000000000000000000000000000000000000000900416612e65565b905060008163ffffffff16116114605760405162461bcd60e51b815260206004820152600860248201527f536f6c64206f7574000000000000000000000000000000000000000000000000604482015260640161079b565b60008163ffffffff168463ffffffff161161147b578361147d565b815b83549091506000906114a7906fffffffffffffffffffffffffffffffff1663ffffffff8416612e8a565b6fffffffffffffffffffffffffffffffff16905080156115845773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cfef8857e9c80e3440a823971420f7fa5f62f020166379cc6790336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401600060405180830381600087803b15801561156b57600080fd5b505af115801561157f573d6000803e3d6000fd5b505050505b33600090815260018501602052604081205463ffffffff1690036115e257600284018054600181018255600091825260209091200180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790555b50336000908152600184016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000811663ffffffff918216840182161790915583547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81167c01000000000000000000000000000000000000000000000000000000009182900483169093019091160217909155505050565b60008060008060008061169087611f46565b546fffffffffffffffffffffffffffffffff81169863ffffffff7001000000000000000000000000000000008304811699507801000000000000000000000000000000000000000000000000830481169850740100000000000000000000000000000000000000008304811697507c0100000000000000000000000000000000000000000000000000000000909204909116945092505050565b606061173582611f46565b60020180548060200260200160405190810160405280929190818152602001828054801561179957602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161176e575b50505050509050919050565b7f186b684b5b4a3fd78fe68f385d558ec599346451ea9615d30d7820029c6f15c46117cf81611fc2565b60005460ff16156118225760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b6118318563ffffffff16611c00565b1561187e5760405162461bcd60e51b815260206004820152600f60248201527f526166666c652066696e69736865640000000000000000000000000000000000604482015260640161079b565b7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71873ffffffffffffffffffffffffffffffffffffffff16633b1fee6c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190d9190612e20565b8563ffffffff1611806119b7575061192642603c612dd0565b7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71873ffffffffffffffffffffffffffffffffffffffff16633c099fce6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b59190612e20565b115b611a035760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682074696d65206265666f7265206e6578742073656564604482015260640161079b565b600380546001810182556000829052027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0163ffffffff841615611a475783611a4d565b63ffffffff5b81546fffffffffffffffffffffffffffffffff87167fffffffff00000000ffffffff0000000000000000000000000000000000000000909116780100000000000000000000000000000000000000000000000063ffffffff938416027fffffffffffffffffffffffff000000000000000000000000000000000000000016171770010000000000000000000000000000000088831602177fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000918516919091021781553373ffffffffffffffffffffffffffffffffffffffff166001600380549050611b4f9190612d47565b6040517f832bd4f409009d1b1093221b1a5e841f08c4dd4dc4304c18d95a505b611ce05890600090a3505050505050565b60008181526002602052604081206105a79061219f565b6000611ba283611f46565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600191909101602052604090205463ffffffff16905092915050565b60008281526001602081905260409091200154611bf681611fc2565b61090c8383611fee565b6040517f591c0e1c00000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff718169063591c0e1c90602401602060405180830381865afa158015611c90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb49190612e20565b6040517f05b19402000000000000000000000000000000000000000000000000000000008152600481018290529091507f000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff71873ffffffffffffffffffffffffffffffffffffffff16906305b1940290602401602060405180830381865afa158015611d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f229190612e20565b6060611d7182611f46565b50600060048054611d8190612eb9565b905011611d9d57604051806020016040528060008152506105a7565b6004611da8836121a9565b604051602001611db9929190612f28565b60405160208183030381529060405292915050565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c5b57600082815260016020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000610f228373ffffffffffffffffffffffffffffffffffffffff84166122e6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806105a757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146105a7565b6003546000908210611f9a5760405162461bcd60e51b815260206004820152601460248201527f526166666c6520646f65736e2774206578697374000000000000000000000000604482015260640161079b565b60038281548110611fad57611fad612d5e565b90600052602060002090600302019050919050565b610ce38133612335565b611fd68282611dce565b600082815260026020526040902061090c9082611e8d565b611ff882826123ed565b600082815260026020526040902061090c90826124a8565b60005460ff166120625760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161079b565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b60008183106120e65781610f22565b5090919050565b60005460ff16156121405760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161079b565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120ad3390565b6000610f2283836124ca565b60006105a7825490565b6060816000036121ec57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612216578061220081612de8565b915061220f9050600a83613005565b91506121f0565b60008167ffffffffffffffff811115612231576122316128eb565b6040519080825280601f01601f19166020018201604052801561225b576020820181803683370190505b5090505b84156122de57612270600183612d47565b915061227d600a86612dbc565b612288906030612dd0565b60f81b81838151811061229d5761229d612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506122d7600a86613005565b945061225f565b949350505050565b600081815260018301602052604081205461232d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105a7565b5060006105a7565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c5b5761238d8173ffffffffffffffffffffffffffffffffffffffff1660146124f4565b6123988360206124f4565b6040516020016123a9929190613019565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905262461bcd60e51b825261079b91600401612cc7565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610c5b57600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f228373ffffffffffffffffffffffffffffffffffffffff841661271d565b60008260000182815481106124e1576124e1612d5e565b9060005260206000200154905092915050565b6060600061250383600261309a565b61250e906002612dd0565b67ffffffffffffffff811115612526576125266128eb565b6040519080825280601f01601f191660200182016040528015612550576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061258757612587612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106125ea576125ea612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061262684600261309a565b612631906001612dd0565b90505b60018111156126ce577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061267257612672612d5e565b1a60f81b82828151811061268857612688612d5e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936126c7816130d7565b9050612634565b508315610f225760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161079b565b60008181526001830160205260408120548015612806576000612741600183612d47565b855490915060009061275590600190612d47565b90508181146127ba57600086600001828154811061277557612775612d5e565b906000526020600020015490508087600001848154811061279857612798612d5e565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806127cb576127cb61310c565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105a7565b60009150506105a7565b82805461281c90612eb9565b90600052602060002090601f01602090048101928261283e5760008555612884565b82601f1061285757805160ff1916838001178555612884565b82800160010185558215612884579182015b82811115612884578251825591602001919060010190612869565b50612890929150612894565b5090565b5b808211156128905760008155600101612895565b6000602082840312156128bb57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f2257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612961576129616128eb565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461298d57600080fd5b919050565b600080604083850312156129a557600080fd5b823567ffffffffffffffff808211156129bd57600080fd5b818501915085601f8301126129d157600080fd5b81356020828211156129e5576129e56128eb565b8160051b92506129f681840161291a565b8281529284018101928181019089851115612a1057600080fd5b948201945b84861015612a3557612a2686612969565b82529482019490820190612a15565b9997909101359750505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612a9357835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612a61565b50909695505050505050565b600060208284031215612ab157600080fd5b5035919050565b60008060408385031215612acb57600080fd5b82359150612adb60208401612969565b90509250929050565b803563ffffffff8116811461298d57600080fd5b60008060408385031215612b0b57600080fd5b82359150612adb60208401612ae4565b600080600060608486031215612b3057600080fd5b83359250612b4060208501612ae4565b9150612b4e60408501612ae4565b90509250925092565b60006020808385031215612b6a57600080fd5b823567ffffffffffffffff80821115612b8257600080fd5b818501915085601f830112612b9657600080fd5b813581811115612ba857612ba86128eb565b612bd8847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161291a565b91508082528684828501011115612bee57600080fd5b8084840185840137600090820190930192909252509392505050565b60008060408385031215612c1d57600080fd5b50508035926020909101359150565b60008060008060808587031215612c4257600080fd5b612c4b85612ae4565b935060208501356fffffffffffffffffffffffffffffffff81168114612c7057600080fd5b9250612c7e60408601612ae4565b9150612c8c60608601612ae4565b905092959194509250565b60005b83811015612cb2578181015183820152602001612c9a565b83811115612cc1576000848401525b50505050565b6020815260008251806020840152612ce6816040850160208701612c97565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015612d5957612d59612d18565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612dcb57612dcb612d8d565b500690565b60008219821115612de357612de3612d18565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612e1957612e19612d18565b5060010190565b600060208284031215612e3257600080fd5b5051919050565b600063ffffffff80831681851681830481118215151615612e5c57612e5c612d18565b02949350505050565b600063ffffffff83811690831681811015612e8257612e82612d18565b039392505050565b60006fffffffffffffffffffffffffffffffff80831681851681830481118215151615612e5c57612e5c612d18565b600181811c90821680612ecd57607f821691505b602082108103612f06577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60008151612f1e818560208601612c97565b9290920192915050565b600080845481600182811c915080831680612f4457607f831692505b60208084108203612f7c577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b818015612f905760018114612fbf57612fec565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00861689528489019650612fec565b60008b81526020902060005b86811015612fe45781548b820152908501908301612fcb565b505084890196505b505050505050612ffc8185612f0c565b95945050505050565b60008261301457613014612d8d565b500490565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613051816017850160208801612c97565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161308e816028840160208801612c97565b01602801949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130d2576130d2612d18565b500290565b6000816130e6576130e6612d18565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220e19522301b67b4c500761396d91192c9d8278c8ed3f1c919e4986b56f094bab064736f6c634300080d0033

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

000000000000000000000000cfef8857e9c80e3440a823971420f7fa5f62f020000000000000000000000000d311bdacb151b72bddfee9cbdc414af22a5e38dc000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff718000000000000000000000000cf2d2da4c2f9b0675a197febc6708704834f9c2400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001e68747470733a2f2f6170692e726169642e70617274792f726166666c652f0000

-----Decoded View---------------
Arg [0] : confetti (address): 0xCfef8857E9C80e3440A823971420F7Fa5F62f020
Arg [1] : party (address): 0xd311bDACB151b72BddFEE9cBdC414Af22a5E38dc
Arg [2] : rpSeeder (address): 0xD9bc167E6C37b29F65E708C4Bb1D299937dFF718
Arg [3] : admin (address): 0xcF2D2dA4c2F9B0675A197FEbC6708704834f9c24
Arg [4] : baseRaffleURI (string): https://api.raid.party/raffle/

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000cfef8857e9c80e3440a823971420f7fa5f62f020
Arg [1] : 000000000000000000000000d311bdacb151b72bddfee9cbdc414af22a5e38dc
Arg [2] : 000000000000000000000000d9bc167e6c37b29f65e708c4bb1d299937dff718
Arg [3] : 000000000000000000000000cf2d2da4c2f9b0675a197febc6708704834f9c24
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [5] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [6] : 68747470733a2f2f6170692e726169642e70617274792f726166666c652f0000


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.