POL Price: $0.217688 (-0.29%)
Gas: 30 GWei
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Redeem695370142025-03-26 21:06:0727 days ago1743023167IN
0x02e60b91...26c819b87
0 POL0.0056009828.86450005
Redeem655116732024-12-15 12:08:14128 days ago1734264494IN
0x02e60b91...26c819b87
0 POL0.0068474730.51840958
Redeem655064982024-12-15 9:00:29128 days ago1734253229IN
0x02e60b91...26c819b87
0 POL0.0070447431.39763108
Redeem655064372024-12-15 8:58:17128 days ago1734253097IN
0x02e60b91...26c819b87
0 POL0.0071954531.39763108
Redeem655057532024-12-15 8:34:00128 days ago1734251640IN
0x02e60b91...26c819b87
0 POL0.0070447431.39763113
Redeem655057322024-12-15 8:33:16128 days ago1734251596IN
0x02e60b91...26c819b87
0 POL0.0071954531.39763112
Redeem655056972024-12-15 8:32:02128 days ago1734251522IN
0x02e60b91...26c819b87
0 POL0.0071954531.39763112
Redeem641088082024-11-10 9:11:48163 days ago1731229908IN
0x02e60b91...26c819b87
0 POL0.0191877585.51759681
Redeem556415312024-04-09 22:03:32378 days ago1712700212IN
0x02e60b91...26c819b87
0 POL0.0100626543.9087399
Redeem556415022024-04-09 22:02:30378 days ago1712700150IN
0x02e60b91...26c819b87
0 POL0.0106140346.31469442
Redeem556413322024-04-09 21:55:56378 days ago1712699756IN
0x02e60b91...26c819b87
0 POL0.0125070854.36774447
Redeem556413132024-04-09 21:54:48378 days ago1712699688IN
0x02e60b91...26c819b87
0 POL0.0114882848.91836193
Redeem556412862024-04-09 21:53:46378 days ago1712699626IN
0x02e60b91...26c819b87
0 POL0.0122822752.29927602
Redeem556412582024-04-09 21:52:46378 days ago1712699566IN
0x02e60b91...26c819b87
0 POL0.0131636656.05233516
Redeem556412282024-04-09 21:51:40378 days ago1712699500IN
0x02e60b91...26c819b87
0 POL0.0107326145.70063263
Redeem556412082024-04-09 21:50:58378 days ago1712699458IN
0x02e60b91...26c819b87
0 POL0.0106057945.16063056
Redeem556411862024-04-09 21:50:12378 days ago1712699412IN
0x02e60b91...26c819b87
0 POL0.0108347246.13543599
Redeem556411682024-04-09 21:49:34378 days ago1712699374IN
0x02e60b91...26c819b87
0 POL0.0114955348.94924977
Redeem556411462024-04-09 21:48:46378 days ago1712699326IN
0x02e60b91...26c819b87
0 POL0.012671253.95538436
Redeem556411242024-04-09 21:48:00378 days ago1712699280IN
0x02e60b91...26c819b87
0 POL0.013014955.4188902
Redeem556411072024-04-09 21:47:24378 days ago1712699244IN
0x02e60b91...26c819b87
0 POL0.0131805156.12409701
Redeem556410852024-04-09 21:46:36378 days ago1712699196IN
0x02e60b91...26c819b87
0 POL0.0147688562.88742168
Redeem556410622024-04-09 21:45:30378 days ago1712699130IN
0x02e60b91...26c819b87
0 POL0.0134208957.14763017
Redeem556410452024-04-09 21:44:40378 days ago1712699080IN
0x02e60b91...26c819b87
0 POL0.0135825957.83619401
Redeem556410242024-04-09 21:43:26378 days ago1712699006IN
0x02e60b91...26c819b87
0 POL0.0118073650.27704755
View all transactions

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

Contract Source Code Verified (Exact Match)

Contract Name:
KongRedeemer

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license
File 1 of 11 : KongRedeemer.sol
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "Ownable.sol";
import "IERC20.sol";
import "IERC721.sol";
import "IERC1155.sol";
import "VRFConsumerBase2.sol";
import "SafeMath.sol";

/*
 *     ,_,
 *    (',')
 *    {/"\}
 *    -"-"-
 */

contract KongRedeemer is VRFConsumerBaseV2 {
	using SafeMath for uint256;

	struct vrfCall {
		uint256 tokenType;
		address ticketAdd;
		uint256 ticketId;
		uint256 index;
		address user;
		address lootAdd;
	}

	struct Loot20 {
		uint256 ticketReq;
		uint256 min;
		uint256 max;
	}

	struct Loot721 {
		uint256 ticketReq;
		uint256[] loot;
	}

	struct SubGroup {
		uint256[] tokenIds;
		uint256[] itemCount;
		uint256 totalItemCount;
	}

	struct Loot1155 {
		uint256 ticketReq;
		uint256 itemCount;
		uint256 subGroupCount;
		mapping(uint256 => SubGroup) subGroups;
	}

	address constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;

	mapping(uint256 => vrfCall) public requestData;

	// ticket add => tokenId  => redeemIndex => nftadd => array of loot
	mapping(address => mapping(uint256 => mapping(uint256 => mapping(address => Loot20)))) public loot20Array;

	// ticket add => tokenId  => redeemIndex => nftadd => array of loot
	mapping(address => mapping(uint256 => mapping(uint256 => mapping(address => Loot721)))) public loot721Array;
	// ticket add => tokenId  => redeemIndex => nftadd => array of loot
	mapping(address => mapping(uint256 => mapping(uint256 => mapping(address => Loot1155)))) public lootArray1155;

	event ItemRedeemed(address indexed user, uint256 tokenType, address lootAdd, uint256 tokenId, uint256 amount);

	constructor(address _vrfCoordinator, address _link) public VRFConsumerBaseV2(_vrfCoordinator, _link) {}

	function populateLoot20(address _ticket, uint256 _ticketId, uint256 _ticketReq, uint256 _index, address _lootAdd, uint256 _min, uint256 _max) external onlyOwner {
		loot20Array[_ticket][_ticketId][_index][_lootAdd] = Loot20(_ticketReq, _min, _max);
	}

	function populateArray721(address _ticket, uint256 _ticketId, uint256 _ticketReq, uint256 _index, address _lootAdd, uint256[] calldata _ids) external onlyOwner {
		Loot721 storage loot = loot721Array[_ticket][_ticketId][_index][_lootAdd];
		loot.ticketReq = _ticketReq;
		for (uint256 i = 0; i < _ids.length; i++) {
			loot.loot.push(_ids[i]);
			IERC721(_lootAdd).safeTransferFrom(msg.sender, address(this), _ids[i]);
		}
	}

	function populateArray1155(address _ticket, uint256 _ticketId, uint256 _ticketReq, uint256 _index, address _lootAdd, uint256[][] calldata _groupIds, uint256[][] calldata _groupCounts) external onlyOwner {
		Loot1155 storage loot1155 = lootArray1155[_ticket][_ticketId][_index][_lootAdd];
		require(loot1155.itemCount == 0);
		loot1155.ticketReq = _ticketReq;

		uint256 totalCount;
		for (uint256 i = 0; i < _groupIds.length; i++) {
			uint256 subItemCount;
			SubGroup storage sub = loot1155.subGroups[i];
			for (uint256 j = 0; j < _groupIds[i].length; j++) {
				sub.tokenIds.push(_groupIds[i][j]);
				sub.itemCount.push(_groupCounts[i][j]);
				subItemCount += _groupCounts[i][j];
			}
			sub.totalItemCount = subItemCount;
			totalCount += subItemCount;
		}
		loot1155.subGroupCount = _groupIds.length;
		loot1155.itemCount = totalCount;
	}

	function redeem(uint256 tokenType, address _ticket, uint256 _ticketId, uint256 _index, address _lootAdd) external {
		require(tokenType == 20 || tokenType == 721 || tokenType == 1155);
		uint256 ticketReq;

		if (tokenType == 721) {
			require(loot721Array[_ticket][_ticketId][_index][_lootAdd].loot.length > 0, "721: Array empty");
			ticketReq = loot721Array[_ticket][_ticketId][_index][_lootAdd].ticketReq;
		}
		else if (tokenType == 1155) {
			require(lootArray1155[_ticket][_ticketId][_index][_lootAdd].itemCount > 0, "1155: Array empty" );
			ticketReq = lootArray1155[_ticket][_ticketId][_index][_lootAdd].ticketReq;
		}
		else if (tokenType == 20) {
			require(loot20Array[_ticket][_ticketId][_index][_lootAdd].max <= IERC20(_lootAdd).balanceOf(address(this)), "Not enough tokens");
			ticketReq = loot20Array[_ticket][_ticketId][_index][_lootAdd].ticketReq;
		}
		uint256 requestId = requestRandomWords();
		requestData[requestId] = vrfCall(tokenType, _ticket, _ticketId, _index, msg.sender, _lootAdd);
		IERC1155(_ticket).safeTransferFrom(msg.sender, address(this), _ticketId, ticketReq, "");
		
	}

	function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
		vrfCall memory call = requestData[requestId];
		uint256 tokenType = call.tokenType;
		uint256 ticketReq;
		if (tokenType == 20) {
			Loot20 memory loot20 = loot20Array[call.ticketAdd][call.ticketId][call.index][call.lootAdd];
			ticketReq = loot20.ticketReq;
			if (loot20.max > IERC20(call.lootAdd).balanceOf(address(this))) {
				IERC1155(call.ticketAdd).safeTransferFrom(address(this), call.user, call.ticketId, ticketReq, "");
				return;
			}
			_redeem20(randomWords[0], call.lootAdd, call.user, loot20.min, loot20.max);
		}
		else if (tokenType == 721) {
			Loot721 storage loot721 = loot721Array[call.ticketAdd][call.ticketId][call.index][call.lootAdd];
			ticketReq = loot721.ticketReq;
			if (loot721.loot.length == 0) {
				IERC1155(call.ticketAdd).safeTransferFrom(address(this), call.user, call.ticketId, ticketReq, "");
				return;
			}
			_redeem721(loot721, randomWords[0], call.lootAdd, call.user);
		}
		else if (tokenType == 1155) {
			Loot1155 storage loot1155 = lootArray1155[call.ticketAdd][call.ticketId][call.index][call.lootAdd];
			ticketReq = loot1155.ticketReq;
			if (loot1155.itemCount == 0) {
				IERC1155(call.ticketAdd).safeTransferFrom(address(this), call.user, call.ticketId, ticketReq, "");
				return;
			}
			_redeem1155(loot1155, randomWords[0], call.lootAdd, call.user);
		}

		IERC1155(call.ticketAdd).safeTransferFrom(address(this), BURN_ADDRESS, call.ticketId, ticketReq, "");
	}

	function _redeem20(uint256 _seed, address _lootAdd, address _receiver, uint256 _min, uint256 _max) internal {
		_seed = uint256(keccak256(abi.encodePacked(_seed)));
		uint256 amount = _min + _seed % (_max - _min + 1);
		IERC20(_lootAdd).transfer(_receiver, amount);
		emit ItemRedeemed(_receiver, 20, _lootAdd, 0, amount);
	}

	function _redeem721(Loot721 storage _loot, uint256 _seed, address _lootAdd, address _receiver) internal {
		uint256 len = _loot.loot.length;
		_seed = uint256(keccak256(abi.encodePacked(_seed))) % len;
		uint256 tokenId = _loot.loot[_seed];
		_loot.loot[_seed] = _loot.loot[len - 1];
		_loot.loot.pop();
		IERC721(_lootAdd).safeTransferFrom(address(this), _receiver, tokenId);
		emit ItemRedeemed(_receiver, 721, _lootAdd, tokenId, 0);
	}

	function _redeem1155(Loot1155 storage _loot, uint256 _seed, address _lootAdd, address _receiver) internal {
		uint256 rng = uint256(keccak256(abi.encodePacked(_seed))) % _loot.itemCount;
		uint256 subGroupCount = _loot.subGroupCount;
		uint256 rngCeiling;
		uint256 returnId;

		for (uint256 i = 0; i < subGroupCount; i++) {
			rngCeiling += _loot.subGroups[i].totalItemCount;
			if (rng < rngCeiling) {
				SubGroup storage sub = _loot.subGroups[i];
				rng = uint256(keccak256(abi.encodePacked(_seed))) % sub.totalItemCount;
				uint256 itemCount = sub.tokenIds.length;
				rngCeiling = 0;
				for (uint256 j = 0; j < itemCount; j++) {
					rngCeiling += sub.itemCount[j];
					if (rng < rngCeiling) {
						sub.itemCount[j]--;
						sub.totalItemCount--;
						_loot.itemCount--;
						IERC1155(_lootAdd).safeTransferFrom(address(this), _receiver, sub.tokenIds[j], 1, "");
						emit ItemRedeemed(_receiver, 1155, _lootAdd, sub.tokenIds[j], 1);
						return;
					}
				}
			}
		}
	}

	function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4) {
		return KongRedeemer.onERC721Received.selector;
	}

	function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _value, bytes calldata _data) external returns(bytes4) {
		return KongRedeemer.onERC1155Received.selector;
	}
}

File 2 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "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.
 */
contract Ownable is Context {
    address internal _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 3 of 11 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 4 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @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);
}

File 5 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "IERC165.sol";

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

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

File 6 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

File 7 of 11 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;
}

File 8 of 11 : VRFConsumerBase2.sol
pragma solidity ^0.6.12;

import "IVRFCoordinator2.sol";
import "ILink.sol";
import "Ownable.sol";

abstract contract VRFConsumerBaseV2 is Ownable {

	struct RequestConfig {
		uint64 subId;
		uint32 callbackGasLimit;
		uint16 requestConfirmations;
		uint32 numWords;
		bytes32 keyHash;
	}

	RequestConfig public config;
	VRFCoordinatorV2Interface private COORDINATOR;
	LinkTokenInterface private LINK;


	/**
	* @param _vrfCoordinator address of VRFCoordinator contract
	*/
	// poly coord: 0xAE975071Be8F8eE67addBC1A82488F1C24858067
	// poly link:  0xb0897686c545045afc77cf20ec7a532e3120e0f1
	constructor(address _vrfCoordinator, address _link) public {
		COORDINATOR = VRFCoordinatorV2Interface(_vrfCoordinator);
		LINK = LinkTokenInterface(_link);
		
		config = RequestConfig({
			subId: 0,
			callbackGasLimit: 1000000,
			requestConfirmations: 3,
			numWords: 1,
			keyHash: 0x6e099d640cde6de9d40ac749b4b594126b0169747122711109c9985d47751f93
		});
	}

	function _initVRF(address _vrfCoordinator, address _link) internal {
		COORDINATOR = VRFCoordinatorV2Interface(_vrfCoordinator);
		LINK = LinkTokenInterface(_link);
		
		config = RequestConfig({
			subId: 0,
			callbackGasLimit: 1000000,
			requestConfirmations: 3,
			numWords: 1,
			keyHash: 0x6e099d640cde6de9d40ac749b4b594126b0169747122711109c9985d47751f93
		});
	}

	/**
	* @notice fulfillRandomness handles the VRF response. Your contract must
	* @notice implement it. See "SECURITY CONSIDERATIONS" above for important
	* @notice principles to keep in mind when implementing your fulfillRandomness
	* @notice method.
	*
	* @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
	* @dev signature, and will call it once it has verified the proof
	* @dev associated with the randomness. (It is triggered via a call to
	* @dev rawFulfillRandomness, below.)
	*
	* @param requestId The Id initially returned by requestRandomness
	* @param randomWords the VRF output expanded to the requested number of words
	*/
	function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

	// rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
	// proof. rawFulfillRandomness then calls fulfillRandomness, after validating
	// the origin of the call
	function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
		require (msg.sender == address(COORDINATOR), "!coordinator");
		fulfillRandomWords(requestId, randomWords);
	}

	  // Assumes the subscription is funded sufficiently.
	function requestRandomWords() internal returns(uint256 requestId) {
		RequestConfig memory rc = config;
		// Will revert if subscription is not set and funded.
		requestId = COORDINATOR.requestRandomWords(
			rc.keyHash,
			rc.subId,
			rc.requestConfirmations,
			rc.callbackGasLimit,
			rc.numWords
		);
	}

	function topUpSubscription(uint256 amount) external onlyOwner {
		LINK.transferAndCall(address(COORDINATOR), amount, abi.encode(config.subId));
	}

	function withdraw(uint256 amount, address to) external onlyOwner {
		LINK.transfer(to, amount);
	}

	function unsubscribe(address to) external onlyOwner {
		// Returns funds to this address
		COORDINATOR.cancelSubscription(config.subId, to);
		config.subId = 0;
	}

	function subscribe() public onlyOwner {
		// Create a subscription, current subId
		address[] memory consumers = new address[](1);
		consumers[0] = address(this);
		config.subId = COORDINATOR.createSubscription();
		COORDINATOR.addConsumer(config.subId, consumers[0]);
	}
}

File 9 of 11 : IVRFCoordinator2.sol
pragma solidity ^0.6.12;

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;
}

File 10 of 11 : ILink.sol
pragma solidity ^0.6.12;

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 11 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenType","type":"uint256"},{"indexed":false,"internalType":"address","name":"lootAdd","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ItemRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"config","outputs":[{"internalType":"uint64","name":"subId","type":"uint64"},{"internalType":"uint32","name":"callbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"requestConfirmations","type":"uint16"},{"internalType":"uint32","name":"numWords","type":"uint32"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"loot20Array","outputs":[{"internalType":"uint256","name":"ticketReq","type":"uint256"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"loot721Array","outputs":[{"internalType":"uint256","name":"ticketReq","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"lootArray1155","outputs":[{"internalType":"uint256","name":"ticketReq","type":"uint256"},{"internalType":"uint256","name":"itemCount","type":"uint256"},{"internalType":"uint256","name":"subGroupCount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_ticketId","type":"uint256"},{"internalType":"uint256","name":"_ticketReq","type":"uint256"},{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_lootAdd","type":"address"},{"internalType":"uint256[][]","name":"_groupIds","type":"uint256[][]"},{"internalType":"uint256[][]","name":"_groupCounts","type":"uint256[][]"}],"name":"populateArray1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_ticketId","type":"uint256"},{"internalType":"uint256","name":"_ticketReq","type":"uint256"},{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_lootAdd","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"populateArray721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_ticketId","type":"uint256"},{"internalType":"uint256","name":"_ticketReq","type":"uint256"},{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_lootAdd","type":"address"},{"internalType":"uint256","name":"_min","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"populateLoot20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenType","type":"uint256"},{"internalType":"address","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_ticketId","type":"uint256"},{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_lootAdd","type":"address"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requestData","outputs":[{"internalType":"uint256","name":"tokenType","type":"uint256"},{"internalType":"address","name":"ticketAdd","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"lootAdd","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"subscribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"topUpSubscription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"unsubscribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620025f7380380620025f7833981016040819052620000349162000160565b81816000620000426200015c565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600380546001600160a01b03199081166001600160a01b039485161782556004805490911692909316919091179091556040805160a08101825260008152620f42406020820152908101919091526001606082018190527f6e099d640cde6de9d40ac749b4b594126b0169747122711109c9985d47751f9360809092018290528054600160701b6001600160601b03199091166a0f424000000000000000001761ffff60601b19166c030000000000000000000000001763ffffffff60701b191617905560025550620001b79050565b3390565b6000806040838503121562000173578182fd5b825162000180816200019e565b602084015190925062000193816200019e565b809150509250929050565b6001600160a01b0381168114620001b457600080fd5b50565b61243080620001c76000396000f3fe608060405234801561001057600080fd5b50600436106101205760003560e01c8063715018a6116100ad5780638f449a05116100715780638f449a0514610265578063d4e208281461026d578063f23a6e611461028d578063f2fde38b146102a0578063fa851a4d146102b357610120565b8063715018a6146102095780637262561c1461021157806379502c551461022457806386850e931461023d5780638da5cb5b1461025057610120565b80631fe543e3116100f45780631fe543e3146101895780632536e8ca1461019c5780632adb9e3c146101be57806333329355146101e3578063470854df146101f657610120565b8062f714ce1461012557806302d0c1d51461013a578063081ea5b61461014d578063150b7a0214610160575b600080fd5b610138610133366004611ec4565b6102c6565b005b610138610148366004611d8f565b61038c565b61013861015b366004611ef0565b6104c2565b61017361016e366004611bb0565b610845565b6040516101809190612141565b60405180910390f35b610138610197366004611f45565b610856565b6101af6101aa366004611c97565b61088e565b604051610180939291906122d1565b6101d16101cc366004611e94565b6108c9565b6040516101809695949392919061229b565b6101af6101f1366004611c97565b61090f565b610138610204366004611e10565b61094a565b6101386109e6565b61013861021f366004611b8e565b610a65565b61022c610b1f565b60405161018095949392919061231d565b61013861024b366004611e94565b610b59565b610258610c45565b6040516101809190612015565b610138610c54565b61028061027b366004611c97565b610de4565b604051610180919061200c565b61017361029b366004611c1e565b610e10565b6101386102ae366004611b8e565b610e22565b6101386102c1366004611ce0565b610ed8565b6102ce61109e565b6000546001600160a01b039081169116146103045760405162461bcd60e51b81526004016102fb906121ea565b60405180910390fd5b6004805460405163a9059cbb60e01b81526001600160a01b039091169163a9059cbb91610335918591879101612085565b602060405180830381600087803b15801561034f57600080fd5b505af1158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611e74565b505050565b61039461109e565b6000546001600160a01b039081169116146103c15760405162461bcd60e51b81526004016102fb906121ea565b6001600160a01b0380881660009081526007602090815260408083208a8452825280832088845282528083209387168352929052908120868155905b828110156104b7578160010184848381811061041557fe5b835460018101855560009485526020948590209190940292909201359190920155506001600160a01b0385166342842e0e333087878681811061045457fe5b905060200201356040518463ffffffff1660e01b815260040161047993929190612029565b600060405180830381600087803b15801561049357600080fd5b505af11580156104a7573d6000803e3d6000fd5b5050600190920191506103fd9050565b505050505050505050565b84601414806104d25750846102d1145b806104de575084610483145b6104e757600080fd5b6000856102d11415610584576001600160a01b03808616600090815260076020908152604080832088845282528083208784528252808320938616835292905220600101546105485760405162461bcd60e51b81526004016102fb906121c0565b506001600160a01b0380851660009081526007602090815260408083208784528252808320868452825280832093851683529290522054610733565b85610483141561061f576001600160a01b03808616600090815260086020908152604080832088845282528083208784528252808320938616835292905220600101546105e35760405162461bcd60e51b81526004016102fb90612245565b506001600160a01b0380851660009081526008602090815260408083208784528252808320868452825280832093851683529290522054610733565b8560141415610733576040516370a0823160e01b81526001600160a01b038316906370a0823190610654903090600401612015565b60206040518083038186803b15801561066c57600080fd5b505afa158015610680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a49190611eac565b6001600160a01b038087166000908152600660209081526040808320898452825280832088845282528083209387168352929052206002015411156106fb5760405162461bcd60e51b81526004016102fb90612270565b506001600160a01b03808516600090815260066020908152604080832087845282528083208684528252808320938516835292905220545b600061073d6110a2565b6040805160c0810182528981526001600160a01b03808a1660208084018281528486018c8152606086018c815233608088018181528d881660a08a0190815260008c81526005978890528b902099518a55945160018a018054918a166001600160a01b0319928316179055935160028a015591516003890155905160048089018054928916928516929092179091559251969093018054969095169516949094179092559251637921219560e11b8152939450919263f242432a9261080a92909130918b9189910161204d565b600060405180830381600087803b15801561082457600080fd5b505af1158015610838573d6000803e3d6000fd5b5050505050505050505050565b630a85bd0160e11b95945050505050565b6003546001600160a01b031633146108805760405162461bcd60e51b81526004016102fb9061221f565b61088a8282611195565b5050565b600860209081526000948552604080862082529385528385208152918452828420909152825290208054600182015460029092015490919083565b600560208190526000918252604090912080546001820154600283015460038401546004850154949095015492946001600160a01b039283169491939092918216911686565b600660209081526000948552604080862082529385528385208152918452828420909152825290208054600182015460029092015490919083565b61095261109e565b6000546001600160a01b0390811691161461097f5760405162461bcd60e51b81526004016102fb906121ea565b6040805160608101825295865260208087019384528682019283526001600160a01b03988916600090815260068252828120988152978152818820958852948552808720939097168652919092529390922090518155905160018201559051600290910155565b6109ee61109e565b6000546001600160a01b03908116911614610a1b5760405162461bcd60e51b81526004016102fb906121ea565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610a6d61109e565b6000546001600160a01b03908116911614610a9a5760405162461bcd60e51b81526004016102fb906121ea565b600354600154604051630d7ae1d360e41b81526001600160a01b039092169163d7ae1d3091610ad9916001600160401b039091169085906004016122fb565b600060405180830381600087803b158015610af357600080fd5b505af1158015610b07573d6000803e3d6000fd5b50506001805467ffffffffffffffff19169055505050565b6001546002546001600160401b0382169163ffffffff600160401b820481169261ffff600160601b84041692600160701b90049091169085565b610b6161109e565b6000546001600160a01b03908116911614610b8e5760405162461bcd60e51b81526004016102fb906121ea565b6004546003546001546040516001600160a01b0393841693634000aea09316918591610bc6916001600160401b0316906020016122e7565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610bf39392919061209e565b602060405180830381600087803b158015610c0d57600080fd5b505af1158015610c21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088a9190611e74565b6000546001600160a01b031690565b610c5c61109e565b6000546001600160a01b03908116911614610c895760405162461bcd60e51b81526004016102fb906121ea565b604080516001808252818301909252606091602080830190803683370190505090503081600081518110610cb957fe5b6001600160a01b039283166020918202929092018101919091526003546040805163288688f960e21b81529051919093169263a21a23e49260048083019391928290030181600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d479190611fe5565b6001805467ffffffffffffffff19166001600160401b03928316179081905560035483516001600160a01b0390911692637341c10c9216908490600090610d8a57fe5b60200260200101516040518363ffffffff1660e01b8152600401610daf9291906122fb565b600060405180830381600087803b158015610dc957600080fd5b505af1158015610ddd573d6000803e3d6000fd5b5050505050565b600760209081526000948552604080862082529385528385208152918452828420909152825290205481565b63f23a6e6160e01b9695505050505050565b610e2a61109e565b6000546001600160a01b03908116911614610e575760405162461bcd60e51b81526004016102fb906121ea565b6001600160a01b038116610e7d5760405162461bcd60e51b81526004016102fb9061217a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ee061109e565b6000546001600160a01b03908116911614610f0d5760405162461bcd60e51b81526004016102fb906121ea565b6001600160a01b03808a1660009081526008602090815260408083208c845282528083208a84528252808320938916835292905220600181015415610f5157600080fd5b8781556000805b858110156110845760008181526003840160205260408120815b898985818110610f7e57fe5b9050602002810190610f909190612357565b905081101561107057818a8a86818110610fa657fe5b9050602002810190610fb89190612357565b83818110610fc257fe5b8354600180820186556000958652602095869020929095029390930135920191909155508201888886818110610ff457fe5b90506020028101906110069190612357565b8381811061101057fe5b8354600181018555600094855260209485902091909402929092013591909201555087878581811061103e57fe5b90506020028101906110509190612357565b8281811061105a57fe5b6020029190910135939093019250600101610f72565b506002018190559190910190600101610f58565b506002820194909455600101929092555050505050505050565b3390565b60006110ac611a4a565b506040805160a0810182526001546001600160401b03811680835263ffffffff600160401b830481166020850181905261ffff600160601b850416858701819052600160701b909404909116606085018190526002546080860181905260035496516305d3b1d360e41b815295966001600160a01b031695635d3b1d309561113d9592949293909291600401612108565b602060405180830381600087803b15801561115757600080fd5b505af115801561116b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118f9190611eac565b91505090565b61119d611a78565b506000828152600560208181526040808420815160c081018352815480825260018301546001600160a01b03908116958301959095526002830154938201939093526003820154606082015260048201548416608082015293015490911660a0830152909160148214156113af57611213611ac9565b50506020808301516001600160a01b0390811660009081526006835260408082208187015183528452808220606080880151845290855281832060a08801805186168552908652928290208251918201835280548083526001820154968301969096526002015481830152915190516370a0823160e01b8152919216906370a08231906112a4903090600401612015565b60206040518083038186803b1580156112bc57600080fd5b505afa1580156112d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f49190611eac565b8160400151111561137857602084015160808501516040808701519051637921219560e11b81526001600160a01b039093169263f242432a9261133d923092889060040161204d565b600060405180830381600087803b15801561135757600080fd5b505af115801561136b573d6000803e3d6000fd5b505050505050505061088a565b6113a98560008151811061138857fe5b60200260200101518560a001518660800151846020015185604001516115a5565b5061153b565b816102d1141561147457506020808301516001600160a01b039081166000908152600783526040808220818701518352845280822060608701518352845280822060a087015190931682529190925290208054600182015490919061144c57602084015160808501516040808701519051637921219560e11b81526001600160a01b039093169263f242432a9261133d923092889060040161204d565b6113a9818660008151811061145d57fe5b60200260200101518660a0015187608001516116b8565b81610483141561153b57506020808301516001600160a01b039081166000908152600883526040808220818701518352845280822060608701518352845280822060a087015190931682529190925290208054600182015490919061151157602084015160808501516040808701519051637921219560e11b81526001600160a01b039093169263f242432a9261133d923092889060040161204d565b611539818660008151811061152257fe5b60200260200101518660a001518760800151611810565b505b82602001516001600160a01b031663f242432a3061dead8660400151856040518563ffffffff1660e01b8152600401611577949392919061204d565b600060405180830381600087803b15801561159157600080fd5b505af11580156104b7573d6000803e3d6000fd5b846040516020016115b6919061200c565b6040516020818303038152906040528051906020012060001c9450600082820360010186816115e157fe5b0683019050846001600160a01b031663a9059cbb85836040518363ffffffff1660e01b8152600401611614929190612085565b602060405180830381600087803b15801561162e57600080fd5b505af1158015611642573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116669190611e74565b50836001600160a01b03167fe4198bd6c13c44cb569dad7287e50d0ba7146a0ac4401be930161ebf2bbb782d6014876000856040516116a89493929190612156565b60405180910390a2505050505050565b600184015460405181906116d090869060200161200c565b6040516020818303038152906040528051906020012060001c816116f057fe5b069350600085600101858154811061170457fe5b9060005260206000200154905085600101600183038154811061172357fe5b906000526020600020015486600101868154811061173d57fe5b6000918252602090912001556001860180548061175657fe5b60019003818190600052602060002001600090559055836001600160a01b03166342842e0e3085846040518463ffffffff1660e01b815260040161179c93929190612029565b600060405180830381600087803b1580156117b657600080fd5b505af11580156117ca573d6000803e3d6000fd5b50505050826001600160a01b03167fe4198bd6c13c44cb569dad7287e50d0ba7146a0ac4401be930161ebf2bbb782d6102d1868460006040516116a89493929190612156565b6000846001015484604051602001611828919061200c565b6040516020818303038152906040528051906020012060001c8161184857fe5b60028701549190069150600080805b838110156104b757600081815260038a016020526040902060020154929092019182851015611a3c57600081815260038a016020908152604091829020600281015492519092916118aa918c910161200c565b6040516020818303038152906040528051906020012060001c816118ca57fe5b8254919006965060009450845b81811015611a38578260010181815481106118ee57fe5b90600052602060002001548601955085881015611a305782600101818154811061191457fe5b600091825260209091200180546000199081019091556002840180548201905560018d018054909101905582546001600160a01b038b169063f242432a9030908c9087908690811061196257fe5b906000526020600020015460016040518563ffffffff1660e01b815260040161198e949392919061204d565b600060405180830381600087803b1580156119a857600080fd5b505af11580156119bc573d6000803e3d6000fd5b50505050886001600160a01b03167fe4198bd6c13c44cb569dad7287e50d0ba7146a0ac4401be930161ebf2bbb782d6104838c8660000185815481106119fe57fe5b90600052602060002001546001604051611a1b9493929190612156565b60405180910390a25050505050505050611a44565b6001016118d7565b5050505b600101611857565b50505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040518060c001604052806000815260200160006001600160a01b03168152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681525090565b60405180606001604052806000815260200160008152602001600081525090565b80356001600160a01b0381168114611b0157600080fd5b92915050565b60008083601f840112611b18578182fd5b5081356001600160401b03811115611b2e578182fd5b6020830191508360208083028501011115611b4857600080fd5b9250929050565b60008083601f840112611b60578182fd5b5081356001600160401b03811115611b76578182fd5b602083019150836020828501011115611b4857600080fd5b600060208284031215611b9f578081fd5b611ba98383611aea565b9392505050565b600080600080600060808688031215611bc7578081fd5b611bd18787611aea565b9450611be08760208801611aea565b93506040860135925060608601356001600160401b03811115611c01578182fd5b611c0d88828901611b4f565b969995985093965092949392505050565b60008060008060008060a08789031215611c36578081fd5b8635611c41816123e2565b95506020870135611c51816123e2565b9450604087013593506060870135925060808701356001600160401b03811115611c79578182fd5b611c8589828a01611b4f565b979a9699509497509295939492505050565b60008060008060808587031215611cac578384fd5b8435611cb7816123e2565b935060208501359250604085013591506060850135611cd5816123e2565b939692955090935050565b600080600080600080600080600060e08a8c031215611cfd578283fd5b8935611d08816123e2565b985060208a0135975060408a0135965060608a01359550611d2c8b60808c01611aea565b945060a08a01356001600160401b0380821115611d47578485fd5b611d538d838e01611b07565b909650945060c08c0135915080821115611d6b578384fd5b50611d788c828d01611b07565b915080935050809150509295985092959850929598565b600080600080600080600060c0888a031215611da9578283fd5b611db38989611aea565b9650602088013595506040880135945060608801359350611dd78960808a01611aea565b925060a08801356001600160401b03811115611df1578283fd5b611dfd8a828b01611b07565b989b979a50959850939692959293505050565b600080600080600080600060e0888a031215611e2a578283fd5b611e348989611aea565b9650602088013595506040880135945060608801359350611e588960808a01611aea565b925060a0880135915060c0880135905092959891949750929550565b600060208284031215611e85578081fd5b81518015158114611ba9578182fd5b600060208284031215611ea5578081fd5b5035919050565b600060208284031215611ebd578081fd5b5051919050565b60008060408385031215611ed6578182fd5b82359150611ee78460208501611aea565b90509250929050565b600080600080600060a08688031215611f07578283fd5b853594506020860135611f19816123e2565b935060408601359250606086013591506080860135611f37816123e2565b809150509295509295909350565b60008060408385031215611f57578182fd5b823591506020808401356001600160401b03811115611f74578283fd5b8401601f81018613611f84578283fd5b8035611f97611f92826123c3565b61239d565b81815283810190838501858402850186018a1015611fb3578687fd5b8694505b83851015611fd5578035835260019490940193918501918501611fb7565b5080955050505050509250929050565b600060208284031215611ff6578081fd5b81516001600160401b0381168114611ba9578182fd5b90815260200190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b038516825260208481840152606060408401528351806060850152825b818110156120df578581018301518582016080015282016120c3565b818111156120f05783608083870101525b50601f01601f19169290920160800195945050505050565b9485526001600160401b0393909316602085015261ffff91909116604084015263ffffffff908116606084015216608082015260a00190565b6001600160e01b031991909116815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526010908201526f3732313a20417272617920656d70747960801b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600c908201526b10b1b7b7b93234b730ba37b960a11b604082015260600190565b602080825260119082015270313135353a20417272617920656d70747960781b604082015260600190565b6020808252601190820152704e6f7420656e6f75676820746f6b656e7360781b604082015260600190565b9586526001600160a01b03948516602087015260408601939093526060850191909152821660808401521660a082015260c00190565b9283526020830191909152604082015260600190565b6001600160401b0391909116815260200190565b6001600160401b039290921682526001600160a01b0316602082015260400190565b6001600160401b0395909516855263ffffffff938416602086015261ffff9290921660408501529091166060830152608082015260a00190565b6000808335601e1984360301811261236d578283fd5b8301803591506001600160401b03821115612386578283fd5b6020908101925081023603821315611b4857600080fd5b6040518181016001600160401b03811182821017156123bb57600080fd5b604052919050565b60006001600160401b038211156123d8578081fd5b5060209081020190565b6001600160a01b03811681146123f757600080fd5b5056fea26469706673582212205bdda54192697b86bf096868fd1d429c7e557ce1afb75214c94d55f4cc1884f464736f6c634300060c0033000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101205760003560e01c8063715018a6116100ad5780638f449a05116100715780638f449a0514610265578063d4e208281461026d578063f23a6e611461028d578063f2fde38b146102a0578063fa851a4d146102b357610120565b8063715018a6146102095780637262561c1461021157806379502c551461022457806386850e931461023d5780638da5cb5b1461025057610120565b80631fe543e3116100f45780631fe543e3146101895780632536e8ca1461019c5780632adb9e3c146101be57806333329355146101e3578063470854df146101f657610120565b8062f714ce1461012557806302d0c1d51461013a578063081ea5b61461014d578063150b7a0214610160575b600080fd5b610138610133366004611ec4565b6102c6565b005b610138610148366004611d8f565b61038c565b61013861015b366004611ef0565b6104c2565b61017361016e366004611bb0565b610845565b6040516101809190612141565b60405180910390f35b610138610197366004611f45565b610856565b6101af6101aa366004611c97565b61088e565b604051610180939291906122d1565b6101d16101cc366004611e94565b6108c9565b6040516101809695949392919061229b565b6101af6101f1366004611c97565b61090f565b610138610204366004611e10565b61094a565b6101386109e6565b61013861021f366004611b8e565b610a65565b61022c610b1f565b60405161018095949392919061231d565b61013861024b366004611e94565b610b59565b610258610c45565b6040516101809190612015565b610138610c54565b61028061027b366004611c97565b610de4565b604051610180919061200c565b61017361029b366004611c1e565b610e10565b6101386102ae366004611b8e565b610e22565b6101386102c1366004611ce0565b610ed8565b6102ce61109e565b6000546001600160a01b039081169116146103045760405162461bcd60e51b81526004016102fb906121ea565b60405180910390fd5b6004805460405163a9059cbb60e01b81526001600160a01b039091169163a9059cbb91610335918591879101612085565b602060405180830381600087803b15801561034f57600080fd5b505af1158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611e74565b505050565b61039461109e565b6000546001600160a01b039081169116146103c15760405162461bcd60e51b81526004016102fb906121ea565b6001600160a01b0380881660009081526007602090815260408083208a8452825280832088845282528083209387168352929052908120868155905b828110156104b7578160010184848381811061041557fe5b835460018101855560009485526020948590209190940292909201359190920155506001600160a01b0385166342842e0e333087878681811061045457fe5b905060200201356040518463ffffffff1660e01b815260040161047993929190612029565b600060405180830381600087803b15801561049357600080fd5b505af11580156104a7573d6000803e3d6000fd5b5050600190920191506103fd9050565b505050505050505050565b84601414806104d25750846102d1145b806104de575084610483145b6104e757600080fd5b6000856102d11415610584576001600160a01b03808616600090815260076020908152604080832088845282528083208784528252808320938616835292905220600101546105485760405162461bcd60e51b81526004016102fb906121c0565b506001600160a01b0380851660009081526007602090815260408083208784528252808320868452825280832093851683529290522054610733565b85610483141561061f576001600160a01b03808616600090815260086020908152604080832088845282528083208784528252808320938616835292905220600101546105e35760405162461bcd60e51b81526004016102fb90612245565b506001600160a01b0380851660009081526008602090815260408083208784528252808320868452825280832093851683529290522054610733565b8560141415610733576040516370a0823160e01b81526001600160a01b038316906370a0823190610654903090600401612015565b60206040518083038186803b15801561066c57600080fd5b505afa158015610680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a49190611eac565b6001600160a01b038087166000908152600660209081526040808320898452825280832088845282528083209387168352929052206002015411156106fb5760405162461bcd60e51b81526004016102fb90612270565b506001600160a01b03808516600090815260066020908152604080832087845282528083208684528252808320938516835292905220545b600061073d6110a2565b6040805160c0810182528981526001600160a01b03808a1660208084018281528486018c8152606086018c815233608088018181528d881660a08a0190815260008c81526005978890528b902099518a55945160018a018054918a166001600160a01b0319928316179055935160028a015591516003890155905160048089018054928916928516929092179091559251969093018054969095169516949094179092559251637921219560e11b8152939450919263f242432a9261080a92909130918b9189910161204d565b600060405180830381600087803b15801561082457600080fd5b505af1158015610838573d6000803e3d6000fd5b5050505050505050505050565b630a85bd0160e11b95945050505050565b6003546001600160a01b031633146108805760405162461bcd60e51b81526004016102fb9061221f565b61088a8282611195565b5050565b600860209081526000948552604080862082529385528385208152918452828420909152825290208054600182015460029092015490919083565b600560208190526000918252604090912080546001820154600283015460038401546004850154949095015492946001600160a01b039283169491939092918216911686565b600660209081526000948552604080862082529385528385208152918452828420909152825290208054600182015460029092015490919083565b61095261109e565b6000546001600160a01b0390811691161461097f5760405162461bcd60e51b81526004016102fb906121ea565b6040805160608101825295865260208087019384528682019283526001600160a01b03988916600090815260068252828120988152978152818820958852948552808720939097168652919092529390922090518155905160018201559051600290910155565b6109ee61109e565b6000546001600160a01b03908116911614610a1b5760405162461bcd60e51b81526004016102fb906121ea565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610a6d61109e565b6000546001600160a01b03908116911614610a9a5760405162461bcd60e51b81526004016102fb906121ea565b600354600154604051630d7ae1d360e41b81526001600160a01b039092169163d7ae1d3091610ad9916001600160401b039091169085906004016122fb565b600060405180830381600087803b158015610af357600080fd5b505af1158015610b07573d6000803e3d6000fd5b50506001805467ffffffffffffffff19169055505050565b6001546002546001600160401b0382169163ffffffff600160401b820481169261ffff600160601b84041692600160701b90049091169085565b610b6161109e565b6000546001600160a01b03908116911614610b8e5760405162461bcd60e51b81526004016102fb906121ea565b6004546003546001546040516001600160a01b0393841693634000aea09316918591610bc6916001600160401b0316906020016122e7565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610bf39392919061209e565b602060405180830381600087803b158015610c0d57600080fd5b505af1158015610c21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088a9190611e74565b6000546001600160a01b031690565b610c5c61109e565b6000546001600160a01b03908116911614610c895760405162461bcd60e51b81526004016102fb906121ea565b604080516001808252818301909252606091602080830190803683370190505090503081600081518110610cb957fe5b6001600160a01b039283166020918202929092018101919091526003546040805163288688f960e21b81529051919093169263a21a23e49260048083019391928290030181600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d479190611fe5565b6001805467ffffffffffffffff19166001600160401b03928316179081905560035483516001600160a01b0390911692637341c10c9216908490600090610d8a57fe5b60200260200101516040518363ffffffff1660e01b8152600401610daf9291906122fb565b600060405180830381600087803b158015610dc957600080fd5b505af1158015610ddd573d6000803e3d6000fd5b5050505050565b600760209081526000948552604080862082529385528385208152918452828420909152825290205481565b63f23a6e6160e01b9695505050505050565b610e2a61109e565b6000546001600160a01b03908116911614610e575760405162461bcd60e51b81526004016102fb906121ea565b6001600160a01b038116610e7d5760405162461bcd60e51b81526004016102fb9061217a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ee061109e565b6000546001600160a01b03908116911614610f0d5760405162461bcd60e51b81526004016102fb906121ea565b6001600160a01b03808a1660009081526008602090815260408083208c845282528083208a84528252808320938916835292905220600181015415610f5157600080fd5b8781556000805b858110156110845760008181526003840160205260408120815b898985818110610f7e57fe5b9050602002810190610f909190612357565b905081101561107057818a8a86818110610fa657fe5b9050602002810190610fb89190612357565b83818110610fc257fe5b8354600180820186556000958652602095869020929095029390930135920191909155508201888886818110610ff457fe5b90506020028101906110069190612357565b8381811061101057fe5b8354600181018555600094855260209485902091909402929092013591909201555087878581811061103e57fe5b90506020028101906110509190612357565b8281811061105a57fe5b6020029190910135939093019250600101610f72565b506002018190559190910190600101610f58565b506002820194909455600101929092555050505050505050565b3390565b60006110ac611a4a565b506040805160a0810182526001546001600160401b03811680835263ffffffff600160401b830481166020850181905261ffff600160601b850416858701819052600160701b909404909116606085018190526002546080860181905260035496516305d3b1d360e41b815295966001600160a01b031695635d3b1d309561113d9592949293909291600401612108565b602060405180830381600087803b15801561115757600080fd5b505af115801561116b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118f9190611eac565b91505090565b61119d611a78565b506000828152600560208181526040808420815160c081018352815480825260018301546001600160a01b03908116958301959095526002830154938201939093526003820154606082015260048201548416608082015293015490911660a0830152909160148214156113af57611213611ac9565b50506020808301516001600160a01b0390811660009081526006835260408082208187015183528452808220606080880151845290855281832060a08801805186168552908652928290208251918201835280548083526001820154968301969096526002015481830152915190516370a0823160e01b8152919216906370a08231906112a4903090600401612015565b60206040518083038186803b1580156112bc57600080fd5b505afa1580156112d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f49190611eac565b8160400151111561137857602084015160808501516040808701519051637921219560e11b81526001600160a01b039093169263f242432a9261133d923092889060040161204d565b600060405180830381600087803b15801561135757600080fd5b505af115801561136b573d6000803e3d6000fd5b505050505050505061088a565b6113a98560008151811061138857fe5b60200260200101518560a001518660800151846020015185604001516115a5565b5061153b565b816102d1141561147457506020808301516001600160a01b039081166000908152600783526040808220818701518352845280822060608701518352845280822060a087015190931682529190925290208054600182015490919061144c57602084015160808501516040808701519051637921219560e11b81526001600160a01b039093169263f242432a9261133d923092889060040161204d565b6113a9818660008151811061145d57fe5b60200260200101518660a0015187608001516116b8565b81610483141561153b57506020808301516001600160a01b039081166000908152600883526040808220818701518352845280822060608701518352845280822060a087015190931682529190925290208054600182015490919061151157602084015160808501516040808701519051637921219560e11b81526001600160a01b039093169263f242432a9261133d923092889060040161204d565b611539818660008151811061152257fe5b60200260200101518660a001518760800151611810565b505b82602001516001600160a01b031663f242432a3061dead8660400151856040518563ffffffff1660e01b8152600401611577949392919061204d565b600060405180830381600087803b15801561159157600080fd5b505af11580156104b7573d6000803e3d6000fd5b846040516020016115b6919061200c565b6040516020818303038152906040528051906020012060001c9450600082820360010186816115e157fe5b0683019050846001600160a01b031663a9059cbb85836040518363ffffffff1660e01b8152600401611614929190612085565b602060405180830381600087803b15801561162e57600080fd5b505af1158015611642573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116669190611e74565b50836001600160a01b03167fe4198bd6c13c44cb569dad7287e50d0ba7146a0ac4401be930161ebf2bbb782d6014876000856040516116a89493929190612156565b60405180910390a2505050505050565b600184015460405181906116d090869060200161200c565b6040516020818303038152906040528051906020012060001c816116f057fe5b069350600085600101858154811061170457fe5b9060005260206000200154905085600101600183038154811061172357fe5b906000526020600020015486600101868154811061173d57fe5b6000918252602090912001556001860180548061175657fe5b60019003818190600052602060002001600090559055836001600160a01b03166342842e0e3085846040518463ffffffff1660e01b815260040161179c93929190612029565b600060405180830381600087803b1580156117b657600080fd5b505af11580156117ca573d6000803e3d6000fd5b50505050826001600160a01b03167fe4198bd6c13c44cb569dad7287e50d0ba7146a0ac4401be930161ebf2bbb782d6102d1868460006040516116a89493929190612156565b6000846001015484604051602001611828919061200c565b6040516020818303038152906040528051906020012060001c8161184857fe5b60028701549190069150600080805b838110156104b757600081815260038a016020526040902060020154929092019182851015611a3c57600081815260038a016020908152604091829020600281015492519092916118aa918c910161200c565b6040516020818303038152906040528051906020012060001c816118ca57fe5b8254919006965060009450845b81811015611a38578260010181815481106118ee57fe5b90600052602060002001548601955085881015611a305782600101818154811061191457fe5b600091825260209091200180546000199081019091556002840180548201905560018d018054909101905582546001600160a01b038b169063f242432a9030908c9087908690811061196257fe5b906000526020600020015460016040518563ffffffff1660e01b815260040161198e949392919061204d565b600060405180830381600087803b1580156119a857600080fd5b505af11580156119bc573d6000803e3d6000fd5b50505050886001600160a01b03167fe4198bd6c13c44cb569dad7287e50d0ba7146a0ac4401be930161ebf2bbb782d6104838c8660000185815481106119fe57fe5b90600052602060002001546001604051611a1b9493929190612156565b60405180910390a25050505050505050611a44565b6001016118d7565b5050505b600101611857565b50505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040518060c001604052806000815260200160006001600160a01b03168152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681525090565b60405180606001604052806000815260200160008152602001600081525090565b80356001600160a01b0381168114611b0157600080fd5b92915050565b60008083601f840112611b18578182fd5b5081356001600160401b03811115611b2e578182fd5b6020830191508360208083028501011115611b4857600080fd5b9250929050565b60008083601f840112611b60578182fd5b5081356001600160401b03811115611b76578182fd5b602083019150836020828501011115611b4857600080fd5b600060208284031215611b9f578081fd5b611ba98383611aea565b9392505050565b600080600080600060808688031215611bc7578081fd5b611bd18787611aea565b9450611be08760208801611aea565b93506040860135925060608601356001600160401b03811115611c01578182fd5b611c0d88828901611b4f565b969995985093965092949392505050565b60008060008060008060a08789031215611c36578081fd5b8635611c41816123e2565b95506020870135611c51816123e2565b9450604087013593506060870135925060808701356001600160401b03811115611c79578182fd5b611c8589828a01611b4f565b979a9699509497509295939492505050565b60008060008060808587031215611cac578384fd5b8435611cb7816123e2565b935060208501359250604085013591506060850135611cd5816123e2565b939692955090935050565b600080600080600080600080600060e08a8c031215611cfd578283fd5b8935611d08816123e2565b985060208a0135975060408a0135965060608a01359550611d2c8b60808c01611aea565b945060a08a01356001600160401b0380821115611d47578485fd5b611d538d838e01611b07565b909650945060c08c0135915080821115611d6b578384fd5b50611d788c828d01611b07565b915080935050809150509295985092959850929598565b600080600080600080600060c0888a031215611da9578283fd5b611db38989611aea565b9650602088013595506040880135945060608801359350611dd78960808a01611aea565b925060a08801356001600160401b03811115611df1578283fd5b611dfd8a828b01611b07565b989b979a50959850939692959293505050565b600080600080600080600060e0888a031215611e2a578283fd5b611e348989611aea565b9650602088013595506040880135945060608801359350611e588960808a01611aea565b925060a0880135915060c0880135905092959891949750929550565b600060208284031215611e85578081fd5b81518015158114611ba9578182fd5b600060208284031215611ea5578081fd5b5035919050565b600060208284031215611ebd578081fd5b5051919050565b60008060408385031215611ed6578182fd5b82359150611ee78460208501611aea565b90509250929050565b600080600080600060a08688031215611f07578283fd5b853594506020860135611f19816123e2565b935060408601359250606086013591506080860135611f37816123e2565b809150509295509295909350565b60008060408385031215611f57578182fd5b823591506020808401356001600160401b03811115611f74578283fd5b8401601f81018613611f84578283fd5b8035611f97611f92826123c3565b61239d565b81815283810190838501858402850186018a1015611fb3578687fd5b8694505b83851015611fd5578035835260019490940193918501918501611fb7565b5080955050505050509250929050565b600060208284031215611ff6578081fd5b81516001600160401b0381168114611ba9578182fd5b90815260200190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b038516825260208481840152606060408401528351806060850152825b818110156120df578581018301518582016080015282016120c3565b818111156120f05783608083870101525b50601f01601f19169290920160800195945050505050565b9485526001600160401b0393909316602085015261ffff91909116604084015263ffffffff908116606084015216608082015260a00190565b6001600160e01b031991909116815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526010908201526f3732313a20417272617920656d70747960801b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600c908201526b10b1b7b7b93234b730ba37b960a11b604082015260600190565b602080825260119082015270313135353a20417272617920656d70747960781b604082015260600190565b6020808252601190820152704e6f7420656e6f75676820746f6b656e7360781b604082015260600190565b9586526001600160a01b03948516602087015260408601939093526060850191909152821660808401521660a082015260c00190565b9283526020830191909152604082015260600190565b6001600160401b0391909116815260200190565b6001600160401b039290921682526001600160a01b0316602082015260400190565b6001600160401b0395909516855263ffffffff938416602086015261ffff9290921660408501529091166060830152608082015260a00190565b6000808335601e1984360301811261236d578283fd5b8301803591506001600160401b03821115612386578283fd5b6020908101925081023603821315611b4857600080fd5b6040518181016001600160401b03811182821017156123bb57600080fd5b604052919050565b60006001600160401b038211156123d8578081fd5b5060209081020190565b6001600160a01b03811681146123f757600080fd5b5056fea26469706673582212205bdda54192697b86bf096868fd1d429c7e557ce1afb75214c94d55f4cc1884f464736f6c634300060c0033

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

000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1

-----Decoded View---------------
Arg [0] : _vrfCoordinator (address): 0xAE975071Be8F8eE67addBC1A82488F1C24858067
Arg [1] : _link (address): 0xb0897686c545045aFc77CF20eC7A532E3120E0F1

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067
Arg [1] : 000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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.