Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- RabbitHabit
- Optimization enabled
- true
- Compiler version
- v0.8.20+commit.a1b79de6
- Optimization runs
- 200
- EVM Version
- london
- Verified at
- 2024-05-20T14:14:50.111987Z
Contract source code
// File: @openzeppelin/contracts/utils/ReentrancyGuard.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } } // 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/RabbitHabit.sol pragma solidity 0.8.20; /** * @title RabbitHabit * @dev A simple betting contract where users can place bets and receive prizes based on the outcome. */ contract RabbitHabit is Ownable, ReentrancyGuard { using Address for address payable; uint256 public minBet; uint256 public maxBet; uint256 public stayBetCoefficient; uint256 public changedBetCoefficient; uint256 public constant COEFFICIENT_DENOMINATOR = 100; uint256 private constant DOORS_COUNT = 3; struct Bet { uint256 blockNumber; uint256 amount; uint256 firstBet; bool isChanged; } 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 firstBet The user's initial bet number. * @param isChanged Indicates whether the bet has been changed. */ event BetPlaced( address indexed user, uint256 blockNumber, uint256 amount, uint256 firstBet, bool isChanged ); /** * @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; stayBetCoefficient = 300; changedBetCoefficient = 150; } receive() external payable {} /** * @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 stay bet coefficient. * @param _stayBetCoefficient The new stay bet coefficient. */ function setStayBetCoefficient( uint256 _stayBetCoefficient ) external onlyOwner notZero(_stayBetCoefficient) { stayBetCoefficient = _stayBetCoefficient; } /** * @dev Sets the changed bet coefficient. * @param _changedBetCoefficient The new changed bet coefficient. */ function setChangedBetCoefficient( uint256 _changedBetCoefficient ) external onlyOwner notZero(_changedBetCoefficient) { changedBetCoefficient = _changedBetCoefficient; } /** * @dev Allows a user to place a bet. * @param _firstBet The user's initial bet number. * @param _isChanged Indicates whether the bet has been changed. */ function play(uint256 _firstBet, bool _isChanged) external nonReentrant payable { require( address(this).balance >= (msg.value * stayBetCoefficient) / COEFFICIENT_DENOMINATOR, "Insufficient funds" ); require(_firstBet > 0 && _firstBet < 4, "Incorrect bet number"); require( msg.value >= minBet && msg.value <= maxBet, "Incorrect bet amount" ); bets[msg.sender].push( Bet(block.number, msg.value, _firstBet, _isChanged) ); emit BetPlaced( msg.sender, block.number, msg.value, _firstBet, _isChanged ); } /** * @dev Allows a user to claim their prize. */ function getPrize() external nonReentrant { 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 Retrieves the bets placed by a user. * @param _user The address of the user. * @return An array of Bet structs representing the user's bets. */ function getBets(address _user) external view returns (Bet[] memory) { return bets[_user]; } /** * @dev Calculates the total prize amount for a user. * @param _user The address of the user. * @return The total prize amount. */ function calculateTotalWin(address _user) public view returns (uint256) { uint256 totalWin; for (uint256 i = 0; i < bets[_user].length; i++) { totalWin += calculateWin(_user, i); } return totalWin; } /** * @dev Calculates the prize amount for a specific bet of a user. * @param _user 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 _user, uint256 _betIndex ) public view returns (uint256) { Bet storage _bet = bets[_user][_betIndex]; uint256 winNum = getRand(_bet.blockNumber); if (_bet.firstBet == winNum && !_bet.isChanged) { return (_bet.amount * stayBetCoefficient) / COEFFICIENT_DENOMINATOR; } else if (_bet.firstBet != winNum && _bet.isChanged) { return (_bet.amount * changedBetCoefficient) / 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. * @param _isChanged A flag indicating whether the bet has been changed. * @return The estimated reward based on the bet amount and coefficients. * @notice This function provides an estimate of the potential reward for a bet * based on the specified amount and whether the bet has been changed. * If the bet has been changed (_isChanged is true), the reward is calculated * using the changed bet coefficient; otherwise, the stay bet coefficient is used. * 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 coefficients used for the calculation are set by the contract owner. */ function estimateAvialableReward( uint256 _amount, bool _isChanged ) public view returns (uint256) { if (_isChanged) { return (_amount * changedBetCoefficient) / COEFFICIENT_DENOMINATOR; } else { return (_amount * stayBetCoefficient) / 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) internal view returns (uint256) { require(block.number > _blockNumber); return (uint256(keccak256(abi.encodePacked((blockhash(_blockNumber))))) % DOORS_COUNT) + 1; } }
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":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"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":"firstBet","internalType":"uint256","indexed":false},{"type":"bool","name":"isChanged","internalType":"bool","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":"firstBet","internalType":"uint256"},{"type":"bool","name":"isChanged","internalType":"bool"}],"name":"bets","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateTotalWin","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateWin","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"uint256","name":"_betIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"changedBetCoefficient","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"estimateAvialableReward","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"bool","name":"_isChanged","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct RabbitHabit.Bet[]","components":[{"type":"uint256","name":"blockNumber","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"firstBet","internalType":"uint256"},{"type":"bool","name":"isChanged","internalType":"bool"}]}],"name":"getBets","inputs":[{"type":"address","name":"_user","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":"_firstBet","internalType":"uint256"},{"type":"bool","name":"_isChanged","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setChangedBetCoefficient","inputs":[{"type":"uint256","name":"_changedBetCoefficient","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":"setStayBetCoefficient","inputs":[{"type":"uint256","name":"_stayBetCoefficient","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"stayBetCoefficient","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawFTN","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100408161006e565b5060018055670de0b6b3a764000060025568056bc75e2d6310000060035561012c60045560966005556100be565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610dae806100cd6000396000f3fe6080604052600436106101235760003560e01c806388ea41b9116100a0578063b97e707d11610064578063b97e707d14610310578063c34f6b0d14610330578063e8d7232514610345578063f2fde38b14610365578063fb9213ff1461038557600080fd5b806388ea41b9146102875780638da5cb5b146102a75780638e3ae0db146102cf5780639619367d146102e557806399872442146102fb57600080fd5b80633a8aa684116100e75780633a8aa684146101c35780634a39ec90146101e3578063715018a61461022557806381e074ba1461023a578063881eff1e1461026757600080fd5b806302f715081461012f57806312508ea414610158578063127cfbe81461016d578063268b67d81461018d5780632e5b2168146101ad57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5061014560055481565b6040519081526020015b60405180910390f35b61016b610166366004610b7a565b6103a5565b005b34801561017957600080fd5b5061016b610188366004610baf565b610582565b34801561019957600080fd5b5061016b6101a8366004610baf565b6105b1565b3480156101b957600080fd5b5061014560035481565b3480156101cf57600080fd5b5061016b6101de366004610baf565b6105e0565b3480156101ef57600080fd5b506102036101fe366004610be4565b6105f5565b604080519485526020850193909352918301521515606082015260800161014f565b34801561023157600080fd5b5061016b61063e565b34801561024657600080fd5b5061025a610255366004610c0e565b610652565b60405161014f9190610c30565b34801561027357600080fd5b5061016b610282366004610baf565b6106ee565b34801561029357600080fd5b5061016b6102a2366004610baf565b61071d565b3480156102b357600080fd5b506000546040516001600160a01b03909116815260200161014f565b3480156102db57600080fd5b5061014560045481565b3480156102f157600080fd5b5061014560025481565b34801561030757600080fd5b50610145606481565b34801561031c57600080fd5b5061014561032b366004610be4565b61074c565b34801561033c57600080fd5b5061016b61081c565b34801561035157600080fd5b50610145610360366004610b7a565b6108d5565b34801561037157600080fd5b5061016b610380366004610c0e565b61090e565b34801561039157600080fd5b506101456103a0366004610c0e565b610949565b6103ad61099e565b6064600454346103bd9190610cac565b6103c79190610cd9565b4710156104105760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b6000821180156104205750600482105b6104635760405162461bcd60e51b815260206004820152601460248201527324b731b7b93932b1ba103132ba10373ab6b132b960611b6044820152606401610407565b600254341015801561047757506003543411155b6104ba5760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0818995d08185b5bdd5b9d60621b6044820152606401610407565b33600081815260066020908152604080832081516080808201845243808352348387018181528487018c81528b15156060808801828152895460018082018c559a8e529c8c902098516004909d029098019b8c559251978b01979097555160028a015593516003909801805460ff191698151598909817909755845190815294850195909552918301879052908201527f2a321dbd54cece7c335a7658d548693dbedd0e71b4b9a93e813a19af9a1ff910910160405180910390a261057e60018055565b5050565b61058a6109c8565b80600081116105ab5760405162461bcd60e51b815260040161040790610ced565b50600455565b6105b96109c8565b80600081116105da5760405162461bcd60e51b815260040161040790610ced565b50600555565b6105e86109c8565b6105f233826109f5565b50565b6006602052816000526040600020818154811061061157600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925060ff1684565b6106466109c8565b6106506000610a91565b565b6001600160a01b0381166000908152600660209081526040808320805482518185028101850190935280835260609492939192909184015b828210156106e3576000848152602090819020604080516080810182526004860290920180548352600180820154848601526002820154928401929092526003015460ff1615156060830152908352909201910161068a565b505050509050919050565b6106f66109c8565b80600081116107175760405162461bcd60e51b815260040161040790610ced565b50600355565b6107256109c8565b80600081116107465760405162461bcd60e51b815260040161040790610ced565b50600255565b6001600160a01b038216600090815260066020526040812080548291908490811061077957610779610d22565b9060005260206000209060040201905060006107988260000154610ae1565b90508082600201541480156107b25750600382015460ff16155b156107de57606460045483600101546107cb9190610cac565b6107d59190610cd9565b92505050610816565b808260020154141580156107f65750600382015460ff165b1561080f57606460055483600101546107cb9190610cac565b6000925050505b92915050565b61082461099e565b600061082f33610949565b9050600081116108745760405162461bcd60e51b815260206004820152601060248201526f2cb7ba903430bb32903737ba103bb4b760811b6044820152606401610407565b33600090815260066020526040812061088c91610b2c565b61089633826109f5565b60405181815233907f95681e512bc0fe659e195e06c283eada494316f3d801213e48e7101af92bf7709060200160405180910390a25061065060018055565b600081156108fe576064600554846108ed9190610cac565b6108f79190610cd9565b9050610816565b6064600454846108ed9190610cac565b6109166109c8565b6001600160a01b03811661094057604051631e4fbdf760e01b815260006004820152602401610407565b6105f281610a91565b60008060005b6001600160a01b03841660009081526006602052604090205481101561099757610979848261074c565b6109839083610d38565b91508061098f81610d4b565b91505061094f565b5092915050565b6002600154036109c157604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b6000546001600160a01b031633146106505760405163118cdaa760e01b8152336004820152602401610407565b80471015610a185760405163cd78605960e01b8152306004820152602401610407565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610a65576040519150601f19603f3d011682016040523d82523d6000602084013e610a6a565b606091505b5050905080610a8c57604051630a12f52160e11b815260040160405180910390fd5b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000814311610aef57600080fd5b6040805183406020820152600391016040516020818303038152906040528051906020012060001c610b219190610d64565b610816906001610d38565b50805460008255600402906000526020600020908101906105f291905b80821115610b7657600080825560018201819055600282015560038101805460ff19169055600401610b49565b5090565b60008060408385031215610b8d57600080fd5b8235915060208301358015158114610ba457600080fd5b809150509250929050565b600060208284031215610bc157600080fd5b5035919050565b80356001600160a01b0381168114610bdf57600080fd5b919050565b60008060408385031215610bf757600080fd5b610c0083610bc8565b946020939093013593505050565b600060208284031215610c2057600080fd5b610c2982610bc8565b9392505050565b602080825282518282018190526000919060409081850190868401855b82811015610c89578151805185528681015187860152858101518686015260609081015115159085015260809093019290850190600101610c4d565b5091979650505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761081657610816610c96565b634e487b7160e01b600052601260045260246000fd5b600082610ce857610ce8610cc3565b500490565b6020808252818101527f4e756d626572206d7573742062652067726561746572207468616e207a65726f604082015260600190565b634e487b7160e01b600052603260045260246000fd5b8082018082111561081657610816610c96565b600060018201610d5d57610d5d610c96565b5060010190565b600082610d7357610d73610cc3565b50069056fea2646970667358221220c16de5c6ba2265edbfac1d295c80ae1f06935da7a7abf29e4daaa82302e7d88564736f6c63430008140033
Deployed ByteCode
0x6080604052600436106101235760003560e01c806388ea41b9116100a0578063b97e707d11610064578063b97e707d14610310578063c34f6b0d14610330578063e8d7232514610345578063f2fde38b14610365578063fb9213ff1461038557600080fd5b806388ea41b9146102875780638da5cb5b146102a75780638e3ae0db146102cf5780639619367d146102e557806399872442146102fb57600080fd5b80633a8aa684116100e75780633a8aa684146101c35780634a39ec90146101e3578063715018a61461022557806381e074ba1461023a578063881eff1e1461026757600080fd5b806302f715081461012f57806312508ea414610158578063127cfbe81461016d578063268b67d81461018d5780632e5b2168146101ad57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5061014560055481565b6040519081526020015b60405180910390f35b61016b610166366004610b7a565b6103a5565b005b34801561017957600080fd5b5061016b610188366004610baf565b610582565b34801561019957600080fd5b5061016b6101a8366004610baf565b6105b1565b3480156101b957600080fd5b5061014560035481565b3480156101cf57600080fd5b5061016b6101de366004610baf565b6105e0565b3480156101ef57600080fd5b506102036101fe366004610be4565b6105f5565b604080519485526020850193909352918301521515606082015260800161014f565b34801561023157600080fd5b5061016b61063e565b34801561024657600080fd5b5061025a610255366004610c0e565b610652565b60405161014f9190610c30565b34801561027357600080fd5b5061016b610282366004610baf565b6106ee565b34801561029357600080fd5b5061016b6102a2366004610baf565b61071d565b3480156102b357600080fd5b506000546040516001600160a01b03909116815260200161014f565b3480156102db57600080fd5b5061014560045481565b3480156102f157600080fd5b5061014560025481565b34801561030757600080fd5b50610145606481565b34801561031c57600080fd5b5061014561032b366004610be4565b61074c565b34801561033c57600080fd5b5061016b61081c565b34801561035157600080fd5b50610145610360366004610b7a565b6108d5565b34801561037157600080fd5b5061016b610380366004610c0e565b61090e565b34801561039157600080fd5b506101456103a0366004610c0e565b610949565b6103ad61099e565b6064600454346103bd9190610cac565b6103c79190610cd9565b4710156104105760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b6000821180156104205750600482105b6104635760405162461bcd60e51b815260206004820152601460248201527324b731b7b93932b1ba103132ba10373ab6b132b960611b6044820152606401610407565b600254341015801561047757506003543411155b6104ba5760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0818995d08185b5bdd5b9d60621b6044820152606401610407565b33600081815260066020908152604080832081516080808201845243808352348387018181528487018c81528b15156060808801828152895460018082018c559a8e529c8c902098516004909d029098019b8c559251978b01979097555160028a015593516003909801805460ff191698151598909817909755845190815294850195909552918301879052908201527f2a321dbd54cece7c335a7658d548693dbedd0e71b4b9a93e813a19af9a1ff910910160405180910390a261057e60018055565b5050565b61058a6109c8565b80600081116105ab5760405162461bcd60e51b815260040161040790610ced565b50600455565b6105b96109c8565b80600081116105da5760405162461bcd60e51b815260040161040790610ced565b50600555565b6105e86109c8565b6105f233826109f5565b50565b6006602052816000526040600020818154811061061157600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925060ff1684565b6106466109c8565b6106506000610a91565b565b6001600160a01b0381166000908152600660209081526040808320805482518185028101850190935280835260609492939192909184015b828210156106e3576000848152602090819020604080516080810182526004860290920180548352600180820154848601526002820154928401929092526003015460ff1615156060830152908352909201910161068a565b505050509050919050565b6106f66109c8565b80600081116107175760405162461bcd60e51b815260040161040790610ced565b50600355565b6107256109c8565b80600081116107465760405162461bcd60e51b815260040161040790610ced565b50600255565b6001600160a01b038216600090815260066020526040812080548291908490811061077957610779610d22565b9060005260206000209060040201905060006107988260000154610ae1565b90508082600201541480156107b25750600382015460ff16155b156107de57606460045483600101546107cb9190610cac565b6107d59190610cd9565b92505050610816565b808260020154141580156107f65750600382015460ff165b1561080f57606460055483600101546107cb9190610cac565b6000925050505b92915050565b61082461099e565b600061082f33610949565b9050600081116108745760405162461bcd60e51b815260206004820152601060248201526f2cb7ba903430bb32903737ba103bb4b760811b6044820152606401610407565b33600090815260066020526040812061088c91610b2c565b61089633826109f5565b60405181815233907f95681e512bc0fe659e195e06c283eada494316f3d801213e48e7101af92bf7709060200160405180910390a25061065060018055565b600081156108fe576064600554846108ed9190610cac565b6108f79190610cd9565b9050610816565b6064600454846108ed9190610cac565b6109166109c8565b6001600160a01b03811661094057604051631e4fbdf760e01b815260006004820152602401610407565b6105f281610a91565b60008060005b6001600160a01b03841660009081526006602052604090205481101561099757610979848261074c565b6109839083610d38565b91508061098f81610d4b565b91505061094f565b5092915050565b6002600154036109c157604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b6000546001600160a01b031633146106505760405163118cdaa760e01b8152336004820152602401610407565b80471015610a185760405163cd78605960e01b8152306004820152602401610407565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610a65576040519150601f19603f3d011682016040523d82523d6000602084013e610a6a565b606091505b5050905080610a8c57604051630a12f52160e11b815260040160405180910390fd5b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000814311610aef57600080fd5b6040805183406020820152600391016040516020818303038152906040528051906020012060001c610b219190610d64565b610816906001610d38565b50805460008255600402906000526020600020908101906105f291905b80821115610b7657600080825560018201819055600282015560038101805460ff19169055600401610b49565b5090565b60008060408385031215610b8d57600080fd5b8235915060208301358015158114610ba457600080fd5b809150509250929050565b600060208284031215610bc157600080fd5b5035919050565b80356001600160a01b0381168114610bdf57600080fd5b919050565b60008060408385031215610bf757600080fd5b610c0083610bc8565b946020939093013593505050565b600060208284031215610c2057600080fd5b610c2982610bc8565b9392505050565b602080825282518282018190526000919060409081850190868401855b82811015610c89578151805185528681015187860152858101518686015260609081015115159085015260809093019290850190600101610c4d565b5091979650505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761081657610816610c96565b634e487b7160e01b600052601260045260246000fd5b600082610ce857610ce8610cc3565b500490565b6020808252818101527f4e756d626572206d7573742062652067726561746572207468616e207a65726f604082015260600190565b634e487b7160e01b600052603260045260246000fd5b8082018082111561081657610816610c96565b600060018201610d5d57610d5d610c96565b5060010190565b600082610d7357610d73610cc3565b50069056fea2646970667358221220c16de5c6ba2265edbfac1d295c80ae1f06935da7a7abf29e4daaa82302e7d88564736f6c63430008140033