Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 343,027 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Play | 87510448 | 194 days ago | IN | 0 ETH | 0.00001433 | ||||
Play | 87510441 | 194 days ago | IN | 0 ETH | 0.00001433 | ||||
Play | 87510434 | 194 days ago | IN | 0 ETH | 0.00001433 | ||||
Play | 87510427 | 194 days ago | IN | 0 ETH | 0.00001433 | ||||
Play | 87510419 | 194 days ago | IN | 0 ETH | 0.00001604 | ||||
Start Game | 87510402 | 194 days ago | IN | 0 ETH | 0.00001572 | ||||
Finalize Game | 87510380 | 194 days ago | IN | 0 ETH | 0.00003456 | ||||
Play With Permit | 87509933 | 194 days ago | IN | 0 ETH | 0.00000417 | ||||
Play With Permit | 87509867 | 194 days ago | IN | 0 ETH | 0.00001603 | ||||
Play With Permit | 87509864 | 194 days ago | IN | 0 ETH | 0.00001603 | ||||
Play | 87509770 | 194 days ago | IN | 0 ETH | 0.00001406 | ||||
Play | 87509762 | 194 days ago | IN | 0 ETH | 0.00001406 | ||||
Play | 87509754 | 194 days ago | IN | 0 ETH | 0.00001406 | ||||
Play | 87509750 | 194 days ago | IN | 0 ETH | 0.00001406 | ||||
Play | 87509743 | 194 days ago | IN | 0 ETH | 0.00001406 | ||||
Play With Permit | 87509735 | 194 days ago | IN | 0 ETH | 0.0000177 | ||||
Start Game | 87509724 | 194 days ago | IN | 0 ETH | 0.00001527 | ||||
Finalize Game | 87509709 | 194 days ago | IN | 0 ETH | 0.00003635 | ||||
Play With Permit | 87509239 | 194 days ago | IN | 0 ETH | 0.00001604 | ||||
Play With Permit | 87509190 | 194 days ago | IN | 0 ETH | 0.00001604 | ||||
Play With Permit | 87509183 | 194 days ago | IN | 0 ETH | 0.00001604 | ||||
Play With Permit | 87509139 | 194 days ago | IN | 0 ETH | 0.00001604 | ||||
Play | 87509103 | 194 days ago | IN | 0 ETH | 0.00001406 | ||||
Play | 87509098 | 194 days ago | IN | 0 ETH | 0.00001406 | ||||
Play | 87509092 | 194 days ago | IN | 0 ETH | 0.00001406 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Bullseye
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.24; import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; import {ITreasury} from "./interfaces/ITreasury.sol"; import {IDataStreamsVerifier} from "./interfaces/IDataStreamsVerifier.sol"; contract Bullseye is AccessControl { uint256 constant DENOMINATOR = 10000; uint256 public fee = 100; uint256[3] public rate = [5000, 3500, 1500]; uint256[3] public exactRate = [7500, 1500, 1000]; uint256[2] public twoPlayersRate = [7500, 2500]; uint256[2] public twoPlayersExactRate = [8000, 2000]; event BullseyeStart( uint256 startTime, uint48 stopPredictAt, uint48 endTime, uint256 depositAmount, bytes32 feedId, bytes32 indexed gameId ); event BullseyeNewPlayer( address player, int192 assetPrice, uint256 depositAmount, bytes32 indexed gameId ); event BullseyeFinalized( address[3] players, int192 finalPrice, bool isExact, bytes32 indexed gameId ); event BullseyeCancelled(bytes32 indexed gameId); struct GameInfo { bytes32 feedId; bytes32 gameId; uint256 startTime; uint48 endTime; uint48 stopPredictAt; uint256 depositAmount; } address[] public players; mapping(address => int192) public assetPrices; mapping(address => uint256) public playerTimestamp; GameInfo public game; address public treasury; constructor() { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** * Starts bullseye game * @param endTime when the game iteration will end * @param depositAmount amount to enter the game */ function startGame( uint48 endTime, uint48 stopPredictAt, uint256 depositAmount, bytes32 feedId ) public onlyRole(DEFAULT_ADMIN_ROLE) { require(game.startTime == 0, "Finish previous game first"); game.feedId = feedId; game.startTime = block.timestamp; game.stopPredictAt = stopPredictAt; game.endTime = endTime; game.depositAmount = depositAmount; game.gameId = keccak256( abi.encodePacked(endTime, block.timestamp, address(this)) ); emit BullseyeStart( block.timestamp, stopPredictAt, endTime, depositAmount, feedId, game.gameId ); } /** * Participate in bullseye game * @param assetPrice player's picked asset price */ function play(int192 assetPrice) public { require( game.stopPredictAt >= block.timestamp, "Game is closed for new players" ); require(assetPrices[msg.sender] == 0, "You are already in the game"); playerTimestamp[msg.sender] = block.timestamp; players.push(msg.sender); assetPrices[msg.sender] = assetPrice; ITreasury(treasury).deposit(game.depositAmount, msg.sender); emit BullseyeNewPlayer( msg.sender, assetPrice, game.depositAmount, game.gameId ); } /** * Participate in bullseye game with permit * @param assetPrice player's picked asset price */ function playWithPermit( int192 assetPrice, ITreasury.PermitData calldata permitData ) public { require( game.stopPredictAt >= block.timestamp, "Game is closed for new players" ); require(assetPrices[msg.sender] == 0, "You are already in the game"); playerTimestamp[msg.sender] = block.timestamp; players.push(msg.sender); assetPrices[msg.sender] = assetPrice; ITreasury(treasury).depositWithPermit( game.depositAmount, msg.sender, permitData.deadline, permitData.v, permitData.r, permitData.s ); emit BullseyeNewPlayer( msg.sender, assetPrice, game.depositAmount, game.gameId ); } /** * Finalizes bullseye game and distributes rewards to players * @param unverifiedReport Chainlink DataStreams report */ function finalizeGame( bytes memory unverifiedReport ) public onlyRole(DEFAULT_ADMIN_ROLE) { require(game.gameId != bytes32(0), "Start the game first"); require(block.timestamp >= game.endTime, "Too early to finish"); if (players.length < 2) { address player; if (players.length == 1) { player = players[0]; ITreasury(treasury).refund(game.depositAmount, players[0]); assetPrices[players[0]] = 0; playerTimestamp[players[0]] = 0; delete players; } emit BullseyeCancelled(game.gameId); delete game; return; } address upkeep = ITreasury(treasury).upkeep(); (int192 finalPrice, uint32 priceTimestamp) = IDataStreamsVerifier( upkeep ).verifyReportWithTimestamp(unverifiedReport, game.feedId); require( priceTimestamp - game.endTime <= 10 minutes || block.timestamp - priceTimestamp <= 10 minutes, "Old chainlink report" ); int192 exactRange = finalPrice / 10000; if (players.length == 2) { address playerOne = players[0]; address playerTwo = players[1]; int192 playerOneDiff = assetPrices[playerOne] > finalPrice ? assetPrices[playerOne] - finalPrice : finalPrice - assetPrices[playerOne]; int192 playerTwoDiff = assetPrices[playerTwo] > finalPrice ? assetPrices[playerTwo] - finalPrice : finalPrice - assetPrices[playerTwo]; if (playerOneDiff < playerTwoDiff) { // player 1 closer uint256 wonAmountFirst = (2 * game.depositAmount * ( playerOneDiff <= exactRange ? twoPlayersExactRate[0] : twoPlayersRate[0] )) / DENOMINATOR; ITreasury(treasury).distribute( wonAmountFirst, playerOne, game.depositAmount, fee ); uint256 wonAmountSecond = (2 * game.depositAmount * ( playerOneDiff <= exactRange ? twoPlayersExactRate[1] : twoPlayersRate[1] )) / DENOMINATOR; ITreasury(treasury).distribute( wonAmountSecond, playerTwo, game.depositAmount, fee ); emit BullseyeFinalized( [playerOne, playerTwo, address(0)], finalPrice, playerOneDiff <= exactRange, game.gameId ); } else { // player 2 closer uint256 wonAmountFirst = (2 * game.depositAmount * ( playerTwoDiff <= exactRange ? twoPlayersExactRate[0] : twoPlayersRate[0] )) / DENOMINATOR; ITreasury(treasury).distribute( wonAmountFirst, playerTwo, game.depositAmount, fee ); uint256 wonAmountSecond = (2 * game.depositAmount * ( playerTwoDiff <= exactRange ? twoPlayersExactRate[1] : twoPlayersRate[1] )) / DENOMINATOR; ITreasury(treasury).distribute( wonAmountSecond, playerOne, game.depositAmount, fee ); emit BullseyeFinalized( [playerTwo, playerOne, address(0)], finalPrice, playerTwoDiff <= exactRange, game.gameId ); } } else { address[3] memory topPlayers; int192[3] memory closestDiff = [ type(int192).max, type(int192).max, type(int192).max ]; for (uint256 j = 0; j < players.length; j++) { address currentAddress = players[j]; int192 currentGuess = assetPrices[currentAddress]; int192 currentDiff = currentGuess > finalPrice ? currentGuess - finalPrice : finalPrice - currentGuess; uint256 currentTimestamp = playerTimestamp[currentAddress]; for (uint256 i = 0; i < 3; i++) { if (currentDiff < closestDiff[i]) { for (uint256 k = 2; k > i; k--) { closestDiff[k] = closestDiff[k - 1]; topPlayers[k] = topPlayers[k - 1]; } closestDiff[i] = currentDiff; topPlayers[i] = currentAddress; break; } else if ( currentDiff == closestDiff[i] && currentTimestamp < playerTimestamp[topPlayers[i]] ) { for (uint256 k = 2; k > i; k--) { closestDiff[k] = closestDiff[k - 1]; topPlayers[k] = topPlayers[k - 1]; } topPlayers[i] = currentAddress; break; } } } uint256 totalDeposited = game.depositAmount * players.length; uint256[3] memory wonAmount; if (closestDiff[0] <= exactRange) { wonAmount = exactRate; } else { wonAmount = rate; } for (uint256 i = 0; i < 3; i++) { if (topPlayers[i] != address(0)) { ITreasury(treasury).distribute( (totalDeposited * wonAmount[i]) / DENOMINATOR, topPlayers[i], game.depositAmount, fee ); totalDeposited -= wonAmount[i]; } } emit BullseyeFinalized( topPlayers, finalPrice, closestDiff[0] <= exactRange, game.gameId ); } for (uint256 i = 0; i < players.length; i++) { assetPrices[players[i]] = 0; playerTimestamp[players[i]] = 0; } delete game; delete players; } function closeGame() public onlyRole(DEFAULT_ADMIN_ROLE) { uint256 deposit = game.depositAmount; for (uint i; i < players.length; i++) { ITreasury(treasury).refund(deposit, players[i]); assetPrices[players[i]] = 0; playerTimestamp[players[i]] = 0; } emit BullseyeCancelled(game.gameId); delete game; delete players; } function getTotalPlayers() public view returns (uint256) { return players.length; } /** * Do we need this? */ function changeDepositAmount( uint256 newDepositAmount ) public onlyRole(DEFAULT_ADMIN_ROLE) { game.depositAmount = newDepositAmount; } /** * Change treasury address * @param newTreasury new treasury address */ function setTreasury( address newTreasury ) public onlyRole(DEFAULT_ADMIN_ROLE) { treasury = newTreasury; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; interface IDataStreamsVerifier { function lastRetrievedPrice() external view returns (int192); function getPrice() external view returns (int192); function verifyReportWithTimestamp( bytes memory unverifiedReport, bytes32 feedId ) external returns (int192, uint32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; interface ITreasury { struct PermitData { uint256 deadline; uint8 v; bytes32 r; bytes32 s; } function DISTRIBUTOR_ROLE() external view returns (bytes32); function grantRole(bytes32 role, address account) external; function increaseFee(uint256 amount) external; function deposit(uint256 amount, address from) external; function depositWithPermit( uint256 amount, address from, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; function upkeep() external view returns (address); function distribute( uint256 amount, address to, uint256 initialDeposit, uint256 gameFee ) external; function refund(uint256 amount, address to) external; function distributeWithoutFee( uint256 rate, address to, uint256 initialDeposit ) external; function calculateSetupRate( uint256 lostTeamTotal, uint256 wonTeamTotal, address initiator ) external returns (uint256, uint256); function calculateUpDownRate( uint256 lostTeamTotal, uint256 wonTeamTotal, uint256 updownFee ) external returns (uint256 rate); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"BullseyeCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[3]","name":"players","type":"address[3]"},{"indexed":false,"internalType":"int192","name":"finalPrice","type":"int192"},{"indexed":false,"internalType":"bool","name":"isExact","type":"bool"},{"indexed":true,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"BullseyeFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"int192","name":"assetPrice","type":"int192"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"BullseyeNewPlayer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint48","name":"stopPredictAt","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"endTime","type":"uint48"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"feedId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"BullseyeStart","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"assetPrices","outputs":[{"internalType":"int192","name":"","type":"int192"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDepositAmount","type":"uint256"}],"name":"changeDepositAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"exactRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"unverifiedReport","type":"bytes"}],"name":"finalizeGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"game","outputs":[{"internalType":"bytes32","name":"feedId","type":"bytes32"},{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint48","name":"endTime","type":"uint48"},{"internalType":"uint48","name":"stopPredictAt","type":"uint48"},{"internalType":"uint256","name":"depositAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int192","name":"assetPrice","type":"int192"}],"name":"play","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int192","name":"assetPrice","type":"int192"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ITreasury.PermitData","name":"permitData","type":"tuple"}],"name":"playWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"playerTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"players","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"endTime","type":"uint48"},{"internalType":"uint48","name":"stopPredictAt","type":"uint48"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"bytes32","name":"feedId","type":"bytes32"}],"name":"startGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"twoPlayersExactRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"twoPlayersRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
606460015560e06040526113886080908152610dac60a0526105dc60c0526200002d90600290600362000181565b5060408051606081018252611d4c81526105dc60208201526103e8918101919091526200005f90600590600362000181565b5060408051808201909152611d4c81526109c4602082015262000087906008906002620001ca565b5060408051808201909152611f4081526107d06020820152620000af90600a906002620001ca565b50348015620000bd57600080fd5b50620000cb600033620000d2565b5062000217565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000177576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556200012e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016200017b565b5060005b92915050565b8260038101928215620001b8579160200282015b82811115620001b8578251829061ffff1690559160200191906001019062000195565b50620001c692915062000200565b5090565b8260028101928215620001b85791602002820182811115620001b8578251829061ffff1690559160200191906001019062000195565b5b80821115620001c6576000815560010162000201565b61221b80620002276000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806391d14854116100de578063d0bf580611610097578063e7ee6ad611610071578063e7ee6ad6146103ac578063f0f44260146103bf578063f540205c146103d2578063f71d96cb146103e557600080fd5b8063d0bf58061461037d578063d547741f14610390578063ddca3f43146103a357600080fd5b806391d14854146102c3578063a217fddf146102d6578063a26cc7e3146102de578063acebb280146102f1578063c32d88bb14610304578063c3fe3e281461031757600080fd5b80634529cae7116101305780634529cae71461022c5780635e9a523c146102345780635f50f7b91461026a57806361d027b31461027d5780636396d4b5146102a8578063786b844b146102bb57600080fd5b806301ffc9a7146101785780630c317791146101a057806320e9aac3146101b5578063248a9ca3146101e35780632f2ff15d1461020657806336568abe14610219575b600080fd5b61018b610186366004611d42565b6103f8565b60405190151581526020015b60405180910390f35b6101b36101ae366004611d82565b61042f565b005b6101d56101c3366004611db4565b600e6020526000908152604090205481565b604051908152602001610197565b6101d56101f1366004611dd1565b60009081526020819052604090206001015490565b6101b3610214366004611dea565b610621565b6101b3610227366004611dea565b61064c565b600c546101d5565b610257610242366004611db4565b600d6020526000908152604090205460170b81565b60405160179190910b8152602001610197565b6101b3610278366004611e35565b610684565b601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610197565b6101b36102b6366004611e77565b6107cd565b6101b3610a02565b61018b6102d1366004611dea565b610bb9565b6101d5600081565b6101d56102ec366004611dd1565b610be2565b6101b36102ff366004611ece565b610bf9565b6101b3610312366004611dd1565b611aec565b600f546010546011546012546013546103459493929165ffffffffffff80821692600160301b909204169086565b6040805196875260208701959095529385019290925265ffffffffffff908116606085015216608083015260a082015260c001610197565b6101d561038b366004611dd1565b611afd565b6101b361039e366004611dea565b611b0d565b6101d560015481565b6101d56103ba366004611dd1565b611b32565b6101b36103cd366004611db4565b611b42565b6101d56103e0366004611dd1565b611b70565b6102906103f3366004611dd1565b611b80565b60006001600160e01b03198216637965db0b60e01b148061042957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60125442600160301b90910465ffffffffffff1610156104965760405162461bcd60e51b815260206004820152601e60248201527f47616d6520697320636c6f73656420666f72206e657720706c6179657273000060448201526064015b60405180910390fd5b336000908152600d602052604090205460170b156104f65760405162461bcd60e51b815260206004820152601b60248201527f596f752061726520616c726561647920696e207468652067616d650000000000604482015260640161048d565b336000818152600e60209081526040808320429055600c8054600181019091557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b03191685179055600d9091529081902080546001600160c01b0319166001600160c01b0385161790556014546013549151636e553f6560e01b8152600481019290925260248201929092526001600160a01b0390911690636e553f6590604401600060405180830381600087803b1580156105bb57600080fd5b505af11580156105cf573d6000803e3d6000fd5b505060105460135460408051338152601787900b602082015280820192909252519193507ff9c605e9e655b01fc3a7e8bf44818fef37fa953aa03299365b56d7f4eaa8b668925081900360600190a250565b60008281526020819052604090206001015461063c81611baa565b6106468383611bb7565b50505050565b6001600160a01b03811633146106755760405163334bd91960e11b815260040160405180910390fd5b61067f8282611c49565b505050565b600061068f81611baa565b601154156106df5760405162461bcd60e51b815260206004820152601a60248201527f46696e6973682070726576696f75732067616d65206669727374000000000000604482015260640161048d565b600f8290554260118190556012805465ffffffffffff88811665ffffffffffff19918916600160301b02919091166001600160601b03199283161717909155601385905560405160d088901b6001600160d01b031916602082015260268101929092523060601b166046820152605a0160408051808303601f190181528282528051602091820120601081905542845265ffffffffffff80891692850192909252908816918301919091526060820185905260808201849052907f9f5cfc044880dd4da1194b1d6945daaaeddf1d8afa38f40e6d8e748f4e545d9c9060a00160405180910390a25050505050565b60125442600160301b90910465ffffffffffff16101561082f5760405162461bcd60e51b815260206004820152601e60248201527f47616d6520697320636c6f73656420666f72206e657720706c61796572730000604482015260640161048d565b336000908152600d602052604090205460170b1561088f5760405162461bcd60e51b815260206004820152601b60248201527f596f752061726520616c726561647920696e207468652067616d650000000000604482015260640161048d565b336000818152600e60209081526040808320429055600c8054600181019091557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b03191685179055600d82529182902080546001600160c01b0319166001600160c01b0387161790556014546013546001600160a01b03909116936350921b23939192909186359161092f918801908801611f7f565b604080516001600160e01b031960e088901b16815260048101959095526001600160a01b039093166024850152604484019190915260ff1660648301528401356084820152606084013560a482015260c401600060405180830381600087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505060105460135460408051338152601788900b602082015280820192909252519193507ff9c605e9e655b01fc3a7e8bf44818fef37fa953aa03299365b56d7f4eaa8b668925081900360600190a25050565b6000610a0d81611baa565b60135460005b600c54811015610b5657601454600c80546001600160a01b0390921691637ad226dc91859185908110610a4857610a48611fa2565b60009182526020909120015460405160e084901b6001600160e01b031916815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b158015610a9b57600080fd5b505af1158015610aaf573d6000803e3d6000fd5b505050506000600d6000600c8481548110610acc57610acc611fa2565b6000918252602080832091909101546001600160a01b03168352820192909252604001812080546001600160c01b0319166001600160c01b039390931692909217909155600c8054600e91839185908110610b2957610b29611fa2565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610a13565b506010546040517f712d82a27e9cc8c6f2ecbecd5a732cf15b6b16e38f3b65af9904d0aeba00d81890600090a26000600f81905560108190556011819055601280546001600160601b03191690556013819055610bb590600c90611ced565b5050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60088160028110610bf257600080fd5b0154905081565b6000610c0481611baa565b601054610c4a5760405162461bcd60e51b815260206004820152601460248201527314dd185c9d081d1a194819d85b5948199a5c9cdd60621b604482015260640161048d565b60125465ffffffffffff16421015610c9a5760405162461bcd60e51b81526020600482015260136024820152720a8dede40cac2e4d8f240e8de40ccd2dcd2e6d606b1b604482015260640161048d565b600c5460021115610e6a57600c54600090600103610e1557600c600081548110610cc657610cc6611fa2565b6000918252602082200154601454601354600c80546001600160a01b0394851696509290931693637ad226dc939192610d0157610d01611fa2565b60009182526020909120015460405160e084901b6001600160e01b031916815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b158015610d5457600080fd5b505af1158015610d68573d6000803e3d6000fd5b505050506000600d6000600c600081548110610d8657610d86611fa2565b6000918252602080832091909101546001600160a01b03168352820192909252604001812080546001600160c01b0319166001600160c01b039390931692909217909155600c8054600e9183918290610de157610de1611fa2565b60009182526020808320909101546001600160a01b03168352820192909252604001812091909155610e1590600c90611ced565b6010546040517f712d82a27e9cc8c6f2ecbecd5a732cf15b6b16e38f3b65af9904d0aeba00d81890600090a2506000600f81905560108190556011819055601280546001600160601b03191690556013555050565b6014546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed89190611fb8565b600f5460405163b6a9b90960e01b815291925060009182916001600160a01b0385169163b6a9b90991610f1091899190600401611fd5565b60408051808303816000875af1158015610f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f52919061202a565b601254919350915061025890610f769065ffffffffffff1663ffffffff8416612078565b65ffffffffffff16111580610f9c5750610258610f9963ffffffff83164261209e565b11155b610fdf5760405162461bcd60e51b815260206004820152601460248201527313db190818da185a5b9b1a5b9ac81c995c1bdc9d60621b604482015260640161048d565b6000610fed612710846120c7565b600c549091506002036114f9576000600c60008154811061101057611010611fa2565b6000918252602082200154600c80546001600160a01b03909216935090600190811061103e5761103e611fa2565b60009182526020808320909101546001600160a01b038581168452600d909252604083205491169250601787810b91900b1361109f576001600160a01b0383166000908152600d602052604090205461109a9060170b87612105565b6110c6565b6001600160a01b0383166000908152600d60205260409020546110c690879060170b612105565b6001600160a01b0383166000908152600d602052604081205491925090601788810b91900b1361111b576001600160a01b0383166000908152600d60205260409020546111169060170b88612105565b611142565b6001600160a01b0383166000908152600d602052604090205461114290889060170b612105565b90508060170b8260170b12156113235760006127108660170b8460170b131561116d57600854611171565b600a545b60135461117f906002612132565b6111899190612132565b6111939190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc967542926111cf9286928b929060040161215d565b600060405180830381600087803b1580156111e957600080fd5b505af11580156111fd573d6000803e3d6000fd5b5050505060006127108760170b8560170b131561121c57600954611220565b600b545b60135461122e906002612132565b6112389190612132565b6112429190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc9675429261127e9286928b929060040161215d565b600060405180830381600087803b15801561129857600080fd5b505af11580156112ac573d6000803e3d6000fd5b5050601054604080516060810182526001600160a01b03808c1682528a16602082015260008183015290519193507f4121b80d62643ee909a4d3383db4b827b9924c4be3cbf1f47a43091628ea21b59250611314918d9060178d810b908b900b131590612181565b60405180910390a250506114f0565b60006127108660170b8360170b131561133e57600854611342565b600a545b601354611350906002612132565b61135a9190612132565b6113649190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc967542926113a09286928a929060040161215d565b600060405180830381600087803b1580156113ba57600080fd5b505af11580156113ce573d6000803e3d6000fd5b5050505060006127108760170b8460170b13156113ed576009546113f1565b600b545b6013546113ff906002612132565b6114099190612132565b6114139190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc9675429261144f9286928c929060040161215d565b600060405180830381600087803b15801561146957600080fd5b505af115801561147d573d6000803e3d6000fd5b5050601054604080516060810182526001600160a01b03808b1682528b16602082015260008183015290519193507f4121b80d62643ee909a4d3383db4b827b9924c4be3cbf1f47a43091628ea21b592506114e5918d9060178d810b908a900b131590612181565b60405180910390a250505b50505050611a01565b611501611d0b565b604080516060810182526001600160bf1b03808252602082018190529181019190915260005b600c54811015611809576000600c828154811061154657611546611fa2565b60009182526020808320909101546001600160a01b0316808352600d9091526040822054909250601790810b919089900b821361158c57611587828a612105565b611596565b6115968983612105565b6001600160a01b0384166000908152600e60205260408120549192505b60038110156117f8578681600381106115ce576115ce611fa2565b602002015160170b8360170b12156116cf5760025b8181111561168357876115f760018361209e565b6003811061160757611607611fa2565b602002015188826003811061161e5761161e611fa2565b60179290920b602090920201528861163760018361209e565b6003811061164757611647611fa2565b602002015189826003811061165e5761165e611fa2565b6001600160a01b0390921660209290920201528061167b816121ce565b9150506115e3565b508287826003811061169757611697611fa2565b60179290920b60209092020152848882600381106116b7576116b7611fa2565b6001600160a01b0390921660209290920201526117f8565b8681600381106116e1576116e1611fa2565b602002015160170b8360170b1480156117345750600e600089836003811061170b5761170b611fa2565b60200201516001600160a01b03166001600160a01b031681526020019081526020016000205482105b156117f05760025b818111156117dc578761175060018361209e565b6003811061176057611760611fa2565b602002015188826003811061177757611777611fa2565b60179290920b602090920201528861179060018361209e565b600381106117a0576117a0611fa2565b60200201518982600381106117b7576117b7611fa2565b6001600160a01b039092166020929092020152806117d4816121ce565b91505061173c565b50848882600381106116b7576116b7611fa2565b6001016115b3565b505060019093019250611527915050565b50600c5460135460009161181c91612132565b9050611826611d0b565b8251601786810b91900b1361186a576040805160608101918290529060059060039082845b81548152602001906001019080831161184b575050505050905061189b565b6040805160608101918290529060029060039082845b81548152602001906001019080831161188057505050505090505b60005b60038110156119ac5760008582600381106118bb576118bb611fa2565b60200201516001600160a01b0316146119a4576014546001600160a01b031663fc9675426127108484600381106118f4576118f4611fa2565b60200201516119039087612132565b61190d9190612149565b87846003811061191f5761191f611fa2565b60200201516013546001546040516001600160e01b031960e087901b16815261194e949392919060040161215d565b600060405180830381600087803b15801561196857600080fd5b505af115801561197c573d6000803e3d6000fd5b5050505081816003811061199257611992611fa2565b60200201516119a1908461209e565b92505b60010161189e565b506010547f4121b80d62643ee909a4d3383db4b827b9924c4be3cbf1f47a43091628ea21b58589601789900b876000602002015160170b13156040516119f493929190612181565b60405180910390a2505050505b60005b600c54811015611ab1576000600d6000600c8481548110611a2757611a27611fa2565b6000918252602080832091909101546001600160a01b03168352820192909252604001812080546001600160c01b0319166001600160c01b039390931692909217909155600c8054600e91839185908110611a8457611a84611fa2565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101611a04565b506000600f81905560108190556011819055601280546001600160601b03191690556013819055611ae490600c90611ced565b505050505050565b6000611af781611baa565b50601355565b600a8160028110610bf257600080fd5b600082815260208190526040902060010154611b2881611baa565b6106468383611c49565b60028160038110610bf257600080fd5b6000611b4d81611baa565b50601480546001600160a01b0319166001600160a01b0392909216919091179055565b60058160038110610bf257600080fd5b600c8181548110611b9057600080fd5b6000918252602090912001546001600160a01b0316905081565b611bb48133611cb4565b50565b6000611bc38383610bb9565b611c41576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611bf93390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610429565b506000610429565b6000611c558383610bb9565b15611c41576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610429565b611cbe8282610bb9565b610bb55760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161048d565b5080546000825590600052602060002090810190611bb49190611d29565b60405180606001604052806003906020820280368337509192915050565b5b80821115611d3e5760008155600101611d2a565b5090565b600060208284031215611d5457600080fd5b81356001600160e01b031981168114611d6c57600080fd5b9392505050565b8060170b8114611bb457600080fd5b600060208284031215611d9457600080fd5b8135611d6c81611d73565b6001600160a01b0381168114611bb457600080fd5b600060208284031215611dc657600080fd5b8135611d6c81611d9f565b600060208284031215611de357600080fd5b5035919050565b60008060408385031215611dfd57600080fd5b823591506020830135611e0f81611d9f565b809150509250929050565b803565ffffffffffff81168114611e3057600080fd5b919050565b60008060008060808587031215611e4b57600080fd5b611e5485611e1a565b9350611e6260208601611e1a565b93969395505050506040820135916060013590565b60008082840360a0811215611e8b57600080fd5b8335611e9681611d73565b92506080601f1982011215611eaa57600080fd5b506020830190509250929050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611ee057600080fd5b813567ffffffffffffffff80821115611ef857600080fd5b818401915084601f830112611f0c57600080fd5b813581811115611f1e57611f1e611eb8565b604051601f8201601f19908116603f01168101908382118183101715611f4657611f46611eb8565b81604052828152876020848701011115611f5f57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215611f9157600080fd5b813560ff81168114611d6c57600080fd5b634e487b7160e01b600052603260045260246000fd5b600060208284031215611fca57600080fd5b8151611d6c81611d9f565b604081526000835180604084015260005b818110156120035760208187018101516060868401015201611fe6565b506000606082850101526060601f19601f8301168401019150508260208301529392505050565b6000806040838503121561203d57600080fd5b825161204881611d73565b602084015190925063ffffffff81168114611e0f57600080fd5b634e487b7160e01b600052601160045260246000fd5b65ffffffffffff82811682821603908082111561209757612097612062565b5092915050565b8181038181111561042957610429612062565b634e487b7160e01b600052601260045260246000fd5b60008160170b8360170b806120de576120de6120b1565b6001600160bf1b03198214600019821416156120fc576120fc612062565b90059392505050565b601782810b9082900b036001600160bf1b031981126001600160bf1b038213171561042957610429612062565b808202811582820484141761042957610429612062565b600082612158576121586120b1565b500490565b9384526001600160a01b039290921660208401526040830152606082015260800190565b60a08101818560005b60038110156121b25781516001600160a01b031683526020928301929091019060010161218a565b5050508360170b60608301528215156080830152949350505050565b6000816121dd576121dd612062565b50600019019056fea264697066735822122077df8f8f82067110b7e78474ebd1555e29791fc4da42cd4fdbdb833b6dd20bb564736f6c63430008180033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806391d14854116100de578063d0bf580611610097578063e7ee6ad611610071578063e7ee6ad6146103ac578063f0f44260146103bf578063f540205c146103d2578063f71d96cb146103e557600080fd5b8063d0bf58061461037d578063d547741f14610390578063ddca3f43146103a357600080fd5b806391d14854146102c3578063a217fddf146102d6578063a26cc7e3146102de578063acebb280146102f1578063c32d88bb14610304578063c3fe3e281461031757600080fd5b80634529cae7116101305780634529cae71461022c5780635e9a523c146102345780635f50f7b91461026a57806361d027b31461027d5780636396d4b5146102a8578063786b844b146102bb57600080fd5b806301ffc9a7146101785780630c317791146101a057806320e9aac3146101b5578063248a9ca3146101e35780632f2ff15d1461020657806336568abe14610219575b600080fd5b61018b610186366004611d42565b6103f8565b60405190151581526020015b60405180910390f35b6101b36101ae366004611d82565b61042f565b005b6101d56101c3366004611db4565b600e6020526000908152604090205481565b604051908152602001610197565b6101d56101f1366004611dd1565b60009081526020819052604090206001015490565b6101b3610214366004611dea565b610621565b6101b3610227366004611dea565b61064c565b600c546101d5565b610257610242366004611db4565b600d6020526000908152604090205460170b81565b60405160179190910b8152602001610197565b6101b3610278366004611e35565b610684565b601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610197565b6101b36102b6366004611e77565b6107cd565b6101b3610a02565b61018b6102d1366004611dea565b610bb9565b6101d5600081565b6101d56102ec366004611dd1565b610be2565b6101b36102ff366004611ece565b610bf9565b6101b3610312366004611dd1565b611aec565b600f546010546011546012546013546103459493929165ffffffffffff80821692600160301b909204169086565b6040805196875260208701959095529385019290925265ffffffffffff908116606085015216608083015260a082015260c001610197565b6101d561038b366004611dd1565b611afd565b6101b361039e366004611dea565b611b0d565b6101d560015481565b6101d56103ba366004611dd1565b611b32565b6101b36103cd366004611db4565b611b42565b6101d56103e0366004611dd1565b611b70565b6102906103f3366004611dd1565b611b80565b60006001600160e01b03198216637965db0b60e01b148061042957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60125442600160301b90910465ffffffffffff1610156104965760405162461bcd60e51b815260206004820152601e60248201527f47616d6520697320636c6f73656420666f72206e657720706c6179657273000060448201526064015b60405180910390fd5b336000908152600d602052604090205460170b156104f65760405162461bcd60e51b815260206004820152601b60248201527f596f752061726520616c726561647920696e207468652067616d650000000000604482015260640161048d565b336000818152600e60209081526040808320429055600c8054600181019091557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b03191685179055600d9091529081902080546001600160c01b0319166001600160c01b0385161790556014546013549151636e553f6560e01b8152600481019290925260248201929092526001600160a01b0390911690636e553f6590604401600060405180830381600087803b1580156105bb57600080fd5b505af11580156105cf573d6000803e3d6000fd5b505060105460135460408051338152601787900b602082015280820192909252519193507ff9c605e9e655b01fc3a7e8bf44818fef37fa953aa03299365b56d7f4eaa8b668925081900360600190a250565b60008281526020819052604090206001015461063c81611baa565b6106468383611bb7565b50505050565b6001600160a01b03811633146106755760405163334bd91960e11b815260040160405180910390fd5b61067f8282611c49565b505050565b600061068f81611baa565b601154156106df5760405162461bcd60e51b815260206004820152601a60248201527f46696e6973682070726576696f75732067616d65206669727374000000000000604482015260640161048d565b600f8290554260118190556012805465ffffffffffff88811665ffffffffffff19918916600160301b02919091166001600160601b03199283161717909155601385905560405160d088901b6001600160d01b031916602082015260268101929092523060601b166046820152605a0160408051808303601f190181528282528051602091820120601081905542845265ffffffffffff80891692850192909252908816918301919091526060820185905260808201849052907f9f5cfc044880dd4da1194b1d6945daaaeddf1d8afa38f40e6d8e748f4e545d9c9060a00160405180910390a25050505050565b60125442600160301b90910465ffffffffffff16101561082f5760405162461bcd60e51b815260206004820152601e60248201527f47616d6520697320636c6f73656420666f72206e657720706c61796572730000604482015260640161048d565b336000908152600d602052604090205460170b1561088f5760405162461bcd60e51b815260206004820152601b60248201527f596f752061726520616c726561647920696e207468652067616d650000000000604482015260640161048d565b336000818152600e60209081526040808320429055600c8054600181019091557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b03191685179055600d82529182902080546001600160c01b0319166001600160c01b0387161790556014546013546001600160a01b03909116936350921b23939192909186359161092f918801908801611f7f565b604080516001600160e01b031960e088901b16815260048101959095526001600160a01b039093166024850152604484019190915260ff1660648301528401356084820152606084013560a482015260c401600060405180830381600087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505060105460135460408051338152601788900b602082015280820192909252519193507ff9c605e9e655b01fc3a7e8bf44818fef37fa953aa03299365b56d7f4eaa8b668925081900360600190a25050565b6000610a0d81611baa565b60135460005b600c54811015610b5657601454600c80546001600160a01b0390921691637ad226dc91859185908110610a4857610a48611fa2565b60009182526020909120015460405160e084901b6001600160e01b031916815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b158015610a9b57600080fd5b505af1158015610aaf573d6000803e3d6000fd5b505050506000600d6000600c8481548110610acc57610acc611fa2565b6000918252602080832091909101546001600160a01b03168352820192909252604001812080546001600160c01b0319166001600160c01b039390931692909217909155600c8054600e91839185908110610b2957610b29611fa2565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610a13565b506010546040517f712d82a27e9cc8c6f2ecbecd5a732cf15b6b16e38f3b65af9904d0aeba00d81890600090a26000600f81905560108190556011819055601280546001600160601b03191690556013819055610bb590600c90611ced565b5050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60088160028110610bf257600080fd5b0154905081565b6000610c0481611baa565b601054610c4a5760405162461bcd60e51b815260206004820152601460248201527314dd185c9d081d1a194819d85b5948199a5c9cdd60621b604482015260640161048d565b60125465ffffffffffff16421015610c9a5760405162461bcd60e51b81526020600482015260136024820152720a8dede40cac2e4d8f240e8de40ccd2dcd2e6d606b1b604482015260640161048d565b600c5460021115610e6a57600c54600090600103610e1557600c600081548110610cc657610cc6611fa2565b6000918252602082200154601454601354600c80546001600160a01b0394851696509290931693637ad226dc939192610d0157610d01611fa2565b60009182526020909120015460405160e084901b6001600160e01b031916815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b158015610d5457600080fd5b505af1158015610d68573d6000803e3d6000fd5b505050506000600d6000600c600081548110610d8657610d86611fa2565b6000918252602080832091909101546001600160a01b03168352820192909252604001812080546001600160c01b0319166001600160c01b039390931692909217909155600c8054600e9183918290610de157610de1611fa2565b60009182526020808320909101546001600160a01b03168352820192909252604001812091909155610e1590600c90611ced565b6010546040517f712d82a27e9cc8c6f2ecbecd5a732cf15b6b16e38f3b65af9904d0aeba00d81890600090a2506000600f81905560108190556011819055601280546001600160601b03191690556013555050565b6014546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed89190611fb8565b600f5460405163b6a9b90960e01b815291925060009182916001600160a01b0385169163b6a9b90991610f1091899190600401611fd5565b60408051808303816000875af1158015610f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f52919061202a565b601254919350915061025890610f769065ffffffffffff1663ffffffff8416612078565b65ffffffffffff16111580610f9c5750610258610f9963ffffffff83164261209e565b11155b610fdf5760405162461bcd60e51b815260206004820152601460248201527313db190818da185a5b9b1a5b9ac81c995c1bdc9d60621b604482015260640161048d565b6000610fed612710846120c7565b600c549091506002036114f9576000600c60008154811061101057611010611fa2565b6000918252602082200154600c80546001600160a01b03909216935090600190811061103e5761103e611fa2565b60009182526020808320909101546001600160a01b038581168452600d909252604083205491169250601787810b91900b1361109f576001600160a01b0383166000908152600d602052604090205461109a9060170b87612105565b6110c6565b6001600160a01b0383166000908152600d60205260409020546110c690879060170b612105565b6001600160a01b0383166000908152600d602052604081205491925090601788810b91900b1361111b576001600160a01b0383166000908152600d60205260409020546111169060170b88612105565b611142565b6001600160a01b0383166000908152600d602052604090205461114290889060170b612105565b90508060170b8260170b12156113235760006127108660170b8460170b131561116d57600854611171565b600a545b60135461117f906002612132565b6111899190612132565b6111939190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc967542926111cf9286928b929060040161215d565b600060405180830381600087803b1580156111e957600080fd5b505af11580156111fd573d6000803e3d6000fd5b5050505060006127108760170b8560170b131561121c57600954611220565b600b545b60135461122e906002612132565b6112389190612132565b6112429190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc9675429261127e9286928b929060040161215d565b600060405180830381600087803b15801561129857600080fd5b505af11580156112ac573d6000803e3d6000fd5b5050601054604080516060810182526001600160a01b03808c1682528a16602082015260008183015290519193507f4121b80d62643ee909a4d3383db4b827b9924c4be3cbf1f47a43091628ea21b59250611314918d9060178d810b908b900b131590612181565b60405180910390a250506114f0565b60006127108660170b8360170b131561133e57600854611342565b600a545b601354611350906002612132565b61135a9190612132565b6113649190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc967542926113a09286928a929060040161215d565b600060405180830381600087803b1580156113ba57600080fd5b505af11580156113ce573d6000803e3d6000fd5b5050505060006127108760170b8460170b13156113ed576009546113f1565b600b545b6013546113ff906002612132565b6114099190612132565b6114139190612149565b601454601354600154604051637e4b3aa160e11b81529394506001600160a01b039092169263fc9675429261144f9286928c929060040161215d565b600060405180830381600087803b15801561146957600080fd5b505af115801561147d573d6000803e3d6000fd5b5050601054604080516060810182526001600160a01b03808b1682528b16602082015260008183015290519193507f4121b80d62643ee909a4d3383db4b827b9924c4be3cbf1f47a43091628ea21b592506114e5918d9060178d810b908a900b131590612181565b60405180910390a250505b50505050611a01565b611501611d0b565b604080516060810182526001600160bf1b03808252602082018190529181019190915260005b600c54811015611809576000600c828154811061154657611546611fa2565b60009182526020808320909101546001600160a01b0316808352600d9091526040822054909250601790810b919089900b821361158c57611587828a612105565b611596565b6115968983612105565b6001600160a01b0384166000908152600e60205260408120549192505b60038110156117f8578681600381106115ce576115ce611fa2565b602002015160170b8360170b12156116cf5760025b8181111561168357876115f760018361209e565b6003811061160757611607611fa2565b602002015188826003811061161e5761161e611fa2565b60179290920b602090920201528861163760018361209e565b6003811061164757611647611fa2565b602002015189826003811061165e5761165e611fa2565b6001600160a01b0390921660209290920201528061167b816121ce565b9150506115e3565b508287826003811061169757611697611fa2565b60179290920b60209092020152848882600381106116b7576116b7611fa2565b6001600160a01b0390921660209290920201526117f8565b8681600381106116e1576116e1611fa2565b602002015160170b8360170b1480156117345750600e600089836003811061170b5761170b611fa2565b60200201516001600160a01b03166001600160a01b031681526020019081526020016000205482105b156117f05760025b818111156117dc578761175060018361209e565b6003811061176057611760611fa2565b602002015188826003811061177757611777611fa2565b60179290920b602090920201528861179060018361209e565b600381106117a0576117a0611fa2565b60200201518982600381106117b7576117b7611fa2565b6001600160a01b039092166020929092020152806117d4816121ce565b91505061173c565b50848882600381106116b7576116b7611fa2565b6001016115b3565b505060019093019250611527915050565b50600c5460135460009161181c91612132565b9050611826611d0b565b8251601786810b91900b1361186a576040805160608101918290529060059060039082845b81548152602001906001019080831161184b575050505050905061189b565b6040805160608101918290529060029060039082845b81548152602001906001019080831161188057505050505090505b60005b60038110156119ac5760008582600381106118bb576118bb611fa2565b60200201516001600160a01b0316146119a4576014546001600160a01b031663fc9675426127108484600381106118f4576118f4611fa2565b60200201516119039087612132565b61190d9190612149565b87846003811061191f5761191f611fa2565b60200201516013546001546040516001600160e01b031960e087901b16815261194e949392919060040161215d565b600060405180830381600087803b15801561196857600080fd5b505af115801561197c573d6000803e3d6000fd5b5050505081816003811061199257611992611fa2565b60200201516119a1908461209e565b92505b60010161189e565b506010547f4121b80d62643ee909a4d3383db4b827b9924c4be3cbf1f47a43091628ea21b58589601789900b876000602002015160170b13156040516119f493929190612181565b60405180910390a2505050505b60005b600c54811015611ab1576000600d6000600c8481548110611a2757611a27611fa2565b6000918252602080832091909101546001600160a01b03168352820192909252604001812080546001600160c01b0319166001600160c01b039390931692909217909155600c8054600e91839185908110611a8457611a84611fa2565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101611a04565b506000600f81905560108190556011819055601280546001600160601b03191690556013819055611ae490600c90611ced565b505050505050565b6000611af781611baa565b50601355565b600a8160028110610bf257600080fd5b600082815260208190526040902060010154611b2881611baa565b6106468383611c49565b60028160038110610bf257600080fd5b6000611b4d81611baa565b50601480546001600160a01b0319166001600160a01b0392909216919091179055565b60058160038110610bf257600080fd5b600c8181548110611b9057600080fd5b6000918252602090912001546001600160a01b0316905081565b611bb48133611cb4565b50565b6000611bc38383610bb9565b611c41576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611bf93390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610429565b506000610429565b6000611c558383610bb9565b15611c41576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610429565b611cbe8282610bb9565b610bb55760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161048d565b5080546000825590600052602060002090810190611bb49190611d29565b60405180606001604052806003906020820280368337509192915050565b5b80821115611d3e5760008155600101611d2a565b5090565b600060208284031215611d5457600080fd5b81356001600160e01b031981168114611d6c57600080fd5b9392505050565b8060170b8114611bb457600080fd5b600060208284031215611d9457600080fd5b8135611d6c81611d73565b6001600160a01b0381168114611bb457600080fd5b600060208284031215611dc657600080fd5b8135611d6c81611d9f565b600060208284031215611de357600080fd5b5035919050565b60008060408385031215611dfd57600080fd5b823591506020830135611e0f81611d9f565b809150509250929050565b803565ffffffffffff81168114611e3057600080fd5b919050565b60008060008060808587031215611e4b57600080fd5b611e5485611e1a565b9350611e6260208601611e1a565b93969395505050506040820135916060013590565b60008082840360a0811215611e8b57600080fd5b8335611e9681611d73565b92506080601f1982011215611eaa57600080fd5b506020830190509250929050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611ee057600080fd5b813567ffffffffffffffff80821115611ef857600080fd5b818401915084601f830112611f0c57600080fd5b813581811115611f1e57611f1e611eb8565b604051601f8201601f19908116603f01168101908382118183101715611f4657611f46611eb8565b81604052828152876020848701011115611f5f57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215611f9157600080fd5b813560ff81168114611d6c57600080fd5b634e487b7160e01b600052603260045260246000fd5b600060208284031215611fca57600080fd5b8151611d6c81611d9f565b604081526000835180604084015260005b818110156120035760208187018101516060868401015201611fe6565b506000606082850101526060601f19601f8301168401019150508260208301529392505050565b6000806040838503121561203d57600080fd5b825161204881611d73565b602084015190925063ffffffff81168114611e0f57600080fd5b634e487b7160e01b600052601160045260246000fd5b65ffffffffffff82811682821603908082111561209757612097612062565b5092915050565b8181038181111561042957610429612062565b634e487b7160e01b600052601260045260246000fd5b60008160170b8360170b806120de576120de6120b1565b6001600160bf1b03198214600019821416156120fc576120fc612062565b90059392505050565b601782810b9082900b036001600160bf1b031981126001600160bf1b038213171561042957610429612062565b808202811582820484141761042957610429612062565b600082612158576121586120b1565b500490565b9384526001600160a01b039290921660208401526040830152606082015260800190565b60a08101818560005b60038110156121b25781516001600160a01b031683526020928301929091019060010161218a565b5050508360170b60608301528215156080830152949350505050565b6000816121dd576121dd612062565b50600019019056fea264697066735822122077df8f8f82067110b7e78474ebd1555e29791fc4da42cd4fdbdb833b6dd20bb564736f6c63430008180033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.