Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x7e6da8162c047bb3627212abd0a87821e7f60a9428576d2f41c527e9e23db6e6 | 0x60806040 | 26020835 | 134 days 20 hrs ago | 0xb013abd83f0bd173e9f14ce7d6e420ad711483b4 | IN | Create: SmolRacing | 0 ETH | 0.00140672 |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
SmolRacing
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.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: * * ``` * 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}: * * ``` * 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. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } 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, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).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 `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 ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.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. */ 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. */ 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`. */ 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. * * [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. */ 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. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// 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 IAccessControlUpgradeable { /** * @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.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; import "./extensions/IERC1155MetadataURIUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable { using AddressUpgradeable for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ function __ERC1155_init(string memory uri_) internal onlyInitializing { __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155Upgradeable).interfaceId || interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[47] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155ReceiverUpgradeable is IERC165Upgradeable { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155Burnable_init() internal onlyInitializing { } function __ERC1155Burnable_init_unchained() internal onlyInitializing { } function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155Upgradeable.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721ReceiverUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { function __ERC721Holder_init() internal onlyInitializing { } function __ERC721Holder_init_unchained() internal onlyInitializing { } /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @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 v4.4.1 (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// 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 pragma solidity ^0.8.9; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; // A base class for all contracts. // Includes basic utility functions, access control, and the ability to pause the contract. contract UtilitiesV2Upgradeable is Initializable, AccessControlEnumerableUpgradeable, PausableUpgradeable { bytes32 internal constant OWNER_ROLE = keccak256("OWNER"); bytes32 internal constant ADMIN_ROLE = keccak256("ADMIN"); bytes32 internal constant ROLE_GRANTER_ROLE = keccak256("ROLE_GRANTER"); function __Utilities_init() internal onlyInitializing { AccessControlEnumerableUpgradeable.__AccessControlEnumerable_init(); PausableUpgradeable.__Pausable_init(); __Utilities_init_unchained(); } function __Utilities_init_unchained() internal onlyInitializing { _pause(); _grantRole(OWNER_ROLE, msg.sender); } function setPause(bool _shouldPause) external requiresEitherRole(ADMIN_ROLE, OWNER_ROLE) { if(_shouldPause) { _pause(); } else { _unpause(); } } function grantRole(bytes32 _role, address _account) public override requiresEitherRole(ROLE_GRANTER_ROLE, OWNER_ROLE) { require(_role != OWNER_ROLE, "Cannot change owner role through grantRole"); _grantRole(_role, _account); } function revokeRole(bytes32 _role, address _account) public override requiresEitherRole(ROLE_GRANTER_ROLE, OWNER_ROLE) { require(_role != OWNER_ROLE, "Cannot change owner role through grantRole"); _revokeRole(_role, _account); } function compareStrings(string memory a, string memory b) internal pure returns (bool) { return (keccak256(abi.encodePacked((a))) == keccak256(abi.encodePacked((b)))); } modifier onlyEOA() { /* solhint-disable avoid-tx-origin */ require(msg.sender == tx.origin, "No contracts"); _; } modifier requiresRole(bytes32 _role) { require(hasRole(_role, msg.sender), "Does not have required role"); _; } modifier requiresEitherRole(bytes32 _roleOption1, bytes32 _roleOption2) { require(hasRole(_roleOption1, msg.sender) || hasRole(_roleOption2, msg.sender), "Does not have required role"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IRandomizer { // Sets the number of blocks that must pass between increment the commitId and seeding the random // Admin function setNumBlocksAfterIncrement(uint8 _numBlocksAfterIncrement) external; // Increments the commit id. // Admin function incrementCommitId() external; // Adding the random number needs to be done AFTER incrementing the commit id on a separate transaction. If // these are done together, there is a potential vulnerability to front load a commit when the bad actor // sees the value of the random number. function addRandomForCommit(uint256 _seed) external; // Returns a request ID for a random number. This is unique. function requestRandomNumber() external returns(uint256); // Returns the random number for the given request ID. Will revert // if the random is not ready. function revealRandomNumber(uint256 _requestId) external view returns(uint256); // Returns if the random number for the given request ID is ready or not. Call // before calling revealRandomNumber. function isRandomReady(uint256 _requestId) external view returns(bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ISmolRacing { }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "./ISmolRacing.sol"; import "./SmolRacingAdmin.sol"; contract SmolRacing is Initializable, ISmolRacing, ReentrancyGuardUpgradeable, SmolRacingAdmin { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet; // ------------------------------------------------------------- // Initializer // ------------------------------------------------------------- function initialize() external initializer { SmolRacingAdmin.__SmolRacingAdmin_init(); } // ------------------------------------------------------------- // External functions // ------------------------------------------------------------- function stakeVehicles( SmolCar[] calldata _cars, Swolercycle[] calldata _cycles) external nonReentrant contractsAreSet whenNotPaused { require(_cars.length > 0 || _cycles.length > 0, "no tokens given"); for(uint256 i = 0; i < _cars.length; i++) { SmolCar calldata car = _cars[i]; require(car.numDrivers > 0, "no car drivers given"); // validation occurs in _stakeVehicleStart _stakeVehicle(smolBrains, address(smolCars), Vehicle({ driverIds: car.driverIds, vehicleId: car.carId, numRaces: car.numRaces, numDrivers: car.numDrivers, boostTreasureIds: car.boostTreasureIds, boostTreasureQuantities: car.boostTreasureQuantities })); } for(uint256 i = 0; i < _cycles.length; i++) { Swolercycle calldata cycle = _cycles[i]; require(cycle.numDrivers > 0, "no cycle drivers given"); // validation occurs in _stakeVehicleStart uint64[4] memory drivers; drivers[0] = cycle.driverIds[0]; drivers[1] = cycle.driverIds[1]; _stakeVehicle(smolBodies, address(swolercycles), Vehicle({ driverIds: drivers, vehicleId: cycle.cycleId, numRaces: cycle.numRaces, numDrivers: cycle.numDrivers, boostTreasureIds: cycle.boostTreasureIds, boostTreasureQuantities: cycle.boostTreasureQuantities })); } } function unstakeVehicles( uint256[] calldata _carTokens, uint256[] calldata _cycleTokens) external nonReentrant contractsAreSet whenNotPaused { require(_carTokens.length > 0 || _cycleTokens.length > 0, "no tokens given"); for(uint256 i = 0; i < _carTokens.length; i++) { _unstakeVehicle(smolBrains, address(smolCars), _carTokens[i]); } for(uint256 i = 0; i < _cycleTokens.length; i++) { _unstakeVehicle(smolBodies, address(swolercycles), _cycleTokens[i]); } } function restakeVehicles( uint256[] calldata _carTokens, uint256[] calldata _cycleTokens) external nonReentrant contractsAreSet whenNotPaused { require(_carTokens.length > 0 || _cycleTokens.length > 0, "no tokens given"); for(uint256 i = 0; i < _carTokens.length; i++) { _restakeVehicle(address(smolCars), _carTokens[i]); } for(uint256 i = 0; i < _cycleTokens.length; i++) { _restakeVehicle(address(swolercycles), _cycleTokens[i]); } } function claimRewardsForVehicles( uint256[] calldata _carTokens, uint256[] calldata _cycleTokens) external nonReentrant contractsAreSet whenNotPaused { require(_carTokens.length > 0 || _cycleTokens.length > 0, "no tokens given"); for(uint256 i = 0; i < _carTokens.length; i++) { _claimRewardsForVehicle(address(smolCars), _carTokens[i]); } for(uint256 i = 0; i < _cycleTokens.length; i++) { _claimRewardsForVehicle(address(swolercycles), _cycleTokens[i]); } } function ownsVehicle(address _collection, address _owner, uint256 _tokenId) external view returns (bool) { return userToVehiclesStaked[_collection][_owner].contains(_tokenId); } function vehiclesOfOwner(address _collection, address _owner) external view returns (uint256[] memory) { return userToVehiclesStaked[_collection][_owner].values(); } // Gassy, do not call from other contracts function smolsOfOwner(address _collection, address _owner) external view returns (uint256[] memory) { uint256[] memory vehicles = userToVehiclesStaked[_collection][_owner].values(); uint256 numDrivers; for (uint i = 0; i < vehicles.length; i++) { uint256 vehicleId = vehicles[i]; numDrivers += vehicleIdToVehicleInfo[_collection][vehicleId].numDrivers; } uint256[] memory retVal = new uint256[](numDrivers); for (uint i = 0; i < vehicles.length; i++) { Vehicle memory vehicleInfo = vehicleIdToVehicleInfo[_collection][vehicles[i]]; // numDrivers may be < 4 if the vehicle isn't full of smols for (uint j = 0; j < vehicleInfo.numDrivers; j++) { uint256 driverCur = vehicleInfo.driverIds[j]; if(driverCur == 0) { continue; } retVal[i + j] = driverCur; } } return retVal; } //Will return 0 if vehicle isnt staked or there are no races to claim function numberOfRacesToClaim(address _vehicleAddress, uint256 _tokenId) public view returns(uint256) { uint64 curTime = (endEmissionTime == 0 || block.timestamp < endEmissionTime) ? uint64(block.timestamp) : uint64(endEmissionTime); RacingInfo memory _info = vehicleIdToRacingInfo[_vehicleAddress][_tokenId]; // Not staked, otherwise this would be the timestamp that the user was staked at if(_info.lastClaimed == 0) { return 0; } uint8 maxAvailable = _info.totalRaces - _info.racesCompleted; uint256 uncappedPending = (curTime - _info.lastClaimed) / timeForReward; if(uncappedPending > maxAvailable) { return maxAvailable; } return uncappedPending; } //Will return 0 if vehicle isnt staked or there are no races to claim function vehicleOddsBoost(address _vehicleAddress, uint256 _tokenId) public view returns(uint256) { return vehicleIdToRacingInfo[_vehicleAddress][_tokenId].boostedOdds; } // ------------------------------------------------------------- // Private functions // ------------------------------------------------------------- function _stakeVehicle(IERC721 _smol, address _vehicleAddress, Vehicle memory _vehicle) private { require(_vehicle.driverIds.length > 0, "No drivers"); userToVehiclesStaked[_vehicleAddress][msg.sender].add(_vehicle.vehicleId); vehicleIdToVehicleInfo[_vehicleAddress][_vehicle.vehicleId] = _vehicle; uint64 curTime = uint64(block.timestamp); vehicleIdToRacingInfo[_vehicleAddress][_vehicle.vehicleId] = RacingInfo({ racingStartTime: curTime, totalRaces: _vehicle.numRaces, racesCompleted: 0, lastClaimed: curTime, boostedOdds: _calculateBoostOdds(_vehicleAddress, _vehicle) }); uint256 numDrivers; for (uint i = 0; i < _vehicle.driverIds.length; i++) { // Doesn't have to have a full vehicle if(_vehicle.driverIds[i] == 0) { break; } numDrivers += 1; // will revert if does not own _smol.safeTransferFrom(msg.sender, address(this), _vehicle.driverIds[i]); emit SmolStaked(msg.sender, address(_smol), _vehicle.driverIds[i], curTime); } // Verify that the given number of drivers match the array. // This info is needed to not have to loop for every claim require(numDrivers == _vehicle.numDrivers, "incorrect number of drivers given"); // will revert if does not own IERC721(_vehicleAddress).safeTransferFrom(msg.sender, address(this), _vehicle.vehicleId); uint256 _requestId = randomizer.requestRandomNumber(); // always set this, as it will re-set any previous request ids // to get new randoms when staking/unstaking tokenIdToRequestId[_vehicleAddress][_vehicle.vehicleId] = _requestId; emit StartRacing( msg.sender, _vehicleAddress, _vehicle.vehicleId, curTime, _vehicle.numRaces, _vehicle.driverIds, _requestId ); } function _restakeVehicle(address _vehicleAddress, uint256 _tokenId) private { require(userToVehiclesStaked[_vehicleAddress][msg.sender].contains(_tokenId), "token not staked"); // store needed state in memory Vehicle memory vehicleInfo = vehicleIdToVehicleInfo[_vehicleAddress][_tokenId]; RacingInfo memory racingInfo = vehicleIdToRacingInfo[_vehicleAddress][_tokenId]; uint256 pendingRaceRewards = numberOfRacesToClaim(_vehicleAddress, _tokenId); // Must finish their racing circuit before returning require(racingInfo.racesCompleted + pendingRaceRewards >= racingInfo.totalRaces, "not done racing"); // claim any rewards pending if(pendingRaceRewards > 0) { _claimRewards(pendingRaceRewards, _vehicleAddress, _tokenId, racingInfo); } uint64 curTime = uint64(block.timestamp); // remove vehicle boosts when re-racing vehicleIdToVehicleInfo[_vehicleAddress][_tokenId] = Vehicle({ driverIds: vehicleInfo.driverIds, vehicleId: vehicleInfo.vehicleId, numRaces: vehicleInfo.numRaces, numDrivers: vehicleInfo.numDrivers, boostTreasureIds: new uint64[](0), boostTreasureQuantities: new uint32[](0) }); vehicleIdToRacingInfo[_vehicleAddress][_tokenId] = RacingInfo({ racingStartTime: curTime, totalRaces: vehicleInfo.numRaces, racesCompleted: 0, lastClaimed: curTime, boostedOdds: _calculateBoostOdds(_vehicleAddress, vehicleIdToVehicleInfo[_vehicleAddress][_tokenId]) // Must pull from storage }); uint256 _requestId = randomizer.requestRandomNumber(); // always set this, as it will re-set any previous request ids // to get new randoms when staking/unstaking tokenIdToRequestId[_vehicleAddress][vehicleInfo.vehicleId] = _requestId; emit RestartRacing( msg.sender, _vehicleAddress, vehicleInfo.vehicleId, curTime, vehicleInfo.numRaces, vehicleInfo.driverIds, _requestId ); } function _unstakeVehicle(IERC721 _smol, address _vehicleAddress, uint256 _tokenId) private { require(userToVehiclesStaked[_vehicleAddress][msg.sender].contains(_tokenId), "token not staked"); // store needed state in memory Vehicle memory vehicleInfo = vehicleIdToVehicleInfo[_vehicleAddress][_tokenId]; RacingInfo memory racingInfo = vehicleIdToRacingInfo[_vehicleAddress][_tokenId]; uint256 pendingRaceRewards = numberOfRacesToClaim(_vehicleAddress, _tokenId); // Must finish their racing circuit before returning require(racingInfo.racesCompleted + pendingRaceRewards >= racingInfo.totalRaces, "not done racing"); // remove state delete vehicleIdToVehicleInfo[_vehicleAddress][_tokenId]; delete vehicleIdToRacingInfo[_vehicleAddress][_tokenId]; userToVehiclesStaked[_vehicleAddress][msg.sender].remove(_tokenId); // claim any rewards pending if(pendingRaceRewards > 0) { _claimRewards(pendingRaceRewards, _vehicleAddress, _tokenId, racingInfo); } // unstake all uint64 curTime = uint64(block.timestamp); for (uint i = 0; i < vehicleInfo.driverIds.length; i++) { // Doesn't have to have a full vehicle if(vehicleInfo.driverIds[i] == 0) { break; } _smol.safeTransferFrom(address(this), msg.sender, vehicleInfo.driverIds[i]); emit SmolUnstaked(msg.sender, address(_smol), vehicleInfo.driverIds[i]); } IERC721(_vehicleAddress).safeTransferFrom(address(this), msg.sender, vehicleInfo.vehicleId); emit StopRacing( msg.sender, _vehicleAddress, vehicleInfo.vehicleId, curTime, vehicleInfo.numRaces ); } function _claimRewardsForVehicle(address _vehicleAddress, uint256 _tokenId) private { require(userToVehiclesStaked[_vehicleAddress][msg.sender].contains(_tokenId), "not vehicle owner"); uint256 count = numberOfRacesToClaim(_vehicleAddress, _tokenId); require(count > 0, "nothing to claim"); RacingInfo memory racingInfo = vehicleIdToRacingInfo[_vehicleAddress][_tokenId]; racingInfo.lastClaimed += uint64(count * timeForReward); _claimRewards(count, _vehicleAddress, _tokenId, racingInfo); racingInfo.racesCompleted += uint8(count); vehicleIdToRacingInfo[_vehicleAddress][_tokenId] = racingInfo; } function _claimRewards(uint256 numRewards, address _vehicleAddress, uint256 _tokenId, RacingInfo memory _info) private { uint256 seed = _getRandomSeedForVehicle(_vehicleAddress, _tokenId); for (uint i = 0; i < numRewards; i++) { uint256 curRace = _info.racesCompleted + i + 1; uint256 random = uint256(keccak256(abi.encode(seed, curRace))); _claimReward(_vehicleAddress, _tokenId, _info.boostedOdds, random); } } function _claimReward(address _vehicleAddress, uint256 _tokenId, uint32 _boostedOdds, uint256 _randomNumber) private { uint256 _rewardResult = (_randomNumber % ODDS_DENOMINATOR) + _boostedOdds; if(_rewardResult >= ODDS_DENOMINATOR) { _rewardResult = ODDS_DENOMINATOR - 1; // This is the 0 based max value for modulus } uint256 _topRange = 0; uint256 _claimedRewardId = 0; for(uint256 i = 0; i < rewardOptions.length; i++) { uint256 _rewardId = rewardOptions[i]; _topRange += rewardIdToOdds[_rewardId]; if(_rewardResult < _topRange) { // _rewardId of 0 denotes that a reward should not be minted (bad luck roll) if(_rewardId != 0) { _claimedRewardId = _rewardId; // Each driver earns a reward racingTrophies.mint(msg.sender, _claimedRewardId, 1); } break; // always break to avoid walking the array } } if(_claimedRewardId > 0) { emit RewardClaimed(msg.sender, _vehicleAddress, _tokenId, _claimedRewardId, 1); } else { emit NoRewardEarned(msg.sender, _vehicleAddress, _tokenId); } } function _calculateBoostOdds(address _vehicleAddress, Vehicle memory _vehicle) private returns (uint32 boostOdds_) { // Additional driver boosts if(_vehicleAddress == address(smolCars)) { boostOdds_ += ((_vehicle.numDrivers - 1) * additionalSmolBrainBoost); } else if(_vehicleAddress == address(swolercycles)) { if(_vehicle.numDrivers == 2) { boostOdds_ += additionalSmolBodyBoost; } } // Treasure boosts uint256 numBoostItems = _vehicle.boostTreasureIds.length; require(numBoostItems == _vehicle.boostTreasureQuantities.length, "Number of treasures much match quantities"); for (uint i = 0; i < numBoostItems; i++) { // burn vs burnBatch because we are already looping which batch would also do treasures.burn(msg.sender, _vehicle.boostTreasureIds[i], _vehicle.boostTreasureQuantities[i]); uint32 boostPerItem = smolTreasureIdToOddsBoost[_vehicle.boostTreasureIds[i]]; boostOdds_ += boostPerItem * _vehicle.boostTreasureQuantities[i]; } if(boostOdds_ > maxOddsBoostAllowed) { // Cannot exceed the max amount of boosted odds boostOdds_ = maxOddsBoostAllowed; } } function _getRandomSeedForVehicle(address _vehicleAddress, uint256 _tokenId) private view returns (uint256) { uint256 _requestId = tokenIdToRequestId[_vehicleAddress][_tokenId]; // No need to do sanity checks as they already happen inside of the randomizer return randomizer.revealRandomNumber(_requestId); } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./SmolRacingState.sol"; abstract contract SmolRacingAdmin is Initializable, SmolRacingState { // ------------------------------------------------------------- // Initializer // ------------------------------------------------------------- function __SmolRacingAdmin_init() internal initializer { SmolRacingState.__SmolRacingState_init(); } // ------------------------------------------------------------- // External functions // ------------------------------------------------------------- function setContracts( address _treasures, address _smolBrains, address _smolBodies, address _smolCars, address _swolercycles, address _racingTrophies, address _randomizer) external requiresEitherRole(ADMIN_ROLE, OWNER_ROLE) { treasures = ISmolTreasures(_treasures); smolBrains = IERC721(_smolBrains); smolBodies = IERC721(_smolBodies); smolCars = IERC721(_smolCars); swolercycles = IERC721(_swolercycles); racingTrophies = ISmolRacingTrophies(_racingTrophies); randomizer = IRandomizer(_randomizer); } function setRewards( uint256[] calldata _rewardIds, uint32[] calldata _rewardOdds) external requiresEitherRole(ADMIN_ROLE, OWNER_ROLE) { require(_rewardIds.length == _rewardOdds.length, "Bad lengths"); delete rewardOptions; uint32 _totalOdds; for(uint256 i = 0; i < _rewardIds.length; i++) { _totalOdds += _rewardOdds[i]; rewardOptions.push(_rewardIds[i]); rewardIdToOdds[_rewardIds[i]] = _rewardOdds[i]; } require(_totalOdds == ODDS_DENOMINATOR, "Bad total odds"); } function setTimeForReward(uint256 _rewardTime) external requiresEitherRole(ADMIN_ROLE, OWNER_ROLE) { timeForReward = _rewardTime; } function setEndTimeForEmissions(uint256 _endTime) external requiresEitherRole(ADMIN_ROLE, OWNER_ROLE) { endEmissionTime = _endTime; } // ------------------------------------------------------------- // Modifiers // ------------------------------------------------------------- modifier contractsAreSet() { require(areContractsSet(), "Contracts aren't set"); _; } function areContractsSet() public view returns(bool) { return address(treasures) != address(0) && address(randomizer) != address(0) && address(smolBrains) != address(0) && address(smolBodies) != address(0) && address(smolCars) != address(0) && address(swolercycles) != address(0) && address(racingTrophies) != address(0); } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../../shared/UtilitiesV2Upgradeable.sol"; import "../../shared/randomizer/IRandomizer.sol"; import "../treasures/ISmolTreasures.sol"; import "../racingtrophy/ISmolRacingTrophies.sol"; abstract contract SmolRacingState is Initializable, UtilitiesV2Upgradeable, ERC721HolderUpgradeable { event SmolStaked( address indexed _owner, address indexed _smolAddress, uint256 indexed _tokenId, uint64 _stakeTime ); event StartRacing( address indexed _owner, address indexed _vehicleAddress, uint256 indexed _tokenId, uint64 _stakeTime, uint8 _totalRaces, uint64[4] _driverIds, uint256 _requestId ); event RestartRacing( address indexed _owner, address indexed _vehicleAddress, uint256 indexed _tokenId, uint64 _stakeTime, uint8 _totalRaces, uint64[4] _driverIds, uint256 _requestId ); event StopRacing( address indexed _owner, address indexed _vehicleAddress, uint256 indexed _tokenId, uint64 _stakeTime, uint8 _totalRaces ); event SmolUnstaked( address indexed _owner, address indexed _smolAddress, uint256 indexed _tokenId ); event RewardClaimed( address indexed _owner, address indexed _vehicleAddress, uint256 indexed _tokenId, uint256 _claimedRewardId, uint256 _amount ); event NoRewardEarned( address indexed _owner, address indexed _vehicleAddress, uint256 indexed _tokenId ); ISmolRacingTrophies public racingTrophies; ISmolTreasures public treasures; IRandomizer public randomizer; IERC721 public smolBrains; IERC721 public smolBodies; IERC721 public smolCars; IERC721 public swolercycles; // collection address -> user address -> tokens staked for collection // collection address can be either SmolCars or Swolercycles // token staked is the tokenId of the SmolCar or Swolercycle // data for staked smols is in the following mapping mapping(address => mapping(address => EnumerableSetUpgradeable.UintSet)) internal userToVehiclesStaked; // collection address => tokenId => Vehicle // collection address can be either SmolCars or Swolercycles // tokenId is the id of the SmolCar or Swolercycle // Vehicle contains ids of who is inside the vehicle and other racing info // It is assumed that SmolCars have SmolBrains in them, and Swolercycles have SmolBodies in them mapping(address => mapping(uint256 => Vehicle)) internal vehicleIdToVehicleInfo; // collection address => tokenId => Vehicle // collection address can be either SmolCars or Swolercycles // tokenId is the id of the SmolCar or Swolercycle // RacingInfo contains metadata for calculating rewards and determining unstake-ability mapping(address => mapping(uint256 => RacingInfo)) internal vehicleIdToRacingInfo; // collection address -> tokenId -> info // collection address can be either SmolCars or Swolercycles // tokenId is the id of the SmolCar or Swolercycle mapping(address => mapping(uint256 => uint256)) public tokenIdToRequestId; mapping(address => mapping(uint256 => uint256)) public tokenIdToStakeStartTime; mapping(address => mapping(uint256 => uint256)) public tokenIdToRewardsClaimed; mapping(address => mapping(uint256 => uint256)) public tokenIdToRewardsInProgress; mapping(uint256 => uint32) public smolTreasureIdToOddsBoost; uint32 public constant ODDS_DENOMINATOR = 100_000_000; uint32 public maxOddsBoostAllowed; uint32 public additionalSmolBrainBoost; uint32 public additionalSmolBodyBoost; uint256[] public rewardOptions; // Odds out of 100,000,000 // treasureTokenId -> Odds of getting reward mapping(uint256 => uint32) public rewardIdToOdds; uint256 public timeForReward; uint256 public endEmissionTime; function __SmolRacingState_init() internal initializer { UtilitiesV2Upgradeable.__Utilities_init(); ERC721HolderUpgradeable.__ERC721Holder_init(); timeForReward = 1 days; // Odds are calculated out of 100,000,000 (100 million). This is to obtain the 6 digit precision needed for treasure boost amounts // .667% increase per smol after the first one (since the max in a car is 4, caps at 2.001%) additionalSmolBrainBoost = 667_000; // Having a second body on a cycle increases odds by 1% additionalSmolBodyBoost = 1_000_000; // 1 million out of 100 million is 1% maxOddsBoostAllowed = 2_500_000; // 2.5% max boost uint256 moonrockId = 1; uint256 stardustId = 2; uint256 cometShardId = 3; uint256 lunarGoldId = 4; smolTreasureIdToOddsBoost[moonrockId] = 2; // 0.000002% increase per moonrock smolTreasureIdToOddsBoost[stardustId] = 5; // 0.000005% increase per stardust smolTreasureIdToOddsBoost[cometShardId] = 12; // 0.000012% increase per comet shard smolTreasureIdToOddsBoost[lunarGoldId] = 27; // 0.000027% increase per lunar gold // rewards setup after initialization } struct BoostItem { uint64 treasureId; uint64 quantity; } struct BoostItemOdds { uint64 quantityNeededForBoost; uint32 oddsBoostPerQuantity; } struct SmolCar { uint64[4] driverIds; uint64 carId; uint8 numRaces; uint8 numDrivers; uint64[] boostTreasureIds; uint32[] boostTreasureQuantities; } struct Swolercycle { uint64[2] driverIds; uint64 cycleId; uint8 numRaces; uint8 numDrivers; uint64[] boostTreasureIds; uint32[] boostTreasureQuantities; } struct Vehicle { uint64[4] driverIds; uint64 vehicleId; uint8 numRaces; uint8 numDrivers; uint64[] boostTreasureIds; uint32[] boostTreasureQuantities; } struct RacingInfo { uint64 racingStartTime; uint8 totalRaces; uint8 racesCompleted; uint64 lastClaimed; uint32 boostedOdds; // out of 100,000,000 (6 digit precision) } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol"; interface ISmolRacingTrophies is IERC1155Upgradeable { function mint(address _to, uint256 _id, uint256 _amount) external; function burn(address account, uint256 id, uint256 value) external; function burnBatch(address account, uint256[] memory ids, uint256[] memory values) external; function adminSafeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount) external; function adminSafeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol"; interface ISmolTreasures is IERC1155Upgradeable { function mint(address _to, uint256 _id, uint256 _amount) external; function burn(address account, uint256 id, uint256 value) external; function burnBatch(address account, uint256[] memory ids, uint256[] memory values) external; function adminSafeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount) external; function adminSafeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts) external; }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_vehicleAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"NoRewardEarned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_vehicleAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_stakeTime","type":"uint64"},{"indexed":false,"internalType":"uint8","name":"_totalRaces","type":"uint8"},{"indexed":false,"internalType":"uint64[4]","name":"_driverIds","type":"uint64[4]"},{"indexed":false,"internalType":"uint256","name":"_requestId","type":"uint256"}],"name":"RestartRacing","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_vehicleAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_claimedRewardId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"RewardClaimed","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_smolAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_stakeTime","type":"uint64"}],"name":"SmolStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_smolAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"SmolUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_vehicleAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_stakeTime","type":"uint64"},{"indexed":false,"internalType":"uint8","name":"_totalRaces","type":"uint8"},{"indexed":false,"internalType":"uint64[4]","name":"_driverIds","type":"uint64[4]"},{"indexed":false,"internalType":"uint256","name":"_requestId","type":"uint256"}],"name":"StartRacing","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_vehicleAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_stakeTime","type":"uint64"},{"indexed":false,"internalType":"uint8","name":"_totalRaces","type":"uint8"}],"name":"StopRacing","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ODDS_DENOMINATOR","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"additionalSmolBodyBoost","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"additionalSmolBrainBoost","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"areContractsSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_carTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_cycleTokens","type":"uint256[]"}],"name":"claimRewardsForVehicles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endEmissionTime","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":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","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":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxOddsBoostAllowed","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vehicleAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"numberOfRacesToClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownsVehicle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"racingTrophies","outputs":[{"internalType":"contract ISmolRacingTrophies","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizer","outputs":[{"internalType":"contract IRandomizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_carTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_cycleTokens","type":"uint256[]"}],"name":"restakeVehicles","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":"","type":"uint256"}],"name":"rewardIdToOdds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardOptions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_treasures","type":"address"},{"internalType":"address","name":"_smolBrains","type":"address"},{"internalType":"address","name":"_smolBodies","type":"address"},{"internalType":"address","name":"_smolCars","type":"address"},{"internalType":"address","name":"_swolercycles","type":"address"},{"internalType":"address","name":"_racingTrophies","type":"address"},{"internalType":"address","name":"_randomizer","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setEndTimeForEmissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_shouldPause","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_rewardIds","type":"uint256[]"},{"internalType":"uint32[]","name":"_rewardOdds","type":"uint32[]"}],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardTime","type":"uint256"}],"name":"setTimeForReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smolBodies","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"smolBrains","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"smolCars","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"smolTreasureIdToOddsBoost","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"smolsOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint64[4]","name":"driverIds","type":"uint64[4]"},{"internalType":"uint64","name":"carId","type":"uint64"},{"internalType":"uint8","name":"numRaces","type":"uint8"},{"internalType":"uint8","name":"numDrivers","type":"uint8"},{"internalType":"uint64[]","name":"boostTreasureIds","type":"uint64[]"},{"internalType":"uint32[]","name":"boostTreasureQuantities","type":"uint32[]"}],"internalType":"struct SmolRacingState.SmolCar[]","name":"_cars","type":"tuple[]"},{"components":[{"internalType":"uint64[2]","name":"driverIds","type":"uint64[2]"},{"internalType":"uint64","name":"cycleId","type":"uint64"},{"internalType":"uint8","name":"numRaces","type":"uint8"},{"internalType":"uint8","name":"numDrivers","type":"uint8"},{"internalType":"uint64[]","name":"boostTreasureIds","type":"uint64[]"},{"internalType":"uint32[]","name":"boostTreasureQuantities","type":"uint32[]"}],"internalType":"struct SmolRacingState.Swolercycle[]","name":"_cycles","type":"tuple[]"}],"name":"stakeVehicles","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":"swolercycles","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeForReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToRequestId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToRewardsClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToRewardsInProgress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToStakeStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasures","outputs":[{"internalType":"contract ISmolTreasures","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_carTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_cycleTokens","type":"uint256[]"}],"name":"unstakeVehicles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vehicleAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"vehicleOddsBoost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"vehiclesOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50614aa4806100206000396000f3fe608060405234801561001057600080fd5b50600436106102955760003560e01c80637bd6babb11610167578063cc12ee60116100ce578063eb54d5c711610087578063eb54d5c7146106a7578063f10fb584146106d3578063f603a76e146106e7578063f636019b146106fa578063fe2fcbbf1461070e578063fe3cbd6e1461072157600080fd5b8063cc12ee601461062f578063d3ff95c714610642578063d547741f14610655578063d6d6727a14610668578063e0e3818e14610681578063ead657c71461069457600080fd5b80639b9580af116101205780639b9580af146105c85780639d1b27eb146105db578063a217fddf146105ee578063a319ada9146105f6578063bedb86fb14610609578063ca15c8731461061c57600080fd5b80637bd6babb1461056a5780638129fc1c1461057e57806388a5d420146105865780638cdcc4b41461059a5780639010d07c146105a257806391d14854146105b557600080fd5b80632f2ff15d1161020b57806349a5572b116101c457806349a5572b146104f65780634f4463f41461050a5780635877349a146105315780635c975abb1461053b578063617a608f14610546578063686dd20b1461055757600080fd5b80632f2ff15d1461046f5780633245dad31461048457806333bd32041461049c57806336568abe146104bc578063365c4ceb146104cf5780633dc22fdd146104e357600080fd5b80631702e2fd1161025d5780631702e2fd1461037a57806319842fb5146103845780631f23c09b146103b05780631f823805146103f4578063248a9ca3146104205780632b5f94bd1461044357600080fd5b806301ffc9a71461029a578063030c4225146102c25780630a5ff95a146102fc578063150b7a021461033857806315ca659d1461036f575b600080fd5b6102ad6102a836600461410f565b610734565b60405190151581526020015b60405180910390f35b6102ee6102d0366004614155565b61016b60209081526000928352604080842090915290825290205481565b6040519081526020016102b9565b61032361030a36600461417f565b6101706020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020016102b9565b6103566103463660046141ae565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016102b9565b6103236305f5e10081565b6102ee6101715481565b6102ee610392366004614155565b61016960209081526000928352604080842090915290825290205481565b6102ee6103be366004614155565b6001600160a01b03919091166000908152610168602090815260408083209383529290522054600160901b900463ffffffff1690565b61016054610408906001600160a01b031681565b6040516001600160a01b0390911681526020016102b9565b6102ee61042e36600461417f565b60009081526097602052604090206001015490565b6102ee610451366004614155565b61016a60209081526000928352604080842090915290825290205481565b61048261047d366004614289565b61075f565b005b61016e5461032390600160401b900463ffffffff1681565b6104af6104aa3660046142b5565b61080c565b6040516102b991906142df565b6104826104ca366004614289565b610bb0565b61015f54610408906001600160a01b031681565b6104af6104f13660046142b5565b610c2e565b61016254610408906001600160a01b031681565b61032361051836600461417f565b61016d6020526000908152604090205463ffffffff1681565b6102ee6101725481565b60fb5460ff166102ad565b61016e546103239063ffffffff1681565b6102ee61056536600461417f565b610c67565b61016354610408906001600160a01b031681565b610482610c89565b61016454610408906001600160a01b031681565b6102ad610d03565b6104086105b0366004614323565b610da4565b6102ad6105c3366004614289565b610dbc565b6104826105d636600461417f565b610de7565b6102ad6105e9366004614345565b610e43565b6102ee600081565b6104826106043660046143cc565b610e7d565b610482610617366004614437565b61128f565b6102ee61062a36600461417f565b6112fe565b61048261063d3660046143cc565b611315565b610482610650366004614459565b61143a565b610482610663366004614289565b611515565b61016e5461032390640100000000900463ffffffff1681565b61048261068f3660046143cc565b6115b3565b6104826106a236600461417f565b61179f565b6102ee6106b5366004614155565b61016c60209081526000928352604080842090915290825290205481565b61016154610408906001600160a01b031681565b6104826106f53660046143cc565b6117fb565b61016554610408906001600160a01b031681565b6102ee61071c366004614155565b611920565b61048261072f3660046143cc565b611a42565b60006001600160e01b03198216635a05180f60e01b1480610759575061075982611b77565b92915050565b7fa2328fc90c90feb8f254e41caa67a90952094a7c9c879c5eb4f2088aaecb4ae8600080516020614a4f8339815191526107998233610dbc565b806107a957506107a98133610dbc565b6107ce5760405162461bcd60e51b81526004016107c5906144df565b60405180910390fd5b600080516020614a4f8339815191528414156107fc5760405162461bcd60e51b81526004016107c590614516565b6108068484611bac565b50505050565b6001600160a01b0380831660009081526101666020908152604080832093851683529290529081206060919061084190611bce565b90506000805b82518110156108c457600083828151811061086457610864614560565b6020908102919091018101516001600160a01b03891660009081526101678352604080822083835290935291909120600101549091506108ae90600160481b900460ff168461458c565b92505080806108bc906145a4565b915050610847565b506000816001600160401b038111156108df576108df614198565b604051908082528060200260200182016040528015610908578160200160208202803683370190505b50905060005b8351811015610ba6576001600160a01b0387166000908152610167602052604081208551829087908590811061094657610946614560565b60209081029190910181015182528101919091526040908101600020815161014081019092528160c081018260048282826020028201916000905b82829054906101000a90046001600160401b03166001600160401b031681526020019060080190602082600701049283019260010382029150808411610981579050505050918352505060018201546001600160401b03811660208084019190915260ff600160401b83048116604080860191909152600160481b9093041660608401526002840180548351818402810184019094528084526080909401939091830182828015610a8357602002820191906000526020600020906000905b82829054906101000a90046001600160401b03166001600160401b031681526020019060080190602082600701049283019260010382029150808411610a405790505b5050505050815260200160038201805480602002602001604051908101604052809291908181526020018280548015610b0757602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610aca5790505b505050505081525050905060005b816060015160ff16811015610b915781516000908260048110610b3a57610b3a614560565b60200201516001600160401b0316905080610b555750610b7f565b8085610b61848761458c565b81518110610b7157610b71614560565b602002602001018181525050505b80610b89816145a4565b915050610b15565b50508080610b9e906145a4565b91505061090e565b5095945050505050565b6001600160a01b0381163314610c205760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016107c5565b610c2a8282611bdb565b5050565b6001600160a01b03808316600090815261016660209081526040808320938516835292905220606090610c6090611bce565b9392505050565b61016f8181548110610c7857600080fd5b600091825260209091200154905081565b600054610100900460ff16610ca45760005460ff1615610ca8565b303b155b610cc45760405162461bcd60e51b81526004016107c5906145bf565b600054610100900460ff16158015610ce6576000805461ffff19166101011790555b610cee611bfd565b8015610d00576000805461ff00191690555b50565b610160546000906001600160a01b031615801590610d2c5750610161546001600160a01b031615155b8015610d435750610162546001600160a01b031615155b8015610d5a5750610163546001600160a01b031615155b8015610d715750610164546001600160a01b031615155b8015610d885750610165546001600160a01b031615155b8015610d9f575061015f546001600160a01b031615155b905090565b600082815260c960205260408120610c609083611c62565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020614a2f833981519152600080516020614a4f833981519152610e0f8233610dbc565b80610e1f5750610e1f8133610dbc565b610e3b5760405162461bcd60e51b81526004016107c5906144df565b505061017255565b6001600160a01b038084166000908152610166602090815260408083209386168352929052908120610e759083611c6e565b949350505050565b60026001541415610ea05760405162461bcd60e51b81526004016107c59061460d565b6002600155610ead610d03565b610ec95760405162461bcd60e51b81526004016107c590614644565b60fb5460ff1615610eec5760405162461bcd60e51b81526004016107c590614672565b82151580610ef957508015155b610f155760405162461bcd60e51b81526004016107c59061469c565b60005b838110156110d15736858583818110610f3357610f33614560565b9050602002810190610f4591906146c5565b90506000610f5960e0830160c084016146e6565b60ff1611610fa05760405162461bcd60e51b815260206004820152601460248201527337379031b0b910323934bb32b9399033b4bb32b760611b60448201526064016107c5565b61016254610164546040805161014081019091526110be926001600160a01b039081169216908060c08101866004828260808082843760009201919091525050508152602001610ff660a0870160808801614709565b6001600160401b0316815260200161101460c0870160a088016146e6565b60ff16815260200161102c60e0870160c088016146e6565b60ff16815260200161104160e0870187614732565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250602001611086610100870187614732565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050915250611c86565b50806110c9816145a4565b915050610f18565b5060005b8181101561128457368383838181106110f0576110f0614560565b9050602002810190611102919061477b565b9050600061111660a08301608084016146e6565b60ff161161115f5760405162461bcd60e51b815260206004820152601660248201527537379031bcb1b63290323934bb32b9399033b4bb32b760511b60448201526064016107c5565b611167613ec4565b6111746020830183614709565b6001600160401b0316815261118f6040830160208401614709565b6001600160401b031660208083019190915261016354610165546040805160c08101825285815261126f946001600160a01b0394851694909316929091908201906111e09060608901908901614709565b6001600160401b031681526020016111fe60808801606089016146e6565b60ff16815260200161121660a08801608089016146e6565b60ff16815260200161122b60a0880188614732565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509082525060200161108660c0880188614732565b5050808061127c906145a4565b9150506110d5565b505060018055505050565b600080516020614a2f833981519152600080516020614a4f8339815191526112b78233610dbc565b806112c757506112c78133610dbc565b6112e35760405162461bcd60e51b81526004016107c5906144df565b82156112f6576112f16121db565b505050565b6112f1612250565b600081815260c960205260408120610759906122ca565b600260015414156113385760405162461bcd60e51b81526004016107c59061460d565b6002600155611345610d03565b6113615760405162461bcd60e51b81526004016107c590614644565b60fb5460ff16156113845760405162461bcd60e51b81526004016107c590614672565b8215158061139157508015155b6113ad5760405162461bcd60e51b81526004016107c59061469c565b60005b838110156113f957610164546113e7906001600160a01b03168686848181106113db576113db614560565b905060200201356122d4565b806113f1816145a4565b9150506113b0565b5060005b818110156112845761016554611428906001600160a01b03168484848181106113db576113db614560565b80611432816145a4565b9150506113fd565b600080516020614a2f833981519152600080516020614a4f8339815191526114628233610dbc565b8061147257506114728133610dbc565b61148e5760405162461bcd60e51b81526004016107c5906144df565b505061016080546001600160a01b03199081166001600160a01b03998a16179091556101628054821697891697909717909655610163805487169588169590951790945561016480548616938716939093179092556101658054851691861691909117905561015f8054841691851691909117905561016180549092169216919091179055565b7fa2328fc90c90feb8f254e41caa67a90952094a7c9c879c5eb4f2088aaecb4ae8600080516020614a4f83398151915261154f8233610dbc565b8061155f575061155f8133610dbc565b61157b5760405162461bcd60e51b81526004016107c5906144df565b600080516020614a4f8339815191528414156115a95760405162461bcd60e51b81526004016107c590614516565b6108068484611bdb565b600080516020614a2f833981519152600080516020614a4f8339815191526115db8233610dbc565b806115eb57506115eb8133610dbc565b6116075760405162461bcd60e51b81526004016107c5906144df565b8483146116445760405162461bcd60e51b815260206004820152600b60248201526a426164206c656e6774687360a81b60448201526064016107c5565b61165161016f6000613ee2565b6000805b8681101561174b5785858281811061166f5761166f614560565b90506020020160208101906116849190614791565b61168e90836147b7565b915061016f8888838181106116a5576116a5614560565b835460018101855560009485526020948590209190940292909201359190920155508585828181106116d9576116d9614560565b90506020020160208101906116ee9190614791565b61017060008a8a8581811061170557611705614560565b90506020020135815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055508080611743906145a4565b915050611655565b5063ffffffff81166305f5e100146117965760405162461bcd60e51b815260206004820152600e60248201526d42616420746f74616c206f64647360901b60448201526064016107c5565b50505050505050565b600080516020614a2f833981519152600080516020614a4f8339815191526117c78233610dbc565b806117d757506117d78133610dbc565b6117f35760405162461bcd60e51b81526004016107c5906144df565b505061017155565b6002600154141561181e5760405162461bcd60e51b81526004016107c59061460d565b600260015561182b610d03565b6118475760405162461bcd60e51b81526004016107c590614644565b60fb5460ff161561186a5760405162461bcd60e51b81526004016107c590614672565b8215158061187757508015155b6118935760405162461bcd60e51b81526004016107c59061469c565b60005b838110156118df57610164546118cd906001600160a01b03168686848181106118c1576118c1614560565b90506020020135612b67565b806118d7816145a4565b915050611896565b5060005b81811015611284576101655461190e906001600160a01b03168484848181106118c1576118c1614560565b80611918816145a4565b9150506118e3565b600080610172546000148061193757506101725442105b6119445761017254611946565b425b6001600160a01b038516600090815261016860209081526040808320878452825291829020825160a08101845290546001600160401b038082168352600160401b820460ff90811694840194909452600160481b820490931693820193909352600160501b830490911660608201819052600160901b90920463ffffffff1660808201529192506119dc57600092505050610759565b6000816040015182602001516119f291906147df565b9050600061017154836060015185611a0a9190614802565b6001600160401b0316611a1d9190614840565b90508160ff16811115611a38575060ff169250610759915050565b9695505050505050565b60026001541415611a655760405162461bcd60e51b81526004016107c59061460d565b6002600155611a72610d03565b611a8e5760405162461bcd60e51b81526004016107c590614644565b60fb5460ff1615611ab15760405162461bcd60e51b81526004016107c590614672565b82151580611abe57508015155b611ada5760405162461bcd60e51b81526004016107c59061469c565b60005b83811015611b2e576101625461016454611b1c916001600160a01b039081169116878785818110611b1057611b10614560565b90506020020135612dbe565b80611b26816145a4565b915050611add565b5060005b81811015611284576101635461016554611b65916001600160a01b039081169116858585818110611b1057611b10614560565b80611b6f816145a4565b915050611b32565b60006001600160e01b03198216637965db0b60e01b148061075957506301ffc9a760e01b6001600160e01b0319831614610759565b611bb6828261339f565b600082815260c9602052604090206112f19082613425565b60606000610c608361343a565b611be58282613496565b600082815260c9602052604090206112f190826134fd565b600054610100900460ff16611c185760005460ff1615611c1c565b303b155b611c385760405162461bcd60e51b81526004016107c5906145bf565b600054610100900460ff16158015611c5a576000805461ffff19166101011790555b610cee613512565b6000610c60838361367c565b60008181526001830160205260408120541515610c60565b6020808201516001600160a01b03841660009081526101668352604080822033835290935291909120611cc1916001600160401b03166136a6565b506001600160a01b038216600090815261016760209081526040808320828501516001600160401b0316845290915290208151829190611d049082906004613f00565b50602082810151600183018054604086015160608701516001600160401b0390941668ffffffffffffffffff1990921691909117600160401b60ff928316021760ff60481b1916600160481b919093160291909117905560808301518051611d729260028501920190613fa5565b5060a08201518051611d8e916003840191602090910190614017565b5090505060004290506040518060a00160405280826001600160401b03168152602001836040015160ff168152602001600060ff168152602001826001600160401b03168152602001611de185856136b2565b63ffffffff9081169091526001600160a01b038516600090815261016860209081526040808320878301516001600160401b0390811685529083528184208651815494880151938801516060890151608090990151909716600160901b0263ffffffff60901b19988416600160501b0267ffffffffffffffff60501b1960ff998a16600160481b021668ffffffffffffffffff60481b1999909616600160401b0268ffffffffffffffffff1990971692909416919091179490941795909516919091171793909316929092179055805b6004811015611ffd5783518160048110611ecd57611ecd614560565b60200201516001600160401b0316611ee457611ffd565b611eef60018361458c565b9150856001600160a01b03166342842e0e333087600001518560048110611f1857611f18614560565b60200201516040518463ffffffff1660e01b8152600401611f3b93929190614854565b600060405180830381600087803b158015611f5557600080fd5b505af1158015611f69573d6000803e3d6000fd5b5050505083600001518160048110611f8357611f83614560565b60200201516001600160401b0316866001600160a01b0316336001600160a01b03167f11a9cf9fb826815e83a8636e49d456b2aea0a01a31a6cea2912e50d5ba49568e86604051611fe391906001600160401b0391909116815260200190565b60405180910390a480611ff5816145a4565b915050611eb1565b50826060015160ff16811461205e5760405162461bcd60e51b815260206004820152602160248201527f696e636f7272656374206e756d626572206f66206472697665727320676976656044820152603760f91b60648201526084016107c5565b6020830151604051632142170760e11b81526001600160a01b038616916342842e0e91612092913391309190600401614854565b600060405180830381600087803b1580156120ac57600080fd5b505af11580156120c0573d6000803e3d6000fd5b50505050600061016160009054906101000a90046001600160a01b03166001600160a01b0316638678a7b26040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561211757600080fd5b505af115801561212b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214f9190614880565b6001600160a01b03861660008181526101696020908152604080832089830180516001600160401b03908116865291909352928190208590559051888201518951925195965092169333927fb9aa1aef7b85a61602dc4fb998914a813dd1b708295c1c55e2b5b01f09281722926121cb928a9291908990614899565b60405180910390a4505050505050565b60fb5460ff16156121fe5760405162461bcd60e51b81526004016107c590614672565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122333390565b6040516001600160a01b03909116815260200160405180910390a1565b60fb5460ff166122995760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107c5565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612233565b6000610759825490565b6001600160a01b03821660009081526101666020908152604080832033845290915290206123029082611c6e565b6123415760405162461bcd60e51b815260206004820152601060248201526f1d1bdad95b881b9bdd081cdd185ad95960821b60448201526064016107c5565b6001600160a01b038216600090815261016760209081526040808320848452909152808220815161014081019283905291829060c082019083906004908288855b82829054906101000a90046001600160401b03166001600160401b031681526020019060080190602082600701049283019260010382029150808411612382579050505050918352505060018201546001600160401b03811660208084019190915260ff600160401b83048116604080860191909152600160481b909304166060840152600284018054835181840281018401909452808452608090940193909183018282801561248457602002820191906000526020600020906000905b82829054906101000a90046001600160401b03166001600160401b0316815260200190600801906020826007010492830192600103820291508084116124415790505b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561250857602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116124cb5790505b505050919092525050506001600160a01b0384166000908152610168602090815260408083208684528252808320815160a08101835290546001600160401b03808216835260ff600160401b8304811695840195909552600160481b820490941692820192909252600160501b8204909216606083015263ffffffff600160901b90910416608082015291925061259f8585611920565b9050816020015160ff1681836040015160ff166125bc919061458c565b10156125fc5760405162461bcd60e51b815260206004820152600f60248201526e6e6f7420646f6e6520726163696e6760881b60448201526064016107c5565b801561260e5761260e81868685613959565b60004290506040518060c001604052808560000151815260200185602001516001600160401b03168152602001856040015160ff168152602001856060015160ff16815260200160006001600160401b0381111561266e5761266e614198565b604051908082528060200260200182016040528015612697578160200160208202803683370190505b50815260200160006040519080825280602002602001820160405280156126c8578160200160208202803683370190505b5090526001600160a01b038716600090815261016760209081526040808320898452909152902081516126fe9082906004613f00565b50602082810151600183018054604086015160608701516001600160401b0390941668ffffffffffffffffff1990921691909117600160401b60ff928316021760ff60481b1916600160481b91909316029190911790556080830151805161276c9260028501920190613fa5565b5060a08201518051612788916003840191602090910190614017565b50506040805160a0810182526001600160401b0384168082528783015160ff16602080840191909152600083850181905260608401929092526001600160a01b038b16825261016781528382208a8352905282902082516101408101909352909250608083019161299f918a91908160c081018260048282826020028201916000905b82829054906101000a90046001600160401b03166001600160401b03168152602001906008019060208260070104928301926001038202915080841161280b579050505050918352505060018201546001600160401b03811660208084019190915260ff600160401b83048116604080860191909152600160481b909304166060840152600284018054835181840281018401909452808452608090940193909183018282801561290d57602002820191906000526020600020906000905b82829054906101000a90046001600160401b03166001600160401b0316815260200190600801906020826007010492830192600103820291508084116128ca5790505b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561299157602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116129545790505b5050505050815250506136b2565b63ffffffff9081169091526001600160a01b038089166000908152610168602090815260408083208b8452825280832086518154888501518985015160608b01516080909b0151909916600160901b0263ffffffff60901b196001600160401b039b8c16600160501b0267ffffffffffffffff60501b1960ff9c8d16600160481b021668ffffffffffffffffff60481b199c909416600160401b0268ffffffffffffffffff199095169c9095169b909b1792909217989098169790971717969096169490941790945561016154835163433c53d960e11b815293519194921692638678a7b292600480830193919282900301818787803b158015612aa257600080fd5b505af1158015612ab6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ada9190614880565b6001600160a01b0388166000818152610169602090815260408083208a830180516001600160401b03908116865291909352928190208590559051898201518a51925195965092169333927f539837747a1afd2affdc2d3a4de602e8d1b2ec80b0febbcf72f7b94020801bb392612b5692899291908990614899565b60405180910390a450505050505050565b6001600160a01b0382166000908152610166602090815260408083203384529091529020612b959082611c6e565b612bd55760405162461bcd60e51b81526020600482015260116024820152703737ba103b32b434b1b6329037bbb732b960791b60448201526064016107c5565b6000612be18383611920565b905060008111612c265760405162461bcd60e51b815260206004820152601060248201526f6e6f7468696e6720746f20636c61696d60801b60448201526064016107c5565b6001600160a01b038316600090815261016860209081526040808320858452825291829020825160a08101845290546001600160401b038082168352600160401b820460ff90811694840194909452600160481b820490931693820193909352600160501b83049091166060820152600160901b90910463ffffffff16608082015261017154612cb690836148f3565b81606001818151612cc79190614912565b6001600160401b0316905250612cdf82858584613959565b8181604001818151612cf19190614934565b60ff9081169091526001600160a01b0390951660009081526101686020908152604080832096835295815290859020835181549285015196850151606086015160809096015163ffffffff16600160901b0263ffffffff60901b196001600160401b03978816600160501b0267ffffffffffffffff60501b19938c16600160481b029390931668ffffffffffffffffff60481b199a909b16600160401b0268ffffffffffffffffff1990961697909316969096179390931796909616969096171793909316179092555050565b6001600160a01b0382166000908152610166602090815260408083203384529091529020612dec9082611c6e565b612e2b5760405162461bcd60e51b815260206004820152601060248201526f1d1bdad95b881b9bdd081cdd185ad95960821b60448201526064016107c5565b6001600160a01b038216600090815261016760209081526040808320848452909152808220815161014081019283905291829060c082019083906004908288855b82829054906101000a90046001600160401b03166001600160401b031681526020019060080190602082600701049283019260010382029150808411612e6c579050505050918352505060018201546001600160401b03811660208084019190915260ff600160401b83048116604080860191909152600160481b9093041660608401526002840180548351818402810184019094528084526080909401939091830182828015612f6e57602002820191906000526020600020906000905b82829054906101000a90046001600160401b03166001600160401b031681526020019060080190602082600701049283019260010382029150808411612f2b5790505b5050505050815260200160038201805480602002602001604051908101604052809291908181526020018280548015612ff257602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411612fb55790505b505050919092525050506001600160a01b0384166000908152610168602090815260408083208684528252808320815160a08101835290546001600160401b03808216835260ff600160401b8304811695840195909552600160481b820490941692820192909252600160501b8204909216606083015263ffffffff600160901b9091041660808201529192506130898585611920565b9050816020015160ff1681836040015160ff166130a6919061458c565b10156130e65760405162461bcd60e51b815260206004820152600f60248201526e6e6f7420646f6e6520726163696e6760881b60448201526064016107c5565b6001600160a01b03851660009081526101676020908152604080832087845290915281208181559060018201805469ffffffffffffffffffff191690556131316002830160006140b4565b61313f6003830160006140d9565b50506001600160a01b038516600081815261016860209081526040808320888452825280832080546001600160b01b0319169055928252610166815282822033835290522061318e90856139fa565b5080156131a1576131a181868685613959565b4260005b60048110156132ca57845181600481106131c1576131c1614560565b60200201516001600160401b03166131d8576132ca565b876001600160a01b03166342842e0e3033886000015185600481106131ff576131ff614560565b60200201516040518463ffffffff1660e01b815260040161322293929190614854565b600060405180830381600087803b15801561323c57600080fd5b505af1158015613250573d6000803e3d6000fd5b505050508460000151816004811061326a5761326a614560565b60200201516001600160401b0316886001600160a01b0316336001600160a01b03167f0e0892e64dffe15b2a80856d3fa02b3b3df09de56739118dc5b9a6050b8d553f60405160405180910390a4806132c2816145a4565b9150506131a5565b506020840151604051632142170760e11b81526001600160a01b038816916342842e0e916132ff913091339190600401614854565b600060405180830381600087803b15801561331957600080fd5b505af115801561332d573d6000803e3d6000fd5b5050505083602001516001600160401b0316866001600160a01b0316336001600160a01b03167f9befef7662aaefd702af59c4c6f9e9a369b3ab1f242afc3b04376387817533ee848860400151604051612b569291906001600160401b0392909216825260ff16602082015260400190565b6133a98282610dbc565b610c2a5760008281526097602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610c60836001600160a01b038416613a06565b60608160000180548060200260200160405190810160405280929190818152602001828054801561348a57602002820191906000526020600020905b815481526020019060010190808311613476575b50505050509050919050565b6134a08282610dbc565b15610c2a5760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610c60836001600160a01b038416613a55565b600054610100900460ff1661352d5760005460ff1615613531565b303b155b61354d5760405162461bcd60e51b81526004016107c5906145bf565b600054610100900460ff1615801561356f576000805461ffff19166101011790555b613577613b48565b61357f613b89565b620151806101715561016e80546a0f4240000a2d78002625a06bffffffffffffffffffffffff1990911617905561016d6020527f6078124e71fd9c0560cfe3a4bc21fab1d9b8aec7d51bb7242640552dc617b3eb805463ffffffff199081166002179091557fa41153f7b441e5124984a1a7a25de80e57749aba77d03eb20616228c312fe9b88054821660051790557f7e8a02e2876e7ede23202519472266dc52bcb834242340746bda0c7bfc93350080548216600c17905560046000527ffd0335b1652bda6537bb20a5eac5c877b63e94b4b0a303d80d81478970b660df8054909116601b1790558015610d00576000805461ff001916905550565b600082600001828154811061369357613693614560565b9060005260206000200154905092915050565b6000610c608383613a06565b610164546000906001600160a01b038481169116141561370f5761016e60049054906101000a900463ffffffff16600183606001516136f191906147df565b60ff166136fe9190614959565b61370890826147b7565b9050613754565b610165546001600160a01b038481169116141561375457816060015160ff16600214156137545761016e5461375190600160401b900463ffffffff16826147b7565b90505b60808201515160a08301515181146137c05760405162461bcd60e51b815260206004820152602960248201527f4e756d626572206f6620747265617375726573206d756368206d61746368207160448201526875616e74697469657360b81b60648201526084016107c5565b60005b8181101561392f5761016054608085015180516001600160a01b039092169163f5298aca913391859081106137fa576137fa614560565b60200260200101518760a00151858151811061381857613818614560565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0390931660048401526001600160401b03909116602483015263ffffffff166044820152606401600060405180830381600087803b15801561387f57600080fd5b505af1158015613893573d6000803e3d6000fd5b50505050600061016d6000866080015184815181106138b4576138b4614560565b60200260200101516001600160401b0316815260200190815260200160002060009054906101000a900463ffffffff1690508460a0015182815181106138fc576138fc614560565b60200260200101518161390f9190614959565b61391990856147b7565b9350508080613927906145a4565b9150506137c3565b5061016e5463ffffffff90811690831611156139525761016e5463ffffffff1691505b5092915050565b60006139658484613bb0565b905060005b858110156139f257600081846040015160ff16613987919061458c565b61399290600161458c565b9050600083826040516020016139b2929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506139dd8787876080015184613c4e565b505080806139ea906145a4565b91505061396a565b505050505050565b6000610c608383613a55565b6000818152600183016020526040812054613a4d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610759565b506000610759565b60008181526001830160205260408120548015613b3e576000613a79600183614985565b8554909150600090613a8d90600190614985565b9050818114613af2576000866000018281548110613aad57613aad614560565b9060005260206000200154905080876000018481548110613ad057613ad0614560565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613b0357613b0361499c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610759565b6000915050610759565b600054610100900460ff16613b6f5760405162461bcd60e51b81526004016107c5906149b2565b613b77613b89565b613b7f613e1b565b613b87613e4a565b565b600054610100900460ff16613b875760405162461bcd60e51b81526004016107c5906149b2565b6001600160a01b0382811660009081526101696020908152604080832085845290915280822054610161549151634ad30a7560e01b81526004810182905292939092911690634ad30a759060240160206040518083038186803b158015613c1657600080fd5b505afa158015613c2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e759190614880565b600063ffffffff8316613c656305f5e100846149fd565b613c6f919061458c565b90506305f5e1008110613c9457613c8b60016305f5e100614a11565b63ffffffff1690505b60008060005b61016f54811015613d8657600061016f8281548110613cbb57613cbb614560565b6000918252602080832090910154808352610170909152604090912054909150613ceb9063ffffffff168561458c565b935083851015613d73578015613d6d5761015f54604051630ab714fb60e11b8152336004820152602481018390526001604482015291935083916001600160a01b039091169063156e29f690606401600060405180830381600087803b158015613d5457600080fd5b505af1158015613d68573d6000803e3d6000fd5b505050505b50613d86565b5080613d7e816145a4565b915050613c9a565b508015613dda57604080518281526001602082015287916001600160a01b038a169133917f17db246e2b79d27e01c800967d89cbee46000807213e933b6e4c4fddac899a78910160405180910390a4611796565b60405186906001600160a01b0389169033907fe3771e644816ae6e430f2ff06418f05ccfe72fc1288b1879824c02cf63f5748490600090a450505050505050565b600054610100900460ff16613e425760405162461bcd60e51b81526004016107c5906149b2565b613b87613e91565b600054610100900460ff16613e715760405162461bcd60e51b81526004016107c5906149b2565b613e796121db565b613b87600080516020614a4f83398151915233611bac565b600054610100900460ff16613eb85760405162461bcd60e51b81526004016107c5906149b2565b60fb805460ff19169055565b60405180608001604052806004906020820280368337509192915050565b5080546000825590600052602060002090810190610d0091906140fa565b600183019183908215613f955791602002820160005b83821115613f6057835183826101000a8154816001600160401b0302191690836001600160401b031602179055509260200192600801602081600701049283019260010302613f16565b8015613f935782816101000a8154906001600160401b030219169055600801602081600701049283019260010302613f60565b505b50613fa19291506140fa565b5090565b82805482825590600052602060002090600301600490048101928215613f9557916020028201600083821115613f6057835183826101000a8154816001600160401b0302191690836001600160401b031602179055509260200192600801602081600701049283019260010302613f16565b82805482825590600052602060002090600701600890048101928215613f955791602002820160005b8382111561408457835183826101000a81548163ffffffff021916908363ffffffff1602179055509260200192600401602081600301049283019260010302614040565b8015613f935782816101000a81549063ffffffff0219169055600401602081600301049283019260010302614084565b508054600082556003016004900490600052602060002090810190610d0091906140fa565b508054600082556007016008900490600052602060002090810190610d0091905b5b80821115613fa157600081556001016140fb565b60006020828403121561412157600080fd5b81356001600160e01b031981168114610c6057600080fd5b80356001600160a01b038116811461415057600080fd5b919050565b6000806040838503121561416857600080fd5b61417183614139565b946020939093013593505050565b60006020828403121561419157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156141c457600080fd5b6141cd85614139565b93506141db60208601614139565b92506040850135915060608501356001600160401b03808211156141fe57600080fd5b818701915087601f83011261421257600080fd5b81358181111561422457614224614198565b604051601f8201601f19908116603f0116810190838211818310171561424c5761424c614198565b816040528281528a602084870101111561426557600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561429c57600080fd5b823591506142ac60208401614139565b90509250929050565b600080604083850312156142c857600080fd5b6142d183614139565b91506142ac60208401614139565b6020808252825182820181905260009190848201906040850190845b81811015614317578351835292840192918401916001016142fb565b50909695505050505050565b6000806040838503121561433657600080fd5b50508035926020909101359150565b60008060006060848603121561435a57600080fd5b61436384614139565b925061437160208501614139565b9150604084013590509250925092565b60008083601f84011261439357600080fd5b5081356001600160401b038111156143aa57600080fd5b6020830191508360208260051b85010111156143c557600080fd5b9250929050565b600080600080604085870312156143e257600080fd5b84356001600160401b03808211156143f957600080fd5b61440588838901614381565b9096509450602087013591508082111561441e57600080fd5b5061442b87828801614381565b95989497509550505050565b60006020828403121561444957600080fd5b81358015158114610c6057600080fd5b600080600080600080600060e0888a03121561447457600080fd5b61447d88614139565b965061448b60208901614139565b955061449960408901614139565b94506144a760608901614139565b93506144b560808901614139565b92506144c360a08901614139565b91506144d160c08901614139565b905092959891949750929550565b6020808252601b908201527f446f6573206e6f74206861766520726571756972656420726f6c650000000000604082015260600190565b6020808252602a908201527f43616e6e6f74206368616e6765206f776e657220726f6c65207468726f756768604082015269206772616e74526f6c6560b01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561459f5761459f614576565b500190565b60006000198214156145b8576145b8614576565b5060010190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526014908201527310dbdb9d1c9858dd1cc8185c995b89dd081cd95d60621b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252600f908201526e3737903a37b5b2b7399033b4bb32b760891b604082015260600190565b6000823561011e198336030181126146dc57600080fd5b9190910192915050565b6000602082840312156146f857600080fd5b813560ff81168114610c6057600080fd5b60006020828403121561471b57600080fd5b81356001600160401b0381168114610c6057600080fd5b6000808335601e1984360301811261474957600080fd5b8301803591506001600160401b0382111561476357600080fd5b6020019150600581901b36038213156143c557600080fd5b6000823560de198336030181126146dc57600080fd5b6000602082840312156147a357600080fd5b813563ffffffff81168114610c6057600080fd5b600063ffffffff8083168185168083038211156147d6576147d6614576565b01949350505050565b600060ff821660ff8416808210156147f9576147f9614576565b90039392505050565b60006001600160401b038381169083168181101561482257614822614576565b039392505050565b634e487b7160e01b600052601260045260246000fd5b60008261484f5761484f61482a565b500490565b6001600160a01b0393841681529190921660208201526001600160401b03909116604082015260600190565b60006020828403121561489257600080fd5b5051919050565b600060e0820190506001600160401b038087168352602060ff871681850152604084018660005b60048110156148df5781518516835291830191908301906001016148c0565b50505050508260c083015295945050505050565b600081600019048311821515161561490d5761490d614576565b500290565b60006001600160401b038083168185168083038211156147d6576147d6614576565b600060ff821660ff84168060ff0382111561495157614951614576565b019392505050565b600063ffffffff8083168185168183048111821515161561497c5761497c614576565b02949350505050565b60008282101561499757614997614576565b500390565b634e487b7160e01b600052603160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082614a0c57614a0c61482a565b500690565b600063ffffffff838116908316818110156148225761482261457656fedf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec426270edb7c868f86fda4adedba75108201087268ea345934db8bad688e1feb91ba264697066735822122032048de5fbb150c59a9aff8b10b2e1a1c429f3c1fdd321c7a3a658f3b69b078964736f6c63430008090033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.