Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- SuperMario
- Optimization enabled
- true
- Compiler version
- v0.8.20+commit.a1b79de6
- Optimization runs
- 200
- EVM Version
- london
- Verified at
- 2024-05-20T14:12:04.724780Z
Contract source code
// File: @openzeppelin/contracts/utils/Address.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } } // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: @openzeppelin/contracts/access/Ownable.sol // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; /** * @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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: contracts/SuperMario.sol pragma solidity 0.8.20; /** * @title SuperMario * @dev A simple betting contract where users can bet on boxes, and if their bet matches the randomly selected box, they win a prize. */ contract SuperMario is Ownable { using Address for address payable; uint256 private salt; uint256 public minBet; uint256 public maxBet; uint256 public winCoefficient; uint256 public boxesCount; uint256 public constant COEFFICIENT_DENOMINATOR = 100; struct Bet { uint256 blockNumber; uint256 amount; uint256 betNumber; uint256 salt; address player; } mapping(address => Bet[]) public bets; /** * @dev Emitted when a user places a bet. * @param user The address of the user placing the bet. * @param blockNumber The block number at which the bet is placed. * @param amount The amount of FTN sent with the bet. * @param betNumber The user's selected box number. */ event BetPlaced( address indexed user, uint256 blockNumber, uint256 amount, uint256 betNumber, uint256 salt ); /** * @dev Emitted when a user claims their prize. * @param user The address of the user claiming the prize. * @param winAmount The amount of FTN won by the user. */ event PrizeClaimed(address indexed user, uint256 winAmount); modifier notZero(uint256 number){ require(number > 0, "Number must be greater than zero"); _; } constructor() Ownable(msg.sender) { minBet = 1 * 10 ** 18; maxBet = 100 * 10 ** 18; boxesCount = 5; winCoefficient = boxesCount * COEFFICIENT_DENOMINATOR; } receive() external payable {} /** * @dev Retrieves the bets placed by a user. * @param _player The address of the user. * @return An array of Bet structs representing the user's bets. */ function getBets(address _player) public view returns (Bet[] memory) { return bets[_player]; } /** * @dev Withdraws the FTN balance from the contract. * @param _amount The amount of FTN to withdraw. */ function withdrawFTN(uint256 _amount) external onlyOwner { payable(msg.sender).sendValue(_amount); } /** * @dev Sets the minimum bet amount. * @param _minBet The new minimum bet amount. */ function setMinBet(uint256 _minBet) external onlyOwner notZero(_minBet) { minBet = _minBet; } /** * @dev Sets the maximum bet amount. * @param _maxBet The new maximum bet amount. */ function setMaxBet(uint256 _maxBet) external onlyOwner notZero(_maxBet) { maxBet = _maxBet; } /** * @dev Sets the win coefficient. * @param _winCoefficient The new win coefficient. */ function setWinCoefficient(uint256 _winCoefficient) external onlyOwner notZero(_winCoefficient) { winCoefficient = _winCoefficient; } /** * @dev Sets the number of boxes available for betting. * @param _boxesCount The new number of boxes. */ function setBoxesCount(uint256 _boxesCount) external onlyOwner notZero(_boxesCount) { boxesCount = _boxesCount; } /** * @dev Allows a user to place a bet on a box. * @param _betnum The user's selected box number. */ function play(uint256 _betnum) external payable { require( address(this).balance >= (msg.value * winCoefficient) / COEFFICIENT_DENOMINATOR, "Insufficient funds" ); require(_betnum > 0 && _betnum <= boxesCount, "Incorrect bet number"); require( msg.value >= minBet && msg.value <= maxBet, "Incorrect bet amount" ); bets[msg.sender].push(Bet(block.number, msg.value, _betnum, salt, msg.sender)); emit BetPlaced(msg.sender, block.number, msg.value, _betnum, salt); salt++; } /** * @dev Allows a user to claim their prize. */ function getPrize() external { uint256 winAmount = calculateTotalWin(msg.sender); require(winAmount > 0, "You have not win"); delete bets[msg.sender]; payable(msg.sender).sendValue(winAmount); emit PrizeClaimed(msg.sender, winAmount); } /** * @dev Calculates the total prize amount for a user. * @param _player The address of the user. * @return The total prize amount. */ function calculateTotalWin(address _player) public view returns (uint256) { uint256 totalWin; for (uint256 i = 0; i < bets[_player].length; i++) { totalWin += calculateWin(_player, i); } return totalWin; } /** * @dev Calculates the prize amount for a specific bet of a user. * @param _player The address of the user. * @param _betIndex The index of the bet in the user's array of bets. * @return The prize amount for the bet. */ function calculateWin( address _player, uint256 _betIndex ) public view returns (uint256) { Bet storage _bet = bets[_player][_betIndex]; uint256 winNum = getRand(_bet.blockNumber, _bet.salt, _player); if (_bet.betNumber == winNum) { return (_bet.amount * winCoefficient) / COEFFICIENT_DENOMINATOR; } else { return 0; } } /** * @dev Estimates the potential reward for a given bet amount. * @param _amount The amount of FTN staked in the bet. * @return The estimated reward based on the bet amount and the global win coefficient. * @notice This function provides an estimate of the potential reward for a bet * based on the specified amount and the globally defined win coefficient. * The estimate does not represent the actual reward claimable by the user. * To claim the actual reward, use the 'getPrize' function after the bet outcome is determined. * @dev The win coefficient used for the calculation is set by the contract owner. */ function estimateAvialableReward(uint256 _amount) public view returns(uint256){ return _amount * winCoefficient / COEFFICIENT_DENOMINATOR; } /** * @dev Generates a pseudo-random number based on a past block's hash. * @param _blockNumber The block number to use for randomness. * @return The pseudo-random number. */ function getRand(uint256 _blockNumber, uint256 _salt, address _player) internal view returns (uint256) { require(block.number > _blockNumber, "Block number out of range"); if(_blockNumber + 250 < block.number){ return 0; } return (uint256(keccak256(abi.encodePacked((blockhash(_blockNumber)), _salt, _player))) % boxesCount) + 1; } /** * @dev Checks if a bet is a winning bet and calculates the potential prize. * @param _blockHash The hash of the block at which the bet was placed. * @param betNum The user's selected bet number. * @param betAmount The amount of Ether staked in the bet. * @return The potential prize amount based on the bet outcome. * @dev The win coefficient used for the calculation is set by the contract owner. */ function checkWin(bytes32 _blockHash, uint256 betNum, uint256 betAmount, address _player) external view returns(uint256){ Bet storage _bet = bets[_player][bets[_player].length - 1]; uint256 winNum = (uint256(keccak256(abi.encodePacked(_blockHash, _bet.salt, _player)))% boxesCount) + 1; if(winNum == betNum){ return betAmount * winCoefficient / COEFFICIENT_DENOMINATOR; } else{ return 0; } } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"AddressInsufficientBalance","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"FailedInnerCall","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"event","name":"BetPlaced","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"blockNumber","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"betNumber","internalType":"uint256","indexed":false},{"type":"uint256","name":"salt","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"PrizeClaimed","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"winAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"COEFFICIENT_DENOMINATOR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"betNumber","internalType":"uint256"},{"type":"uint256","name":"salt","internalType":"uint256"},{"type":"address","name":"player","internalType":"address"}],"name":"bets","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"boxesCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateTotalWin","inputs":[{"type":"address","name":"_player","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateWin","inputs":[{"type":"address","name":"_player","internalType":"address"},{"type":"uint256","name":"_betIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"checkWin","inputs":[{"type":"bytes32","name":"_blockHash","internalType":"bytes32"},{"type":"uint256","name":"betNum","internalType":"uint256"},{"type":"uint256","name":"betAmount","internalType":"uint256"},{"type":"address","name":"_player","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"estimateAvialableReward","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct SuperMario.Bet[]","components":[{"type":"uint256","name":"blockNumber","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"betNumber","internalType":"uint256"},{"type":"uint256","name":"salt","internalType":"uint256"},{"type":"address","name":"player","internalType":"address"}]}],"name":"getBets","inputs":[{"type":"address","name":"_player","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"getPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxBet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"minBet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"play","inputs":[{"type":"uint256","name":"_betnum","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBoxesCount","inputs":[{"type":"uint256","name":"_boxesCount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxBet","inputs":[{"type":"uint256","name":"_maxBet","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMinBet","inputs":[{"type":"uint256","name":"_minBet","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWinCoefficient","inputs":[{"type":"uint256","name":"_winCoefficient","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"winCoefficient","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawFTN","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610073565b50670de0b6b3a764000060025568056bc75e2d63100000600355600580805561006b906064906100c3565b6004556100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80820281158282048414176100e857634e487b7160e01b600052601160045260246000fd5b92915050565b610f49806100fd6000396000f3fe60806040526004361061012e5760003560e01c8063881eff1e116100ab578063998724421161006f5780639987244214610335578063b97e707d1461034a578063c34f6b0d1461036a578063f06e7dd41461037f578063f2fde38b1461039f578063fb9213ff146103bf57600080fd5b8063881eff1e1461029757806388ea41b9146102b75780638da5cb5b146102d757806390e50774146102ff5780639619367d1461031f57600080fd5b80634a39ec90116100f25780634a39ec90146101db5780635a8c8a4a1461022c5780636898f82b14610242578063715018a61461025557806381e074ba1461026a57600080fd5b806310a650711461013a5780632e5b21681461015c578063339d2b50146101855780633a8aa6841461019b5780634024d336146101bb57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004610cee565b6103df565b005b34801561016857600080fd5b5061017260035481565b6040519081526020015b60405180910390f35b34801561019157600080fd5b5061017260055481565b3480156101a757600080fd5b5061015a6101b6366004610cee565b610417565b3480156101c757600080fd5b506101726101d6366004610cee565b61042c565b3480156101e757600080fd5b506101fb6101f6366004610d23565b61044e565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a00161017c565b34801561023857600080fd5b5061017260045481565b61015a610250366004610cee565b6104a5565b34801561026157600080fd5b5061015a61069f565b34801561027657600080fd5b5061028a610285366004610d4d565b6106b3565b60405161017c9190610d68565b3480156102a357600080fd5b5061015a6102b2366004610cee565b61075d565b3480156102c357600080fd5b5061015a6102d2366004610cee565b61078c565b3480156102e357600080fd5b506000546040516001600160a01b03909116815260200161017c565b34801561030b57600080fd5b5061015a61031a366004610cee565b6107bb565b34801561032b57600080fd5b5061017260025481565b34801561034157600080fd5b50610172606481565b34801561035657600080fd5b50610172610365366004610d23565b6107ea565b34801561037657600080fd5b5061015a61087b565b34801561038b57600080fd5b5061017261039a366004610ddf565b610925565b3480156103ab57600080fd5b5061015a6103ba366004610d4d565b610a18565b3480156103cb57600080fd5b506101726103da366004610d4d565b610a53565b6103e7610aa8565b80600081116104115760405162461bcd60e51b815260040161040890610e1e565b60405180910390fd5b50600555565b61041f610aa8565b6104293382610ad5565b50565b600060646004548361043e9190610e69565b6104489190610e96565b92915050565b6006602052816000526040600020818154811061046a57600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492955090935091906001600160a01b031685565b6064600454346104b59190610e69565b6104bf9190610e96565b4710156105035760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610408565b60008111801561051557506005548111155b6105585760405162461bcd60e51b815260206004820152601460248201527324b731b7b93932b1ba103132ba10373ab6b132b960611b6044820152606401610408565b600254341015801561056c57506003543411155b6105af5760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0818995d08185b5bdd5b9d60621b6044820152606401610408565b336000818152600660209081526040808320815160a08101835243808252348286018181528386018a815260018054606080880191825260808089018e81528a548086018c559a8e529c8c902098516005909a0290980198895593518883015591516002880155905160038701559751600490950180546001600160a01b0319166001600160a01b039096169590951790945595548451918252948101959095529184018690528301919091527f935a8686694e2b5cc90f63054b327255f6fb92db3acd6d98c5a707d4987e93e1910160405180910390a26001805490600061069783610eaa565b919050555050565b6106a7610aa8565b6106b16000610b71565b565b6001600160a01b0381166000908152600660209081526040808320805482518185028101850190935280835260609492939192909184015b828210156107525760008481526020908190206040805160a08101825260058602909201805483526001808201548486015260028201549284019290925260038101546060840152600401546001600160a01b0316608083015290835290920191016106eb565b505050509050919050565b610765610aa8565b80600081116107865760405162461bcd60e51b815260040161040890610e1e565b50600355565b610794610aa8565b80600081116107b55760405162461bcd60e51b815260040161040890610e1e565b50600255565b6107c3610aa8565b80600081116107e45760405162461bcd60e51b815260040161040890610e1e565b50600455565b6001600160a01b038216600090815260066020526040812080548291908490811061081757610817610ec3565b90600052602060002090600502019050600061083c8260000154836003015487610bc1565b905080826002015403610870576064600454836001015461085d9190610e69565b6108679190610e96565b92505050610448565b506000949350505050565b600061088633610a53565b9050600081116108cb5760405162461bcd60e51b815260206004820152601060248201526f2cb7ba903430bb32903737ba103bb4b760811b6044820152606401610408565b3360009081526006602052604081206108e391610c93565b6108ed3382610ad5565b60405181815233907f95681e512bc0fe659e195e06c283eada494316f3d801213e48e7101af92bf7709060200160405180910390a250565b6001600160a01b0381166000908152600660205260408120805482919061094e90600190610ed9565b8154811061095e5761095e610ec3565b906000526020600020906005020190506000600554878360030154866040516020016109af93929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b6040516020818303038152906040528051906020012060001c6109d29190610eec565b6109dd906001610f00565b9050858103610a09576064600454866109f69190610e69565b610a009190610e96565b92505050610a10565b6000925050505b949350505050565b610a20610aa8565b6001600160a01b038116610a4a57604051631e4fbdf760e01b815260006004820152602401610408565b61042981610b71565b60008060005b6001600160a01b038416600090815260066020526040902054811015610aa157610a8384826107ea565b610a8d9083610f00565b915080610a9981610eaa565b915050610a59565b5092915050565b6000546001600160a01b031633146106b15760405163118cdaa760e01b8152336004820152602401610408565b80471015610af85760405163cd78605960e01b8152306004820152602401610408565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b45576040519150601f19603f3d011682016040523d82523d6000602084013e610b4a565b606091505b5050905080610b6c57604051630a12f52160e11b815260040160405180910390fd5b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000834311610c125760405162461bcd60e51b815260206004820152601960248201527f426c6f636b206e756d626572206f7574206f662072616e6765000000000000006044820152606401610408565b43610c1e8560fa610f00565b1015610c2c57506000610c8c565b6005546040805186406020820152908101859052606084811b6bffffffffffffffffffffffff1916908201526074016040516020818303038152906040528051906020012060001c610c7e9190610eec565b610c89906001610f00565b90505b9392505050565b508054600082556005029060005260206000209081019061042991905b80821115610cea576000808255600182018190556002820181905560038201556004810180546001600160a01b0319169055600501610cb0565b5090565b600060208284031215610d0057600080fd5b5035919050565b80356001600160a01b0381168114610d1e57600080fd5b919050565b60008060408385031215610d3657600080fd5b610d3f83610d07565b946020939093013593505050565b600060208284031215610d5f57600080fd5b610c8c82610d07565b602080825282518282018190526000919060409081850190868401855b82811015610dd25781518051855286810151878601528581015186860152606080820151908601526080908101516001600160a01b03169085015260a09093019290850190600101610d85565b5091979650505050505050565b60008060008060808587031215610df557600080fd5b843593506020850135925060408501359150610e1360608601610d07565b905092959194509250565b6020808252818101527f4e756d626572206d7573742062652067726561746572207468616e207a65726f604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761044857610448610e53565b634e487b7160e01b600052601260045260246000fd5b600082610ea557610ea5610e80565b500490565b600060018201610ebc57610ebc610e53565b5060010190565b634e487b7160e01b600052603260045260246000fd5b8181038181111561044857610448610e53565b600082610efb57610efb610e80565b500690565b8082018082111561044857610448610e5356fea26469706673582212204d337acef1194ddd0118364c7ba489813abfa666ac84f1ab591ff1c74cac08dc64736f6c63430008140033
Deployed ByteCode
0x60806040526004361061012e5760003560e01c8063881eff1e116100ab578063998724421161006f5780639987244214610335578063b97e707d1461034a578063c34f6b0d1461036a578063f06e7dd41461037f578063f2fde38b1461039f578063fb9213ff146103bf57600080fd5b8063881eff1e1461029757806388ea41b9146102b75780638da5cb5b146102d757806390e50774146102ff5780639619367d1461031f57600080fd5b80634a39ec90116100f25780634a39ec90146101db5780635a8c8a4a1461022c5780636898f82b14610242578063715018a61461025557806381e074ba1461026a57600080fd5b806310a650711461013a5780632e5b21681461015c578063339d2b50146101855780633a8aa6841461019b5780634024d336146101bb57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004610cee565b6103df565b005b34801561016857600080fd5b5061017260035481565b6040519081526020015b60405180910390f35b34801561019157600080fd5b5061017260055481565b3480156101a757600080fd5b5061015a6101b6366004610cee565b610417565b3480156101c757600080fd5b506101726101d6366004610cee565b61042c565b3480156101e757600080fd5b506101fb6101f6366004610d23565b61044e565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a00161017c565b34801561023857600080fd5b5061017260045481565b61015a610250366004610cee565b6104a5565b34801561026157600080fd5b5061015a61069f565b34801561027657600080fd5b5061028a610285366004610d4d565b6106b3565b60405161017c9190610d68565b3480156102a357600080fd5b5061015a6102b2366004610cee565b61075d565b3480156102c357600080fd5b5061015a6102d2366004610cee565b61078c565b3480156102e357600080fd5b506000546040516001600160a01b03909116815260200161017c565b34801561030b57600080fd5b5061015a61031a366004610cee565b6107bb565b34801561032b57600080fd5b5061017260025481565b34801561034157600080fd5b50610172606481565b34801561035657600080fd5b50610172610365366004610d23565b6107ea565b34801561037657600080fd5b5061015a61087b565b34801561038b57600080fd5b5061017261039a366004610ddf565b610925565b3480156103ab57600080fd5b5061015a6103ba366004610d4d565b610a18565b3480156103cb57600080fd5b506101726103da366004610d4d565b610a53565b6103e7610aa8565b80600081116104115760405162461bcd60e51b815260040161040890610e1e565b60405180910390fd5b50600555565b61041f610aa8565b6104293382610ad5565b50565b600060646004548361043e9190610e69565b6104489190610e96565b92915050565b6006602052816000526040600020818154811061046a57600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492955090935091906001600160a01b031685565b6064600454346104b59190610e69565b6104bf9190610e96565b4710156105035760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610408565b60008111801561051557506005548111155b6105585760405162461bcd60e51b815260206004820152601460248201527324b731b7b93932b1ba103132ba10373ab6b132b960611b6044820152606401610408565b600254341015801561056c57506003543411155b6105af5760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0818995d08185b5bdd5b9d60621b6044820152606401610408565b336000818152600660209081526040808320815160a08101835243808252348286018181528386018a815260018054606080880191825260808089018e81528a548086018c559a8e529c8c902098516005909a0290980198895593518883015591516002880155905160038701559751600490950180546001600160a01b0319166001600160a01b039096169590951790945595548451918252948101959095529184018690528301919091527f935a8686694e2b5cc90f63054b327255f6fb92db3acd6d98c5a707d4987e93e1910160405180910390a26001805490600061069783610eaa565b919050555050565b6106a7610aa8565b6106b16000610b71565b565b6001600160a01b0381166000908152600660209081526040808320805482518185028101850190935280835260609492939192909184015b828210156107525760008481526020908190206040805160a08101825260058602909201805483526001808201548486015260028201549284019290925260038101546060840152600401546001600160a01b0316608083015290835290920191016106eb565b505050509050919050565b610765610aa8565b80600081116107865760405162461bcd60e51b815260040161040890610e1e565b50600355565b610794610aa8565b80600081116107b55760405162461bcd60e51b815260040161040890610e1e565b50600255565b6107c3610aa8565b80600081116107e45760405162461bcd60e51b815260040161040890610e1e565b50600455565b6001600160a01b038216600090815260066020526040812080548291908490811061081757610817610ec3565b90600052602060002090600502019050600061083c8260000154836003015487610bc1565b905080826002015403610870576064600454836001015461085d9190610e69565b6108679190610e96565b92505050610448565b506000949350505050565b600061088633610a53565b9050600081116108cb5760405162461bcd60e51b815260206004820152601060248201526f2cb7ba903430bb32903737ba103bb4b760811b6044820152606401610408565b3360009081526006602052604081206108e391610c93565b6108ed3382610ad5565b60405181815233907f95681e512bc0fe659e195e06c283eada494316f3d801213e48e7101af92bf7709060200160405180910390a250565b6001600160a01b0381166000908152600660205260408120805482919061094e90600190610ed9565b8154811061095e5761095e610ec3565b906000526020600020906005020190506000600554878360030154866040516020016109af93929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b6040516020818303038152906040528051906020012060001c6109d29190610eec565b6109dd906001610f00565b9050858103610a09576064600454866109f69190610e69565b610a009190610e96565b92505050610a10565b6000925050505b949350505050565b610a20610aa8565b6001600160a01b038116610a4a57604051631e4fbdf760e01b815260006004820152602401610408565b61042981610b71565b60008060005b6001600160a01b038416600090815260066020526040902054811015610aa157610a8384826107ea565b610a8d9083610f00565b915080610a9981610eaa565b915050610a59565b5092915050565b6000546001600160a01b031633146106b15760405163118cdaa760e01b8152336004820152602401610408565b80471015610af85760405163cd78605960e01b8152306004820152602401610408565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b45576040519150601f19603f3d011682016040523d82523d6000602084013e610b4a565b606091505b5050905080610b6c57604051630a12f52160e11b815260040160405180910390fd5b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000834311610c125760405162461bcd60e51b815260206004820152601960248201527f426c6f636b206e756d626572206f7574206f662072616e6765000000000000006044820152606401610408565b43610c1e8560fa610f00565b1015610c2c57506000610c8c565b6005546040805186406020820152908101859052606084811b6bffffffffffffffffffffffff1916908201526074016040516020818303038152906040528051906020012060001c610c7e9190610eec565b610c89906001610f00565b90505b9392505050565b508054600082556005029060005260206000209081019061042991905b80821115610cea576000808255600182018190556002820181905560038201556004810180546001600160a01b0319169055600501610cb0565b5090565b600060208284031215610d0057600080fd5b5035919050565b80356001600160a01b0381168114610d1e57600080fd5b919050565b60008060408385031215610d3657600080fd5b610d3f83610d07565b946020939093013593505050565b600060208284031215610d5f57600080fd5b610c8c82610d07565b602080825282518282018190526000919060409081850190868401855b82811015610dd25781518051855286810151878601528581015186860152606080820151908601526080908101516001600160a01b03169085015260a09093019290850190600101610d85565b5091979650505050505050565b60008060008060808587031215610df557600080fd5b843593506020850135925060408501359150610e1360608601610d07565b905092959194509250565b6020808252818101527f4e756d626572206d7573742062652067726561746572207468616e207a65726f604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761044857610448610e53565b634e487b7160e01b600052601260045260246000fd5b600082610ea557610ea5610e80565b500490565b600060018201610ebc57610ebc610e53565b5060010190565b634e487b7160e01b600052603260045260246000fd5b8181038181111561044857610448610e53565b600082610efb57610efb610e80565b500690565b8082018082111561044857610448610e5356fea26469706673582212204d337acef1194ddd0118364c7ba489813abfa666ac84f1ab591ff1c74cac08dc64736f6c63430008140033