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
- paris
- Verified at
- 2025-07-15T13:53:21.237117Z
Constructor Arguments
000000000000000000000000112c37126c035e1de37346f5b6005494ef80506e
Arg [0] (<b>address</b>) : <a href="{#{address_path(@conn, :show, @address)}}">0x112c37126c035e1de37346f5b6005494ef80506e</a>
RabbitHabit.sol
pragma solidity 0.8.20;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
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);
}
}
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();
}
}
}
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;
}
}
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
interface IBankroll {
function sendFTN(address _to, uint256 _amount) external;
function sendERC20(IERC20 _token, address _to, uint256 _amount) external;
function sendERC721(IERC721 _token, address _to, uint256 _id) external;
}
// SPDX-License-Identifier: MIT
/**
* @title RabbitHabit
* @dev A simple betting contract where players can place bets and receive prizes based on the outcome.
*/
contract RabbitHabit is Ownable, ReentrancyGuard {
using Address for address payable;
IBankroll public bankrollContract;
uint256 private salt;
uint256 public minBet;
uint256 public maxBet;
uint256 public unchangedBetCoefficient;
uint256 public changedBetCoefficient;
uint256 public constant COEFFICIENT_DENOMINATOR = 100;
uint256 private constant NUMBER_OF_DOORS = 3;
struct Bet {
uint256 blockNumber;
uint256 amount;
uint256 firstBet;
bool isChanged;
uint256 salt;
address player;
}
mapping(address => Bet[]) public bets;
event RewardDistributed(uint256 amount);
/**
* @dev Emitted when a player places a bet.
* @param player The address of the player placing the bet.
* @param blockNumber The block number at which the bet is placed.
* @param amount The amount of FTNs sent with the bet.
* @param firstBet The player's initial bet number.
* @param isChanged Indicates whether the bet has been changed.
*/
event BetPlaced(
address indexed player,
uint256 blockNumber,
uint256 amount,
uint256 firstBet,
bool isChanged,
uint256 salt
);
/**
* @dev Emitted when a player claims their prize.
* @param player The address of the player claiming the prize.
* @param winAmount The amount of FTN won by the player.
*/
event PrizeClaimed(address indexed player, uint256 winAmount);
modifier notZero(uint256 number) {
require(number > 0, "Number must be greater than zero");
_;
}
constructor(IBankroll _bankrollContract) Ownable(msg.sender) {
minBet = 1 * 10 ** 18;
maxBet = 10 * 10 ** 18;
unchangedBetCoefficient = 300;
changedBetCoefficient = 150;
bankrollContract = _bankrollContract;
}
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 address of the Bankroll contract.
* @param _bankrollContract The address of the Bankroll contract to be set.
* @notice Only the owner of this contract can set the Bankroll contract address.
* @dev Reverts if the provided Bankroll contract address is zero.
*/
function setBankrollContract(
IBankroll _bankrollContract
) external onlyOwner {
require(
address(_bankrollContract) != address(0),
"Invalid bankroll contract address"
);
bankrollContract = _bankrollContract;
}
/**
* @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 coefficient for unchanged bet.
* @param _unchangedBetCoefficient The new coefficient for unchanged bet.
*/
function setUnchangedBetCoefficient(
uint256 _unchangedBetCoefficient
) external onlyOwner notZero(_unchangedBetCoefficient) {
unchangedBetCoefficient = _unchangedBetCoefficient;
}
/**
* @dev Sets the coefficient for changed bet.
* @param _changedBetCoefficient The new coefficient for changed bet.
*/
function setChangedBetCoefficient(
uint256 _changedBetCoefficient
) external onlyOwner notZero(_changedBetCoefficient) {
changedBetCoefficient = _changedBetCoefficient;
}
/**
* @dev Allows a player to place a bet.
* @param _firstBet The player's initial bet number.
* @param _isChanged Indicates whether the bet has been changed.
*/
function play(
uint256 _firstBet,
bool _isChanged
) external payable nonReentrant returns (uint256) {
require(
address(bankrollContract).balance >=
(msg.value * unchangedBetCoefficient) / COEFFICIENT_DENOMINATOR,
"Insufficient funds"
);
require(_firstBet > 0 && _firstBet < 4, "Incorrect bet number");
require(
msg.value >= minBet && msg.value <= maxBet,
"Incorrect bet amount"
);
payable(address(bankrollContract)).sendValue(msg.value);
distributeReward(msg.sender);
bets[msg.sender].push(
Bet(
block.number,
msg.value,
_firstBet,
_isChanged,
salt,
msg.sender
)
);
emit BetPlaced(
msg.sender,
block.number,
msg.value,
_firstBet,
_isChanged,
salt
);
salt++;
return salt - 1;
}
/**
* @dev Allows a player to claim their prize.
*/
function getPrize() external nonReentrant {
uint256 winAmount = calculateTotalWin(msg.sender);
require(winAmount > 0, "You have not won");
delete bets[msg.sender];
bankrollContract.sendFTN(msg.sender, winAmount);
emit PrizeClaimed(msg.sender, winAmount);
}
function distributeReward(address _player) public {
if (
bets[_player].length == 0 ||
bets[_player][0].blockNumber == block.number
) {
return;
}
uint256 totalWin;
for (uint256 i = 0; i < bets[_player].length; i++) {
totalWin += calculateWin(_player, i);
}
delete bets[_player];
if (totalWin > 0) {
bankrollContract.sendFTN(_player, totalWin);
emit RewardDistributed(totalWin);
}
}
/**
* @dev Retrieves the bets placed by a player.
* @param _player The address of the player.
* @return An array of Bet structs representing the player's bets.
*/
function getPlayerBets(
address _player
) external view returns (Bet[] memory) {
return bets[_player];
}
/**
* @dev Calculates the total prize amount for a player.
* @param _player The address of the player.
* @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 for player's specific bet.
* @param _player The address of the player.
* @param _betIndex The index of the bet in the player's array of bets.
* @return The amount of prize 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 (winNum == 0) {
return 0;
} else if (_bet.firstBet == winNum && !_bet.isChanged) {
return
(_bet.amount * unchangedBetCoefficient) /
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 unchanged bet coefficient is used.
* The estimate does not represent the actual reward claimable by the player.
* 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 estimatePotentialReward(
uint256 _amount,
bool _isChanged
) public view returns (uint256) {
if (_isChanged) {
return (_amount * changedBetCoefficient) / COEFFICIENT_DENOMINATOR;
} else {
return
(_amount * unchangedBetCoefficient) / COEFFICIENT_DENOMINATOR;
}
}
/**
* @dev Generates a random number based on a past block's hash.
* @param _blockNumber The block number to use for generation of a random number.
* @return The random number.
*/
function getRand(
uint256 _blockNumber,
uint256 _salt,
address _player
) internal view returns (uint256) {
require(block.number > _blockNumber, "Block number is out of range");
if (_blockNumber + 250 < block.number) {
return 0;
}
return
(uint256(
keccak256(
abi.encodePacked((blockhash(_blockNumber)), _salt, _player)
)
) % NUMBER_OF_DOORS) + 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 _firstBetNum The player's initial bet number.
* @param _isChanged Indicates whether the bet has been changed.
* @param _betAmount The amount of FTN staked in the bet.
* @return The potential prize based on the bet outcome.
* @dev The coefficients used for the calculation are set by the contract owner.
*/
function checkGameResult(
bytes32 _blockHash,
uint256 _firstBetNum,
bool _isChanged,
uint256 _betAmount,
uint256 _salt,
address _player
) external view returns (uint256) {
uint256 winNum = (uint256(
keccak256(abi.encodePacked(_blockHash, _salt, _player))
) % NUMBER_OF_DOORS) + 1;
if (_firstBetNum == winNum && !_isChanged) {
return
(_betAmount * unchangedBetCoefficient) /
COEFFICIENT_DENOMINATOR;
} else if (_firstBetNum != winNum && _isChanged) {
return
(_betAmount * changedBetCoefficient) / COEFFICIENT_DENOMINATOR;
} else {
return 0;
}
}
}
Compiler Settings
{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{"RabbitHabit.sol":{}},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_bankrollContract","internalType":"contract IBankroll"}]},{"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":"player","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},{"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":"player","internalType":"address","indexed":true},{"type":"uint256","name":"winAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardDistributed","inputs":[{"type":"uint256","name":"amount","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":"address","name":"","internalType":"contract IBankroll"}],"name":"bankrollContract","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"},{"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":"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":"changedBetCoefficient","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"checkGameResult","inputs":[{"type":"bytes32","name":"_blockHash","internalType":"bytes32"},{"type":"uint256","name":"_firstBetNum","internalType":"uint256"},{"type":"bool","name":"_isChanged","internalType":"bool"},{"type":"uint256","name":"_betAmount","internalType":"uint256"},{"type":"uint256","name":"_salt","internalType":"uint256"},{"type":"address","name":"_player","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"distributeReward","inputs":[{"type":"address","name":"_player","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"estimatePotentialReward","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"},{"type":"uint256","name":"salt","internalType":"uint256"},{"type":"address","name":"player","internalType":"address"}]}],"name":"getPlayerBets","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":[{"type":"uint256","name":"","internalType":"uint256"}],"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":"setBankrollContract","inputs":[{"type":"address","name":"_bankrollContract","internalType":"contract IBankroll"}]},{"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":"setUnchangedBetCoefficient","inputs":[{"type":"uint256","name":"_unchangedBetCoefficient","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":"unchangedBetCoefficient","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawFTN","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x608060405234801561001057600080fd5b5060405161151238038061151283398101604081905261002f916100fb565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e816100ab565b5060018055670de0b6b3a7640000600455678ac7230489e8000060055561012c6006556096600755600280546001600160a01b0319166001600160a01b039290921691909117905561012b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561010d57600080fd5b81516001600160a01b038116811461012457600080fd5b9392505050565b6113d88061013a6000396000f3fe60806040526004361061014f5760003560e01c80638da5cb5b116100b6578063e17af3171161006f578063e17af317146103ae578063e2e1335d146103ce578063eaf07c8c146103ee578063f20f58aa1461041b578063f2fde38b14610431578063fb9213ff1461045157600080fd5b80638da5cb5b146102fc5780638dff13d91461032e5780639619367d1461034e5780639987244214610364578063b97e707d14610379578063c34f6b0d1461039957600080fd5b806337fc09041161010857806337fc09041461020f5780633a8aa6841461022f5780634a39ec901461024f578063715018a6146102a7578063881eff1e146102bc57806388ea41b9146102dc57600080fd5b806302f715081461015b578063092193ab1461018457806312508ea4146101a657806315b52658146101b9578063268b67d8146101d95780632e5b2168146101f957600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017160075481565b6040519081526020015b60405180910390f35b34801561019057600080fd5b506101a461019f36600461112b565b610471565b005b6101716101b436600461115d565b6105ee565b3480156101c557600080fd5b506101a46101d4366004611189565b61087b565b3480156101e557600080fd5b506101a46101f4366004611189565b6108aa565b34801561020557600080fd5b5061017160055481565b34801561021b57600080fd5b506101a461022a36600461112b565b6108d9565b34801561023b57600080fd5b506101a461024a366004611189565b610963565b34801561025b57600080fd5b5061026f61026a3660046111a2565b610978565b604080519687526020870195909552938501929092521515606084015260808301526001600160a01b031660a082015260c00161017b565b3480156102b357600080fd5b506101a46109d9565b3480156102c857600080fd5b506101a46102d7366004611189565b6109ed565b3480156102e857600080fd5b506101a46102f7366004611189565b610a1c565b34801561030857600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161017b565b34801561033a57600080fd5b506101716103493660046111ce565b610a4b565b34801561035a57600080fd5b5061017160045481565b34801561037057600080fd5b50610171606481565b34801561038557600080fd5b506101716103943660046111a2565b610b1e565b3480156103a557600080fd5b506101a4610c05565b3480156103ba57600080fd5b50600254610316906001600160a01b031681565b3480156103da57600080fd5b506101716103e936600461115d565b610d18565b3480156103fa57600080fd5b5061040e61040936600461112b565b610d51565b60405161017b919061122a565b34801561042757600080fd5b5061017160065481565b34801561043d57600080fd5b506101a461044c36600461112b565b610e0a565b34801561045d57600080fd5b5061017161046c36600461112b565b610e45565b6001600160a01b03811660009081526008602052604090205415806104ce57506001600160a01b038116600090815260086020526040812080544392906104ba576104ba6112ad565b906000526020600020906006020160000154145b156104d65750565b6000805b6001600160a01b038316600090815260086020526040902054811015610522576105048382610b1e565b61050e90836112d9565b91508061051a816112ec565b9150506104da565b506001600160a01b0382166000908152600860205260408120610544916110af565b80156105ea57600254604051635961857d60e11b81526001600160a01b038481166004830152602482018490529091169063b2c30afa90604401600060405180830381600087803b15801561059857600080fd5b505af11580156105ac573d6000803e3d6000fd5b505050507f04944120d2e185fc95ba63f3ca24c385ec4c5215a801c8766c96486d7fc4ed8e816040516105e191815260200190565b60405180910390a15b5050565b60006105f8610e9a565b6064600654346106089190611305565b6106129190611332565b6002546001600160a01b03163110156106675760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b6000831180156106775750600483105b6106ba5760405162461bcd60e51b815260206004820152601460248201527324b731b7b93932b1ba103132ba10373ab6b132b960611b604482015260640161065e565b60045434101580156106ce57506005543411155b6107115760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0818995d08185b5bdd5b9d60621b604482015260640161065e565b600254610727906001600160a01b031634610ec4565b61073033610471565b336000818152600860209081526040808320815160c08101835243808252348286018181528386018c81528b151560608601908152600380546080880190815260a088018d8152895460018181018c559a8e529b909c2097516006909b02909701998a559251968901969096555160028801559351868501805491151560ff19909216919091179055915160048601559451600590940180546001600160a01b03959095166001600160a01b0319909516949094179093555490517f0e0d65833a4e590322107211ce07d93f80f59a5617e92157f8d2c69f88ffaac59361083e9390929091899189919485526020850193909352604084019190915215156060830152608082015260a00190565b60405180910390a260038054906000610856836112ec565b9190505550600160035461086a9190611346565b905061087560018055565b92915050565b610883610f60565b80600081116108a45760405162461bcd60e51b815260040161065e90611359565b50600655565b6108b2610f60565b80600081116108d35760405162461bcd60e51b815260040161065e90611359565b50600755565b6108e1610f60565b6001600160a01b0381166109415760405162461bcd60e51b815260206004820152602160248201527f496e76616c69642062616e6b726f6c6c20636f6e7472616374206164647265736044820152607360f81b606482015260840161065e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61096b610f60565b6109753382610ec4565b50565b6008602052816000526040600020818154811061099457600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501549396509194509260ff909116916001600160a01b031686565b6109e1610f60565b6109eb6000610f8d565b565b6109f5610f60565b8060008111610a165760405162461bcd60e51b815260040161065e90611359565b50600555565b610a24610f60565b8060008111610a455760405162461bcd60e51b815260040161065e90611359565b50600455565b6000806003888585604051602001610a8893929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b6040516020818303038152906040528051906020012060001c610aab919061138e565b610ab69060016112d9565b90508087148015610ac5575085155b15610aec57606460065486610ada9190611305565b610ae49190611332565b915050610b14565b808714158015610af95750855b15610b0e57606460075486610ada9190611305565b60009150505b9695505050505050565b6001600160a01b0382166000908152600860205260408120805482919084908110610b4b57610b4b6112ad565b906000526020600020906006020190506000610b708260000154836004015487610fdd565b905080600003610b8557600092505050610875565b808260020154148015610b9d5750600382015460ff16155b15610bc95760646006548360010154610bb69190611305565b610bc09190611332565b92505050610875565b80826002015414158015610be15750600382015460ff165b15610bfa5760646007548360010154610bb69190611305565b600092505050610875565b610c0d610e9a565b6000610c1833610e45565b905060008111610c5d5760405162461bcd60e51b815260206004820152601060248201526f2cb7ba903430bb32903737ba103bb7b760811b604482015260640161065e565b336000908152600860205260408120610c75916110af565b600254604051635961857d60e11b8152336004820152602481018390526001600160a01b039091169063b2c30afa90604401600060405180830381600087803b158015610cc157600080fd5b505af1158015610cd5573d6000803e3d6000fd5b50506040518381523392507f95681e512bc0fe659e195e06c283eada494316f3d801213e48e7101af92bf770915060200160405180910390a2506109eb60018055565b60008115610d4157606460075484610d309190611305565b610d3a9190611332565b9050610875565b606460065484610d309190611305565b6001600160a01b0381166000908152600860209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610dff5760008481526020908190206040805160c081018252600686029092018054835260018082015484860152600282015492840192909252600381015460ff161515606084015260048101546080840152600501546001600160a01b031660a08301529083529092019101610d89565b505050509050919050565b610e12610f60565b6001600160a01b038116610e3c57604051631e4fbdf760e01b81526000600482015260240161065e565b61097581610f8d565b60008060005b6001600160a01b038416600090815260086020526040902054811015610e9357610e758482610b1e565b610e7f90836112d9565b915080610e8b816112ec565b915050610e4b565b5092915050565b600260015403610ebd57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b80471015610ee75760405163cd78605960e01b815230600482015260240161065e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f34576040519150601f19603f3d011682016040523d82523d6000602084013e610f39565b606091505b5050905080610f5b57604051630a12f52160e11b815260040160405180910390fd5b505050565b6000546001600160a01b031633146109eb5760405163118cdaa760e01b815233600482015260240161065e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600083431161102e5760405162461bcd60e51b815260206004820152601c60248201527f426c6f636b206e756d626572206973206f7574206f662072616e676500000000604482015260640161065e565b4361103a8560fa6112d9565b1015611048575060006110a8565b6040805185406020820152908101849052606083811b6bffffffffffffffffffffffff1916908201526003906074016040516020818303038152906040528051906020012060001c61109a919061138e565b6110a59060016112d9565b90505b9392505050565b508054600082556006029060005260206000209081019061097591905b80821115611112576000808255600182018190556002820181905560038201805460ff1916905560048201556005810180546001600160a01b03191690556006016110cc565b5090565b6001600160a01b038116811461097557600080fd5b60006020828403121561113d57600080fd5b81356110a881611116565b8035801515811461115857600080fd5b919050565b6000806040838503121561117057600080fd5b8235915061118060208401611148565b90509250929050565b60006020828403121561119b57600080fd5b5035919050565b600080604083850312156111b557600080fd5b82356111c081611116565b946020939093013593505050565b60008060008060008060c087890312156111e757600080fd5b86359550602087013594506111fe60408801611148565b9350606087013592506080870135915060a087013561121c81611116565b809150509295509295509295565b602080825282518282018190526000919060409081850190868401855b828110156112a057815180518552868101518786015285810151868601526060808201511515908601526080808201519086015260a0908101516001600160a01b03169085015260c09093019290850190600101611247565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610875576108756112c3565b6000600182016112fe576112fe6112c3565b5060010190565b8082028115828204841417610875576108756112c3565b634e487b7160e01b600052601260045260246000fd5b6000826113415761134161131c565b500490565b81810381811115610875576108756112c3565b6020808252818101527f4e756d626572206d7573742062652067726561746572207468616e207a65726f604082015260600190565b60008261139d5761139d61131c565b50069056fea26469706673582212208a11d8df0d47a8ba3ff5276fae29d265f2bd74cce49121e755e131db75b9253464736f6c63430008140033000000000000000000000000112c37126c035e1de37346f5b6005494ef80506e
Deployed ByteCode
0x60806040526004361061014f5760003560e01c80638da5cb5b116100b6578063e17af3171161006f578063e17af317146103ae578063e2e1335d146103ce578063eaf07c8c146103ee578063f20f58aa1461041b578063f2fde38b14610431578063fb9213ff1461045157600080fd5b80638da5cb5b146102fc5780638dff13d91461032e5780639619367d1461034e5780639987244214610364578063b97e707d14610379578063c34f6b0d1461039957600080fd5b806337fc09041161010857806337fc09041461020f5780633a8aa6841461022f5780634a39ec901461024f578063715018a6146102a7578063881eff1e146102bc57806388ea41b9146102dc57600080fd5b806302f715081461015b578063092193ab1461018457806312508ea4146101a657806315b52658146101b9578063268b67d8146101d95780632e5b2168146101f957600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017160075481565b6040519081526020015b60405180910390f35b34801561019057600080fd5b506101a461019f36600461112b565b610471565b005b6101716101b436600461115d565b6105ee565b3480156101c557600080fd5b506101a46101d4366004611189565b61087b565b3480156101e557600080fd5b506101a46101f4366004611189565b6108aa565b34801561020557600080fd5b5061017160055481565b34801561021b57600080fd5b506101a461022a36600461112b565b6108d9565b34801561023b57600080fd5b506101a461024a366004611189565b610963565b34801561025b57600080fd5b5061026f61026a3660046111a2565b610978565b604080519687526020870195909552938501929092521515606084015260808301526001600160a01b031660a082015260c00161017b565b3480156102b357600080fd5b506101a46109d9565b3480156102c857600080fd5b506101a46102d7366004611189565b6109ed565b3480156102e857600080fd5b506101a46102f7366004611189565b610a1c565b34801561030857600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161017b565b34801561033a57600080fd5b506101716103493660046111ce565b610a4b565b34801561035a57600080fd5b5061017160045481565b34801561037057600080fd5b50610171606481565b34801561038557600080fd5b506101716103943660046111a2565b610b1e565b3480156103a557600080fd5b506101a4610c05565b3480156103ba57600080fd5b50600254610316906001600160a01b031681565b3480156103da57600080fd5b506101716103e936600461115d565b610d18565b3480156103fa57600080fd5b5061040e61040936600461112b565b610d51565b60405161017b919061122a565b34801561042757600080fd5b5061017160065481565b34801561043d57600080fd5b506101a461044c36600461112b565b610e0a565b34801561045d57600080fd5b5061017161046c36600461112b565b610e45565b6001600160a01b03811660009081526008602052604090205415806104ce57506001600160a01b038116600090815260086020526040812080544392906104ba576104ba6112ad565b906000526020600020906006020160000154145b156104d65750565b6000805b6001600160a01b038316600090815260086020526040902054811015610522576105048382610b1e565b61050e90836112d9565b91508061051a816112ec565b9150506104da565b506001600160a01b0382166000908152600860205260408120610544916110af565b80156105ea57600254604051635961857d60e11b81526001600160a01b038481166004830152602482018490529091169063b2c30afa90604401600060405180830381600087803b15801561059857600080fd5b505af11580156105ac573d6000803e3d6000fd5b505050507f04944120d2e185fc95ba63f3ca24c385ec4c5215a801c8766c96486d7fc4ed8e816040516105e191815260200190565b60405180910390a15b5050565b60006105f8610e9a565b6064600654346106089190611305565b6106129190611332565b6002546001600160a01b03163110156106675760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b6000831180156106775750600483105b6106ba5760405162461bcd60e51b815260206004820152601460248201527324b731b7b93932b1ba103132ba10373ab6b132b960611b604482015260640161065e565b60045434101580156106ce57506005543411155b6107115760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0818995d08185b5bdd5b9d60621b604482015260640161065e565b600254610727906001600160a01b031634610ec4565b61073033610471565b336000818152600860209081526040808320815160c08101835243808252348286018181528386018c81528b151560608601908152600380546080880190815260a088018d8152895460018181018c559a8e529b909c2097516006909b02909701998a559251968901969096555160028801559351868501805491151560ff19909216919091179055915160048601559451600590940180546001600160a01b03959095166001600160a01b0319909516949094179093555490517f0e0d65833a4e590322107211ce07d93f80f59a5617e92157f8d2c69f88ffaac59361083e9390929091899189919485526020850193909352604084019190915215156060830152608082015260a00190565b60405180910390a260038054906000610856836112ec565b9190505550600160035461086a9190611346565b905061087560018055565b92915050565b610883610f60565b80600081116108a45760405162461bcd60e51b815260040161065e90611359565b50600655565b6108b2610f60565b80600081116108d35760405162461bcd60e51b815260040161065e90611359565b50600755565b6108e1610f60565b6001600160a01b0381166109415760405162461bcd60e51b815260206004820152602160248201527f496e76616c69642062616e6b726f6c6c20636f6e7472616374206164647265736044820152607360f81b606482015260840161065e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61096b610f60565b6109753382610ec4565b50565b6008602052816000526040600020818154811061099457600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501549396509194509260ff909116916001600160a01b031686565b6109e1610f60565b6109eb6000610f8d565b565b6109f5610f60565b8060008111610a165760405162461bcd60e51b815260040161065e90611359565b50600555565b610a24610f60565b8060008111610a455760405162461bcd60e51b815260040161065e90611359565b50600455565b6000806003888585604051602001610a8893929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b6040516020818303038152906040528051906020012060001c610aab919061138e565b610ab69060016112d9565b90508087148015610ac5575085155b15610aec57606460065486610ada9190611305565b610ae49190611332565b915050610b14565b808714158015610af95750855b15610b0e57606460075486610ada9190611305565b60009150505b9695505050505050565b6001600160a01b0382166000908152600860205260408120805482919084908110610b4b57610b4b6112ad565b906000526020600020906006020190506000610b708260000154836004015487610fdd565b905080600003610b8557600092505050610875565b808260020154148015610b9d5750600382015460ff16155b15610bc95760646006548360010154610bb69190611305565b610bc09190611332565b92505050610875565b80826002015414158015610be15750600382015460ff165b15610bfa5760646007548360010154610bb69190611305565b600092505050610875565b610c0d610e9a565b6000610c1833610e45565b905060008111610c5d5760405162461bcd60e51b815260206004820152601060248201526f2cb7ba903430bb32903737ba103bb7b760811b604482015260640161065e565b336000908152600860205260408120610c75916110af565b600254604051635961857d60e11b8152336004820152602481018390526001600160a01b039091169063b2c30afa90604401600060405180830381600087803b158015610cc157600080fd5b505af1158015610cd5573d6000803e3d6000fd5b50506040518381523392507f95681e512bc0fe659e195e06c283eada494316f3d801213e48e7101af92bf770915060200160405180910390a2506109eb60018055565b60008115610d4157606460075484610d309190611305565b610d3a9190611332565b9050610875565b606460065484610d309190611305565b6001600160a01b0381166000908152600860209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610dff5760008481526020908190206040805160c081018252600686029092018054835260018082015484860152600282015492840192909252600381015460ff161515606084015260048101546080840152600501546001600160a01b031660a08301529083529092019101610d89565b505050509050919050565b610e12610f60565b6001600160a01b038116610e3c57604051631e4fbdf760e01b81526000600482015260240161065e565b61097581610f8d565b60008060005b6001600160a01b038416600090815260086020526040902054811015610e9357610e758482610b1e565b610e7f90836112d9565b915080610e8b816112ec565b915050610e4b565b5092915050565b600260015403610ebd57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b80471015610ee75760405163cd78605960e01b815230600482015260240161065e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f34576040519150601f19603f3d011682016040523d82523d6000602084013e610f39565b606091505b5050905080610f5b57604051630a12f52160e11b815260040160405180910390fd5b505050565b6000546001600160a01b031633146109eb5760405163118cdaa760e01b815233600482015260240161065e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600083431161102e5760405162461bcd60e51b815260206004820152601c60248201527f426c6f636b206e756d626572206973206f7574206f662072616e676500000000604482015260640161065e565b4361103a8560fa6112d9565b1015611048575060006110a8565b6040805185406020820152908101849052606083811b6bffffffffffffffffffffffff1916908201526003906074016040516020818303038152906040528051906020012060001c61109a919061138e565b6110a59060016112d9565b90505b9392505050565b508054600082556006029060005260206000209081019061097591905b80821115611112576000808255600182018190556002820181905560038201805460ff1916905560048201556005810180546001600160a01b03191690556006016110cc565b5090565b6001600160a01b038116811461097557600080fd5b60006020828403121561113d57600080fd5b81356110a881611116565b8035801515811461115857600080fd5b919050565b6000806040838503121561117057600080fd5b8235915061118060208401611148565b90509250929050565b60006020828403121561119b57600080fd5b5035919050565b600080604083850312156111b557600080fd5b82356111c081611116565b946020939093013593505050565b60008060008060008060c087890312156111e757600080fd5b86359550602087013594506111fe60408801611148565b9350606087013592506080870135915060a087013561121c81611116565b809150509295509295509295565b602080825282518282018190526000919060409081850190868401855b828110156112a057815180518552868101518786015285810151868601526060808201511515908601526080808201519086015260a0908101516001600160a01b03169085015260c09093019290850190600101611247565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610875576108756112c3565b6000600182016112fe576112fe6112c3565b5060010190565b8082028115828204841417610875576108756112c3565b634e487b7160e01b600052601260045260246000fd5b6000826113415761134161131c565b500490565b81810381811115610875576108756112c3565b6020808252818101527f4e756d626572206d7573742062652067726561746572207468616e207a65726f604082015260600190565b60008261139d5761139d61131c565b50069056fea26469706673582212208a11d8df0d47a8ba3ff5276fae29d265f2bd74cce49121e755e131db75b9253464736f6c63430008140033