Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 138,497 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Play With Deposi... | 113858925 | 103 days ago | IN | 0 ETH | 0.00039744 | ||||
Play With Deposi... | 113858923 | 103 days ago | IN | 0 ETH | 0.00039627 | ||||
Play With Deposi... | 113858920 | 103 days ago | IN | 0 ETH | 0.00038636 | ||||
Play With Deposi... | 113858917 | 103 days ago | IN | 0 ETH | 0.0003798 | ||||
Play With Deposi... | 113858907 | 103 days ago | IN | 0 ETH | 0.00045638 | ||||
Start Game | 113858893 | 103 days ago | IN | 0 ETH | 0.00032796 | ||||
Close Game | 113857493 | 103 days ago | IN | 0 ETH | 0.00040213 | ||||
Play With Deposi... | 113753729 | 104 days ago | IN | 0 ETH | 0.00000659 | ||||
Start Game | 113753601 | 104 days ago | IN | 0 ETH | 0.00001269 | ||||
Close Game | 113753590 | 104 days ago | IN | 0 ETH | 0.00001273 | ||||
Play With Deposi... | 113589215 | 104 days ago | IN | 0 ETH | 0.00005293 | ||||
Play With Deposi... | 113589211 | 104 days ago | IN | 0 ETH | 0.00005329 | ||||
Play With Deposi... | 113589201 | 104 days ago | IN | 0 ETH | 0.00006391 | ||||
Start Game | 113589191 | 104 days ago | IN | 0 ETH | 0.0000468 | ||||
Finalize Game | 113589169 | 104 days ago | IN | 0 ETH | 0.00012083 | ||||
Play With Deposi... | 113588920 | 104 days ago | IN | 0 ETH | 0.000055 | ||||
Play With Deposi... | 113588912 | 104 days ago | IN | 0 ETH | 0.00005494 | ||||
Play With Deposi... | 113588900 | 104 days ago | IN | 0 ETH | 0.00006684 | ||||
Start Game | 113588881 | 104 days ago | IN | 0 ETH | 0.00004686 | ||||
Finalize Game | 113588874 | 104 days ago | IN | 0 ETH | 0.0001244 | ||||
Play With Deposi... | 113588612 | 104 days ago | IN | 0 ETH | 0.00004332 | ||||
Play With Deposi... | 113588605 | 104 days ago | IN | 0 ETH | 0.00004289 | ||||
Play With Deposi... | 113588602 | 104 days ago | IN | 0 ETH | 0.00004324 | ||||
Play With Deposi... | 113588593 | 104 days ago | IN | 0 ETH | 0.00004285 | ||||
Play With Deposi... | 113588587 | 104 days ago | IN | 0 ETH | 0.00005139 |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x6219c97c...14ee5ad98 The constructor portion of the code might be different and could alter the actual behaviour of the contract
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 { bytes32 public constant GAME_MASTER_ROLE = keccak256("GAME_MASTER_ROLE"); uint256 constant DENOMINATOR = 10000; uint256 public exactRange = 50000; uint256 public fee = 1000; uint256 public maxPlayers = 100; uint256[3][6] public rates = [ [9000, 1000, 0], [10000, 0, 0], [7500, 2500, 0], [9000, 1000, 0], [5000, 3500, 1500], [7500, 1500, 1000] ]; event NewTreasury(address newTreasury); event NewFee(uint256 newFee); event NewExactRange(uint256 newExactRange); event BullseyeStart( uint256 startTime, uint32 stopPredictAt, uint32 endTime, uint32 depositAmount, uint8 feedNumber, bytes32 gameId ); event BullseyeNewPlayer( address player, uint32 assetPrice, uint256 depositAmount, bytes32 gameId, uint256 index ); event BullseyeFinalized( address[3] players, uint256[3] topIndexes, int192 finalPrice, bool isExact, bytes32 gameId ); event BullseyeCancelled(bytes32 gameId); struct GameInfo { uint8 feedNumber; uint256 startTime; uint256 endTime; uint256 stopPredictAt; uint256 depositAmount; } struct GuessStruct { address player; uint256 assetPrice; uint256 timestamp; } uint256[] packedGuessData; uint256 packedData; bytes32 public currentGameId; 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( uint32 endTime, uint32 stopPredictAt, uint32 depositAmount, uint8 feedNumber ) public onlyRole(GAME_MASTER_ROLE) { require(packedData == 0, "Finish previous game first"); require(endTime > block.timestamp, "Wrong ending time"); packedData = (block.timestamp | (uint256(stopPredictAt) << 32) | (uint256(endTime) << 64) | (uint256(feedNumber) << 96) | (uint256(depositAmount) << 104)); currentGameId = keccak256( abi.encodePacked(endTime, block.timestamp, address(this)) ); emit BullseyeStart( block.timestamp, stopPredictAt, endTime, depositAmount, feedNumber, currentGameId ); } /** * Participate in bullseye game and deposit funds * @param assetPrice player's picked asset price */ function play(uint32 assetPrice) public { GameInfo memory game = decodeData(); require( packedGuessData.length + 1 <= maxPlayers, "Max player amount reached" ); require( game.stopPredictAt >= block.timestamp, "Game is closed for new players" ); uint256 packedGuess = uint256(uint160(msg.sender)) | (block.timestamp << 160) | (uint256(assetPrice) << 192); packedGuessData.push(packedGuess); ITreasury(treasury).depositAndLock(game.depositAmount, msg.sender); emit BullseyeNewPlayer( msg.sender, assetPrice, game.depositAmount, currentGameId, packedGuessData.length - 1 ); } /** * Participate in bullseye game with deposited funds * @param assetPrice player's picked asset price */ function playWithDeposit(uint32 assetPrice) public { GameInfo memory game = decodeData(); require( packedGuessData.length + 1 <= maxPlayers, "Max player amount reached" ); require( game.stopPredictAt >= block.timestamp, "Game is closed for new players" ); uint256 packedGuess = uint256(uint160(msg.sender)) | (block.timestamp << 160) | (uint256(assetPrice) << 192); packedGuessData.push(packedGuess); ITreasury(treasury).lock(game.depositAmount, msg.sender); emit BullseyeNewPlayer( msg.sender, assetPrice, game.depositAmount, currentGameId, packedGuessData.length - 1 ); } /** * Participate in bullseye game and deposit funds with permit * @param assetPrice player's picked asset price */ function playWithPermit( uint32 assetPrice, ITreasury.PermitData calldata permitData ) public { GameInfo memory game = decodeData(); require( packedGuessData.length + 1 <= maxPlayers, "Max player amount reached" ); require( game.stopPredictAt >= block.timestamp, "Game is closed for new players" ); uint256 packedGuess = uint256(uint160(msg.sender)) | (block.timestamp << 160) | (uint256(assetPrice) << 192); packedGuessData.push(packedGuess); ITreasury(treasury).depositAndLockWithPermit( game.depositAmount, msg.sender, permitData.deadline, permitData.v, permitData.r, permitData.s ); emit BullseyeNewPlayer( msg.sender, assetPrice, game.depositAmount, currentGameId, packedGuessData.length - 1 ); } /** * Finalizes bullseye game and distributes rewards to players * @param unverifiedReport Chainlink DataStreams report */ function finalizeGame( bytes memory unverifiedReport ) public onlyRole(GAME_MASTER_ROLE) { GameInfo memory game = decodeData(); require(currentGameId != bytes32(0), "Start the game first"); require(block.timestamp >= game.endTime, "Too early to finish"); if (packedGuessData.length < 2) { if (packedGuessData.length == 1) { GuessStruct memory playerGuessData = decodeGuess(0); emit BullseyeCancelled(currentGameId); ITreasury(treasury).refund( game.depositAmount, playerGuessData.player ); delete packedGuessData; } packedData = 0; currentGameId = bytes32(0); return; } address upkeep = ITreasury(treasury).upkeep(); (int192 finalPrice, uint32 priceTimestamp) = IDataStreamsVerifier( upkeep ).verifyReportWithTimestamp(unverifiedReport, game.feedNumber); finalPrice /= 1e14; require( priceTimestamp - game.endTime <= 1 minutes || block.timestamp - priceTimestamp <= 1 minutes, "Old chainlink report" ); if (packedGuessData.length == 2) { GuessStruct memory playerOneGuessData = decodeGuess(0); GuessStruct memory playerTwoGuessData = decodeGuess(1); uint256 playerOneDiff = playerOneGuessData.assetPrice > uint192(finalPrice) ? playerOneGuessData.assetPrice - uint192(finalPrice) : uint192(finalPrice) - playerOneGuessData.assetPrice; uint256 playerTwoDiff = playerTwoGuessData.assetPrice > uint192(finalPrice) ? playerTwoGuessData.assetPrice - uint192(finalPrice) : uint192(finalPrice) - playerTwoGuessData.assetPrice; if (playerOneDiff < playerTwoDiff) { // player 1 closer if (playerOneDiff > exactRange) { uint256 wonAmountFirst = (2 * game.depositAmount * 10 ** IERC20(ITreasury(treasury).approvedToken()) .decimals() * rates[0][0]) / DENOMINATOR; ITreasury(treasury).distributeBullseye( wonAmountFirst, playerOneGuessData.player, fee ); uint256 wonAmountSecond = 2 * game.depositAmount * 10 ** IERC20(ITreasury(treasury).approvedToken()) .decimals() - wonAmountFirst; ITreasury(treasury).distributeBullseye( wonAmountSecond, playerTwoGuessData.player, fee ); } else { ITreasury(treasury).distributeBullseye( 2 * game.depositAmount * 10 ** IERC20(ITreasury(treasury).approvedToken()) .decimals(), playerOneGuessData.player, fee ); } emit BullseyeFinalized( [ playerOneGuessData.player, playerTwoGuessData.player, address(0) ], [uint256(0), uint256(1), uint256(0)], finalPrice, playerOneDiff <= exactRange, currentGameId ); } else { // player 2 closer if (playerTwoDiff > exactRange) { uint256 wonAmountFirst = (2 * game.depositAmount * 10 ** IERC20(ITreasury(treasury).approvedToken()) .decimals() * rates[0][0]) / DENOMINATOR; ITreasury(treasury).distributeBullseye( wonAmountFirst, playerTwoGuessData.player, fee ); uint256 wonAmountSecond = 2 * game.depositAmount * 10 ** IERC20(ITreasury(treasury).approvedToken()) .decimals() - wonAmountFirst; ITreasury(treasury).distributeBullseye( wonAmountSecond, playerOneGuessData.player, fee ); } else { ITreasury(treasury).distributeBullseye( 2 * game.depositAmount * 10 ** IERC20(ITreasury(treasury).approvedToken()) .decimals(), playerTwoGuessData.player, fee ); } emit BullseyeFinalized( [ playerTwoGuessData.player, playerOneGuessData.player, address(0) ], [uint256(1), uint256(0), uint256(0)], finalPrice, playerTwoDiff <= exactRange, currentGameId ); } } else { uint256[3] memory topIndexes; address[3] memory topPlayers; uint256[3] memory topTimestamps; uint256[3] memory closestDiff = [ type(uint256).max, type(uint256).max, type(uint256).max ]; for (uint256 j = 0; j < packedGuessData.length; j++) { GuessStruct memory playerGuessData = decodeGuess(j); uint256 currentDiff = playerGuessData.assetPrice > uint192(finalPrice) ? playerGuessData.assetPrice - uint192(finalPrice) : uint192(finalPrice) - playerGuessData.assetPrice; 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]; topIndexes[k] = topIndexes[k - 1]; } closestDiff[i] = currentDiff; topPlayers[i] = playerGuessData.player; topTimestamps[i] = playerGuessData.timestamp; topIndexes[i] = j; break; } else if ( //write top timestamps currentDiff == closestDiff[i] && playerGuessData.timestamp < topTimestamps[i] ) { for (uint256 k = 2; k > i; k--) { closestDiff[k] = closestDiff[k - 1]; topPlayers[k] = topPlayers[k - 1]; topIndexes[k] = topIndexes[k - 1]; } topIndexes[i] = j; topPlayers[i] = playerGuessData.player; break; } } } uint256 totalDeposited = game.depositAmount * packedGuessData.length; uint256[3] memory wonAmount; if (closestDiff[0] <= exactRange) { if (packedGuessData.length <= 5) { wonAmount = rates[1]; } else if (packedGuessData.length <= 10) { wonAmount = rates[3]; } else { wonAmount = rates[5]; } } else { if (packedGuessData.length <= 5) { wonAmount = rates[0]; } else if (packedGuessData.length <= 10) { wonAmount = rates[2]; } else { wonAmount = rates[4]; } } for (uint256 i = 0; i < 3; i++) { if (topPlayers[i] != address(0)) { if (wonAmount[i] != 0) { if (i != 3) { ITreasury(treasury).distributeBullseye( (totalDeposited * 10 ** IERC20( ITreasury(treasury).approvedToken() ).decimals() * wonAmount[i]) / DENOMINATOR, topPlayers[i], fee ); } else { ITreasury(treasury).distributeBullseye( totalDeposited * 10 ** IERC20( ITreasury(treasury).approvedToken() ).decimals() - ((totalDeposited * 10 ** IERC20( ITreasury(treasury) .approvedToken() ).decimals() * wonAmount[0]) / DENOMINATOR + (totalDeposited * 10 ** IERC20( ITreasury(treasury) .approvedToken() ).decimals() * wonAmount[1]) / DENOMINATOR), topPlayers[i], fee ); } } } } emit BullseyeFinalized( topPlayers, topIndexes, finalPrice, closestDiff[0] <= exactRange, currentGameId ); } packedData = 0; currentGameId = bytes32(0); delete packedGuessData; } /** * Closes game and makes refund */ function closeGame() public onlyRole(GAME_MASTER_ROLE) { require(packedData != 0, "Game not started"); GameInfo memory game = decodeData(); uint256 deposit = game.depositAmount; for (uint i; i < packedGuessData.length; i++) { GuessStruct memory playerGuessData = decodeGuess(i); ITreasury(treasury).refund(deposit, playerGuessData.player); } emit BullseyeCancelled(currentGameId); packedData = 0; currentGameId = bytes32(0); delete packedGuessData; } /** * Returns decoded game data */ function decodeData() public view returns (GameInfo memory data) { data.startTime = uint256(uint32(packedData)); data.stopPredictAt = uint256(uint32(packedData >> 32)); data.endTime = uint256(uint32(packedData >> 64)); data.feedNumber = uint8(packedData >> 96); data.depositAmount = uint256(uint32(packedData >> 104)); } /** * Returns decoded guess packed data */ function decodeGuess( uint256 index ) public view returns (GuessStruct memory data) { uint256 guessData = packedGuessData[index]; data.player = address(uint160(guessData)); data.timestamp = uint256(uint32(guessData >> 160)); data.assetPrice = uint256(uint32(guessData >> 192)); } function getTotalPlayers() public view returns (uint256) { return packedGuessData.length; } /** * Change maximum players number * @param newMax new maximum number */ function setMaxPlayers(uint256 newMax) public onlyRole(DEFAULT_ADMIN_ROLE) { maxPlayers = newMax; } /** * Change treasury address * @param newTreasury new treasury address */ function setTreasury( address newTreasury ) public onlyRole(DEFAULT_ADMIN_ROLE) { require(newTreasury != address(0), "Zero address"); treasury = newTreasury; emit NewTreasury(newTreasury); } /** * Change exact range * @param newRange new exact range */ function setExactRange( uint256 newRange ) public onlyRole(DEFAULT_ADMIN_ROLE) { exactRange = newRange; emit NewExactRange(newRange); } /** * Change fee * @param newFee new fee in bp */ function setFee(uint256 newFee) public onlyRole(DEFAULT_ADMIN_ROLE) { fee = newFee; emit NewFee(newFee); } function getRateIndex( uint256 playersCount, bool isExact ) public pure returns (uint256 index) { if (playersCount <= 5) { index = isExact ? 1 : 0; } else if (playersCount <= 10) { index = isExact ? 3 : 2; } else { index = isExact ? 5 : 4; } } function setRate( uint256[3] memory rate, uint256 playersCount, bool isExact ) public onlyRole(DEFAULT_ADMIN_ROLE) { rates[getRateIndex(playersCount, isExact)] = rate; } } interface IERC20 { function decimals() external view returns (uint256); }
// 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.1.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC-165 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. This account bears the admin role (for the granted role). * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}. */ 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.1.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 ERC-165 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.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * 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[ERC 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, uint8 feedNumber ) 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 depositAndLock(uint256 amount, address from) external; function depositAndLockWithPermit( uint256 amount, address from, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; function lock(uint256 amount, address from) external; function upkeep() external view returns (address); function distribute(uint256 amount, address to, uint256 gameFee) external; function distributeBullseye( uint256 amount, address to, uint256 gameFee ) external; function approvedToken() external returns (address); function refund(uint256 amount, address to) external; function refundWithFees( uint256 amount, address to, uint256 refundFee ) external; function distributeWithoutFee( uint256 rate, address to, uint256 usedFee, uint256 initialDeposit ) external; function calculateSetupRate( uint256 lostTeamTotal, uint256 wonTeamTotal, uint256 setupFee, 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":false,"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":"uint256[3]","name":"topIndexes","type":"uint256[3]"},{"indexed":false,"internalType":"int192","name":"finalPrice","type":"int192"},{"indexed":false,"internalType":"bool","name":"isExact","type":"bool"},{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"BullseyeFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint32","name":"assetPrice","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"BullseyeNewPlayer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"stopPredictAt","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"endTime","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"depositAmount","type":"uint32"},{"indexed":false,"internalType":"uint8","name":"feedNumber","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"BullseyeStart","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newExactRange","type":"uint256"}],"name":"NewExactRange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"NewFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTreasury","type":"address"}],"name":"NewTreasury","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":[],"name":"GAME_MASTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentGameId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decodeData","outputs":[{"components":[{"internalType":"uint8","name":"feedNumber","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"stopPredictAt","type":"uint256"},{"internalType":"uint256","name":"depositAmount","type":"uint256"}],"internalType":"struct Bullseye.GameInfo","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"decodeGuess","outputs":[{"components":[{"internalType":"address","name":"player","type":"address"},{"internalType":"uint256","name":"assetPrice","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct Bullseye.GuessStruct","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exactRange","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":[{"internalType":"uint256","name":"playersCount","type":"uint256"},{"internalType":"bool","name":"isExact","type":"bool"}],"name":"getRateIndex","outputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"pure","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":[],"name":"maxPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"assetPrice","type":"uint32"}],"name":"play","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"assetPrice","type":"uint32"}],"name":"playWithDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"assetPrice","type":"uint32"},{"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":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"rates","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":"uint256","name":"newRange","type":"uint256"}],"name":"setExactRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"setMaxPlayers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[3]","name":"rate","type":"uint256[3]"},{"internalType":"uint256","name":"playersCount","type":"uint256"},{"internalType":"bool","name":"isExact","type":"bool"}],"name":"setRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"uint32","name":"stopPredictAt","type":"uint32"},{"internalType":"uint32","name":"depositAmount","type":"uint32"},{"internalType":"uint8","name":"feedNumber","type":"uint8"}],"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"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806391d1485411610104578063ce07b075116100a2578063f0f4426011610071578063f0f442601461041a578063f7237a1b1461042d578063f954be8614610440578063fd979b111461045357600080fd5b8063ce07b0751461039e578063d547741f146103eb578063d7a04edf146103fe578063ddca3f431461041157600080fd5b8063acebb280116100de578063acebb2801461032f578063ad1def1e14610342578063ae304d1c14610357578063b2c5c8761461039557600080fd5b806391d1485414610301578063a217fddf14610314578063ab544e861461031c57600080fd5b80634c2412a2116101715780635f2aacc41161014b5780635f2aacc4146102a857806361d027b3146102bb57806369fe0e2d146102e6578063786b844b146102f957600080fd5b80634c2412a214610283578063536a3ddc1461028c57806359b31abf1461029557600080fd5b8063288dee3b116101ad578063288dee3b146102405780632f2ff15d1461025557806336568abe146102685780634529cae71461027b57600080fd5b806301ffc9a7146101d45780630f94aa06146101fc578063248a9ca31461021d575b600080fd5b6101e76101e23660046129cf565b610466565b60405190151581526020015b60405180910390f35b61020f61020a366004612a15565b61049d565b6040519081526020016101f3565b61020f61022b366004612a41565b60009081526020819052604090206001015490565b61025361024e366004612a41565b6104f5565b005b610253610263366004612a6f565b610506565b610253610276366004612a6f565b610531565b60165461020f565b61020f60035481565b61020f60185481565b61020f6102a3366004612a9f565b610569565b6102536102b6366004612ad3565b610594565b6019546102ce906001600160a01b031681565b6040516001600160a01b0390911681526020016101f3565b6102536102f4366004612a41565b610741565b610253610789565b6101e761030f366004612a6f565b6108da565b61020f600081565b61025361032a366004612a41565b610903565b61025361033d366004612b06565b610943565b61020f6000805160206130d983398151915281565b61036a610365366004612a41565b612186565b6040805182516001600160a01b031681526020808401519082015291810151908201526060016101f3565b61020f60015481565b6103a6612203565b6040516101f39190600060a08201905060ff83511682526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b6102536103f9366004612a6f565b61227c565b61025361040c366004612bc8565b6122a1565b61020f60025481565b610253610428366004612c22565b61244b565b61025361043b366004612ad3565b6124e9565b61025361044e366004612c3f565b6125df565b610253610461366004612c80565b6127bc565b60006001600160e01b03198216637965db0b60e01b148061049757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000600583116104c057816104b35760006104b6565b60015b60ff169050610497565b600a83116104dc57816104d45760026104b6565b506003610497565b816104e85760046104eb565b60055b60ff169392505050565b6000610500816127fd565b50600355565b600082815260208190526040902060010154610521816127fd565b61052b838361280a565b50505050565b6001600160a01b038116331461055a5760405163334bd91960e11b815260040160405180910390fd5b610564828261289c565b505050565b6004826006811061057957600080fd5b60030201816003811061058b57600080fd5b01549150829050565b600061059e612203565b600354601654919250906105b3906001612d29565b11156105da5760405162461bcd60e51b81526004016105d190612d3c565b60405180910390fd5b42816060015110156105fe5760405162461bcd60e51b81526004016105d190612d73565b60168054600181018255600091909152334260a01b811763ffffffff60c01b60c086901b16177fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b51242899092018290556019546080840151604051632b329c5360e21b81526001600160a01b03929092169263acca714c926106939291906004019182526001600160a01b0316602082015260400190565b600060405180830381600087803b1580156106ad57600080fd5b505af11580156106c1573d6000803e3d6000fd5b505050507fab4e31aa5778793488e6ace2016f3a4ce611ef72ec5181bf80a2b8d523f4d2da3384846080015160185460016016805490506107029190612daa565b604080516001600160a01b03909616865263ffffffff9094166020860152928401919091526060830152608082015260a00160405180910390a1505050565b600061074c816127fd565b60028290556040518281527f63fe946ed58429ac3c5e64d4356ff92c26d7fa1e73586515df8ba9f059ab54a5906020015b60405180910390a15050565b6000805160206130d98339815191526107a1816127fd565b6017546000036107e65760405162461bcd60e51b815260206004820152601060248201526f11d85b59481b9bdd081cdd185c9d195960821b60448201526064016105d1565b60006107f0612203565b608081015190915060005b60165481101561088657600061081082612186565b6019548151604051631eb489b760e21b8152600481018790526001600160a01b0391821660248201529293501690637ad226dc90604401600060405180830381600087803b15801561086157600080fd5b505af1158015610875573d6000803e3d6000fd5b5050600190930192506107fb915050565b507f712d82a27e9cc8c6f2ecbecd5a732cf15b6b16e38f3b65af9904d0aeba00d8186018546040516108ba91815260200190565b60405180910390a160006017819055601881905561056490601690612940565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600061090e816127fd565b60018290556040518281527ff2350a85c47cad6c064e0f0fd6bcdddd758a3e3c997106ccb9479e2669d67b6f9060200161077d565b6000805160206130d983398151915261095b816127fd565b6000610965612203565b6018549091506109ae5760405162461bcd60e51b815260206004820152601460248201527314dd185c9d081d1a194819d85b5948199a5c9cdd60621b60448201526064016105d1565b80604001514210156109f85760405162461bcd60e51b81526020600482015260136024820152720a8dede40cac2e4d8f240e8de40ccd2dcd2e6d606b1b60448201526064016105d1565b60165460021115610ae357601654600103610ad4576000610a196000612186565b90507f712d82a27e9cc8c6f2ecbecd5a732cf15b6b16e38f3b65af9904d0aeba00d818601854604051610a4e91815260200190565b60405180910390a160195460808301518251604051631eb489b760e21b815260048101929092526001600160a01b03908116602483015290911690637ad226dc90604401600060405180830381600087803b158015610aac57600080fd5b505af1158015610ac0573d6000803e3d6000fd5b5050505060166000610ad29190612940565b505b50600060178190556018555050565b6019546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa158015610b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b519190612dbd565b825160405163d369dc6160e01b815291925060009182916001600160a01b0385169163d369dc6191610b88918a9190600401612dda565b60408051808303816000875af1158015610ba6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bca9190612e32565b9092509050610bdf655af3107a400083612e7d565b9150603c84604001518263ffffffff16610bf99190612daa565b111580610c165750603c610c1363ffffffff831642612daa565b11155b610c595760405162461bcd60e51b815260206004820152601460248201527313db190818da185a5b9b1a5b9ac81c995c1bdc9d60621b60448201526064016105d1565b6016546002036116fc576000610c6f6000612186565b90506000610c7d6001612186565b90506000846001600160c01b0316836020015111610cb2576020830151610cad906001600160c01b038716612daa565b610ccb565b846001600160c01b03168360200151610ccb9190612daa565b90506000856001600160c01b0316836020015111610d00576020830151610cfb906001600160c01b038816612daa565b610d19565b856001600160c01b03168360200151610d199190612daa565b90508082101561120d5760015482111561102857600480546019546040805163bab4625960e01b8152905160009461271094936001600160a01b03169263bab462599281830192602092829003018189875af1158015610d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da19190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612ed1565b610e0d90600a612fce565b60808c0151610e1d906002612fda565b610e279190612fda565b610e319190612fda565b610e3b9190612ff1565b6019548651600254604051635d5246cf60e11b81529394506001600160a01b039092169263baa48d9e92610e76928692909190600401613005565b600060405180830381600087803b158015610e9057600080fd5b505af1158015610ea4573d6000803e3d6000fd5b50505050600081601960009054906101000a90046001600160a01b03166001600160a01b031663bab462596040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610f00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f249190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f859190612ed1565b610f9090600a612fce565b60808c0151610fa0906002612fda565b610faa9190612fda565b610fb49190612daa565b6019548651600254604051635d5246cf60e11b81529394506001600160a01b039092169263baa48d9e92610fef928692909190600401613005565b600060405180830381600087803b15801561100957600080fd5b505af115801561101d573d6000803e3d6000fd5b505050505050611181565b6019546040805163bab4625960e01b815290516001600160a01b039092169163baa48d9e91839163bab462599160048082019260209290919082900301816000875af115801561107c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a09190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111019190612ed1565b61110c90600a612fce565b60808b015161111c906002612fda565b6111269190612fda565b86516002546040516001600160e01b031960e086901b16815261114e93929190600401613005565b600060405180830381600087803b15801561116857600080fd5b505af115801561117c573d6000803e3d6000fd5b505050505b604080516060808201835286516001600160a01b0390811683528651166020808401919091526000838501819052845192830185528083526001918301829052828501525460185493517f3672fd56560e49f0f4d041528094fadff7cf68cb7cca887f7cfd6f06b2260f21946112009493928c92908911159190613024565b60405180910390a16116f3565b60015481111561151257600480546019546040805163bab4625960e01b8152905160009461271094936001600160a01b03169263bab462599281830192602092829003018189875af1158015611267573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128b9190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec9190612ed1565b6112f790600a612fce565b60808c0151611307906002612fda565b6113119190612fda565b61131b9190612fda565b6113259190612ff1565b6019548551600254604051635d5246cf60e11b81529394506001600160a01b039092169263baa48d9e92611360928692909190600401613005565b600060405180830381600087803b15801561137a57600080fd5b505af115801561138e573d6000803e3d6000fd5b50505050600081601960009054906101000a90046001600160a01b03166001600160a01b031663bab462596040518163ffffffff1660e01b81526004016020604051808303816000875af11580156113ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140e9190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561144b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146f9190612ed1565b61147a90600a612fce565b60808c015161148a906002612fda565b6114949190612fda565b61149e9190612daa565b6019548751600254604051635d5246cf60e11b81529394506001600160a01b039092169263baa48d9e926114d9928692909190600401613005565b600060405180830381600087803b1580156114f357600080fd5b505af1158015611507573d6000803e3d6000fd5b50505050505061166b565b6019546040805163bab4625960e01b815290516001600160a01b039092169163baa48d9e91839163bab462599160048082019260209290919082900301816000875af1158015611566573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158a9190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115eb9190612ed1565b6115f690600a612fce565b60808b0151611606906002612fda565b6116109190612fda565b85516002546040516001600160e01b031960e086901b16815261163893929190600401613005565b600060405180830381600087803b15801561165257600080fd5b505af1158015611666573d6000803e3d6000fd5b505050505b604080516060808201835285516001600160a01b0390811683528751166020808401919091526000838501819052845192830185526001808452918301819052828501525460185493517f3672fd56560e49f0f4d041528094fadff7cf68cb7cca887f7cfd6f06b2260f21946116ea9493928c92908811159190613024565b60405180910390a15b50505050612165565b61170461295e565b61170c61295e565b61171461295e565b6000604051806060016040528060001981526020016000198152602001600019815250905060005b601654811015611a8557600061175182612186565b90506000886001600160c01b0316826020015111611786576020820151611781906001600160c01b038b16612daa565b61179f565b886001600160c01b0316826020015161179f9190612daa565b905060005b6003811015611a7a578481600381106117bf576117bf612ebb565b60200201518210156119175760025b8181111561189e57856117e2600183612daa565b600381106117f2576117f2612ebb565b602002015186826003811061180957611809612ebb565b60200201528761181a600183612daa565b6003811061182a5761182a612ebb565b602002015188826003811061184157611841612ebb565b6001600160a01b03909216602092909202015288611860600183612daa565b6003811061187057611870612ebb565b602002015189826003811061188757611887612ebb565b602002015280611896816130a6565b9150506117ce565b50818582600381106118b2576118b2612ebb565b602002015282518782600381106118cb576118cb612ebb565b6001600160a01b03909216602092909202015260408301518682600381106118f5576118f5612ebb565b60200201528388826003811061190d5761190d612ebb565b6020020152611a7a565b84816003811061192957611929612ebb565b602002015182148015611955575085816003811061194957611949612ebb565b60200201518360400151105b15611a725760025b81811115611a2d5785611971600183612daa565b6003811061198157611981612ebb565b602002015186826003811061199857611998612ebb565b6020020152876119a9600183612daa565b600381106119b9576119b9612ebb565b60200201518882600381106119d0576119d0612ebb565b6001600160a01b039092166020929092020152886119ef600183612daa565b600381106119ff576119ff612ebb565b6020020151898260038110611a1657611a16612ebb565b602002015280611a25816130a6565b91505061195d565b5083888260038110611a4157611a41612ebb565b60200201528251878260038110611a5a57611a5a612ebb565b6001600160a01b039092166020929092020152611a7a565b6001016117a4565b50505060010161173c565b506016546080890151600091611a9a91612fda565b9050611aa461295e565b600154835111611b3757601654600510611af457600460015b60408051606081019182905292600392830201919082845b815481526020019060010190808311611ad55750505050509050611b8e565b601654600a10611b2e57604080516060810191829052600d805482529091600390600e60208501808311611ad55750505050509050611b8e565b60046005611abd565b601654600510611b4a5760046000611abd565b601654600a10611b5d5760046002611abd565b6040805160608101918290529060109060039082845b815481526020019060010190808311611b7357505050505090505b60005b6003811015612100576000868260038110611bae57611bae612ebb565b60200201516001600160a01b0316146120f857818160038110611bd357611bd3612ebb565b6020020151156120f85780600314611d82576019546001600160a01b031663baa48d9e612710848460038110611c0b57611c0b612ebb565b6020020151601960009054906101000a90046001600160a01b03166001600160a01b031663bab462596040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611c65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c899190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611cc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cea9190612ed1565b611cf590600a612fce565b611cff9088612fda565b611d099190612fda565b611d139190612ff1565b888460038110611d2557611d25612ebb565b60200201516002546040518463ffffffff1660e01b8152600401611d4b93929190613005565b600060405180830381600087803b158015611d6557600080fd5b505af1158015611d79573d6000803e3d6000fd5b505050506120f8565b6019546020808401516040805163bab4625960e01b815290516001600160a01b039094169363baa48d9e936127109392869263bab462599260048084019391929182900301816000875af1158015611dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e029190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e639190612ed1565b611e6e90600a612fce565b611e789088612fda565b611e829190612fda565b611e8c9190612ff1565b84516019546040805163bab4625960e01b8152905161271093926001600160a01b03169163bab4625991600480830192602092919082900301816000875af1158015611edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f009190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f619190612ed1565b611f6c90600a612fce565b611f769089612fda565b611f809190612fda565b611f8a9190612ff1565b611f949190612d29565b601960009054906101000a90046001600160a01b03166001600160a01b031663bab462596040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190612dbd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561204a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206e9190612ed1565b61207990600a612fce565b6120839087612fda565b61208d9190612daa565b88846003811061209f5761209f612ebb565b60200201516002546040518463ffffffff1660e01b81526004016120c593929190613005565b600060405180830381600087803b1580156120df57600080fd5b505af11580156120f3573d6000803e3d6000fd5b505050505b600101611b91565b507f3672fd56560e49f0f4d041528094fadff7cf68cb7cca887f7cfd6f06b2260f2185878a6001548760006003811061213b5761213b612ebb565b60200201511115601854604051612156959493929190613024565b60405180910390a15050505050505b60006017819055601881905561217d90601690612940565b505050505b5050565b6121b3604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b6000601683815481106121c8576121c8612ebb565b600091825260209182902001546001600160a01b038116845263ffffffff60a082901c8116604086015260c09190911c169083015250919050565b6122386040518060a00160405280600060ff168152602001600081526020016000815260200160008152602001600081525090565b60175463ffffffff80821660208481019190915282901c8116606080850191909152604083811c83169085015282901c60ff16835260689190911c16608082015290565b600082815260208190526040902060010154612297816127fd565b61052b838361289c565b6000805160206130d98339815191526122b9816127fd565b601754156123095760405162461bcd60e51b815260206004820152601a60248201527f46696e6973682070726576696f75732067616d6520666972737400000000000060448201526064016105d1565b428563ffffffff16116123525760405162461bcd60e51b815260206004820152601160248201527057726f6e6720656e64696e672074696d6560781b60448201526064016105d1565b60688363ffffffff16901b60608360ff16901b60408763ffffffff16901b60208763ffffffff16901b42171717176017819055508442306040516020016123cd9392919060e09390931b6001600160e01b0319168352600483019190915260601b6bffffffffffffffffffffffff1916602482015260380190565b60408051601f198184030181528282528051602091820120601881905542845263ffffffff8881169285019290925288821684840152908616606084015260ff8516608084015260a0830152517f8199b2d39fc32afd17a2a39a52b1406abb1ccf88c62a75ba7298658046fd18e19181900360c00190a15050505050565b6000612456816127fd565b6001600160a01b03821661249b5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b60448201526064016105d1565b601980546001600160a01b0319166001600160a01b0384169081179091556040519081527fafa147634b29e2c7bd53ce194256b9f41cfb9ba3036f2b822fdd1d965beea0869060200161077d565b60006124f3612203565b60035460165491925090612508906001612d29565b11156125265760405162461bcd60e51b81526004016105d190612d3c565b428160600151101561254a5760405162461bcd60e51b81526004016105d190612d73565b60168054600181018255600091909152334260a01b811763ffffffff60c01b60c086901b16177fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b512428990920182905560195460808401516040516319b7efed60e21b81526001600160a01b0392909216926366dfbfb4926106939291906004019182526001600160a01b0316602082015260400190565b60006125e9612203565b600354601654919250906125fe906001612d29565b111561261c5760405162461bcd60e51b81526004016105d190612d3c565b42816060015110156126405760405162461bcd60e51b81526004016105d190612d73565b60168054600181018255600091909152334260a01b811763ffffffff60c01b60c087901b16177fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b512428990920182905560195460808401516001600160a01b039190911691631567920a919086356126bb6040890160208a016130bd565b604080516001600160e01b031960e088901b16815260048101959095526001600160a01b039093166024850152604484019190915260ff1660648301528601356084820152606086013560a482015260c401600060405180830381600087803b15801561272757600080fd5b505af115801561273b573d6000803e3d6000fd5b505050507fab4e31aa5778793488e6ace2016f3a4ce611ef72ec5181bf80a2b8d523f4d2da33858460800151601854600160168054905061277c9190612daa565b604080516001600160a01b03909616865263ffffffff9094166020860152928401919091526060830152608082015260a00160405180910390a150505050565b60006127c7816127fd565b8360046127d4858561049d565b600681106127e4576127e4612ebb565b600302019060036127f692919061297c565b5050505050565b6128078133612907565b50565b600061281683836108da565b612894576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561284c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610497565b506000610497565b60006128a883836108da565b15612894576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610497565b61291182826108da565b6121825760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016105d1565b508054600082559060005260206000209081019061280791906129ba565b60405180606001604052806003906020820280368337509192915050565b82600381019282156129aa579160200282015b828111156129aa57825182559160200191906001019061298f565b506129b69291506129ba565b5090565b5b808211156129b657600081556001016129bb565b6000602082840312156129e157600080fd5b81356001600160e01b0319811681146129f957600080fd5b9392505050565b80358015158114612a1057600080fd5b919050565b60008060408385031215612a2857600080fd5b82359150612a3860208401612a00565b90509250929050565b600060208284031215612a5357600080fd5b5035919050565b6001600160a01b038116811461280757600080fd5b60008060408385031215612a8257600080fd5b823591506020830135612a9481612a5a565b809150509250929050565b60008060408385031215612ab257600080fd5b50508035926020909101359150565b63ffffffff8116811461280757600080fd5b600060208284031215612ae557600080fd5b81356129f981612ac1565b634e487b7160e01b600052604160045260246000fd5b600060208284031215612b1857600080fd5b813567ffffffffffffffff80821115612b3057600080fd5b818401915084601f830112612b4457600080fd5b813581811115612b5657612b56612af0565b604051601f8201601f19908116603f01168101908382118183101715612b7e57612b7e612af0565b81604052828152876020848701011115612b9757600080fd5b826020860160208301376000928101602001929092525095945050505050565b803560ff81168114612a1057600080fd5b60008060008060808587031215612bde57600080fd5b8435612be981612ac1565b93506020850135612bf981612ac1565b92506040850135612c0981612ac1565b9150612c1760608601612bb7565b905092959194509250565b600060208284031215612c3457600080fd5b81356129f981612a5a565b60008082840360a0811215612c5357600080fd5b8335612c5e81612ac1565b92506080601f1982011215612c7257600080fd5b506020830190509250929050565b600080600060a08486031215612c9557600080fd5b84601f850112612ca457600080fd5b6040516060810181811067ffffffffffffffff82111715612cc757612cc7612af0565b604052806060860187811115612cdc57600080fd5b865b81811015612cf6578035835260209283019201612cde565b5091945050359150612d0a60808501612a00565b90509250925092565b634e487b7160e01b600052601160045260246000fd5b8082018082111561049757610497612d13565b60208082526019908201527f4d617820706c6179657220616d6f756e74207265616368656400000000000000604082015260600190565b6020808252601e908201527f47616d6520697320636c6f73656420666f72206e657720706c61796572730000604082015260600190565b8181038181111561049757610497612d13565b600060208284031215612dcf57600080fd5b81516129f981612a5a565b604081526000835180604084015260005b81811015612e085760208187018101516060868401015201612deb565b506000606082850101526060601f19601f83011684010191505060ff831660208301529392505050565b60008060408385031215612e4557600080fd5b82518060170b8114612e5657600080fd5b6020840151909250612a9481612ac1565b634e487b7160e01b600052601260045260246000fd5b60008160170b8360170b80612e9457612e94612e67565b6001600160bf1b0319821460001982141615612eb257612eb2612d13565b90059392505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612ee357600080fd5b5051919050565b600181815b80851115612f25578160001904821115612f0b57612f0b612d13565b80851615612f1857918102915b93841c9390800290612eef565b509250929050565b600082612f3c57506001610497565b81612f4957506000610497565b8160018114612f5f5760028114612f6957612f85565b6001915050610497565b60ff841115612f7a57612f7a612d13565b50506001821b610497565b5060208310610133831016604e8410600b8410161715612fa8575081810a610497565b612fb28383612eea565b8060001904821115612fc657612fc6612d13565b029392505050565b60006129f98383612f2d565b808202811582820484141761049757610497612d13565b60008261300057613000612e67565b500490565b9283526001600160a01b03919091166020830152604082015260600190565b6101208101818760005b60038110156130565781516001600160a01b031683526020928301929091019060010161302e565b505050606082018660005b6003811015613080578151835260209283019290910190600101613061565b50505061309260c083018660170b9052565b92151560e082015261010001529392505050565b6000816130b5576130b5612d13565b506000190190565b6000602082840312156130cf57600080fd5b6129f982612bb756fe1d93c87416ca7b54f0fb8323167b72760e8e2ec93d48660953897a150f97a8b4a2646970667358221220d381e4d758b1680533429e57981de3c3292962536886020b4ac44baa5cca0b5d64736f6c63430008180033
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.