Address Details
contract
0x8D6A8637a66B4524495DBEC4C5C0a8Ef80d5E0Bc
- Contract Name
- PriceFeed
- Creator
- 0x007e71–f37016 at 0xc8a9c2–c6aab6
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 55 Transactions
- Transfers
- 0 Transfers
- Gas Used
- 8,954,435
- Last Balance Update
- 14460526
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- PriceFeed
- Optimization enabled
- false
- Compiler version
- v0.8.14+commit.80d49f37
- EVM Version
- london
- Verified at
- 2023-02-19T04:35:37.788682Z
contracts/core/PriceFeed.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; import "./PriceAwareOwnable.sol"; import "../interfaces/IPriceFeed.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; /// @notice Dynamic error for price getters /// @dev Emitted when got old price data error OldPriceData(bytes32 symbol); /// @title RedStone Oracle Price Feed contract /// @author Moola Markets /// @notice Utility contract to store current prices from RedStone API /// @custom:contract IPriceFeed Common interface /// @custom:contract PriceAwareOwnable RedStone EVM Connector implementation with changable signer contract PriceFeed is PriceAwareOwnable, AccessControl, IPriceFeed { bytes32 public constant SIGNER_ROLE = bytes32("SIGNER_ROLE"); /// @notice Price list for each authorized token mapping(bytes32 => uint256) private _prices; mapping(bytes32 => uint256) public lastPriceUpdate; /// @notice Event emmited after the price being updated for exact asset /// @param symbol Hash-symbol of asset /// @param previous Previous price /// @param current Current price event PriceUpdated( bytes32 symbol, uint256 previous, uint256 current, uint256 timestamp ); constructor() { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @notice Get price form oracle and update it on feed /// @param _symbol Hash-symbol of authorized asset function setPrice(bytes32 _symbol) public onlyRole(SIGNER_ROLE) { uint256 previous = _prices[_symbol]; (uint256 current, uint256 timestamp) = getPriceFromMsg(_symbol); _prices[_symbol] = current; lastPriceUpdate[_symbol] = timestamp; emit PriceUpdated(_symbol, previous, current, timestamp); } /// @notice Get prices form oracle and update them on feed /// @param data contains calldata for multiple price set function setPriceExt(bytes[] memory data) external onlyRole(SIGNER_ROLE) returns (bool status) { for (uint256 i = 0; i < data.length; i++) { (bool success, ) = address(this).call(data[i]); status = success && status; } } function getRedstoneData(bytes32 symbol) external pure returns (bytes memory) { return abi.encodePacked(this.setPrice.selector, msg.data[4:]); } /// @notice Get price from feed in USD /// @param _symbol Hash-symbol of authorized address /// @return Price of asset in USD function getPrice(bytes32 _symbol) external view returns (uint256) { return _prices[_symbol]; } }
/_openzeppelin/contracts/access/AccessControl.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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(uint160(account), 20), " 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()); } } }
/_openzeppelin/contracts/access/IAccessControl.sol
// 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; }
/_openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
/_openzeppelin/contracts/utils/Context.sol
// 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; } }
/_openzeppelin/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_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) { // 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); } /** * @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); } }
/_openzeppelin/contracts/utils/cryptography/ECDSA.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
/_openzeppelin/contracts/utils/introspection/ERC165.sol
// 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; } }
/_openzeppelin/contracts/utils/introspection/IERC165.sol
// 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); }
/contracts/core/PriceAware.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; abstract contract PriceAware { using ECDSA for bytes32; uint256 constant _MAX_DATA_TIMESTAMP_DELAY = 3 * 60; // 3 minute uint256 constant _MAX_BLOCK_TIMESTAMP_DELAY = 15; // 15 seconds /* ========== VIRTUAL FUNCTIONS (MAY BE OVERRIDEN IN CHILD CONTRACTS) ========== */ function getMaxDataTimestampDelay() public view virtual returns (uint256) { return _MAX_DATA_TIMESTAMP_DELAY; } function getMaxBlockTimestampDelay() public view virtual returns (uint256) { return _MAX_BLOCK_TIMESTAMP_DELAY; } function isSignerAuthorized(address _receviedSigner) public view virtual returns (bool); function isTimestampValid(uint256 _receivedTimestamp) public view virtual returns (bool) { // Getting data timestamp from future seems quite unlikely // But we've already spent too much time with different cases // Where block.timestamp was less than dataPackage.timestamp. // Some blockchains may case this problem as well. // That's why we add MAX_BLOCK_TIMESTAMP_DELAY // and allow data "from future" but with a small delay require( (block.timestamp + getMaxBlockTimestampDelay()) > _receivedTimestamp, "Data with future timestamps is not allowed" ); return block.timestamp < _receivedTimestamp || block.timestamp - _receivedTimestamp < getMaxDataTimestampDelay(); } /* ========== FUNCTIONS WITH IMPLEMENTATION (CAN NOT BE OVERRIDEN) ========== */ function getPriceFromMsg(bytes32 symbol) internal view returns (uint256, uint256) { bytes32[] memory symbols = new bytes32[](1); symbols[0] = symbol; (uint256[] memory price, uint256 timestamp) = getPricesFromMsg(symbols); return (price[0], timestamp); } function getPricesFromMsg(bytes32[] memory symbols) internal view returns (uint256[] memory, uint256) { // The structure of calldata witn n - data items: // The data that is signed (symbols, values, timestamp) are inside the {} brackets // [origina_call_data| ?]{[[symbol | 32][value | 32] | n times][timestamp | 32]}[size | 1][signature | 65] // 1. First we extract dataSize - the number of data items (symbol,value pairs) in the message uint8 dataSize; //Number of data entries assembly { // Calldataload loads slots of 32 bytes // The last 65 bytes are for signature // We load the previous 32 bytes and automatically take the 2 least significant ones (casting to uint16) dataSize := calldataload(sub(calldatasize(), 97)) } // 2. We calculate the size of signable message expressed in bytes // ((symbolLen(32) + valueLen(32)) * dataSize + timeStamp length uint16 messageLength = uint16(dataSize) * 64 + 32; //Length of data message in bytes // 3. We extract the signableMessage // (That's the high level equivalent 2k gas more expensive) // bytes memory rawData = msg.data.slice(msg.data.length - messageLength - 65, messageLength); bytes memory signableMessage; assembly { signableMessage := mload(0x40) mstore(signableMessage, messageLength) // The starting point is callDataSize minus length of data(messageLength), signature(65) and size(1) = 66 calldatacopy( add(signableMessage, 0x20), sub(calldatasize(), add(messageLength, 66)), messageLength ) mstore(0x40, add(signableMessage, 0x20)) } // 4. We first hash the raw message and then hash it again with the prefix // Following the https://github.com/ethereum/eips/issues/191 standard bytes32 hash = keccak256(signableMessage); bytes32 hashWithPrefix = keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", hash) ); // 5. We extract the off-chain signature from calldata // (That's the high level equivalent 2k gas more expensive) // bytes memory signature = msg.data.slice(msg.data.length - 65, 65); bytes memory signature; assembly { signature := mload(0x40) mstore(signature, 65) calldatacopy(add(signature, 0x20), sub(calldatasize(), 65), 65) mstore(0x40, add(signature, 0x20)) } // 6. We verify the off-chain signature against on-chain hashed data address signer = hashWithPrefix.recover(signature); require(isSignerAuthorized(signer), "Signer not authorized"); // 7. We extract timestamp from callData uint256 dataTimestamp; assembly { // Calldataload loads slots of 32 bytes // The last 65 bytes are for signature + 1 for data size // We load the previous 32 bytes dataTimestamp := calldataload(sub(calldatasize(), 98)) } // 8. We validate timestamp require(isTimestampValid(dataTimestamp), "Data timestamp is invalid"); return ( _readFromCallData(symbols, uint256(dataSize), messageLength), dataTimestamp ); } function _readFromCallData( bytes32[] memory symbols, uint256 dataSize, uint16 messageLength ) private pure returns (uint256[] memory) { uint256[] memory values; uint256 i; uint256 j; uint256 readyAssets; bytes32 currentSymbol; // We iterate directly through call data to extract the values for symbols assembly { let start := sub(calldatasize(), add(messageLength, 66)) values := msize() mstore(values, mload(symbols)) mstore(0x40, add(add(values, 0x20), mul(mload(symbols), 0x20))) for { i := 0 } lt(i, dataSize) { i := add(i, 1) } { currentSymbol := calldataload(add(start, mul(i, 64))) for { j := 0 } lt(j, mload(symbols)) { j := add(j, 1) } { if eq(mload(add(add(symbols, 32), mul(j, 32))), currentSymbol) { mstore( add(add(values, 32), mul(j, 32)), calldataload(add(add(start, mul(i, 64)), 32)) ) readyAssets := add(readyAssets, 1) } if eq(readyAssets, mload(symbols)) { i := dataSize } } } } return (values); } }
/contracts/core/PriceAwareOwnable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "./PriceAware.sol"; contract PriceAwareOwnable is PriceAware, Ownable { address private trustedSigner; function authorizeSigner(address _trustedSigner) external onlyOwner { require(_trustedSigner != address(0)); trustedSigner = _trustedSigner; emit TrustedSignerChanged(trustedSigner); } function isSignerAuthorized(address _receviedSigner) public view virtual override returns (bool) { return _receviedSigner == trustedSigner; } /* ========== EVENTS ========== */ /** * @dev emitted after the owner updates trusted signer * @param newSigner the address of the new signer **/ event TrustedSignerChanged(address indexed newSigner); }
/contracts/interfaces/IPriceFeed.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.14; interface IPriceFeed { function getPrice(bytes32 symbol) external view returns (uint256); function lastPriceUpdate(bytes32 symbol) external view returns (uint256); }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"PriceUpdated","inputs":[{"type":"bytes32","name":"symbol","internalType":"bytes32","indexed":false},{"type":"uint256","name":"previous","internalType":"uint256","indexed":false},{"type":"uint256","name":"current","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TrustedSignerChanged","inputs":[{"type":"address","name":"newSigner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"SIGNER_ROLE","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"authorizeSigner","inputs":[{"type":"address","name":"_trustedSigner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMaxBlockTimestampDelay","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMaxDataTimestampDelay","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPrice","inputs":[{"type":"bytes32","name":"_symbol","internalType":"bytes32"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"getRedstoneData","inputs":[{"type":"bytes32","name":"symbol","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isSignerAuthorized","inputs":[{"type":"address","name":"_receviedSigner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isTimestampValid","inputs":[{"type":"uint256","name":"_receivedTimestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastPriceUpdate","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPrice","inputs":[{"type":"bytes32","name":"_symbol","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"status","internalType":"bool"}],"name":"setPriceExt","inputs":[{"type":"bytes[]","name":"data","internalType":"bytes[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x60806040523480156200001157600080fd5b5062000032620000266200005c60201b60201c565b6200006460201b60201c565b620000566000801b6200004a6200005c60201b60201c565b6200012860201b60201c565b6200029b565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6200013a82826200013e60201b60201c565b5050565b6200015082826200023060201b60201c565b6200022c5760016002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620001d16200005c60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61299f80620002ab6000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063bfe51c101161007c578063bfe51c1014610362578063d547741f1461037e578063ee974af01461039a578063f2fde38b146103ca578063f31a210a146103e6578063fb512cb31461040457610137565b80638da5cb5b146102a857806391d14854146102c65780639449ab63146102f6578063a1ebf35d14610326578063a217fddf1461034457610137565b806331d98b3f116100ff57806331d98b3f1461020457806336568abe146102345780635118af5a14610250578063715018a61461026e578063750582051461027857610137565b806301ffc9a71461013c57806311c89b101461016c578063248a9ca31461019c578063285da53b146101cc5780632f2ff15d146101e8575b600080fd5b6101566004803603810190610151919061184c565b610434565b6040516101639190611894565b60405180910390f35b6101866004803603810190610181919061190d565b6104ae565b6040516101939190611894565b60405180910390f35b6101b660048036038101906101b19190611970565b610508565b6040516101c391906119ac565b60405180910390f35b6101e660048036038101906101e19190611970565b610528565b005b61020260048036038101906101fd91906119c7565b6105ee565b005b61021e60048036038101906102199190611970565b61060f565b60405161022b9190611a20565b60405180910390f35b61024e600480360381019061024991906119c7565b61062c565b005b6102586106af565b6040516102659190611a20565b60405180910390f35b6102766106b8565b005b610292600480360381019061028d9190611a67565b6106cc565b60405161029f9190611894565b60405180910390f35b6102b0610748565b6040516102bd9190611aa3565b60405180910390f35b6102e060048036038101906102db91906119c7565b610771565b6040516102ed9190611894565b60405180910390f35b610310600480360381019061030b9190611970565b6107dc565b60405161031d9190611b57565b60405180910390f35b61032e610822565b60405161033b91906119ac565b60405180910390f35b61034c610846565b60405161035991906119ac565b60405180910390f35b61037c6004803603810190610377919061190d565b61084d565b005b610398600480360381019061039391906119c7565b610937565b005b6103b460048036038101906103af9190611d94565b610958565b6040516103c19190611894565b60405180910390f35b6103e460048036038101906103df919061190d565b610a3e565b005b6103ee610ac1565b6040516103fb9190611a20565b60405180910390f35b61041e60048036038101906104199190611970565b610aca565b60405161042b9190611a20565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104a757506104a682610ae2565b5b9050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b600060026000838152602001908152602001600020600101549050919050565b7f5349474e45525f524f4c4500000000000000000000000000000000000000000061055281610b4c565b60006003600084815260200190815260200160002054905060008061057685610b60565b915091508160036000878152602001908152602001600020819055508060046000878152602001908152602001600020819055507f1c278fa9790ee5cfae7607a35202b57ef06960df9fe79baca5d617e2db126d6f858484846040516105df9493929190611ddd565b60405180910390a15050505050565b6105f782610508565b61060081610b4c565b61060a8383610c0b565b505050565b600060036000838152602001908152602001600020549050919050565b610634610cec565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146106a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069890611ea5565b60405180910390fd5b6106ab8282610cf4565b5050565b6000600f905090565b6106c0610dd6565b6106ca6000610e54565b565b6000816106d76106af565b426106e29190611ef4565b11610722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071990611fbc565b60405180910390fd5b814210806107415750610733610ac1565b824261073f9190611fdc565b105b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606063285da53b60e01b60003660049080926107fa9392919061201a565b60405160200161080c939291906120a6565b6040516020818303038152906040529050919050565b7f5349474e45525f524f4c4500000000000000000000000000000000000000000081565b6000801b81565b610855610dd6565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361088e57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ffc34663d6e481c3ed985715061d3e369aa003416efd09293880e20cf2e8f53b560405160405180910390a250565b61094082610508565b61094981610b4c565b6109538383610cf4565b505050565b60007f5349474e45525f524f4c4500000000000000000000000000000000000000000061098481610b4c565b60005b8351811015610a375760003073ffffffffffffffffffffffffffffffffffffffff168583815181106109bc576109bb6120d0565b5b60200260200101516040516109d19190612130565b6000604051808303816000865af19150503d8060008114610a0e576040519150601f19603f3d011682016040523d82523d6000602084013e610a13565b606091505b50509050808015610a215750835b9350508080610a2f90612147565b915050610987565b5050919050565b610a46610dd6565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ab5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aac90612201565b60405180910390fd5b610abe81610e54565b50565b600060b4905090565b60046020528060005260406000206000915090505481565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b610b5d81610b58610cec565b610f18565b50565b6000806000600167ffffffffffffffff811115610b8057610b7f611b7e565b5b604051908082528060200260200182016040528015610bae5781602001602082028036833780820191505090505b5090508381600081518110610bc657610bc56120d0565b5b602002602001018181525050600080610bde83610fb5565b9150915081600081518110610bf657610bf56120d0565b5b60200260200101518194509450505050915091565b610c158282610771565b610ce85760016002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610c8d610cec565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b610cfe8282610771565b15610dd25760006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d77610cec565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b610dde610cec565b73ffffffffffffffffffffffffffffffffffffffff16610dfc610748565b73ffffffffffffffffffffffffffffffffffffffff1614610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e499061226d565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b610f228282610771565b610fb157610f478173ffffffffffffffffffffffffffffffffffffffff166014611121565b610f558360001c6020611121565b604051602001610f6692919061236c565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa891906123df565b60405180910390fd5b5050565b6060600080606136033590506000602060408360ff16610fd5919061240f565b610fdf919061244b565b9050606060405190508181528160428301360360208301376020810160405260008180519060200120905060008160405160200161101d91906124f0565b604051602081830303815290604052805190602001209050606060405190506041815260418036036020830137602081016040526000611066828461135d90919063ffffffff16565b9050611071816104ae565b6110b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a790612562565b60405180910390fd5b6000606236033590506110c2816106cc565b611101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f8906125ce565b60405180910390fd5b61110f8b8960ff1689611384565b81995099505050505050505050915091565b60606000600283600261113491906125ee565b61113e9190611ef4565b67ffffffffffffffff81111561115757611156611b7e565b5b6040519080825280601f01601f1916602001820160405280156111895781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106111c1576111c06120d0565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611225576112246120d0565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261126591906125ee565b61126f9190611ef4565b90505b600181111561130f577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106112b1576112b06120d0565b5b1a60f81b8282815181106112c8576112c76120d0565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061130890612648565b9050611272565b5060008414611353576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134a906126bd565b60405180910390fd5b8091505092915050565b600080600061136c8585611428565b91509150611379816114a9565b819250505092915050565b6060806000806000806042870136035995508951865260208a51026020870101604052600094505b8885101561141857604085028101359150600093505b895184101561140d57816020850260208c010151036113f65760206040860282010135602085026020880101526001830192505b89518303611402578894505b6001840193506113c2565b6001850194506113ac565b5084955050505050509392505050565b60008060418351036114695760008060006020860151925060408601519150606086015160001a905061145d87828585611675565b945094505050506114a2565b604083510361149957600080602085015191506040850151905061148e868383611781565b9350935050506114a2565b60006002915091505b9250929050565b600060048111156114bd576114bc6126dd565b5b8160048111156114d0576114cf6126dd565b5b031561167257600160048111156114ea576114e96126dd565b5b8160048111156114fd576114fc6126dd565b5b0361153d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153490612758565b60405180910390fd5b60026004811115611551576115506126dd565b5b816004811115611564576115636126dd565b5b036115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b906127c4565b60405180910390fd5b600360048111156115b8576115b76126dd565b5b8160048111156115cb576115ca6126dd565b5b0361160b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160290612856565b60405180910390fd5b60048081111561161e5761161d6126dd565b5b816004811115611631576116306126dd565b5b03611671576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611668906128e8565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c11156116b0576000600391509150611778565b601b8560ff16141580156116c85750601c8560ff1614155b156116da576000600491509150611778565b6000600187878787604051600081526020016040526040516116ff9493929190612924565b6020604051602081039080840390855afa158015611721573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361176f57600060019250925050611778565b80600092509250505b94509492505050565b60008060007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60001b841690506000601b60ff8660001c901c6117c49190611ef4565b90506117d287828885611675565b935093505050935093915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611829816117f4565b811461183457600080fd5b50565b60008135905061184681611820565b92915050565b600060208284031215611862576118616117ea565b5b600061187084828501611837565b91505092915050565b60008115159050919050565b61188e81611879565b82525050565b60006020820190506118a96000830184611885565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006118da826118af565b9050919050565b6118ea816118cf565b81146118f557600080fd5b50565b600081359050611907816118e1565b92915050565b600060208284031215611923576119226117ea565b5b6000611931848285016118f8565b91505092915050565b6000819050919050565b61194d8161193a565b811461195857600080fd5b50565b60008135905061196a81611944565b92915050565b600060208284031215611986576119856117ea565b5b60006119948482850161195b565b91505092915050565b6119a68161193a565b82525050565b60006020820190506119c1600083018461199d565b92915050565b600080604083850312156119de576119dd6117ea565b5b60006119ec8582860161195b565b92505060206119fd858286016118f8565b9150509250929050565b6000819050919050565b611a1a81611a07565b82525050565b6000602082019050611a356000830184611a11565b92915050565b611a4481611a07565b8114611a4f57600080fd5b50565b600081359050611a6181611a3b565b92915050565b600060208284031215611a7d57611a7c6117ea565b5b6000611a8b84828501611a52565b91505092915050565b611a9d816118cf565b82525050565b6000602082019050611ab86000830184611a94565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611af8578082015181840152602081019050611add565b83811115611b07576000848401525b50505050565b6000601f19601f8301169050919050565b6000611b2982611abe565b611b338185611ac9565b9350611b43818560208601611ada565b611b4c81611b0d565b840191505092915050565b60006020820190508181036000830152611b718184611b1e565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611bb682611b0d565b810181811067ffffffffffffffff82111715611bd557611bd4611b7e565b5b80604052505050565b6000611be86117e0565b9050611bf48282611bad565b919050565b600067ffffffffffffffff821115611c1457611c13611b7e565b5b602082029050602081019050919050565b600080fd5b600080fd5b600067ffffffffffffffff821115611c4a57611c49611b7e565b5b611c5382611b0d565b9050602081019050919050565b82818337600083830152505050565b6000611c82611c7d84611c2f565b611bde565b905082815260208101848484011115611c9e57611c9d611c2a565b5b611ca9848285611c60565b509392505050565b600082601f830112611cc657611cc5611b79565b5b8135611cd6848260208601611c6f565b91505092915050565b6000611cf2611ced84611bf9565b611bde565b90508083825260208201905060208402830185811115611d1557611d14611c25565b5b835b81811015611d5c57803567ffffffffffffffff811115611d3a57611d39611b79565b5b808601611d478982611cb1565b85526020850194505050602081019050611d17565b5050509392505050565b600082601f830112611d7b57611d7a611b79565b5b8135611d8b848260208601611cdf565b91505092915050565b600060208284031215611daa57611da96117ea565b5b600082013567ffffffffffffffff811115611dc857611dc76117ef565b5b611dd484828501611d66565b91505092915050565b6000608082019050611df2600083018761199d565b611dff6020830186611a11565b611e0c6040830185611a11565b611e196060830184611a11565b95945050505050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000611e8f602f83611e22565b9150611e9a82611e33565b604082019050919050565b60006020820190508181036000830152611ebe81611e82565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eff82611a07565b9150611f0a83611a07565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611f3f57611f3e611ec5565b5b828201905092915050565b7f446174612077697468206675747572652074696d657374616d7073206973206e60008201527f6f7420616c6c6f77656400000000000000000000000000000000000000000000602082015250565b6000611fa6602a83611e22565b9150611fb182611f4a565b604082019050919050565b60006020820190508181036000830152611fd581611f99565b9050919050565b6000611fe782611a07565b9150611ff283611a07565b92508282101561200557612004611ec5565b5b828203905092915050565b600080fd5b600080fd5b6000808585111561202e5761202d612010565b5b8386111561203f5761203e612015565b5b6001850283019150848603905094509492505050565b6000819050919050565b61207061206b826117f4565b612055565b82525050565b600081905092915050565b600061208d8385612076565b935061209a838584611c60565b82840190509392505050565b60006120b2828661205f565b6004820191506120c3828486612081565b9150819050949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061210a82611abe565b6121148185612076565b9350612124818560208601611ada565b80840191505092915050565b600061213c82846120ff565b915081905092915050565b600061215282611a07565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361218457612183611ec5565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006121eb602683611e22565b91506121f68261218f565b604082019050919050565b6000602082019050818103600083015261221a816121de565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612257602083611e22565b915061226282612221565b602082019050919050565b600060208201905081810360008301526122868161224a565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006122ce60178361228d565b91506122d982612298565b601782019050919050565b600081519050919050565b60006122fa826122e4565b612304818561228d565b9350612314818560208601611ada565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b600061235660118361228d565b915061236182612320565b601182019050919050565b6000612377826122c1565b915061238382856122ef565b915061238e82612349565b915061239a82846122ef565b91508190509392505050565b60006123b1826122e4565b6123bb8185611e22565b93506123cb818560208601611ada565b6123d481611b0d565b840191505092915050565b600060208201905081810360008301526123f981846123a6565b905092915050565b600061ffff82169050919050565b600061241a82612401565b915061242583612401565b92508161ffff04831182151516156124405761243f611ec5565b5b828202905092915050565b600061245682612401565b915061246183612401565b92508261ffff0382111561247857612477611ec5565b5b828201905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b60006124b9601c8361228d565b91506124c482612483565b601c82019050919050565b6000819050919050565b6124ea6124e58261193a565b6124cf565b82525050565b60006124fb826124ac565b915061250782846124d9565b60208201915081905092915050565b7f5369676e6572206e6f7420617574686f72697a65640000000000000000000000600082015250565b600061254c601583611e22565b915061255782612516565b602082019050919050565b6000602082019050818103600083015261257b8161253f565b9050919050565b7f446174612074696d657374616d7020697320696e76616c696400000000000000600082015250565b60006125b8601983611e22565b91506125c382612582565b602082019050919050565b600060208201905081810360008301526125e7816125ab565b9050919050565b60006125f982611a07565b915061260483611a07565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561263d5761263c611ec5565b5b828202905092915050565b600061265382611a07565b91506000820361266657612665611ec5565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006126a7602083611e22565b91506126b282612671565b602082019050919050565b600060208201905081810360008301526126d68161269a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b6000612742601883611e22565b915061274d8261270c565b602082019050919050565b6000602082019050818103600083015261277181612735565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b60006127ae601f83611e22565b91506127b982612778565b602082019050919050565b600060208201905081810360008301526127dd816127a1565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b6000612840602283611e22565b915061284b826127e4565b604082019050919050565b6000602082019050818103600083015261286f81612833565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006128d2602283611e22565b91506128dd82612876565b604082019050919050565b60006020820190508181036000830152612901816128c5565b9050919050565b600060ff82169050919050565b61291e81612908565b82525050565b6000608082019050612939600083018761199d565b6129466020830186612915565b612953604083018561199d565b612960606083018461199d565b9594505050505056fea2646970667358221220c52b3f1e3e5d4e8d7856639bb85992632a86338d2dff55f3e34022b0a258ce4164736f6c634300080e0033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063bfe51c101161007c578063bfe51c1014610362578063d547741f1461037e578063ee974af01461039a578063f2fde38b146103ca578063f31a210a146103e6578063fb512cb31461040457610137565b80638da5cb5b146102a857806391d14854146102c65780639449ab63146102f6578063a1ebf35d14610326578063a217fddf1461034457610137565b806331d98b3f116100ff57806331d98b3f1461020457806336568abe146102345780635118af5a14610250578063715018a61461026e578063750582051461027857610137565b806301ffc9a71461013c57806311c89b101461016c578063248a9ca31461019c578063285da53b146101cc5780632f2ff15d146101e8575b600080fd5b6101566004803603810190610151919061184c565b610434565b6040516101639190611894565b60405180910390f35b6101866004803603810190610181919061190d565b6104ae565b6040516101939190611894565b60405180910390f35b6101b660048036038101906101b19190611970565b610508565b6040516101c391906119ac565b60405180910390f35b6101e660048036038101906101e19190611970565b610528565b005b61020260048036038101906101fd91906119c7565b6105ee565b005b61021e60048036038101906102199190611970565b61060f565b60405161022b9190611a20565b60405180910390f35b61024e600480360381019061024991906119c7565b61062c565b005b6102586106af565b6040516102659190611a20565b60405180910390f35b6102766106b8565b005b610292600480360381019061028d9190611a67565b6106cc565b60405161029f9190611894565b60405180910390f35b6102b0610748565b6040516102bd9190611aa3565b60405180910390f35b6102e060048036038101906102db91906119c7565b610771565b6040516102ed9190611894565b60405180910390f35b610310600480360381019061030b9190611970565b6107dc565b60405161031d9190611b57565b60405180910390f35b61032e610822565b60405161033b91906119ac565b60405180910390f35b61034c610846565b60405161035991906119ac565b60405180910390f35b61037c6004803603810190610377919061190d565b61084d565b005b610398600480360381019061039391906119c7565b610937565b005b6103b460048036038101906103af9190611d94565b610958565b6040516103c19190611894565b60405180910390f35b6103e460048036038101906103df919061190d565b610a3e565b005b6103ee610ac1565b6040516103fb9190611a20565b60405180910390f35b61041e60048036038101906104199190611970565b610aca565b60405161042b9190611a20565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104a757506104a682610ae2565b5b9050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b600060026000838152602001908152602001600020600101549050919050565b7f5349474e45525f524f4c4500000000000000000000000000000000000000000061055281610b4c565b60006003600084815260200190815260200160002054905060008061057685610b60565b915091508160036000878152602001908152602001600020819055508060046000878152602001908152602001600020819055507f1c278fa9790ee5cfae7607a35202b57ef06960df9fe79baca5d617e2db126d6f858484846040516105df9493929190611ddd565b60405180910390a15050505050565b6105f782610508565b61060081610b4c565b61060a8383610c0b565b505050565b600060036000838152602001908152602001600020549050919050565b610634610cec565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146106a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069890611ea5565b60405180910390fd5b6106ab8282610cf4565b5050565b6000600f905090565b6106c0610dd6565b6106ca6000610e54565b565b6000816106d76106af565b426106e29190611ef4565b11610722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071990611fbc565b60405180910390fd5b814210806107415750610733610ac1565b824261073f9190611fdc565b105b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606063285da53b60e01b60003660049080926107fa9392919061201a565b60405160200161080c939291906120a6565b6040516020818303038152906040529050919050565b7f5349474e45525f524f4c4500000000000000000000000000000000000000000081565b6000801b81565b610855610dd6565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361088e57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ffc34663d6e481c3ed985715061d3e369aa003416efd09293880e20cf2e8f53b560405160405180910390a250565b61094082610508565b61094981610b4c565b6109538383610cf4565b505050565b60007f5349474e45525f524f4c4500000000000000000000000000000000000000000061098481610b4c565b60005b8351811015610a375760003073ffffffffffffffffffffffffffffffffffffffff168583815181106109bc576109bb6120d0565b5b60200260200101516040516109d19190612130565b6000604051808303816000865af19150503d8060008114610a0e576040519150601f19603f3d011682016040523d82523d6000602084013e610a13565b606091505b50509050808015610a215750835b9350508080610a2f90612147565b915050610987565b5050919050565b610a46610dd6565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ab5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aac90612201565b60405180910390fd5b610abe81610e54565b50565b600060b4905090565b60046020528060005260406000206000915090505481565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b610b5d81610b58610cec565b610f18565b50565b6000806000600167ffffffffffffffff811115610b8057610b7f611b7e565b5b604051908082528060200260200182016040528015610bae5781602001602082028036833780820191505090505b5090508381600081518110610bc657610bc56120d0565b5b602002602001018181525050600080610bde83610fb5565b9150915081600081518110610bf657610bf56120d0565b5b60200260200101518194509450505050915091565b610c158282610771565b610ce85760016002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610c8d610cec565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b610cfe8282610771565b15610dd25760006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d77610cec565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b610dde610cec565b73ffffffffffffffffffffffffffffffffffffffff16610dfc610748565b73ffffffffffffffffffffffffffffffffffffffff1614610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e499061226d565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b610f228282610771565b610fb157610f478173ffffffffffffffffffffffffffffffffffffffff166014611121565b610f558360001c6020611121565b604051602001610f6692919061236c565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa891906123df565b60405180910390fd5b5050565b6060600080606136033590506000602060408360ff16610fd5919061240f565b610fdf919061244b565b9050606060405190508181528160428301360360208301376020810160405260008180519060200120905060008160405160200161101d91906124f0565b604051602081830303815290604052805190602001209050606060405190506041815260418036036020830137602081016040526000611066828461135d90919063ffffffff16565b9050611071816104ae565b6110b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a790612562565b60405180910390fd5b6000606236033590506110c2816106cc565b611101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f8906125ce565b60405180910390fd5b61110f8b8960ff1689611384565b81995099505050505050505050915091565b60606000600283600261113491906125ee565b61113e9190611ef4565b67ffffffffffffffff81111561115757611156611b7e565b5b6040519080825280601f01601f1916602001820160405280156111895781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106111c1576111c06120d0565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611225576112246120d0565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261126591906125ee565b61126f9190611ef4565b90505b600181111561130f577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106112b1576112b06120d0565b5b1a60f81b8282815181106112c8576112c76120d0565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061130890612648565b9050611272565b5060008414611353576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134a906126bd565b60405180910390fd5b8091505092915050565b600080600061136c8585611428565b91509150611379816114a9565b819250505092915050565b6060806000806000806042870136035995508951865260208a51026020870101604052600094505b8885101561141857604085028101359150600093505b895184101561140d57816020850260208c010151036113f65760206040860282010135602085026020880101526001830192505b89518303611402578894505b6001840193506113c2565b6001850194506113ac565b5084955050505050509392505050565b60008060418351036114695760008060006020860151925060408601519150606086015160001a905061145d87828585611675565b945094505050506114a2565b604083510361149957600080602085015191506040850151905061148e868383611781565b9350935050506114a2565b60006002915091505b9250929050565b600060048111156114bd576114bc6126dd565b5b8160048111156114d0576114cf6126dd565b5b031561167257600160048111156114ea576114e96126dd565b5b8160048111156114fd576114fc6126dd565b5b0361153d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153490612758565b60405180910390fd5b60026004811115611551576115506126dd565b5b816004811115611564576115636126dd565b5b036115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b906127c4565b60405180910390fd5b600360048111156115b8576115b76126dd565b5b8160048111156115cb576115ca6126dd565b5b0361160b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160290612856565b60405180910390fd5b60048081111561161e5761161d6126dd565b5b816004811115611631576116306126dd565b5b03611671576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611668906128e8565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c11156116b0576000600391509150611778565b601b8560ff16141580156116c85750601c8560ff1614155b156116da576000600491509150611778565b6000600187878787604051600081526020016040526040516116ff9493929190612924565b6020604051602081039080840390855afa158015611721573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361176f57600060019250925050611778565b80600092509250505b94509492505050565b60008060007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60001b841690506000601b60ff8660001c901c6117c49190611ef4565b90506117d287828885611675565b935093505050935093915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611829816117f4565b811461183457600080fd5b50565b60008135905061184681611820565b92915050565b600060208284031215611862576118616117ea565b5b600061187084828501611837565b91505092915050565b60008115159050919050565b61188e81611879565b82525050565b60006020820190506118a96000830184611885565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006118da826118af565b9050919050565b6118ea816118cf565b81146118f557600080fd5b50565b600081359050611907816118e1565b92915050565b600060208284031215611923576119226117ea565b5b6000611931848285016118f8565b91505092915050565b6000819050919050565b61194d8161193a565b811461195857600080fd5b50565b60008135905061196a81611944565b92915050565b600060208284031215611986576119856117ea565b5b60006119948482850161195b565b91505092915050565b6119a68161193a565b82525050565b60006020820190506119c1600083018461199d565b92915050565b600080604083850312156119de576119dd6117ea565b5b60006119ec8582860161195b565b92505060206119fd858286016118f8565b9150509250929050565b6000819050919050565b611a1a81611a07565b82525050565b6000602082019050611a356000830184611a11565b92915050565b611a4481611a07565b8114611a4f57600080fd5b50565b600081359050611a6181611a3b565b92915050565b600060208284031215611a7d57611a7c6117ea565b5b6000611a8b84828501611a52565b91505092915050565b611a9d816118cf565b82525050565b6000602082019050611ab86000830184611a94565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611af8578082015181840152602081019050611add565b83811115611b07576000848401525b50505050565b6000601f19601f8301169050919050565b6000611b2982611abe565b611b338185611ac9565b9350611b43818560208601611ada565b611b4c81611b0d565b840191505092915050565b60006020820190508181036000830152611b718184611b1e565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611bb682611b0d565b810181811067ffffffffffffffff82111715611bd557611bd4611b7e565b5b80604052505050565b6000611be86117e0565b9050611bf48282611bad565b919050565b600067ffffffffffffffff821115611c1457611c13611b7e565b5b602082029050602081019050919050565b600080fd5b600080fd5b600067ffffffffffffffff821115611c4a57611c49611b7e565b5b611c5382611b0d565b9050602081019050919050565b82818337600083830152505050565b6000611c82611c7d84611c2f565b611bde565b905082815260208101848484011115611c9e57611c9d611c2a565b5b611ca9848285611c60565b509392505050565b600082601f830112611cc657611cc5611b79565b5b8135611cd6848260208601611c6f565b91505092915050565b6000611cf2611ced84611bf9565b611bde565b90508083825260208201905060208402830185811115611d1557611d14611c25565b5b835b81811015611d5c57803567ffffffffffffffff811115611d3a57611d39611b79565b5b808601611d478982611cb1565b85526020850194505050602081019050611d17565b5050509392505050565b600082601f830112611d7b57611d7a611b79565b5b8135611d8b848260208601611cdf565b91505092915050565b600060208284031215611daa57611da96117ea565b5b600082013567ffffffffffffffff811115611dc857611dc76117ef565b5b611dd484828501611d66565b91505092915050565b6000608082019050611df2600083018761199d565b611dff6020830186611a11565b611e0c6040830185611a11565b611e196060830184611a11565b95945050505050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000611e8f602f83611e22565b9150611e9a82611e33565b604082019050919050565b60006020820190508181036000830152611ebe81611e82565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eff82611a07565b9150611f0a83611a07565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611f3f57611f3e611ec5565b5b828201905092915050565b7f446174612077697468206675747572652074696d657374616d7073206973206e60008201527f6f7420616c6c6f77656400000000000000000000000000000000000000000000602082015250565b6000611fa6602a83611e22565b9150611fb182611f4a565b604082019050919050565b60006020820190508181036000830152611fd581611f99565b9050919050565b6000611fe782611a07565b9150611ff283611a07565b92508282101561200557612004611ec5565b5b828203905092915050565b600080fd5b600080fd5b6000808585111561202e5761202d612010565b5b8386111561203f5761203e612015565b5b6001850283019150848603905094509492505050565b6000819050919050565b61207061206b826117f4565b612055565b82525050565b600081905092915050565b600061208d8385612076565b935061209a838584611c60565b82840190509392505050565b60006120b2828661205f565b6004820191506120c3828486612081565b9150819050949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061210a82611abe565b6121148185612076565b9350612124818560208601611ada565b80840191505092915050565b600061213c82846120ff565b915081905092915050565b600061215282611a07565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361218457612183611ec5565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006121eb602683611e22565b91506121f68261218f565b604082019050919050565b6000602082019050818103600083015261221a816121de565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612257602083611e22565b915061226282612221565b602082019050919050565b600060208201905081810360008301526122868161224a565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006122ce60178361228d565b91506122d982612298565b601782019050919050565b600081519050919050565b60006122fa826122e4565b612304818561228d565b9350612314818560208601611ada565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b600061235660118361228d565b915061236182612320565b601182019050919050565b6000612377826122c1565b915061238382856122ef565b915061238e82612349565b915061239a82846122ef565b91508190509392505050565b60006123b1826122e4565b6123bb8185611e22565b93506123cb818560208601611ada565b6123d481611b0d565b840191505092915050565b600060208201905081810360008301526123f981846123a6565b905092915050565b600061ffff82169050919050565b600061241a82612401565b915061242583612401565b92508161ffff04831182151516156124405761243f611ec5565b5b828202905092915050565b600061245682612401565b915061246183612401565b92508261ffff0382111561247857612477611ec5565b5b828201905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b60006124b9601c8361228d565b91506124c482612483565b601c82019050919050565b6000819050919050565b6124ea6124e58261193a565b6124cf565b82525050565b60006124fb826124ac565b915061250782846124d9565b60208201915081905092915050565b7f5369676e6572206e6f7420617574686f72697a65640000000000000000000000600082015250565b600061254c601583611e22565b915061255782612516565b602082019050919050565b6000602082019050818103600083015261257b8161253f565b9050919050565b7f446174612074696d657374616d7020697320696e76616c696400000000000000600082015250565b60006125b8601983611e22565b91506125c382612582565b602082019050919050565b600060208201905081810360008301526125e7816125ab565b9050919050565b60006125f982611a07565b915061260483611a07565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561263d5761263c611ec5565b5b828202905092915050565b600061265382611a07565b91506000820361266657612665611ec5565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006126a7602083611e22565b91506126b282612671565b602082019050919050565b600060208201905081810360008301526126d68161269a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b6000612742601883611e22565b915061274d8261270c565b602082019050919050565b6000602082019050818103600083015261277181612735565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b60006127ae601f83611e22565b91506127b982612778565b602082019050919050565b600060208201905081810360008301526127dd816127a1565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b6000612840602283611e22565b915061284b826127e4565b604082019050919050565b6000602082019050818103600083015261286f81612833565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006128d2602283611e22565b91506128dd82612876565b604082019050919050565b60006020820190508181036000830152612901816128c5565b9050919050565b600060ff82169050919050565b61291e81612908565b82525050565b6000608082019050612939600083018761199d565b6129466020830186612915565b612953604083018561199d565b612960606083018461199d565b9594505050505056fea2646970667358221220c52b3f1e3e5d4e8d7856639bb85992632a86338d2dff55f3e34022b0a258ce4164736f6c634300080e0033