ETH Price: $3,478.24 (+1.75%)

Contract

0x8a6E4d9bfd0F82c6Aa58df274150d00124B58Ffb
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Block
From
To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TheCarnivalLottery

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : PLSDLottery.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@chainlink/contracts/src/v0.8/VRFV2WrapperConsumerBase.sol";

interface PLSDStaker {
    function depositPLSD(uint256 _amount) external;
}

contract TheCarnivalLottery is VRFV2WrapperConsumerBase, ReentrancyGuard {
    using SafeERC20 for IERC20;

    uint32 callbackGasLimit = 600000;
    uint16 requestConfirmations = 3;
    uint32 numWords = 2;

    // Ethereum Mainnet
    address linkAddress = 0x514910771AF9Ca656af840dff83E8264EcF986CA;
    address wrapperAddress = 0x5A861794B927983406fCE1D062e00b9368d97Df6;

    //     //Sepolia
    //     address linkAddress = 0x779877A7B0D9E8603169DdbD7836e478b4624789;
    //     address wrapperAddress = 0xab18414CD93297B0d12ac29E63Ca20f515b3DB46;

    //     //Goerli
    //     address linkAddress = 0x326C977E6efc84E512bB9C30f76E30c160eD06FB;
    //     address wrapperAddress = 0x708701a1DfF4f478de54383E49a627eD4852C816;

    // Mumbai
    // address linkAddress = 0x326C977E6efc84E512bB9C30f76E30c160eD06FB;
    // address wrapperAddress = 0x99aFAf084eBA697E584501b8Ed2c0B37Dd136693;

    uint256 public randomResult;
    uint256 public requestId;

    address[] public players; // store entries

    uint256 public immutable ticketPrice; // price of each ticket
    uint256 public immutable timeLength; // time length for each round in seconds
    uint256 drawId; // Id for the current game

    uint256 ticketsSold; // keeps track of number of tickets sold
    uint256 totalDeposits;

    uint256 public lotteryDeadline;

    uint256 public constant CARN_FEE = 1e11; // Flat cost of 0.1 CARN for each ticket

    uint256 public constant PLSD_TRANSFER_BPS = 2000; // 20%
    uint256 public constant WAATCA_TRANSFER_BPS = 500; // 5%

    address public immutable waatcaPool;
    address public immutable buyAndBurnContract;
    address public immutable plsdStakingContract;

    IERC20 public immutable paymentToken;
    IERC20 public immutable CARN;

    struct DrawResult {
        address winner;
        uint256 totalDeposits;
        bool isRewardClaimed;
    }

    // mapping that store winners addresses for each game
    mapping(uint256 => DrawResult) public drawHistory;

    event TicketsBought(
        address indexed buyer,
        uint256 indexed drawId,
        uint256 amount
    );
    
    event WinnerSelected(
        address indexed winner,
        uint256 drawId,
        uint256 timestamp
    );
    event DrawSkipped(uint256 indexed drawId, uint256 newLotteryDeadline);
    event RewardSent(address indexed winner, uint256 drawId, uint256 amount);

    constructor(
        address _waatcaPoolAddress,
        address _buyAndBurnContractAddress,
        address _plsdStakingContractAddress,
        uint256 _ticketPrice,
        uint256 _timeLength,
        address _paymentToken,
        address _carn
    )
        VRFV2WrapperConsumerBase(linkAddress, wrapperAddress)
    {
        waatcaPool = _waatcaPoolAddress;
        buyAndBurnContract = _buyAndBurnContractAddress;
        plsdStakingContract = _plsdStakingContractAddress;

        ticketPrice = _ticketPrice;
        drawId = 1;

        timeLength = _timeLength;
        lotteryDeadline = block.timestamp + _timeLength;

        paymentToken = IERC20(_paymentToken);
        CARN = IERC20(_carn);
    }

    // function that allows the players to buy a certain amount of tickets
    function buyTickets(uint256 _amount) external nonReentrant {
        CARN.safeTransferFrom(
            msg.sender,
            buyAndBurnContract,
            CARN_FEE * _amount
        );
        paymentToken.safeTransferFrom(
            msg.sender,
            address(this),
            _amount * ticketPrice
        );

        totalDeposits += _amount * ticketPrice;
        ticketsSold += _amount;
        for (uint256 i = 0; i < _amount; i++) {
            players.push(msg.sender);
        }

        emit TicketsBought(msg.sender, drawId, _amount);

        if (block.timestamp > lotteryDeadline) _pickWinner();
    }

    // function to get random number for winner selection
    function requestRandomWords() internal {
        lotteryDeadline = block.timestamp + timeLength;
        requestId = requestRandomness(
            callbackGasLimit,
            requestConfirmations,
            numWords
        );
    }

    function fulfillRandomWords(
        uint256, /* requestId */
        uint256[] memory randomWords
    ) internal override {
        if (randomWords[0] % 4 == 0) {
            randomResult = randomWords[1];
            setWinner();
        } else {
            skipDraw();
        }
    }

    // function to pick the winner once all the tickets are sold
    function _pickWinner() private {
        require(block.timestamp > lotteryDeadline, "Deadline not reached yet");
        requestRandomWords();
    }

    // function to set the winner - called from fulfillRandomness function
    function setWinner() private {
        uint256 index = randomResult % players.length;
        address winner = players[index];
        emit WinnerSelected(winner, drawId, block.timestamp);

        players = new address[](0);
        lotteryDeadline = block.timestamp + timeLength;

        DrawResult memory result = DrawResult(winner, totalDeposits, false);
        drawHistory[drawId] = result;
        drawId++;

        ticketsSold = 0;
        totalDeposits = 0;
    }

    // In case a winner is not picked, the pot gets bigger and bigger
    function skipDraw() private {
        lotteryDeadline = block.timestamp + timeLength;
        emit DrawSkipped(drawId, lotteryDeadline);
    }

    // function to send rewards to the winner for a specific drawId
    function sendRewards(uint256 _drawId) external nonReentrant {
        bool _isRewardClaimed = drawHistory[_drawId].isRewardClaimed;
        require(!_isRewardClaimed, "Reward already claimed");

        address winner = drawHistory[_drawId].winner;
        require(winner != address(0), "No winner yet");

        uint256 _totalDeposits = drawHistory[_drawId].totalDeposits;
        require(_totalDeposits > 0, "No deposits");

        uint256 amountToPlsdStaker = (_totalDeposits * PLSD_TRANSFER_BPS) /
            10000;
        uint256 amountToWaatca = (_totalDeposits * WAATCA_TRANSFER_BPS) / 10000;

        uint256 amountToWinner = _totalDeposits -
            amountToWaatca -
            amountToPlsdStaker;
        drawHistory[_drawId].isRewardClaimed = true;

        IERC20(paymentToken).approve(plsdStakingContract, amountToPlsdStaker);
        PLSDStaker(plsdStakingContract).depositPLSD(amountToPlsdStaker);
        paymentToken.safeTransfer(waatcaPool, amountToWaatca);
        paymentToken.safeTransfer(winner, amountToWinner);
        emit RewardSent(winner, _drawId, amountToWinner);
    }

    // function that returns how many tickets a particular wallet has purchased for the current game
    function getPlayerEntries(address player) public view returns (uint256) {
        uint256 entries = 0;
        for (uint256 i = 0; i < players.length; i++) {
            if (players[i] == player) entries++;
        }

        return entries;
    }

    // function to check which wallet the prize has been sent for a particular drawId
    function getWinnerByDrawId(uint256 _drawId)
        public
        view
        returns (address winner)
    {
        // return drawHistory[_drawId];
        winner = drawHistory[_drawId].winner;
    }

    // function that returns how many tickets have been sold at a given time for the current game
    function getTicketsSold() public view returns (uint256) {
        return ticketsSold;
    }

    // function that returns how much payment tokens accumulated so far for the current draw Id
    function getCurrentDeposits() public view returns (uint256) {
        return totalDeposits;
    }

    // function that returns the current draw Id
    function getCurrentDrawId() public view returns (uint256) {
        return drawId;
    }
}

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

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

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

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

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

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

  function increaseApproval(address spender, uint256 subtractedValue) external;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 6 of 9 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 7 of 9 : 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 8 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_waatcaPoolAddress","type":"address"},{"internalType":"address","name":"_buyAndBurnContractAddress","type":"address"},{"internalType":"address","name":"_plsdStakingContractAddress","type":"address"},{"internalType":"uint256","name":"_ticketPrice","type":"uint256"},{"internalType":"uint256","name":"_timeLength","type":"uint256"},{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"address","name":"_carn","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"drawId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newLotteryDeadline","type":"uint256"}],"name":"DrawSkipped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"drawId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":true,"internalType":"uint256","name":"drawId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"drawId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"WinnerSelected","type":"event"},{"inputs":[],"name":"CARN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CARN_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PLSD_TRANSFER_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WAATCA_TRANSFER_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyAndBurnContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"buyTickets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"drawHistory","outputs":[{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"totalDeposits","type":"uint256"},{"internalType":"bool","name":"isRewardClaimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentDrawId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"player","type":"address"}],"name":"getPlayerEntries","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicketsSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_drawId","type":"uint256"}],"name":"getWinnerByDrawId","outputs":[{"internalType":"address","name":"winner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lotteryDeadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"players","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"plsdStakingContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomResult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_requestId","type":"uint256"},{"internalType":"uint256[]","name":"_randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_drawId","type":"uint256"}],"name":"sendRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticketPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"waatcaPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6101a0604052620927c0600160006101000a81548163ffffffff021916908363ffffffff1602179055506003600160046101000a81548161ffff021916908361ffff1602179055506002600160066101000a81548163ffffffff021916908363ffffffff16021790555073514910771af9ca656af840dff83e8264ecf986ca6001600a6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550735a861794b927983406fce1d062e00b9368d97df6600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503480156200012057600080fd5b5060405162002c0f38038062002c0f8339818101604052810190620001469190620003e5565b6001600a9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1681525050505060016000819055508673ffffffffffffffffffffffffffffffffffffffff166101008173ffffffffffffffffffffffffffffffffffffffff16815250508573ffffffffffffffffffffffffffffffffffffffff166101208173ffffffffffffffffffffffffffffffffffffffff16815250508473ffffffffffffffffffffffffffffffffffffffff166101408173ffffffffffffffffffffffffffffffffffffffff16815250508360c0818152505060016006819055508260e081815250508242620002c39190620004c7565b6009819055508173ffffffffffffffffffffffffffffffffffffffff166101608173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff166101808173ffffffffffffffffffffffffffffffffffffffff16815250505050505050505062000502565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003728262000345565b9050919050565b620003848162000365565b81146200039057600080fd5b50565b600081519050620003a48162000379565b92915050565b6000819050919050565b620003bf81620003aa565b8114620003cb57600080fd5b50565b600081519050620003df81620003b4565b92915050565b600080600080600080600060e0888a03121562000407576200040662000340565b5b6000620004178a828b0162000393565b97505060206200042a8a828b0162000393565b96505060406200043d8a828b0162000393565b9550506060620004508a828b01620003ce565b9450506080620004638a828b01620003ce565b93505060a0620004768a828b0162000393565b92505060c0620004898a828b0162000393565b91505092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620004d482620003aa565b9150620004e183620003aa565b9250828201905080821115620004fc57620004fb62000498565b5b92915050565b60805160a05160c05160e0516101005161012051610140516101605161018051612625620005ea600039600081816106240152610d1501526000818161069c0152818161083101528181610ab401528181610c230152610c6e01526000818161086101528181610af00152610b730152600081816105f2015261088f015260008181610c010152610d5d015260008181610d390152818161118a015281816112ad01526113e401526000818161051c0152818161067001526106e301526000818161054a015281816114b3015281816114d401526115f40152600061147701526126256000f3fe608060405234801561001057600080fd5b506004361061014c5760003560e01c806342619f66116100c3578063bd06f3f11161007c578063bd06f3f11461035b578063be07ae7714610379578063ea1ecfb714610397578063f3871a15146103b5578063f71d96cb146103e5578063fc46925f146104155761014c565b806342619f66146102a9578063482853c9146102c7578063520198a8146102e55780638474e28314610303578063ada07fa014610321578063b9419a1b1461033d5761014c565b80631209b1f6116101155780631209b1f6146101f95780631f0e214b146102175780631fe543e3146102355780632f366637146102515780633013ce291461026d57806338a83aeb1461028b5761014c565b80626d6cae14610151578063065adc451461016f5780630ac012d41461018d5780630e6bf4f3146101bd5780630f96a8ed146101db575b600080fd5b610159610447565b60405161016691906118ff565b60405180910390f35b61017761044d565b60405161018491906118ff565b60405180910390f35b6101a760048036038101906101a2919061198c565b610456565b6040516101b491906118ff565b60405180910390f35b6101c561050a565b6040516101d291906118ff565b60405180910390f35b6101e3610514565b6040516101f091906118ff565b60405180910390f35b61020161051a565b60405161020e91906118ff565b60405180910390f35b61021f61053e565b60405161022c91906118ff565b60405180910390f35b61024f600480360381019061024a9190611b3e565b610548565b005b61026b60048036038101906102669190611b9a565b6105e4565b005b61027561082f565b6040516102829190611c26565b60405180910390f35b610293610853565b6040516102a091906118ff565b60405180910390f35b6102b1610859565b6040516102be91906118ff565b60405180910390f35b6102cf61085f565b6040516102dc9190611c50565b60405180910390f35b6102ed610883565b6040516102fa91906118ff565b60405180910390f35b61030b61088d565b6040516103189190611c50565b60405180910390f35b61033b60048036038101906103369190611b9a565b6108b1565b005b610345610d13565b6040516103529190611c26565b60405180910390f35b610363610d37565b60405161037091906118ff565b60405180910390f35b610381610d5b565b60405161038e9190611c50565b60405180910390f35b61039f610d7f565b6040516103ac91906118ff565b60405180910390f35b6103cf60048036038101906103ca9190611b9a565b610d85565b6040516103dc9190611c50565b60405180910390f35b6103ff60048036038101906103fa9190611b9a565b610dc5565b60405161040c9190611c50565b60405180910390f35b61042f600480360381019061042a9190611b9a565b610e04565b60405161043e93929190611c86565b60405180910390f35b60045481565b64174876e80081565b6000806000905060005b600580549050811015610500578373ffffffffffffffffffffffffffffffffffffffff166005828154811061049857610497611cbd565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036104ed5781806104e990611d1b565b9250505b80806104f890611d1b565b915050610460565b5080915050919050565b6000600654905090565b60095481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600854905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105cd90611dc0565b60405180910390fd5b6105e08282610e5b565b5050565b6105ec610ec6565b610669337f00000000000000000000000000000000000000000000000000000000000000008364174876e8006106229190611de0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610f15909392919063ffffffff16565b6106e133307f00000000000000000000000000000000000000000000000000000000000000008461069a9190611de0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610f15909392919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000008161070d9190611de0565b6008600082825461071e9190611e22565b9250508190555080600760008282546107379190611e22565b9250508190555060005b818110156107bf576005339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080806107b790611d1b565b915050610741565b506006543373ffffffffffffffffffffffffffffffffffffffff167fb0ebd247b49b0f0079dfe3093ede3e56ddb43164363f38bf1576023c076ab4f28360405161080991906118ff565b60405180910390a360095442111561082457610823610f9e565b5b61082c610fec565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b6101f481565b60035481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600754905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6108b9610ec6565b6000600a600083815260200190815260200160002060020160009054906101000a900460ff1690508015610922576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091990611ea2565b60405180910390fd5b6000600a600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c390611f0e565b60405180910390fd5b6000600a600085815260200190815260200160002060010154905060008111610a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2190611f7a565b60405180910390fd5b60006127106107d083610a3d9190611de0565b610a479190611fc9565b905060006127106101f484610a5c9190611de0565b610a669190611fc9565b90506000828285610a779190611ffa565b610a819190611ffa565b90506001600a600089815260200190815260200160002060020160006101000a81548160ff0219169083151502179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000856040518363ffffffff1660e01b8152600401610b2d92919061202e565b6020604051808303816000875af1158015610b4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b709190612083565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166352c6138a846040518263ffffffff1660e01b8152600401610bca91906118ff565b600060405180830381600087803b158015610be457600080fd5b505af1158015610bf8573d6000803e3d6000fd5b50505050610c677f0000000000000000000000000000000000000000000000000000000000000000837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610ff69092919063ffffffff16565b610cb285827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610ff69092919063ffffffff16565b8473ffffffffffffffffffffffffffffffffffffffff167f6379339f0ae63e95e65fad18ca2a7ec4e7e3f05f3cc5f7079f4d8da8cec34faa8883604051610cfa9291906120b0565b60405180910390a2505050505050610d10610fec565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6107d081565b6000600a600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60058181548110610dd557600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900460ff16905083565b6000600482600081518110610e7357610e72611cbd565b5b6020026020010151610e8591906120d9565b03610eb95780600181518110610e9e57610e9d611cbd565b5b6020026020010151600381905550610eb461107c565b610ec2565b610ec16112ab565b5b5050565b600260005403610f0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0290612156565b60405180910390fd5b6002600081905550565b610f98846323b872dd60e01b858585604051602401610f3693929190612176565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061131b565b50505050565b6009544211610fe2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd9906121f9565b60405180910390fd5b610fea6113e2565b565b6001600081905550565b6110778363a9059cbb60e01b848460405160240161101592919061202e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061131b565b505050565b600060058054905060035461109191906120d9565b90506000600582815481106110a9576110a8611cbd565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff167f866efae43947560fe9d0de9013bc323d5718730d5c1543261b48a7bcb0717b93600654426040516111209291906120b0565b60405180910390a2600067ffffffffffffffff811115611143576111426119fb565b5b6040519080825280602002602001820160405280156111715781602001602082028036833780820191505090505b506005908051906020019061118792919061183f565b507f0000000000000000000000000000000000000000000000000000000000000000426111b49190611e22565b600981905550600060405180606001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001600854815260200160001515815250905080600a6000600654815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050506006600081548092919061129190611d1b565b919050555060006007819055506000600881905550505050565b7f0000000000000000000000000000000000000000000000000000000000000000426112d79190611e22565b6009819055506006547fb610b85feb28896aac627a8df6608ed5400bb75cadb7d0b34db99a180f88259360095460405161131191906118ff565b60405180910390a2565b600061137d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661145b9092919063ffffffff16565b90506000815111156113dd578080602001905181019061139d9190612083565b6113dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d39061228b565b60405180910390fd5b5b505050565b7f00000000000000000000000000000000000000000000000000000000000000004261140e9190611e22565b600981905550611453600160009054906101000a900463ffffffff16600160049054906101000a900461ffff16600160069054906101000a900463ffffffff16611473565b600481905550565b606061146a848460008561168a565b90509392505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634000aea07f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634306d354886040518263ffffffff1660e01b815260040161152b91906122ca565b602060405180830381865afa158015611548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156c91906122fa565b87878760405160200161158193929190612344565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016115ae939291906123fa565b6020604051808303816000875af11580156115cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f19190612083565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b8152600401602060405180830381865afa15801561165d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168191906122fa565b90509392505050565b6060824710156116cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c6906124aa565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516116f89190612506565b60006040518083038185875af1925050503d8060008114611735576040519150601f19603f3d011682016040523d82523d6000602084013e61173a565b606091505b509150915061174b87838387611757565b92505050949350505050565b606083156117b95760008351036117b157611771856117cc565b6117b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a790612569565b60405180910390fd5b5b8290506117c4565b6117c383836117ef565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156118025781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183691906125cd565b60405180910390fd5b8280548282559060005260206000209081019282156118b8579160200282015b828111156118b75782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061185f565b5b5090506118c591906118c9565b5090565b5b808211156118e25760008160009055506001016118ca565b5090565b6000819050919050565b6118f9816118e6565b82525050565b600060208201905061191460008301846118f0565b92915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119598261192e565b9050919050565b6119698161194e565b811461197457600080fd5b50565b60008135905061198681611960565b92915050565b6000602082840312156119a2576119a1611924565b5b60006119b084828501611977565b91505092915050565b6119c2816118e6565b81146119cd57600080fd5b50565b6000813590506119df816119b9565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611a33826119ea565b810181811067ffffffffffffffff82111715611a5257611a516119fb565b5b80604052505050565b6000611a6561191a565b9050611a718282611a2a565b919050565b600067ffffffffffffffff821115611a9157611a906119fb565b5b602082029050602081019050919050565b600080fd5b6000611aba611ab584611a76565b611a5b565b90508083825260208201905060208402830185811115611add57611adc611aa2565b5b835b81811015611b065780611af288826119d0565b845260208401935050602081019050611adf565b5050509392505050565b600082601f830112611b2557611b246119e5565b5b8135611b35848260208601611aa7565b91505092915050565b60008060408385031215611b5557611b54611924565b5b6000611b63858286016119d0565b925050602083013567ffffffffffffffff811115611b8457611b83611929565b5b611b9085828601611b10565b9150509250929050565b600060208284031215611bb057611baf611924565b5b6000611bbe848285016119d0565b91505092915050565b6000819050919050565b6000611bec611be7611be28461192e565b611bc7565b61192e565b9050919050565b6000611bfe82611bd1565b9050919050565b6000611c1082611bf3565b9050919050565b611c2081611c05565b82525050565b6000602082019050611c3b6000830184611c17565b92915050565b611c4a8161194e565b82525050565b6000602082019050611c656000830184611c41565b92915050565b60008115159050919050565b611c8081611c6b565b82525050565b6000606082019050611c9b6000830186611c41565b611ca860208301856118f0565b611cb56040830184611c77565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611d26826118e6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d5857611d57611cec565b5b600182019050919050565b600082825260208201905092915050565b7f6f6e6c792056524620563220777261707065722063616e2066756c66696c6c00600082015250565b6000611daa601f83611d63565b9150611db582611d74565b602082019050919050565b60006020820190508181036000830152611dd981611d9d565b9050919050565b6000611deb826118e6565b9150611df6836118e6565b9250828202611e04816118e6565b91508282048414831517611e1b57611e1a611cec565b5b5092915050565b6000611e2d826118e6565b9150611e38836118e6565b9250828201905080821115611e5057611e4f611cec565b5b92915050565b7f52657761726420616c726561647920636c61696d656400000000000000000000600082015250565b6000611e8c601683611d63565b9150611e9782611e56565b602082019050919050565b60006020820190508181036000830152611ebb81611e7f565b9050919050565b7f4e6f2077696e6e65722079657400000000000000000000000000000000000000600082015250565b6000611ef8600d83611d63565b9150611f0382611ec2565b602082019050919050565b60006020820190508181036000830152611f2781611eeb565b9050919050565b7f4e6f206465706f73697473000000000000000000000000000000000000000000600082015250565b6000611f64600b83611d63565b9150611f6f82611f2e565b602082019050919050565b60006020820190508181036000830152611f9381611f57565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611fd4826118e6565b9150611fdf836118e6565b925082611fef57611fee611f9a565b5b828204905092915050565b6000612005826118e6565b9150612010836118e6565b925082820390508181111561202857612027611cec565b5b92915050565b60006040820190506120436000830185611c41565b61205060208301846118f0565b9392505050565b61206081611c6b565b811461206b57600080fd5b50565b60008151905061207d81612057565b92915050565b60006020828403121561209957612098611924565b5b60006120a78482850161206e565b91505092915050565b60006040820190506120c560008301856118f0565b6120d260208301846118f0565b9392505050565b60006120e4826118e6565b91506120ef836118e6565b9250826120ff576120fe611f9a565b5b828206905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000612140601f83611d63565b915061214b8261210a565b602082019050919050565b6000602082019050818103600083015261216f81612133565b9050919050565b600060608201905061218b6000830186611c41565b6121986020830185611c41565b6121a560408301846118f0565b949350505050565b7f446561646c696e65206e6f742072656163686564207965740000000000000000600082015250565b60006121e3601883611d63565b91506121ee826121ad565b602082019050919050565b60006020820190508181036000830152612212816121d6565b9050919050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612275602a83611d63565b915061228082612219565b604082019050919050565b600060208201905081810360008301526122a481612268565b9050919050565b600063ffffffff82169050919050565b6122c4816122ab565b82525050565b60006020820190506122df60008301846122bb565b92915050565b6000815190506122f4816119b9565b92915050565b6000602082840312156123105761230f611924565b5b600061231e848285016122e5565b91505092915050565b600061ffff82169050919050565b61233e81612327565b82525050565b600060608201905061235960008301866122bb565b6123666020830185612335565b61237360408301846122bb565b949350505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156123b557808201518184015260208101905061239a565b60008484015250505050565b60006123cc8261237b565b6123d68185612386565b93506123e6818560208601612397565b6123ef816119ea565b840191505092915050565b600060608201905061240f6000830186611c41565b61241c60208301856118f0565b818103604083015261242e81846123c1565b9050949350505050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612494602683611d63565b915061249f82612438565b604082019050919050565b600060208201905081810360008301526124c381612487565b9050919050565b600081905092915050565b60006124e08261237b565b6124ea81856124ca565b93506124fa818560208601612397565b80840191505092915050565b600061251282846124d5565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612553601d83611d63565b915061255e8261251d565b602082019050919050565b6000602082019050818103600083015261258281612546565b9050919050565b600081519050919050565b600061259f82612589565b6125a98185611d63565b93506125b9818560208601612397565b6125c2816119ea565b840191505092915050565b600060208201905081810360008301526125e78184612594565b90509291505056fea264697066735822122010f325ef33c845785b0655a5010382e104bb942ec361c6b41d80b3daeb8b5ac564736f6c63430008110033000000000000000000000000d55fe0a9b00bb8c2691fc5b30a99496b7a7c366500000000000000000000000004e3faa5758a2768ddafd34d91e7d04eef8feae200000000000000000000000002eb294af5e1fe16eb701f164bf8cf396e0cd8aa0000000000000000000000000000000000000000000000000000048c27395000000000000000000000000000000000000000000000000000000000000001518000000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a7000000000000000000000000488db574c77dd27a07f9c97bac673bc8e9fc6bf3

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806342619f66116100c3578063bd06f3f11161007c578063bd06f3f11461035b578063be07ae7714610379578063ea1ecfb714610397578063f3871a15146103b5578063f71d96cb146103e5578063fc46925f146104155761014c565b806342619f66146102a9578063482853c9146102c7578063520198a8146102e55780638474e28314610303578063ada07fa014610321578063b9419a1b1461033d5761014c565b80631209b1f6116101155780631209b1f6146101f95780631f0e214b146102175780631fe543e3146102355780632f366637146102515780633013ce291461026d57806338a83aeb1461028b5761014c565b80626d6cae14610151578063065adc451461016f5780630ac012d41461018d5780630e6bf4f3146101bd5780630f96a8ed146101db575b600080fd5b610159610447565b60405161016691906118ff565b60405180910390f35b61017761044d565b60405161018491906118ff565b60405180910390f35b6101a760048036038101906101a2919061198c565b610456565b6040516101b491906118ff565b60405180910390f35b6101c561050a565b6040516101d291906118ff565b60405180910390f35b6101e3610514565b6040516101f091906118ff565b60405180910390f35b61020161051a565b60405161020e91906118ff565b60405180910390f35b61021f61053e565b60405161022c91906118ff565b60405180910390f35b61024f600480360381019061024a9190611b3e565b610548565b005b61026b60048036038101906102669190611b9a565b6105e4565b005b61027561082f565b6040516102829190611c26565b60405180910390f35b610293610853565b6040516102a091906118ff565b60405180910390f35b6102b1610859565b6040516102be91906118ff565b60405180910390f35b6102cf61085f565b6040516102dc9190611c50565b60405180910390f35b6102ed610883565b6040516102fa91906118ff565b60405180910390f35b61030b61088d565b6040516103189190611c50565b60405180910390f35b61033b60048036038101906103369190611b9a565b6108b1565b005b610345610d13565b6040516103529190611c26565b60405180910390f35b610363610d37565b60405161037091906118ff565b60405180910390f35b610381610d5b565b60405161038e9190611c50565b60405180910390f35b61039f610d7f565b6040516103ac91906118ff565b60405180910390f35b6103cf60048036038101906103ca9190611b9a565b610d85565b6040516103dc9190611c50565b60405180910390f35b6103ff60048036038101906103fa9190611b9a565b610dc5565b60405161040c9190611c50565b60405180910390f35b61042f600480360381019061042a9190611b9a565b610e04565b60405161043e93929190611c86565b60405180910390f35b60045481565b64174876e80081565b6000806000905060005b600580549050811015610500578373ffffffffffffffffffffffffffffffffffffffff166005828154811061049857610497611cbd565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036104ed5781806104e990611d1b565b9250505b80806104f890611d1b565b915050610460565b5080915050919050565b6000600654905090565b60095481565b7f0000000000000000000000000000000000000000000000000000048c2739500081565b6000600854905090565b7f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105cd90611dc0565b60405180910390fd5b6105e08282610e5b565b5050565b6105ec610ec6565b610669337f00000000000000000000000004e3faa5758a2768ddafd34d91e7d04eef8feae28364174876e8006106229190611de0565b7f000000000000000000000000488db574c77dd27a07f9c97bac673bc8e9fc6bf373ffffffffffffffffffffffffffffffffffffffff16610f15909392919063ffffffff16565b6106e133307f0000000000000000000000000000000000000000000000000000048c273950008461069a9190611de0565b7f00000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a773ffffffffffffffffffffffffffffffffffffffff16610f15909392919063ffffffff16565b7f0000000000000000000000000000000000000000000000000000048c273950008161070d9190611de0565b6008600082825461071e9190611e22565b9250508190555080600760008282546107379190611e22565b9250508190555060005b818110156107bf576005339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080806107b790611d1b565b915050610741565b506006543373ffffffffffffffffffffffffffffffffffffffff167fb0ebd247b49b0f0079dfe3093ede3e56ddb43164363f38bf1576023c076ab4f28360405161080991906118ff565b60405180910390a360095442111561082457610823610f9e565b5b61082c610fec565b50565b7f00000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a781565b6101f481565b60035481565b7f00000000000000000000000002eb294af5e1fe16eb701f164bf8cf396e0cd8aa81565b6000600754905090565b7f00000000000000000000000004e3faa5758a2768ddafd34d91e7d04eef8feae281565b6108b9610ec6565b6000600a600083815260200190815260200160002060020160009054906101000a900460ff1690508015610922576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091990611ea2565b60405180910390fd5b6000600a600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c390611f0e565b60405180910390fd5b6000600a600085815260200190815260200160002060010154905060008111610a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2190611f7a565b60405180910390fd5b60006127106107d083610a3d9190611de0565b610a479190611fc9565b905060006127106101f484610a5c9190611de0565b610a669190611fc9565b90506000828285610a779190611ffa565b610a819190611ffa565b90506001600a600089815260200190815260200160002060020160006101000a81548160ff0219169083151502179055507f00000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a773ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f00000000000000000000000002eb294af5e1fe16eb701f164bf8cf396e0cd8aa856040518363ffffffff1660e01b8152600401610b2d92919061202e565b6020604051808303816000875af1158015610b4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b709190612083565b507f00000000000000000000000002eb294af5e1fe16eb701f164bf8cf396e0cd8aa73ffffffffffffffffffffffffffffffffffffffff166352c6138a846040518263ffffffff1660e01b8152600401610bca91906118ff565b600060405180830381600087803b158015610be457600080fd5b505af1158015610bf8573d6000803e3d6000fd5b50505050610c677f000000000000000000000000d55fe0a9b00bb8c2691fc5b30a99496b7a7c3665837f00000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a773ffffffffffffffffffffffffffffffffffffffff16610ff69092919063ffffffff16565b610cb285827f00000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a773ffffffffffffffffffffffffffffffffffffffff16610ff69092919063ffffffff16565b8473ffffffffffffffffffffffffffffffffffffffff167f6379339f0ae63e95e65fad18ca2a7ec4e7e3f05f3cc5f7079f4d8da8cec34faa8883604051610cfa9291906120b0565b60405180910390a2505050505050610d10610fec565b50565b7f000000000000000000000000488db574c77dd27a07f9c97bac673bc8e9fc6bf381565b7f000000000000000000000000000000000000000000000000000000000001518081565b7f000000000000000000000000d55fe0a9b00bb8c2691fc5b30a99496b7a7c366581565b6107d081565b6000600a600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60058181548110610dd557600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900460ff16905083565b6000600482600081518110610e7357610e72611cbd565b5b6020026020010151610e8591906120d9565b03610eb95780600181518110610e9e57610e9d611cbd565b5b6020026020010151600381905550610eb461107c565b610ec2565b610ec16112ab565b5b5050565b600260005403610f0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0290612156565b60405180910390fd5b6002600081905550565b610f98846323b872dd60e01b858585604051602401610f3693929190612176565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061131b565b50505050565b6009544211610fe2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd9906121f9565b60405180910390fd5b610fea6113e2565b565b6001600081905550565b6110778363a9059cbb60e01b848460405160240161101592919061202e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061131b565b505050565b600060058054905060035461109191906120d9565b90506000600582815481106110a9576110a8611cbd565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff167f866efae43947560fe9d0de9013bc323d5718730d5c1543261b48a7bcb0717b93600654426040516111209291906120b0565b60405180910390a2600067ffffffffffffffff811115611143576111426119fb565b5b6040519080825280602002602001820160405280156111715781602001602082028036833780820191505090505b506005908051906020019061118792919061183f565b507f0000000000000000000000000000000000000000000000000000000000015180426111b49190611e22565b600981905550600060405180606001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001600854815260200160001515815250905080600a6000600654815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050506006600081548092919061129190611d1b565b919050555060006007819055506000600881905550505050565b7f0000000000000000000000000000000000000000000000000000000000015180426112d79190611e22565b6009819055506006547fb610b85feb28896aac627a8df6608ed5400bb75cadb7d0b34db99a180f88259360095460405161131191906118ff565b60405180910390a2565b600061137d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661145b9092919063ffffffff16565b90506000815111156113dd578080602001905181019061139d9190612083565b6113dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d39061228b565b60405180910390fd5b5b505050565b7f00000000000000000000000000000000000000000000000000000000000151804261140e9190611e22565b600981905550611453600160009054906101000a900463ffffffff16600160049054906101000a900461ffff16600160069054906101000a900463ffffffff16611473565b600481905550565b606061146a848460008561168a565b90509392505050565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16634000aea07f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df67f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df673ffffffffffffffffffffffffffffffffffffffff16634306d354886040518263ffffffff1660e01b815260040161152b91906122ca565b602060405180830381865afa158015611548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156c91906122fa565b87878760405160200161158193929190612344565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016115ae939291906123fa565b6020604051808303816000875af11580156115cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f19190612083565b507f0000000000000000000000005a861794b927983406fce1d062e00b9368d97df673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b8152600401602060405180830381865afa15801561165d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168191906122fa565b90509392505050565b6060824710156116cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c6906124aa565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516116f89190612506565b60006040518083038185875af1925050503d8060008114611735576040519150601f19603f3d011682016040523d82523d6000602084013e61173a565b606091505b509150915061174b87838387611757565b92505050949350505050565b606083156117b95760008351036117b157611771856117cc565b6117b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a790612569565b60405180910390fd5b5b8290506117c4565b6117c383836117ef565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156118025781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183691906125cd565b60405180910390fd5b8280548282559060005260206000209081019282156118b8579160200282015b828111156118b75782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061185f565b5b5090506118c591906118c9565b5090565b5b808211156118e25760008160009055506001016118ca565b5090565b6000819050919050565b6118f9816118e6565b82525050565b600060208201905061191460008301846118f0565b92915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119598261192e565b9050919050565b6119698161194e565b811461197457600080fd5b50565b60008135905061198681611960565b92915050565b6000602082840312156119a2576119a1611924565b5b60006119b084828501611977565b91505092915050565b6119c2816118e6565b81146119cd57600080fd5b50565b6000813590506119df816119b9565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611a33826119ea565b810181811067ffffffffffffffff82111715611a5257611a516119fb565b5b80604052505050565b6000611a6561191a565b9050611a718282611a2a565b919050565b600067ffffffffffffffff821115611a9157611a906119fb565b5b602082029050602081019050919050565b600080fd5b6000611aba611ab584611a76565b611a5b565b90508083825260208201905060208402830185811115611add57611adc611aa2565b5b835b81811015611b065780611af288826119d0565b845260208401935050602081019050611adf565b5050509392505050565b600082601f830112611b2557611b246119e5565b5b8135611b35848260208601611aa7565b91505092915050565b60008060408385031215611b5557611b54611924565b5b6000611b63858286016119d0565b925050602083013567ffffffffffffffff811115611b8457611b83611929565b5b611b9085828601611b10565b9150509250929050565b600060208284031215611bb057611baf611924565b5b6000611bbe848285016119d0565b91505092915050565b6000819050919050565b6000611bec611be7611be28461192e565b611bc7565b61192e565b9050919050565b6000611bfe82611bd1565b9050919050565b6000611c1082611bf3565b9050919050565b611c2081611c05565b82525050565b6000602082019050611c3b6000830184611c17565b92915050565b611c4a8161194e565b82525050565b6000602082019050611c656000830184611c41565b92915050565b60008115159050919050565b611c8081611c6b565b82525050565b6000606082019050611c9b6000830186611c41565b611ca860208301856118f0565b611cb56040830184611c77565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611d26826118e6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d5857611d57611cec565b5b600182019050919050565b600082825260208201905092915050565b7f6f6e6c792056524620563220777261707065722063616e2066756c66696c6c00600082015250565b6000611daa601f83611d63565b9150611db582611d74565b602082019050919050565b60006020820190508181036000830152611dd981611d9d565b9050919050565b6000611deb826118e6565b9150611df6836118e6565b9250828202611e04816118e6565b91508282048414831517611e1b57611e1a611cec565b5b5092915050565b6000611e2d826118e6565b9150611e38836118e6565b9250828201905080821115611e5057611e4f611cec565b5b92915050565b7f52657761726420616c726561647920636c61696d656400000000000000000000600082015250565b6000611e8c601683611d63565b9150611e9782611e56565b602082019050919050565b60006020820190508181036000830152611ebb81611e7f565b9050919050565b7f4e6f2077696e6e65722079657400000000000000000000000000000000000000600082015250565b6000611ef8600d83611d63565b9150611f0382611ec2565b602082019050919050565b60006020820190508181036000830152611f2781611eeb565b9050919050565b7f4e6f206465706f73697473000000000000000000000000000000000000000000600082015250565b6000611f64600b83611d63565b9150611f6f82611f2e565b602082019050919050565b60006020820190508181036000830152611f9381611f57565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611fd4826118e6565b9150611fdf836118e6565b925082611fef57611fee611f9a565b5b828204905092915050565b6000612005826118e6565b9150612010836118e6565b925082820390508181111561202857612027611cec565b5b92915050565b60006040820190506120436000830185611c41565b61205060208301846118f0565b9392505050565b61206081611c6b565b811461206b57600080fd5b50565b60008151905061207d81612057565b92915050565b60006020828403121561209957612098611924565b5b60006120a78482850161206e565b91505092915050565b60006040820190506120c560008301856118f0565b6120d260208301846118f0565b9392505050565b60006120e4826118e6565b91506120ef836118e6565b9250826120ff576120fe611f9a565b5b828206905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000612140601f83611d63565b915061214b8261210a565b602082019050919050565b6000602082019050818103600083015261216f81612133565b9050919050565b600060608201905061218b6000830186611c41565b6121986020830185611c41565b6121a560408301846118f0565b949350505050565b7f446561646c696e65206e6f742072656163686564207965740000000000000000600082015250565b60006121e3601883611d63565b91506121ee826121ad565b602082019050919050565b60006020820190508181036000830152612212816121d6565b9050919050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612275602a83611d63565b915061228082612219565b604082019050919050565b600060208201905081810360008301526122a481612268565b9050919050565b600063ffffffff82169050919050565b6122c4816122ab565b82525050565b60006020820190506122df60008301846122bb565b92915050565b6000815190506122f4816119b9565b92915050565b6000602082840312156123105761230f611924565b5b600061231e848285016122e5565b91505092915050565b600061ffff82169050919050565b61233e81612327565b82525050565b600060608201905061235960008301866122bb565b6123666020830185612335565b61237360408301846122bb565b949350505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156123b557808201518184015260208101905061239a565b60008484015250505050565b60006123cc8261237b565b6123d68185612386565b93506123e6818560208601612397565b6123ef816119ea565b840191505092915050565b600060608201905061240f6000830186611c41565b61241c60208301856118f0565b818103604083015261242e81846123c1565b9050949350505050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612494602683611d63565b915061249f82612438565b604082019050919050565b600060208201905081810360008301526124c381612487565b9050919050565b600081905092915050565b60006124e08261237b565b6124ea81856124ca565b93506124fa818560208601612397565b80840191505092915050565b600061251282846124d5565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612553601d83611d63565b915061255e8261251d565b602082019050919050565b6000602082019050818103600083015261258281612546565b9050919050565b600081519050919050565b600061259f82612589565b6125a98185611d63565b93506125b9818560208601612397565b6125c2816119ea565b840191505092915050565b600060208201905081810360008301526125e78184612594565b90509291505056fea264697066735822122010f325ef33c845785b0655a5010382e104bb942ec361c6b41d80b3daeb8b5ac564736f6c63430008110033

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

000000000000000000000000d55fe0a9b00bb8c2691fc5b30a99496b7a7c366500000000000000000000000004e3faa5758a2768ddafd34d91e7d04eef8feae200000000000000000000000002eb294af5e1fe16eb701f164bf8cf396e0cd8aa0000000000000000000000000000000000000000000000000000048c27395000000000000000000000000000000000000000000000000000000000000001518000000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a7000000000000000000000000488db574c77dd27a07f9c97bac673bc8e9fc6bf3

-----Decoded View---------------
Arg [0] : _waatcaPoolAddress (address): 0xd55fe0a9b00Bb8C2691FC5B30a99496B7A7c3665
Arg [1] : _buyAndBurnContractAddress (address): 0x04E3FAa5758A2768DDAfd34D91E7D04eEf8FEae2
Arg [2] : _plsdStakingContractAddress (address): 0x02Eb294AF5e1fe16eB701f164Bf8CF396E0cD8Aa
Arg [3] : _ticketPrice (uint256): 5000000000000
Arg [4] : _timeLength (uint256): 86400
Arg [5] : _paymentToken (address): 0x34F0915a5f15a66Eba86F6a58bE1A471FB7836A7
Arg [6] : _carn (address): 0x488Db574C77dd27A07f9C97BAc673BC8E9fC6Bf3

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000d55fe0a9b00bb8c2691fc5b30a99496b7a7c3665
Arg [1] : 00000000000000000000000004e3faa5758a2768ddafd34d91e7d04eef8feae2
Arg [2] : 00000000000000000000000002eb294af5e1fe16eb701f164bf8cf396e0cd8aa
Arg [3] : 0000000000000000000000000000000000000000000000000000048c27395000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [5] : 00000000000000000000000034f0915a5f15a66eba86f6a58be1a471fb7836a7
Arg [6] : 000000000000000000000000488db574c77dd27a07f9c97bac673bc8e9fc6bf3


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

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.