Transactions
Token Transfers
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
- Contract name:
- PKPHelper
- Optimization enabled
- false
- Compiler version
- v0.8.17+commit.8df45f5f
- Verified at
- 2024-06-24T18:23:04.907422Z
Constructor Arguments
000000000000000000000000e5a7c5d908ee8996332f488ce5f636d4ebff85220000000000000000000000000000000000000000000000000000000000000002
Arg [0] (address) : 0xe5a7c5d908ee8996332f488ce5f636d4ebff8522
Arg [1] (uint8) : 2
contracts/lit-node/PKPHelper.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";import { PKPPermissions } from "./PKPPermissions.sol";import { PKPNFT } from "./PKPNFT.sol";import { PKPNFTMetadata } from "./PKPNFTMetadata.sol";import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol";import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";import { ContractResolver } from "../lit-core/ContractResolver.sol";import { PKPNFTFacet } from "./PKPNFT/PKPNFTFacet.sol";import "@openzeppelin/contracts/access/AccessControl.sol";import "hardhat/console.sol";import { LibPKPPermissionsStorage } from "./PKPPermissions/LibPKPPermissionsStorage.sol";import { PKPPermissionsFacet } from "./PKPPermissions/PKPPermissionsFacet.sol";import { LibPKPNFTStorage } from "./PKPNFT/LibPKPNFTStorage.sol";// TODO: tests for the mintGrantAndBurn function, withdraw function, some of the setters, transfer function, freeMint and freeMintGrantAndBurn/// @title Programmable Keypair NFT////// @dev This is the contract for the PKP NFTs////// Simply put, whomever owns a PKP NFT can ask that PKP to sign a message./// The owner can also grant signing permissions to other eth addresses/// or lit actionscontract PKPHelper is Ownable, IERC721Receiver, AccessControl {/* ========== CUSTOM STRUCTS ========== */struct AuthMethodData {uint256 keyType;bytes[] permittedIpfsCIDs;uint256[][] permittedIpfsCIDScopes;address[] permittedAddresses;uint256[][] permittedAddressScopes;uint256[] permittedAuthMethodTypes;bytes[] permittedAuthMethodIds;bytes[] permittedAuthMethodPubkeys;uint256[][] permittedAuthMethodScopes;bool addPkpEthAddressAsPermittedAddress;bool sendPkpToItself;
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.4) (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;}function _contextSuffixLength() internal view virtual returns (uint256) {return 0;}}
solidity-bytes-utils/contracts/BytesLib.sol
// SPDX-License-Identifier: Unlicense/** @title Solidity Bytes Arrays Utils* @author Gonçalo Sá <goncalo.sa@consensys.net>** @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.* The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.*/pragma solidity >=0.8.0 <0.9.0;library BytesLib {function concat(bytes memory _preBytes,bytes memory _postBytes)internalpurereturns (bytes memory){bytes memory tempBytes;assembly {// Get a location of some free memory and store it in tempBytes as// Solidity does for memory variables.tempBytes := mload(0x40)// Store the length of the first bytes array at the beginning of// the memory for tempBytes.let length := mload(_preBytes)mstore(tempBytes, length)// Maintain a memory counter for the current write location in the// temp bytes array by adding the 32 bytes for the array length to// the starting location.let mc := add(tempBytes, 0x20)// Stop copying when the memory counter reaches the length of the// first bytes array.let end := add(mc, length)for {
@openzeppelin/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)pragma solidity ^0.8.0;import "./math/Math.sol";import "./math/SignedMath.sol";/*** @dev String operations.*/library Strings {bytes16 private constant _SYMBOLS = "0123456789abcdef";uint8 private constant _ADDRESS_LENGTH = 20;/*** @dev Converts a `uint256` to its ASCII `string` decimal representation.*/function toString(uint256 value) internal pure returns (string memory) {unchecked {uint256 length = Math.log10(value) + 1;string memory buffer = new string(length);uint256 ptr;/// @solidity memory-safe-assemblyassembly {ptr := add(buffer, add(32, length))}while (true) {ptr--;/// @solidity memory-safe-assemblyassembly {mstore8(ptr, byte(mod(value, 10), _SYMBOLS))}value /= 10;if (value == 0) break;}return buffer;}}/**
@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)pragma solidity ^0.8.0;import "../IERC721.sol";/*** @title ERC-721 Non-Fungible Token Standard, optional metadata extension* @dev See https://eips.ethereum.org/EIPS/eip-721*/interface IERC721Metadata is IERC721 {/*** @dev Returns the token collection name.*/function name() external view returns (string memory);/*** @dev Returns the token collection symbol.*/function symbol() external view returns (string memory);/*** @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.*/function tokenURI(uint256 tokenId) external view returns (string memory);}
contracts/lit-node/PKPPermissions.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/******************************************************************************\* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535** Implementation of a diamond./******************************************************************************/import { LibDiamond } from "../libraries/LibDiamond.sol";import { IDiamondCut } from "../interfaces/IDiamondCut.sol";import { IDiamondLoupe } from "../interfaces/IDiamondLoupe.sol";import { IERC173 } from "../interfaces/IERC173.sol";import { IERC165 } from "../interfaces/IERC165.sol";import { ContractResolver } from "../lit-core/ContractResolver.sol";import { LibPKPPermissionsStorage } from "./PKPPermissions/LibPKPPermissionsStorage.sol";// When no function exists for function callederror FunctionNotFound(bytes4 _functionSelector);// This is used in diamond constructor// more arguments are added to this struct// this avoids stack too deep errorsstruct PKPPermissionsArgs {address owner;address init;bytes initCalldata;address contractResolver;ContractResolver.Env env;}contract PKPPermissions {constructor(IDiamondCut.FacetCut[] memory _diamondCut,PKPPermissionsArgs memory _args) payable {LibDiamond.setContractOwner(_args.owner);LibDiamond.diamondCut(_diamondCut, _args.init, _args.initCalldata);
@openzeppelin/contracts/access/AccessControl.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)pragma solidity ^0.8.0;import "./IAccessControl.sol";import "../utils/Context.sol";import "../utils/Strings.sol";import "../utils/introspection/ERC165.sol";/*** @dev Contract module that allows children to implement role-based access* control mechanisms. This is a lightweight version that doesn't allow enumerating role* members except through off-chain means by accessing the contract event logs. Some* applications may benefit from on-chain enumerability, for those cases see* {AccessControlEnumerable}.** Roles are referred to by their `bytes32` identifier. These should be exposed* in the external API and be unique. The best way to achieve this is by* using `public constant` hash digests:** ```solidity* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");* ```** Roles can be used to represent a set of permissions. To restrict access to a* function call, use {hasRole}:** ```solidity* function foo() public {* require(hasRole(MY_ROLE, msg.sender));* ...* }* ```** Roles can be granted and revoked dynamically via the {grantRole} and* {revokeRole} functions. Each role has an associated admin role, and only* accounts that have a role's admin role can call {grantRole} and {revokeRole}.** By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means* that only accounts with this role will be able to grant or revoke other
@gnus.ai/contracts-upgradeable-diamond/contracts/utils/introspection/ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)pragma solidity ^0.8.0;import "./IERC165Upgradeable.sol";import "../../proxy/utils/Initializable.sol";/*** @dev Implementation of the {IERC165} interface.** Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check* for the additional interface id that will be supported. For example:** ```solidity* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);* }* ```** Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.*/abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {function __ERC165_init() internal onlyInitializing {}function __ERC165_init_unchained() internal onlyInitializing {}/*** @dev See {IERC165-supportsInterface}.*/function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {return interfaceId == type(IERC165Upgradeable).interfaceId;}}
@gnus.ai/contracts-upgradeable-diamond/contracts/proxy/utils/InitializableStorage.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import { Initializable } from "./Initializable.sol";library InitializableStorage {struct Layout {/** @dev Indicates that the contract has been initialized.* @custom:oz-retyped-from bool*/uint8 _initialized;/** @dev Indicates that the contract is in the process of being initialized.*/bool _initializing;}bytes32 internal constant STORAGE_SLOT = keccak256('openzeppelin.contracts.storage.Initializable');function layout() internal pure returns (Layout storage l) {bytes32 slot = STORAGE_SLOT;assembly {l.slot := slot}}}
contracts/interfaces/IDiamond.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/******************************************************************************\* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535/******************************************************************************/interface IDiamond {enum FacetCutAction {Add,Replace,Remove}// Add=0, Replace=1, Remove=2struct FacetCut {address facetAddress;FacetCutAction action;bytes4[] functionSelectors;}event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);}
@gnus.ai/contracts-upgradeable-diamond/contracts/utils/math/MathUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)pragma solidity ^0.8.0;/*** @dev Standard math utilities missing in the Solidity language.*/library MathUpgradeable {enum Rounding {Down, // Toward negative infinityUp, // Toward infinityZero // 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.*
contracts/lit-node/Staking/StakingFacet.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";import { LibDiamond } from "../../libraries/LibDiamond.sol";import { StakingViewsFacet } from "./StakingViewsFacet.sol";import { StakingBalancesFacet } from "../StakingBalances/StakingBalancesFacet.sol";import { LibStakingStorage } from "./LibStakingStorage.sol";// import "hardhat/console.sol";contract StakingFacet {using EnumerableSet for EnumerableSet.AddressSet;// errorserror MustBeInActiveOrUnlockedState(LibStakingStorage.States state);error MustBeInNextValidatorSetLockedOrReadyForNextEpochOrRestoreState(LibStakingStorage.States state);error MustBeInNextValidatorSetLockedState(LibStakingStorage.States state);error MustBeInReadyForNextEpochState(LibStakingStorage.States state);error MustBeInActiveOrUnlockedOrPausedState(LibStakingStorage.States state);error MustBeInNextValidatorSetLockedOrReadyForNextEpochState(LibStakingStorage.States state);error NotEnoughValidatorsInNextEpoch(uint256 validatorCount,uint256 minimumValidatorCount);error ValidatorIsNotInNextEpoch(address validator,address[] validatorsInNextEpoch);error NotEnoughValidatorsReadyForNextEpoch(uint256 currentReadyValidatorCount,uint256 nextReadyValidatorCount,uint256 minimumValidatorCountToBeReady);
@openzeppelin/contracts/utils/cryptography/ECDSA.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.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 // Deprecated in v4.8}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");}}/*** @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.
@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)pragma solidity ^0.8.0;import "../IERC721.sol";/*** @title ERC-721 Non-Fungible Token Standard, optional enumeration extension* @dev See https://eips.ethereum.org/EIPS/eip-721*/interface IERC721Enumerable is IERC721 {/*** @dev Returns the total amount of tokens stored by the contract.*/function totalSupply() external view returns (uint256);/*** @dev Returns a token ID owned by `owner` at a given `index` of its token list.* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.*/function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);/*** @dev Returns a token ID at a given `index` of all the tokens stored by the contract.* Use along with {totalSupply} to enumerate all tokens.*/function tokenByIndex(uint256 index) external view returns (uint256);}
contracts/interfaces/IERC173.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/// @title ERC-173 Contract Ownership Standard/// Note: the ERC-165 identifier for this interface is 0x7f5828d0/* is ERC165 */interface IERC173 {/// @dev This emits when ownership of a contract changes.event OwnershipTransferred(address indexed previousOwner,address indexed newOwner);/// @notice Get the address of the owner/// @return owner_ The address of the owner.function owner() external view returns (address owner_);/// @notice Set the address of the new owner of the contract/// @dev Set _newOwner to address(0) to renounce any ownership./// @param _newOwner The address of the new owner of the contractfunction transferOwnership(address _newOwner) external;}
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)pragma solidity ^0.8.0;import "../IERC721Upgradeable.sol";/*** @title ERC-721 Non-Fungible Token Standard, optional enumeration extension* @dev See https://eips.ethereum.org/EIPS/eip-721*/interface IERC721EnumerableUpgradeable is IERC721Upgradeable {/*** @dev Returns the total amount of tokens stored by the contract.*/function totalSupply() external view returns (uint256);/*** @dev Returns a token ID owned by `owner` at a given `index` of its token list.* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.*/function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);/*** @dev Returns a token ID at a given `index` of all the tokens stored by the contract.* Use along with {totalSupply} to enumerate all tokens.*/function tokenByIndex(uint256 index) external view returns (uint256);}
@openzeppelin/contracts/token/ERC721/IERC721.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)pragma solidity ^0.8.0;import "../../utils/introspection/IERC165.sol";/*** @dev Required interface of an ERC721 compliant contract.*/interface IERC721 is IERC165 {/*** @dev Emitted when `tokenId` token is transferred from `from` to `to`.*/event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);/*** @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.*/event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);/*** @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.*/event ApprovalForAll(address indexed owner, address indexed operator, bool approved);/*** @dev Returns the number of tokens in ``owner``'s account.*/function balanceOf(address owner) external view returns (uint256 balance);/*** @dev Returns the owner of the `tokenId` token.** Requirements:** - `tokenId` must exist.*/function ownerOf(uint256 tokenId) external view returns (address owner);/**
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/extensions/ERC721EnumerableStorage.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import { ERC721EnumerableUpgradeable } from "./ERC721EnumerableUpgradeable.sol";library ERC721EnumerableStorage {struct Layout {// Mapping from owner to list of owned token IDsmapping(address => mapping(uint256 => uint256)) _ownedTokens;// Mapping from token ID to index of the owner tokens listmapping(uint256 => uint256) _ownedTokensIndex;// Array with all token ids, used for enumerationuint256[] _allTokens;// Mapping from token id to position in the allTokens arraymapping(uint256 => uint256) _allTokensIndex;}bytes32 internal constant STORAGE_SLOT = keccak256('openzeppelin.contracts.storage.ERC721Enumerable');function layout() internal pure returns (Layout storage l) {bytes32 slot = STORAGE_SLOT;assembly {l.slot := slot}}}
contracts/lit-node/Staking/LibStakingStorage.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";import "solidity-bytes-utils/contracts/BytesLib.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";interface IPubkeyRouter {struct RootKey {bytes pubkey;uint256 keyType; // 1 = BLS, 2 = ECDSA. Not doing this in an enum so we can add more keytypes in the future without redeploying.}struct Signature {bytes32 r;bytes32 s;uint8 v;}}library LibStakingStorage {using EnumerableSet for EnumerableSet.AddressSet;bytes32 constant STAKING_POSITION = keccak256("staking.storage");enum States {Active,NextValidatorSetLocked,ReadyForNextEpoch,Unlocked,Paused,Restore}struct Validator {uint32 ip;uint128 ipv6;uint32 port;address nodeAddress;uint256 reward;
@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)pragma solidity ^0.8.0;/*** @title ERC721 token receiver interface* @dev Interface for any contract that wants to support safeTransfers* from ERC721 asset contracts.*/interface IERC721Receiver {/*** @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}* by `operator` from `from`, this function is called.** It must return its Solidity selector to confirm the token transfer.* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.** The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.*/function onERC721Received(address operator,address from,uint256 tokenId,bytes calldata data) external returns (bytes4);}
contracts/lit-node/PKPNFT/LibPKPNFTStorage.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";import "solidity-bytes-utils/contracts/BytesLib.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";import { IPubkeyRouter } from "../PubkeyRouter/LibPubkeyRouterStorage.sol";library LibPKPNFTStorage {using EnumerableSet for EnumerableSet.AddressSet;bytes32 constant PKP_NFT_POSITION = keccak256("pkpnft.storage");struct ClaimMaterial {uint256 keyType;bytes32 derivedKeyId;IPubkeyRouter.Signature[] signatures;}struct PKPNFTStorage {ContractResolver contractResolver;ContractResolver.Env env;uint256 mintCost;address freeMintSigner;mapping(uint256 => bool) redeemedFreeMintIds;}// Return ERC721 storage struct for reading and writingfunction getStorage()internalpurereturns (PKPNFTStorage storage storageStruct){bytes32 position = PKP_NFT_POSITION;assembly {storageStruct.slot := position}}}
contracts/lit-node/PKPPermissions/PKPPermissionsFacet.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";import "solidity-bytes-utils/contracts/BytesLib.sol";import { LibDiamond } from "../../libraries/LibDiamond.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";import { PubkeyRouterFacet } from "../PubkeyRouter/PubkeyRouterFacet.sol";import { PKPNFTFacet } from "../PKPNFT/PKPNFTFacet.sol";import { LibPKPPermissionsStorage } from "./LibPKPPermissionsStorage.sol";import "hardhat/console.sol";contract PKPPermissionsFacet {using EnumerableSet for EnumerableSet.AddressSet;using EnumerableSet for EnumerableSet.Bytes32Set;using EnumerableSet for EnumerableSet.UintSet;using BytesLib for bytes;using BitMaps for BitMaps.BitMap;enum AuthMethodType {NULLMETHOD, // 0ADDRESS, // 1ACTION, // 2WEBAUTHN, // 3DISCORD, // 4GOOGLE, // 5GOOGLE_JWT, // 6OTP, // 7APPLE_JWT, // 8STYTCH_JWT, // 9STYTCH_JWT_EMAIL_FACTOR, // 10STYTCH_JWT_SMS_FACTOR, // 11STYTCH_JWT_WHATS_APP_FACTOR, // 12STYTCH_JWT_TOTP_FACTOR // 13}
contracts/lit-core/ContractResolver.sol
// SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.0;import "@openzeppelin/contracts/access/AccessControl.sol";import "hardhat/console.sol";contract ContractResolver is AccessControl {/* ========== TYPE DEFINITIONS ========== */// the comments following each one of these are the keccak256 hashes of the string values// this is very useful if you have to manually set any of these, so that you// don't have to calculate the hahes yourself.bytes32 public constant ADMIN_ROLE = keccak256("ADMIN"); // 0xdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42bytes32 public constant RELEASE_REGISTER_CONTRACT =keccak256("RELEASE_REGISTER"); // 0x3a68dbfd8bbb64015c42bc131c388dea7965e28c1004d09b39f59500c3a763ecbytes32 public constant STAKING_CONTRACT = keccak256("STAKING"); // 0x080909c18c958ce5a2d36481697824e477319323d03154ceba3b78f28a61887bbytes32 public constant STAKING_BALANCES_CONTRACT =keccak256("STAKING_BALANCES"); // 0xaa06d108dbd7bf976b16b7bf5adb29d2d0ef2c385ca8b9d833cc802f33942d72bytes32 public constant MULTI_SENDER_CONTRACT = keccak256("MULTI_SENDER"); // 0xdd5b9b8a5e8e01f2962ed7e983d58fe32e1f66aa88dd7ab30770fa9b77da7243bytes32 public constant LIT_TOKEN_CONTRACT = keccak256("LIT_TOKEN");bytes32 public constant PUB_KEY_ROUTER_CONTRACT =keccak256("PUB_KEY_ROUTER"); // 0xb1f79813bc7630a52ae948bc99781397e409d0dd3521953bf7d8d7a2db6147f7bytes32 public constant PKP_NFT_CONTRACT = keccak256("PKP_NFT"); // 0xb7b4fde9944d3c13e9a78835431c33a5084d90a7f0c73def76d7886315fe87b0bytes32 public constant RATE_LIMIT_NFT_CONTRACT =keccak256("RATE_LIMIT_NFT"); // 0xb931b2719aeb2a65a5035fa0a190bfdc4c8622ce8cbff7a3d1ab42531fb1a918bytes32 public constant PKP_HELPER_CONTRACT = keccak256("PKP_HELPER"); // 0x27d764ea2a4a3865434bbf4a391110149644be31448f3479fd15b44388755765bytes32 public constant PKP_HELPER_V2_CONTRACT = keccak256("PKP_HELPER_V2"); // 0x58a0044e0ecd81025e398bf1815075d1234cbac3749614b0b33a404c2ee2babfbytes32 public constant PKP_PERMISSIONS_CONTRACT =keccak256("PKP_PERMISSIONS"); // 0x54953c23068b8fc4c0736301b50f10027d6b469327de1fd42841a5072b1bcebebytes32 public constant PKP_NFT_METADATA_CONTRACT =keccak256("PKP_NFT_METADATA"); // 0xf14f431dadc82e7dbc5e379f71234e5735c9187e4327a7c6ac014d55d1b7727abytes32 public constant ALLOWLIST_CONTRACT = keccak256("ALLOWLIST"); // 0x74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bcabytes32 public constant DOMAIN_WALLET_REGISTRY =keccak256("DOMAIN_WALLET_REGISTRY");bytes32 public constant HD_KEY_DERIVER_CONTRACT =keccak256("HD_KEY_DERIVER");bytes32 public constant BACKUP_RECOVERY_CONTRACT =keccak256("BACKUP_RECOVERY");
contracts/lit-node/StakingBalances/LibStakingBalancesStorage.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";import "solidity-bytes-utils/contracts/BytesLib.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";library LibStakingBalancesStorage {using EnumerableSet for EnumerableSet.AddressSet;struct VoteToKickValidatorInNextEpoch {uint256 votes;mapping(address => bool) voted;}bytes32 constant STAKING_BALANCES_POSITION =keccak256("stakingbalances.storage");struct StakingBalancesStorage {ContractResolver contractResolver;ContractResolver.Env env;mapping(address => uint256) balances;mapping(address => uint256) rewards;// allowed stakersmapping(address => bool) permittedStakers;// maps alias address to real staker addressmapping(address => address) aliases;// maps staker address to alias countmapping(address => uint256) aliasCounts;uint256 minimumStake;uint256 maximumStake;uint256 totalStaked;bool permittedStakersOn;uint256 maxAliasCount;uint256 penaltyBalance;}// Return ERC721 storage struct for reading and writingfunction getStorage()internal
contracts/interfaces/IDiamondCut.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/******************************************************************************\* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535/******************************************************************************/import { IDiamond } from "./IDiamond.sol";interface IDiamondCut is IDiamond {/// @notice Add/replace/remove any number of functions and optionally execute/// a function with delegatecall/// @param _diamondCut Contains the facet addresses and function selectors/// @param _init The address of the contract or facet to execute _calldata/// @param _calldata A function call, including function selector and arguments/// _calldata is executed with delegatecall on _initfunction diamondCut(FacetCut[] calldata _diamondCut,address _init,bytes calldata _calldata) external;}
@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)pragma solidity ^0.8.0;import "../ERC20.sol";import "../../../utils/Context.sol";/*** @dev Extension of {ERC20} that allows token holders to destroy both their own* tokens and those that they have an allowance for, in a way that can be* recognized off-chain (via event analysis).*/abstract contract ERC20Burnable is Context, ERC20 {/*** @dev Destroys `amount` tokens from the caller.** See {ERC20-_burn}.*/function burn(uint256 amount) public virtual {_burn(_msgSender(), amount);}/*** @dev Destroys `amount` tokens from `account`, deducting from the caller's* allowance.** See {ERC20-_burn} and {ERC20-allowance}.** Requirements:** - the caller must have allowance for ``accounts``'s tokens of at least* `amount`.*/function burnFrom(address account, uint256 amount) public virtual {_spendAllowance(account, _msgSender(), amount);_burn(account, amount);}}
@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/lit-node/PKPNFT.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/******************************************************************************\* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535** Implementation of a diamond./******************************************************************************/import { LibDiamond } from "../libraries/LibDiamond.sol";import { IDiamondCut } from "../interfaces/IDiamondCut.sol";import { IDiamondLoupe } from "../interfaces/IDiamondLoupe.sol";import { IERC173 } from "../interfaces/IERC173.sol";import { IERC165 } from "../interfaces/IERC165.sol";import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";import { ContractResolver } from "../lit-core/ContractResolver.sol";import { LibPKPNFTStorage } from "./PKPNFT/LibPKPNFTStorage.sol";// When no function exists for function callederror FunctionNotFound(bytes4 _functionSelector);// This is used in diamond constructor// more arguments are added to this struct// this avoids stack too deep errorsstruct StakingArgs {address owner;address init;bytes initCalldata;address contractResolver;ContractResolver.Env env;}contract PKPNFT {constructor(IDiamondCut.FacetCut[] memory _diamondCut,StakingArgs memory _args) payable {LibDiamond.setContractOwner(_args.owner);LibDiamond.diamondCut(_diamondCut, _args.init, _args.initCalldata);
@openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)pragma solidity ^0.8.0;/*** @dev These functions deal with verification of Merkle Tree proofs.** The tree and the proofs can be generated using our* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].* You will find a quickstart guide in the readme.** WARNING: You should avoid using leaf values that are 64 bytes long prior to* hashing, or use a hash function other than keccak256 for hashing leaves.* This is because the concatenation of a sorted pair of internal nodes in* the merkle tree could be reinterpreted as a leaf value.* OpenZeppelin's JavaScript library generates merkle trees that are safe* against this attack out of the box.*/library MerkleProof {/*** @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree* defined by `root`. For this, a `proof` must be provided, containing* sibling hashes on the branch from the leaf to the root of the tree. Each* pair of leaves and each pair of pre-images are assumed to be sorted.*/function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {return processProof(proof, leaf) == root;}/*** @dev Calldata version of {verify}** _Available since v4.7._*/function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {return processProofCalldata(proof, leaf) == root;}/*** @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
@gnus.ai/contracts-upgradeable-diamond/contracts/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)pragma solidity ^0.8.0;import "../proxy/utils/Initializable.sol";/*** @dev Provides information about the current execution context, including the* sender of the transaction and its data. While these are generally available* via msg.sender and msg.data, they should not be accessed in such a direct* manner, since when dealing with meta-transactions the account sending and* paying for execution may not be the actual sender (as far as an application* is concerned).** This contract is only required for intermediate, library-like contracts.*/abstract contract ContextUpgradeable is Initializable {function __Context_init() internal onlyInitializing {}function __Context_init_unchained() internal onlyInitializing {}function _msgSender() internal view virtual returns (address) {return msg.sender;}function _msgData() internal view virtual returns (bytes calldata) {return msg.data;}}
@gnus.ai/contracts-upgradeable-diamond/contracts/utils/StringsUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)pragma solidity ^0.8.0;import "./math/MathUpgradeable.sol";import "./math/SignedMathUpgradeable.sol";/*** @dev String operations.*/library StringsUpgradeable {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 = MathUpgradeable.log10(value) + 1;string memory buffer = new string(length);uint256 ptr;/// @solidity memory-safe-assemblyassembly {ptr := add(buffer, add(32, length))}while (true) {ptr--;/// @solidity memory-safe-assemblyassembly {mstore8(ptr, byte(mod(value, 10), _SYMBOLS))}value /= 10;if (value == 0) break;}return buffer;}}/**
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/extensions/IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)pragma solidity ^0.8.0;import "../IERC721Upgradeable.sol";/*** @title ERC-721 Non-Fungible Token Standard, optional metadata extension* @dev See https://eips.ethereum.org/EIPS/eip-721*/interface IERC721MetadataUpgradeable is IERC721Upgradeable {/*** @dev Returns the token collection name.*/function name() external view returns (string memory);/*** @dev Returns the token collection symbol.*/function symbol() external view returns (string memory);/*** @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.*/function tokenURI(uint256 tokenId) external view returns (string memory);}
contracts/lit-node/PKPNFTMetadata.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol";import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";import "hardhat/console.sol";import "@openzeppelin/contracts/access/AccessControl.sol";import { ContractResolver } from "../lit-core/ContractResolver.sol";/// @title Programmable Keypair NFT Metadata////// @dev This is the contract for the PKP NFTs////// Simply put, whomever owns a PKP NFT can ask that PKP to sign a message./// The owner can also grant signing permissions to other eth addresses/// or lit actionscontract PKPNFTMetadata {using Strings for uint256;ContractResolver public contractResolver;ContractResolver.Env public env;/* ========== STATE VARIABLES ========== */mapping(uint256 => string) pkpUrls;mapping(uint256 => string) pkpProfileImg;/* ========== CONSTRUCTOR ========== */constructor(address _resolver, ContractResolver.Env _env) {contractResolver = ContractResolver(_resolver);env = _env;}/* ========== VIEWS ========== */function bytesToHex(bytes memory buffer) public pure returns (string memory) {// Fixed buffer size for hexadecimal convertionbytes memory converted = new bytes(buffer.length * 2);
contracts/lit-node/HDKeyDeriver.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { IPubkeyRouter } from "./PubkeyRouter/LibPubkeyRouterStorage.sol";abstract contract IKeyDeriver {function computeHDPubKey(bytes32 derivedKeyId,IPubkeyRouter.RootKey[] memory rootHDKeys,uint256 keyType) public view virtual returns (bool, bytes memory);}contract KeyDeriver is IKeyDeriver {// address for HD public KDFaddress public constant HD_KDF = 0x00000000000000000000000000000000000000F5;// hd kdf ctxstring constant HD_KDF_CTX = "LIT_HD_KEY_ID_K256_XMD:SHA-256_SSWU_RO_NUL_";constructor() {}function computeHDPubKey(bytes32 derivedKeyId,IPubkeyRouter.RootKey[] memory rootHDKeys,uint256 keyType) public view override returns (bool, bytes memory) {bytes memory args = _buildArgs(derivedKeyId, rootHDKeys, keyType);(bool success, bytes memory data) = HD_KDF.staticcall(args);return (success, data);}function _buildArgs(bytes32 derivedKeyId,IPubkeyRouter.RootKey[] memory rootHDKeys,uint256 keyType) internal pure returns (bytes memory) {// empty array for concating pubkeysbytes memory rootPubkeys = new bytes(0);uint32 numRootPubkeys = 0;for (uint256 i = 0; i < rootHDKeys.length; i++) {if (rootHDKeys[i].keyType == keyType) {
contracts/lit-node/PubkeyRouter/LibPubkeyRouterStorage.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";import "solidity-bytes-utils/contracts/BytesLib.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";interface IPubkeyRouter {struct RootKey {bytes pubkey;uint256 keyType; // 1 = BLS, 2 = ECDSA. Not doing this in an enum so we can add more keytypes in the future without redeploying.}struct Signature {bytes32 r;bytes32 s;uint8 v;}}library LibPubkeyRouterStorage {using EnumerableSet for EnumerableSet.AddressSet;using EnumerableSet for EnumerableSet.Bytes32Set;using EnumerableSet for EnumerableSet.UintSet;using BytesLib for bytes;using BitMaps for BitMaps.BitMap;bytes32 constant PUBKEY_ROUTER_POSITION = keccak256("pubkeyrouter.storage");struct PubkeyRoutingData {bytes pubkey;uint256 keyType; // 1 = BLS, 2 = ECDSA. Not doing this in an enum so we can add more keytypes in the future without redeploying.bytes32 derivedKeyId;}struct VoteToRegisterRootKey {uint256 votes;mapping(address => bool) voted;}
contracts/lit-node/Staking/StakingViewsFacet.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { StakingBalancesFacet } from "../StakingBalances/StakingBalancesFacet.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";import { LibDiamond } from "../../libraries/LibDiamond.sol";import { LibStakingStorage } from "./LibStakingStorage.sol";// import "hardhat/console.sol";contract StakingViewsFacet {using EnumerableSet for EnumerableSet.AddressSet;/* ========== VIEWS ========== */function stakingStorage()internalpurereturns (LibStakingStorage.StakingStorage storage){return LibStakingStorage.getStorage();}function epoch() public view returns (LibStakingStorage.Epoch memory) {return stakingStorage().epochs[0];}function config() public view returns (LibStakingStorage.Config memory) {return stakingStorage().configs[0];}function complaintConfig(uint256 reason) public view returns (LibStakingStorage.ComplaintConfig memory) {return stakingStorage().complaintReasonToConfig[reason];}function getKeyTypes() external view returns (uint256[] memory) {return config().keyTypes;
contracts/interfaces/IERC165.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;interface IERC165 {/// @notice Query if a contract implements an interface/// @param interfaceId The interface identifier, as specified in ERC-165/// @dev Interface identification is specified in ERC-165. This function/// uses less than 30,000 gas./// @return `true` if the contract implements `interfaceID` and/// `interfaceID` is not 0xffffffff, `false` otherwisefunction supportsInterface(bytes4 interfaceId) external view returns (bool);}
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)pragma solidity ^0.8.0;import "../../utils/introspection/IERC165Upgradeable.sol";/*** @dev Required interface of an ERC721 compliant contract.*/interface IERC721Upgradeable is IERC165Upgradeable {/*** @dev Emitted when `tokenId` token is transferred from `from` to `to`.*/event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);/*** @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.*/event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);/*** @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.*/event ApprovalForAll(address indexed owner, address indexed operator, bool approved);/*** @dev Returns the number of tokens in ``owner``'s account.*/function balanceOf(address owner) external view returns (uint256 balance);/*** @dev Returns the owner of the `tokenId` token.** Requirements:** - `tokenId` must exist.*/function ownerOf(uint256 tokenId) external view returns (address owner);/**
hardhat/console.sol
// SPDX-License-Identifier: MITpragma solidity >=0.4.22 <0.9.0;library console {address constant CONSOLE_ADDRESS =0x000000000000000000636F6e736F6c652e6c6f67;function _sendLogPayloadImplementation(bytes memory payload) internal view {address consoleAddress = CONSOLE_ADDRESS;/// @solidity memory-safe-assemblyassembly {pop(staticcall(gas(),consoleAddress,add(payload, 32),mload(payload),0,0))}}function _castToPure(function(bytes memory) internal view fnIn) internal pure returns (function(bytes memory) pure fnOut) {assembly {fnOut := fnIn}}function _sendLogPayload(bytes memory payload) internal pure {_castToPure(_sendLogPayloadImplementation)(payload);}function log() internal pure {_sendLogPayload(abi.encodeWithSignature("log()"));}function logInt(int256 p0) internal pure {_sendLogPayload(abi.encodeWithSignature("log(int256)", p0));
contracts/lit-node/StakingBalances/StakingBalancesFacet.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { ERC20Burnable } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";import { Staking } from "../Staking.sol";import { StakingFacet } from "../Staking/StakingFacet.sol";import { StakingViewsFacet } from "../Staking/StakingViewsFacet.sol";import { LibStakingBalancesStorage } from "./LibStakingBalancesStorage.sol";import { LibDiamond } from "../../libraries/LibDiamond.sol";import "hardhat/console.sol";contract StakingBalancesFacet {using EnumerableSet for EnumerableSet.AddressSet;error CannotStakeZero();error StakeMustBeGreaterThanMinimumStake(uint256 amountStaked,uint256 minimumStake);error StakeMustBeLessThanMaximumStake(uint256 amountStaked,uint256 maximumStake);error TryingToWithdrawMoreThanStaked(uint256 yourBalance,uint256 requestedWithdrawlAmount);error CannotWithdrawZero();error OnlyStakingContract(address sender);error StakerNotPermitted(address stakerAddress);error ActiveValidatorsCannotLeave();error MaxAliasCountReached(uint256 aliasCount);error AliasNotOwnedBySender(address aliasAccount, address stakerAddress);error CannotRemoveAliasOfActiveValidator(address aliasAccount);error CallerNotOwner();modifier onlyStakingContract() {if (msg.sender != getStakingAddress()) {
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)pragma solidity ^0.8.0;/*** @title ERC721 token receiver interface* @dev Interface for any contract that wants to support safeTransfers* from ERC721 asset contracts.*/interface IERC721ReceiverUpgradeable {/*** @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}* by `operator` from `from`, this function is called.** It must return its Solidity selector to confirm the token transfer.* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.** The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.*/function onERC721Received(address operator,address from,uint256 tokenId,bytes calldata data) external returns (bytes4);}
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)pragma solidity ^0.8.0;import "./IERC721Upgradeable.sol";import "./IERC721ReceiverUpgradeable.sol";import "./extensions/IERC721MetadataUpgradeable.sol";import "../../utils/AddressUpgradeable.sol";import "../../utils/ContextUpgradeable.sol";import "../../utils/StringsUpgradeable.sol";import "../../utils/introspection/ERC165Upgradeable.sol";import { ERC721Storage } from "./ERC721Storage.sol";import "../../proxy/utils/Initializable.sol";/*** @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including* the Metadata extension, but not including the Enumerable extension, which is available separately as* {ERC721Enumerable}.*/contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {using ERC721Storage for ERC721Storage.Layout;using AddressUpgradeable for address;using StringsUpgradeable for uint256;/*** @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.*/function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {__ERC721_init_unchained(name_, symbol_);}function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {ERC721Storage.layout()._name = name_;ERC721Storage.layout()._symbol = symbol_;}/*** @dev See {IERC165-supportsInterface}.*/function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
@openzeppelin/contracts/utils/Base64.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.6) (utils/Base64.sol)pragma solidity ^0.8.0;/*** @dev Provides a set of functions to operate with Base64 strings.** _Available since v4.5._*/library Base64 {/*** @dev Base64 Encoding/Decoding Table*/string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";/*** @dev Converts a `bytes` to its Bytes64 `string` representation.*/function encode(bytes memory data) internal pure returns (string memory) {/*** Inspired by Brecht Devos (Brechtpd) implementation - MIT licence* https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol*/if (data.length == 0) return "";// Loads the table into memorystring memory table = _TABLE;// Encoding takes 3 bytes chunks of binary data from `bytes` data parameter// and split into 4 numbers of 6 bits.// The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up// - `data.length + 2` -> Round up// - `/ 3` -> Number of 3-bytes chunks// - `4 *` -> 4 characters for each chunkstring memory result = new string(4 * ((data.length + 2) / 3));/// @solidity memory-safe-assemblyassembly {// Prepare the lookup table (skip the first "length" byte)let tablePtr := add(table, 1)
@openzeppelin/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)pragma solidity ^0.8.0;/*** @dev Standard math utilities missing in the Solidity language.*/library Math {enum Rounding {Down, // Toward negative infinityUp, // Toward infinityZero // 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.*
@openzeppelin/contracts/utils/math/SignedMath.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)pragma solidity ^0.8.0;/*** @dev Standard signed math utilities missing in the Solidity language.*/library SignedMath {/*** @dev Returns the largest of two signed numbers.*/function max(int256 a, int256 b) internal pure returns (int256) {return a > b ? a : b;}/*** @dev Returns the smallest of two signed numbers.*/function min(int256 a, int256 b) internal pure returns (int256) {return a < b ? a : b;}/*** @dev Returns the average of two signed numbers without overflow.* The result is rounded towards zero.*/function average(int256 a, int256 b) internal pure returns (int256) {// Formula from the book "Hacker's Delight"int256 x = (a & b) + ((a ^ b) >> 1);return x + (int256(uint256(x) >> 255) & (a ^ b));}/*** @dev Returns the absolute unsigned value of a signed value.*/function abs(int256 n) internal pure returns (uint256) {unchecked {// must be unchecked in order to support `n = type(int256).min`return uint256(n >= 0 ? n : -n);}
@gnus.ai/contracts-upgradeable-diamond/contracts/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)pragma solidity ^0.8.2;import "../../utils/AddressUpgradeable.sol";import { InitializableStorage } from "./InitializableStorage.sol";/*** @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.** The initialization functions use a version number. Once a version number is used, it is consumed and cannot be* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in* case an upgrade adds a module that needs to be initialized.** For example:** [.hljs-theme-light.nopadding]* ```solidity* contract MyToken is ERC20Upgradeable {* function initialize() initializer public {* __ERC20_init("MyToken", "MTK");* }* }** contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {* function initializeV2() reinitializer(2) public {* __ERC20Permit_init("MyToken");* }* }* ```** TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.** CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.*
contracts/lit-node/Staking.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/******************************************************************************\* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535** Implementation of a diamond./******************************************************************************/import { LibDiamond } from "../libraries/LibDiamond.sol";import { IDiamondCut } from "../interfaces/IDiamondCut.sol";import { IDiamondLoupe } from "../interfaces/IDiamondLoupe.sol";import { IERC173 } from "../interfaces/IERC173.sol";import { IERC165 } from "../interfaces/IERC165.sol";import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";import { ContractResolver } from "../lit-core/ContractResolver.sol";import { LibStakingStorage } from "./Staking/LibStakingStorage.sol";// When no function exists for function callederror FunctionNotFound(bytes4 _functionSelector);// This is used in diamond constructor// more arguments are added to this struct// this avoids stack too deep errorsstruct StakingArgs {address owner;address init;bytes initCalldata;address contractResolver;ContractResolver.Env env;}contract Staking {constructor(IDiamondCut.FacetCut[] memory _diamondCut,StakingArgs memory _args) payable {LibDiamond.setContractOwner(_args.owner);LibDiamond.diamondCut(_diamondCut, _args.init, _args.initCalldata);
@openzeppelin/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)pragma solidity ^0.8.0;import "./IERC20.sol";import "./extensions/IERC20Metadata.sol";import "../../utils/Context.sol";/*** @dev Implementation of the {IERC20} interface.** This implementation is agnostic to the way tokens are created. This means* that a supply mechanism has to be added in a derived contract using {_mint}.* For a generic mechanism see {ERC20PresetMinterPauser}.** TIP: For a detailed writeup see our guide* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How* to implement supply mechanisms].** The default value of {decimals} is 18. To change this, you should override* this function so it returns a different value.** We have followed general OpenZeppelin Contracts guidelines: functions revert* instead returning `false` on failure. This behavior is nonetheless* conventional and does not conflict with the expectations of ERC20* applications.** Additionally, an {Approval} event is emitted on calls to {transferFrom}.* This allows applications to reconstruct the allowance for all accounts just* by listening to said events. Other implementations of the EIP may not emit* these events, as it isn't required by the specification.** Finally, the non-standard {decreaseAllowance} and {increaseAllowance}* functions have been added to mitigate the well-known issues around setting* allowances. See {IERC20-approve}.*/contract ERC20 is Context, IERC20, IERC20Metadata {mapping(address => uint256) private _balances;mapping(address => mapping(address => uint256)) private _allowances;
@openzeppelin/contracts/utils/structs/EnumerableSet.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.pragma solidity ^0.8.0;/*** @dev Library for managing* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive* types.** Sets have the following properties:** - Elements are added, removed, and checked for existence in constant time* (O(1)).* - Elements are enumerated in O(n). No guarantees are made on the ordering.** ```solidity* contract Example {* // Add the library methods* using EnumerableSet for EnumerableSet.AddressSet;** // Declare a set state variable* EnumerableSet.AddressSet private mySet;* }* ```** As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)* and `uint256` (`UintSet`) are supported.** [WARNING]* ====* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure* unusable.* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.** In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an* array of EnumerableSet.* ====*/library EnumerableSet {
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/extensions/ERC721BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)pragma solidity ^0.8.0;import "../ERC721Upgradeable.sol";import "../../../utils/ContextUpgradeable.sol";import "../../../proxy/utils/Initializable.sol";/*** @title ERC721 Burnable Token* @dev ERC721 Token that can be burned (destroyed).*/abstract contract ERC721BurnableUpgradeable is Initializable, ContextUpgradeable, ERC721Upgradeable {function __ERC721Burnable_init() internal onlyInitializing {}function __ERC721Burnable_init_unchained() internal onlyInitializing {}/*** @dev Burns `tokenId`. See {ERC721-_burn}.** Requirements:** - The caller must own `tokenId` or be an approved operator.*/function burn(uint256 tokenId) public virtual {//solhint-disable-next-line max-line-lengthrequire(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");_burn(tokenId);}}
contracts/libraries/LibDiamond.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/******************************************************************************\* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535/******************************************************************************/import { IDiamond } from "../interfaces/IDiamond.sol";import { IDiamondCut } from "../interfaces/IDiamondCut.sol";// Remember to add the loupe functions from DiamondLoupeFacet to the diamond.// The loupe functions are required by the EIP2535 Diamonds standarderror NoSelectorsGivenToAdd();error NotContractOwner(address _user, address _contractOwner);error NoSelectorsProvidedForFacetForCut(address _facetAddress);error CannotAddSelectorsToZeroAddress(bytes4[] _selectors);error NoBytecodeAtAddress(address _contractAddress, string _message);error IncorrectFacetCutAction(uint8 _action);error CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);error CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);error CannotReplaceImmutableFunction(bytes4 _selector);error CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);error CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);error RemoveFacetAddressMustBeZeroAddress(address _facetAddress);error CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);error CannotRemoveImmutableFunction(bytes4 _selector);error InitializationFunctionReverted(address _initializationContractAddress,bytes _calldata);library LibDiamond {bytes32 constant DIAMOND_STORAGE_POSITION =keccak256("diamond.standard.diamond.storage");struct FacetAddressAndSelectorPosition {address facetAddress;uint16 selectorPosition;
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)pragma solidity ^0.8.0;import "../ERC721Upgradeable.sol";import "./IERC721EnumerableUpgradeable.sol";import { ERC721EnumerableStorage } from "./ERC721EnumerableStorage.sol";import "../../../proxy/utils/Initializable.sol";/*** @dev This implements an optional extension of {ERC721} defined in the EIP that adds* enumerability of all the token ids in the contract as well as all token ids owned by each* account.*/abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {using ERC721EnumerableStorage for ERC721EnumerableStorage.Layout;function __ERC721Enumerable_init() internal onlyInitializing {}function __ERC721Enumerable_init_unchained() internal onlyInitializing {}/*** @dev See {IERC165-supportsInterface}.*/function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) {return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);}/*** @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.*/function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");return ERC721EnumerableStorage.layout()._ownedTokens[owner][index];}/*** @dev See {IERC721Enumerable-totalSupply}.*/
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)pragma solidity ^0.8.0;import "../IERC20.sol";/*** @dev Interface for the optional metadata functions from the ERC20 standard.** _Available since v4.1._*/interface IERC20Metadata is IERC20 {/*** @dev Returns the name of the token.*/function name() external view returns (string memory);/*** @dev Returns the symbol of the token.*/function symbol() external view returns (string memory);/*** @dev Returns the decimals places of the token.*/function decimals() external view returns (uint8);}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)pragma solidity ^0.8.0;import "../utils/Context.sol";/*** @dev Contract module which provides a basic access control mechanism, where* there is an account (an owner) that can be granted exclusive access to* specific functions.** By default, the owner account will be the one that deploys the contract. This* can later be changed with {transferOwnership}.** This module is used through inheritance. It will make available the modifier* `onlyOwner`, which can be applied to your functions to restrict their use to* the owner.*/abstract contract Ownable is Context {address private _owner;event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);/*** @dev Initializes the contract setting the deployer as the initial owner.*/constructor() {_transferOwnership(_msgSender());}/*** @dev Throws if called by any account other than the owner.*/modifier onlyOwner() {_checkOwner();_;}/*** @dev Returns the address of the current owner.
@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/ERC721Storage.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import { ERC721Upgradeable } from "./ERC721Upgradeable.sol";library ERC721Storage {struct Layout {// Token namestring _name;// Token symbolstring _symbol;// Mapping from token ID to owner addressmapping(uint256 => address) _owners;// Mapping owner address to token countmapping(address => uint256) _balances;// Mapping from token ID to approved addressmapping(uint256 => address) _tokenApprovals;// Mapping from owner to operator approvalsmapping(address => mapping(address => bool)) _operatorApprovals;}bytes32 internal constant STORAGE_SLOT = keccak256('openzeppelin.contracts.storage.ERC721');function layout() internal pure returns (Layout storage l) {bytes32 slot = STORAGE_SLOT;assembly {l.slot := slot}}}
contracts/lit-node/PKPNFT/PKPNFTFacet.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { ERC721Upgradeable } from "@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/ERC721Upgradeable.sol";import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";import { ERC721BurnableUpgradeable } from "@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/extensions/ERC721BurnableUpgradeable.sol";import { ERC721EnumerableUpgradeable } from "@gnus.ai/contracts-upgradeable-diamond/contracts/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol";import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";import { ERC165Upgradeable } from "@gnus.ai/contracts-upgradeable-diamond/contracts/utils/introspection/ERC165Upgradeable.sol";import { IERC165Upgradeable } from "@gnus.ai/contracts-upgradeable-diamond/contracts/utils/introspection/IERC165Upgradeable.sol";import { LibDiamond } from "../../libraries/LibDiamond.sol";import { LibPKPNFTStorage } from "./LibPKPNFTStorage.sol";import { IPubkeyRouter } from "../PubkeyRouter/LibPubkeyRouterStorage.sol";import { PubkeyRouterFacet } from "../PubkeyRouter/PubkeyRouterFacet.sol";import { PKPNFTMetadata } from "../PKPNFTMetadata.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";import { PKPPermissionsFacet } from "../PKPPermissions/PKPPermissionsFacet.sol";import "hardhat/console.sol";// TODO: tests for the mintGrantAndBurn function, withdraw function, some of the setters, transfer function, freeMint and freeMintGrantAndBurn/// @title Programmable Keypair NFT////// @dev This is the contract for the PKP NFTs////// Simply put, whomever owns a PKP NFT can ask that PKP to sign a message./// The owner can also grant signing permissions to other eth addresses/// or lit actionscontract PKPNFTFacet isERC721Upgradeable,ERC721BurnableUpgradeable,ERC721EnumerableUpgradeable{using Strings for uint256;error CallerNotOwner();
contracts/interfaces/IDiamondLoupe.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/******************************************************************************\* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535/******************************************************************************/// A loupe is a small magnifying glass used to look at diamonds.// These functions look at diamondsinterface IDiamondLoupe {/// These functions are expected to be called frequently/// by tools.struct Facet {address facetAddress;bytes4[] functionSelectors;}/// @notice Gets all facet addresses and their four byte function selectors./// @return facets_ Facetfunction facets() external view returns (Facet[] memory facets_);/// @notice Gets all the function selectors supported by a specific facet./// @param _facet The facet address./// @return facetFunctionSelectors_function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);/// @notice Get all the facet addresses used by a diamond./// @return facetAddresses_function facetAddresses()externalviewreturns (address[] memory facetAddresses_);/// @notice Gets the facet that supports the given selector./// @dev If facet is not found return address(0)./// @param _functionSelector The function selector./// @return facetAddress_ The facet address.
@gnus.ai/contracts-upgradeable-diamond/contracts/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)pragma solidity ^0.8.1;/*** @dev Collection of functions related to the address type*/library AddressUpgradeable {/*** @dev Returns true if `account` is a contract.** [IMPORTANT]* ====* It is unsafe to assume that an address for which this function returns* false is an externally-owned account (EOA) and not a contract.** Among others, `isContract` will return false for the following* types of addresses:** - an externally-owned account* - a contract in construction* - an address where a contract will be created* - an address where a contract lived, but was destroyed** Furthermore, `isContract` will also return true if the target contract within* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,* which only has an effect at the end of a transaction.* ====** [IMPORTANT]* ====* You shouldn't rely on `isContract` to protect against flash loan attacks!** Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract* constructor.* ====*/function isContract(address account) internal view returns (bool) {// This method relies on extcodesize/address.code.length, which returns 0
contracts/lit-node/PubkeyRouter/PubkeyRouterFacet.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import "solidity-bytes-utils/contracts/BytesLib.sol";import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";import { LibDiamond } from "../../libraries/LibDiamond.sol";import { PKPNFT } from "../PKPNFT.sol";import { Staking } from "../Staking.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";import { IKeyDeriver } from "../HDKeyDeriver.sol";import { StakingFacet } from "../Staking/StakingFacet.sol";import { StakingViewsFacet } from "../Staking/StakingViewsFacet.sol";import { PKPNFTFacet } from "../PKPNFT/PKPNFTFacet.sol";import { LibPubkeyRouterStorage, IPubkeyRouter } from "./LibPubkeyRouterStorage.sol";import "hardhat/console.sol";// TODO: make the tests send PKPNFT into the constructor// TODO: test interaction between PKPNFT and this contract, like mint a keypair and see if you can access it// TODO: setRoutingData() for a batch of keyscontract PubkeyRouterFacet {using EnumerableSet for EnumerableSet.AddressSet;using EnumerableSet for EnumerableSet.Bytes32Set;using EnumerableSet for EnumerableSet.UintSet;using BytesLib for bytes;/* ========== Errors ========== */error CallerNotOwner();/* ========== Modifiers ========== */modifier onlyPKPOwner(uint256 tokenId) {// check that user is allowed to set thisPKPNFTFacet pkpNFT = PKPNFTFacet(getPkpNftAddress());address nftOwner = pkpNFT.ownerOf(tokenId);require(msg.sender == nftOwner, "Not PKP NFT owner");_;}
@gnus.ai/contracts-upgradeable-diamond/contracts/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {/*** @dev Returns true if this contract implements the interface defined by* `interfaceId`. See the corresponding* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]* to learn more about how these ids are created.** This function call must use less than 30 000 gas.*/function supportsInterface(bytes4 interfaceId) external view returns (bool);}
contracts/lit-node/PKPPermissions/LibPKPPermissionsStorage.sol
//SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";import "solidity-bytes-utils/contracts/BytesLib.sol";import { ContractResolver } from "../../lit-core/ContractResolver.sol";library LibPKPPermissionsStorage {using EnumerableSet for EnumerableSet.AddressSet;using EnumerableSet for EnumerableSet.Bytes32Set;using EnumerableSet for EnumerableSet.UintSet;using BytesLib for bytes;using BitMaps for BitMaps.BitMap;bytes32 constant PKP_PERMISSIONS_POSITION =keccak256("pkppermissions.storage");struct AuthMethod {uint256 authMethodType; // 1 = address, 2 = action, 3 = WebAuthn, 4 = Discord, 5 = Google, 6 = Google JWT, 7 = OTP, 8 = Apple JWT. Not doing this in an enum so that we can add more auth methods in the future without redeploying.bytes id; // the id of the auth method. For address, this is an eth address. For action, this is an IPFS CID. For WebAuthn, this is the credentialId. For Discord, this is the user's Discord ID. For Google, this is the user's Google ID.bytes userPubkey; // the user's pubkey. This is used for WebAuthn.}struct PKPPermissionsStorage {ContractResolver contractResolver;ContractResolver.Env env;// map the keccack256(uncompressed pubkey) -> set of auth methodsmapping(uint256 => EnumerableSet.UintSet) permittedAuthMethods;// map the keccack256(uncompressed pubkey) -> auth_method_id -> scope idmapping(uint256 => mapping(uint256 => BitMaps.BitMap)) permittedAuthMethodScopes;// map the keccack256(authMethodType, userId) -> the actual AuthMethod structmapping(uint256 => AuthMethod) authMethods;// map the AuthMethod hash to the pubkeys that it's allowed to sign for// this makes it possible to be given a discord id and then lookup all the pubkeys that are allowed to sign for that discord idmapping(uint256 => EnumerableSet.UintSet) authMethodToPkpIds;// map the keccack256(uncompressed pubkey) -> (group => merkle tree root hash)mapping(uint256 => mapping(uint256 => bytes32)) _rootHashes;}
@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/structs/BitMaps.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/BitMaps.sol)pragma solidity ^0.8.0;/*** @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.* Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].*/library BitMaps {struct BitMap {mapping(uint256 => uint256) _data;}/*** @dev Returns whether the bit at `index` is set.*/function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {uint256 bucket = index >> 8;uint256 mask = 1 << (index & 0xff);return bitmap._data[bucket] & mask != 0;}/*** @dev Sets the bit at `index` to the boolean `value`.*/function setTo(BitMap storage bitmap, uint256 index, bool value) internal {if (value) {set(bitmap, index);} else {unset(bitmap, index);}}/*** @dev Sets the bit at `index`.*/function set(BitMap storage bitmap, uint256 index) internal {uint256 bucket = index >> 8;uint256 mask = 1 << (index & 0xff);bitmap._data[bucket] |= mask;}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)pragma solidity ^0.8.0;/*** @dev Interface of the ERC20 standard as defined in the EIP.*/interface IERC20 {/*** @dev Emitted when `value` tokens are moved from one account (`from`) to* another (`to`).** Note that `value` may be zero.*/event Transfer(address indexed from, address indexed to, uint256 value);/*** @dev Emitted when the allowance of a `spender` for an `owner` is set by* a call to {approve}. `value` is the new allowance.*/event Approval(address indexed owner, address indexed spender, uint256 value);/*** @dev Returns the amount of tokens in existence.*/function totalSupply() external view returns (uint256);/*** @dev Returns the amount of tokens owned by `account`.*/function balanceOf(address account) external view returns (uint256);/*** @dev Moves `amount` tokens from the caller's account to `to`.** Returns a boolean value indicating whether the operation succeeded.** Emits a {Transfer} event.*/function transfer(address to, uint256 amount) external returns (bool);
@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);
@gnus.ai/contracts-upgradeable-diamond/contracts/utils/math/SignedMathUpgradeable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)pragma solidity ^0.8.0;/*** @dev Standard signed math utilities missing in the Solidity language.*/library SignedMathUpgradeable {/*** @dev Returns the largest of two signed numbers.*/function max(int256 a, int256 b) internal pure returns (int256) {return a > b ? a : b;}/*** @dev Returns the smallest of two signed numbers.*/function min(int256 a, int256 b) internal pure returns (int256) {return a < b ? a : b;}/*** @dev Returns the average of two signed numbers without overflow.* The result is rounded towards zero.*/function average(int256 a, int256 b) internal pure returns (int256) {// Formula from the book "Hacker's Delight"int256 x = (a & b) + ((a ^ b) >> 1);return x + (int256(uint256(x) >> 255) & (a ^ b));}/*** @dev Returns the absolute unsigned value of a signed value.*/function abs(int256 n) internal pure returns (uint256) {unchecked {// must be unchecked in order to support `n = type(int256).min`return uint256(n >= 0 ? n : -n);}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_resolver","internalType":"address"},{"type":"uint8","name":"_env","internalType":"enum ContractResolver.Env"}]},{"type":"event","name":"ContractResolverAddressSet","inputs":[{"type":"address","name":"newResolverAddress","internalType":"address","indexed":false}],"anonymous":false},{"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":"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":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimAndMintNextAndAddAuthMethods","inputs":[{"type":"tuple","name":"claimMaterial","internalType":"struct LibPKPNFTStorage.ClaimMaterial","components":[{"type":"uint256","name":"keyType","internalType":"uint256"},{"type":"bytes32","name":"derivedKeyId","internalType":"bytes32"},{"type":"tuple[]","name":"signatures","internalType":"struct IPubkeyRouter.Signature[]","components":[{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"},{"type":"uint8","name":"v","internalType":"uint8"}]}]},{"type":"tuple","name":"authMethodData","internalType":"struct PKPHelper.AuthMethodData","components":[{"type":"uint256","name":"keyType","internalType":"uint256"},{"type":"bytes[]","name":"permittedIpfsCIDs","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedIpfsCIDScopes","internalType":"uint256[][]"},{"type":"address[]","name":"permittedAddresses","internalType":"address[]"},{"type":"uint256[][]","name":"permittedAddressScopes","internalType":"uint256[][]"},{"type":"uint256[]","name":"permittedAuthMethodTypes","internalType":"uint256[]"},{"type":"bytes[]","name":"permittedAuthMethodIds","internalType":"bytes[]"},{"type":"bytes[]","name":"permittedAuthMethodPubkeys","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedAuthMethodScopes","internalType":"uint256[][]"},{"type":"bool","name":"addPkpEthAddressAsPermittedAddress","internalType":"bool"},{"type":"bool","name":"sendPkpToItself","internalType":"bool"}]}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimAndMintNextAndAddAuthMethodsWithTypes","inputs":[{"type":"tuple","name":"claimMaterial","internalType":"struct LibPKPNFTStorage.ClaimMaterial","components":[{"type":"uint256","name":"keyType","internalType":"uint256"},{"type":"bytes32","name":"derivedKeyId","internalType":"bytes32"},{"type":"tuple[]","name":"signatures","internalType":"struct IPubkeyRouter.Signature[]","components":[{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"},{"type":"uint8","name":"v","internalType":"uint8"}]}]},{"type":"tuple","name":"authMethodData","internalType":"struct PKPHelper.AuthMethodData","components":[{"type":"uint256","name":"keyType","internalType":"uint256"},{"type":"bytes[]","name":"permittedIpfsCIDs","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedIpfsCIDScopes","internalType":"uint256[][]"},{"type":"address[]","name":"permittedAddresses","internalType":"address[]"},{"type":"uint256[][]","name":"permittedAddressScopes","internalType":"uint256[][]"},{"type":"uint256[]","name":"permittedAuthMethodTypes","internalType":"uint256[]"},{"type":"bytes[]","name":"permittedAuthMethodIds","internalType":"bytes[]"},{"type":"bytes[]","name":"permittedAuthMethodPubkeys","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedAuthMethodScopes","internalType":"uint256[][]"},{"type":"bool","name":"addPkpEthAddressAsPermittedAddress","internalType":"bool"},{"type":"bool","name":"sendPkpToItself","internalType":"bool"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ContractResolver"}],"name":"contractResolver","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum ContractResolver.Env"}],"name":"env","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getDomainWalletRegistry","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getPKPNftMetdataAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getPkpNftAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getPkpPermissionsAddress","inputs":[]},{"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":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintNextAndAddAuthMethods","inputs":[{"type":"uint256","name":"keyType","internalType":"uint256"},{"type":"uint256[]","name":"permittedAuthMethodTypes","internalType":"uint256[]"},{"type":"bytes[]","name":"permittedAuthMethodIds","internalType":"bytes[]"},{"type":"bytes[]","name":"permittedAuthMethodPubkeys","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedAuthMethodScopes","internalType":"uint256[][]"},{"type":"bool","name":"addPkpEthAddressAsPermittedAddress","internalType":"bool"},{"type":"bool","name":"sendPkpToItself","internalType":"bool"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintNextAndAddAuthMethodsWithTypes","inputs":[{"type":"uint256","name":"keyType","internalType":"uint256"},{"type":"bytes[]","name":"permittedIpfsCIDs","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedIpfsCIDScopes","internalType":"uint256[][]"},{"type":"address[]","name":"permittedAddresses","internalType":"address[]"},{"type":"uint256[][]","name":"permittedAddressScopes","internalType":"uint256[][]"},{"type":"uint256[]","name":"permittedAuthMethodTypes","internalType":"uint256[]"},{"type":"bytes[]","name":"permittedAuthMethodIds","internalType":"bytes[]"},{"type":"bytes[]","name":"permittedAuthMethodPubkeys","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedAuthMethodScopes","internalType":"uint256[][]"},{"type":"bool","name":"addPkpEthAddressAsPermittedAddress","internalType":"bool"},{"type":"bool","name":"sendPkpToItself","internalType":"bool"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintNextAndAddDomainWalletMetadata","inputs":[{"type":"uint256","name":"keyType","internalType":"uint256"},{"type":"uint256[]","name":"permittedAuthMethodTypes","internalType":"uint256[]"},{"type":"bytes[]","name":"permittedAuthMethodIds","internalType":"bytes[]"},{"type":"bytes[]","name":"permittedAuthMethodPubkeys","internalType":"bytes[]"},{"type":"uint256[][]","name":"permittedAuthMethodScopes","internalType":"uint256[][]"},{"type":"string[]","name":"nftMetadata","internalType":"string[]"},{"type":"bool","name":"addPkpEthAddressAsPermittedAddress","internalType":"bool"},{"type":"bool","name":"sendPkpToItself","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC721Received","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removePkpMetadata","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"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":"setContractResolver","inputs":[{"type":"address","name":"newResolverAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPkpMetadata","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"string[]","name":"nftMetadata","internalType":"string[]"}]},{"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
0x60806040523480156200001157600080fd5b506040516200581a3803806200581a83398181016040528101906200003791906200022b565b620000576200004b620000cd60201b60201c565b620000d560201b60201c565b81600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260146101000a81548160ff02191690836002811115620000c057620000bf62000272565b5b02179055505050620002a1565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620001cb826200019e565b9050919050565b620001dd81620001be565b8114620001e957600080fd5b50565b600081519050620001fd81620001d2565b92915050565b600381106200021157600080fd5b50565b600081519050620002258162000203565b92915050565b6000806040838503121562000245576200024462000199565b5b60006200025585828601620001ec565b9250506020620002688582860162000214565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b61556980620002b16000396000f3fe6080604052600436106101665760003560e01c8063715018a6116100d15780639fba176b1161008a578063d547741f11610064578063d547741f14610532578063f2fde38b1461055b578063f95d71b114610584578063ffc83325146105ad57610166565b80639fba176b146104ac578063a217fddf146104dc578063caead0c71461050757610166565b8063715018a6146103ae57806373cc4111146103c5578063782e2ea5146103f05780638da5cb5b1461041957806391d14854146104445780639dca00321461048157610166565b80632b553551116101235780632b553551146102b25780632f2ff15d146102db5780633276558c1461030457806336568abe1461032f5780635043026c1461035857806350d17b5e1461038357610166565b806301ffc9a71461016b57806313af411b146101a8578063150b7a02146101d85780631f71cb3114610215578063202f724f14610245578063248a9ca314610275575b600080fd5b34801561017757600080fd5b50610192600480360381019061018d91906132d0565b6105dd565b60405161019f9190613318565b60405180910390f35b6101c260048036038101906101bd9190613c92565b610657565b6040516101cf9190613d19565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190613d8f565b610e13565b60405161020c9190613e26565b60405180910390f35b61022f600480360381019061022a9190613e41565b610e9d565b60405161023c9190613d19565b60405180910390f35b61025f600480360381019061025a9190613c92565b61159b565b60405161026c9190613d19565b60405180910390f35b34801561028157600080fd5b5061029c60048036038101906102979190614015565b6115af565b6040516102a99190614051565b60405180910390f35b3480156102be57600080fd5b506102d960048036038101906102d4919061406c565b6115cf565b005b3480156102e757600080fd5b5061030260048036038101906102fd9190614099565b61185f565b005b34801561031057600080fd5b50610319611880565b60405161032691906140e8565b60405180910390f35b34801561033b57600080fd5b5061035660048036038101906103519190614099565b6119c4565b005b34801561036457600080fd5b5061036d611a47565b60405161037a91906140e8565b60405180910390f35b34801561038f57600080fd5b50610398611b8b565b6040516103a59190614162565b60405180910390f35b3480156103ba57600080fd5b506103c3611bb1565b005b3480156103d157600080fd5b506103da611bc5565b6040516103e791906140e8565b60405180910390f35b3480156103fc57600080fd5b50610417600480360381019061041291906142ff565b611d09565b005b34801561042557600080fd5b5061042e611fdf565b60405161043b91906140e8565b60405180910390f35b34801561045057600080fd5b5061046b60048036038101906104669190614099565b612008565b6040516104789190613318565b60405180910390f35b34801561048d57600080fd5b50610496612073565b6040516104a391906143d2565b60405180910390f35b6104c660048036038101906104c191906143ed565b612086565b6040516104d39190613d19565b60405180910390f35b3480156104e857600080fd5b506104f16121db565b6040516104fe9190614051565b60405180910390f35b34801561051357600080fd5b5061051c6121e2565b60405161052991906140e8565b60405180910390f35b34801561053e57600080fd5b5061055960048036038101906105549190614099565b612326565b005b34801561056757600080fd5b50610582600480360381019061057d91906144ff565b612347565b005b34801561059057600080fd5b506105ab60048036038101906105a691906144ff565b6123ca565b005b6105c760048036038101906105c2919061452c565b61244d565b6040516105d49190613d19565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610650575061064f82612bec565b5b9050919050565b600081600001518360000151146106a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069a906146f1565b60405180910390fd5b60006106ad6121e2565b73ffffffffffffffffffffffffffffffffffffffff1663c70384b8348660000151876020015188604001516040518563ffffffff1660e01b81526004016106f693929190614820565b60206040518083038185885af1158015610714573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107399190614873565b905082604001515183602001515114610787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077e90614912565b60405180910390fd5b826080015151836060015151146107d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ca906149a4565b60405180910390fd5b8260c00151518360a00151511461081f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081690614a36565b60405180910390fd5b8260e00151518360a00151511461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290614ac8565b60405180910390fd5b826101000151518360a0015151146108b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108af90614b5a565b60405180910390fd5b60008360200151511461099c5760005b83602001515181101561099a576108dd611880565b73ffffffffffffffffffffffffffffffffffffffff16638a43157883866020015184815181106109105761090f614b7a565b5b60200260200101518760400151858151811061092f5761092e614b7a565b5b60200260200101516040518463ffffffff1660e01b815260040161095593929190614ce6565b600060405180830381600087803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b50505050808061099290614d5a565b9150506108c8565b505b600083606001515114610a805760005b836060015151811015610a7e576109c1611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c12183866060015184815181106109f4576109f3614b7a565b5b602002602001015187608001518581518110610a1357610a12614b7a565b5b60200260200101516040518463ffffffff1660e01b8152600401610a3993929190614da2565b600060405180830381600087803b158015610a5357600080fd5b505af1158015610a67573d6000803e3d6000fd5b505050508080610a7690614d5a565b9150506109ac565b505b60008360a001515114610bbb5760005b8360a0015151811015610bb957610aa5611880565b73ffffffffffffffffffffffffffffffffffffffff16639dd4349b8360405180606001604052808860a001518681518110610ae357610ae2614b7a565b5b602002602001015181526020018860c001518681518110610b0757610b06614b7a565b5b602002602001015181526020018860e001518681518110610b2b57610b2a614b7a565b5b60200260200101518152508761010001518581518110610b4e57610b4d614b7a565b5b60200260200101516040518463ffffffff1660e01b8152600401610b7493929190614e81565b600060405180830381600087803b158015610b8e57600080fd5b505af1158015610ba2573d6000803e3d6000fd5b505050508080610bb190614d5a565b915050610a90565b505b6000610bc5611880565b73ffffffffffffffffffffffffffffffffffffffff1663bd4986a0836040518263ffffffff1660e01b8152600401610bfd9190613d19565b602060405180830381865afa158015610c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3e9190614edb565b905083610120015115610d0b57610c53611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c1218383600067ffffffffffffffff811115610c8b57610c8a613349565b5b604051908082528060200260200182016040528015610cb95781602001602082028036833780820191505090505b506040518463ffffffff1660e01b8152600401610cd893929190614da2565b600060405180830381600087803b158015610cf257600080fd5b505af1158015610d06573d6000803e3d6000fd5b505050505b83610140015115610d9157610d1e6121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b8152600401610d5a93929190614f08565b600060405180830381600087803b158015610d7457600080fd5b505af1158015610d88573d6000803e3d6000fd5b50505050610e08565b610d996121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3033856040518463ffffffff1660e01b8152600401610dd593929190614f08565b600060405180830381600087803b158015610def57600080fd5b505af1158015610e03573d6000803e3d6000fd5b505050505b819250505092915050565b6000610e1d6121e2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8190614fb1565b60405180910390fd5b63150b7a0260e01b905095945050505050565b600080610ea86121e2565b73ffffffffffffffffffffffffffffffffffffffff16635d228b16348f6040518363ffffffff1660e01b8152600401610ee19190613d19565b60206040518083038185885af1158015610eff573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f249190614873565b90508a518c5114610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6190614912565b60405180910390fd5b88518a5114610fae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa5906149a4565b60405180910390fd5b8651885114610ff2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe990614a36565b60405180910390fd5b8551885114611036576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102d90614ac8565b60405180910390fd5b845188511461107a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107190614b5a565b60405180910390fd5b60008c511461114e5760005b8c5181101561114c57611097611880565b73ffffffffffffffffffffffffffffffffffffffff16638a431578838f84815181106110c6576110c5614b7a565b5b60200260200101518f85815181106110e1576110e0614b7a565b5b60200260200101516040518463ffffffff1660e01b815260040161110793929190614ce6565b600060405180830381600087803b15801561112157600080fd5b505af1158015611135573d6000803e3d6000fd5b50505050808061114490614d5a565b915050611086565b505b60008a51146112225760005b8a518110156112205761116b611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c121838d848151811061119a57611199614b7a565b5b60200260200101518d85815181106111b5576111b4614b7a565b5b60200260200101516040518463ffffffff1660e01b81526004016111db93929190614da2565b600060405180830381600087803b1580156111f557600080fd5b505af1158015611209573d6000803e3d6000fd5b50505050808061121890614d5a565b91505061115a565b505b60008851146113445760005b88518110156113425761123f611880565b73ffffffffffffffffffffffffffffffffffffffff16639dd4349b8360405180606001604052808d868151811061127957611278614b7a565b5b602002602001015181526020018c868151811061129957611298614b7a565b5b602002602001015181526020018b86815181106112b9576112b8614b7a565b5b60200260200101518152508985815181106112d7576112d6614b7a565b5b60200260200101516040518463ffffffff1660e01b81526004016112fd93929190614e81565b600060405180830381600087803b15801561131757600080fd5b505af115801561132b573d6000803e3d6000fd5b50505050808061133a90614d5a565b91505061122e565b505b600061134e611880565b73ffffffffffffffffffffffffffffffffffffffff1663bd4986a0836040518263ffffffff1660e01b81526004016113869190613d19565b602060405180830381865afa1580156113a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c79190614edb565b9050841561148f576113d7611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c1218383600067ffffffffffffffff81111561140f5761140e613349565b5b60405190808252806020026020018201604052801561143d5781602001602082028036833780820191505090505b506040518463ffffffff1660e01b815260040161145c93929190614da2565b600060405180830381600087803b15801561147657600080fd5b505af115801561148a573d6000803e3d6000fd5b505050505b83156115105761149d6121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b81526004016114d993929190614f08565b600060405180830381600087803b1580156114f357600080fd5b505af1158015611507573d6000803e3d6000fd5b50505050611587565b6115186121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3033856040518463ffffffff1660e01b815260040161155493929190614f08565b600060405180830381600087803b15801561156e57600080fd5b505af1158015611582573d6000803e3d6000fd5b505050505b81925050509b9a5050505050505050505050565b60006115a78383610657565b905092915050565b600060016000838152602001908152602001600020600101549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561167a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169e9190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b81526004016116cb929190615013565b602060405180830381865afa1580156116e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170c9190614edb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611779576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611770906150d4565b60405180910390fd5b6000611783611a47565b90508073ffffffffffffffffffffffffffffffffffffffff1663b63a7677836040518263ffffffff1660e01b81526004016117be9190613d19565b600060405180830381600087803b1580156117d857600080fd5b505af11580156117ec573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663519a218e836040518263ffffffff1660e01b81526004016118299190613d19565b600060405180830381600087803b15801561184357600080fd5b505af1158015611857573d6000803e3d6000fd5b505050505050565b611868826115af565b61187181612c56565b61187b8383612c6a565b505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639072f8386040518163ffffffff1660e01b8152600401602060405180830381865afa15801561192d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119519190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b815260040161197e929190615013565b602060405180830381865afa15801561199b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bf9190614edb565b905090565b6119cc612d4a565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611a39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3090615166565b60405180910390fd5b611a438282612d52565b5050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166316f76bbf6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611af4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b189190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b8152600401611b45929190615013565b602060405180830381865afa158015611b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b869190614edb565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611bb9612e34565b611bc36000612eb2565b565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c969190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b8152600401611cc3929190615013565b602060405180830381865afa158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d049190614edb565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd89190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b8152600401611e05929190615013565b602060405180830381865afa158015611e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e469190614edb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaa906150d4565b60405180910390fd5b6000611ebd611a47565b9050600082511115611fda578073ffffffffffffffffffffffffffffffffffffffff1663855eec228484600081518110611efa57611ef9614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401611f1f9291906151ca565b600060405180830381600087803b158015611f3957600080fd5b505af1158015611f4d573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16639000fee18484600181518110611f8257611f81614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401611fa79291906151ca565b600060405180830381600087803b158015611fc157600080fd5b505af1158015611fd5573d6000803e3d6000fd5b505050505b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600260149054906101000a900460ff1681565b60006121ce88600067ffffffffffffffff8111156120a7576120a6613349565b5b6040519080825280602002602001820160405280156120da57816020015b60608152602001906001900390816120c55790505b50600067ffffffffffffffff8111156120f6576120f5613349565b5b60405190808252806020026020018201604052801561212957816020015b60608152602001906001900390816121145790505b50600067ffffffffffffffff81111561214557612144613349565b5b6040519080825280602002602001820160405280156121735781602001602082028036833780820191505090505b50600067ffffffffffffffff81111561218f5761218e613349565b5b6040519080825280602002602001820160405280156121c257816020015b60608152602001906001900390816121ad5790505b508c8c8c8c8c8c610e9d565b9050979650505050505050565b6000801b81565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c0b8bf76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561228f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b39190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b81526004016122e0929190615013565b602060405180830381865afa1580156122fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123219190614edb565b905090565b61232f826115af565b61233881612c56565b6123428383612d52565b505050565b61234f612e34565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036123be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b59061526c565b60405180910390fd5b6123c781612eb2565b50565b6123d2612e34565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f2760073c7cd8cac531d7f643becbfbb74d8b8156443eacf879622532dbbb3cd58160405161244291906140e8565b60405180910390a150565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251e9190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b815260040161254b929190615013565b602060405180830381865afa158015612568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258c9190614edb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146125f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f0906150d4565b60405180910390fd5b60006126036121e2565b73ffffffffffffffffffffffffffffffffffffffff16635d228b16348c6040518363ffffffff1660e01b815260040161263c9190613d19565b60206040518083038185885af115801561265a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061267f9190614873565b905087518951146126c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126bc90614a36565b60405180910390fd5b8651895114612709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270090614ac8565b60405180910390fd5b855189511461274d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274490614b5a565b60405180910390fd5b600089511461286f5760005b895181101561286d5761276a611880565b73ffffffffffffffffffffffffffffffffffffffff16639dd4349b8360405180606001604052808e86815181106127a4576127a3614b7a565b5b602002602001015181526020018d86815181106127c4576127c3614b7a565b5b602002602001015181526020018c86815181106127e4576127e3614b7a565b5b60200260200101518152508a858151811061280257612801614b7a565b5b60200260200101516040518463ffffffff1660e01b815260040161282893929190614e81565b600060405180830381600087803b15801561284257600080fd5b505af1158015612856573d6000803e3d6000fd5b50505050808061286590614d5a565b915050612759565b505b6000612879611880565b73ffffffffffffffffffffffffffffffffffffffff1663bd4986a0836040518263ffffffff1660e01b81526004016128b19190613d19565b602060405180830381865afa1580156128ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f29190614edb565b905084156129ba57612902611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c1218383600067ffffffffffffffff81111561293a57612939613349565b5b6040519080825280602002602001820160405280156129685781602001602082028036833780820191505090505b506040518463ffffffff1660e01b815260040161298793929190614da2565b600060405180830381600087803b1580156129a157600080fd5b505af11580156129b5573d6000803e3d6000fd5b505050505b8315612a3b576129c86121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b8152600401612a0493929190614f08565b600060405180830381600087803b158015612a1e57600080fd5b505af1158015612a32573d6000803e3d6000fd5b50505050612ab2565b612a436121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3033856040518463ffffffff1660e01b8152600401612a7f93929190614f08565b600060405180830381600087803b158015612a9957600080fd5b505af1158015612aad573d6000803e3d6000fd5b505050505b600086511115612bdb57612ac4611a47565b73ffffffffffffffffffffffffffffffffffffffff1663855eec228388600081518110612af457612af3614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401612b199291906151ca565b600060405180830381600087803b158015612b3357600080fd5b505af1158015612b47573d6000803e3d6000fd5b50505050612b53611a47565b73ffffffffffffffffffffffffffffffffffffffff16639000fee18388600181518110612b8357612b82614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401612ba89291906151ca565b600060405180830381600087803b158015612bc257600080fd5b505af1158015612bd6573d6000803e3d6000fd5b505050505b819250505098975050505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612c6781612c62612d4a565b612f76565b50565b612c748282612008565b612d4657600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612ceb612d4a565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b612d5c8282612008565b15612e305760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612dd5612d4a565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b612e3c612d4a565b73ffffffffffffffffffffffffffffffffffffffff16612e5a611fdf565b73ffffffffffffffffffffffffffffffffffffffff1614612eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ea7906152d8565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612f808282612008565b612ff757612f8d81612ffb565b612f9b8360001c6020613028565b604051602001612fac9291906153cc565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fee9190615406565b60405180910390fd5b5050565b60606130218273ffffffffffffffffffffffffffffffffffffffff16601460ff16613028565b9050919050565b60606000600283600261303b9190615428565b613045919061546a565b67ffffffffffffffff81111561305e5761305d613349565b5b6040519080825280601f01601f1916602001820160405280156130905781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106130c8576130c7614b7a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061312c5761312b614b7a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261316c9190615428565b613176919061546a565b90505b6001811115613216577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106131b8576131b7614b7a565b5b1a60f81b8282815181106131cf576131ce614b7a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061320f9061549e565b9050613179565b506000841461325a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161325190615513565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6132ad81613278565b81146132b857600080fd5b50565b6000813590506132ca816132a4565b92915050565b6000602082840312156132e6576132e561326e565b5b60006132f4848285016132bb565b91505092915050565b60008115159050919050565b613312816132fd565b82525050565b600060208201905061332d6000830184613309565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61338182613338565b810181811067ffffffffffffffff821117156133a05761339f613349565b5b80604052505050565b60006133b3613264565b90506133bf8282613378565b919050565b600080fd5b6000819050919050565b6133dc816133c9565b81146133e757600080fd5b50565b6000813590506133f9816133d3565b92915050565b6000819050919050565b613412816133ff565b811461341d57600080fd5b50565b60008135905061342f81613409565b92915050565b600080fd5b600067ffffffffffffffff82111561345557613454613349565b5b602082029050602081019050919050565b600080fd5b600060ff82169050919050565b6134818161346b565b811461348c57600080fd5b50565b60008135905061349e81613478565b92915050565b6000606082840312156134ba576134b9613333565b5b6134c460606133a9565b905060006134d484828501613420565b60008301525060206134e884828501613420565b60208301525060406134fc8482850161348f565b60408301525092915050565b600061351b6135168461343a565b6133a9565b9050808382526020820190506060840283018581111561353e5761353d613466565b5b835b81811015613567578061355388826134a4565b845260208401935050606081019050613540565b5050509392505050565b600082601f83011261358657613585613435565b5b8135613596848260208601613508565b91505092915050565b6000606082840312156135b5576135b4613333565b5b6135bf60606133a9565b905060006135cf848285016133ea565b60008301525060206135e384828501613420565b602083015250604082013567ffffffffffffffff811115613607576136066133c4565b5b61361384828501613571565b60408301525092915050565b600067ffffffffffffffff82111561363a57613639613349565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff82111561366b5761366a613349565b5b61367482613338565b9050602081019050919050565b82818337600083830152505050565b60006136a361369e84613650565b6133a9565b9050828152602081018484840111156136bf576136be61364b565b5b6136ca848285613681565b509392505050565b600082601f8301126136e7576136e6613435565b5b81356136f7848260208601613690565b91505092915050565b600061371361370e8461361f565b6133a9565b9050808382526020820190506020840283018581111561373657613735613466565b5b835b8181101561377d57803567ffffffffffffffff81111561375b5761375a613435565b5b80860161376889826136d2565b85526020850194505050602081019050613738565b5050509392505050565b600082601f83011261379c5761379b613435565b5b81356137ac848260208601613700565b91505092915050565b600067ffffffffffffffff8211156137d0576137cf613349565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156137fc576137fb613349565b5b602082029050602081019050919050565b600061382061381b846137e1565b6133a9565b9050808382526020820190506020840283018581111561384357613842613466565b5b835b8181101561386c578061385888826133ea565b845260208401935050602081019050613845565b5050509392505050565b600082601f83011261388b5761388a613435565b5b813561389b84826020860161380d565b91505092915050565b60006138b76138b2846137b5565b6133a9565b905080838252602082019050602084028301858111156138da576138d9613466565b5b835b8181101561392157803567ffffffffffffffff8111156138ff576138fe613435565b5b80860161390c8982613876565b855260208501945050506020810190506138dc565b5050509392505050565b600082601f8301126139405761393f613435565b5b81356139508482602086016138a4565b91505092915050565b600067ffffffffffffffff82111561397457613973613349565b5b602082029050602081019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006139b082613985565b9050919050565b6139c0816139a5565b81146139cb57600080fd5b50565b6000813590506139dd816139b7565b92915050565b60006139f66139f184613959565b6133a9565b90508083825260208201905060208402830185811115613a1957613a18613466565b5b835b81811015613a425780613a2e88826139ce565b845260208401935050602081019050613a1b565b5050509392505050565b600082601f830112613a6157613a60613435565b5b8135613a718482602086016139e3565b91505092915050565b613a83816132fd565b8114613a8e57600080fd5b50565b600081359050613aa081613a7a565b92915050565b60006101608284031215613abd57613abc613333565b5b613ac86101606133a9565b90506000613ad8848285016133ea565b600083015250602082013567ffffffffffffffff811115613afc57613afb6133c4565b5b613b0884828501613787565b602083015250604082013567ffffffffffffffff811115613b2c57613b2b6133c4565b5b613b388482850161392b565b604083015250606082013567ffffffffffffffff811115613b5c57613b5b6133c4565b5b613b6884828501613a4c565b606083015250608082013567ffffffffffffffff811115613b8c57613b8b6133c4565b5b613b988482850161392b565b60808301525060a082013567ffffffffffffffff811115613bbc57613bbb6133c4565b5b613bc884828501613876565b60a08301525060c082013567ffffffffffffffff811115613bec57613beb6133c4565b5b613bf884828501613787565b60c08301525060e082013567ffffffffffffffff811115613c1c57613c1b6133c4565b5b613c2884828501613787565b60e08301525061010082013567ffffffffffffffff811115613c4d57613c4c6133c4565b5b613c598482850161392b565b61010083015250610120613c6f84828501613a91565b61012083015250610140613c8584828501613a91565b6101408301525092915050565b60008060408385031215613ca957613ca861326e565b5b600083013567ffffffffffffffff811115613cc757613cc6613273565b5b613cd38582860161359f565b925050602083013567ffffffffffffffff811115613cf457613cf3613273565b5b613d0085828601613aa6565b9150509250929050565b613d13816133c9565b82525050565b6000602082019050613d2e6000830184613d0a565b92915050565b600080fd5b60008083601f840112613d4f57613d4e613435565b5b8235905067ffffffffffffffff811115613d6c57613d6b613d34565b5b602083019150836001820283011115613d8857613d87613466565b5b9250929050565b600080600080600060808688031215613dab57613daa61326e565b5b6000613db9888289016139ce565b9550506020613dca888289016139ce565b9450506040613ddb888289016133ea565b935050606086013567ffffffffffffffff811115613dfc57613dfb613273565b5b613e0888828901613d39565b92509250509295509295909350565b613e2081613278565b82525050565b6000602082019050613e3b6000830184613e17565b92915050565b60008060008060008060008060008060006101608c8e031215613e6757613e6661326e565b5b6000613e758e828f016133ea565b9b505060208c013567ffffffffffffffff811115613e9657613e95613273565b5b613ea28e828f01613787565b9a505060408c013567ffffffffffffffff811115613ec357613ec2613273565b5b613ecf8e828f0161392b565b99505060608c013567ffffffffffffffff811115613ef057613eef613273565b5b613efc8e828f01613a4c565b98505060808c013567ffffffffffffffff811115613f1d57613f1c613273565b5b613f298e828f0161392b565b97505060a08c013567ffffffffffffffff811115613f4a57613f49613273565b5b613f568e828f01613876565b96505060c08c013567ffffffffffffffff811115613f7757613f76613273565b5b613f838e828f01613787565b95505060e08c013567ffffffffffffffff811115613fa457613fa3613273565b5b613fb08e828f01613787565b9450506101008c013567ffffffffffffffff811115613fd257613fd1613273565b5b613fde8e828f0161392b565b935050610120613ff08e828f01613a91565b9250506101406140028e828f01613a91565b9150509295989b509295989b9093969950565b60006020828403121561402b5761402a61326e565b5b600061403984828501613420565b91505092915050565b61404b816133ff565b82525050565b60006020820190506140666000830184614042565b92915050565b6000602082840312156140825761408161326e565b5b6000614090848285016133ea565b91505092915050565b600080604083850312156140b0576140af61326e565b5b60006140be85828601613420565b92505060206140cf858286016139ce565b9150509250929050565b6140e2816139a5565b82525050565b60006020820190506140fd60008301846140d9565b92915050565b6000819050919050565b600061412861412361411e84613985565b614103565b613985565b9050919050565b600061413a8261410d565b9050919050565b600061414c8261412f565b9050919050565b61415c81614141565b82525050565b60006020820190506141776000830184614153565b92915050565b600067ffffffffffffffff82111561419857614197613349565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156141c4576141c3613349565b5b6141cd82613338565b9050602081019050919050565b60006141ed6141e8846141a9565b6133a9565b9050828152602081018484840111156142095761420861364b565b5b614214848285613681565b509392505050565b600082601f83011261423157614230613435565b5b81356142418482602086016141da565b91505092915050565b600061425d6142588461417d565b6133a9565b905080838252602082019050602084028301858111156142805761427f613466565b5b835b818110156142c757803567ffffffffffffffff8111156142a5576142a4613435565b5b8086016142b2898261421c565b85526020850194505050602081019050614282565b5050509392505050565b600082601f8301126142e6576142e5613435565b5b81356142f684826020860161424a565b91505092915050565b600080604083850312156143165761431561326e565b5b6000614324858286016133ea565b925050602083013567ffffffffffffffff81111561434557614344613273565b5b614351858286016142d1565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6003811061439b5761439a61435b565b5b50565b60008190506143ac8261438a565b919050565b60006143bc8261439e565b9050919050565b6143cc816143b1565b82525050565b60006020820190506143e760008301846143c3565b92915050565b600080600080600080600060e0888a03121561440c5761440b61326e565b5b600061441a8a828b016133ea565b975050602088013567ffffffffffffffff81111561443b5761443a613273565b5b6144478a828b01613876565b965050604088013567ffffffffffffffff81111561446857614467613273565b5b6144748a828b01613787565b955050606088013567ffffffffffffffff81111561449557614494613273565b5b6144a18a828b01613787565b945050608088013567ffffffffffffffff8111156144c2576144c1613273565b5b6144ce8a828b0161392b565b93505060a06144df8a828b01613a91565b92505060c06144f08a828b01613a91565b91505092959891949750929550565b6000602082840312156145155761451461326e565b5b6000614523848285016139ce565b91505092915050565b600080600080600080600080610100898b03121561454d5761454c61326e565b5b600061455b8b828c016133ea565b985050602089013567ffffffffffffffff81111561457c5761457b613273565b5b6145888b828c01613876565b975050604089013567ffffffffffffffff8111156145a9576145a8613273565b5b6145b58b828c01613787565b965050606089013567ffffffffffffffff8111156145d6576145d5613273565b5b6145e28b828c01613787565b955050608089013567ffffffffffffffff81111561460357614602613273565b5b61460f8b828c0161392b565b94505060a089013567ffffffffffffffff8111156146305761462f613273565b5b61463c8b828c016142d1565b93505060c061464d8b828c01613a91565b92505060e061465e8b828c01613a91565b9150509295985092959890939650565b600082825260208201905092915050565b7f504b5048656c7065723a20436c61696d206b65792074797065206d757374206d60008201527f617463682041757468204d6574686f642064617461206b657920747970650000602082015250565b60006146db603e8361466e565b91506146e68261467f565b604082019050919050565b6000602082019050818103600083015261470a816146ce565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614746816133ff565b82525050565b6147558161346b565b82525050565b606082016000820151614771600085018261473d565b506020820151614784602085018261473d565b506040820151614797604085018261474c565b50505050565b60006147a9838361475b565b60608301905092915050565b6000602082019050919050565b60006147cd82614711565b6147d7818561471c565b93506147e28361472d565b8060005b838110156148135781516147fa888261479d565b9750614805836147b5565b9250506001810190506147e6565b5085935050505092915050565b60006060820190506148356000830186613d0a565b6148426020830185614042565b818103604083015261485481846147c2565b9050949350505050565b60008151905061486d816133d3565b92915050565b6000602082840312156148895761488861326e565b5b60006148978482850161485e565b91505092915050565b7f504b5048656c7065723a20697066732063696420616e642073636f706520617260008201527f726179206c656e67746873206d757374206d6174636800000000000000000000602082015250565b60006148fc60368361466e565b9150614907826148a0565b604082019050919050565b6000602082019050818103600083015261492b816148ef565b9050919050565b7f504b5048656c7065723a206164647265737320616e642073636f70652061727260008201527f6179206c656e67746873206d757374206d617463680000000000000000000000602082015250565b600061498e60358361466e565b915061499982614932565b604082019050919050565b600060208201905081810360008301526149bd81614981565b9050919050565b7f504b5048656c7065723a2061757468206d6574686f64207479706520616e642060008201527f6964206172726179206c656e67746873206d757374206d617463680000000000602082015250565b6000614a20603b8361466e565b9150614a2b826149c4565b604082019050919050565b60006020820190508181036000830152614a4f81614a13565b9050919050565b7f504b5048656c7065723a2061757468206d6574686f64207479706520616e642060008201527f7075626b6579206172726179206c656e67746873206d757374206d6174636800602082015250565b6000614ab2603f8361466e565b9150614abd82614a56565b604082019050919050565b60006020820190508181036000830152614ae181614aa5565b9050919050565b7f504b5048656c7065723a2061757468206d6574686f64207479706520616e642060008201527f73636f706573206172726179206c656e67746873206d757374206d6174636800602082015250565b6000614b44603f8361466e565b9150614b4f82614ae8565b604082019050919050565b60006020820190508181036000830152614b7381614b37565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b60005b83811015614be3578082015181840152602081019050614bc8565b60008484015250505050565b6000614bfa82614ba9565b614c048185614bb4565b9350614c14818560208601614bc5565b614c1d81613338565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614c5d816133c9565b82525050565b6000614c6f8383614c54565b60208301905092915050565b6000602082019050919050565b6000614c9382614c28565b614c9d8185614c33565b9350614ca883614c44565b8060005b83811015614cd9578151614cc08882614c63565b9750614ccb83614c7b565b925050600181019050614cac565b5085935050505092915050565b6000606082019050614cfb6000830186613d0a565b8181036020830152614d0d8185614bef565b90508181036040830152614d218184614c88565b9050949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614d65826133c9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d9757614d96614d2b565b5b600182019050919050565b6000606082019050614db76000830186613d0a565b614dc460208301856140d9565b8181036040830152614dd68184614c88565b9050949350505050565b600082825260208201905092915050565b6000614dfc82614ba9565b614e068185614de0565b9350614e16818560208601614bc5565b614e1f81613338565b840191505092915050565b6000606083016000830151614e426000860182614c54565b5060208301518482036020860152614e5a8282614df1565b91505060408301518482036040860152614e748282614df1565b9150508091505092915050565b6000606082019050614e966000830186613d0a565b8181036020830152614ea88185614e2a565b90508181036040830152614ebc8184614c88565b9050949350505050565b600081519050614ed5816139b7565b92915050565b600060208284031215614ef157614ef061326e565b5b6000614eff84828501614ec6565b91505092915050565b6000606082019050614f1d60008301866140d9565b614f2a60208301856140d9565b614f376040830184613d0a565b949350505050565b7f504b5048656c7065723a206f6e6c792061636365707473207472616e7366657260008201527f732066726f6d2074686520504b504e465420636f6e7472616374000000000000602082015250565b6000614f9b603a8361466e565b9150614fa682614f3f565b604082019050919050565b60006020820190508181036000830152614fca81614f8e565b9050919050565b600081519050614fe081613409565b92915050565b600060208284031215614ffc57614ffb61326e565b5b600061500a84828501614fd1565b91505092915050565b60006040820190506150286000830185614042565b61503560208301846143c3565b9392505050565b7f504b5048656c7065723a206f6e6c792074686520446f6d61696e2057616c6c6560008201527f7420726567697374727920697320616c6c6f77656420746f206d696e7420646f60208201527f6d61696e2077616c6c6574732c2077686f2061726520796f753f000000000000604082015250565b60006150be605a8361466e565b91506150c98261503c565b606082019050919050565b600060208201905081810360008301526150ed816150b1565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000615150602f8361466e565b915061515b826150f4565b604082019050919050565b6000602082019050818103600083015261517f81615143565b9050919050565b600081519050919050565b600061519c82615186565b6151a6818561466e565b93506151b6818560208601614bc5565b6151bf81613338565b840191505092915050565b60006040820190506151df6000830185613d0a565b81810360208301526151f18184615191565b90509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061525660268361466e565b9150615261826151fa565b604082019050919050565b6000602082019050818103600083015261528581615249565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006152c260208361466e565b91506152cd8261528c565b602082019050919050565b600060208201905081810360008301526152f1816152b5565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006153396017836152f8565b915061534482615303565b601782019050919050565b600061535a82615186565b61536481856152f8565b9350615374818560208601614bc5565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006153b66011836152f8565b91506153c182615380565b601182019050919050565b60006153d78261532c565b91506153e3828561534f565b91506153ee826153a9565b91506153fa828461534f565b91508190509392505050565b600060208201905081810360008301526154208184615191565b905092915050565b6000615433826133c9565b915061543e836133c9565b925082820261544c816133c9565b9150828204841483151761546357615462614d2b565b5b5092915050565b6000615475826133c9565b9150615480836133c9565b925082820190508082111561549857615497614d2b565b5b92915050565b60006154a9826133c9565b9150600082036154bc576154bb614d2b565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006154fd60208361466e565b9150615508826154c7565b602082019050919050565b6000602082019050818103600083015261552c816154f0565b905091905056fea2646970667358221220770611251405bd4c91c84f891096f146b51d80d028fffb8a538072ea674c6b9a64736f6c63430008110033000000000000000000000000e5a7c5d908ee8996332f488ce5f636d4ebff85220000000000000000000000000000000000000000000000000000000000000002
Deployed ByteCode
0x6080604052600436106101665760003560e01c8063715018a6116100d15780639fba176b1161008a578063d547741f11610064578063d547741f14610532578063f2fde38b1461055b578063f95d71b114610584578063ffc83325146105ad57610166565b80639fba176b146104ac578063a217fddf146104dc578063caead0c71461050757610166565b8063715018a6146103ae57806373cc4111146103c5578063782e2ea5146103f05780638da5cb5b1461041957806391d14854146104445780639dca00321461048157610166565b80632b553551116101235780632b553551146102b25780632f2ff15d146102db5780633276558c1461030457806336568abe1461032f5780635043026c1461035857806350d17b5e1461038357610166565b806301ffc9a71461016b57806313af411b146101a8578063150b7a02146101d85780631f71cb3114610215578063202f724f14610245578063248a9ca314610275575b600080fd5b34801561017757600080fd5b50610192600480360381019061018d91906132d0565b6105dd565b60405161019f9190613318565b60405180910390f35b6101c260048036038101906101bd9190613c92565b610657565b6040516101cf9190613d19565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190613d8f565b610e13565b60405161020c9190613e26565b60405180910390f35b61022f600480360381019061022a9190613e41565b610e9d565b60405161023c9190613d19565b60405180910390f35b61025f600480360381019061025a9190613c92565b61159b565b60405161026c9190613d19565b60405180910390f35b34801561028157600080fd5b5061029c60048036038101906102979190614015565b6115af565b6040516102a99190614051565b60405180910390f35b3480156102be57600080fd5b506102d960048036038101906102d4919061406c565b6115cf565b005b3480156102e757600080fd5b5061030260048036038101906102fd9190614099565b61185f565b005b34801561031057600080fd5b50610319611880565b60405161032691906140e8565b60405180910390f35b34801561033b57600080fd5b5061035660048036038101906103519190614099565b6119c4565b005b34801561036457600080fd5b5061036d611a47565b60405161037a91906140e8565b60405180910390f35b34801561038f57600080fd5b50610398611b8b565b6040516103a59190614162565b60405180910390f35b3480156103ba57600080fd5b506103c3611bb1565b005b3480156103d157600080fd5b506103da611bc5565b6040516103e791906140e8565b60405180910390f35b3480156103fc57600080fd5b50610417600480360381019061041291906142ff565b611d09565b005b34801561042557600080fd5b5061042e611fdf565b60405161043b91906140e8565b60405180910390f35b34801561045057600080fd5b5061046b60048036038101906104669190614099565b612008565b6040516104789190613318565b60405180910390f35b34801561048d57600080fd5b50610496612073565b6040516104a391906143d2565b60405180910390f35b6104c660048036038101906104c191906143ed565b612086565b6040516104d39190613d19565b60405180910390f35b3480156104e857600080fd5b506104f16121db565b6040516104fe9190614051565b60405180910390f35b34801561051357600080fd5b5061051c6121e2565b60405161052991906140e8565b60405180910390f35b34801561053e57600080fd5b5061055960048036038101906105549190614099565b612326565b005b34801561056757600080fd5b50610582600480360381019061057d91906144ff565b612347565b005b34801561059057600080fd5b506105ab60048036038101906105a691906144ff565b6123ca565b005b6105c760048036038101906105c2919061452c565b61244d565b6040516105d49190613d19565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610650575061064f82612bec565b5b9050919050565b600081600001518360000151146106a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069a906146f1565b60405180910390fd5b60006106ad6121e2565b73ffffffffffffffffffffffffffffffffffffffff1663c70384b8348660000151876020015188604001516040518563ffffffff1660e01b81526004016106f693929190614820565b60206040518083038185885af1158015610714573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107399190614873565b905082604001515183602001515114610787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077e90614912565b60405180910390fd5b826080015151836060015151146107d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ca906149a4565b60405180910390fd5b8260c00151518360a00151511461081f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081690614a36565b60405180910390fd5b8260e00151518360a00151511461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290614ac8565b60405180910390fd5b826101000151518360a0015151146108b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108af90614b5a565b60405180910390fd5b60008360200151511461099c5760005b83602001515181101561099a576108dd611880565b73ffffffffffffffffffffffffffffffffffffffff16638a43157883866020015184815181106109105761090f614b7a565b5b60200260200101518760400151858151811061092f5761092e614b7a565b5b60200260200101516040518463ffffffff1660e01b815260040161095593929190614ce6565b600060405180830381600087803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b50505050808061099290614d5a565b9150506108c8565b505b600083606001515114610a805760005b836060015151811015610a7e576109c1611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c12183866060015184815181106109f4576109f3614b7a565b5b602002602001015187608001518581518110610a1357610a12614b7a565b5b60200260200101516040518463ffffffff1660e01b8152600401610a3993929190614da2565b600060405180830381600087803b158015610a5357600080fd5b505af1158015610a67573d6000803e3d6000fd5b505050508080610a7690614d5a565b9150506109ac565b505b60008360a001515114610bbb5760005b8360a0015151811015610bb957610aa5611880565b73ffffffffffffffffffffffffffffffffffffffff16639dd4349b8360405180606001604052808860a001518681518110610ae357610ae2614b7a565b5b602002602001015181526020018860c001518681518110610b0757610b06614b7a565b5b602002602001015181526020018860e001518681518110610b2b57610b2a614b7a565b5b60200260200101518152508761010001518581518110610b4e57610b4d614b7a565b5b60200260200101516040518463ffffffff1660e01b8152600401610b7493929190614e81565b600060405180830381600087803b158015610b8e57600080fd5b505af1158015610ba2573d6000803e3d6000fd5b505050508080610bb190614d5a565b915050610a90565b505b6000610bc5611880565b73ffffffffffffffffffffffffffffffffffffffff1663bd4986a0836040518263ffffffff1660e01b8152600401610bfd9190613d19565b602060405180830381865afa158015610c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3e9190614edb565b905083610120015115610d0b57610c53611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c1218383600067ffffffffffffffff811115610c8b57610c8a613349565b5b604051908082528060200260200182016040528015610cb95781602001602082028036833780820191505090505b506040518463ffffffff1660e01b8152600401610cd893929190614da2565b600060405180830381600087803b158015610cf257600080fd5b505af1158015610d06573d6000803e3d6000fd5b505050505b83610140015115610d9157610d1e6121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b8152600401610d5a93929190614f08565b600060405180830381600087803b158015610d7457600080fd5b505af1158015610d88573d6000803e3d6000fd5b50505050610e08565b610d996121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3033856040518463ffffffff1660e01b8152600401610dd593929190614f08565b600060405180830381600087803b158015610def57600080fd5b505af1158015610e03573d6000803e3d6000fd5b505050505b819250505092915050565b6000610e1d6121e2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8190614fb1565b60405180910390fd5b63150b7a0260e01b905095945050505050565b600080610ea86121e2565b73ffffffffffffffffffffffffffffffffffffffff16635d228b16348f6040518363ffffffff1660e01b8152600401610ee19190613d19565b60206040518083038185885af1158015610eff573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f249190614873565b90508a518c5114610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6190614912565b60405180910390fd5b88518a5114610fae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa5906149a4565b60405180910390fd5b8651885114610ff2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe990614a36565b60405180910390fd5b8551885114611036576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102d90614ac8565b60405180910390fd5b845188511461107a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107190614b5a565b60405180910390fd5b60008c511461114e5760005b8c5181101561114c57611097611880565b73ffffffffffffffffffffffffffffffffffffffff16638a431578838f84815181106110c6576110c5614b7a565b5b60200260200101518f85815181106110e1576110e0614b7a565b5b60200260200101516040518463ffffffff1660e01b815260040161110793929190614ce6565b600060405180830381600087803b15801561112157600080fd5b505af1158015611135573d6000803e3d6000fd5b50505050808061114490614d5a565b915050611086565b505b60008a51146112225760005b8a518110156112205761116b611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c121838d848151811061119a57611199614b7a565b5b60200260200101518d85815181106111b5576111b4614b7a565b5b60200260200101516040518463ffffffff1660e01b81526004016111db93929190614da2565b600060405180830381600087803b1580156111f557600080fd5b505af1158015611209573d6000803e3d6000fd5b50505050808061121890614d5a565b91505061115a565b505b60008851146113445760005b88518110156113425761123f611880565b73ffffffffffffffffffffffffffffffffffffffff16639dd4349b8360405180606001604052808d868151811061127957611278614b7a565b5b602002602001015181526020018c868151811061129957611298614b7a565b5b602002602001015181526020018b86815181106112b9576112b8614b7a565b5b60200260200101518152508985815181106112d7576112d6614b7a565b5b60200260200101516040518463ffffffff1660e01b81526004016112fd93929190614e81565b600060405180830381600087803b15801561131757600080fd5b505af115801561132b573d6000803e3d6000fd5b50505050808061133a90614d5a565b91505061122e565b505b600061134e611880565b73ffffffffffffffffffffffffffffffffffffffff1663bd4986a0836040518263ffffffff1660e01b81526004016113869190613d19565b602060405180830381865afa1580156113a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c79190614edb565b9050841561148f576113d7611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c1218383600067ffffffffffffffff81111561140f5761140e613349565b5b60405190808252806020026020018201604052801561143d5781602001602082028036833780820191505090505b506040518463ffffffff1660e01b815260040161145c93929190614da2565b600060405180830381600087803b15801561147657600080fd5b505af115801561148a573d6000803e3d6000fd5b505050505b83156115105761149d6121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b81526004016114d993929190614f08565b600060405180830381600087803b1580156114f357600080fd5b505af1158015611507573d6000803e3d6000fd5b50505050611587565b6115186121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3033856040518463ffffffff1660e01b815260040161155493929190614f08565b600060405180830381600087803b15801561156e57600080fd5b505af1158015611582573d6000803e3d6000fd5b505050505b81925050509b9a5050505050505050505050565b60006115a78383610657565b905092915050565b600060016000838152602001908152602001600020600101549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561167a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169e9190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b81526004016116cb929190615013565b602060405180830381865afa1580156116e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170c9190614edb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611779576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611770906150d4565b60405180910390fd5b6000611783611a47565b90508073ffffffffffffffffffffffffffffffffffffffff1663b63a7677836040518263ffffffff1660e01b81526004016117be9190613d19565b600060405180830381600087803b1580156117d857600080fd5b505af11580156117ec573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663519a218e836040518263ffffffff1660e01b81526004016118299190613d19565b600060405180830381600087803b15801561184357600080fd5b505af1158015611857573d6000803e3d6000fd5b505050505050565b611868826115af565b61187181612c56565b61187b8383612c6a565b505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639072f8386040518163ffffffff1660e01b8152600401602060405180830381865afa15801561192d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119519190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b815260040161197e929190615013565b602060405180830381865afa15801561199b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bf9190614edb565b905090565b6119cc612d4a565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611a39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3090615166565b60405180910390fd5b611a438282612d52565b5050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166316f76bbf6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611af4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b189190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b8152600401611b45929190615013565b602060405180830381865afa158015611b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b869190614edb565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611bb9612e34565b611bc36000612eb2565b565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c969190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b8152600401611cc3929190615013565b602060405180830381865afa158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d049190614edb565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd89190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b8152600401611e05929190615013565b602060405180830381865afa158015611e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e469190614edb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaa906150d4565b60405180910390fd5b6000611ebd611a47565b9050600082511115611fda578073ffffffffffffffffffffffffffffffffffffffff1663855eec228484600081518110611efa57611ef9614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401611f1f9291906151ca565b600060405180830381600087803b158015611f3957600080fd5b505af1158015611f4d573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16639000fee18484600181518110611f8257611f81614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401611fa79291906151ca565b600060405180830381600087803b158015611fc157600080fd5b505af1158015611fd5573d6000803e3d6000fd5b505050505b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600260149054906101000a900460ff1681565b60006121ce88600067ffffffffffffffff8111156120a7576120a6613349565b5b6040519080825280602002602001820160405280156120da57816020015b60608152602001906001900390816120c55790505b50600067ffffffffffffffff8111156120f6576120f5613349565b5b60405190808252806020026020018201604052801561212957816020015b60608152602001906001900390816121145790505b50600067ffffffffffffffff81111561214557612144613349565b5b6040519080825280602002602001820160405280156121735781602001602082028036833780820191505090505b50600067ffffffffffffffff81111561218f5761218e613349565b5b6040519080825280602002602001820160405280156121c257816020015b60608152602001906001900390816121ad5790505b508c8c8c8c8c8c610e9d565b9050979650505050505050565b6000801b81565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c0b8bf76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561228f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b39190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b81526004016122e0929190615013565b602060405180830381865afa1580156122fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123219190614edb565b905090565b61232f826115af565b61233881612c56565b6123428383612d52565b505050565b61234f612e34565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036123be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b59061526c565b60405180910390fd5b6123c781612eb2565b50565b6123d2612e34565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f2760073c7cd8cac531d7f643becbfbb74d8b8156443eacf879622532dbbb3cd58160405161244291906140e8565b60405180910390a150565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e8dfd16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634216e73a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251e9190614fe6565b600260149054906101000a900460ff166040518363ffffffff1660e01b815260040161254b929190615013565b602060405180830381865afa158015612568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258c9190614edb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146125f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f0906150d4565b60405180910390fd5b60006126036121e2565b73ffffffffffffffffffffffffffffffffffffffff16635d228b16348c6040518363ffffffff1660e01b815260040161263c9190613d19565b60206040518083038185885af115801561265a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061267f9190614873565b905087518951146126c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126bc90614a36565b60405180910390fd5b8651895114612709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270090614ac8565b60405180910390fd5b855189511461274d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274490614b5a565b60405180910390fd5b600089511461286f5760005b895181101561286d5761276a611880565b73ffffffffffffffffffffffffffffffffffffffff16639dd4349b8360405180606001604052808e86815181106127a4576127a3614b7a565b5b602002602001015181526020018d86815181106127c4576127c3614b7a565b5b602002602001015181526020018c86815181106127e4576127e3614b7a565b5b60200260200101518152508a858151811061280257612801614b7a565b5b60200260200101516040518463ffffffff1660e01b815260040161282893929190614e81565b600060405180830381600087803b15801561284257600080fd5b505af1158015612856573d6000803e3d6000fd5b50505050808061286590614d5a565b915050612759565b505b6000612879611880565b73ffffffffffffffffffffffffffffffffffffffff1663bd4986a0836040518263ffffffff1660e01b81526004016128b19190613d19565b602060405180830381865afa1580156128ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f29190614edb565b905084156129ba57612902611880565b73ffffffffffffffffffffffffffffffffffffffff16631663c1218383600067ffffffffffffffff81111561293a57612939613349565b5b6040519080825280602002602001820160405280156129685781602001602082028036833780820191505090505b506040518463ffffffff1660e01b815260040161298793929190614da2565b600060405180830381600087803b1580156129a157600080fd5b505af11580156129b5573d6000803e3d6000fd5b505050505b8315612a3b576129c86121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b8152600401612a0493929190614f08565b600060405180830381600087803b158015612a1e57600080fd5b505af1158015612a32573d6000803e3d6000fd5b50505050612ab2565b612a436121e2565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e3033856040518463ffffffff1660e01b8152600401612a7f93929190614f08565b600060405180830381600087803b158015612a9957600080fd5b505af1158015612aad573d6000803e3d6000fd5b505050505b600086511115612bdb57612ac4611a47565b73ffffffffffffffffffffffffffffffffffffffff1663855eec228388600081518110612af457612af3614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401612b199291906151ca565b600060405180830381600087803b158015612b3357600080fd5b505af1158015612b47573d6000803e3d6000fd5b50505050612b53611a47565b73ffffffffffffffffffffffffffffffffffffffff16639000fee18388600181518110612b8357612b82614b7a565b5b60200260200101516040518363ffffffff1660e01b8152600401612ba89291906151ca565b600060405180830381600087803b158015612bc257600080fd5b505af1158015612bd6573d6000803e3d6000fd5b505050505b819250505098975050505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612c6781612c62612d4a565b612f76565b50565b612c748282612008565b612d4657600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612ceb612d4a565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b612d5c8282612008565b15612e305760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612dd5612d4a565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b612e3c612d4a565b73ffffffffffffffffffffffffffffffffffffffff16612e5a611fdf565b73ffffffffffffffffffffffffffffffffffffffff1614612eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ea7906152d8565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612f808282612008565b612ff757612f8d81612ffb565b612f9b8360001c6020613028565b604051602001612fac9291906153cc565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fee9190615406565b60405180910390fd5b5050565b60606130218273ffffffffffffffffffffffffffffffffffffffff16601460ff16613028565b9050919050565b60606000600283600261303b9190615428565b613045919061546a565b67ffffffffffffffff81111561305e5761305d613349565b5b6040519080825280601f01601f1916602001820160405280156130905781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106130c8576130c7614b7a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061312c5761312b614b7a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261316c9190615428565b613176919061546a565b90505b6001811115613216577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106131b8576131b7614b7a565b5b1a60f81b8282815181106131cf576131ce614b7a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061320f9061549e565b9050613179565b506000841461325a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161325190615513565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6132ad81613278565b81146132b857600080fd5b50565b6000813590506132ca816132a4565b92915050565b6000602082840312156132e6576132e561326e565b5b60006132f4848285016132bb565b91505092915050565b60008115159050919050565b613312816132fd565b82525050565b600060208201905061332d6000830184613309565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61338182613338565b810181811067ffffffffffffffff821117156133a05761339f613349565b5b80604052505050565b60006133b3613264565b90506133bf8282613378565b919050565b600080fd5b6000819050919050565b6133dc816133c9565b81146133e757600080fd5b50565b6000813590506133f9816133d3565b92915050565b6000819050919050565b613412816133ff565b811461341d57600080fd5b50565b60008135905061342f81613409565b92915050565b600080fd5b600067ffffffffffffffff82111561345557613454613349565b5b602082029050602081019050919050565b600080fd5b600060ff82169050919050565b6134818161346b565b811461348c57600080fd5b50565b60008135905061349e81613478565b92915050565b6000606082840312156134ba576134b9613333565b5b6134c460606133a9565b905060006134d484828501613420565b60008301525060206134e884828501613420565b60208301525060406134fc8482850161348f565b60408301525092915050565b600061351b6135168461343a565b6133a9565b9050808382526020820190506060840283018581111561353e5761353d613466565b5b835b81811015613567578061355388826134a4565b845260208401935050606081019050613540565b5050509392505050565b600082601f83011261358657613585613435565b5b8135613596848260208601613508565b91505092915050565b6000606082840312156135b5576135b4613333565b5b6135bf60606133a9565b905060006135cf848285016133ea565b60008301525060206135e384828501613420565b602083015250604082013567ffffffffffffffff811115613607576136066133c4565b5b61361384828501613571565b60408301525092915050565b600067ffffffffffffffff82111561363a57613639613349565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff82111561366b5761366a613349565b5b61367482613338565b9050602081019050919050565b82818337600083830152505050565b60006136a361369e84613650565b6133a9565b9050828152602081018484840111156136bf576136be61364b565b5b6136ca848285613681565b509392505050565b600082601f8301126136e7576136e6613435565b5b81356136f7848260208601613690565b91505092915050565b600061371361370e8461361f565b6133a9565b9050808382526020820190506020840283018581111561373657613735613466565b5b835b8181101561377d57803567ffffffffffffffff81111561375b5761375a613435565b5b80860161376889826136d2565b85526020850194505050602081019050613738565b5050509392505050565b600082601f83011261379c5761379b613435565b5b81356137ac848260208601613700565b91505092915050565b600067ffffffffffffffff8211156137d0576137cf613349565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156137fc576137fb613349565b5b602082029050602081019050919050565b600061382061381b846137e1565b6133a9565b9050808382526020820190506020840283018581111561384357613842613466565b5b835b8181101561386c578061385888826133ea565b845260208401935050602081019050613845565b5050509392505050565b600082601f83011261388b5761388a613435565b5b813561389b84826020860161380d565b91505092915050565b60006138b76138b2846137b5565b6133a9565b905080838252602082019050602084028301858111156138da576138d9613466565b5b835b8181101561392157803567ffffffffffffffff8111156138ff576138fe613435565b5b80860161390c8982613876565b855260208501945050506020810190506138dc565b5050509392505050565b600082601f8301126139405761393f613435565b5b81356139508482602086016138a4565b91505092915050565b600067ffffffffffffffff82111561397457613973613349565b5b602082029050602081019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006139b082613985565b9050919050565b6139c0816139a5565b81146139cb57600080fd5b50565b6000813590506139dd816139b7565b92915050565b60006139f66139f184613959565b6133a9565b90508083825260208201905060208402830185811115613a1957613a18613466565b5b835b81811015613a425780613a2e88826139ce565b845260208401935050602081019050613a1b565b5050509392505050565b600082601f830112613a6157613a60613435565b5b8135613a718482602086016139e3565b91505092915050565b613a83816132fd565b8114613a8e57600080fd5b50565b600081359050613aa081613a7a565b92915050565b60006101608284031215613abd57613abc613333565b5b613ac86101606133a9565b90506000613ad8848285016133ea565b600083015250602082013567ffffffffffffffff811115613afc57613afb6133c4565b5b613b0884828501613787565b602083015250604082013567ffffffffffffffff811115613b2c57613b2b6133c4565b5b613b388482850161392b565b604083015250606082013567ffffffffffffffff811115613b5c57613b5b6133c4565b5b613b6884828501613a4c565b606083015250608082013567ffffffffffffffff811115613b8c57613b8b6133c4565b5b613b988482850161392b565b60808301525060a082013567ffffffffffffffff811115613bbc57613bbb6133c4565b5b613bc884828501613876565b60a08301525060c082013567ffffffffffffffff811115613bec57613beb6133c4565b5b613bf884828501613787565b60c08301525060e082013567ffffffffffffffff811115613c1c57613c1b6133c4565b5b613c2884828501613787565b60e08301525061010082013567ffffffffffffffff811115613c4d57613c4c6133c4565b5b613c598482850161392b565b61010083015250610120613c6f84828501613a91565b61012083015250610140613c8584828501613a91565b6101408301525092915050565b60008060408385031215613ca957613ca861326e565b5b600083013567ffffffffffffffff811115613cc757613cc6613273565b5b613cd38582860161359f565b925050602083013567ffffffffffffffff811115613cf457613cf3613273565b5b613d0085828601613aa6565b9150509250929050565b613d13816133c9565b82525050565b6000602082019050613d2e6000830184613d0a565b92915050565b600080fd5b60008083601f840112613d4f57613d4e613435565b5b8235905067ffffffffffffffff811115613d6c57613d6b613d34565b5b602083019150836001820283011115613d8857613d87613466565b5b9250929050565b600080600080600060808688031215613dab57613daa61326e565b5b6000613db9888289016139ce565b9550506020613dca888289016139ce565b9450506040613ddb888289016133ea565b935050606086013567ffffffffffffffff811115613dfc57613dfb613273565b5b613e0888828901613d39565b92509250509295509295909350565b613e2081613278565b82525050565b6000602082019050613e3b6000830184613e17565b92915050565b60008060008060008060008060008060006101608c8e031215613e6757613e6661326e565b5b6000613e758e828f016133ea565b9b505060208c013567ffffffffffffffff811115613e9657613e95613273565b5b613ea28e828f01613787565b9a505060408c013567ffffffffffffffff811115613ec357613ec2613273565b5b613ecf8e828f0161392b565b99505060608c013567ffffffffffffffff811115613ef057613eef613273565b5b613efc8e828f01613a4c565b98505060808c013567ffffffffffffffff811115613f1d57613f1c613273565b5b613f298e828f0161392b565b97505060a08c013567ffffffffffffffff811115613f4a57613f49613273565b5b613f568e828f01613876565b96505060c08c013567ffffffffffffffff811115613f7757613f76613273565b5b613f838e828f01613787565b95505060e08c013567ffffffffffffffff811115613fa457613fa3613273565b5b613fb08e828f01613787565b9450506101008c013567ffffffffffffffff811115613fd257613fd1613273565b5b613fde8e828f0161392b565b935050610120613ff08e828f01613a91565b9250506101406140028e828f01613a91565b9150509295989b509295989b9093969950565b60006020828403121561402b5761402a61326e565b5b600061403984828501613420565b91505092915050565b61404b816133ff565b82525050565b60006020820190506140666000830184614042565b92915050565b6000602082840312156140825761408161326e565b5b6000614090848285016133ea565b91505092915050565b600080604083850312156140b0576140af61326e565b5b60006140be85828601613420565b92505060206140cf858286016139ce565b9150509250929050565b6140e2816139a5565b82525050565b60006020820190506140fd60008301846140d9565b92915050565b6000819050919050565b600061412861412361411e84613985565b614103565b613985565b9050919050565b600061413a8261410d565b9050919050565b600061414c8261412f565b9050919050565b61415c81614141565b82525050565b60006020820190506141776000830184614153565b92915050565b600067ffffffffffffffff82111561419857614197613349565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156141c4576141c3613349565b5b6141cd82613338565b9050602081019050919050565b60006141ed6141e8846141a9565b6133a9565b9050828152602081018484840111156142095761420861364b565b5b614214848285613681565b509392505050565b600082601f83011261423157614230613435565b5b81356142418482602086016141da565b91505092915050565b600061425d6142588461417d565b6133a9565b905080838252602082019050602084028301858111156142805761427f613466565b5b835b818110156142c757803567ffffffffffffffff8111156142a5576142a4613435565b5b8086016142b2898261421c565b85526020850194505050602081019050614282565b5050509392505050565b600082601f8301126142e6576142e5613435565b5b81356142f684826020860161424a565b91505092915050565b600080604083850312156143165761431561326e565b5b6000614324858286016133ea565b925050602083013567ffffffffffffffff81111561434557614344613273565b5b614351858286016142d1565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6003811061439b5761439a61435b565b5b50565b60008190506143ac8261438a565b919050565b60006143bc8261439e565b9050919050565b6143cc816143b1565b82525050565b60006020820190506143e760008301846143c3565b92915050565b600080600080600080600060e0888a03121561440c5761440b61326e565b5b600061441a8a828b016133ea565b975050602088013567ffffffffffffffff81111561443b5761443a613273565b5b6144478a828b01613876565b965050604088013567ffffffffffffffff81111561446857614467613273565b5b6144748a828b01613787565b955050606088013567ffffffffffffffff81111561449557614494613273565b5b6144a18a828b01613787565b945050608088013567ffffffffffffffff8111156144c2576144c1613273565b5b6144ce8a828b0161392b565b93505060a06144df8a828b01613a91565b92505060c06144f08a828b01613a91565b91505092959891949750929550565b6000602082840312156145155761451461326e565b5b6000614523848285016139ce565b91505092915050565b600080600080600080600080610100898b03121561454d5761454c61326e565b5b600061455b8b828c016133ea565b985050602089013567ffffffffffffffff81111561457c5761457b613273565b5b6145888b828c01613876565b975050604089013567ffffffffffffffff8111156145a9576145a8613273565b5b6145b58b828c01613787565b965050606089013567ffffffffffffffff8111156145d6576145d5613273565b5b6145e28b828c01613787565b955050608089013567ffffffffffffffff81111561460357614602613273565b5b61460f8b828c0161392b565b94505060a089013567ffffffffffffffff8111156146305761462f613273565b5b61463c8b828c016142d1565b93505060c061464d8b828c01613a91565b92505060e061465e8b828c01613a91565b9150509295985092959890939650565b600082825260208201905092915050565b7f504b5048656c7065723a20436c61696d206b65792074797065206d757374206d60008201527f617463682041757468204d6574686f642064617461206b657920747970650000602082015250565b60006146db603e8361466e565b91506146e68261467f565b604082019050919050565b6000602082019050818103600083015261470a816146ce565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614746816133ff565b82525050565b6147558161346b565b82525050565b606082016000820151614771600085018261473d565b506020820151614784602085018261473d565b506040820151614797604085018261474c565b50505050565b60006147a9838361475b565b60608301905092915050565b6000602082019050919050565b60006147cd82614711565b6147d7818561471c565b93506147e28361472d565b8060005b838110156148135781516147fa888261479d565b9750614805836147b5565b9250506001810190506147e6565b5085935050505092915050565b60006060820190506148356000830186613d0a565b6148426020830185614042565b818103604083015261485481846147c2565b9050949350505050565b60008151905061486d816133d3565b92915050565b6000602082840312156148895761488861326e565b5b60006148978482850161485e565b91505092915050565b7f504b5048656c7065723a20697066732063696420616e642073636f706520617260008201527f726179206c656e67746873206d757374206d6174636800000000000000000000602082015250565b60006148fc60368361466e565b9150614907826148a0565b604082019050919050565b6000602082019050818103600083015261492b816148ef565b9050919050565b7f504b5048656c7065723a206164647265737320616e642073636f70652061727260008201527f6179206c656e67746873206d757374206d617463680000000000000000000000602082015250565b600061498e60358361466e565b915061499982614932565b604082019050919050565b600060208201905081810360008301526149bd81614981565b9050919050565b7f504b5048656c7065723a2061757468206d6574686f64207479706520616e642060008201527f6964206172726179206c656e67746873206d757374206d617463680000000000602082015250565b6000614a20603b8361466e565b9150614a2b826149c4565b604082019050919050565b60006020820190508181036000830152614a4f81614a13565b9050919050565b7f504b5048656c7065723a2061757468206d6574686f64207479706520616e642060008201527f7075626b6579206172726179206c656e67746873206d757374206d6174636800602082015250565b6000614ab2603f8361466e565b9150614abd82614a56565b604082019050919050565b60006020820190508181036000830152614ae181614aa5565b9050919050565b7f504b5048656c7065723a2061757468206d6574686f64207479706520616e642060008201527f73636f706573206172726179206c656e67746873206d757374206d6174636800602082015250565b6000614b44603f8361466e565b9150614b4f82614ae8565b604082019050919050565b60006020820190508181036000830152614b7381614b37565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b60005b83811015614be3578082015181840152602081019050614bc8565b60008484015250505050565b6000614bfa82614ba9565b614c048185614bb4565b9350614c14818560208601614bc5565b614c1d81613338565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614c5d816133c9565b82525050565b6000614c6f8383614c54565b60208301905092915050565b6000602082019050919050565b6000614c9382614c28565b614c9d8185614c33565b9350614ca883614c44565b8060005b83811015614cd9578151614cc08882614c63565b9750614ccb83614c7b565b925050600181019050614cac565b5085935050505092915050565b6000606082019050614cfb6000830186613d0a565b8181036020830152614d0d8185614bef565b90508181036040830152614d218184614c88565b9050949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614d65826133c9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d9757614d96614d2b565b5b600182019050919050565b6000606082019050614db76000830186613d0a565b614dc460208301856140d9565b8181036040830152614dd68184614c88565b9050949350505050565b600082825260208201905092915050565b6000614dfc82614ba9565b614e068185614de0565b9350614e16818560208601614bc5565b614e1f81613338565b840191505092915050565b6000606083016000830151614e426000860182614c54565b5060208301518482036020860152614e5a8282614df1565b91505060408301518482036040860152614e748282614df1565b9150508091505092915050565b6000606082019050614e966000830186613d0a565b8181036020830152614ea88185614e2a565b90508181036040830152614ebc8184614c88565b9050949350505050565b600081519050614ed5816139b7565b92915050565b600060208284031215614ef157614ef061326e565b5b6000614eff84828501614ec6565b91505092915050565b6000606082019050614f1d60008301866140d9565b614f2a60208301856140d9565b614f376040830184613d0a565b949350505050565b7f504b5048656c7065723a206f6e6c792061636365707473207472616e7366657260008201527f732066726f6d2074686520504b504e465420636f6e7472616374000000000000602082015250565b6000614f9b603a8361466e565b9150614fa682614f3f565b604082019050919050565b60006020820190508181036000830152614fca81614f8e565b9050919050565b600081519050614fe081613409565b92915050565b600060208284031215614ffc57614ffb61326e565b5b600061500a84828501614fd1565b91505092915050565b60006040820190506150286000830185614042565b61503560208301846143c3565b9392505050565b7f504b5048656c7065723a206f6e6c792074686520446f6d61696e2057616c6c6560008201527f7420726567697374727920697320616c6c6f77656420746f206d696e7420646f60208201527f6d61696e2077616c6c6574732c2077686f2061726520796f753f000000000000604082015250565b60006150be605a8361466e565b91506150c98261503c565b606082019050919050565b600060208201905081810360008301526150ed816150b1565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000615150602f8361466e565b915061515b826150f4565b604082019050919050565b6000602082019050818103600083015261517f81615143565b9050919050565b600081519050919050565b600061519c82615186565b6151a6818561466e565b93506151b6818560208601614bc5565b6151bf81613338565b840191505092915050565b60006040820190506151df6000830185613d0a565b81810360208301526151f18184615191565b90509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061525660268361466e565b9150615261826151fa565b604082019050919050565b6000602082019050818103600083015261528581615249565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006152c260208361466e565b91506152cd8261528c565b602082019050919050565b600060208201905081810360008301526152f1816152b5565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006153396017836152f8565b915061534482615303565b601782019050919050565b600061535a82615186565b61536481856152f8565b9350615374818560208601614bc5565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006153b66011836152f8565b91506153c182615380565b601182019050919050565b60006153d78261532c565b91506153e3828561534f565b91506153ee826153a9565b91506153fa828461534f565b91508190509392505050565b600060208201905081810360008301526154208184615191565b905092915050565b6000615433826133c9565b915061543e836133c9565b925082820261544c816133c9565b9150828204841483151761546357615462614d2b565b5b5092915050565b6000615475826133c9565b9150615480836133c9565b925082820190508082111561549857615497614d2b565b5b92915050565b60006154a9826133c9565b9150600082036154bc576154bb614d2b565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006154fd60208361466e565b9150615508826154c7565b602082019050919050565b6000602082019050818103600083015261552c816154f0565b905091905056fea2646970667358221220770611251405bd4c91c84f891096f146b51d80d028fffb8a538072ea674c6b9a64736f6c63430008110033