Contract 0xa33abbbe700de342c347c5110bdb6e7e596ce9d7

Contract Overview

Balance:
0 BNB

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x40a82a657f1c751b33f4feeb75f74e351042183a589b69ee74c125291cb74742Pick Winner85487712021-05-04 14:00:59142 days 17 hrs ago0x9130fc4334921f418fbbaf87d37a57e786ee75d2 IN  0xa33abbbe700de342c347c5110bdb6e7e596ce9d70 BNB0.00134907
0x1648a3861ca928e82d36e5bdc962c1c67d6e526507a4e85626500614992ea38bGenerate Random ...85487482021-05-04 13:59:50142 days 17 hrs ago0x9130fc4334921f418fbbaf87d37a57e786ee75d2 IN  0xa33abbbe700de342c347c5110bdb6e7e596ce9d70 BNB0.00055894
0x1fee252f4fbdc1c5639d7aa44c6db0128eae509e2b17bfc8e8a4497cd6c34b4bGenerate Random ...85487122021-05-04 13:58:02142 days 17 hrs ago0x9130fc4334921f418fbbaf87d37a57e786ee75d2 IN  0xa33abbbe700de342c347c5110bdb6e7e596ce9d70 BNB0.00070894
0xe3276eec16a28b6907125250adab9699cc24a1179ed6da64cb86de0046809841Buy Ticket85486932021-05-04 13:57:05142 days 17 hrs ago0x9130fc4334921f418fbbaf87d37a57e786ee75d2 IN  0xa33abbbe700de342c347c5110bdb6e7e596ce9d70 BNB0.00135242
0xebae800b017163c992bc55a4fc5a0c1e2ecfbdf73542294477b61e32ba80dcdfPick Winner85484712021-05-04 13:45:59142 days 17 hrs ago0x9130fc4334921f418fbbaf87d37a57e786ee75d2 IN  0xa33abbbe700de342c347c5110bdb6e7e596ce9d70 BNB0.00120413
0x030b69a93d34d31487cba1b83efea33c1be516b7a55b599f54e47636189ddbd1Buy Ticket85484382021-05-04 13:44:20142 days 17 hrs ago0x9130fc4334921f418fbbaf87d37a57e786ee75d2 IN  0xa33abbbe700de342c347c5110bdb6e7e596ce9d70 BNB0.00150242
0xc1926c618ffc3ace4b6952a0ca89700c1ceabb3b0f0bd7a84f211fd9f8de7f940x6080604085482842021-05-04 13:36:38142 days 17 hrs ago0x9130fc4334921f418fbbaf87d37a57e786ee75d2 IN  Contract Creation0 BNB0.04471732
[ Download CSV Export 
Latest 6 internal transactions
Parent Txn Hash Block From To Value
0x40a82a657f1c751b33f4feeb75f74e351042183a589b69ee74c125291cb7474285487712021-05-04 14:00:59142 days 17 hrs ago 0xa33abbbe700de342c347c5110bdb6e7e596ce9d7 0xa199fe40dd4e2427b3ee18921d8af15185e94d680 BNB
0x40a82a657f1c751b33f4feeb75f74e351042183a589b69ee74c125291cb7474285487712021-05-04 14:00:59142 days 17 hrs ago 0xa33abbbe700de342c347c5110bdb6e7e596ce9d7 0xa199fe40dd4e2427b3ee18921d8af15185e94d680 BNB
0xe3276eec16a28b6907125250adab9699cc24a1179ed6da64cb86de004680984185486932021-05-04 13:57:05142 days 17 hrs ago 0xa33abbbe700de342c347c5110bdb6e7e596ce9d7 0xa199fe40dd4e2427b3ee18921d8af15185e94d680 BNB
0xe3276eec16a28b6907125250adab9699cc24a1179ed6da64cb86de004680984185486932021-05-04 13:57:05142 days 17 hrs ago 0xa33abbbe700de342c347c5110bdb6e7e596ce9d7 0xa199fe40dd4e2427b3ee18921d8af15185e94d680 BNB
0x030b69a93d34d31487cba1b83efea33c1be516b7a55b599f54e47636189ddbd185484382021-05-04 13:44:20142 days 17 hrs ago 0xa33abbbe700de342c347c5110bdb6e7e596ce9d7 0xa199fe40dd4e2427b3ee18921d8af15185e94d680 BNB
0x030b69a93d34d31487cba1b83efea33c1be516b7a55b599f54e47636189ddbd185484382021-05-04 13:44:20142 days 17 hrs ago 0xa33abbbe700de342c347c5110bdb6e7e596ce9d7 0xa199fe40dd4e2427b3ee18921d8af15185e94d680 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Lottery

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : Lottery.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract Lottery is
	Context,
	Ownable,
	ERC20("DoubleMoon Lottery", "DOUBLEMOONLOTTERY")
{
	using SafeMath for uint256;

	address public _tokenAddress;
	address public _commuAddress;
	address public _burnAddress = address(0);
	// address public _burnAddress = 0x2546BcD3c84621e976D8185a91A922aE77ECEc30;

	address private winner;
	address[] public randomPlayers;
	mapping(address => uint256) public playerRewards;

	struct PlayerInfo {
		uint256 ticket;
		uint256 index;
		bool exists;
	}

	mapping(address => PlayerInfo) public playerInfos;
	address[] public playerAddressIdxes;
	address[] public pendingPlayers;

	uint256 public _sumReward;
	uint256 public _sumToken;

	uint256 public _rewardPercent = 6;
	uint256 public _burnPercent = 8;
	uint256 public _commuPercent = 2;
	uint256 public _tokenPerTicket = 500000 * 10**6 * 10**9;
	uint256 public _minHolderToken = 500000 * 10**6 * 10**9;

	constructor(address tokenAddress, address commuAddress) {
		_tokenAddress = tokenAddress;
		_commuAddress = commuAddress;
	}

	function buyTicket() external {
		require(
			IERC20(_tokenAddress).balanceOf(_msgSender()) >= _tokenPerTicket,
			"Balance is not enough"
		);
		// ซื้อก่อน 2 ชั่วโมง

		// โอน dbm จาก user มาเก็บไว้ใน lottery
		IERC20(_tokenAddress).transferFrom(
			_msgSender(),
			address(this),
			_tokenPerTicket
		);
		pendingPlayers.push(_msgSender());
	}

	function totalReward() public view returns (uint256 reward) {
		// (2500-2000)+(2000*6%)
		if (_sumToken > 0) {
			reward = (
				IERC20(_tokenAddress).balanceOf(address(this)).sub(_sumToken)
			).add(_sumToken.mul(_rewardPercent).div(10**2));
		}
	}

	function pickWinner() public onlyOwner() {
		// ไม่อนุญาติถ้า < reward time

		generateRandomPlayers();
		address[] memory tempPending;

		//
		if (pendingPlayers.length > 0) {
			// clearPendding
			tempPending = pendingPlayers;
			for (uint256 i = 0; i < pendingPlayers.length; i++) {
				//
				addPlayer(pendingPlayers[i], 1);
				_sumToken = _sumToken.add(_tokenPerTicket);
			}
			delete pendingPlayers;
		}

		if (randomPlayers.length == 0) {
			return;
		}

		uint256 index = _random() % randomPlayers.length;
		winner = randomPlayers[index];

		uint256 reward = totalReward();


		// Burn
		uint256 burnAmount = reward.mul(_burnPercent).div(10**2);
		IERC20(_tokenAddress).transfer(_burnAddress, burnAmount);
		// Commu
		uint256 commuAmount = reward.mul(_commuPercent).div(10**2);
		IERC20(_tokenAddress).transfer(_commuAddress, commuAmount);

		// Reward to winner
		playerRewards[winner] = reward.sub(burnAmount).sub(commuAmount);
		_sumReward = _sumReward.add(playerRewards[winner]);

		// check holder token < _minHolderToken
		for (uint256 i = 0; i < randomPlayers.length; i++) {
			if (
				winner != randomPlayers[i] &&
				!existPending(tempPending, randomPlayers[i]) &&
				IERC20(_tokenAddress).balanceOf(randomPlayers[i]) <
				_minHolderToken
			) {

				deletePlayer(randomPlayers[i]);
			}
		}

		// reset player
		delete randomPlayers;
		delete tempPending;
	}

	function existPending(address[] memory tempPending, address randomPlayer)
		internal
		pure
		returns (bool)
	{
		for (uint256 i = 0; i < tempPending.length; i++) {
			if (tempPending[i] == randomPlayer) {
				return true;
			}
		}
		return false;
	}

	function claimReward() public {
		_sumReward = _sumReward.sub(playerRewards[_msgSender()]);
		IERC20(_tokenAddress).transfer(
			_msgSender(),
			playerRewards[_msgSender()]
		);
	}

	function withdrawTicket() public {
		// Withdraw from pending first
		uint256 index;
		bool foundPending = false;

		if (pendingPlayers.length > 0) {
			for (uint256 i = 0; i < pendingPlayers.length; i++) {
				if (pendingPlayers[i] == _msgSender()) {

					index = i;
					foundPending = true;
					break;
				}
			}
		}

		uint256 playerAmount;
		if (foundPending) {
			for (uint256 i = index; i < pendingPlayers.length - 1; i++) {
				pendingPlayers[i] = pendingPlayers[i + 1];
			}
			delete pendingPlayers[pendingPlayers.length - 1];
			pendingPlayers.pop();

			playerAmount = _tokenPerTicket.sub(
				_tokenPerTicket.mul(_rewardPercent).div(10**2)
			);
		} else {
			PlayerInfo memory withdrawPlayer = playerInfos[_msgSender()];
			require(withdrawPlayer.exists, "Player does not exist");
			withdrawPlayer.ticket--;
			if (withdrawPlayer.ticket <= 0) {
				deletePlayer(_msgSender());
			}
			playerAmount = _tokenPerTicket.sub(
				withdrawPlayer
					.ticket
					.mul(_tokenPerTicket)
					.mul(_rewardPercent)
					.div(10**2)
			);
		}


		require(IERC20(_tokenAddress).transfer(_msgSender(), playerAmount));
		_sumToken = _sumToken.sub(_tokenPerTicket);
	}

	function _random() private view returns (uint256) {
		return
			uint256(
				keccak256(
					abi.encodePacked(
						block.difficulty,
						block.timestamp,
						randomPlayers
					)
				)
			);
	}

	function addPlayer(address player, uint256 ticket) internal returns (bool) {
		// if user exists, add ticket
		if (playerInfos[player].exists == true) {
			playerInfos[player].ticket += ticket;
		} else {
			// else its new user
			playerAddressIdxes.push(player);
			playerInfos[player].ticket = ticket;
			playerInfos[player].index = playerAddressIdxes.length - 1;
			playerInfos[player].exists = true;
		}
		return true;
	}

	function deletePlayer(address player) internal returns (bool) {
		// if address exists
		if (playerInfos[player].exists) {
			PlayerInfo memory deletedUser = playerInfos[player];
			// if index is not the last entry
			if (deletedUser.index != playerAddressIdxes.length - 1) {
				// last playerInfos
				address lastAddress =
					playerAddressIdxes[playerAddressIdxes.length - 1];
				playerAddressIdxes[deletedUser.index] = lastAddress;
				playerInfos[lastAddress].index = deletedUser.index;
			}
			delete playerInfos[player];
			playerAddressIdxes.pop();
			return true;
		}
	}

	function totalTicket() public view returns (uint256) {
		uint256 total = 0;
		for (uint256 i = 0; i < playerAddressIdxes.length; i++) {
			total += playerInfos[playerAddressIdxes[i]].ticket;
		}
		return total;
	}

	function totalPlayer() public view returns (uint256) {
		return playerAddressIdxes.length;
	}

	function totalPendingPlayer() public view returns (uint256) {
		return pendingPlayers.length;
	}

	function generateRandomPlayers() public onlyOwner() returns (uint256) {
		//
		for (uint256 i = 0; i < playerAddressIdxes.length; i++) {
			uint256 value = playerInfos[playerAddressIdxes[i]].ticket;
			if (value > 0) {
				for (uint256 j = 0; j < value; j++) {
					randomPlayers.push(playerAddressIdxes[i]);
				}
			}
		}
		return randomPlayers.length;
	}

	function setting(
		uint256 rewardPercent,
		uint256 burnPercent,
		uint256 commuPercent,
		uint256 tokenPerTicket,
		uint256 minHolderToken
	) external onlyOwner() {
		_rewardPercent = rewardPercent;
		_burnPercent = burnPercent;
		_commuPercent = commuPercent;
		_tokenPerTicket = tokenPerTicket;
		_minHolderToken = minHolderToken;
	}

	function setToken(address tokenAddress) external onlyOwner() {
		_tokenAddress = tokenAddress;
	}

	function setCommuAddress(address commuAddress) external onlyOwner() {
		_commuAddress = commuAddress;
	}

	function getWinnerAddress() public view returns (address) {
		return winner;
	}
}

File 2 of 6 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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 3 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        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 4 of 6 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @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) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @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) {
        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, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting 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) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * 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);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * 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;
    }
}

File 5 of 6 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) public {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

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

pragma solidity >=0.6.0 <0.8.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);
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"commuAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_burnAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_burnPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_commuAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_commuPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_minHolderToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_rewardPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_sumReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_sumToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_tokenPerTicket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTicket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"generateRandomPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getWinnerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pendingPlayers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pickWinner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"playerAddressIdxes","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"playerInfos","outputs":[{"internalType":"uint256","name":"ticket","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bool","name":"exists","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"playerRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"randomPlayers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"commuAddress","type":"address"}],"name":"setCommuAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardPercent","type":"uint256"},{"internalType":"uint256","name":"burnPercent","type":"uint256"},{"internalType":"uint256","name":"commuPercent","type":"uint256"},{"internalType":"uint256","name":"tokenPerTicket","type":"uint256"},{"internalType":"uint256","name":"minHolderToken","type":"uint256"}],"name":"setting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPendingPlayer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPlayer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReward","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTicket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawTicket","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600880546001600160a01b031916815560066011556012556002601355681b1ae4d6e2ef50000060148190556015553480156200004057600080fd5b50604051620025c8380380620025c8833981810160405260408110156200006657600080fd5b5080516020918201516040805180820182526012815271446f75626c654d6f6f6e204c6f747465727960701b8186015281518083019092526011825270444f55424c454d4f4f4e4c4f545445525960781b94820194909452919290916000620000ce6200018b565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35081516200012d9060049060208501906200018f565b508051620001439060059060208401906200018f565b505060068054601260ff1990911617610100600160a81b0319166101006001600160a01b039586160217905550600780546001600160a01b031916919092161790556200022b565b3390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001d257805160ff191683800117855562000202565b8280016001018555821562000202579182015b8281111562000202578251825591602001919060010190620001e5565b506200021092915062000214565b5090565b5b8082111562000210576000815560010162000215565b61238d806200023b6000396000f3fe608060405234801561001057600080fd5b506004361061025e5760003560e01c80637aa3581c11610146578063b88a802f116100c3578063c4a9d4d611610087578063c4a9d4d6146105d6578063dd62ed3e1461061c578063e7ed56251461064a578063edca914c14610670578063eed9a91614610678578063f2fde38b146106805761025e565b8063b88a802f14610599578063b8a28336146105a1578063b9740d82146105a9578063bd3900c0146105c6578063c494a080146105ce5761025e565b80639f9db3741161010a5780639f9db3741461050b578063a457c2d714610513578063a9059cbb1461053f578063af0546081461056b578063b4e7bcbf146105915761025e565b80637aa3581c146104ce5780638b470d86146104d65780638caccf0b146104f35780638da5cb5b146104fb57806395d89b41146105035761025e565b806324e40c12116101df5780634ef903cd116101a35780634ef903cd14610480578063543fcf03146104885780635d495aea1461049057806370a0823114610498578063715018a6146104be578063750142e6146104c65761025e565b806324e40c121461040957806324f50e64146104115780632a950d8d1461042e578063313ce5671461043657806339509351146104545761025e565b806310a37c261161022657806310a37c2614610379578063144fa6d71461039d57806318160ddd146103c35780632177e510146103cb57806323b872dd146103d35761025e565b806303ae0a171461026357806306fdde031461029a57806308c6d1f314610317578063095ea7b31461031f5780630dfe2a831461035f575b600080fd5b610298600480360360a081101561027957600080fd5b50803590602081013590604081013590606081013590608001356106a6565b005b6102a261071f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102dc5781810151838201526020016102c4565b50505050905090810190601f1680156103095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102986107b6565b61034b6004803603604081101561033557600080fd5b506001600160a01b038135169060200135610acc565b604080519115158252519081900360200190f35b610367610aea565b60408051918252519081900360200190f35b610381610af0565b604080516001600160a01b039092168252519081900360200190f35b610298600480360360208110156103b357600080fd5b50356001600160a01b0316610aff565b610367610b89565b610381610b8f565b61034b600480360360608110156103e957600080fd5b506001600160a01b03813581169160208101359091169060400135610b9e565b610367610c25565b6103816004803603602081101561042757600080fd5b5035610c2b565b610367610c52565b61043e610d72565b6040805160ff9092168252519081900360200190f35b61034b6004803603604081101561046a57600080fd5b506001600160a01b038135169060200135610d7b565b610367610dc9565b610381610dcf565b610298610de3565b610367600480360360208110156104ae57600080fd5b50356001600160a01b0316611287565b6102986112a6565b610367611352565b61036761140e565b610381600480360360208110156104ec57600080fd5b5035611414565b610367611421565b610381611427565b6102a2611436565b610367611497565b61034b6004803603604081101561052957600080fd5b506001600160a01b03813516906020013561149d565b61034b6004803603604081101561055557600080fd5b506001600160a01b038135169060200135611505565b6102986004803603602081101561058157600080fd5b50356001600160a01b0316611519565b61036761159d565b6102986115a3565b610367611697565b610381600480360360208110156105bf57600080fd5b50356116ef565b6103816116fc565b61036761170b565b6105fc600480360360208110156105ec57600080fd5b50356001600160a01b0316611711565b604080519384526020840192909252151582820152519081900360600190f35b6103676004803603604081101561063257600080fd5b506001600160a01b0381358116916020013516611735565b6103676004803603602081101561066057600080fd5b50356001600160a01b0316611760565b610298611772565b61036761192a565b6102986004803603602081101561069657600080fd5b50356001600160a01b0316611930565b6106ae611a32565b6001600160a01b03166106bf611427565b6001600160a01b031614610708576040805162461bcd60e51b815260206004820181905260248201526000805160206122ca833981519152604482015290519081900360640190fd5b601194909455601292909255601355601455601555565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107ab5780601f10610780576101008083540402835291602001916107ab565b820191906000526020600020905b81548152906001019060200180831161078e57829003601f168201915b505050505090505b90565b600e5460009081901561081f5760005b600e5481101561081d576107d8611a32565b6001600160a01b0316600e82815481106107ee57fe5b6000918252602090912001546001600160a01b03161415610815578092506001915061081d565b6001016107c6565b505b6000811561092857825b600e546000190181101561089e57600e816001018154811061084757fe5b600091825260209091200154600e80546001600160a01b03909216918390811061086d57fe5b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055600101610829565b50600e805460001981019081106108b157fe5b600091825260209091200180546001600160a01b0319169055600e8054806108d557fe5b600082815260209020810160001990810180546001600160a01b031916905501905560115460145461092191610918916064916109129190611a36565b90611a96565b60145490611afd565b9050610a1b565b610930612192565b600c600061093c611a32565b6001600160a01b0316815260208082019290925260409081016000208151606081018352815481526001820154938101939093526002015460ff1615159082018190529091506109cb576040805162461bcd60e51b8152602060048201526015602482015274141b185e595c88191bd95cc81b9bdd08195e1a5cdd605a1b604482015290519081900360640190fd5b8051600019018082526109ea576109e86109e3611a32565b611b5a565b505b610a176109186064610912601154610a116014548760000151611a3690919063ffffffff16565b90611a36565b9150505b60065461010090046001600160a01b031663a9059cbb610a39611a32565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b505050506040513d6020811015610aaa57600080fd5b5051610ab557600080fd5b601454601054610ac491611afd565b601055505050565b6000610ae0610ad9611a32565b8484611cc5565b5060015b92915050565b60125481565b6009546001600160a01b031690565b610b07611a32565b6001600160a01b0316610b18611427565b6001600160a01b031614610b61576040805162461bcd60e51b815260206004820181905260248201526000805160206122ca833981519152604482015290519081900360640190fd5b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60035490565b6007546001600160a01b031681565b6000610bab848484611db1565b610c1b84610bb7611a32565b610c16856040518060600160405280602881526020016122a2602891396001600160a01b038a16600090815260026020526040812090610bf5611a32565b6001600160a01b031681526020810191909152604001600020549190611f0e565b611cc5565b5060019392505050565b600e5490565b600a8181548110610c3857fe5b6000918252602090912001546001600160a01b0316905081565b6000610c5c611a32565b6001600160a01b0316610c6d611427565b6001600160a01b031614610cb6576040805162461bcd60e51b815260206004820181905260248201526000805160206122ca833981519152604482015290519081900360640190fd5b60005b600d54811015610d6a576000600c6000600d8481548110610cd657fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205490508015610d615760005b81811015610d5f57600a600d8481548110610d1d57fe5b6000918252602080832090910154835460018181018655948452919092200180546001600160a01b0319166001600160a01b0390921691909117905501610d06565b505b50600101610cb9565b5050600a5490565b60065460ff1690565b6000610ae0610d88611a32565b84610c168560026000610d99611a32565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611fa5565b60115481565b60065461010090046001600160a01b031681565b610deb611a32565b6001600160a01b0316610dfc611427565b6001600160a01b031614610e45576040805162461bcd60e51b815260206004820181905260248201526000805160206122ca833981519152604482015290519081900360640190fd5b610e4d610c52565b50600e5460609015610f1757600e805480602002602001604051908101604052809291908181526020018280548015610eaf57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e91575b5050505050905060005b600e54811015610f0a57610eef600e8281548110610ed357fe5b6000918252602090912001546001600160a01b03166001611fff565b50601454601054610eff91611fa5565b601055600101610eb9565b50610f17600e60006121b5565b600a54610f245750611285565b600a54600090610f326120c3565b81610f3957fe5b069050600a8181548110610f4957fe5b6000918252602082200154600980546001600160a01b0319166001600160a01b03909216919091179055610f7b611352565b90506000610f99606461091260125485611a3690919063ffffffff16565b6006546008546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051939450610100909204169163a9059cbb916044808201926020929091908290030181600087803b158015610ff957600080fd5b505af115801561100d573d6000803e3d6000fd5b505050506040513d602081101561102357600080fd5b505060135460009061103d90606490610912908690611a36565b6006546007546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051939450610100909204169163a9059cbb916044808201926020929091908290030181600087803b15801561109d57600080fd5b505af11580156110b1573d6000803e3d6000fd5b505050506040513d60208110156110c757600080fd5b506110de9050816110d88585611afd565b90611afd565b600980546001600160a01b039081166000908152600b60205260408082209490945591541681522054600f5461111391611fa5565b600f5560005b600a5481101561127257600a818154811061113057fe5b6000918252602090912001546009546001600160a01b03908116911614801590611182575061118086600a838154811061116657fe5b6000918252602090912001546001600160a01b0316612137565b155b80156112395750601554600660019054906101000a90046001600160a01b03166001600160a01b03166370a08231600a84815481106111bd57fe5b60009182526020918290200154604080516001600160e01b031960e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b15801561120b57600080fd5b505afa15801561121f573d6000803e3d6000fd5b505050506040513d602081101561123557600080fd5b5051105b1561126a57611268600a828154811061124e57fe5b6000918252602090912001546001600160a01b0316611b5a565b505b600101611119565b5061127f600a60006121b5565b50505050505b565b6001600160a01b0381166000908152600160205260409020545b919050565b6112ae611a32565b6001600160a01b03166112bf611427565b6001600160a01b031614611308576040805162461bcd60e51b815260206004820181905260248201526000805160206122ca833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b601054600090156107b35761140961137c6064610912601154601054611a3690919063ffffffff16565b601054600654604080516370a0823160e01b81523060048201529051611403939261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156113d157600080fd5b505afa1580156113e5573d6000803e3d6000fd5b505050506040513d60208110156113fb57600080fd5b505190611afd565b90611fa5565b905090565b60105481565b600e8181548110610c3857fe5b60155481565b6000546001600160a01b031690565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107ab5780601f10610780576101008083540402835291602001916107ab565b60135481565b6000610ae06114aa611a32565b84610c168560405180606001604052806025815260200161233360259139600260006114d4611a32565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611f0e565b6000610ae0611512611a32565b8484611db1565b611521611a32565b6001600160a01b0316611532611427565b6001600160a01b03161461157b576040805162461bcd60e51b815260206004820181905260248201526000805160206122ca833981519152604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60145481565b6115d5600b60006115b2611a32565b6001600160a01b03168152602081019190915260400160002054600f5490611afd565b600f5560065461010090046001600160a01b031663a9059cbb6115f6611a32565b600b6000611602611a32565b6001600160a01b03166001600160a01b03168152602001908152602001600020546040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561166957600080fd5b505af115801561167d573d6000803e3d6000fd5b505050506040513d602081101561169357600080fd5b5050565b600080805b600d548110156116e957600c6000600d83815481106116b757fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054919091019060010161169c565b50905090565b600d8181548110610c3857fe5b6008546001600160a01b031681565b600d5490565b600c6020526000908152604090208054600182015460029092015490919060ff1683565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b600b6020526000908152604090205481565b60145460065461010090046001600160a01b03166370a08231611793611a32565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156117d057600080fd5b505afa1580156117e4573d6000803e3d6000fd5b505050506040513d60208110156117fa57600080fd5b50511015611847576040805162461bcd60e51b8152602060048201526015602482015274084c2d8c2dcc6ca40d2e640dcdee840cadcdeeaced605b1b604482015290519081900360640190fd5b60065461010090046001600160a01b03166323b872dd611865611a32565b306014546040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b1580156118bf57600080fd5b505af11580156118d3573d6000803e3d6000fd5b505050506040513d60208110156118e957600080fd5b50600e90506118f6611a32565b81546001810183556000928352602090922090910180546001600160a01b0319166001600160a01b03909216919091179055565b600f5481565b611938611a32565b6001600160a01b0316611949611427565b6001600160a01b031614611992576040805162461bcd60e51b815260206004820181905260248201526000805160206122ca833981519152604482015290519081900360640190fd5b6001600160a01b0381166119d75760405162461bcd60e51b81526004018080602001828103825260268152602001806122136026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b600082611a4557506000610ae4565b82820282848281611a5257fe5b0414611a8f5760405162461bcd60e51b81526004018080602001828103825260218152602001806122816021913960400191505060405180910390fd5b9392505050565b6000808211611aec576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611af557fe5b049392505050565b600082821115611b54576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b0381166000908152600c602052604081206002015460ff16156112a157611b86612192565b506001600160a01b0382166000908152600c6020908152604091829020825160608101845281548152600182015492810183905260029091015460ff16151592810192909252600d546000190114611c6057600d8054600091906000198101908110611bee57fe5b9060005260206000200160009054906101000a90046001600160a01b0316905080600d836020015181548110611c2057fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905584810151939092168152600c90915260409020600101555b6001600160a01b0383166000908152600c602052604081208181556001810191909155600201805460ff19169055600d805480611c9957fe5b600082815260209020810160001990810180546001600160a01b031916905501905550600190506112a1565b6001600160a01b038316611d0a5760405162461bcd60e51b815260040180806020018281038252602481526020018061230f6024913960400191505060405180910390fd5b6001600160a01b038216611d4f5760405162461bcd60e51b81526004018080602001828103825260228152602001806122396022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611df65760405162461bcd60e51b81526004018080602001828103825260258152602001806122ea6025913960400191505060405180910390fd5b6001600160a01b038216611e3b5760405162461bcd60e51b81526004018080602001828103825260238152602001806121f06023913960400191505060405180910390fd5b611e4683838361218d565b611e838160405180606001604052806026815260200161225b602691396001600160a01b0386166000908152600160205260409020549190611f0e565b6001600160a01b038085166000908152600160205260408082209390935590841681522054611eb29082611fa5565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611f9d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f62578181015183820152602001611f4a565b50505050905090810190601f168015611f8f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611a8f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600c602052604081206002015460ff1615156001141561204b576001600160a01b0383166000908152600c60205260409020805483019055610ae0565b50600d8054600180820183557fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb590910180546001600160a01b0319166001600160a01b039590951694851790556000938452600c6020526040909320918255546000190181830155600201805460ff19168217905590565b60004442600a60405160200180848152602001838152602001828054801561211457602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116120f6575b505060408051601f19818403018152919052805160209091012094505050505090565b6000805b835181101561218357826001600160a01b031684828151811061215a57fe5b60200260200101516001600160a01b0316141561217b576001915050610ae4565b60010161213b565b5060009392505050565b505050565b604051806060016040528060008152602001600081526020016000151581525090565b50805460008255906000526020600020908101906121d391906121d6565b50565b5b808211156121eb57600081556001016121d7565b509056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f109a1ed739f4712d26f1a86564482cf37488362a389c7958b14131905de831664736f6c63430007030033000000000000000000000000a199fe40dd4e2427b3ee18921d8af15185e94d680000000000000000000000000e46312d5759107d8988c5aab15ebcfb68e3a9c8

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

000000000000000000000000a199fe40dd4e2427b3ee18921d8af15185e94d680000000000000000000000000e46312d5759107d8988c5aab15ebcfb68e3a9c8
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a199fe40dd4e2427b3ee18921d8af15185e94d68
Arg [1] : 0000000000000000000000000e46312d5759107d8988c5aab15ebcfb68e3a9c8


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading