More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ConnectorPurchase
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/AccessControl.sol"; interface IERC20Burnable { function burn(uint256 amount) external; function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transferFrom( address from, address to, uint256 amount ) external returns (bool); function transfer(address to, uint256 amount) external returns (bool); } contract ConnectorPurchase is AccessControl { // Define events event ConnectorPurchased(string uuid, address indexed purchaser, uint256 indexed connectorId, uint256 expiration, uint256 price); event ConnectorPriceUpdated(uint256 newConnectorPrice); event ConnectorDurationUpdated(uint256 newConnectorDuration); event MaxConnectorsUpdated(uint256 newMaxConnectors); event RepurchaseWindowUpdated(uint256 newRepurchaseWindow); event TokensWithdrawn(address indexed recipient, uint256 amount); event TokensBurned(uint256 amount); // ERC20 token to be used for purchases IERC20Burnable public paymentToken; // Price per connector in token units uint256 public connectorPrice; // Duration for purchased connectors in seconds uint256 public connectorDuration; // Maximum number of connectors that can be purchased at once uint256 public maxConnectors = 10; // Maximum window to allow repurchasing an existing connector for a user uint256 public repurchaseWindow; // Contract version uint256 public version = 100; // Mapping of uuid to purchased connectors with expiration timestamp mapping(string => mapping(uint256 => uint256)) public purchasedConnectors; bytes32 public constant TOKEN_WITHDRAW_ROLE = keccak256("TOKEN_WITHDRAW_ROLE"); bytes32 public constant TOKEN_BURNER_ROLE = keccak256("TOKEN_BURNER_ROLE"); constructor( IERC20Burnable _paymentToken, uint256 _connectorPrice, uint256 _connectorDuration, uint256 _repurchaseWindow ) { require( _connectorPrice > 0, "ConnectorPurchase: price must be greater than zero" ); require( address(_paymentToken) != address(0), "ConnectorPurchase: token must be a valid address" ); connectorPrice = _connectorPrice; connectorDuration = _connectorDuration; repurchaseWindow = _repurchaseWindow; paymentToken = _paymentToken; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(TOKEN_WITHDRAW_ROLE, msg.sender); _setupRole(TOKEN_BURNER_ROLE, msg.sender); } function purchase(string calldata uuid, uint256[] calldata connectorIds) external { uint256 currentTimestamp = block.timestamp; require( connectorIds.length <= maxConnectors, "ConnectorPurchase: cannot purchase more than maxConnectors connectors at once" ); uint256 totalAmount = connectorIds.length * connectorPrice; require( totalAmount > 0, "ConnectorPurchase: cannot purchase zero connectors" ); require( paymentToken.balanceOf(msg.sender) >= totalAmount, "ConnectorPurchase: insufficient token balance" ); require( paymentToken.allowance(msg.sender, address(this)) >= totalAmount, "ConnectorPurchase: token allowance too low" ); for (uint256 i = 0; i < connectorIds.length; i++) { uint256 expirationTimestamp = purchasedConnectors[uuid][ connectorIds[i] ]; require( expirationTimestamp == 0 || expirationTimestamp <= currentTimestamp || ( expirationTimestamp <= (currentTimestamp + repurchaseWindow) && expirationTimestamp > currentTimestamp ), "ConnectorPurchase: user cannot repurchase a connector that has not yet expired or is outside of the repurchase window" ); require(connectorIds[i] != 0,"ConnectorPurchase: user cannot purchase connector ID 0"); if (expirationTimestamp > currentTimestamp && expirationTimestamp <= currentTimestamp + repurchaseWindow) { // Add remaining time to the existing expiration timestamp purchasedConnectors[uuid][connectorIds[i]] = expirationTimestamp + connectorDuration; } else { purchasedConnectors[uuid][connectorIds[i]] = currentTimestamp + connectorDuration; } // Emit event emit ConnectorPurchased(uuid, msg.sender, connectorIds[i], purchasedConnectors[uuid][connectorIds[i]], connectorPrice); } // Transfer tokens from user to contract require( paymentToken.transferFrom(msg.sender, address(this), totalAmount), "ConnectorPurchase: token transfer failed" ); } // Check the expiration of a purchased connector for the given uuid and connector ID function getConnectorExpiration(string calldata uuid, uint256 connectorId) external view returns (uint256) { return purchasedConnectors[uuid][connectorId]; } // Update the connector price function updateConnectorPrice(uint256 _newConnectorPrice) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _newConnectorPrice > 0, "ConnectorPurchase: price must be greater than zero" ); connectorPrice = _newConnectorPrice; // Emit event emit ConnectorPriceUpdated(_newConnectorPrice); } // Update the connector duration function updateConnectorDuration(uint256 _newConnectorDuration) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _newConnectorDuration > 0, "ConnectorPurchase: duration must be greater than zero" ); connectorDuration = _newConnectorDuration; // Emit event emit ConnectorDurationUpdated(_newConnectorDuration); } // Update the maximum number of connectors a user can purchase at once function updateMaxConnectors(uint256 _newMaxConnectors) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _newMaxConnectors > 0, "ConnectorPurchase: maximum connectors must be greater than zero" ); maxConnectors = _newMaxConnectors; // Emit event emit MaxConnectorsUpdated(_newMaxConnectors); } // Update the repurchase window function updateRepurchaseWindow(uint256 _newRepurchaseWindow) external onlyRole(DEFAULT_ADMIN_ROLE) { repurchaseWindow = _newRepurchaseWindow; // Emit event emit RepurchaseWindowUpdated(_newRepurchaseWindow); } // Withdraw tokens from the contract to the given recipient address function withdrawTokens(address recipient, uint256 amount) external onlyRole(TOKEN_WITHDRAW_ROLE) { require(amount > 0, "ConnectorPurchase: cannot withdraw zero tokens"); require( paymentToken.balanceOf(address(this)) >= amount, "ConnectorPurchase: insufficient contract balance" ); require( paymentToken.transfer(recipient, amount), "ConnectorPurchase: token transfer failed" ); // Emit event emit TokensWithdrawn(recipient, amount); } // Burn the specified amount of tokens from the contract balance function burnTokens(uint256 amount) external onlyRole(TOKEN_BURNER_ROLE) { require(amount > 0, "ConnectorPurchase: cannot burn zero tokens"); require( paymentToken.balanceOf(address(this)) >= amount, "ConnectorPurchase: insufficient contract balance" ); paymentToken.burn(amount); // Emit event emit TokensBurned(amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * 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 AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20Burnable","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_connectorPrice","type":"uint256"},{"internalType":"uint256","name":"_connectorDuration","type":"uint256"},{"internalType":"uint256","name":"_repurchaseWindow","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newConnectorDuration","type":"uint256"}],"name":"ConnectorDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newConnectorPrice","type":"uint256"}],"name":"ConnectorPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"uuid","type":"string"},{"indexed":true,"internalType":"address","name":"purchaser","type":"address"},{"indexed":true,"internalType":"uint256","name":"connectorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"ConnectorPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxConnectors","type":"uint256"}],"name":"MaxConnectorsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRepurchaseWindow","type":"uint256"}],"name":"RepurchaseWindowUpdated","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":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_WITHDRAW_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"connectorDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"connectorPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"uuid","type":"string"},{"internalType":"uint256","name":"connectorId","type":"uint256"}],"name":"getConnectorExpiration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxConnectors","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentToken","outputs":[{"internalType":"contract IERC20Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"uuid","type":"string"},{"internalType":"uint256[]","name":"connectorIds","type":"uint256[]"}],"name":"purchase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"purchasedConnectors","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"repurchaseWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","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":[{"internalType":"uint256","name":"_newConnectorDuration","type":"uint256"}],"name":"updateConnectorDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newConnectorPrice","type":"uint256"}],"name":"updateConnectorPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxConnectors","type":"uint256"}],"name":"updateMaxConnectors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newRepurchaseWindow","type":"uint256"}],"name":"updateRepurchaseWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052600a60045560646006553480156200001b57600080fd5b506040516200341338038062003413833981810160405281019062000041919062000405565b6000831162000087576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200007e90620004fe565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415620000fa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000f19062000596565b60405180910390fd5b82600281905550816003819055508060058190555083600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001656000801b33620001d360201b60201c565b620001977fe6a7817a58d7040f21b2f1158bab553c28bf2ec0575caae7aea952b07ae224d333620001d360201b60201c565b620001c97f02358c16c6ece4d564dd98c8400ef2ce02ec4ed5a3d53421ef64678a57ac510133620001d360201b60201c565b50505050620005b8565b620001e58282620001e960201b60201c565b5050565b620001fb8282620002da60201b60201c565b620002d657600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200027b6200034460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200037e8262000351565b9050919050565b6000620003928262000371565b9050919050565b620003a48162000385565b8114620003b057600080fd5b50565b600081519050620003c48162000399565b92915050565b6000819050919050565b620003df81620003ca565b8114620003eb57600080fd5b50565b600081519050620003ff81620003d4565b92915050565b600080600080608085870312156200042257620004216200034c565b5b60006200043287828801620003b3565b94505060206200044587828801620003ee565b93505060406200045887828801620003ee565b92505060606200046b87828801620003ee565b91505092959194509250565b600082825260208201905092915050565b7f436f6e6e6563746f7250757263686173653a207072696365206d75737420626560008201527f2067726561746572207468616e207a65726f0000000000000000000000000000602082015250565b6000620004e660328362000477565b9150620004f38262000488565b604082019050919050565b600060208201905081810360008301526200051981620004d7565b9050919050565b7f436f6e6e6563746f7250757263686173653a20746f6b656e206d75737420626560008201527f20612076616c6964206164647265737300000000000000000000000000000000602082015250565b60006200057e60308362000477565b91506200058b8262000520565b604082019050919050565b60006020820190508181036000830152620005b1816200056f565b9050919050565b612e4b80620005c86000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c8063634396cd116100c35780639c3acb511161007c5780639c3acb51146103a1578063a217fddf146103d1578063b486fa57146103ef578063d547741f1461040b578063d5bbb4fc14610427578063e536e2d91461045757610158565b8063634396cd146102df5780636d1b229d146102fd57806370f44186146103195780637c32a52b146103375780638d30177d1461035357806391d148541461037157610158565b806331c125ce1161011557806331c125ce146102315780633334944a1461024d57806336568abe14610269578063483084981461028557806353e26d9e146102a357806354fd4d50146102c157610158565b806301ffc9a71461015d57806306b091f91461018d57806310be3ee9146101a9578063248a9ca3146101c75780632f2ff15d146101f75780633013ce2914610213575b600080fd5b610177600480360381019061017291906119fb565b610473565b6040516101849190611a43565b60405180910390f35b6101a760048036038101906101a29190611af2565b6104ed565b005b6101b1610788565b6040516101be9190611b41565b60405180910390f35b6101e160048036038101906101dc9190611b92565b61078e565b6040516101ee9190611bce565b60405180910390f35b610211600480360381019061020c9190611be9565b6107ad565b005b61021b6107ce565b6040516102289190611c88565b60405180910390f35b61024b60048036038101906102469190611ca3565b6107f4565b005b61026760048036038101906102629190611ca3565b610886565b005b610283600480360381019061027e9190611be9565b610918565b005b61028d61099b565b60405161029a9190611b41565b60405180910390f35b6102ab6109a1565b6040516102b89190611bce565b60405180910390f35b6102c96109c5565b6040516102d69190611b41565b60405180910390f35b6102e76109cb565b6040516102f49190611b41565b60405180910390f35b61031760048036038101906103129190611ca3565b6109d1565b005b610321610bf3565b60405161032e9190611b41565b60405180910390f35b610351600480360381019061034c9190611ca3565b610bf9565b005b61035b610c48565b6040516103689190611bce565b60405180910390f35b61038b60048036038101906103869190611be9565b610c6c565b6040516103989190611a43565b60405180910390f35b6103bb60048036038101906103b69190611e16565b610cd6565b6040516103c89190611b41565b60405180910390f35b6103d9610d11565b6040516103e69190611bce565b60405180910390f35b61040960048036038101906104049190611f28565b610d18565b005b61042560048036038101906104209190611be9565b61136a565b005b610441600480360381019061043c9190611fa9565b61138b565b60405161044e9190611b41565b60405180910390f35b610471600480360381019061046c9190611ca3565b6113c8565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104e657506104e58261145a565b5b9050919050565b7fe6a7817a58d7040f21b2f1158bab553c28bf2ec0575caae7aea952b07ae224d3610517816114c4565b6000821161055a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105519061208c565b60405180910390fd5b81600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105b691906120bb565b60206040518083038186803b1580156105ce57600080fd5b505afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060691906120eb565b1015610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9061218a565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016106a49291906121aa565b602060405180830381600087803b1580156106be57600080fd5b505af11580156106d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f691906121ff565b610735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072c9061229e565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8360405161077b9190611b41565b60405180910390a2505050565b60035481565b6000806000838152602001908152602001600020600101549050919050565b6107b68261078e565b6107bf816114c4565b6107c983836114d8565b505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000801b610801816114c4565b60008211610844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083b90612330565b60405180910390fd5b816004819055507f47ac0ab6dc12376fe48c03ea9f7a5f48c56562bbb05cecc54b97e4b0dd13ee1a8260405161087a9190611b41565b60405180910390a15050565b6000801b610893816114c4565b600082116108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd906123c2565b60405180910390fd5b816003819055507f3ef8c51db35e69e0b15562d5d640b846ec643aedbfd5e99e19c60f64dfb1bb7d8260405161090c9190611b41565b60405180910390a15050565b6109206115b8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490612454565b60405180910390fd5b61099782826115c0565b5050565b60055481565b7f02358c16c6ece4d564dd98c8400ef2ce02ec4ed5a3d53421ef64678a57ac510181565b60065481565b60025481565b7f02358c16c6ece4d564dd98c8400ef2ce02ec4ed5a3d53421ef64678a57ac51016109fb816114c4565b60008211610a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a35906124e6565b60405180910390fd5b81600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a9a91906120bb565b60206040518083038186803b158015610ab257600080fd5b505afa158015610ac6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aea91906120eb565b1015610b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b229061218a565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68836040518263ffffffff1660e01b8152600401610b869190611b41565b600060405180830381600087803b158015610ba057600080fd5b505af1158015610bb4573d6000803e3d6000fd5b505050507f6ef4855b666dcc7884561072e4358b28dfe01feb1b7f4dcebc00e62d50394ac782604051610be79190611b41565b60405180910390a15050565b60045481565b6000801b610c06816114c4565b816005819055507fcf71f121c1db4ec85d4e56ae3135072a3b1d0097f730127c5bb06866589bbeff82604051610c3c9190611b41565b60405180910390a15050565b7fe6a7817a58d7040f21b2f1158bab553c28bf2ec0575caae7aea952b07ae224d381565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600782805160208101820180518482526020830160208501208183528095505050505050602052806000526040600020600091509150505481565b6000801b81565b6000429050600454838390501115610d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5c9061259e565b60405180910390fd5b600060025484849050610d7891906125ed565b905060008111610dbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db4906126b9565b60405180910390fd5b80600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610e1991906120bb565b60206040518083038186803b158015610e3157600080fd5b505afa158015610e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6991906120eb565b1015610eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea19061274b565b60405180910390fd5b80600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401610f0892919061276b565b60206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5891906120eb565b1015610f99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9090612806565b60405180910390fd5b60005b8484905081101561127157600060078888604051610fbb929190612856565b90815260200160405180910390206000878785818110610fde57610fdd61286f565b5b90506020020135815260200190815260200160002054905060008114806110055750838111155b80611028575060055484611019919061289e565b811115801561102757508381115b5b611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e906129b2565b60405180910390fd5b600086868481811061107c5761107b61286f565b5b9050602002013514156110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bb90612a44565b60405180910390fd5b83811180156110e05750600554846110dc919061289e565b8111155b1561114657600354816110f3919061289e565b60078989604051611105929190612856565b908152602001604051809103902060008888868181106111285761112761286f565b5b905060200201358152602001908152602001600020819055506111a3565b60035484611154919061289e565b60078989604051611166929190612856565b908152602001604051809103902060008888868181106111895761118861286f565b5b905060200201358152602001908152602001600020819055505b8585838181106111b6576111b561286f565b5b905060200201353373ffffffffffffffffffffffffffffffffffffffff167fad93e42011f5564f683fb5c0870f97915024034f646b3c8cd70ca47399cc361c8a8a60078d8d604051611209929190612856565b908152602001604051809103902060008c8c8a81811061122c5761122b61286f565b5b905060200201358152602001908152602001600020546002546040516112559493929190612a91565b60405180910390a350808061126990612ad1565b915050610f9c565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016112d193929190612b1a565b602060405180830381600087803b1580156112eb57600080fd5b505af11580156112ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132391906121ff565b611362576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113599061229e565b60405180910390fd5b505050505050565b6113738261078e565b61137c816114c4565b61138683836115c0565b505050565b60006007848460405161139f929190612856565b908152602001604051809103902060008381526020019081526020016000205490509392505050565b6000801b6113d5816114c4565b60008211611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f90612bc3565b60405180910390fd5b816002819055507f5a781b1f296be07367f20d78cf908071eb30321de9c63e4f94c881487e96311e8260405161144e9190611b41565b60405180910390a15050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6114d5816114d06115b8565b6116a1565b50565b6114e28282610c6c565b6115b457600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506115596115b8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b6115ca8282610c6c565b1561169d57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506116426115b8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6116ab8282610c6c565b611722576116b881611726565b6116c68360001c6020611753565b6040516020016116d7929190612cea565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117199190612d5d565b60405180910390fd5b5050565b606061174c8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611753565b9050919050565b60606000600283600261176691906125ed565b611770919061289e565b67ffffffffffffffff81111561178957611788611ceb565b5b6040519080825280601f01601f1916602001820160405280156117bb5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106117f3576117f261286f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106118575761185661286f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261189791906125ed565b6118a1919061289e565b90505b6001811115611941577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106118e3576118e261286f565b5b1a60f81b8282815181106118fa576118f961286f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061193a90612d7f565b90506118a4565b5060008414611985576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197c90612df5565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6119d8816119a3565b81146119e357600080fd5b50565b6000813590506119f5816119cf565b92915050565b600060208284031215611a1157611a10611999565b5b6000611a1f848285016119e6565b91505092915050565b60008115159050919050565b611a3d81611a28565b82525050565b6000602082019050611a586000830184611a34565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a8982611a5e565b9050919050565b611a9981611a7e565b8114611aa457600080fd5b50565b600081359050611ab681611a90565b92915050565b6000819050919050565b611acf81611abc565b8114611ada57600080fd5b50565b600081359050611aec81611ac6565b92915050565b60008060408385031215611b0957611b08611999565b5b6000611b1785828601611aa7565b9250506020611b2885828601611add565b9150509250929050565b611b3b81611abc565b82525050565b6000602082019050611b566000830184611b32565b92915050565b6000819050919050565b611b6f81611b5c565b8114611b7a57600080fd5b50565b600081359050611b8c81611b66565b92915050565b600060208284031215611ba857611ba7611999565b5b6000611bb684828501611b7d565b91505092915050565b611bc881611b5c565b82525050565b6000602082019050611be36000830184611bbf565b92915050565b60008060408385031215611c0057611bff611999565b5b6000611c0e85828601611b7d565b9250506020611c1f85828601611aa7565b9150509250929050565b6000819050919050565b6000611c4e611c49611c4484611a5e565b611c29565b611a5e565b9050919050565b6000611c6082611c33565b9050919050565b6000611c7282611c55565b9050919050565b611c8281611c67565b82525050565b6000602082019050611c9d6000830184611c79565b92915050565b600060208284031215611cb957611cb8611999565b5b6000611cc784828501611add565b91505092915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611d2382611cda565b810181811067ffffffffffffffff82111715611d4257611d41611ceb565b5b80604052505050565b6000611d5561198f565b9050611d618282611d1a565b919050565b600067ffffffffffffffff821115611d8157611d80611ceb565b5b611d8a82611cda565b9050602081019050919050565b82818337600083830152505050565b6000611db9611db484611d66565b611d4b565b905082815260208101848484011115611dd557611dd4611cd5565b5b611de0848285611d97565b509392505050565b600082601f830112611dfd57611dfc611cd0565b5b8135611e0d848260208601611da6565b91505092915050565b60008060408385031215611e2d57611e2c611999565b5b600083013567ffffffffffffffff811115611e4b57611e4a61199e565b5b611e5785828601611de8565b9250506020611e6885828601611add565b9150509250929050565b600080fd5b600080fd5b60008083601f840112611e9257611e91611cd0565b5b8235905067ffffffffffffffff811115611eaf57611eae611e72565b5b602083019150836001820283011115611ecb57611eca611e77565b5b9250929050565b60008083601f840112611ee857611ee7611cd0565b5b8235905067ffffffffffffffff811115611f0557611f04611e72565b5b602083019150836020820283011115611f2157611f20611e77565b5b9250929050565b60008060008060408587031215611f4257611f41611999565b5b600085013567ffffffffffffffff811115611f6057611f5f61199e565b5b611f6c87828801611e7c565b9450945050602085013567ffffffffffffffff811115611f8f57611f8e61199e565b5b611f9b87828801611ed2565b925092505092959194509250565b600080600060408486031215611fc257611fc1611999565b5b600084013567ffffffffffffffff811115611fe057611fdf61199e565b5b611fec86828701611e7c565b93509350506020611fff86828701611add565b9150509250925092565b600082825260208201905092915050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f742077697468647260008201527f6177207a65726f20746f6b656e73000000000000000000000000000000000000602082015250565b6000612076602e83612009565b91506120818261201a565b604082019050919050565b600060208201905081810360008301526120a581612069565b9050919050565b6120b581611a7e565b82525050565b60006020820190506120d060008301846120ac565b92915050565b6000815190506120e581611ac6565b92915050565b60006020828403121561210157612100611999565b5b600061210f848285016120d6565b91505092915050565b7f436f6e6e6563746f7250757263686173653a20696e73756666696369656e742060008201527f636f6e74726163742062616c616e636500000000000000000000000000000000602082015250565b6000612174603083612009565b915061217f82612118565b604082019050919050565b600060208201905081810360008301526121a381612167565b9050919050565b60006040820190506121bf60008301856120ac565b6121cc6020830184611b32565b9392505050565b6121dc81611a28565b81146121e757600080fd5b50565b6000815190506121f9816121d3565b92915050565b60006020828403121561221557612214611999565b5b6000612223848285016121ea565b91505092915050565b7f436f6e6e6563746f7250757263686173653a20746f6b656e207472616e73666560008201527f72206661696c6564000000000000000000000000000000000000000000000000602082015250565b6000612288602883612009565b91506122938261222c565b604082019050919050565b600060208201905081810360008301526122b78161227b565b9050919050565b7f436f6e6e6563746f7250757263686173653a206d6178696d756d20636f6e6e6560008201527f63746f7273206d7573742062652067726561746572207468616e207a65726f00602082015250565b600061231a603f83612009565b9150612325826122be565b604082019050919050565b600060208201905081810360008301526123498161230d565b9050919050565b7f436f6e6e6563746f7250757263686173653a206475726174696f6e206d75737460008201527f2062652067726561746572207468616e207a65726f0000000000000000000000602082015250565b60006123ac603583612009565b91506123b782612350565b604082019050919050565b600060208201905081810360008301526123db8161239f565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061243e602f83612009565b9150612449826123e2565b604082019050919050565b6000602082019050818103600083015261246d81612431565b9050919050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f74206275726e207a60008201527f65726f20746f6b656e7300000000000000000000000000000000000000000000602082015250565b60006124d0602a83612009565b91506124db82612474565b604082019050919050565b600060208201905081810360008301526124ff816124c3565b9050919050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f742070757263686160008201527f7365206d6f7265207468616e206d6178436f6e6e6563746f727320636f6e6e6560208201527f63746f7273206174206f6e636500000000000000000000000000000000000000604082015250565b6000612588604d83612009565b915061259382612506565b606082019050919050565b600060208201905081810360008301526125b78161257b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006125f882611abc565b915061260383611abc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561263c5761263b6125be565b5b828202905092915050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f742070757263686160008201527f7365207a65726f20636f6e6e6563746f72730000000000000000000000000000602082015250565b60006126a3603283612009565b91506126ae82612647565b604082019050919050565b600060208201905081810360008301526126d281612696565b9050919050565b7f436f6e6e6563746f7250757263686173653a20696e73756666696369656e742060008201527f746f6b656e2062616c616e636500000000000000000000000000000000000000602082015250565b6000612735602d83612009565b9150612740826126d9565b604082019050919050565b6000602082019050818103600083015261276481612728565b9050919050565b600060408201905061278060008301856120ac565b61278d60208301846120ac565b9392505050565b7f436f6e6e6563746f7250757263686173653a20746f6b656e20616c6c6f77616e60008201527f636520746f6f206c6f7700000000000000000000000000000000000000000000602082015250565b60006127f0602a83612009565b91506127fb82612794565b604082019050919050565b6000602082019050818103600083015261281f816127e3565b9050919050565b600081905092915050565b600061283d8385612826565b935061284a838584611d97565b82840190509392505050565b6000612863828486612831565b91508190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006128a982611abc565b91506128b483611abc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128e9576128e86125be565b5b828201905092915050565b7f436f6e6e6563746f7250757263686173653a20757365722063616e6e6f74207260008201527f657075726368617365206120636f6e6e6563746f72207468617420686173206e60208201527f6f74207965742065787069726564206f72206973206f757473696465206f662060408201527f74686520726570757263686173652077696e646f770000000000000000000000606082015250565b600061299c607583612009565b91506129a7826128f4565b608082019050919050565b600060208201905081810360008301526129cb8161298f565b9050919050565b7f436f6e6e6563746f7250757263686173653a20757365722063616e6e6f74207060008201527f7572636861736520636f6e6e6563746f72204944203000000000000000000000602082015250565b6000612a2e603683612009565b9150612a39826129d2565b604082019050919050565b60006020820190508181036000830152612a5d81612a21565b9050919050565b6000612a708385612009565b9350612a7d838584611d97565b612a8683611cda565b840190509392505050565b60006060820190508181036000830152612aac818688612a64565b9050612abb6020830185611b32565b612ac86040830184611b32565b95945050505050565b6000612adc82611abc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612b0f57612b0e6125be565b5b600182019050919050565b6000606082019050612b2f60008301866120ac565b612b3c60208301856120ac565b612b496040830184611b32565b949350505050565b7f436f6e6e6563746f7250757263686173653a207072696365206d75737420626560008201527f2067726561746572207468616e207a65726f0000000000000000000000000000602082015250565b6000612bad603283612009565b9150612bb882612b51565b604082019050919050565b60006020820190508181036000830152612bdc81612ba0565b9050919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612c19601783612826565b9150612c2482612be3565b601782019050919050565b600081519050919050565b60005b83811015612c58578082015181840152602081019050612c3d565b83811115612c67576000848401525b50505050565b6000612c7882612c2f565b612c828185612826565b9350612c92818560208601612c3a565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612cd4601183612826565b9150612cdf82612c9e565b601182019050919050565b6000612cf582612c0c565b9150612d018285612c6d565b9150612d0c82612cc7565b9150612d188284612c6d565b91508190509392505050565b6000612d2f82612c2f565b612d398185612009565b9350612d49818560208601612c3a565b612d5281611cda565b840191505092915050565b60006020820190508181036000830152612d778184612d24565b905092915050565b6000612d8a82611abc565b91506000821415612d9e57612d9d6125be565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000612ddf602083612009565b9150612dea82612da9565b602082019050919050565b60006020820190508181036000830152612e0e81612dd2565b905091905056fea2646970667358221220f3f159431534adda03f09f8146f90125b1313c7ef5a326f20c3a320c9ee0c1e264736f6c634300080900330000000000000000000000004ee438be38f8682abb089f2bfea48851c5e71eaf00000000000000000000000000000000000000000000005150ae84a8cdf000000000000000000000000000000000000000000000000000000000000001e133800000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063634396cd116100c35780639c3acb511161007c5780639c3acb51146103a1578063a217fddf146103d1578063b486fa57146103ef578063d547741f1461040b578063d5bbb4fc14610427578063e536e2d91461045757610158565b8063634396cd146102df5780636d1b229d146102fd57806370f44186146103195780637c32a52b146103375780638d30177d1461035357806391d148541461037157610158565b806331c125ce1161011557806331c125ce146102315780633334944a1461024d57806336568abe14610269578063483084981461028557806353e26d9e146102a357806354fd4d50146102c157610158565b806301ffc9a71461015d57806306b091f91461018d57806310be3ee9146101a9578063248a9ca3146101c75780632f2ff15d146101f75780633013ce2914610213575b600080fd5b610177600480360381019061017291906119fb565b610473565b6040516101849190611a43565b60405180910390f35b6101a760048036038101906101a29190611af2565b6104ed565b005b6101b1610788565b6040516101be9190611b41565b60405180910390f35b6101e160048036038101906101dc9190611b92565b61078e565b6040516101ee9190611bce565b60405180910390f35b610211600480360381019061020c9190611be9565b6107ad565b005b61021b6107ce565b6040516102289190611c88565b60405180910390f35b61024b60048036038101906102469190611ca3565b6107f4565b005b61026760048036038101906102629190611ca3565b610886565b005b610283600480360381019061027e9190611be9565b610918565b005b61028d61099b565b60405161029a9190611b41565b60405180910390f35b6102ab6109a1565b6040516102b89190611bce565b60405180910390f35b6102c96109c5565b6040516102d69190611b41565b60405180910390f35b6102e76109cb565b6040516102f49190611b41565b60405180910390f35b61031760048036038101906103129190611ca3565b6109d1565b005b610321610bf3565b60405161032e9190611b41565b60405180910390f35b610351600480360381019061034c9190611ca3565b610bf9565b005b61035b610c48565b6040516103689190611bce565b60405180910390f35b61038b60048036038101906103869190611be9565b610c6c565b6040516103989190611a43565b60405180910390f35b6103bb60048036038101906103b69190611e16565b610cd6565b6040516103c89190611b41565b60405180910390f35b6103d9610d11565b6040516103e69190611bce565b60405180910390f35b61040960048036038101906104049190611f28565b610d18565b005b61042560048036038101906104209190611be9565b61136a565b005b610441600480360381019061043c9190611fa9565b61138b565b60405161044e9190611b41565b60405180910390f35b610471600480360381019061046c9190611ca3565b6113c8565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104e657506104e58261145a565b5b9050919050565b7fe6a7817a58d7040f21b2f1158bab553c28bf2ec0575caae7aea952b07ae224d3610517816114c4565b6000821161055a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105519061208c565b60405180910390fd5b81600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105b691906120bb565b60206040518083038186803b1580156105ce57600080fd5b505afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060691906120eb565b1015610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9061218a565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016106a49291906121aa565b602060405180830381600087803b1580156106be57600080fd5b505af11580156106d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f691906121ff565b610735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072c9061229e565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8360405161077b9190611b41565b60405180910390a2505050565b60035481565b6000806000838152602001908152602001600020600101549050919050565b6107b68261078e565b6107bf816114c4565b6107c983836114d8565b505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000801b610801816114c4565b60008211610844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083b90612330565b60405180910390fd5b816004819055507f47ac0ab6dc12376fe48c03ea9f7a5f48c56562bbb05cecc54b97e4b0dd13ee1a8260405161087a9190611b41565b60405180910390a15050565b6000801b610893816114c4565b600082116108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd906123c2565b60405180910390fd5b816003819055507f3ef8c51db35e69e0b15562d5d640b846ec643aedbfd5e99e19c60f64dfb1bb7d8260405161090c9190611b41565b60405180910390a15050565b6109206115b8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490612454565b60405180910390fd5b61099782826115c0565b5050565b60055481565b7f02358c16c6ece4d564dd98c8400ef2ce02ec4ed5a3d53421ef64678a57ac510181565b60065481565b60025481565b7f02358c16c6ece4d564dd98c8400ef2ce02ec4ed5a3d53421ef64678a57ac51016109fb816114c4565b60008211610a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a35906124e6565b60405180910390fd5b81600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a9a91906120bb565b60206040518083038186803b158015610ab257600080fd5b505afa158015610ac6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aea91906120eb565b1015610b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b229061218a565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68836040518263ffffffff1660e01b8152600401610b869190611b41565b600060405180830381600087803b158015610ba057600080fd5b505af1158015610bb4573d6000803e3d6000fd5b505050507f6ef4855b666dcc7884561072e4358b28dfe01feb1b7f4dcebc00e62d50394ac782604051610be79190611b41565b60405180910390a15050565b60045481565b6000801b610c06816114c4565b816005819055507fcf71f121c1db4ec85d4e56ae3135072a3b1d0097f730127c5bb06866589bbeff82604051610c3c9190611b41565b60405180910390a15050565b7fe6a7817a58d7040f21b2f1158bab553c28bf2ec0575caae7aea952b07ae224d381565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600782805160208101820180518482526020830160208501208183528095505050505050602052806000526040600020600091509150505481565b6000801b81565b6000429050600454838390501115610d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5c9061259e565b60405180910390fd5b600060025484849050610d7891906125ed565b905060008111610dbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db4906126b9565b60405180910390fd5b80600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610e1991906120bb565b60206040518083038186803b158015610e3157600080fd5b505afa158015610e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6991906120eb565b1015610eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea19061274b565b60405180910390fd5b80600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401610f0892919061276b565b60206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5891906120eb565b1015610f99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9090612806565b60405180910390fd5b60005b8484905081101561127157600060078888604051610fbb929190612856565b90815260200160405180910390206000878785818110610fde57610fdd61286f565b5b90506020020135815260200190815260200160002054905060008114806110055750838111155b80611028575060055484611019919061289e565b811115801561102757508381115b5b611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e906129b2565b60405180910390fd5b600086868481811061107c5761107b61286f565b5b9050602002013514156110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bb90612a44565b60405180910390fd5b83811180156110e05750600554846110dc919061289e565b8111155b1561114657600354816110f3919061289e565b60078989604051611105929190612856565b908152602001604051809103902060008888868181106111285761112761286f565b5b905060200201358152602001908152602001600020819055506111a3565b60035484611154919061289e565b60078989604051611166929190612856565b908152602001604051809103902060008888868181106111895761118861286f565b5b905060200201358152602001908152602001600020819055505b8585838181106111b6576111b561286f565b5b905060200201353373ffffffffffffffffffffffffffffffffffffffff167fad93e42011f5564f683fb5c0870f97915024034f646b3c8cd70ca47399cc361c8a8a60078d8d604051611209929190612856565b908152602001604051809103902060008c8c8a81811061122c5761122b61286f565b5b905060200201358152602001908152602001600020546002546040516112559493929190612a91565b60405180910390a350808061126990612ad1565b915050610f9c565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016112d193929190612b1a565b602060405180830381600087803b1580156112eb57600080fd5b505af11580156112ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132391906121ff565b611362576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113599061229e565b60405180910390fd5b505050505050565b6113738261078e565b61137c816114c4565b61138683836115c0565b505050565b60006007848460405161139f929190612856565b908152602001604051809103902060008381526020019081526020016000205490509392505050565b6000801b6113d5816114c4565b60008211611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f90612bc3565b60405180910390fd5b816002819055507f5a781b1f296be07367f20d78cf908071eb30321de9c63e4f94c881487e96311e8260405161144e9190611b41565b60405180910390a15050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6114d5816114d06115b8565b6116a1565b50565b6114e28282610c6c565b6115b457600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506115596115b8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b6115ca8282610c6c565b1561169d57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506116426115b8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6116ab8282610c6c565b611722576116b881611726565b6116c68360001c6020611753565b6040516020016116d7929190612cea565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117199190612d5d565b60405180910390fd5b5050565b606061174c8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611753565b9050919050565b60606000600283600261176691906125ed565b611770919061289e565b67ffffffffffffffff81111561178957611788611ceb565b5b6040519080825280601f01601f1916602001820160405280156117bb5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106117f3576117f261286f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106118575761185661286f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261189791906125ed565b6118a1919061289e565b90505b6001811115611941577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106118e3576118e261286f565b5b1a60f81b8282815181106118fa576118f961286f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061193a90612d7f565b90506118a4565b5060008414611985576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197c90612df5565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6119d8816119a3565b81146119e357600080fd5b50565b6000813590506119f5816119cf565b92915050565b600060208284031215611a1157611a10611999565b5b6000611a1f848285016119e6565b91505092915050565b60008115159050919050565b611a3d81611a28565b82525050565b6000602082019050611a586000830184611a34565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a8982611a5e565b9050919050565b611a9981611a7e565b8114611aa457600080fd5b50565b600081359050611ab681611a90565b92915050565b6000819050919050565b611acf81611abc565b8114611ada57600080fd5b50565b600081359050611aec81611ac6565b92915050565b60008060408385031215611b0957611b08611999565b5b6000611b1785828601611aa7565b9250506020611b2885828601611add565b9150509250929050565b611b3b81611abc565b82525050565b6000602082019050611b566000830184611b32565b92915050565b6000819050919050565b611b6f81611b5c565b8114611b7a57600080fd5b50565b600081359050611b8c81611b66565b92915050565b600060208284031215611ba857611ba7611999565b5b6000611bb684828501611b7d565b91505092915050565b611bc881611b5c565b82525050565b6000602082019050611be36000830184611bbf565b92915050565b60008060408385031215611c0057611bff611999565b5b6000611c0e85828601611b7d565b9250506020611c1f85828601611aa7565b9150509250929050565b6000819050919050565b6000611c4e611c49611c4484611a5e565b611c29565b611a5e565b9050919050565b6000611c6082611c33565b9050919050565b6000611c7282611c55565b9050919050565b611c8281611c67565b82525050565b6000602082019050611c9d6000830184611c79565b92915050565b600060208284031215611cb957611cb8611999565b5b6000611cc784828501611add565b91505092915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611d2382611cda565b810181811067ffffffffffffffff82111715611d4257611d41611ceb565b5b80604052505050565b6000611d5561198f565b9050611d618282611d1a565b919050565b600067ffffffffffffffff821115611d8157611d80611ceb565b5b611d8a82611cda565b9050602081019050919050565b82818337600083830152505050565b6000611db9611db484611d66565b611d4b565b905082815260208101848484011115611dd557611dd4611cd5565b5b611de0848285611d97565b509392505050565b600082601f830112611dfd57611dfc611cd0565b5b8135611e0d848260208601611da6565b91505092915050565b60008060408385031215611e2d57611e2c611999565b5b600083013567ffffffffffffffff811115611e4b57611e4a61199e565b5b611e5785828601611de8565b9250506020611e6885828601611add565b9150509250929050565b600080fd5b600080fd5b60008083601f840112611e9257611e91611cd0565b5b8235905067ffffffffffffffff811115611eaf57611eae611e72565b5b602083019150836001820283011115611ecb57611eca611e77565b5b9250929050565b60008083601f840112611ee857611ee7611cd0565b5b8235905067ffffffffffffffff811115611f0557611f04611e72565b5b602083019150836020820283011115611f2157611f20611e77565b5b9250929050565b60008060008060408587031215611f4257611f41611999565b5b600085013567ffffffffffffffff811115611f6057611f5f61199e565b5b611f6c87828801611e7c565b9450945050602085013567ffffffffffffffff811115611f8f57611f8e61199e565b5b611f9b87828801611ed2565b925092505092959194509250565b600080600060408486031215611fc257611fc1611999565b5b600084013567ffffffffffffffff811115611fe057611fdf61199e565b5b611fec86828701611e7c565b93509350506020611fff86828701611add565b9150509250925092565b600082825260208201905092915050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f742077697468647260008201527f6177207a65726f20746f6b656e73000000000000000000000000000000000000602082015250565b6000612076602e83612009565b91506120818261201a565b604082019050919050565b600060208201905081810360008301526120a581612069565b9050919050565b6120b581611a7e565b82525050565b60006020820190506120d060008301846120ac565b92915050565b6000815190506120e581611ac6565b92915050565b60006020828403121561210157612100611999565b5b600061210f848285016120d6565b91505092915050565b7f436f6e6e6563746f7250757263686173653a20696e73756666696369656e742060008201527f636f6e74726163742062616c616e636500000000000000000000000000000000602082015250565b6000612174603083612009565b915061217f82612118565b604082019050919050565b600060208201905081810360008301526121a381612167565b9050919050565b60006040820190506121bf60008301856120ac565b6121cc6020830184611b32565b9392505050565b6121dc81611a28565b81146121e757600080fd5b50565b6000815190506121f9816121d3565b92915050565b60006020828403121561221557612214611999565b5b6000612223848285016121ea565b91505092915050565b7f436f6e6e6563746f7250757263686173653a20746f6b656e207472616e73666560008201527f72206661696c6564000000000000000000000000000000000000000000000000602082015250565b6000612288602883612009565b91506122938261222c565b604082019050919050565b600060208201905081810360008301526122b78161227b565b9050919050565b7f436f6e6e6563746f7250757263686173653a206d6178696d756d20636f6e6e6560008201527f63746f7273206d7573742062652067726561746572207468616e207a65726f00602082015250565b600061231a603f83612009565b9150612325826122be565b604082019050919050565b600060208201905081810360008301526123498161230d565b9050919050565b7f436f6e6e6563746f7250757263686173653a206475726174696f6e206d75737460008201527f2062652067726561746572207468616e207a65726f0000000000000000000000602082015250565b60006123ac603583612009565b91506123b782612350565b604082019050919050565b600060208201905081810360008301526123db8161239f565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061243e602f83612009565b9150612449826123e2565b604082019050919050565b6000602082019050818103600083015261246d81612431565b9050919050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f74206275726e207a60008201527f65726f20746f6b656e7300000000000000000000000000000000000000000000602082015250565b60006124d0602a83612009565b91506124db82612474565b604082019050919050565b600060208201905081810360008301526124ff816124c3565b9050919050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f742070757263686160008201527f7365206d6f7265207468616e206d6178436f6e6e6563746f727320636f6e6e6560208201527f63746f7273206174206f6e636500000000000000000000000000000000000000604082015250565b6000612588604d83612009565b915061259382612506565b606082019050919050565b600060208201905081810360008301526125b78161257b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006125f882611abc565b915061260383611abc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561263c5761263b6125be565b5b828202905092915050565b7f436f6e6e6563746f7250757263686173653a2063616e6e6f742070757263686160008201527f7365207a65726f20636f6e6e6563746f72730000000000000000000000000000602082015250565b60006126a3603283612009565b91506126ae82612647565b604082019050919050565b600060208201905081810360008301526126d281612696565b9050919050565b7f436f6e6e6563746f7250757263686173653a20696e73756666696369656e742060008201527f746f6b656e2062616c616e636500000000000000000000000000000000000000602082015250565b6000612735602d83612009565b9150612740826126d9565b604082019050919050565b6000602082019050818103600083015261276481612728565b9050919050565b600060408201905061278060008301856120ac565b61278d60208301846120ac565b9392505050565b7f436f6e6e6563746f7250757263686173653a20746f6b656e20616c6c6f77616e60008201527f636520746f6f206c6f7700000000000000000000000000000000000000000000602082015250565b60006127f0602a83612009565b91506127fb82612794565b604082019050919050565b6000602082019050818103600083015261281f816127e3565b9050919050565b600081905092915050565b600061283d8385612826565b935061284a838584611d97565b82840190509392505050565b6000612863828486612831565b91508190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006128a982611abc565b91506128b483611abc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128e9576128e86125be565b5b828201905092915050565b7f436f6e6e6563746f7250757263686173653a20757365722063616e6e6f74207260008201527f657075726368617365206120636f6e6e6563746f72207468617420686173206e60208201527f6f74207965742065787069726564206f72206973206f757473696465206f662060408201527f74686520726570757263686173652077696e646f770000000000000000000000606082015250565b600061299c607583612009565b91506129a7826128f4565b608082019050919050565b600060208201905081810360008301526129cb8161298f565b9050919050565b7f436f6e6e6563746f7250757263686173653a20757365722063616e6e6f74207060008201527f7572636861736520636f6e6e6563746f72204944203000000000000000000000602082015250565b6000612a2e603683612009565b9150612a39826129d2565b604082019050919050565b60006020820190508181036000830152612a5d81612a21565b9050919050565b6000612a708385612009565b9350612a7d838584611d97565b612a8683611cda565b840190509392505050565b60006060820190508181036000830152612aac818688612a64565b9050612abb6020830185611b32565b612ac86040830184611b32565b95945050505050565b6000612adc82611abc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612b0f57612b0e6125be565b5b600182019050919050565b6000606082019050612b2f60008301866120ac565b612b3c60208301856120ac565b612b496040830184611b32565b949350505050565b7f436f6e6e6563746f7250757263686173653a207072696365206d75737420626560008201527f2067726561746572207468616e207a65726f0000000000000000000000000000602082015250565b6000612bad603283612009565b9150612bb882612b51565b604082019050919050565b60006020820190508181036000830152612bdc81612ba0565b9050919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612c19601783612826565b9150612c2482612be3565b601782019050919050565b600081519050919050565b60005b83811015612c58578082015181840152602081019050612c3d565b83811115612c67576000848401525b50505050565b6000612c7882612c2f565b612c828185612826565b9350612c92818560208601612c3a565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612cd4601183612826565b9150612cdf82612c9e565b601182019050919050565b6000612cf582612c0c565b9150612d018285612c6d565b9150612d0c82612cc7565b9150612d188284612c6d565b91508190509392505050565b6000612d2f82612c2f565b612d398185612009565b9350612d49818560208601612c3a565b612d5281611cda565b840191505092915050565b60006020820190508181036000830152612d778184612d24565b905092915050565b6000612d8a82611abc565b91506000821415612d9e57612d9d6125be565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000612ddf602083612009565b9150612dea82612da9565b602082019050919050565b60006020820190508181036000830152612e0e81612dd2565b905091905056fea2646970667358221220f3f159431534adda03f09f8146f90125b1313c7ef5a326f20c3a320c9ee0c1e264736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004ee438be38f8682abb089f2bfea48851c5e71eaf00000000000000000000000000000000000000000000005150ae84a8cdf000000000000000000000000000000000000000000000000000000000000001e133800000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _paymentToken (address): 0x4eE438be38F8682ABB089F2BFeA48851C5E71EAF
Arg [1] : _connectorPrice (uint256): 1500000000000000000000
Arg [2] : _connectorDuration (uint256): 31536000
Arg [3] : _repurchaseWindow (uint256): 0
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000004ee438be38f8682abb089f2bfea48851c5e71eaf
Arg [1] : 00000000000000000000000000000000000000000000005150ae84a8cdf00000
Arg [2] : 0000000000000000000000000000000000000000000000000000000001e13380
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.000724 | 3,000 | $2.17 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.