Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 8 from a total of 8 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
End Game | 17894738 | 435 days ago | IN | 0 ETH | 0.000778 | ||||
Start Game | 17894519 | 435 days ago | IN | 0 ETH | 0.00236261 | ||||
End Game | 17894458 | 435 days ago | IN | 0 ETH | 0.00169406 | ||||
Emergency Stop B... | 17894410 | 435 days ago | IN | 0 ETH | 0.00060073 | ||||
Bet | 17894390 | 435 days ago | IN | 0 ETH | 0.0034546 | ||||
Start Game | 17894377 | 435 days ago | IN | 0 ETH | 0.00249189 | ||||
Set Time To Bet | 17894152 | 435 days ago | IN | 0 ETH | 0.00057079 | ||||
0x60806040 | 17892969 | 435 days ago | IN | 0 ETH | 0.03889644 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 3 internal transactions
Advanced mode:
Loading...
Loading
Contract Name:
Betting
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract Betting is Ownable, AccessControl { using SafeMath for uint256; bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); IERC20 public token; uint256 public gameId = 0; uint256 public timeToBet = 10 minutes; bool public gameStarted = false; mapping(uint256 => Game) public games; struct Game { uint256 id; uint256 startTime; uint256 bettingEndTime; mapping(address => uint256) betOnFighter1; address[] numberOfBetOnFighter1; uint256 totalBetOnFighter1; mapping(address => uint256) betOnFighter2; address[] numberOfBetOnFighter2; uint256 totalBetOnFighter2; mapping(address => bool) isBettor; uint256 totalBet; uint256 winner; } event GameStarted(uint256 gameId, uint256 startTime, uint256 endTime); event GameEnded(uint256 gameId, uint256 winner); constructor(address _token, address[] memory admins) { token = IERC20(_token); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); for (uint256 i = 0; i < admins.length; i++) { _setupRole(ADMIN_ROLE, admins[i]); } } /** * @dev Allows admins to set the time to bet. * @param _timeToBet The time to bet. */ function setTimeToBet(uint256 _timeToBet) external { require( hasRole(ADMIN_ROLE, msg.sender) || msg.sender == owner(), "You are not an admin" ); timeToBet = _timeToBet; } /** * @dev Allows admins to start a game. */ function startGame() external { require( hasRole(ADMIN_ROLE, msg.sender) || msg.sender == owner(), "You are not an admin" ); require(!gameStarted, "Game has already started"); gameStarted = true; gameId++; games[gameId].id = gameId; games[gameId].startTime = block.timestamp; games[gameId].bettingEndTime = block.timestamp + timeToBet; games[gameId].totalBetOnFighter1 = 0; games[gameId].totalBetOnFighter2 = 0; games[gameId].totalBet = 0; games[gameId].winner = 0; emit GameStarted(gameId, block.timestamp, block.timestamp + timeToBet); } /** * @dev Allows admins to stop players from betting. * This function is used in case of an emergency. */ function emergencyStopBets() external { require( hasRole(ADMIN_ROLE, msg.sender) || msg.sender == owner(), "You are not an admin" ); require(gameStarted, "Game has not started"); games[gameId].bettingEndTime = block.timestamp; } /** * @dev Allows players to place a bet on a either fighter 1 or fighter 2. * @param _bet The amount bet. * @param fighter The fighter to bet on. */ function bet(uint256 _bet, uint256 fighter) external { require(gameStarted, "Game has not started"); require( block.timestamp < games[gameId].bettingEndTime, "Betting has ended" ); require(!games[gameId].isBettor[msg.sender], "You already bet"); require(_bet != 0, "Amount cannot be 0"); require(fighter == 1 || fighter == 2, "Fighter must be 1 or 2"); uint256 allowance = token.allowance(msg.sender, address(this)); require( allowance >= _bet, "You need to approve the token transfer first" ); bool success = token.transferFrom(msg.sender, address(this), _bet); require(success, "Token transfer failed"); // Convert _bet to smallest unit (wei) of the token uint256 betAmountWei = _bet * (10 ** 10); games[gameId].totalBet += betAmountWei; games[gameId].isBettor[msg.sender] = true; if (fighter == 1) { games[gameId].betOnFighter1[msg.sender] = betAmountWei; games[gameId].numberOfBetOnFighter1.push(msg.sender); games[gameId].totalBetOnFighter1 += betAmountWei; } else { games[gameId].betOnFighter2[msg.sender] = betAmountWei; games[gameId].numberOfBetOnFighter2.push(msg.sender); games[gameId].totalBetOnFighter2 += betAmountWei; } } /** * @dev Allows admins to end a game. * @param _winner The fighter who won the game. */ function endGame(uint256 _winner) external { require( hasRole(ADMIN_ROLE, msg.sender) || msg.sender == owner(), "You are not an admin" ); require(gameStarted, "Game has not started"); require(_winner == 1 || _winner == 2, "Winner must be 1 or 2"); if (_winner == 1) { for ( uint256 i = 0; i < games[gameId].numberOfBetOnFighter1.length; i++ ) { address bettor = games[gameId].numberOfBetOnFighter1[i]; uint256 amount = games[gameId].betOnFighter1[bettor]; uint256 winnings = (amount * games[gameId].totalBet) / games[gameId].totalBetOnFighter1; winnings /= 10 ** 10; // Convert back to 8-decimal token bool success = token.transfer(bettor, winnings); require(success, "Token transfer failed"); } } else { for ( uint256 i = 0; i < games[gameId].numberOfBetOnFighter2.length; i++ ) { address bettor = games[gameId].numberOfBetOnFighter2[i]; uint256 amount = games[gameId].betOnFighter2[bettor]; uint256 winnings = (amount * games[gameId].totalBet) / games[gameId].totalBetOnFighter2; winnings /= 10 ** 10; // Convert back to 8-decimal token bool success = token.transfer(bettor, winnings); require(success, "Token transfer failed"); } } games[gameId].winner = _winner; gameStarted = false; emit GameEnded(gameId, _winner); } /** * @dev Returns the game info. * @param _gameId The game id. */ function getGameInfo( uint256 _gameId ) external view returns (uint256, uint256, uint256, uint256, uint256, uint256) { return ( games[_gameId].id, games[_gameId].startTime, games[_gameId].bettingEndTime, games[_gameId].totalBetOnFighter1, games[_gameId].totalBetOnFighter2, games[_gameId].totalBet ); } /** * @dev Returns the last game id. */ function getLastGameId() external view returns (uint256) { return gameId; } /** * @dev Returns if the user is a bettor in this game. * @param _bettor The bettor address. */ function isBettor( address _bettor ) external view returns (bool) { return games[gameId].isBettor[_bettor]; } /** * @dev Returns players who bet on fighter 1 for a specified game. * @param _gameId The game id. */ function getBetOnFighter1( uint256 _gameId ) external view returns (address[] memory) { return games[_gameId].numberOfBetOnFighter1; } /** * @dev Returns players who bet on fighter 1 for a specified game. * @param _gameId The game id. */ function getBetOnFighter2( uint256 _gameId ) external view returns (address[] memory) { return games[_gameId].numberOfBetOnFighter2; } /** * @dev Allows owner to withdraw a certain amount of token from the contract. * @param _amount The amount to withdraw. */ function withdrawAmount(uint256 _amount) external onlyOwner { uint256 balance = token.balanceOf(address(this)); require(balance >= _amount, "Insufficient balance"); bool success = token.transfer(msg.sender, _amount); require(success, "Token transfer failed"); } /** * @dev Allows owner to withdraw all token from the contract. */ function withdraw() public onlyOwner { uint256 balance = token.balanceOf(address(this)); bool success = token.transfer(msg.sender, balance); require(success, "Token transfer failed"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../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 => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ 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 override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @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 override 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 override 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 override 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 `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @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 Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @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. * * _Available since v3.1._ */ 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 `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./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); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @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 // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"gameId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winner","type":"uint256"}],"name":"GameEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"gameId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"GameStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bet","type":"uint256"},{"internalType":"uint256","name":"fighter","type":"uint256"}],"name":"bet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyStopBets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_winner","type":"uint256"}],"name":"endGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gameId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"games","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"bettingEndTime","type":"uint256"},{"internalType":"uint256","name":"totalBetOnFighter1","type":"uint256"},{"internalType":"uint256","name":"totalBetOnFighter2","type":"uint256"},{"internalType":"uint256","name":"totalBet","type":"uint256"},{"internalType":"uint256","name":"winner","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getBetOnFighter1","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getBetOnFighter2","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getGameInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastGameId","outputs":[{"internalType":"uint256","name":"","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":[{"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":"address","name":"_bettor","type":"address"}],"name":"isBettor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","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":"_timeToBet","type":"uint256"}],"name":"setTimeToBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"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":"timeToBet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawAmount","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405260006003556102586004556005805460ff191690553480156200002657600080fd5b5060405162001f0f38038062001f0f833981016040819052620000499162000210565b6200005433620000f5565b600280546001600160a01b0319166001600160a01b0384161790556200007c60003362000145565b60005b8151811015620000ec57620000d77fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775838381518110620000c357620000c3620002f9565b60200260200101516200014560201b60201c565b80620000e3816200030f565b9150506200007f565b50505062000337565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b62000151828262000155565b5050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16620001515760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b80516001600160a01b0381168114620001f557600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156200022457600080fd5b6200022f83620001dd565b602084810151919350906001600160401b03808211156200024f57600080fd5b818601915086601f8301126200026457600080fd5b815181811115620002795762000279620001fa565b8060051b604051601f19603f83011681018181108582111715620002a157620002a1620001fa565b604052918252848201925083810185019189831115620002c057600080fd5b938501935b82851015620002e957620002d985620001dd565b84529385019392850192620002c5565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b6000600182016200033057634e487b7160e01b600052601160045260246000fd5b5060010190565b611bc880620003476000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063869c5e0f116100f9578063c7189dac11610097578063d65ab5f211610071578063d65ab5f214610495578063d7c81b551461049d578063f2fde38b146104a6578063fc0c546a146104b957600080fd5b8063c7189dac1461045c578063d0399bb81461046f578063d547741f1461048257600080fd5b8063a217fddf116100d3578063a217fddf14610423578063a35b6ec71461042b578063a685d4bc14610433578063b14ff5f11461043c57600080fd5b8063869c5e0f146103d85780638da5cb5b146103eb57806391d148541461041057600080fd5b8063429c2ed7116101665780636bbd7886116101405780636bbd7886146103a05780636ffcc719146103a8578063715018a6146103bb57806375b238fc146103c357600080fd5b8063429c2ed7146102e657806347e1d550146103245780635e123ce41461039357600080fd5b8063248a9ca3116101a2578063248a9ca3146102865780632f2ff15d146102b857806336568abe146102cb5780633ccfd60b146102de57600080fd5b806301ffc9a7146101c95780630562b9f7146101f1578063117a5b9014610206575b600080fd5b6101dc6101d736600461180d565b6104cc565b60405190151581526020015b60405180910390f35b6102046101ff366004611837565b610503565b005b610251610214366004611837565b600660205260009081526040902080546001820154600283015460058401546008850154600a860154600b90960154949593949293919290919087565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e0016101e8565b6102aa610294366004611837565b6000908152600160208190526040909120015490565b6040519081526020016101e8565b6102046102c636600461186c565b610660565b6102046102d936600461186c565b610686565b610204610704565b6101dc6102f4366004611898565b60035460009081526006602090815260408083206001600160a01b03909416835260099093019052205460ff1690565b610366610332366004611837565b600090815260066020526040902080546001820154600283015460058401546008850154600a909501549395929491939092565b604080519687526020870195909552938501929092526060840152608083015260a082015260c0016101e8565b6005546101dc9060ff1681565b610204610813565b6102046103b63660046118b3565b610898565b610204610ce9565b6102aa600080516020611b7383398151915281565b6102046103e6366004611837565b610cfd565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101e8565b6101dc61041e36600461186c565b610d4b565b6102aa600081565b6003546102aa565b6102aa60045481565b61044f61044a366004611837565b610d76565b6040516101e891906118d5565b61044f61046a366004611837565b610de5565b61020461047d366004611837565b610e52565b61020461049036600461186c565b611251565b610204611277565b6102aa60035481565b6102046104b4366004611898565b611400565b6002546103f8906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b14806104fd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61050b611479565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610554573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105789190611922565b9050818110156105c65760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b60448201526064015b60405180910390fd5b60025460405163a9059cbb60e01b8152336004820152602481018490526000916001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610618573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063c919061193b565b90508061065b5760405162461bcd60e51b81526004016105bd9061195d565b505050565b6000828152600160208190526040909120015461067c816114d3565b61065b83836114dd565b6001600160a01b03811633146106f65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105bd565b6107008282611548565b5050565b61070c611479565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107799190611922565b60025460405163a9059cbb60e01b8152336004820152602481018390529192506000916001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156107d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f4919061193b565b9050806107005760405162461bcd60e51b81526004016105bd9061195d565b61082b600080516020611b7383398151915233610d4b565b8061084057506000546001600160a01b031633145b61085c5760405162461bcd60e51b81526004016105bd9061198c565b60055460ff1661087e5760405162461bcd60e51b81526004016105bd906119ba565b600354600090815260066020526040902042600290910155565b60055460ff166108ba5760405162461bcd60e51b81526004016105bd906119ba565b60035460009081526006602052604090206002015442106109115760405162461bcd60e51b815260206004820152601160248201527010995d1d1a5b99c81a185cc8195b991959607a1b60448201526064016105bd565b600354600090815260066020908152604080832033845260090190915290205460ff16156109735760405162461bcd60e51b815260206004820152600f60248201526e165bdd48185b1c9958591e4818995d608a1b60448201526064016105bd565b816000036109b85760405162461bcd60e51b81526020600482015260126024820152710416d6f756e742063616e6e6f7420626520360741b60448201526064016105bd565b80600114806109c75750806002145b610a0c5760405162461bcd60e51b81526020600482015260166024820152752334b3b43a32b91036bab9ba10313290189037b9101960511b60448201526064016105bd565b600254604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610a5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7f9190611922565b905082811015610ae65760405162461bcd60e51b815260206004820152602c60248201527f596f75206e65656420746f20617070726f76652074686520746f6b656e20747260448201526b185b9cd9995c88199a5c9cdd60a21b60648201526084016105bd565b6002546040516323b872dd60e01b8152336004820152306024820152604481018590526000916001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b62919061193b565b905080610b815760405162461bcd60e51b81526004016105bd9061195d565b6000610b92856402540be4006119fe565b905080600660006003548152602001908152602001600020600a016000828254610bbc9190611a15565b909155505060035460009081526006602090815260408083203384526009019091529020805460ff19166001908117909155849003610c6e5760038054600090815260066020818152604080842033808652908601835281852087905585548552928252808420600401805460018101825590855291842090910180546001600160a01b031916909217909155915481529081206005018054839290610c63908490611a15565b90915550610ce29050565b60038054600090815260066020818152604080842033808652908401835281852087905585548552928252808420600701805460018101825590855291842090910180546001600160a01b031916909217909155915481529081206008018054839290610cdc908490611a15565b90915550505b5050505050565b610cf1611479565b610cfb60006115af565b565b610d15600080516020611b7383398151915233610d4b565b80610d2a57506000546001600160a01b031633145b610d465760405162461bcd60e51b81526004016105bd9061198c565b600455565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600081815260066020908152604091829020600401805483518184028101840190945280845260609392830182828015610dd957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610dbb575b50505050509050919050565b600081815260066020908152604091829020600701805483518184028101840190945280845260609392830182828015610dd9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610dbb5750505050509050919050565b610e6a600080516020611b7383398151915233610d4b565b80610e7f57506000546001600160a01b031633145b610e9b5760405162461bcd60e51b81526004016105bd9061198c565b60055460ff16610ebd5760405162461bcd60e51b81526004016105bd906119ba565b8060011480610ecc5750806002145b610f105760405162461bcd60e51b81526020600482015260156024820152742bb4b73732b91036bab9ba10313290189037b9101960591b60448201526064016105bd565b806001036110875760005b600354600090815260066020526040902060040154811015611081576003546000908152600660205260408120600401805483908110610f5d57610f5d611a28565b600091825260208083209091015460038054808552600680855260408087206001600160a01b0390951680885293850186528620549186529093526005820154600a90920154909450919291610fb390846119fe565b610fbd9190611a3e565b9050610fce6402540be40082611a3e565b60025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490529293506000929091169063a9059cbb906044016020604051808303816000875af1158015611027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104b919061193b565b90508061106a5760405162461bcd60e51b81526004016105bd9061195d565b50505050808061107990611a60565b915050610f1b565b506111f0565b60005b6003546000908152600660205260409020600701548110156111ee5760035460009081526006602052604081206007018054839081106110cc576110cc611a28565b6000918252602080832090910154600354808452600680845260408086206001600160a01b0390941680875284830186529086205492865293526008820154600a90920154929450929161112090846119fe565b61112a9190611a3e565b905061113b6402540be40082611a3e565b60025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490529293506000929091169063a9059cbb906044016020604051808303816000875af1158015611194573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b8919061193b565b9050806111d75760405162461bcd60e51b81526004016105bd9061195d565b5050505080806111e690611a60565b91505061108a565b505b60038054600090815260066020908152604091829020600b018490556005805460ff19169055915481519081529182018390527f4c4660db760944215f41e957066d756ad5fd0eed1b4640632322eb06f77b034d910160405180910390a150565b6000828152600160208190526040909120015461126d816114d3565b61065b8383611548565b61128f600080516020611b7383398151915233610d4b565b806112a457506000546001600160a01b031633145b6112c05760405162461bcd60e51b81526004016105bd9061198c565b60055460ff16156113135760405162461bcd60e51b815260206004820152601860248201527f47616d652068617320616c72656164792073746172746564000000000000000060448201526064016105bd565b6005805460ff191660011790556003805490600061133083611a60565b9091555050600354600081815260066020526040902090815542600190910181905560045461135e91611a15565b6003805460009081526006602052604080822060020193909355815481528281206005018190558154815282812060080181905581548152828120600a0181905581548152918220600b0191909155546004547fedb371157a97763aaa1b348e6811cbb8c9eb299aaf93a6f5ba91f312bcb40fcf919042906113e09082611a15565b6040805193845260208401929092529082015260600160405180910390a1565b611408611479565b6001600160a01b03811661146d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bd565b611476816115af565b50565b6000546001600160a01b03163314610cfb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105bd565b61147681336115ff565b6114e78282610d4b565b6107005760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6115528282610d4b565b156107005760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6116098282610d4b565b6107005761161681611658565b61162183602061166a565b604051602001611632929190611a9d565b60408051601f198184030181529082905262461bcd60e51b82526105bd91600401611b12565b60606104fd6001600160a01b03831660145b606060006116798360026119fe565b611684906002611a15565b67ffffffffffffffff81111561169c5761169c611b45565b6040519080825280601f01601f1916602001820160405280156116c6576020820181803683370190505b509050600360fc1b816000815181106116e1576116e1611a28565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061171057611710611a28565b60200101906001600160f81b031916908160001a90535060006117348460026119fe565b61173f906001611a15565b90505b60018111156117b7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061177357611773611a28565b1a60f81b82828151811061178957611789611a28565b60200101906001600160f81b031916908160001a90535060049490941c936117b081611b5b565b9050611742565b5083156118065760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105bd565b9392505050565b60006020828403121561181f57600080fd5b81356001600160e01b03198116811461180657600080fd5b60006020828403121561184957600080fd5b5035919050565b80356001600160a01b038116811461186757600080fd5b919050565b6000806040838503121561187f57600080fd5b8235915061188f60208401611850565b90509250929050565b6000602082840312156118aa57600080fd5b61180682611850565b600080604083850312156118c657600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b818110156119165783516001600160a01b0316835292840192918401916001016118f1565b50909695505050505050565b60006020828403121561193457600080fd5b5051919050565b60006020828403121561194d57600080fd5b8151801515811461180657600080fd5b602080825260159082015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604082015260600190565b6020808252601490820152732cb7ba9030b932903737ba1030b71030b236b4b760611b604082015260600190565b60208082526014908201527311d85b59481a185cc81b9bdd081cdd185c9d195960621b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176104fd576104fd6119e8565b808201808211156104fd576104fd6119e8565b634e487b7160e01b600052603260045260246000fd5b600082611a5b57634e487b7160e01b600052601260045260246000fd5b500490565b600060018201611a7257611a726119e8565b5060010190565b60005b83811015611a94578181015183820152602001611a7c565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611ad5816017850160208801611a79565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611b06816028840160208801611a79565b01602801949350505050565b6020815260008251806020840152611b31816040850160208701611a79565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b600081611b6a57611b6a6119e8565b50600019019056fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212200bc6237f7e7b4bb89f5c4682eaff8c0b103372fc227acecb67883c3eedbcd7d564736f6c634300081400330000000000000000000000004fe6d76f9580c1b37c428503cb5a0d3bdb8b545600000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000907e06d928ab5b55464b26ff388141302e94f5e30000000000000000000000005d4a07579a65645fb225d4dbdb88006ee55a9999
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063869c5e0f116100f9578063c7189dac11610097578063d65ab5f211610071578063d65ab5f214610495578063d7c81b551461049d578063f2fde38b146104a6578063fc0c546a146104b957600080fd5b8063c7189dac1461045c578063d0399bb81461046f578063d547741f1461048257600080fd5b8063a217fddf116100d3578063a217fddf14610423578063a35b6ec71461042b578063a685d4bc14610433578063b14ff5f11461043c57600080fd5b8063869c5e0f146103d85780638da5cb5b146103eb57806391d148541461041057600080fd5b8063429c2ed7116101665780636bbd7886116101405780636bbd7886146103a05780636ffcc719146103a8578063715018a6146103bb57806375b238fc146103c357600080fd5b8063429c2ed7146102e657806347e1d550146103245780635e123ce41461039357600080fd5b8063248a9ca3116101a2578063248a9ca3146102865780632f2ff15d146102b857806336568abe146102cb5780633ccfd60b146102de57600080fd5b806301ffc9a7146101c95780630562b9f7146101f1578063117a5b9014610206575b600080fd5b6101dc6101d736600461180d565b6104cc565b60405190151581526020015b60405180910390f35b6102046101ff366004611837565b610503565b005b610251610214366004611837565b600660205260009081526040902080546001820154600283015460058401546008850154600a860154600b90960154949593949293919290919087565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e0016101e8565b6102aa610294366004611837565b6000908152600160208190526040909120015490565b6040519081526020016101e8565b6102046102c636600461186c565b610660565b6102046102d936600461186c565b610686565b610204610704565b6101dc6102f4366004611898565b60035460009081526006602090815260408083206001600160a01b03909416835260099093019052205460ff1690565b610366610332366004611837565b600090815260066020526040902080546001820154600283015460058401546008850154600a909501549395929491939092565b604080519687526020870195909552938501929092526060840152608083015260a082015260c0016101e8565b6005546101dc9060ff1681565b610204610813565b6102046103b63660046118b3565b610898565b610204610ce9565b6102aa600080516020611b7383398151915281565b6102046103e6366004611837565b610cfd565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101e8565b6101dc61041e36600461186c565b610d4b565b6102aa600081565b6003546102aa565b6102aa60045481565b61044f61044a366004611837565b610d76565b6040516101e891906118d5565b61044f61046a366004611837565b610de5565b61020461047d366004611837565b610e52565b61020461049036600461186c565b611251565b610204611277565b6102aa60035481565b6102046104b4366004611898565b611400565b6002546103f8906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b14806104fd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61050b611479565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610554573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105789190611922565b9050818110156105c65760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b60448201526064015b60405180910390fd5b60025460405163a9059cbb60e01b8152336004820152602481018490526000916001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610618573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063c919061193b565b90508061065b5760405162461bcd60e51b81526004016105bd9061195d565b505050565b6000828152600160208190526040909120015461067c816114d3565b61065b83836114dd565b6001600160a01b03811633146106f65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105bd565b6107008282611548565b5050565b61070c611479565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107799190611922565b60025460405163a9059cbb60e01b8152336004820152602481018390529192506000916001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156107d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f4919061193b565b9050806107005760405162461bcd60e51b81526004016105bd9061195d565b61082b600080516020611b7383398151915233610d4b565b8061084057506000546001600160a01b031633145b61085c5760405162461bcd60e51b81526004016105bd9061198c565b60055460ff1661087e5760405162461bcd60e51b81526004016105bd906119ba565b600354600090815260066020526040902042600290910155565b60055460ff166108ba5760405162461bcd60e51b81526004016105bd906119ba565b60035460009081526006602052604090206002015442106109115760405162461bcd60e51b815260206004820152601160248201527010995d1d1a5b99c81a185cc8195b991959607a1b60448201526064016105bd565b600354600090815260066020908152604080832033845260090190915290205460ff16156109735760405162461bcd60e51b815260206004820152600f60248201526e165bdd48185b1c9958591e4818995d608a1b60448201526064016105bd565b816000036109b85760405162461bcd60e51b81526020600482015260126024820152710416d6f756e742063616e6e6f7420626520360741b60448201526064016105bd565b80600114806109c75750806002145b610a0c5760405162461bcd60e51b81526020600482015260166024820152752334b3b43a32b91036bab9ba10313290189037b9101960511b60448201526064016105bd565b600254604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610a5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7f9190611922565b905082811015610ae65760405162461bcd60e51b815260206004820152602c60248201527f596f75206e65656420746f20617070726f76652074686520746f6b656e20747260448201526b185b9cd9995c88199a5c9cdd60a21b60648201526084016105bd565b6002546040516323b872dd60e01b8152336004820152306024820152604481018590526000916001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b62919061193b565b905080610b815760405162461bcd60e51b81526004016105bd9061195d565b6000610b92856402540be4006119fe565b905080600660006003548152602001908152602001600020600a016000828254610bbc9190611a15565b909155505060035460009081526006602090815260408083203384526009019091529020805460ff19166001908117909155849003610c6e5760038054600090815260066020818152604080842033808652908601835281852087905585548552928252808420600401805460018101825590855291842090910180546001600160a01b031916909217909155915481529081206005018054839290610c63908490611a15565b90915550610ce29050565b60038054600090815260066020818152604080842033808652908401835281852087905585548552928252808420600701805460018101825590855291842090910180546001600160a01b031916909217909155915481529081206008018054839290610cdc908490611a15565b90915550505b5050505050565b610cf1611479565b610cfb60006115af565b565b610d15600080516020611b7383398151915233610d4b565b80610d2a57506000546001600160a01b031633145b610d465760405162461bcd60e51b81526004016105bd9061198c565b600455565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600081815260066020908152604091829020600401805483518184028101840190945280845260609392830182828015610dd957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610dbb575b50505050509050919050565b600081815260066020908152604091829020600701805483518184028101840190945280845260609392830182828015610dd9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610dbb5750505050509050919050565b610e6a600080516020611b7383398151915233610d4b565b80610e7f57506000546001600160a01b031633145b610e9b5760405162461bcd60e51b81526004016105bd9061198c565b60055460ff16610ebd5760405162461bcd60e51b81526004016105bd906119ba565b8060011480610ecc5750806002145b610f105760405162461bcd60e51b81526020600482015260156024820152742bb4b73732b91036bab9ba10313290189037b9101960591b60448201526064016105bd565b806001036110875760005b600354600090815260066020526040902060040154811015611081576003546000908152600660205260408120600401805483908110610f5d57610f5d611a28565b600091825260208083209091015460038054808552600680855260408087206001600160a01b0390951680885293850186528620549186529093526005820154600a90920154909450919291610fb390846119fe565b610fbd9190611a3e565b9050610fce6402540be40082611a3e565b60025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490529293506000929091169063a9059cbb906044016020604051808303816000875af1158015611027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104b919061193b565b90508061106a5760405162461bcd60e51b81526004016105bd9061195d565b50505050808061107990611a60565b915050610f1b565b506111f0565b60005b6003546000908152600660205260409020600701548110156111ee5760035460009081526006602052604081206007018054839081106110cc576110cc611a28565b6000918252602080832090910154600354808452600680845260408086206001600160a01b0390941680875284830186529086205492865293526008820154600a90920154929450929161112090846119fe565b61112a9190611a3e565b905061113b6402540be40082611a3e565b60025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490529293506000929091169063a9059cbb906044016020604051808303816000875af1158015611194573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b8919061193b565b9050806111d75760405162461bcd60e51b81526004016105bd9061195d565b5050505080806111e690611a60565b91505061108a565b505b60038054600090815260066020908152604091829020600b018490556005805460ff19169055915481519081529182018390527f4c4660db760944215f41e957066d756ad5fd0eed1b4640632322eb06f77b034d910160405180910390a150565b6000828152600160208190526040909120015461126d816114d3565b61065b8383611548565b61128f600080516020611b7383398151915233610d4b565b806112a457506000546001600160a01b031633145b6112c05760405162461bcd60e51b81526004016105bd9061198c565b60055460ff16156113135760405162461bcd60e51b815260206004820152601860248201527f47616d652068617320616c72656164792073746172746564000000000000000060448201526064016105bd565b6005805460ff191660011790556003805490600061133083611a60565b9091555050600354600081815260066020526040902090815542600190910181905560045461135e91611a15565b6003805460009081526006602052604080822060020193909355815481528281206005018190558154815282812060080181905581548152828120600a0181905581548152918220600b0191909155546004547fedb371157a97763aaa1b348e6811cbb8c9eb299aaf93a6f5ba91f312bcb40fcf919042906113e09082611a15565b6040805193845260208401929092529082015260600160405180910390a1565b611408611479565b6001600160a01b03811661146d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bd565b611476816115af565b50565b6000546001600160a01b03163314610cfb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105bd565b61147681336115ff565b6114e78282610d4b565b6107005760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6115528282610d4b565b156107005760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6116098282610d4b565b6107005761161681611658565b61162183602061166a565b604051602001611632929190611a9d565b60408051601f198184030181529082905262461bcd60e51b82526105bd91600401611b12565b60606104fd6001600160a01b03831660145b606060006116798360026119fe565b611684906002611a15565b67ffffffffffffffff81111561169c5761169c611b45565b6040519080825280601f01601f1916602001820160405280156116c6576020820181803683370190505b509050600360fc1b816000815181106116e1576116e1611a28565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061171057611710611a28565b60200101906001600160f81b031916908160001a90535060006117348460026119fe565b61173f906001611a15565b90505b60018111156117b7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061177357611773611a28565b1a60f81b82828151811061178957611789611a28565b60200101906001600160f81b031916908160001a90535060049490941c936117b081611b5b565b9050611742565b5083156118065760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105bd565b9392505050565b60006020828403121561181f57600080fd5b81356001600160e01b03198116811461180657600080fd5b60006020828403121561184957600080fd5b5035919050565b80356001600160a01b038116811461186757600080fd5b919050565b6000806040838503121561187f57600080fd5b8235915061188f60208401611850565b90509250929050565b6000602082840312156118aa57600080fd5b61180682611850565b600080604083850312156118c657600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b818110156119165783516001600160a01b0316835292840192918401916001016118f1565b50909695505050505050565b60006020828403121561193457600080fd5b5051919050565b60006020828403121561194d57600080fd5b8151801515811461180657600080fd5b602080825260159082015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604082015260600190565b6020808252601490820152732cb7ba9030b932903737ba1030b71030b236b4b760611b604082015260600190565b60208082526014908201527311d85b59481a185cc81b9bdd081cdd185c9d195960621b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176104fd576104fd6119e8565b808201808211156104fd576104fd6119e8565b634e487b7160e01b600052603260045260246000fd5b600082611a5b57634e487b7160e01b600052601260045260246000fd5b500490565b600060018201611a7257611a726119e8565b5060010190565b60005b83811015611a94578181015183820152602001611a7c565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611ad5816017850160208801611a79565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611b06816028840160208801611a79565b01602801949350505050565b6020815260008251806020840152611b31816040850160208701611a79565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b600081611b6a57611b6a6119e8565b50600019019056fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212200bc6237f7e7b4bb89f5c4682eaff8c0b103372fc227acecb67883c3eedbcd7d564736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004fe6d76f9580c1b37c428503cb5a0d3bdb8b545600000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000907e06d928ab5b55464b26ff388141302e94f5e30000000000000000000000005d4a07579a65645fb225d4dbdb88006ee55a9999
-----Decoded View---------------
Arg [0] : _token (address): 0x4fE6D76f9580c1B37C428503cb5a0d3bDb8B5456
Arg [1] : admins (address[]): 0x907E06D928AB5B55464B26Ff388141302E94f5e3,0x5D4A07579a65645Fb225d4DBDB88006eE55A9999
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000004fe6d76f9580c1b37c428503cb5a0d3bdb8b5456
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [3] : 000000000000000000000000907e06d928ab5b55464b26ff388141302e94f5e3
Arg [4] : 0000000000000000000000005d4a07579a65645fb225d4dbdb88006ee55a9999
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.