Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
275574 | 401 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Hats
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; import { ERC1155 } from "lib/ERC1155/ERC1155.sol"; // import { console2 } from "forge-std/Test.sol"; //remove after testing import "./Interfaces/IHats.sol"; import "./HatsIdUtilities.sol"; import "./Interfaces/IHatsToggle.sol"; import "./Interfaces/IHatsEligibility.sol"; import "solbase/utils/Base64.sol"; import "solbase/utils/LibString.sol"; import "solady/utils/Multicallable.sol"; /// @title Hats Protocol v1 /// @notice Hats are DAO-native, revocable, and programmable roles that are represented as non-transferable ERC-1155-similar tokens for composability /// @dev This is a multi-tenant contract that can manage all hats for a given chain. While it fully implements the ERC1155 interface, it does not fully comply with the ERC1155 standard. /// @author Haberdasher Labs contract Hats is IHats, ERC1155, Multicallable, HatsIdUtilities { /// @notice This contract's version is labeled v1. Previous versions labeled similarly as v1 and v1.0 are deprecated, /// and should be treated as beta deployments. /*////////////////////////////////////////////////////////////// HATS DATA MODELS //////////////////////////////////////////////////////////////*/ /// @notice A Hat object containing the hat's properties /// @dev The members are packed to minimize storage costs /// @custom:member eligibility Module that rules on wearer eligibiliy and standing /// @custom:member maxSupply The max number of hats with this id that can exist /// @custom:member supply The number of this hat that currently exist /// @custom:member lastHatId Indexes how many different child hats an admin has /// @custom:member toggle Module that sets the hat's status /** * @custom:member config Holds status and other settings, with this bitwise schema: * * 0th bit | `active` status; can be altered by toggle * 1 | `mutable` setting * 2 - 95 | unassigned */ /// @custom:member details Holds arbitrary metadata about the hat /// @custom:member imageURI A uri pointing to an image for the hat struct Hat { // 1st storage slot address eligibility; // ─┐ 20 uint32 maxSupply; // │ 4 uint32 supply; // │ 4 uint16 lastHatId; // ─┘ 2 // 2nd slot address toggle; // ─┐ 20 uint96 config; // ─┘ 12 // 3rd+ slot (optional) string details; string imageURI; } /*////////////////////////////////////////////////////////////// HATS STORAGE //////////////////////////////////////////////////////////////*/ /// @notice The name of the contract, typically including the version string public name; /// @notice The first 4 bytes of the id of the last tophat created. uint32 public lastTopHatId; // first tophat id starts at 1 /// @notice The fallback image URI for hat tokens with no `imageURI` specified in their branch string public baseImageURI; /// @dev Internal mapping of hats to hat ids. See HatsIdUtilities.sol for more info on how hat ids work mapping(uint256 => Hat) internal _hats; // key: hatId => value: Hat struct /// @notice Mapping of wearers in bad standing for certain hats /// @dev Used by external contracts to trigger penalties for wearers in bad standing /// hatId => wearer => !standing mapping(uint256 => mapping(address => bool)) public badStandings; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /// @notice All arguments are immutable; they can only be set once during construction /// @param _name The name of this contract, typically including the version /// @param _baseImageURI The fallback image URI constructor(string memory _name, string memory _baseImageURI) { name = _name; baseImageURI = _baseImageURI; } /*////////////////////////////////////////////////////////////// HATS LOGIC //////////////////////////////////////////////////////////////*/ /// @notice Creates and mints a Hat that is its own admin, i.e. a "topHat" /// @dev A topHat has no eligibility and no toggle /// @param _target The address to which the newly created topHat is minted /// @param _details A description of the Hat [optional]. Should not be larger than 7000 bytes /// (enforced in changeHatDetails) /// @param _imageURI The image uri for this top hat and the fallback for its /// downstream hats [optional]. Should not be large than 7000 bytes /// (enforced in changeHatImageURI) /// @return topHatId The id of the newly created topHat function mintTopHat(address _target, string calldata _details, string calldata _imageURI) public returns (uint256 topHatId) { // create hat topHatId = uint256(++lastTopHatId) << 224; _createHat( topHatId, _details, // details 1, // maxSupply = 1 address(0), // there is no eligibility address(0), // it has no toggle false, // its immutable _imageURI ); _mintHat(_target, topHatId); } /// @notice Creates a new hat. The msg.sender must wear the `_admin` hat. /// @dev Initializes a new Hat struct, but does not mint any tokens. /// @param _details A description of the Hat. Should not be larger than 7000 bytes (enforced in changeHatDetails) /// @param _maxSupply The total instances of the Hat that can be worn at once /// @param _admin The id of the Hat that will control who wears the newly created hat /// @param _eligibility The address that can report on the Hat wearer's status /// @param _toggle The address that can deactivate the Hat /// @param _mutable Whether the hat's properties are changeable after creation /// @param _imageURI The image uri for this hat and the fallback for its /// downstream hats [optional]. Should not be larger than 7000 bytes (enforced in changeHatImageURI) /// @return newHatId The id of the newly created Hat function createHat( uint256 _admin, string calldata _details, uint32 _maxSupply, address _eligibility, address _toggle, bool _mutable, string calldata _imageURI ) public returns (uint256 newHatId) { if (uint16(_admin) > 0) { revert MaxLevelsReached(); } if (_eligibility == address(0)) revert ZeroAddress(); if (_toggle == address(0)) revert ZeroAddress(); // check that the admin id is valid, ie does not contain empty levels between filled levels if (!isValidHatId(_admin)) revert InvalidHatId(); // construct the next hat id newHatId = getNextId(_admin); // to create a hat, you must be wearing one of its admin hats _checkAdmin(newHatId); // create the new hat _createHat(newHatId, _details, _maxSupply, _eligibility, _toggle, _mutable, _imageURI); // increment _admin.lastHatId // use the overflow check to constrain to correct number of hats per level ++_hats[_admin].lastHatId; } /// @notice Creates new hats in batch. The msg.sender must be an admin of each hat. /// @dev This is a convenience function that loops through the arrays and calls `createHat`. /// @param _admins Array of ids of admins for each hat to create /// @param _details Array of details for each hat to create /// @param _maxSupplies Array of supply caps for each hat to create /// @param _eligibilityModules Array of eligibility module addresses for each hat to /// create /// @param _toggleModules Array of toggle module addresses for each hat to create /// @param _mutables Array of mutable flags for each hat to create /// @param _imageURIs Array of imageURIs for each hat to create /// @return success True if all createHat calls succeeded function batchCreateHats( uint256[] calldata _admins, string[] calldata _details, uint32[] calldata _maxSupplies, address[] memory _eligibilityModules, address[] memory _toggleModules, bool[] calldata _mutables, string[] calldata _imageURIs ) public returns (bool success) { // check if array lengths are the same uint256 length = _admins.length; // save an MLOAD { bool sameLengths = ( length == _details.length // details && length == _maxSupplies.length // supplies && length == _eligibilityModules.length // eligibility && length == _toggleModules.length // toggle && length == _mutables.length // mutable && length == _imageURIs.length ); // imageURI if (!sameLengths) revert BatchArrayLengthMismatch(); } // loop through and create each hat for (uint256 i = 0; i < length;) { createHat( _admins[i], _details[i], _maxSupplies[i], _eligibilityModules[i], _toggleModules[i], _mutables[i], _imageURIs[i] ); unchecked { ++i; } } success = true; } /// @notice Gets the id of the next child hat of the hat `_admin` /// @dev Does not incrememnt lastHatId /// @param _admin The id of the hat to serve as the admin for the next child hat /// @return nextId The new hat id function getNextId(uint256 _admin) public view returns (uint256 nextId) { uint16 nextHatId = _hats[_admin].lastHatId + 1; nextId = buildHatId(_admin, nextHatId); } /// @notice Mints an ERC1155-similar token of the Hat to an eligible recipient, who then "wears" the hat /// @dev The msg.sender must wear an admin Hat of `_hatId`, and the recipient must be eligible to wear `_hatId` /// @param _hatId The id of the Hat to mint /// @param _wearer The address to which the Hat is minted /// @return success Whether the mint succeeded function mintHat(uint256 _hatId, address _wearer) public returns (bool success) { Hat storage hat = _hats[_hatId]; if (hat.maxSupply == 0) revert HatDoesNotExist(_hatId); // only eligible wearers can receive minted hats if (!isEligible(_wearer, _hatId)) revert NotEligible(); // only active hats can be minted if (!_isActive(hat, _hatId)) revert HatNotActive(); // only the wearer of one of a hat's admins can mint it _checkAdmin(_hatId); // hat supply cannot exceed maxSupply if (hat.supply >= hat.maxSupply) revert AllHatsWorn(_hatId); // wearers cannot wear the same hat more than once if (_staticBalanceOf(_wearer, _hatId) > 0) revert AlreadyWearingHat(_wearer, _hatId); // if we've made it through all the checks, mint the hat _mintHat(_wearer, _hatId); success = true; } /// @notice Mints new hats in batch. The msg.sender must be an admin of each hat. /// @dev This is a convenience function that loops through the arrays and calls `mintHat`. /// @param _hatIds Array of ids of hats to mint /// @param _wearers Array of addresses to which the hats will be minted /// @return success True if all mintHat calls succeeded function batchMintHats(uint256[] calldata _hatIds, address[] calldata _wearers) public returns (bool success) { uint256 length = _hatIds.length; if (length != _wearers.length) revert BatchArrayLengthMismatch(); for (uint256 i = 0; i < length;) { mintHat(_hatIds[i], _wearers[i]); unchecked { ++i; } } success = true; } /// @notice Toggles a Hat's status from active to deactive, or vice versa /// @dev The msg.sender must be set as the hat's toggle /// @param _hatId The id of the Hat for which to adjust status /// @param _newStatus The new status to set /// @return toggled Whether the status was toggled function setHatStatus(uint256 _hatId, bool _newStatus) external returns (bool toggled) { Hat storage hat = _hats[_hatId]; if (msg.sender != hat.toggle) { revert NotHatsToggle(); } toggled = _processHatStatus(_hatId, _newStatus); } /// @notice Checks a hat's toggle module and processes the returned status /// @dev May change the hat's status in storage /// @param _hatId The id of the Hat whose toggle we are checking /// @return toggled Whether there was a new status function checkHatStatus(uint256 _hatId) public returns (bool toggled) { Hat storage hat = _hats[_hatId]; // attempt to retrieve the hat's status from the toggle module (bool success, bool newStatus) = _pullHatStatus(hat, _hatId); // if unsuccessful (ie toggle was humanistic), process the new status if (!success) revert NotHatsToggle(); // if successful (ie toggle was mechanistic), process the new status toggled = _processHatStatus(_hatId, newStatus); } function _pullHatStatus(Hat storage _hat, uint256 _hatId) internal view returns (bool success, bool newStatus) { bytes memory data = abi.encodeWithSignature("getHatStatus(uint256)", _hatId); bytes memory returndata; (success, returndata) = _hat.toggle.staticcall(data); /* * if function call succeeds with data of length == 32, then we know the contract exists * and has the getHatStatus function. * But — since function selectors don't include return types — we still can't assume that the return data is a boolean, * so we treat it as a uint so it will always safely decode without throwing. */ if (success && returndata.length == 32) { // check the returndata manually uint256 uintReturndata = abi.decode(returndata, (uint256)); // false condition if (uintReturndata == 0) { newStatus = false; // true condition } else if (uintReturndata == 1) { newStatus = true; } // invalid condition else { success = false; } } else { success = false; } } /// @notice Report from a hat's eligibility on the status of one of its wearers and, if `false`, revoke their hat /// @dev Burns the wearer's hat, if revoked /// @param _hatId The id of the hat /// @param _wearer The address of the hat wearer whose status is being reported /// @param _eligible Whether the wearer is eligible for the hat (will be revoked if /// false) /// @param _standing False if the wearer is no longer in good standing (and potentially should be penalized) /// @return updated Whether the report succeeded function setHatWearerStatus(uint256 _hatId, address _wearer, bool _eligible, bool _standing) external returns (bool updated) { Hat storage hat = _hats[_hatId]; if (msg.sender != hat.eligibility) { revert NotHatsEligibility(); } updated = _processHatWearerStatus(_hatId, _wearer, _eligible, _standing); } /// @notice Check a hat's eligibility for a report on the status of one of the hat's wearers and, if `false`, revoke their hat /// @dev Burns the wearer's hat, if revoked /// @param _hatId The id of the hat /// @param _wearer The address of the Hat wearer whose status report is being requested /// @return updated Whether the wearer's status was altered function checkHatWearerStatus(uint256 _hatId, address _wearer) public returns (bool updated) { bool eligible; bool standing; (bool success, bytes memory returndata) = _hats[_hatId].eligibility.staticcall( abi.encodeWithSignature("getWearerStatus(address,uint256)", _wearer, _hatId) ); /* * if function call succeeds with data of length == 64, then we know the contract exists * and has the getWearerStatus function (which returns two words). * But — since function selectors don't include return types — we still can't assume that the return data is two booleans, * so we treat it as a uint so it will always safely decode without throwing. */ if (success && returndata.length == 64) { // check the returndata manually (uint256 firstWord, uint256 secondWord) = abi.decode(returndata, (uint256, uint256)); // returndata is valid if (firstWord < 2 && secondWord < 2) { standing = (secondWord == 1) ? true : false; // never eligible if in bad standing eligible = (standing && firstWord == 1) ? true : false; } // returndata is invalid else { revert NotHatsEligibility(); } } else { revert NotHatsEligibility(); } updated = _processHatWearerStatus(_hatId, _wearer, eligible, standing); } /// @notice Stop wearing a hat, aka "renounce" it /// @dev Burns the msg.sender's hat /// @param _hatId The id of the Hat being renounced function renounceHat(uint256 _hatId) external { if (_staticBalanceOf(msg.sender, _hatId) < 1) { revert NotHatWearer(); } // remove the hat _burnHat(msg.sender, _hatId); } /*////////////////////////////////////////////////////////////// HATS INTERNAL LOGIC //////////////////////////////////////////////////////////////*/ /// @notice Internal call for creating a new hat /// @dev Initializes a new Hat in storage, but does not mint any tokens /// @param _id ID of the hat to be stored /// @param _details A description of the hat /// @param _maxSupply The total instances of the Hat that can be worn at once /// @param _eligibility The address that can report on the Hat wearer's status /// @param _toggle The address that can deactivate the hat [optional] /// @param _mutable Whether the hat's properties are changeable after creation /// @param _imageURI The image uri for this top hat and the fallback for its /// downstream hats [optional] function _createHat( uint256 _id, string calldata _details, uint32 _maxSupply, address _eligibility, address _toggle, bool _mutable, string calldata _imageURI ) internal { /* We write directly to storage instead of first building the Hat struct in memory. This allows us to cheaply use the existing lastHatId value in case it was incremented by creating a hat while skipping admin levels. (Resetting it to 0 would be bad since this hat's child hat(s) would overwrite the previously created hat(s) at that level.) */ Hat storage hat = _hats[_id]; hat.details = _details; hat.maxSupply = _maxSupply; hat.eligibility = _eligibility; hat.toggle = _toggle; hat.imageURI = _imageURI; // config is a concatenation of the status and mutability properties hat.config = _mutable ? uint96(3 << 94) : uint96(1 << 95); emit HatCreated(_id, _details, _maxSupply, _eligibility, _toggle, _mutable, _imageURI); } /// @notice Internal function to process hat status /// @dev Updates a hat's status if different from current /// @param _hatId The id of the Hat in quest /// @param _newStatus The status to potentially change to /// @return updated - Whether the status was updated function _processHatStatus(uint256 _hatId, bool _newStatus) internal returns (bool updated) { // optimize later Hat storage hat = _hats[_hatId]; if (_newStatus != _getHatStatus(hat)) { _setHatStatus(hat, _newStatus); emit HatStatusChanged(_hatId, _newStatus); updated = true; } } /// @notice Internal call to process wearer status from the eligibility module /// @dev Burns the wearer's Hat token if _eligible is false, and updates badStandings /// state if necessary /// @param _hatId The id of the Hat to revoke /// @param _wearer The address of the wearer in question /// @param _eligible Whether _wearer is eligible for the Hat (if false, this function /// will revoke their Hat) /// @param _standing Whether _wearer is in good standing (to be recorded in storage) /// @return updated Whether the wearer standing was updated function _processHatWearerStatus(uint256 _hatId, address _wearer, bool _eligible, bool _standing) internal returns (bool updated) { // revoke/burn the hat if _wearer has a positive balance if (_staticBalanceOf(_wearer, _hatId) > 0) { // always ineligible if in bad standing if (!_eligible || !_standing) { _burnHat(_wearer, _hatId); } } // record standing for use by other contracts // note: here, standing and badStandings are opposite // i.e. if standing (true = good standing) // then badStandings[_hatId][wearer] will be false // if they are different, then something has changed, and we need to update // badStandings marker if (_standing == badStandings[_hatId][_wearer]) { badStandings[_hatId][_wearer] = !_standing; updated = true; emit WearerStandingChanged(_hatId, _wearer, _standing); } } /// @notice Internal function to set a hat's status in storage /// @dev Flips the 0th bit of _hat.config via bitwise operation /// @param _hat The hat object /// @param _status The status to set for the hat function _setHatStatus(Hat storage _hat, bool _status) internal { if (_status) { _hat.config |= uint96(1 << 95); } else { _hat.config &= ~uint96(1 << 95); } } /** * @notice Internal function to retrieve an account's internal "static" balance directly from internal storage, * @dev This function bypasses the dynamic `_isActive` and `_isEligible` checks * @param _account The account to check * @param _hatId The hat to check * @return staticBalance The account's static of the hat, from internal storage */ function _staticBalanceOf(address _account, uint256 _hatId) internal view returns (uint256 staticBalance) { staticBalance = _balanceOf[_account][_hatId]; } /*////////////////////////////////////////////////////////////// HATS ADMIN FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice Checks whether msg.sender is an admin of a hat, and reverts if not function _checkAdmin(uint256 _hatId) internal view { if (!isAdminOfHat(msg.sender, _hatId)) { revert NotAdmin(msg.sender, _hatId); } } /// @notice checks whether the msg.sender is either an admin or wearer or a hat, and reverts the appropriate error if not function _checkAdminOrWearer(uint256 _hatId) internal view { if (!isAdminOfHat(msg.sender, _hatId) && !isWearerOfHat(msg.sender, _hatId)) { revert NotAdminOrWearer(); } } /// @notice Transfers a hat from one wearer to another eligible wearer /// @dev The hat must be mutable, and the transfer must be initiated by an admin /// @param _hatId The hat in question /// @param _from The current wearer /// @param _to The new wearer function transferHat(uint256 _hatId, address _from, address _to) public { _checkAdmin(_hatId); // cannot transfer immutable hats, except for tophats, which can always transfer themselves if (!isTopHat(_hatId)) { if (!_isMutable(_hats[_hatId])) revert Immutable(); } // Checks storage instead of `isWearerOfHat` since admins may want to transfer revoked Hats to new wearers if (_staticBalanceOf(_from, _hatId) < 1) revert NotHatWearer(); // Check if recipient is already wearing hat; also checks storage to maintain balance == 1 invariant if (_staticBalanceOf(_to, _hatId) > 0) revert AlreadyWearingHat(_to, _hatId); // only eligible wearers can receive transferred hats if (!isEligible(_to, _hatId)) revert NotEligible(); // only active hats can be transferred if (!_isActive(_hats[_hatId], _hatId)) revert HatNotActive(); // we've made it passed all the checks, so adjust balances to execute the transfer _balanceOf[_from][_hatId] = 0; _balanceOf[_to][_hatId] = 1; // emit the ERC1155 standard transfer event emit TransferSingle(msg.sender, _from, _to, _hatId, 1); } /// @notice Set a mutable hat to immutable /// @dev Sets the second bit of hat.config to 0 /// @param _hatId The id of the Hat to make immutable function makeHatImmutable(uint256 _hatId) external { _checkAdmin(_hatId); Hat storage hat = _hats[_hatId]; if (!_isMutable(hat)) { revert Immutable(); } hat.config &= ~uint96(1 << 94); emit HatMutabilityChanged(_hatId); } /// @notice Change a hat's details /// @dev Hat must be mutable, except for tophats. /// @param _hatId The id of the Hat to change /// @param _newDetails The new details. Must not be larger than 7000 bytes. function changeHatDetails(uint256 _hatId, string calldata _newDetails) external { if (bytes(_newDetails).length > 7000) revert StringTooLong(); _checkAdmin(_hatId); Hat storage hat = _hats[_hatId]; // a tophat can change its own details, but otherwise only mutable hat details can be changed if (!isTopHat(_hatId)) { if (!_isMutable(hat)) revert Immutable(); } hat.details = _newDetails; emit HatDetailsChanged(_hatId, _newDetails); } /// @notice Change a hat's details /// @dev Hat must be mutable /// @param _hatId The id of the Hat to change /// @param _newEligibility The new eligibility module function changeHatEligibility(uint256 _hatId, address _newEligibility) external { if (_newEligibility == address(0)) revert ZeroAddress(); _checkAdmin(_hatId); Hat storage hat = _hats[_hatId]; if (!_isMutable(hat)) { revert Immutable(); } hat.eligibility = _newEligibility; emit HatEligibilityChanged(_hatId, _newEligibility); } /// @notice Change a hat's details /// @dev Hat must be mutable /// @param _hatId The id of the Hat to change /// @param _newToggle The new toggle module function changeHatToggle(uint256 _hatId, address _newToggle) external { if (_newToggle == address(0)) revert ZeroAddress(); _checkAdmin(_hatId); Hat storage hat = _hats[_hatId]; if (!_isMutable(hat)) { revert Immutable(); } // record hat status from old toggle before changing; ensures smooth transition to new toggle, // especially in case of switching from mechanistic to humanistic toggle // a) attempt to retrieve hat status from old toggle (bool success, bool newStatus) = _pullHatStatus(hat, _hatId); // b) if succeeded, (ie if old toggle was mechanistic), store the retrieved status if (success) _processHatStatus(_hatId, newStatus); // set the new toggle hat.toggle = _newToggle; emit HatToggleChanged(_hatId, _newToggle); } /// @notice Change a hat's details /// @dev Hat must be mutable, except for tophats /// @param _hatId The id of the Hat to change /// @param _newImageURI The new imageURI. Must not be larger than 7000 bytes. function changeHatImageURI(uint256 _hatId, string calldata _newImageURI) external { if (bytes(_newImageURI).length > 7000) revert StringTooLong(); _checkAdmin(_hatId); Hat storage hat = _hats[_hatId]; // a tophat can change its own imageURI, but otherwise only mutable hat imageURIs can be changed if (!isTopHat(_hatId)) { if (!_isMutable(hat)) revert Immutable(); } hat.imageURI = _newImageURI; emit HatImageURIChanged(_hatId, _newImageURI); } /// @notice Change a hat's details /// @dev Hat must be mutable; new max supply cannot be less than current supply /// @param _hatId The id of the Hat to change /// @param _newMaxSupply The new max supply function changeHatMaxSupply(uint256 _hatId, uint32 _newMaxSupply) external { _checkAdmin(_hatId); Hat storage hat = _hats[_hatId]; if (!_isMutable(hat)) { revert Immutable(); } if (_newMaxSupply < hat.supply) { revert NewMaxSupplyTooLow(); } if (_newMaxSupply != hat.maxSupply) { hat.maxSupply = _newMaxSupply; emit HatMaxSupplyChanged(_hatId, _newMaxSupply); } } /// @notice Submits a request to link a Hat Tree under a parent tree. Requests can be /// submitted by either... /// a) the wearer of a topHat, previous to any linkage, or /// b) the admin(s) of an already-linked topHat (aka tree root), where such a /// request is to move the tree root to another admin within the same parent /// tree /// @dev A topHat can have at most 1 request at a time. Submitting a new request will /// replace the existing request. /// @param _topHatDomain The domain of the topHat to link /// @param _requestedAdminHat The hat that will administer the linked tree function requestLinkTopHatToTree(uint32 _topHatDomain, uint256 _requestedAdminHat) external { uint256 fullTopHatId = uint256(_topHatDomain) << 224; // (256 - TOPHAT_ADDRESS_SPACE); // The wearer of an unlinked tophat is also the admin of same; once a tophat is linked, its wearer is no longer its admin _checkAdmin(fullTopHatId); linkedTreeRequests[_topHatDomain] = _requestedAdminHat; emit TopHatLinkRequested(_topHatDomain, _requestedAdminHat); } /// @notice Approve a request to link a Tree under a parent tree, with options to add eligibility or toggle modules and change its metadata /// @dev Requests can only be approved by wearer or an admin of the `_newAdminHat`, and there /// can only be one link per tree root at a given time. /// @param _topHatDomain The 32 bit domain of the topHat to link /// @param _newAdminHat The hat that will administer the linked tree /// @param _eligibility Optional new eligibility module for the linked topHat /// @param _toggle Optional new toggle module for the linked topHat /// @param _details Optional new details for the linked topHat /// @param _imageURI Optional new imageURI for the linked topHat function approveLinkTopHatToTree( uint32 _topHatDomain, uint256 _newAdminHat, address _eligibility, address _toggle, string calldata _details, string calldata _imageURI ) external { // for everything but the last hat level, check the admin of `_newAdminHat`'s theoretical child hat, since either wearer or admin of `_newAdminHat` can approve if (getHatLevel(_newAdminHat) < MAX_LEVELS) { _checkAdmin(buildHatId(_newAdminHat, 1)); } else { // the above buildHatId trick doesn't work for the last hat level, so we need to explicitly check both admin and wearer in this case _checkAdminOrWearer(_newAdminHat); } // Linkages must be initiated by a request if (_newAdminHat != linkedTreeRequests[_topHatDomain]) revert LinkageNotRequested(); // remove the request -- ensures all linkages are initialized by unique requests, // except for relinks (see `relinkTopHatWithinTree`) delete linkedTreeRequests[_topHatDomain]; // execute the link. Replaces existing link, if any. _linkTopHatToTree(_topHatDomain, _newAdminHat, _eligibility, _toggle, _details, _imageURI); } /** * @notice Unlink a Tree from the parent tree * @dev This can only be called by an admin of the tree root. Fails if the topHat to unlink has no non-zero wearer, which can occur if... * - It's wearer is in badStanding * - It has been revoked from its wearer (and possibly burned)˘ * - It is not active (ie toggled off) * @param _topHatDomain The 32 bit domain of the topHat to unlink * @param _wearer The current wearer of the topHat to unlink */ function unlinkTopHatFromTree(uint32 _topHatDomain, address _wearer) external { uint256 fullTopHatId = uint256(_topHatDomain) << 224; // (256 - TOPHAT_ADDRESS_SPACE); _checkAdmin(fullTopHatId); // prevent unlinking if the topHat has no non-zero wearer // since we cannot search the entire address space for a wearer, we require the caller to provide the wearer if (_wearer == address(0) || !isWearerOfHat(_wearer, fullTopHatId)) revert HatsErrors.InvalidUnlink(); // execute the unlink delete linkedTreeAdmins[_topHatDomain]; // remove the request — ensures all linkages are initialized by unique requests delete linkedTreeRequests[_topHatDomain]; // reset eligibility and storage to defaults for unlinked top hats Hat storage hat = _hats[fullTopHatId]; delete hat.eligibility; delete hat.toggle; emit TopHatLinked(_topHatDomain, 0); } /// @notice Move a tree root to a different position within the same parent tree, /// without a request. Valid destinations include within the same local tree as the origin, /// or to the local tree of the tippyTopHat. TippyTopHat wearers can bypass this restriction /// to relink to anywhere in its full tree. /// @dev Caller must be both an admin tree root and admin or wearer of `_newAdminHat`. /// @param _topHatDomain The 32 bit domain of the topHat to relink /// @param _newAdminHat The new admin for the linked tree /// @param _eligibility Optional new eligibility module for the linked topHat /// @param _toggle Optional new toggle module for the linked topHat /// @param _details Optional new details for the linked topHat /// @param _imageURI Optional new imageURI for the linked topHat function relinkTopHatWithinTree( uint32 _topHatDomain, uint256 _newAdminHat, address _eligibility, address _toggle, string calldata _details, string calldata _imageURI ) external { uint256 fullTopHatId = uint256(_topHatDomain) << 224; // (256 - TOPHAT_ADDRESS_SPACE); // msg.sender being capable of both requesting and approving allows us to skip the request step _checkAdmin(fullTopHatId); // "requester" must be admin // "approver" can be wearer or admin if (getHatLevel(_newAdminHat) < MAX_LEVELS) { _checkAdmin(buildHatId(_newAdminHat, 1)); } else { // the above buildHatId trick doesn't work for the last hat level, so we need to explicitly check both admin and wearer in this case _checkAdminOrWearer(_newAdminHat); } // execute the new link, replacing the old link _linkTopHatToTree(_topHatDomain, _newAdminHat, _eligibility, _toggle, _details, _imageURI); } /// @notice Internal function to link a Tree under a parent Tree, with protection against circular linkages and relinking to a separate Tree, /// with options to add eligibility or toggle modules and change its metadata /// @dev Linking `_topHatDomain` replaces any existing links /// @param _topHatDomain The 32 bit domain of the topHat to link /// @param _newAdminHat The new admin for the linked tree /// @param _eligibility Optional new eligibility module for the linked topHat /// @param _toggle Optional new toggle module for the linked topHat /// @param _details Optional new details for the linked topHat /// @param _imageURI Optional new imageURI for the linked topHat function _linkTopHatToTree( uint32 _topHatDomain, uint256 _newAdminHat, address _eligibility, address _toggle, string calldata _details, string calldata _imageURI ) internal { if (!noCircularLinkage(_topHatDomain, _newAdminHat)) revert CircularLinkage(); { uint256 linkedAdmin = linkedTreeAdmins[_topHatDomain]; // disallow relinking to separate tree if (linkedAdmin > 0) { uint256 tippyTopHat = uint256(getTippyTopHatDomain(_topHatDomain)) << 224; if (!isWearerOfHat(msg.sender, tippyTopHat)) { uint256 destLocalTopHat = uint256(_newAdminHat >> 224 << 224); // (256 - TOPHAT_ADDRESS_SPACE); // for non-tippyTopHat wearers: destination local tophat must be either... // a) the same as origin local tophat, or // b) within the tippy top hat's local tree uint256 originLocalTopHat = linkedAdmin >> 224 << 224; // (256 - TOPHAT_ADDRESS_SPACE); if (destLocalTopHat != originLocalTopHat && destLocalTopHat != tippyTopHat) { revert CrossTreeLinkage(); } // for tippyTopHat weerers: destination must be within the same super tree } else if (!sameTippyTopHatDomain(_topHatDomain, _newAdminHat)) { revert CrossTreeLinkage(); } } } // update and log the linked topHat's modules and metadata, if any changes uint256 topHatId = uint256(_topHatDomain) << 224; Hat storage hat = _hats[topHatId]; if (_eligibility != address(0)) { hat.eligibility = _eligibility; emit HatEligibilityChanged(topHatId, _eligibility); } if (_toggle != address(0)) { hat.toggle = _toggle; emit HatToggleChanged(topHatId, _toggle); } uint256 length = bytes(_details).length; if (length > 0) { if (length > 7000) revert StringTooLong(); hat.details = _details; emit HatDetailsChanged(topHatId, _details); } length = bytes(_imageURI).length; if (length > 0) { if (length > 7000) revert StringTooLong(); hat.imageURI = _imageURI; emit HatImageURIChanged(topHatId, _imageURI); } // store the new linked admin linkedTreeAdmins[_topHatDomain] = _newAdminHat; emit TopHatLinked(_topHatDomain, _newAdminHat); } /*////////////////////////////////////////////////////////////// HATS VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice View the properties of a given Hat /// @param _hatId The id of the Hat /// @return details The details of the Hat /// @return maxSupply The max supply of tokens for this Hat /// @return supply The number of current wearers of this Hat /// @return eligibility The eligibility address for this Hat /// @return toggle The toggle address for this Hat /// @return imageURI The image URI used for this Hat /// @return lastHatId The most recently created Hat with this Hat as admin; also the count of Hats with this Hat as admin /// @return mutable_ Whether this hat's properties can be changed /// @return active Whether the Hat is current active, as read from `_isActive` function viewHat(uint256 _hatId) public view returns ( string memory details, uint32 maxSupply, uint32 supply, address eligibility, address toggle, string memory imageURI, uint16 lastHatId, bool mutable_, bool active ) { Hat storage hat = _hats[_hatId]; details = hat.details; maxSupply = hat.maxSupply; supply = hat.supply; eligibility = hat.eligibility; toggle = hat.toggle; imageURI = getImageURIForHat(_hatId); lastHatId = hat.lastHatId; mutable_ = _isMutable(hat); active = _isActive(hat, _hatId); } /// @notice Checks whether a given address wears a given Hat /// @dev Convenience function that wraps `balanceOf` /// @param _user The address in question /// @param _hatId The id of the Hat that the `_user` might wear /// @return isWearer Whether the `_user` wears the Hat. function isWearerOfHat(address _user, uint256 _hatId) public view returns (bool isWearer) { isWearer = (balanceOf(_user, _hatId) > 0); } /// @notice Checks whether a given address serves as the admin of a given Hat /// @dev Recursively checks if `_user` wears the admin Hat of the Hat in question. This is recursive since there may be a string of Hats as admins of Hats. /// @param _user The address in question /// @param _hatId The id of the Hat for which the `_user` might be the admin /// @return isAdmin Whether the `_user` has admin rights for the Hat function isAdminOfHat(address _user, uint256 _hatId) public view returns (bool isAdmin) { uint256 linkedTreeAdmin; uint32 adminLocalHatLevel; if (isLocalTopHat(_hatId)) { linkedTreeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)]; if (linkedTreeAdmin == 0) { // tree is not linked return isAdmin = isWearerOfHat(_user, _hatId); } else { // tree is linked if (isWearerOfHat(_user, linkedTreeAdmin)) { return isAdmin = true; } // user wears the treeAdmin else { adminLocalHatLevel = getLocalHatLevel(linkedTreeAdmin); _hatId = linkedTreeAdmin; } } } else { // if we get here, _hatId is not a tophat of any kind // get the local tree level of _hatId's admin adminLocalHatLevel = getLocalHatLevel(_hatId) - 1; } // search up _hatId's local address space for an admin hat that the _user wears while (adminLocalHatLevel > 0) { if (isWearerOfHat(_user, getAdminAtLocalLevel(_hatId, adminLocalHatLevel))) { return isAdmin = true; } // should not underflow given stopping condition > 0 unchecked { --adminLocalHatLevel; } } // if we get here, we've reached the top of _hatId's local tree, ie the local tophat // check if the user wears the local tophat if (isWearerOfHat(_user, getAdminAtLocalLevel(_hatId, 0))) return isAdmin = true; // if not, we check if it's linked to another tree linkedTreeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)]; if (linkedTreeAdmin == 0) { // tree is not linked // we've already learned that user doesn't wear the local tophat, so there's nothing else to check; we return false return isAdmin = false; } else { // tree is linked // check if user is wearer of linkedTreeAdmin if (isWearerOfHat(_user, linkedTreeAdmin)) return true; // if not, recurse to traverse the parent tree for a hat that the user wears isAdmin = isAdminOfHat(_user, linkedTreeAdmin); } } /// @notice Checks the active status of a hat /// @dev For internal use instead of `isActive` when passing Hat as param is preferable /// @param _hat The Hat struct /// @param _hatId The id of the hat /// @return active The active status of the hat function _isActive(Hat storage _hat, uint256 _hatId) internal view returns (bool active) { (bool success, bytes memory returndata) = _hat.toggle.staticcall(abi.encodeWithSignature("getHatStatus(uint256)", _hatId)); /* * if function call succeeds with data of length == 32, then we know the contract exists * and has the getHatStatus function. * But — since function selectors don't include return types — we still can't assume that the return data is a boolean, * so we treat it as a uint so it will always safely decode without throwing. */ if (success && returndata.length == 32) { // check the returndata manually uint256 uintReturndata = uint256(bytes32(returndata)); // false condition if (uintReturndata == 0) { active = false; // true condition } else if (uintReturndata == 1) { active = true; } // invalid condition else { active = _getHatStatus(_hat); } } else { active = _getHatStatus(_hat); } } /// @notice Checks the active status of a hat /// @param _hatId The id of the hat /// @return active Whether the hat is active function isActive(uint256 _hatId) external view returns (bool active) { active = _isActive(_hats[_hatId], _hatId); } /// @notice Internal function to retrieve a hat's status from storage /// @dev reads the 0th bit of the hat's config /// @param _hat The hat object /// @return status Whether the hat is active function _getHatStatus(Hat storage _hat) internal view returns (bool status) { status = (_hat.config >> 95 != 0); } /// @notice Internal function to retrieve a hat's mutability setting /// @dev reads the 1st bit of the hat's config /// @param _hat The hat object /// @return _mutable Whether the hat is mutable function _isMutable(Hat storage _hat) internal view returns (bool _mutable) { _mutable = (_hat.config & uint96(1 << 94) != 0); } /// @notice Checks whether a wearer of a Hat is in good standing /// @param _wearer The address of the Hat wearer /// @param _hatId The id of the Hat /// @return standing Whether the wearer is in good standing function isInGoodStanding(address _wearer, uint256 _hatId) public view returns (bool standing) { (bool success, bytes memory returndata) = _hats[_hatId].eligibility.staticcall( abi.encodeWithSignature("getWearerStatus(address,uint256)", _wearer, _hatId) ); /* * if function call succeeds with data of length == 64, then we know the contract exists * and has the getWearerStatus function (which returns two words). * But — since function selectors don't include return types — we still can't assume that the return data is two booleans, * so we treat it as a uint so it will always safely decode without throwing. */ if (success && returndata.length == 64) { // check the returndata manually (uint256 firstWord, uint256 secondWord) = abi.decode(returndata, (uint256, uint256)); // returndata is valid if (firstWord < 2 && secondWord < 2) { standing = (secondWord == 1) ? true : false; // returndata is invalid } else { standing = !badStandings[_hatId][_wearer]; } } else { standing = !badStandings[_hatId][_wearer]; } } /// @notice Internal call to check whether an address is eligible for a given Hat /// @dev Tries an external call to the Hat's eligibility module, defaulting to existing badStandings state if the call fails (ie if the eligibility module address does not conform to the IHatsEligibility interface) /// @param _wearer The address of the Hat wearer /// @param _hat The Hat object /// @param _hatId The id of the Hat /// @return eligible Whether the wearer is eligible for the Hat function _isEligible(address _wearer, Hat storage _hat, uint256 _hatId) internal view returns (bool eligible) { (bool success, bytes memory returndata) = _hat.eligibility.staticcall(abi.encodeWithSignature("getWearerStatus(address,uint256)", _wearer, _hatId)); /* * if function call succeeds with data of length == 64, then we know the contract exists * and has the getWearerStatus function (which returns two words). * But — since function selectors don't include return types — we still can't assume that the return data is two booleans, * so we treat it as a uint so it will always safely decode without throwing. */ if (success && returndata.length == 64) { bool standing; // check the returndata manually (uint256 firstWord, uint256 secondWord) = abi.decode(returndata, (uint256, uint256)); // returndata is valid if (firstWord < 2 && secondWord < 2) { standing = (secondWord == 1) ? true : false; // never eligible if in bad standing eligible = (standing && firstWord == 1) ? true : false; } // returndata is invalid else { eligible = !badStandings[_hatId][_wearer]; } } else { eligible = !badStandings[_hatId][_wearer]; } } /// @notice Checks whether an address is eligible for a given Hat /// @dev Public function for use when passing a Hat object is not possible or preferable /// @param _hatId The id of the Hat /// @param _wearer The address to check /// @return eligible Whether the wearer is eligible for the Hat function isEligible(address _wearer, uint256 _hatId) public view returns (bool eligible) { eligible = _isEligible(_wearer, _hats[_hatId], _hatId); } /// @notice Gets the current supply of a Hat /// @dev Only tracks explicit burns and mints, not dynamic revocations /// @param _hatId The id of the Hat /// @return supply The current supply of the Hat function hatSupply(uint256 _hatId) external view returns (uint32 supply) { supply = _hats[_hatId].supply; } /// @notice Gets the eligibility module for a hat /// @param _hatId The hat whose eligibility module we're looking for /// @return eligibility The eligibility module for this hat function getHatEligibilityModule(uint256 _hatId) external view returns (address eligibility) { eligibility = _hats[_hatId].eligibility; } /// @notice Gets the toggle module for a hat /// @param _hatId The hat whose toggle module we're looking for /// @return toggle The toggle module for this hat function getHatToggleModule(uint256 _hatId) external view returns (address toggle) { toggle = _hats[_hatId].toggle; } /// @notice Gets the max supply for a hat /// @param _hatId The hat whose max supply we're looking for /// @return maxSupply The maximum possible quantity of this hat that could be minted function getHatMaxSupply(uint256 _hatId) external view returns (uint32 maxSupply) { maxSupply = _hats[_hatId].maxSupply; } /// @notice Gets the imageURI for a given hat /// @dev If this hat does not have an imageURI set, recursively get the imageURI from /// its admin /// @param _hatId The hat whose imageURI we're looking for /// @return _uri The imageURI of this hat or, if empty, its admin function getImageURIForHat(uint256 _hatId) public view returns (string memory _uri) { // check _hatId first to potentially avoid the `getHatLevel` call Hat storage hat = _hats[_hatId]; string memory imageURI = hat.imageURI; // save 1 SLOAD // if _hatId has an imageURI, we return it if (bytes(imageURI).length > 0) { return imageURI; } // otherwise, we check its branch of admins uint256 level = getHatLevel(_hatId); // but first we check if _hatId is a tophat, in which case we fall back to the global image uri if (level == 0) return baseImageURI; // otherwise, we check each of its admins for a valid imageURI uint256 id; // already checked at `level` above, so we start the loop at `level - 1` for (uint256 i = level - 1; i > 0;) { id = getAdminAtLevel(_hatId, uint32(i)); hat = _hats[id]; imageURI = hat.imageURI; if (bytes(imageURI).length > 0) { return imageURI; } // should not underflow given stopping condition is > 0 unchecked { --i; } } id = getAdminAtLevel(_hatId, 0); hat = _hats[id]; imageURI = hat.imageURI; if (bytes(imageURI).length > 0) { return imageURI; } // if none of _hatId's admins has an imageURI of its own, we again fall back to the global image uri _uri = baseImageURI; } /// @notice Constructs the URI for a Hat, using data from the Hat struct /// @param _hatId The id of the Hat /// @return _uri An ERC1155-compatible JSON string function _constructURI(uint256 _hatId) internal view returns (string memory _uri) { Hat storage hat = _hats[_hatId]; uint256 hatAdmin; if (isTopHat(_hatId)) { hatAdmin = _hatId; } else { hatAdmin = getAdminAtLevel(_hatId, getHatLevel(_hatId) - 1); } // split into two objects to avoid stack too deep error string memory idProperties = string.concat( '"domain": "', LibString.toString(getTopHatDomain(_hatId)), '", "id": "', LibString.toString(_hatId), '", "pretty id": "', LibString.toHexString(_hatId, 32), '",' ); string memory otherProperties = string.concat( '"status": "', (_isActive(hat, _hatId) ? "active" : "inactive"), '", "current supply": "', LibString.toString(hat.supply), '", "supply cap": "', LibString.toString(hat.maxSupply), '", "admin (id)": "', LibString.toString(hatAdmin), '", "admin (pretty id)": "', LibString.toHexString(hatAdmin, 32), '", "eligibility module": "', LibString.toHexString(hat.eligibility), '", "toggle module": "', LibString.toHexString(hat.toggle), '", "mutable": "', _isMutable(hat) ? "true" : "false", '"' ); _uri = string( abi.encodePacked( "data:application/json;base64,", Base64.encode( bytes( string.concat( '{"name": "', "Hat", '", "description": "', hat.details, '", "image": "', getImageURIForHat(_hatId), '",', '"properties": ', "{", idProperties, otherProperties, "}", "}" ) ) ) ) ); } /*////////////////////////////////////////////////////////////// ERC1155 OVERRIDES //////////////////////////////////////////////////////////////*/ /// @notice Gets the Hat token balance of a user for a given Hat /// @dev Balance is dynamic based on the hat's status and wearer's eligibility, so off-chain balance data indexed from events may not be in sync /// @param _wearer The address whose balance is being checked /// @param _hatId The id of the Hat /// @return balance The `wearer`'s balance of the Hat tokens. Can never be > 1. function balanceOf(address _wearer, uint256 _hatId) public view override(ERC1155, IHats) returns (uint256 balance) { Hat storage hat = _hats[_hatId]; balance = 0; if (_isActive(hat, _hatId) && _isEligible(_wearer, hat, _hatId)) { balance = super.balanceOf(_wearer, _hatId); } } /// @notice Internal call to mint a Hat token to a wearer /// @dev Unsafe if called when `_wearer` has a non-zero balance of `_hatId` /// @param _wearer The wearer of the Hat and the recipient of the newly minted token /// @param _hatId The id of the Hat to mint function _mintHat(address _wearer, uint256 _hatId) internal { unchecked { // should not overflow since `mintHat` enforces max balance of 1 _balanceOf[_wearer][_hatId] = 1; // increment Hat supply counter // should not overflow given AllHatsWorn check in `mintHat` ++_hats[_hatId].supply; } emit TransferSingle(msg.sender, address(0), _wearer, _hatId, 1); } /// @notice Internal call to burn a wearer's Hat token /// @dev Unsafe if called when `_wearer` doesn't have a zero balance of `_hatId` /// @param _wearer The wearer from which to burn the Hat token /// @param _hatId The id of the Hat to burn function _burnHat(address _wearer, uint256 _hatId) internal { // neither should underflow since `_burnHat` is never called on non-positive balance unchecked { _balanceOf[_wearer][_hatId] = 0; // decrement Hat supply counter --_hats[_hatId].supply; } emit TransferSingle(msg.sender, _wearer, address(0), _hatId, 1); } /// @notice Approvals are not necessary for Hats since transfers are not handled by the wearer /// @dev Admins should use `transferHat()` to transfer function setApprovalForAll(address, bool) public pure override { revert(); } /// @notice Safe transfers are not necessary for Hats since transfers are not handled by the wearer /// @dev Admins should use `transferHat()` to transfer function safeTransferFrom(address, address, uint256, uint256, bytes calldata) public pure override { revert(); } /// @notice Safe transfers are not necessary for Hats since transfers are not handled by the wearer function safeBatchTransferFrom(address, address, uint256[] calldata, uint256[] calldata, bytes calldata) public pure override { revert(); } /** * @notice ERC165 interface detection * @dev While Hats Protocol conforms to the ERC1155 *interface*, it does not fully conform to the ERC1155 *specification* * since it does not implement the ERC1155Receiver functionality. * For this reason, this function overrides the ERC1155 implementation to return false for ERC1155. * @param interfaceId The interface identifier, as specified in ERC-165 * @return bool True if the contract implements `interfaceId` and false otherwise */ function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { return interfaceId == 0x01ffc9a7 // ERC165 Interface ID for ERC165 // interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155 || interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI } /// @notice Batch retrieval for wearer balances /// @dev Given the higher gas overhead of Hats balanceOf checks, large batches may be high cost or run into gas limits /// @param _wearers Array of addresses to check balances for /// @param _hatIds Array of Hat ids to check, using the same index as _wearers function balanceOfBatch(address[] calldata _wearers, uint256[] calldata _hatIds) public view override(ERC1155, IHats) returns (uint256[] memory balances) { if (_wearers.length != _hatIds.length) revert BatchArrayLengthMismatch(); balances = new uint256[](_wearers.length); // Unchecked because the only math done is incrementing // the array index counter which cannot possibly overflow. unchecked { for (uint256 i; i < _wearers.length; ++i) { balances[i] = balanceOf(_wearers[i], _hatIds[i]); } } } /// @notice View the uri for a Hat /// @param id The id of the Hat /// @return _uri An 1155-compatible JSON object function uri(uint256 id) public view override(ERC1155, IHats) returns (string memory _uri) { _uri = _constructURI(id); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Minimalist and gas efficient standard ERC1155 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol) abstract contract ERC1155 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event TransferSingle( address indexed operator, address indexed from, address indexed to, uint256 id, uint256 amount ); event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] amounts ); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); event URI(string value, uint256 indexed id); /*////////////////////////////////////////////////////////////// ERC1155 STORAGE //////////////////////////////////////////////////////////////*/ mapping(address => mapping(uint256 => uint256)) internal _balanceOf; mapping(address => mapping(address => bool)) public isApprovedForAll; /*////////////////////////////////////////////////////////////// METADATA LOGIC //////////////////////////////////////////////////////////////*/ function uri(uint256 id) public view virtual returns (string memory); /*////////////////////////////////////////////////////////////// ERC1155 LOGIC //////////////////////////////////////////////////////////////*/ function setApprovalForAll(address operator, bool approved) public virtual { isApprovedForAll[msg.sender][operator] = approved; emit ApprovalForAll(msg.sender, operator, approved); } function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) public virtual { require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED"); _balanceOf[from][id] -= amount; _balanceOf[to][id] += amount; emit TransferSingle(msg.sender, from, to, id, amount); require( to.code.length == 0 ? to != address(0) : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, from, id, amount, data) == ERC1155TokenReceiver.onERC1155Received.selector, "UNSAFE_RECIPIENT" ); } function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) public virtual { require(ids.length == amounts.length, "LENGTH_MISMATCH"); require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED"); // Storing these outside the loop saves ~15 gas per iteration. uint256 id; uint256 amount; for (uint256 i = 0; i < ids.length; ) { id = ids[i]; amount = amounts[i]; _balanceOf[from][id] -= amount; _balanceOf[to][id] += amount; // An array can't have a total length // larger than the max uint256 value. unchecked { ++i; } } emit TransferBatch(msg.sender, from, to, ids, amounts); require( to.code.length == 0 ? to != address(0) : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, from, ids, amounts, data) == ERC1155TokenReceiver.onERC1155BatchReceived.selector, "UNSAFE_RECIPIENT" ); } function balanceOf(address owner, uint256 id) public view virtual returns (uint256 balance) { balance = _balanceOf[owner][id]; } function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) public view virtual returns (uint256[] memory balances) { require(owners.length == ids.length, "LENGTH_MISMATCH"); balances = new uint256[](owners.length); // Unchecked because the only math done is incrementing // the array index counter which cannot possibly overflow. unchecked { for (uint256 i = 0; i < owners.length; ++i) { balances[i] = _balanceOf[owners[i]][ids[i]]; } } } /*////////////////////////////////////////////////////////////// ERC165 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155 interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { _balanceOf[to][id] += amount; emit TransferSingle(msg.sender, address(0), to, id, amount); require( to.code.length == 0 ? to != address(0) : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, address(0), id, amount, data) == ERC1155TokenReceiver.onERC1155Received.selector, "UNSAFE_RECIPIENT" ); } function _batchMint( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { uint256 idsLength = ids.length; // Saves MLOADs. require(idsLength == amounts.length, "LENGTH_MISMATCH"); for (uint256 i = 0; i < idsLength; ) { _balanceOf[to][ids[i]] += amounts[i]; // An array can't have a total length // larger than the max uint256 value. unchecked { ++i; } } emit TransferBatch(msg.sender, address(0), to, ids, amounts); require( to.code.length == 0 ? to != address(0) : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, address(0), ids, amounts, data) == ERC1155TokenReceiver.onERC1155BatchReceived.selector, "UNSAFE_RECIPIENT" ); } function _batchBurn( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { uint256 idsLength = ids.length; // Saves MLOADs. require(idsLength == amounts.length, "LENGTH_MISMATCH"); for (uint256 i = 0; i < idsLength; ) { _balanceOf[from][ids[i]] -= amounts[i]; // An array can't have a total length // larger than the max uint256 value. unchecked { ++i; } } emit TransferBatch(msg.sender, from, address(0), ids, amounts); } function _burn( address from, uint256 id, uint256 amount ) internal virtual { _balanceOf[from][id] -= amount; emit TransferSingle(msg.sender, from, address(0), id, amount); } } /// @notice A generic interface for a contract which properly accepts ERC1155 tokens. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol) abstract contract ERC1155TokenReceiver { function onERC1155Received( address, address, uint256, uint256, bytes calldata ) external virtual returns (bytes4) { return ERC1155TokenReceiver.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] calldata, uint256[] calldata, bytes calldata ) external virtual returns (bytes4) { return ERC1155TokenReceiver.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; import "./IHatsIdUtilities.sol"; import "./HatsErrors.sol"; import "./HatsEvents.sol"; interface IHats is IHatsIdUtilities, HatsErrors, HatsEvents { function mintTopHat(address _target, string memory _details, string memory _imageURI) external returns (uint256 topHatId); function createHat( uint256 _admin, string calldata _details, uint32 _maxSupply, address _eligibility, address _toggle, bool _mutable, string calldata _imageURI ) external returns (uint256 newHatId); function batchCreateHats( uint256[] calldata _admins, string[] calldata _details, uint32[] calldata _maxSupplies, address[] memory _eligibilityModules, address[] memory _toggleModules, bool[] calldata _mutables, string[] calldata _imageURIs ) external returns (bool success); function getNextId(uint256 _admin) external view returns (uint256 nextId); function mintHat(uint256 _hatId, address _wearer) external returns (bool success); function batchMintHats(uint256[] calldata _hatIds, address[] calldata _wearers) external returns (bool success); function setHatStatus(uint256 _hatId, bool _newStatus) external returns (bool toggled); function checkHatStatus(uint256 _hatId) external returns (bool toggled); function setHatWearerStatus(uint256 _hatId, address _wearer, bool _eligible, bool _standing) external returns (bool updated); function checkHatWearerStatus(uint256 _hatId, address _wearer) external returns (bool updated); function renounceHat(uint256 _hatId) external; function transferHat(uint256 _hatId, address _from, address _to) external; /*////////////////////////////////////////////////////////////// HATS ADMIN FUNCTIONS //////////////////////////////////////////////////////////////*/ function makeHatImmutable(uint256 _hatId) external; function changeHatDetails(uint256 _hatId, string memory _newDetails) external; function changeHatEligibility(uint256 _hatId, address _newEligibility) external; function changeHatToggle(uint256 _hatId, address _newToggle) external; function changeHatImageURI(uint256 _hatId, string memory _newImageURI) external; function changeHatMaxSupply(uint256 _hatId, uint32 _newMaxSupply) external; function requestLinkTopHatToTree(uint32 _topHatId, uint256 _newAdminHat) external; function approveLinkTopHatToTree( uint32 _topHatId, uint256 _newAdminHat, address _eligibility, address _toggle, string calldata _details, string calldata _imageURI ) external; function unlinkTopHatFromTree(uint32 _topHatId, address _wearer) external; function relinkTopHatWithinTree( uint32 _topHatDomain, uint256 _newAdminHat, address _eligibility, address _toggle, string calldata _details, string calldata _imageURI ) external; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ function viewHat(uint256 _hatId) external view returns ( string memory details, uint32 maxSupply, uint32 supply, address eligibility, address toggle, string memory imageURI, uint16 lastHatId, bool mutable_, bool active ); function isWearerOfHat(address _user, uint256 _hatId) external view returns (bool isWearer); function isAdminOfHat(address _user, uint256 _hatId) external view returns (bool isAdmin); function isInGoodStanding(address _wearer, uint256 _hatId) external view returns (bool standing); function isEligible(address _wearer, uint256 _hatId) external view returns (bool eligible); function getHatEligibilityModule(uint256 _hatId) external view returns (address eligibility); function getHatToggleModule(uint256 _hatId) external view returns (address toggle); function getHatMaxSupply(uint256 _hatId) external view returns (uint32 maxSupply); function hatSupply(uint256 _hatId) external view returns (uint32 supply); function getImageURIForHat(uint256 _hatId) external view returns (string memory _uri); function balanceOf(address wearer, uint256 hatId) external view returns (uint256 balance); function balanceOfBatch(address[] calldata _wearers, uint256[] calldata _hatIds) external view returns (uint256[] memory); function uri(uint256 id) external view returns (string memory _uri); }
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; import "./Interfaces/IHatsIdUtilities.sol"; // import { console2 } from "forge-std/Test.sol"; //remove after testing /// @notice see HatsErrors.sol for description error MaxLevelsReached(); /// @title Hats Id Utilities /// @dev Functions for working with Hat Ids from Hats Protocol. Factored out of Hats.sol /// for easier use by other contracts. /// @author Haberdasher Labs contract HatsIdUtilities is IHatsIdUtilities { /// @notice Mapping of tophats requesting to link to admin hats in other trees /// @dev Linkage only occurs if request is approved by the new admin mapping(uint32 => uint256) public linkedTreeRequests; // topHatDomain => requested new admin /// @notice Mapping of approved & linked tophats to admin hats in other trees, used for grafting one hats tree onto another /// @dev Trees can only be linked to another tree via their tophat mapping(uint32 => uint256) public linkedTreeAdmins; // topHatDomain => hatId /** * Hat Ids serve as addresses. A given Hat's Id represents its location in its * hat tree: its level, its admin, its admin's admin (etc, all the way up to the * tophat). * * The top level consists of 4 bytes and references all tophats. * * Each level below consists of 16 bits, and contains up to 65,536 child hats. * * A uint256 contains 4 bytes of space for tophat addresses, giving room for ((256 - * 32) / 16) = 14 levels of delegation, with the admin at each level having space for * 65,536 different child hats. * * A hat tree consists of a single tophat and has a max depth of 14 levels. */ /// @dev Number of bits of address space for tophat ids, ie the tophat domain uint256 internal constant TOPHAT_ADDRESS_SPACE = 32; /// @dev Number of bits of address space for each level below the tophat uint256 internal constant LOWER_LEVEL_ADDRESS_SPACE = 16; /// @dev Maximum number of levels below the tophat, ie max tree depth /// (256 - TOPHAT_ADDRESS_SPACE) / LOWER_LEVEL_ADDRESS_SPACE; uint256 internal constant MAX_LEVELS = 14; /// @notice Constructs a valid hat id for a new hat underneath a given admin /// @dev Reverts if the admin has already reached `MAX_LEVELS` /// @param _admin the id of the admin for the new hat /// @param _newHat the uint16 id of the new hat /// @return id The constructed hat id function buildHatId(uint256 _admin, uint16 _newHat) public pure returns (uint256 id) { uint256 mask; for (uint256 i = 0; i < MAX_LEVELS;) { unchecked { mask = uint256( type(uint256).max // should not overflow given known constants >> (TOPHAT_ADDRESS_SPACE + (LOWER_LEVEL_ADDRESS_SPACE * i)) ); } if (_admin & mask == 0) { unchecked { id = _admin | ( uint256(_newHat) // should not overflow given known constants << (LOWER_LEVEL_ADDRESS_SPACE * (MAX_LEVELS - 1 - i)) ); } return id; } // should not overflow based on < MAX_LEVELS stopping condition unchecked { ++i; } } // if _admin is already at MAX_LEVELS, child hats are not possible, so we revert revert MaxLevelsReached(); } /// @notice Identifies the level a given hat in its hat tree /// @param _hatId the id of the hat in question /// @return level (0 to type(uint32).max) function getHatLevel(uint256 _hatId) public view returns (uint32 level) { // uint256 mask; // uint256 i; level = getLocalHatLevel(_hatId); uint256 treeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)]; if (treeAdmin != 0) { level = 1 + level + getHatLevel(treeAdmin); } } /// @notice Identifies the level a given hat in its local hat tree /// @dev Similar to getHatLevel, but does not account for linked trees /// @param _hatId the id of the hat in question /// @return level The local level, from 0 to 14 function getLocalHatLevel(uint256 _hatId) public pure returns (uint32 level) { if (_hatId & uint256(type(uint224).max) == 0) return 0; if (_hatId & uint256(type(uint208).max) == 0) return 1; if (_hatId & uint256(type(uint192).max) == 0) return 2; if (_hatId & uint256(type(uint176).max) == 0) return 3; if (_hatId & uint256(type(uint160).max) == 0) return 4; if (_hatId & uint256(type(uint144).max) == 0) return 5; if (_hatId & uint256(type(uint128).max) == 0) return 6; if (_hatId & uint256(type(uint112).max) == 0) return 7; if (_hatId & uint256(type(uint96).max) == 0) return 8; if (_hatId & uint256(type(uint80).max) == 0) return 9; if (_hatId & uint256(type(uint64).max) == 0) return 10; if (_hatId & uint256(type(uint48).max) == 0) return 11; if (_hatId & uint256(type(uint32).max) == 0) return 12; if (_hatId & uint256(type(uint16).max) == 0) return 13; return 14; } /// @notice Checks whether a hat is a topHat /// @param _hatId The hat in question /// @return _isTopHat Whether the hat is a topHat function isTopHat(uint256 _hatId) public view returns (bool _isTopHat) { _isTopHat = isLocalTopHat(_hatId) && linkedTreeAdmins[getTopHatDomain(_hatId)] == 0; } /// @notice Checks whether a hat is a topHat in its local hat tree /// @dev Similar to isTopHat, but does not account for linked trees /// @param _hatId The hat in question /// @return _isLocalTopHat Whether the hat is a topHat for its local tree function isLocalTopHat(uint256 _hatId) public pure returns (bool _isLocalTopHat) { _isLocalTopHat = _hatId > 0 && uint224(_hatId) == 0; } function isValidHatId(uint256 _hatId) public pure returns (bool validHatId) { // valid top hats are valid hats if (isLocalTopHat(_hatId)) return true; uint32 level = getLocalHatLevel(_hatId); uint256 admin; // for each subsequent level up the tree, check if the level is 0 and return false if so for (uint256 i = level - 1; i > 0;) { // truncate to find the (truncated) admin at this level // we don't need to check _hatId's own level since getLocalHatLevel already ensures that its non-empty admin = _hatId >> (LOWER_LEVEL_ADDRESS_SPACE * (MAX_LEVELS - i)); // if the lowest level of the truncated admin is empty, the hat id is invalid if (uint16(admin) == 0) return false; unchecked { --i; } } // if there are no empty levels, return true return true; } /// @notice Gets the hat id of the admin at a given level of a given hat /// @dev This function traverses trees by following the linkedTreeAdmin /// pointer to a hat located in a different tree /// @param _hatId the id of the hat in question /// @param _level the admin level of interest /// @return admin The hat id of the resulting admin function getAdminAtLevel(uint256 _hatId, uint32 _level) public view returns (uint256 admin) { uint256 linkedTreeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)]; if (linkedTreeAdmin == 0) return admin = getAdminAtLocalLevel(_hatId, _level); uint32 localTopHatLevel = getHatLevel(getAdminAtLocalLevel(_hatId, 0)); if (localTopHatLevel <= _level) return admin = getAdminAtLocalLevel(_hatId, _level - localTopHatLevel); return admin = getAdminAtLevel(linkedTreeAdmin, _level); } /// @notice Gets the hat id of the admin at a given level of a given hat /// local to the tree containing the hat. /// @param _hatId the id of the hat in question /// @param _level the admin level of interest /// @return admin The hat id of the resulting admin function getAdminAtLocalLevel(uint256 _hatId, uint32 _level) public pure returns (uint256 admin) { uint256 mask = type(uint256).max << (LOWER_LEVEL_ADDRESS_SPACE * (MAX_LEVELS - _level)); admin = _hatId & mask; } /// @notice Gets the tophat domain of a given hat /// @dev A domain is the identifier for a given hat tree, stored in the first 4 bytes of a hat's id /// @param _hatId the id of the hat in question /// @return domain The domain of the hat's tophat function getTopHatDomain(uint256 _hatId) public pure returns (uint32 domain) { domain = uint32(_hatId >> (LOWER_LEVEL_ADDRESS_SPACE * MAX_LEVELS)); } /// @notice Gets the domain of the highest parent tophat — the "tippy tophat" /// @param _topHatDomain the 32 bit domain of a (likely linked) tophat /// @return domain The tippy tophat domain function getTippyTopHatDomain(uint32 _topHatDomain) public view returns (uint32 domain) { uint256 linkedAdmin = linkedTreeAdmins[_topHatDomain]; if (linkedAdmin == 0) return domain = _topHatDomain; return domain = getTippyTopHatDomain(getTopHatDomain(linkedAdmin)); } /// @notice Checks For any circular linkage of trees /// @param _topHatDomain the 32 bit domain of the tree to be linked /// @param _linkedAdmin the hatId of the potential tree admin /// @return notCircular circular link has not been found function noCircularLinkage(uint32 _topHatDomain, uint256 _linkedAdmin) public view returns (bool notCircular) { if (_linkedAdmin == 0) return true; uint32 adminDomain = getTopHatDomain(_linkedAdmin); if (_topHatDomain == adminDomain) return false; uint256 parentAdmin = linkedTreeAdmins[adminDomain]; return noCircularLinkage(_topHatDomain, parentAdmin); } /// @notice Checks that a tophat domain and its potential linked admin are from the same tree, ie have the same tippy tophat domain /// @param _topHatDomain The 32 bit domain of the tophat to be linked /// @param _newAdminHat The new admin for the linked tree /// @return sameDomain Whether the _topHatDomain and the domain of its potential linked _newAdminHat domains are the same function sameTippyTopHatDomain(uint32 _topHatDomain, uint256 _newAdminHat) public view returns (bool sameDomain) { // get highest parent domains for current and new tree root admins uint32 currentTippyTophatDomain = getTippyTopHatDomain(_topHatDomain); uint32 newAdminDomain = getTopHatDomain(_newAdminHat); uint32 newHTippyTophatDomain = getTippyTopHatDomain(newAdminDomain); // check that both domains are equal sameDomain = (currentTippyTophatDomain == newHTippyTophatDomain); } }
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; interface IHatsToggle { function getHatStatus(uint256 _hatId) external view returns (bool); }
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; interface IHatsEligibility { /// @notice Returns the status of a wearer for a given hat /// @dev If standing is false, eligibility MUST also be false /// @param _wearer The address of the current or prospective Hat wearer /// @param _hatId The id of the hat in question /// @return eligible Whether the _wearer is eligible to wear the hat /// @return standing Whether the _wearer is in goog standing function getWearerStatus(address _wearer, uint256 _hatId) external view returns (bool eligible, bool standing); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library to encode and decode strings in Base64. /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/Base64.sol) /// @author Modified from Solady (https://github.com/vectorized/solady/blob/main/src/utils/Base64.sol) library Base64 { /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// See: https://datatracker.ietf.org/doc/html/rfc4648 /// @param fileSafe Whether to replace '+' with '-' and '/' with '_'. /// @param noPadding Whether to strip away the padding. function encode(bytes memory data, bool fileSafe, bool noPadding) internal pure returns (string memory result) { assembly { let dataLength := mload(data) if dataLength { // Multiply by 4/3 rounded up. // The `shl(2, ...)` is equivalent to multiplying by 4. let encodedLength := shl(2, div(add(dataLength, 2), 3)) // Set `result` to point to the start of the free memory. result := mload(0x40) // Store the table into the scratch space. // Offsetted by -1 byte so that the `mload` will load the character. // We will rewrite the free memory pointer at `0x40` later with // the allocated size. // The magic constant 0x0230 will translate "-_" + "+/". mstore(0x1f, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef") mstore(0x3f, sub("ghijklmnopqrstuvwxyz0123456789-_", mul(iszero(fileSafe), 0x0230))) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, encodedLength) // Run over the input, 3 bytes at a time. // prettier-ignore for {} 1 {} { data := add(data, 3) // Advance 3 bytes. let input := mload(data) // Write 4 bytes. Optimized for fewer stack operations. mstore8( ptr , mload(and(shr(18, input), 0x3F))) mstore8(add(ptr, 1), mload(and(shr(12, input), 0x3F))) mstore8(add(ptr, 2), mload(and(shr( 6, input), 0x3F))) mstore8(add(ptr, 3), mload(and( input , 0x3F))) ptr := add(ptr, 4) // Advance 4 bytes. // prettier-ignore if iszero(lt(ptr, end)) { break } } let r := mod(dataLength, 3) switch noPadding case 0 { // Offset `ptr` and pad with '='. We can simply write over the end. mstore8(sub(ptr, iszero(iszero(r))), 0x3d) // Pad at `ptr - 1` if `r > 0`. mstore8(sub(ptr, shl(1, eq(r, 1))), 0x3d) // Pad at `ptr - 2` if `r == 1`. // Write the length of the string. mstore(result, encodedLength) } default { // Write the length of the string. mstore(result, sub(encodedLength, add(iszero(iszero(r)), eq(r, 1)))) } // Allocate the memory for the string. // Add 31 and mask with `not(31)` to round the // free memory pointer up the next multiple of 32. mstore(0x40, and(add(end, 31), not(31))) } } } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, false, false)`. function encode(bytes memory data) internal pure returns (string memory result) { result = encode(data, false, false); } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, fileSafe, false)`. function encode(bytes memory data, bool fileSafe) internal pure returns (string memory result) { result = encode(data, fileSafe, false); } /// @dev Decodes base64 encoded `data`. /// /// Supports: /// - RFC 4648 (both standard and file-safe mode). /// - RFC 3501 (63: ','). /// /// Does not support: /// - Line breaks. /// /// Note: For performance reasons, /// this function will NOT revert on invalid `data` inputs. /// Outputs for invalid inputs will simply be undefined behaviour. /// It is the user's responsibility to ensure that the `data` /// is a valid base64 encoded string. function decode(string memory data) internal pure returns (bytes memory result) { assembly { let dataLength := mload(data) if dataLength { let end := add(data, dataLength) let decodedLength := mul(shr(2, dataLength), 3) switch and(dataLength, 3) case 0 { // If padded. decodedLength := sub( decodedLength, add(eq(and(mload(end), 0xFF), 0x3d), eq(and(mload(end), 0xFFFF), 0x3d3d)) ) } default { // If non-padded. decodedLength := add(decodedLength, sub(and(dataLength, 3), 1)) } result := mload(0x40) // Write the length of the string. mstore(result, decodedLength) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) // Load the table into the scratch space. // Constants are optimized for smaller bytecode with zero gas overhead. // `m` also doubles as the mask of the upper 6 bits. let m := 0xfc000000fc00686c7074787c8084888c9094989ca0a4a8acb0b4b8bcc0c4c8cc mstore(0x5b, m) mstore(0x3b, 0x04080c1014181c2024282c3034383c4044484c5054585c6064) mstore(0x1a, 0xf8fcf800fcd0d4d8dce0e4e8ecf0f4) // prettier-ignore for {} 1 {} { // Read 4 bytes. data := add(data, 4) let input := mload(data) // Write 3 bytes. mstore(ptr, or( and(m, mload(byte(28, input))), shr(6, or( and(m, mload(byte(29, input))), shr(6, or( and(m, mload(byte(30, input))), shr(6, mload(byte(31, input))) )) )) )) ptr := add(ptr, 3) // prettier-ignore if iszero(lt(data, end)) { break } } // Allocate the memory for the string. // Add 32 + 31 and mask with `not(31)` to round the // free memory pointer up the next multiple of 32. mstore(0x40, and(add(add(result, decodedLength), 63), not(31))) // Restore the zero slot. mstore(0x60, 0) } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for converting numbers into strings and other string operations. /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/LibString.sol) /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol) library LibString { /// ----------------------------------------------------------------------- /// Custom Errors /// ----------------------------------------------------------------------- /// @dev The `length` of the output is too small to contain all the hex digits. error HexLengthInsufficient(); /// ----------------------------------------------------------------------- /// Constants /// ----------------------------------------------------------------------- /// @dev The constant returned when the `search` is not found in the string. uint256 internal constant NOT_FOUND = uint256(int256(-1)); /// ----------------------------------------------------------------------- /// Decimal Operations /// ----------------------------------------------------------------------- /// @dev Returns the base 10 decimal representation of `value`. function toString(uint256 value) internal pure returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /// ----------------------------------------------------------------------- /// Hexadecimal Operations /// ----------------------------------------------------------------------- /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2 + 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) { assembly { let start := mload(0x40) // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length. // We add 0x20 to the total and round down to a multiple of 0x20. // (0x20 + 0x20 + 0x02 + 0x20) = 0x62. let m := add(start, and(add(shl(1, length), 0x62), not(0x1f))) // Allocate the memory. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let temp := value // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for {} 1 {} { str := sub(str, 2) mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) length := sub(length, 1) // prettier-ignore if iszero(length) { break } } if temp { // Store the function selector of `HexLengthInsufficient()`. mstore(0x00, 0x2194895a) // Revert with (offset, size). revert(0x1c, 0x04) } // Compute the string's length. let strLength := add(sub(end, str), 2) // Move the pointer and write the "0x" prefix. str := sub(str, 0x20) mstore(str, 0x3078) // Move the pointer and write the length. str := sub(str, 2) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2 + 2` bytes. function toHexString(uint256 value) internal pure returns (string memory str) { assembly { let start := mload(0x40) // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x40 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0. let m := add(start, 0xa0) // Allocate the memory. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 2) mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) // prettier-ignore if iszero(temp) { break } } // Compute the string's length. let strLength := add(sub(end, str), 2) // Move the pointer and write the "0x" prefix. str := sub(str, 0x20) mstore(str, 0x3078) // Move the pointer and write the length. str := sub(str, 2) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { assembly { let start := mload(0x40) // We need 0x20 bytes for the length, 0x02 bytes for the prefix, // and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x02 + 0x28) is 0x60. str := add(start, 0x60) // Allocate the memory. mstore(0x40, str) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let length := 20 // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 2) mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) length := sub(length, 1) // prettier-ignore if iszero(length) { break } } // Move the pointer and write the "0x" prefix. str := sub(str, 32) mstore(str, 0x3078) // Move the pointer and write the length. str := sub(str, 2) mstore(str, 42) } } /// ----------------------------------------------------------------------- /// Other String Operations /// ----------------------------------------------------------------------- // For performance and bytecode compactness, all indices of the following operations // are byte (ASCII) offsets, not UTF character offsets. /// @dev Returns `subject` all occurances of `search` replaced with `replacement`. function replace( string memory subject, string memory search, string memory replacement ) internal pure returns (string memory result) { assembly { let subjectLength := mload(subject) let searchLength := mload(search) let replacementLength := mload(replacement) subject := add(subject, 0x20) search := add(search, 0x20) replacement := add(replacement, 0x20) result := add(mload(0x40), 0x20) let subjectEnd := add(subject, subjectLength) if iszero(gt(searchLength, subjectLength)) { let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1) let h := 0 if iszero(lt(searchLength, 32)) { h := keccak256(search, searchLength) } let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(search) // prettier-ignore for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { mstore(result, t) result := add(result, 1) subject := add(subject, 1) // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Copy the `replacement` one word at a time. // prettier-ignore for { let o := 0 } 1 {} { mstore(add(result, o), mload(add(replacement, o))) o := add(o, 0x20) // prettier-ignore if iszero(lt(o, replacementLength)) { break } } result := add(result, replacementLength) subject := add(subject, searchLength) if searchLength { // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } continue } } mstore(result, t) result := add(result, 1) subject := add(subject, 1) // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } } } let resultRemainder := result result := add(mload(0x40), 0x20) let k := add(sub(resultRemainder, result), sub(subjectEnd, subject)) // Copy the rest of the string one word at a time. // prettier-ignore for {} lt(subject, subjectEnd) {} { mstore(resultRemainder, mload(subject)) resultRemainder := add(resultRemainder, 0x20) subject := add(subject, 0x20) } result := sub(result, 0x20) // Zeroize the slot after the string. let last := add(add(result, 0x20), k) mstore(last, 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) // Store the length of the result. mstore(result, k) } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { assembly { // prettier-ignore for { let subjectLength := mload(subject) } 1 {} { if iszero(mload(search)) { // `result = min(from, subjectLength)`. result := xor(from, mul(xor(from, subjectLength), lt(subjectLength, from))) break } let searchLength := mload(search) let subjectStart := add(subject, 0x20) result := not(0) // Initialize to `NOT_FOUND`. subject := add(subjectStart, from) let subjectSearchEnd := add(sub(add(subjectStart, subjectLength), searchLength), 1) let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(add(search, 0x20)) // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } if iszero(lt(searchLength, 32)) { // prettier-ignore for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if iszero(shr(m, xor(mload(subject), s))) { if eq(keccak256(subject, searchLength), h) { result := sub(subject, subjectStart) break } } subject := add(subject, 1) // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } } break } // prettier-ignore for {} 1 {} { if iszero(shr(m, xor(mload(subject), s))) { result := sub(subject, subjectStart) break } subject := add(subject, 1) // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = indexOf(subject, search, 0); } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf( string memory subject, string memory search, uint256 from ) internal pure returns (uint256 result) { assembly { // prettier-ignore for {} 1 {} { let searchLength := mload(search) let fromMax := sub(mload(subject), searchLength) if iszero(gt(fromMax, from)) { from := fromMax } if iszero(mload(search)) { result := from break } result := not(0) // Initialize to `NOT_FOUND`. let subjectSearchEnd := sub(add(subject, 0x20), 1) subject := add(add(subject, 0x20), from) // prettier-ignore if iszero(gt(subject, subjectSearchEnd)) { break } // As this function is not too often used, // we shall simply use keccak256 for smaller bytecode size. // prettier-ignore for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if eq(keccak256(subject, searchLength), h) { result := sub(subject, add(subjectSearchEnd, 1)) break } subject := sub(subject, 1) // prettier-ignore if iszero(gt(subject, subjectSearchEnd)) { break } } break } } } /// @dev Returns the index of the first location of `search` in `subject`, /// searching from right to left. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = lastIndexOf(subject, search, uint256(int256(-1))); } /// @dev Returns whether `subject` starts with `search`. function startsWith(string memory subject, string memory search) internal pure returns (bool result) { assembly { let searchLength := mload(search) // Just using keccak256 directly is actually cheaper. result := and( iszero(gt(searchLength, mload(subject))), eq(keccak256(add(subject, 0x20), searchLength), keccak256(add(search, 0x20), searchLength)) ) } } /// @dev Returns whether `subject` ends with `search`. function endsWith(string memory subject, string memory search) internal pure returns (bool result) { assembly { let searchLength := mload(search) let subjectLength := mload(subject) // Whether `search` is not longer than `subject`. let withinRange := iszero(gt(searchLength, subjectLength)) // Just using keccak256 directly is actually cheaper. result := and( withinRange, eq( keccak256( // `subject + 0x20 + max(subjectLength - searchLength, 0)`. add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))), searchLength ), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns `subject` repeated `times`. function repeat(string memory subject, uint256 times) internal pure returns (string memory result) { assembly { let subjectLength := mload(subject) if iszero(or(iszero(times), iszero(subjectLength))) { subject := add(subject, 0x20) result := mload(0x40) let output := add(result, 0x20) // prettier-ignore for {} 1 {} { // Copy the `subject` one word at a time. // prettier-ignore for { let o := 0 } 1 {} { mstore(add(output, o), mload(add(subject, o))) o := add(o, 0x20) // prettier-ignore if iszero(lt(o, subjectLength)) { break } } output := add(output, subjectLength) times := sub(times, 1) // prettier-ignore if iszero(times) { break } } // Zeroize the slot after the string. mstore(output, 0) // Store the length. let resultLength := sub(output, add(result, 0x20)) mstore(result, resultLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 63), not(31)))) } } } /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive). /// `start` and `end` are byte offsets. function slice(string memory subject, uint256 start, uint256 end) internal pure returns (string memory result) { assembly { let subjectLength := mload(subject) if iszero(gt(subjectLength, end)) { end := subjectLength } if iszero(gt(subjectLength, start)) { start := subjectLength } if lt(start, end) { result := mload(0x40) let resultLength := sub(end, start) mstore(result, resultLength) subject := add(subject, start) // Copy the `subject` one word at a time, backwards. // prettier-ignore for { let o := and(add(resultLength, 31), not(31)) } 1 {} { mstore(add(result, o), mload(add(subject, o))) o := sub(o, 0x20) // prettier-ignore if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(result, 0x20), resultLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 63), not(31)))) } } } /// @dev Returns a copy of `subject` sliced from `start` to the end of the string. /// `start` is a byte offset. function slice(string memory subject, uint256 start) internal pure returns (string memory result) { result = slice(subject, start, uint256(int256(-1))); } /// @dev Returns all the indices of `search` in `subject`. /// The indices are byte offsets. function indicesOf(string memory subject, string memory search) internal pure returns (uint256[] memory result) { assembly { let subjectLength := mload(subject) let searchLength := mload(search) if iszero(gt(searchLength, subjectLength)) { subject := add(subject, 0x20) search := add(search, 0x20) result := add(mload(0x40), 0x20) let subjectStart := subject let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1) let h := 0 if iszero(lt(searchLength, 32)) { h := keccak256(search, searchLength) } let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(search) // prettier-ignore for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { subject := add(subject, 1) // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Append to `result`. mstore(result, sub(subject, subjectStart)) result := add(result, 0x20) // Advance `subject` by `searchLength`. subject := add(subject, searchLength) if searchLength { // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } continue } } subject := add(subject, 1) // prettier-ignore if iszero(lt(subject, subjectSearchEnd)) { break } } let resultEnd := result // Assign `result` to the free memory pointer. result := mload(0x40) // Store the length of `result`. mstore(result, shr(5, sub(resultEnd, add(result, 0x20)))) // Allocate memory for result. // We allocate one more word, so this array can be recycled for {split}. mstore(0x40, add(resultEnd, 0x20)) } } } /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string. function split(string memory subject, string memory delimiter) internal pure returns (string[] memory result) { uint256[] memory indices = indicesOf(subject, delimiter); assembly { if mload(indices) { let indexPtr := add(indices, 0x20) let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1))) mstore(sub(indicesEnd, 0x20), mload(subject)) mstore(indices, add(mload(indices), 1)) let prevIndex := 0 // prettier-ignore for {} 1 {} { let index := mload(indexPtr) mstore(indexPtr, 0x60) if iszero(eq(index, prevIndex)) { let element := mload(0x40) let elementLength := sub(index, prevIndex) mstore(element, elementLength) // Copy the `subject` one word at a time, backwards. // prettier-ignore for { let o := and(add(elementLength, 31), not(31)) } 1 {} { mstore(add(element, o), mload(add(add(subject, prevIndex), o))) o := sub(o, 0x20) // prettier-ignore if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(element, 0x20), elementLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(element, and(add(elementLength, 63), not(31)))) // Store the `element` into the array. mstore(indexPtr, element) } prevIndex := add(index, mload(delimiter)) indexPtr := add(indexPtr, 0x20) // prettier-ignore if iszero(lt(indexPtr, indicesEnd)) { break } } result := indices if iszero(mload(delimiter)) { result := add(indices, 0x20) mstore(result, sub(mload(indices), 2)) } } } } /// @dev Returns a concatenated string of `a` and `b`. /// Cheaper than `string.concat()` and does not de-align the free memory pointer. function concat(string memory a, string memory b) internal pure returns (string memory result) { assembly { result := mload(0x40) let aLength := mload(a) // Copy `a` one word at a time, backwards. // prettier-ignore for { let o := and(add(mload(a), 32), not(31)) } 1 {} { mstore(add(result, o), mload(add(a, o))) o := sub(o, 0x20) // prettier-ignore if iszero(o) { break } } let bLength := mload(b) let output := add(result, mload(a)) // Copy `b` one word at a time, backwards. // prettier-ignore for { let o := and(add(bLength, 32), not(31)) } 1 {} { mstore(add(output, o), mload(add(b, o))) o := sub(o, 0x20) // prettier-ignore if iszero(o) { break } } let totalLength := add(aLength, bLength) let last := add(add(result, 0x20), totalLength) // Zeroize the slot after the string. mstore(last, 0) // Stores the length. mstore(result, totalLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) } } /// @dev Packs a single string with its length into a single word. /// Returns `bytes32(0)` if the length is zero or greater than 31. function packOne(string memory a) internal pure returns (bytes32 result) { assembly { // We don't need to zero right pad the string, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes. mload(add(a, 0x1f)), // `length != 0 && length < 32`. Abuses underflow. // Assumes that the length is valid and within the block gas limit. lt(sub(mload(a), 1), 0x1f) ) } } /// @dev Unpacks a string packed using {packOne}. /// Returns the empty string if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packOne}, the output behaviour is undefined. function unpackOne(bytes32 packed) internal pure returns (string memory result) { assembly { // Grab the free memory pointer. result := mload(0x40) // Allocate 2 words (1 for the length, 1 for the bytes). mstore(0x40, add(result, 0x40)) // Zeroize the length slot. mstore(result, 0) // Store the length and bytes. mstore(add(result, 0x1f), packed) // Right pad with zeroes. mstore(add(add(result, 0x20), mload(result)), 0) } } /// @dev Packs two strings with their lengths into a single word. /// Returns `bytes32(0)` if combined length is zero or greater than 30. function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) { assembly { let aLength := mload(a) // We don't need to zero right pad the strings, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes of `a` and `b`. or(shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))), mload(sub(add(b, 0x1e), aLength))), // `totalLength != 0 && totalLength < 31`. Abuses underflow. // Assumes that the lengths are valid and within the block gas limit. lt(sub(add(aLength, mload(b)), 1), 0x1e) ) } } /// @dev Unpacks strings packed using {packTwo}. /// Returns the empty strings if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packTwo}, the output behaviour is undefined. function unpackTwo(bytes32 packed) internal pure returns (string memory resultA, string memory resultB) { assembly { // Grab the free memory pointer. resultA := mload(0x40) resultB := add(resultA, 0x40) // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words. mstore(0x40, add(resultB, 0x40)) // Zeroize the length slots. mstore(resultA, 0) mstore(resultB, 0) // Store the lengths and bytes. mstore(add(resultA, 0x1f), packed) mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA)))) // Right pad with zeroes. mstore(add(add(resultA, 0x20), mload(resultA)), 0) mstore(add(add(resultB, 0x20), mload(resultB)), 0) } } /// @dev Directly returns `a` without copying. function directReturn(string memory a) internal pure { assembly { // Right pad with zeroes. Just in case the string is produced // by a method that doesn't zero right pad. mstore(add(add(a, 0x20), mload(a)), 0) // Store the return offset. // Assumes that the string does not start from the scratch space. mstore(sub(a, 0x20), 0x20) // End the transaction, returning the string. return(sub(a, 0x20), add(mload(a), 0x40)) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Contract that enables a single call to call multiple methods on itself. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/Multicallable.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Multicallable.sol) abstract contract Multicallable { /// @dev Apply `DELEGATECALL` with the current contract to each calldata in `data`, /// and store the `abi.encode` formatted results of each `DELEGATECALL` into `results`. /// If any of the `DELEGATECALL`s reverts, the entire context is reverted, /// and the error is bubbled up. /// /// This function is deliberately made non-payable to guard against double-spending. /// (See: https://www.paradigm.xyz/2021/08/two-rights-might-make-a-wrong) /// /// For efficiency, this function will directly return the results, terminating the context. /// If called internally, it must be called at the end of a function /// that returns `(bytes[] memory)`. function multicall(bytes[] calldata data) public virtual returns (bytes[] memory) { assembly { mstore(0x00, 0x20) mstore(0x20, data.length) // Store `data.length` into `results`. // Early return if no data. if iszero(data.length) { return(0x00, 0x40) } let results := 0x40 // `shl` 5 is equivalent to multiplying by 0x20. let end := shl(5, data.length) // Copy the offsets from calldata into memory. calldatacopy(0x40, data.offset, end) // Offset into `results`. let resultsOffset := end // Pointer to the end of `results`. end := add(results, end) for {} 1 {} { // The offset of the current bytes in the calldata. let o := add(data.offset, mload(results)) let memPtr := add(resultsOffset, 0x40) // Copy the current bytes from calldata to the memory. calldatacopy( memPtr, add(o, 0x20), // The offset of the current bytes' bytes. calldataload(o) // The length of the current bytes. ) if iszero(delegatecall(gas(), address(), memPtr, calldataload(o), 0x00, 0x00)) { // Bubble up the revert if the delegatecall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } // Append the current `resultsOffset` into `results`. mstore(results, resultsOffset) results := add(results, 0x20) // Append the `returndatasize()`, and the return data. mstore(memPtr, returndatasize()) returndatacopy(add(memPtr, 0x20), 0x00, returndatasize()) // Advance the `resultsOffset` by `returndatasize() + 0x20`, // rounded up to the next multiple of 32. resultsOffset := and(add(add(resultsOffset, returndatasize()), 0x3f), 0xffffffffffffffe0) if iszero(lt(results, end)) { break } } return(0x00, add(resultsOffset, 0x40)) } } }
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; interface IHatsIdUtilities { function buildHatId(uint256 _admin, uint16 _newHat) external pure returns (uint256 id); function getHatLevel(uint256 _hatId) external view returns (uint32 level); function getLocalHatLevel(uint256 _hatId) external pure returns (uint32 level); function isTopHat(uint256 _hatId) external view returns (bool _topHat); function isLocalTopHat(uint256 _hatId) external pure returns (bool _localTopHat); function isValidHatId(uint256 _hatId) external view returns (bool validHatId); function getAdminAtLevel(uint256 _hatId, uint32 _level) external view returns (uint256 admin); function getAdminAtLocalLevel(uint256 _hatId, uint32 _level) external pure returns (uint256 admin); function getTopHatDomain(uint256 _hatId) external view returns (uint32 domain); function getTippyTopHatDomain(uint32 _topHatDomain) external view returns (uint32 domain); function noCircularLinkage(uint32 _topHatDomain, uint256 _linkedAdmin) external view returns (bool notCircular); function sameTippyTopHatDomain(uint32 _topHatDomain, uint256 _newAdminHat) external view returns (bool sameDomain); }
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; interface HatsErrors { /// @notice Emitted when `user` is attempting to perform an action on `hatId` but is not wearing one of `hatId`'s admin hats /// @dev Can be equivalent to `NotHatWearer(buildHatId(hatId))`, such as when emitted by `approveLinkTopHatToTree` or `relinkTopHatToTree` error NotAdmin(address user, uint256 hatId); /// @notice Emitted when attempting to perform an action as or for an account that is not a wearer of a given hat error NotHatWearer(); /// @notice Emitted when attempting to perform an action that requires being either an admin or wearer of a given hat error NotAdminOrWearer(); /// @notice Emitted when attempting to mint `hatId` but `hatId`'s maxSupply has been reached error AllHatsWorn(uint256 hatId); /// @notice Emitted when attempting to create a hat with a level 14 hat as its admin error MaxLevelsReached(); /// @notice Emitted when an attempted hat id has empty intermediate level(s) error InvalidHatId(); /// @notice Emitted when attempting to mint `hatId` to a `wearer` who is already wearing the hat error AlreadyWearingHat(address wearer, uint256 hatId); /// @notice Emitted when attempting to mint a non-existant hat error HatDoesNotExist(uint256 hatId); /// @notice Emmitted when attempting to mint or transfer a hat that is not active error HatNotActive(); /// @notice Emitted when attempting to mint or transfer a hat to an ineligible wearer error NotEligible(); /// @notice Emitted when attempting to check or set a hat's status from an account that is not that hat's toggle module error NotHatsToggle(); /// @notice Emitted when attempting to check or set a hat wearer's status from an account that is not that hat's eligibility module error NotHatsEligibility(); /// @notice Emitted when array arguments to a batch function have mismatching lengths error BatchArrayLengthMismatch(); /// @notice Emitted when attempting to mutate or transfer an immutable hat error Immutable(); /// @notice Emitted when attempting to change a hat's maxSupply to a value lower than its current supply error NewMaxSupplyTooLow(); /// @notice Emitted when attempting to link a tophat to a new admin for which the tophat serves as an admin error CircularLinkage(); /// @notice Emitted when attempting to link or relink a tophat to a separate tree error CrossTreeLinkage(); /// @notice Emitted when attempting to link a tophat without a request error LinkageNotRequested(); /// @notice Emitted when attempting to unlink a tophat that does not have a wearer /// @dev This ensures that unlinking never results in a bricked tophat error InvalidUnlink(); /// @notice Emmited when attempting to change a hat's eligibility or toggle module to the zero address error ZeroAddress(); /// @notice Emmitted when attempting to change a hat's details or imageURI to a string with over 7000 bytes (~characters) /// @dev This protects against a DOS attack where an admin iteratively extend's a hat's details or imageURI /// to be so long that reading it exceeds the block gas limit, breaking `uri()` and `viewHat()` error StringTooLong(); }
// SPDX-License-Identifier: AGPL-3.0 // Copyright (C) 2023 Haberdasher Labs // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.8.13; interface HatsEvents { /// @notice Emitted when a new hat is created /// @param id The id for the new hat /// @param details A description of the Hat /// @param maxSupply The total instances of the Hat that can be worn at once /// @param eligibility The address that can report on the Hat wearer's status /// @param toggle The address that can deactivate the Hat /// @param mutable_ Whether the hat's properties are changeable after creation /// @param imageURI The image uri for this hat and the fallback for its event HatCreated( uint256 id, string details, uint32 maxSupply, address eligibility, address toggle, bool mutable_, string imageURI ); /// @notice Emitted when a hat wearer's standing is updated /// @dev Eligibility is excluded since the source of truth for eligibility is the eligibility module and may change without a transaction /// @param hatId The id of the wearer's hat /// @param wearer The wearer's address /// @param wearerStanding Whether the wearer is in good standing for the hat event WearerStandingChanged(uint256 hatId, address wearer, bool wearerStanding); /// @notice Emitted when a hat's status is updated /// @param hatId The id of the hat /// @param newStatus Whether the hat is active event HatStatusChanged(uint256 hatId, bool newStatus); /// @notice Emitted when a hat's details are updated /// @param hatId The id of the hat /// @param newDetails The updated details event HatDetailsChanged(uint256 hatId, string newDetails); /// @notice Emitted when a hat's eligibility module is updated /// @param hatId The id of the hat /// @param newEligibility The updated eligibiliy module event HatEligibilityChanged(uint256 hatId, address newEligibility); /// @notice Emitted when a hat's toggle module is updated /// @param hatId The id of the hat /// @param newToggle The updated toggle module event HatToggleChanged(uint256 hatId, address newToggle); /// @notice Emitted when a hat's mutability is updated /// @param hatId The id of the hat event HatMutabilityChanged(uint256 hatId); /// @notice Emitted when a hat's maximum supply is updated /// @param hatId The id of the hat /// @param newMaxSupply The updated max supply event HatMaxSupplyChanged(uint256 hatId, uint32 newMaxSupply); /// @notice Emitted when a hat's image URI is updated /// @param hatId The id of the hat /// @param newImageURI The updated image URI event HatImageURIChanged(uint256 hatId, string newImageURI); /// @notice Emitted when a tophat linkage is requested by its admin /// @param domain The domain of the tree tophat to link /// @param newAdmin The tophat's would-be admin in the parent tree event TopHatLinkRequested(uint32 domain, uint256 newAdmin); /// @notice Emitted when a tophat is linked to a another tree /// @param domain The domain of the newly-linked tophat /// @param newAdmin The tophat's new admin in the parent tree event TopHatLinked(uint32 domain, uint256 newAdmin); }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solady/=lib/solady/src/", "solbase/=lib/solbase/src/", "ERC1155/=lib/ERC1155/", "utils/=lib/utils/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "evmVersion": "london", "libraries": {} }
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_baseImageURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"hatId","type":"uint256"}],"name":"AllHatsWorn","type":"error"},{"inputs":[{"internalType":"address","name":"wearer","type":"address"},{"internalType":"uint256","name":"hatId","type":"uint256"}],"name":"AlreadyWearingHat","type":"error"},{"inputs":[],"name":"BatchArrayLengthMismatch","type":"error"},{"inputs":[],"name":"CircularLinkage","type":"error"},{"inputs":[],"name":"CrossTreeLinkage","type":"error"},{"inputs":[{"internalType":"uint256","name":"hatId","type":"uint256"}],"name":"HatDoesNotExist","type":"error"},{"inputs":[],"name":"HatNotActive","type":"error"},{"inputs":[],"name":"Immutable","type":"error"},{"inputs":[],"name":"InvalidHatId","type":"error"},{"inputs":[],"name":"InvalidUnlink","type":"error"},{"inputs":[],"name":"LinkageNotRequested","type":"error"},{"inputs":[],"name":"MaxLevelsReached","type":"error"},{"inputs":[],"name":"MaxLevelsReached","type":"error"},{"inputs":[],"name":"NewMaxSupplyTooLow","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"hatId","type":"uint256"}],"name":"NotAdmin","type":"error"},{"inputs":[],"name":"NotAdminOrWearer","type":"error"},{"inputs":[],"name":"NotEligible","type":"error"},{"inputs":[],"name":"NotHatWearer","type":"error"},{"inputs":[],"name":"NotHatsEligibility","type":"error"},{"inputs":[],"name":"NotHatsToggle","type":"error"},{"inputs":[],"name":"StringTooLong","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"details","type":"string"},{"indexed":false,"internalType":"uint32","name":"maxSupply","type":"uint32"},{"indexed":false,"internalType":"address","name":"eligibility","type":"address"},{"indexed":false,"internalType":"address","name":"toggle","type":"address"},{"indexed":false,"internalType":"bool","name":"mutable_","type":"bool"},{"indexed":false,"internalType":"string","name":"imageURI","type":"string"}],"name":"HatCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"},{"indexed":false,"internalType":"string","name":"newDetails","type":"string"}],"name":"HatDetailsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"},{"indexed":false,"internalType":"address","name":"newEligibility","type":"address"}],"name":"HatEligibilityChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"},{"indexed":false,"internalType":"string","name":"newImageURI","type":"string"}],"name":"HatImageURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"newMaxSupply","type":"uint32"}],"name":"HatMaxSupplyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"}],"name":"HatMutabilityChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"newStatus","type":"bool"}],"name":"HatStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"},{"indexed":false,"internalType":"address","name":"newToggle","type":"address"}],"name":"HatToggleChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"domain","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"newAdmin","type":"uint256"}],"name":"TopHatLinkRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"domain","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"newAdmin","type":"uint256"}],"name":"TopHatLinked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hatId","type":"uint256"},{"indexed":false,"internalType":"address","name":"wearer","type":"address"},{"indexed":false,"internalType":"bool","name":"wearerStanding","type":"bool"}],"name":"WearerStandingChanged","type":"event"},{"inputs":[{"internalType":"uint32","name":"_topHatDomain","type":"uint32"},{"internalType":"uint256","name":"_newAdminHat","type":"uint256"},{"internalType":"address","name":"_eligibility","type":"address"},{"internalType":"address","name":"_toggle","type":"address"},{"internalType":"string","name":"_details","type":"string"},{"internalType":"string","name":"_imageURI","type":"string"}],"name":"approveLinkTopHatToTree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"badStandings","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wearer","type":"address"},{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_wearers","type":"address[]"},{"internalType":"uint256[]","name":"_hatIds","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseImageURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_admins","type":"uint256[]"},{"internalType":"string[]","name":"_details","type":"string[]"},{"internalType":"uint32[]","name":"_maxSupplies","type":"uint32[]"},{"internalType":"address[]","name":"_eligibilityModules","type":"address[]"},{"internalType":"address[]","name":"_toggleModules","type":"address[]"},{"internalType":"bool[]","name":"_mutables","type":"bool[]"},{"internalType":"string[]","name":"_imageURIs","type":"string[]"}],"name":"batchCreateHats","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_hatIds","type":"uint256[]"},{"internalType":"address[]","name":"_wearers","type":"address[]"}],"name":"batchMintHats","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_admin","type":"uint256"},{"internalType":"uint16","name":"_newHat","type":"uint16"}],"name":"buildHatId","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"string","name":"_newDetails","type":"string"}],"name":"changeHatDetails","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"address","name":"_newEligibility","type":"address"}],"name":"changeHatEligibility","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"string","name":"_newImageURI","type":"string"}],"name":"changeHatImageURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"uint32","name":"_newMaxSupply","type":"uint32"}],"name":"changeHatMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"address","name":"_newToggle","type":"address"}],"name":"changeHatToggle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"checkHatStatus","outputs":[{"internalType":"bool","name":"toggled","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"address","name":"_wearer","type":"address"}],"name":"checkHatWearerStatus","outputs":[{"internalType":"bool","name":"updated","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_admin","type":"uint256"},{"internalType":"string","name":"_details","type":"string"},{"internalType":"uint32","name":"_maxSupply","type":"uint32"},{"internalType":"address","name":"_eligibility","type":"address"},{"internalType":"address","name":"_toggle","type":"address"},{"internalType":"bool","name":"_mutable","type":"bool"},{"internalType":"string","name":"_imageURI","type":"string"}],"name":"createHat","outputs":[{"internalType":"uint256","name":"newHatId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"uint32","name":"_level","type":"uint32"}],"name":"getAdminAtLevel","outputs":[{"internalType":"uint256","name":"admin","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"uint32","name":"_level","type":"uint32"}],"name":"getAdminAtLocalLevel","outputs":[{"internalType":"uint256","name":"admin","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"getHatEligibilityModule","outputs":[{"internalType":"address","name":"eligibility","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"getHatLevel","outputs":[{"internalType":"uint32","name":"level","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"getHatMaxSupply","outputs":[{"internalType":"uint32","name":"maxSupply","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"getHatToggleModule","outputs":[{"internalType":"address","name":"toggle","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"getImageURIForHat","outputs":[{"internalType":"string","name":"_uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"getLocalHatLevel","outputs":[{"internalType":"uint32","name":"level","type":"uint32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_admin","type":"uint256"}],"name":"getNextId","outputs":[{"internalType":"uint256","name":"nextId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_topHatDomain","type":"uint32"}],"name":"getTippyTopHatDomain","outputs":[{"internalType":"uint32","name":"domain","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"getTopHatDomain","outputs":[{"internalType":"uint32","name":"domain","type":"uint32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"hatSupply","outputs":[{"internalType":"uint32","name":"supply","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isActive","outputs":[{"internalType":"bool","name":"active","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isAdminOfHat","outputs":[{"internalType":"bool","name":"isAdmin","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wearer","type":"address"},{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isEligible","outputs":[{"internalType":"bool","name":"eligible","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wearer","type":"address"},{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isInGoodStanding","outputs":[{"internalType":"bool","name":"standing","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isLocalTopHat","outputs":[{"internalType":"bool","name":"_isLocalTopHat","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isTopHat","outputs":[{"internalType":"bool","name":"_isTopHat","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isValidHatId","outputs":[{"internalType":"bool","name":"validHatId","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"isWearerOfHat","outputs":[{"internalType":"bool","name":"isWearer","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTopHatId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"linkedTreeAdmins","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"linkedTreeRequests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"makeHatImmutable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"address","name":"_wearer","type":"address"}],"name":"mintHat","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"string","name":"_details","type":"string"},{"internalType":"string","name":"_imageURI","type":"string"}],"name":"mintTopHat","outputs":[{"internalType":"uint256","name":"topHatId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_topHatDomain","type":"uint32"},{"internalType":"uint256","name":"_linkedAdmin","type":"uint256"}],"name":"noCircularLinkage","outputs":[{"internalType":"bool","name":"notCircular","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_topHatDomain","type":"uint32"},{"internalType":"uint256","name":"_newAdminHat","type":"uint256"},{"internalType":"address","name":"_eligibility","type":"address"},{"internalType":"address","name":"_toggle","type":"address"},{"internalType":"string","name":"_details","type":"string"},{"internalType":"string","name":"_imageURI","type":"string"}],"name":"relinkTopHatWithinTree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"renounceHat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_topHatDomain","type":"uint32"},{"internalType":"uint256","name":"_requestedAdminHat","type":"uint256"}],"name":"requestLinkTopHatToTree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint32","name":"_topHatDomain","type":"uint32"},{"internalType":"uint256","name":"_newAdminHat","type":"uint256"}],"name":"sameTippyTopHatDomain","outputs":[{"internalType":"bool","name":"sameDomain","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"bool","name":"_newStatus","type":"bool"}],"name":"setHatStatus","outputs":[{"internalType":"bool","name":"toggled","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"address","name":"_wearer","type":"address"},{"internalType":"bool","name":"_eligible","type":"bool"},{"internalType":"bool","name":"_standing","type":"bool"}],"name":"setHatWearerStatus","outputs":[{"internalType":"bool","name":"updated","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferHat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_topHatDomain","type":"uint32"},{"internalType":"address","name":"_wearer","type":"address"}],"name":"unlinkTopHatFromTree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"_uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hatId","type":"uint256"}],"name":"viewHat","outputs":[{"internalType":"string","name":"details","type":"string"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"supply","type":"uint32"},{"internalType":"address","name":"eligibility","type":"address"},{"internalType":"address","name":"toggle","type":"address"},{"internalType":"string","name":"imageURI","type":"string"},{"internalType":"uint16","name":"lastHatId","type":"uint16"},{"internalType":"bool","name":"mutable_","type":"bool"},{"internalType":"bool","name":"active","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200594a3803806200594a83398101604081905262000034916200011f565b600462000042838262000218565b50600662000051828262000218565b505050620002e4565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200008257600080fd5b81516001600160401b03808211156200009f576200009f6200005a565b604051601f8301601f19908116603f01168101908282118183101715620000ca57620000ca6200005a565b81604052838152602092508683858801011115620000e757600080fd5b600091505b838210156200010b5785820183015181830184015290820190620000ec565b600093810190920192909252949350505050565b600080604083850312156200013357600080fd5b82516001600160401b03808211156200014b57600080fd5b620001598683870162000070565b935060208501519150808211156200017057600080fd5b506200017f8582860162000070565b9150509250929050565b600181811c908216806200019e57607f821691505b602082108103620001bf57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021357600081815260208120601f850160051c81016020861015620001ee5750805b601f850160051c820191505b818110156200020f57828155600101620001fa565b5050505b505050565b81516001600160401b038111156200023457620002346200005a565b6200024c8162000245845462000189565b84620001c5565b602080601f8311600181146200028457600084156200026b5750858301515b600019600386901b1c1916600185901b1785556200020f565b600085815260208120601f198616915b82811015620002b55788860151825594840194600190910190840162000294565b5085821015620002d45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61565680620002f46000396000f3fe608060405234801561001057600080fd5b50600436106103a35760003560e01c806382afd23b116101e9578063d0221ee01161010f578063e985e9c5116100ad578063fb2849171161007c578063fb284917146108e7578063fb2aaa4c14610914578063fc3e05a414610927578063fd8a71631461093757600080fd5b8063e985e9c514610885578063f242432a146108b3578063f737401e146108c1578063f8f353b6146108d457600080fd5b8063d80a8434116100e9578063d80a843414610839578063d9fd995b1461084c578063e05209ff1461085f578063e33dd5c91461087257600080fd5b8063d0221ee0146107eb578063d3272ba8146107fe578063d395acf81461081157600080fd5b8063a2be079b11610187578063b052925e11610156578063b052925e14610792578063b56f7562146107a5578063c43dc177146107b8578063cead6304146107cb57600080fd5b8063a2be079b1461071e578063a4a1f06c1461074c578063ac9650d81461075f578063afaae55a1461077f57600080fd5b80639d6ccb9f116101c35780639d6ccb9f146106d75780639fe3b510146106ea578063a22cb465146106fd578063a29e8fa61461070b57600080fd5b806382afd23b146106885780638c0760771461069b5780639aa22f6d146106c457600080fd5b8063499c05e8116102ce578063641f776e1161026c578063756329a41161023b578063756329a41461063c5780637903e56b1461064f5780637a9df89f1461066257806380198fad1461067557600080fd5b8063641f776e146105cc5780636743175a146105df5780637178fb51146105f257806374f82e301461063457600080fd5b806354a1826c116102a857806354a1826c1461054f57806357f607721461056257806359701e44146105a65780635d5eb5af146105b957600080fd5b8063499c05e8146104f45780634e1273f41461051c57806352a6b2651461053c57600080fd5b80631a64dfad11610346578063378a848911610315578063378a8489146104a85780633fa9d544146104bb5780634352409a146104ce57806345fffac8146104e157600080fd5b80631a64dfad1461046157806321dbb8cb146104745780632eb2c2d614610487578063376792b91461049557600080fd5b806306fdde031161038257806306fdde03146104065780630b328e261461041b5780630e89341c1461043b5780631183a8c01461044e57600080fd5b8062fdd58e146103a85780630109f854146103ce57806301ffc9a7146103e3575b600080fd5b6103bb6103b63660046141ef565b61094a565b6040519081526020015b60405180910390f35b6103e16103dc366004614219565b6109a6565b005b6103f66103f1366004614245565b610af1565b60405190151581526020016103c5565b61040e610b8a565b6040516103c591906142d7565b6103bb6104293660046142fe565b60036020526000908152604090205481565b61040e610449366004614319565b610c18565b6103bb61045c366004614319565b610c23565b6103bb61046f36600461437b565b610c76565b6103e16104823660046143fc565b610cdf565b6103e16103a3366004614464565b6103e16104a336600461451f565b610e41565b6103e16104b636600461451f565b610ec4565b6103f66104c9366004614219565b610f75565b6103f66104dc3660046141ef565b611117565b6103f66104ef366004614319565b61112c565b610507610502366004614319565b611169565b60405163ffffffff90911681526020016103c5565b61052f61052a3660046145a9565b611333565b6040516103c59190614615565b6103f661054a3660046145a9565b611434565b6103f661055d3660046141ef565b6114d4565b61058e610570366004614319565b6000908152600760205260409020600101546001600160a01b031690565b6040516001600160a01b0390911681526020016103c5565b6103e16105b4366004614219565b61166e565b6103bb6105c73660046143fc565b611787565b6103f66105da366004614219565b611814565b6103f66105ed366004614319565b6119e1565b610507610600366004614319565b6000908152600760205260409020547801000000000000000000000000000000000000000000000000900463ffffffff1690565b61040e611a69565b6103e161064a366004614319565b611a76565b6103f661065d36600461471f565b611b49565b6103e1610670366004614319565b611cd2565b6103e161068336600461488a565b611d32565b6103f6610696366004614319565b611e57565b61058e6106a9366004614319565b6000908152600760205260409020546001600160a01b031690565b6105076106d2366004614319565b611e6f565b6105076106e53660046142fe565b611e86565b6103f66106f83660046148b4565b611eb6565b6103e16103a33660046148e0565b6103f66107193660046148b4565b611ef3565b6103f661072c366004614219565b600860209081526000928352604080842090915290825290205460ff1681565b6103e161075a36600461490a565b611f4f565b61077261076d366004614946565b612194565b6040516103c59190614988565b6103f661078d366004614a08565b612215565b6103bb6107a0366004614a55565b61227c565b6103f66107b33660046141ef565b612405565b6103f66107c6366004614b16565b61254c565b6103bb6107d93660046142fe565b60026020526000908152604090205481565b6103e16107f93660046148b4565b6125aa565b6103f661080c366004614319565b612628565b61082461081f366004614319565b612687565b6040516103c599989796959493929190614b39565b6103f66108473660046141ef565b6127f5565b6103e161085a366004614bb5565b61280f565b6103bb61086d3660046143fc565b61290a565b61040e610880366004614319565b612939565b6103f6610893366004614c01565b600160209081526000928352604080842090915290825290205460ff1681565b6103e16103a3366004614c1d565b6103e16108cf366004614bb5565b612cd7565b6103bb6108e2366004614c95565b612dd2565b6105076108f5366004614319565b600090815260076020526040902054600160a01b900463ffffffff1690565b610507610922366004614319565b612e4f565b6005546105079063ffffffff1681565b6103f6610945366004614319565b612eae565b60008181526007602052604081206109628184612edd565b8015610974575061097484828561301f565b1561099f576001600160a01b0384166000908152602081815260408083208684529091529020545b91505b5092915050565b6001600160a01b0381166109e6576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109ef826131d1565b6000828152600760205260409020610a1f8160010154600160a01b90046b40000000000000000000000016151590565b610a55576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610a62838661321a565b915091508115610a7857610a76858261335a565b505b6001830180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0386169081179091556040805187815260208101929092527ff68bc34e5f23b18f8e3a63ff51c021c8fbc9266113a63a4c73a66b4ad9033638910160405180910390a15050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161480610b8457507f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60048054610b9790614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc390614ccc565b8015610c105780601f10610be557610100808354040283529160200191610c10565b820191906000526020600020905b815481529060010190602001808311610bf357829003601f168201915b505050505081565b6060610b84826133d3565b6000818152600760205260408120548190610c63907c0100000000000000000000000000000000000000000000000000000000900461ffff166001614d48565b9050610c6f8382612dd2565b9392505050565b6005805460009160e0918390610c919063ffffffff16614d63565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff16901b9050610ccc818686600160008060008a8a61368e565b610cd686826137de565b95945050505050565b610ce8826131d1565b6000828152600760205260409020610d188160010154600160a01b90046b40000000000000000000000016151590565b610d4e576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805463ffffffff780100000000000000000000000000000000000000000000000090910481169083161015610daf576040517fd2955d3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805463ffffffff838116600160a01b9092041614610e3c5780547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff16600160a01b63ffffffff84169081029190911782556040805185815260208101929092527fb1141d53812d55ffe5a4ca05e686728ebe52d8e4fc66057d6e54724c01a77f5691015b60405180910390a15b505050565b7fffffffff0000000000000000000000000000000000000000000000000000000060e089901b16610e71816131d1565b600e610e7c89612e4f565b63ffffffff161015610ea057610e9b610e96896001612dd2565b6131d1565b610ea9565b610ea98861389a565b610eb989898989898989896138ef565b505050505050505050565b600e610ecf88612e4f565b63ffffffff161015610eee57610ee9610e96886001612dd2565b610ef7565b610ef78761389a565b63ffffffff88166000908152600260205260409020548714610f45576040517fbcb31ea200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff8816600090815260026020526040812055610f6b88888888888888886138ef565b5050505050505050565b6000828152600760205260408082205490516001600160a01b038481166024830152604482018690528392839283928392169060640160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fbd683872000000000000000000000000000000000000000000000000000000001790525161100e9190614da2565b600060405180830381855afa9150503d8060008114611049576040519150601f19603f3d011682016040523d82523d6000602084013e61104e565b606091505b5091509150818015611061575080516040145b156110cc576000808280602001905181019061107d9190614dbe565b915091506002821080156110915750600281105b156110cc57806001146110a55760006110a8565b60015b94508480156110b75750816001145b6110c25760006110c5565b60015b95506110fe565b6040517f8bd78b5a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505061110c87878686613cd9565b979650505050505050565b600080611124848461094a565b119392505050565b600061113782612eae565b8015610b8457506003600061114b84611e6f565b63ffffffff1681526020810191909152604001600020541592915050565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216810361119857506000919050565b79ffffffffffffffffffffffffffffffffffffffffffffffffffff82166000036111c457506001919050565b77ffffffffffffffffffffffffffffffffffffffffffffffff82166000036111ee57506002919050565b75ffffffffffffffffffffffffffffffffffffffffffff821660000361121657506003919050565b6001600160a01b03821660000361122f57506004919050565b71ffffffffffffffffffffffffffffffffffff821660000361125357506005919050565b6fffffffffffffffffffffffffffffffff821660000361127557506006919050565b6dffffffffffffffffffffffffffff821660000361129557506007919050565b6bffffffffffffffffffffffff82166000036112b357506008919050565b69ffffffffffffffffffff82166000036112cf57506009919050565b67ffffffffffffffff82166000036112e95750600a919050565b65ffffffffffff82166000036113015750600b919050565b63ffffffff82166000036113175750600c919050565b61ffff821660000361132b5750600d919050565b50600e919050565b606083821461136e576040517ffc5221bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8367ffffffffffffffff81111561138757611387614659565b6040519080825280602002602001820160405280156113b0578160200160208202803683370190505b50905060005b8481101561142b576114068686838181106113d3576113d3614de2565b90506020020160208101906113e89190614e11565b8585848181106113fa576113fa614de2565b9050602002013561094a565b82828151811061141857611418614de2565b60209081029190910101526001016113b6565b50949350505050565b600083828114611470576040517ffc5221bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156114c7576114be87878381811061149057611490614de2565b905060200201358686848181106114a9576114a9614de2565b90506020020160208101906105da9190614e11565b50600101611473565b5060019695505050505050565b6000818152600760205260408082205490516001600160a01b038581166024830152604482018590528392839291169060640160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fbd683872000000000000000000000000000000000000000000000000000000001790525161156a9190614da2565b600060405180830381855afa9150503d80600081146115a5576040519150601f19603f3d011682016040523d82523d6000602084013e6115aa565b606091505b50915091508180156115bd575080516040145b1561163c57600080828060200190518101906115d99190614dbe565b915091506002821080156115ed5750600281105b1561160b5780600114611601576000611604565b60015b9450611635565b60008681526008602090815260408083206001600160a01b038b16845290915290205460ff161594505b5050611666565b60008481526008602090815260408083206001600160a01b038916845290915290205460ff161592505b505092915050565b6001600160a01b0381166116ae576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116b7826131d1565b60008281526007602052604090206116e78160010154600160a01b90046b40000000000000000000000016151590565b61171d576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811782556040805185815260208101929092527f5f59e4feecec6992840f6f7c313415b21889d4445ea82fefd7f620aeb194461d9101610e33565b6000806003600061179786611e6f565b63ffffffff1663ffffffff168152602001908152602001600020549050806000036117ce576117c6848461290a565b915050610b84565b60006117de61092286600061290a565b90508363ffffffff168163ffffffff161161180a576118018561086d8387614e2c565b92505050610b84565b610cd68285611787565b60008281526007602052604081208054600160a01b900463ffffffff168203611871576040517fae231814000000000000000000000000000000000000000000000000000000008152600481018590526024015b60405180910390fd5b61187b83856127f5565b6118b1576040517ff8eb54de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118bb8185612edd565b6118f1576040517fe629aba300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118fa846131d1565b805463ffffffff600160a01b8204811678010000000000000000000000000000000000000000000000009092041610611962576040517f0cd96ab800000000000000000000000000000000000000000000000000000000815260048101859052602401611868565b6001600160a01b038316600090815260208181526040808320878452909152902054156119cd576040517f643d20830000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101859052604401611868565b6119d783856137de565b5060019392505050565b60006119ec82612eae565b156119f957506001919050565b6000611a0483611169565b9050600080611a14600184614e2c565b63ffffffff1690505b8015611a5e57611a2e81600e614e49565b611a39906010614e5c565b85901c91508161ffff16600003611a5557506000949350505050565b60001901611a1d565b506001949350505050565b60068054610b9790614ccc565b611a7f816131d1565b6000818152600760205260409020611aaf8160010154600160a01b90046b40000000000000000000000016151590565b611ae5576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810180546001600160a01b038116600160a01b918290046bbfffffffffffffffffffffff169091021790556040518281527f10bb2a0010ffb3a037a886128a37f6574be73acb0ee505c37a4f12e8d290ed8e9060200160405180910390a15050565b60008b818b82148015611b5b5750818a145b8015611b675750885182145b8015611b735750875182145b8015611b7e57508186145b8015611b8957508184145b905080611bc2576040517ffc5221bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060005b81811015611cbd57611cb48f8f83818110611be357611be3614de2565b905060200201358e8e84818110611bfc57611bfc614de2565b9050602002810190611c0e9190614e73565b8e8e86818110611c2057611c20614de2565b9050602002016020810190611c3591906142fe565b8d8681518110611c4757611c47614de2565b60200260200101518d8781518110611c6157611c61614de2565b60200260200101518d8d89818110611c7b57611c7b614de2565b9050602002016020810190611c909190614ed8565b8c8c8a818110611ca257611ca2614de2565b90506020028101906107a09190614e73565b50600101611bc6565b5060019e9d5050505050505050505050505050565b3360009081526020818152604080832084845290915290205460011115611d25576040517fae9f0ba500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d2f3382613de8565b50565b7fffffffff0000000000000000000000000000000000000000000000000000000060e083901b16611d62816131d1565b6001600160a01b0382161580611d7f5750611d7d8282611117565b155b15611db6576040517fa60d071800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff83166000818152600360209081526040808320839055600282528083208390558483526007825280832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811682556001820180549091169055815194855291840192909252917fd89812e6ebd66026da23b9c10923f8ec2d47c2f4bea260250e66d05ab76f6b8991015b60405180910390a150505050565b6000818152600760205260408120610b849083612edd565b6000611e7d600e6010614e5c565b9190911c919050565b63ffffffff8116600090815260036020526040812054808203611eaa575090919050565b610c6f6106e582611e6f565b600080611ec284611e86565b90506000611ecf84611e6f565b90506000611edc82611e86565b63ffffffff93841693169290921495945050505050565b600081600003611f0557506001610b84565b6000611f1083611e6f565b90508063ffffffff168463ffffffff1603611f2f576000915050610b84565b63ffffffff8116600090815260036020526040902054610cd68582611ef3565b611f58836131d1565b611f618361112c565b611fc257600083815260076020526040902060010154600160a01b90046b40000000000000000000000016611fc2576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000908152602081815260408083208684529091529020546001111561201e576040517fae9f0ba500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03811660009081526020818152604080832086845290915290205415612089576040517f643d20830000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101849052604401611868565b61209381846127f5565b6120c9576040517ff8eb54de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602052604090206120e19084612edd565b612117576040517fe629aba300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038281166000818152602081815260408083208884528252808320839055938516808352828252848320888452825291849020600190819055845188815291820152909233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4505050565b6060602060005281602052816121aa5760406000f35b60408260051b8085604037818101905b82518601604082018135602083018237600080833583305af46121e1573d6000803e3d6000fd5b8285526020850194503d81523d6000602083013e50503d01603f0167ffffffffffffffe0168183106121ba57604081016000f35b600084815260076020526040812080546001600160a01b03163314612266576040517f8bd78b5a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61227286868686613cd9565b9695505050505050565b600061ffff8a16156122ba576040517f7c9225c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0386166122fa576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03851661233a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123438a6119e1565b612379576040517fb43a065000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123828a610c23565b905061238d816131d1565b61239e818a8a8a8a8a8a8a8a61368e565b60008a81526007602052604090208054601c906123de907c0100000000000000000000000000000000000000000000000000000000900461ffff16614ef3565b91906101000a81548161ffff021916908361ffff1602179055509998505050505050505050565b600080600061241384612eae565b15612481576003600061242586611e6f565b63ffffffff1663ffffffff16815260200190815260200160002054915081600003612454576118018585611117565b61245e8583611117565b1561246e57600192505050610b84565b61247782611169565b9050819350612499565b600161248c85611169565b6124969190614e2c565b90505b63ffffffff8116156124cc576124b3856104dc868461290a565b156124c357600192505050610b84565b60001901612499565b6124db856104dc86600061290a565b156124eb57600192505050610b84565b600360006124f886611e6f565b63ffffffff1663ffffffff1681526020019081526020016000205491508160000361252857600092505050610b84565b6125328583611117565b1561254257600192505050610b84565b610cd68583612405565b600082815260076020526040812060018101546001600160a01b031633146125a0576040517feaca8b6500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61099c848461335a565b7fffffffff0000000000000000000000000000000000000000000000000000000060e083901b166125da816131d1565b63ffffffff8316600081815260026020908152604091829020859055815192835282018490527f81ae7626a9656578e59b92a7575fdbd9cfe59e467c1e88334e305e0b428e76669101610e33565b60008181526007602052604081208180612642838661321a565b915091508161267d576040517feaca8b6500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cd6858261335a565b60606000806000806060600080600080600760008c815260200190815260200160002090508060020180546126bb90614ccc565b80601f01602080910402602001604051908101604052809291908181526020018280546126e790614ccc565b80156127345780601f1061270957610100808354040283529160200191612734565b820191906000526020600020905b81548152906001019060200180831161271757829003601f168201915b505084546001860154949e5063ffffffff600160a01b820481169e5078010000000000000000000000000000000000000000000000008204169c506001600160a01b039081169b5093909316985061279192508d91506129399050565b815460018301549196507c0100000000000000000000000000000000000000000000000000000000900461ffff1694506b400000000000000000000000600160a01b90910416151592506127e5818c612edd565b9150509193959799909294969850565b6000818152600760205260408120610c6f9084908461301f565b611b5881111561284b576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612854836131d1565b600083815260076020526040902061286b8461112c565b6128c7576128918160010154600160a01b90046b40000000000000000000000016151590565b6128c7576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600381016128d6838583614f58565b507f26bb402a5ddddf109a54486ab4d62a69ae00966cbc94c57075787f70bf9cba6c848484604051611e4993929190615044565b60008061291e63ffffffff8416600e614e49565b612929906010614e5c565b600019901b939093169392505050565b6000818152600760205260408120600381018054606093919061295b90614ccc565b80601f016020809104026020016040519081016040528092919081815260200182805461298790614ccc565b80156129d45780601f106129a9576101008083540402835291602001916129d4565b820191906000526020600020905b8154815290600101906020018083116129b757829003601f168201915b505050505090506000815111156129ec579392505050565b60006129f785612e4f565b63ffffffff16905080600003612a9c5760068054612a1490614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612a4090614ccc565b8015612a8d5780601f10612a6257610100808354040283529160200191612a8d565b820191906000526020600020905b815481529060010190602001808311612a7057829003601f168201915b50505050509350505050919050565b600080612aaa600184614e49565b90505b8015612b7e57612abd8782611787565b6000818152600760205260409020600381018054919750919350612ae090614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612b0c90614ccc565b8015612b595780601f10612b2e57610100808354040283529160200191612b59565b820191906000526020600020905b815481529060010190602001808311612b3c57829003601f168201915b50505050509350600084511115612b7557509195945050505050565b60001901612aad565b50612b8a866000611787565b6000818152600760205260409020600381018054919650919250612bad90614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612bd990614ccc565b8015612c265780601f10612bfb57610100808354040283529160200191612c26565b820191906000526020600020905b815481529060010190602001808311612c0957829003601f168201915b50505050509250600083511115612c41575090949350505050565b60068054612c4e90614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612c7a90614ccc565b8015612cc75780601f10612c9c57610100808354040283529160200191612cc7565b820191906000526020600020905b815481529060010190602001808311612caa57829003601f168201915b5050505050945050505050919050565b611b58811115612d13576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d1c836131d1565b6000838152600760205260409020612d338461112c565b612d8f57612d598160010154600160a01b90046b40000000000000000000000016151590565b612d8f576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028101612d9e838583614f58565b507fb8350431af3841b22f977d0e8fd4be94669ef68e2db1d7f02a731d5d09ed44cc848484604051611e4993929190615044565b60008060005b600e811015612e1c57600019602060108302011c9150848216600003612e1457806001600e03036010028461ffff16901b851792505050610b84565b600101612dd8565b506040517f7c9225c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612e5a82611169565b9050600060036000612e6b85611e6f565b63ffffffff16815260208101919091526040016000205490508015612ea857612e9381612e4f565b612e9e83600161505e565b610c6f919061505e565b50919050565b60008082118015610b845750507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b600182015460405160248101839052600091829182916001600160a01b03169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f96208f7a0000000000000000000000000000000000000000000000000000000017905251612f639190614da2565b600060405180830381855afa9150503d8060008114612f9e576040519150601f19603f3d011682016040523d82523d6000602084013e612fa3565b606091505b5091509150818015612fb6575080516020145b15613007576000612fc68261507b565b90506000819003612fda5760009350613001565b80600103612feb5760019350613001565b600180870154600160a01b9004605f1c16151593505b50611666565b600180860154600160a01b9004605f1c161515610cd6565b81546040516001600160a01b03858116602483015260448201849052600092839283929091169060640160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fbd68387200000000000000000000000000000000000000000000000000000000179052516130ac9190614da2565b600060405180830381855afa9150503d80600081146130e7576040519150601f19603f3d011682016040523d82523d6000602084013e6130ec565b606091505b50915091508180156130ff575080516040145b1561319e5760008060008380602001905181019061311d9190614dbe565b915091506002821080156131315750600281105b1561316c5780600114613145576000613148565b60015b92508280156131575750816001145b613162576000613165565b60015b9550613196565b60008781526008602090815260408083206001600160a01b038d16845290915290205460ff161595505b5050506131c8565b60008481526008602090815260408083206001600160a01b038a16845290915290205460ff161592505b50509392505050565b6131db3382612405565b611d2f576040517ff921ec0100000000000000000000000000000000000000000000000000000000815233600482015260248101829052604401611868565b60008060008360405160240161323291815260200190565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f96208f7a00000000000000000000000000000000000000000000000000000000179052600187015490519192506060916001600160a01b03909116906132ae908490614da2565b600060405180830381855afa9150503d80600081146132e9576040519150601f19603f3d011682016040523d82523d6000602084013e6132ee565b606091505b509094509050838015613302575080516020145b1561334c5760008180602001905181019061331d919061509f565b9050806000036133305760009350613346565b806001036133415760019350613346565b600094505b50613351565b600093505b50509250929050565b6000828152600760205260408120600180820154600160a01b9004605f1c16151515158315151461099f5761338f8184613ea4565b6040805185815284151560208201527fd07f9843f67faeb66cef933eec38bef71b53ef4086a2aa2a5b109b6ee531c751910160405180910390a15060019392505050565b60008181526007602052604081206060916133ed8461112c565b156133f9575082613415565b61341284600161340887612e4f565b6105c79190614e2c565b90505b600061342e61342386611e6f565b63ffffffff16613f16565b61343786613f16565b613442876020613f5a565b604051602001613454939291906150b8565b604051602081830303815290604052905060006134718487612edd565b6134b0576040518060400160405280600881526020017f696e6163746976650000000000000000000000000000000000000000000000008152506134e7565b6040518060400160405280600681526020017f61637469766500000000000000000000000000000000000000000000000000008152505b8454613514907801000000000000000000000000000000000000000000000000900463ffffffff16613f16565b855461352c90600160a01b900463ffffffff16613f16565b61353586613f16565b613540876020613f5a565b8854613554906001600160a01b0316614028565b60018a015461356b906001600160a01b0316614028565b61358d8b60010154600160a01b90046b40000000000000000000000016151590565b6135cc576040518060400160405280600581526020017f66616c7365000000000000000000000000000000000000000000000000000000815250613603565b6040518060400160405280600481526020017f74727565000000000000000000000000000000000000000000000000000000008152505b60405160200161361a9897969594939291906151a2565b60405160208183030381529060405290506136648460020161363b88612939565b84846040516020016136509493929190615380565b6040516020818303038152906040526140cb565b6040516020016136749190615573565b604051602081830303815290604052945050505050919050565b6000898152600760205260409020600281016136ab898b83614f58565b5080546001600160a01b038088167fffffffffffffffffffffffff000000000000000000000000000000000000000063ffffffff8b16600160a01b0281167fffffffffffffffff000000000000000000000000000000000000000000000000909416939093171783556001830180549188169190921617905560038101613733838583614f58565b508361374b576b800000000000000000000000613759565b6bc000000000000000000000005b8160010160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f4d38ad12136291322128027bb8c3af7db2261be395032c1d26dd0ad20cf294158a8a8a8a8a8a8a8a8a6040516137ca999897969594939291906155b8565b60405180910390a150505050505050505050565b6001600160a01b038216600081815260208181526040808320858452825280832060019081905560078352818420805463ffffffff780100000000000000000000000000000000000000000000000080830482168501909116027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff90911617905581518681529283015233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291015b60405180910390a45050565b6138a43382612405565b1580156138b857506138b63382611117565b155b15611d2f576040517fbc3a32ff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6138f98888611ef3565b61392f576040517f402128fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff88166000908152600360205260409020548015613a2757600060e06139588b611e86565b63ffffffff16901b905061396c3382611117565b6139e5577fffffffff00000000000000000000000000000000000000000000000000000000808a169083168082148015906139a75750828214155b156139de576040517f899c1ba600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050613a25565b6139ef8a8a611eb6565b613a25576040517f899c1ba600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b507fffffffff0000000000000000000000000000000000000000000000000000000060e089901b1660008181526007602052604090206001600160a01b03881615613ada5780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03891690811782556040805184815260208101929092527f5f59e4feecec6992840f6f7c313415b21889d4445ea82fefd7f620aeb194461d910160405180910390a15b6001600160a01b03871615613b5c576001810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0389169081179091556040805184815260208101929092527ff68bc34e5f23b18f8e3a63ff51c021c8fbc9266113a63a4c73a66b4ad9033638910160405180910390a15b848015613beb57611b58811115613b9f576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028201613bae878983614f58565b507fb8350431af3841b22f977d0e8fd4be94669ef68e2db1d7f02a731d5d09ed44cc838888604051613be293929190615044565b60405180910390a15b50828015613c7b57611b58811115613c2f576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60038201613c3e858783614f58565b507f26bb402a5ddddf109a54486ab4d62a69ae00966cbc94c57075787f70bf9cba6c838686604051613c7293929190615044565b60405180910390a15b63ffffffff8b166000818152600360209081526040918290208d9055815192835282018c90527fd89812e6ebd66026da23b9c10923f8ec2d47c2f4bea260250e66d05ab76f6b89910160405180910390a15050505050505050505050565b6001600160a01b03831660009081526020818152604080832087845290915281205415613d1a57821580613d0b575081155b15613d1a57613d1a8486613de8565b60008581526008602090815260408083206001600160a01b038816845290915290205460ff16151582151503613de0575060008481526008602090815260408083206001600160a01b03871680855290835292819020805485157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116811790915581518881529283019390935291158183015290516001917ff95db9732f1ede51ad19afa6ee380168a1be58df547533ff009c18ceacd01ef5919081900360600190a15b949350505050565b6001600160a01b03821660008181526020818152604080832085845282528083208390556007825280832080547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff811678010000000000000000000000000000000000000000000000009182900463ffffffff9081166000190116909102179055805185815260019281019290925291929133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910161388e565b8015613ee7575060010180546001600160a01b0381166b800000000000000000000000600160a01b928390046bffffffffffffffffffffffff1617909102179055565b5060010180546001600160a01b038116600160a01b918290046b7fffffffffffffffffffffff16909102179055565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480613f305750819003601f19909101908152919050565b60408051601f196062600185901b01811690910191829052600091019081526f30313233343536373839616263646566600f5280835b600f8116517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8401936000190153600f8160041c165183536000199093019260081c83613f90578015613feb57632194895a6000526004601cfd5b50613078601f198301528190036002017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffde90910190815292915050565b60408051606001908190526f30313233343536373839616263646566600f526014825b600f8116517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8401936000190153600f8160041c165183536000199091019060081c8161404b575050613078601f19820152602a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffde909101908152919050565b6060610b84826000806060835180156141cb576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526102308515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f03603f52602083018181015b6003880197508751603f8160121c16518353603f81600c1c16516001840153603f8160061c16516002840153603f81165160038401535060048201915080821061414457600384068680156141a4576001821482151501850387526141bc565b603d821515850353603d6001831460011b8503538487525b5050601f01601f191660405250505b509392505050565b80356001600160a01b03811681146141ea57600080fd5b919050565b6000806040838503121561420257600080fd5b61420b836141d3565b946020939093013593505050565b6000806040838503121561422c57600080fd5b8235915061423c602084016141d3565b90509250929050565b60006020828403121561425757600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6f57600080fd5b60005b838110156142a257818101518382015260200161428a565b50506000910152565b600081518084526142c3816020860160208601614287565b601f01601f19169290920160200192915050565b602081526000610c6f60208301846142ab565b803563ffffffff811681146141ea57600080fd5b60006020828403121561431057600080fd5b610c6f826142ea565b60006020828403121561432b57600080fd5b5035919050565b60008083601f84011261434457600080fd5b50813567ffffffffffffffff81111561435c57600080fd5b60208301915083602082850101111561437457600080fd5b9250929050565b60008060008060006060868803121561439357600080fd5b61439c866141d3565b9450602086013567ffffffffffffffff808211156143b957600080fd5b6143c589838a01614332565b909650945060408801359150808211156143de57600080fd5b506143eb88828901614332565b969995985093965092949392505050565b6000806040838503121561440f57600080fd5b8235915061423c602084016142ea565b60008083601f84011261443157600080fd5b50813567ffffffffffffffff81111561444957600080fd5b6020830191508360208260051b850101111561437457600080fd5b60008060008060008060008060a0898b03121561448057600080fd5b614489896141d3565b975061449760208a016141d3565b9650604089013567ffffffffffffffff808211156144b457600080fd5b6144c08c838d0161441f565b909850965060608b01359150808211156144d957600080fd5b6144e58c838d0161441f565b909650945060808b01359150808211156144fe57600080fd5b5061450b8b828c01614332565b999c989b5096995094979396929594505050565b60008060008060008060008060c0898b03121561453b57600080fd5b614544896142ea565b97506020890135965061455960408a016141d3565b955061456760608a016141d3565b9450608089013567ffffffffffffffff8082111561458457600080fd5b6145908c838d01614332565b909650945060a08b01359150808211156144fe57600080fd5b600080600080604085870312156145bf57600080fd5b843567ffffffffffffffff808211156145d757600080fd5b6145e38883890161441f565b909650945060208701359150808211156145fc57600080fd5b506146098782880161441f565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b8181101561464d57835183529284019291840191600101614631565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261469957600080fd5b8135602067ffffffffffffffff808311156146b6576146b6614659565b8260051b604051601f19603f830116810181811084821117156146db576146db614659565b6040529384528581018301938381019250878511156146f957600080fd5b83870191505b8482101561110c57614710826141d3565b835291830191908301906146ff565b60008060008060008060008060008060008060e08d8f03121561474157600080fd5b67ffffffffffffffff8d35111561475757600080fd5b6147648e8e358f0161441f565b909c509a5067ffffffffffffffff60208e0135111561478257600080fd5b6147928e60208f01358f0161441f565b909a50985067ffffffffffffffff60408e013511156147b057600080fd5b6147c08e60408f01358f0161441f565b909850965067ffffffffffffffff60608e013511156147de57600080fd5b6147ee8e60608f01358f01614688565b955067ffffffffffffffff60808e0135111561480957600080fd5b6148198e60808f01358f01614688565b945067ffffffffffffffff60a08e0135111561483457600080fd5b6148448e60a08f01358f0161441f565b909450925067ffffffffffffffff60c08e0135111561486257600080fd5b6148728e60c08f01358f0161441f565b81935080925050509295989b509295989b509295989b565b6000806040838503121561489d57600080fd5b6148a6836142ea565b915061423c602084016141d3565b600080604083850312156148c757600080fd5b61420b836142ea565b803580151581146141ea57600080fd5b600080604083850312156148f357600080fd5b6148fc836141d3565b915061423c602084016148d0565b60008060006060848603121561491f57600080fd5b8335925061492f602085016141d3565b915061493d604085016141d3565b90509250925092565b6000806020838503121561495957600080fd5b823567ffffffffffffffff81111561497057600080fd5b61497c8582860161441f565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156149fb577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526149e98583516142ab565b945092850192908501906001016149af565b5092979650505050505050565b60008060008060808587031215614a1e57600080fd5b84359350614a2e602086016141d3565b9250614a3c604086016148d0565b9150614a4a606086016148d0565b905092959194509250565b600080600080600080600080600060e08a8c031215614a7357600080fd5b8935985060208a013567ffffffffffffffff80821115614a9257600080fd5b614a9e8d838e01614332565b909a509850889150614ab260408d016142ea565b9750614ac060608d016141d3565b9650614ace60808d016141d3565b9550614adc60a08d016148d0565b945060c08c0135915080821115614af257600080fd5b50614aff8c828d01614332565b915080935050809150509295985092959850929598565b60008060408385031215614b2957600080fd5b8235915061423c602084016148d0565b6000610120808352614b4d8184018d6142ab565b63ffffffff8c811660208601528b1660408501526001600160a01b038a811660608601528916608085015283810360a08501529050614b8c81886142ab565b61ffff9690961660c0840152505091151560e08301521515610100909101529695505050505050565b600080600060408486031215614bca57600080fd5b83359250602084013567ffffffffffffffff811115614be857600080fd5b614bf486828701614332565b9497909650939450505050565b60008060408385031215614c1457600080fd5b6148a6836141d3565b60008060008060008060a08789031215614c3657600080fd5b614c3f876141d3565b9550614c4d602088016141d3565b94506040870135935060608701359250608087013567ffffffffffffffff811115614c7757600080fd5b614c8389828a01614332565b979a9699509497509295939492505050565b60008060408385031215614ca857600080fd5b82359150602083013561ffff81168114614cc157600080fd5b809150509250929050565b600181811c90821680614ce057607f821691505b602082108103612ea8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61ffff81811683821601908082111561099f5761099f614d19565b600063ffffffff808316818103614d7c57614d7c614d19565b6001019392505050565b60008151614d98818560208601614287565b9290920192915050565b60008251614db4818460208701614287565b9190910192915050565b60008060408385031215614dd157600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215614e2357600080fd5b610c6f826141d3565b63ffffffff82811682821603908082111561099f5761099f614d19565b81810381811115610b8457610b84614d19565b8082028115828204841417610b8457610b84614d19565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614ea857600080fd5b83018035915067ffffffffffffffff821115614ec357600080fd5b60200191503681900382131561437457600080fd5b600060208284031215614eea57600080fd5b610c6f826148d0565b600061ffff808316818103614d7c57614d7c614d19565b601f821115610e3c57600081815260208120601f850160051c81016020861015614f315750805b601f850160051c820191505b81811015614f5057828155600101614f3d565b505050505050565b67ffffffffffffffff831115614f7057614f70614659565b614f8483614f7e8354614ccc565b83614f0a565b6000601f841160018114614fb85760008515614fa05750838201355b600019600387901b1c1916600186901b178355615012565b600083815260209020601f19861690835b82811015614fe95786850135825560209485019460019092019101614fc9565b50868210156150065760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b838152604060208201526000610cd6604083018486615019565b63ffffffff81811683821601908082111561099f5761099f614d19565b80516020808301519190811015612ea85760001960209190910360031b1b16919050565b6000602082840312156150b157600080fd5b5051919050565b7f22646f6d61696e223a20220000000000000000000000000000000000000000008152600084516150f081600b850160208901614287565b7f222c20226964223a202200000000000000000000000000000000000000000000600b91840191820152845161512d816015840160208901614287565b7f222c2022707265747479206964223a202200000000000000000000000000000060159290910191820152835161516b816026840160208801614287565b7f222c0000000000000000000000000000000000000000000000000000000000006026929091019182015260280195945050505050565b7f22737461747573223a20220000000000000000000000000000000000000000008152600089516151da81600b850160208e01614287565b7f222c202263757272656e7420737570706c79223a202200000000000000000000600b918401918201528951615217816021840160208e01614287565b01615244602182017f222c2022737570706c7920636170223a202200000000000000000000000000009052565b615251603382018a614d86565b7f222c202261646d696e2028696429223a20220000000000000000000000000000815290506152836012820189614d86565b7f222c202261646d696e202870726574747920696429223a202200000000000000815290506152b56019820188614d86565b7f222c2022656c69676962696c697479206d6f64756c65223a2022000000000000815290506152e7601a820187614d86565b7f222c2022746f67676c65206d6f64756c65223a20220000000000000000000000815290506153196015820186614d86565b7f222c20226d757461626c65223a202200000000000000000000000000000000008152905061534b600f820185614d86565b7f220000000000000000000000000000000000000000000000000000000000000081526001019b9a5050505050505050505050565b7f7b226e616d65223a20220000000000000000000000000000000000000000000081527f4861740000000000000000000000000000000000000000000000000000000000600a8201527f222c20226465736372697074696f6e223a202200000000000000000000000000600d820152600060206000875461540081614ccc565b60018281168015615418576001811461544f5761547f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00841686890152858315158402890101945061547f565b8b6000528560002060005b848110156154755781548a820189015290830190870161545a565b5050858389010194505b507f222c2022696d616765223a20220000000000000000000000000000000000000084526154b0600d85018b614d86565b7f222c000000000000000000000000000000000000000000000000000000000000815294507f2270726f70657274696573223a2000000000000000000000000000000000000060028601527f7b000000000000000000000000000000000000000000000000000000000000006010860152615537615531601187018b614d86565b89614d86565b7f7d00000000000000000000000000000000000000000000000000000000000000808252918101919091526002019a9950505050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516155ab81601d850160208701614287565b91909101601d0192915050565b89815260e0602082015260006155d260e083018a8c615019565b63ffffffff891660408401526001600160a01b0388811660608501528716608084015285151560a084015282810360c0840152615610818587615019565b9c9b50505050505050505050505056fea26469706673582212203620611cb556a5437bbe468fe951b4a09dced80631c01465ad1b2a933f77eb6e64736f6c63430008110033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010486174732050726f746f636f6c207631000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b726569666c657a706b336b6a7a367a737632337062766f777461746e6435686d71666b64726f333378356d6832617a6c686e6533616834000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103a35760003560e01c806382afd23b116101e9578063d0221ee01161010f578063e985e9c5116100ad578063fb2849171161007c578063fb284917146108e7578063fb2aaa4c14610914578063fc3e05a414610927578063fd8a71631461093757600080fd5b8063e985e9c514610885578063f242432a146108b3578063f737401e146108c1578063f8f353b6146108d457600080fd5b8063d80a8434116100e9578063d80a843414610839578063d9fd995b1461084c578063e05209ff1461085f578063e33dd5c91461087257600080fd5b8063d0221ee0146107eb578063d3272ba8146107fe578063d395acf81461081157600080fd5b8063a2be079b11610187578063b052925e11610156578063b052925e14610792578063b56f7562146107a5578063c43dc177146107b8578063cead6304146107cb57600080fd5b8063a2be079b1461071e578063a4a1f06c1461074c578063ac9650d81461075f578063afaae55a1461077f57600080fd5b80639d6ccb9f116101c35780639d6ccb9f146106d75780639fe3b510146106ea578063a22cb465146106fd578063a29e8fa61461070b57600080fd5b806382afd23b146106885780638c0760771461069b5780639aa22f6d146106c457600080fd5b8063499c05e8116102ce578063641f776e1161026c578063756329a41161023b578063756329a41461063c5780637903e56b1461064f5780637a9df89f1461066257806380198fad1461067557600080fd5b8063641f776e146105cc5780636743175a146105df5780637178fb51146105f257806374f82e301461063457600080fd5b806354a1826c116102a857806354a1826c1461054f57806357f607721461056257806359701e44146105a65780635d5eb5af146105b957600080fd5b8063499c05e8146104f45780634e1273f41461051c57806352a6b2651461053c57600080fd5b80631a64dfad11610346578063378a848911610315578063378a8489146104a85780633fa9d544146104bb5780634352409a146104ce57806345fffac8146104e157600080fd5b80631a64dfad1461046157806321dbb8cb146104745780632eb2c2d614610487578063376792b91461049557600080fd5b806306fdde031161038257806306fdde03146104065780630b328e261461041b5780630e89341c1461043b5780631183a8c01461044e57600080fd5b8062fdd58e146103a85780630109f854146103ce57806301ffc9a7146103e3575b600080fd5b6103bb6103b63660046141ef565b61094a565b6040519081526020015b60405180910390f35b6103e16103dc366004614219565b6109a6565b005b6103f66103f1366004614245565b610af1565b60405190151581526020016103c5565b61040e610b8a565b6040516103c591906142d7565b6103bb6104293660046142fe565b60036020526000908152604090205481565b61040e610449366004614319565b610c18565b6103bb61045c366004614319565b610c23565b6103bb61046f36600461437b565b610c76565b6103e16104823660046143fc565b610cdf565b6103e16103a3366004614464565b6103e16104a336600461451f565b610e41565b6103e16104b636600461451f565b610ec4565b6103f66104c9366004614219565b610f75565b6103f66104dc3660046141ef565b611117565b6103f66104ef366004614319565b61112c565b610507610502366004614319565b611169565b60405163ffffffff90911681526020016103c5565b61052f61052a3660046145a9565b611333565b6040516103c59190614615565b6103f661054a3660046145a9565b611434565b6103f661055d3660046141ef565b6114d4565b61058e610570366004614319565b6000908152600760205260409020600101546001600160a01b031690565b6040516001600160a01b0390911681526020016103c5565b6103e16105b4366004614219565b61166e565b6103bb6105c73660046143fc565b611787565b6103f66105da366004614219565b611814565b6103f66105ed366004614319565b6119e1565b610507610600366004614319565b6000908152600760205260409020547801000000000000000000000000000000000000000000000000900463ffffffff1690565b61040e611a69565b6103e161064a366004614319565b611a76565b6103f661065d36600461471f565b611b49565b6103e1610670366004614319565b611cd2565b6103e161068336600461488a565b611d32565b6103f6610696366004614319565b611e57565b61058e6106a9366004614319565b6000908152600760205260409020546001600160a01b031690565b6105076106d2366004614319565b611e6f565b6105076106e53660046142fe565b611e86565b6103f66106f83660046148b4565b611eb6565b6103e16103a33660046148e0565b6103f66107193660046148b4565b611ef3565b6103f661072c366004614219565b600860209081526000928352604080842090915290825290205460ff1681565b6103e161075a36600461490a565b611f4f565b61077261076d366004614946565b612194565b6040516103c59190614988565b6103f661078d366004614a08565b612215565b6103bb6107a0366004614a55565b61227c565b6103f66107b33660046141ef565b612405565b6103f66107c6366004614b16565b61254c565b6103bb6107d93660046142fe565b60026020526000908152604090205481565b6103e16107f93660046148b4565b6125aa565b6103f661080c366004614319565b612628565b61082461081f366004614319565b612687565b6040516103c599989796959493929190614b39565b6103f66108473660046141ef565b6127f5565b6103e161085a366004614bb5565b61280f565b6103bb61086d3660046143fc565b61290a565b61040e610880366004614319565b612939565b6103f6610893366004614c01565b600160209081526000928352604080842090915290825290205460ff1681565b6103e16103a3366004614c1d565b6103e16108cf366004614bb5565b612cd7565b6103bb6108e2366004614c95565b612dd2565b6105076108f5366004614319565b600090815260076020526040902054600160a01b900463ffffffff1690565b610507610922366004614319565b612e4f565b6005546105079063ffffffff1681565b6103f6610945366004614319565b612eae565b60008181526007602052604081206109628184612edd565b8015610974575061097484828561301f565b1561099f576001600160a01b0384166000908152602081815260408083208684529091529020545b91505b5092915050565b6001600160a01b0381166109e6576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109ef826131d1565b6000828152600760205260409020610a1f8160010154600160a01b90046b40000000000000000000000016151590565b610a55576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610a62838661321a565b915091508115610a7857610a76858261335a565b505b6001830180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0386169081179091556040805187815260208101929092527ff68bc34e5f23b18f8e3a63ff51c021c8fbc9266113a63a4c73a66b4ad9033638910160405180910390a15050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161480610b8457507f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60048054610b9790614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc390614ccc565b8015610c105780601f10610be557610100808354040283529160200191610c10565b820191906000526020600020905b815481529060010190602001808311610bf357829003601f168201915b505050505081565b6060610b84826133d3565b6000818152600760205260408120548190610c63907c0100000000000000000000000000000000000000000000000000000000900461ffff166001614d48565b9050610c6f8382612dd2565b9392505050565b6005805460009160e0918390610c919063ffffffff16614d63565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff16901b9050610ccc818686600160008060008a8a61368e565b610cd686826137de565b95945050505050565b610ce8826131d1565b6000828152600760205260409020610d188160010154600160a01b90046b40000000000000000000000016151590565b610d4e576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805463ffffffff780100000000000000000000000000000000000000000000000090910481169083161015610daf576040517fd2955d3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805463ffffffff838116600160a01b9092041614610e3c5780547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff16600160a01b63ffffffff84169081029190911782556040805185815260208101929092527fb1141d53812d55ffe5a4ca05e686728ebe52d8e4fc66057d6e54724c01a77f5691015b60405180910390a15b505050565b7fffffffff0000000000000000000000000000000000000000000000000000000060e089901b16610e71816131d1565b600e610e7c89612e4f565b63ffffffff161015610ea057610e9b610e96896001612dd2565b6131d1565b610ea9565b610ea98861389a565b610eb989898989898989896138ef565b505050505050505050565b600e610ecf88612e4f565b63ffffffff161015610eee57610ee9610e96886001612dd2565b610ef7565b610ef78761389a565b63ffffffff88166000908152600260205260409020548714610f45576040517fbcb31ea200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff8816600090815260026020526040812055610f6b88888888888888886138ef565b5050505050505050565b6000828152600760205260408082205490516001600160a01b038481166024830152604482018690528392839283928392169060640160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fbd683872000000000000000000000000000000000000000000000000000000001790525161100e9190614da2565b600060405180830381855afa9150503d8060008114611049576040519150601f19603f3d011682016040523d82523d6000602084013e61104e565b606091505b5091509150818015611061575080516040145b156110cc576000808280602001905181019061107d9190614dbe565b915091506002821080156110915750600281105b156110cc57806001146110a55760006110a8565b60015b94508480156110b75750816001145b6110c25760006110c5565b60015b95506110fe565b6040517f8bd78b5a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505061110c87878686613cd9565b979650505050505050565b600080611124848461094a565b119392505050565b600061113782612eae565b8015610b8457506003600061114b84611e6f565b63ffffffff1681526020810191909152604001600020541592915050565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216810361119857506000919050565b79ffffffffffffffffffffffffffffffffffffffffffffffffffff82166000036111c457506001919050565b77ffffffffffffffffffffffffffffffffffffffffffffffff82166000036111ee57506002919050565b75ffffffffffffffffffffffffffffffffffffffffffff821660000361121657506003919050565b6001600160a01b03821660000361122f57506004919050565b71ffffffffffffffffffffffffffffffffffff821660000361125357506005919050565b6fffffffffffffffffffffffffffffffff821660000361127557506006919050565b6dffffffffffffffffffffffffffff821660000361129557506007919050565b6bffffffffffffffffffffffff82166000036112b357506008919050565b69ffffffffffffffffffff82166000036112cf57506009919050565b67ffffffffffffffff82166000036112e95750600a919050565b65ffffffffffff82166000036113015750600b919050565b63ffffffff82166000036113175750600c919050565b61ffff821660000361132b5750600d919050565b50600e919050565b606083821461136e576040517ffc5221bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8367ffffffffffffffff81111561138757611387614659565b6040519080825280602002602001820160405280156113b0578160200160208202803683370190505b50905060005b8481101561142b576114068686838181106113d3576113d3614de2565b90506020020160208101906113e89190614e11565b8585848181106113fa576113fa614de2565b9050602002013561094a565b82828151811061141857611418614de2565b60209081029190910101526001016113b6565b50949350505050565b600083828114611470576040517ffc5221bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156114c7576114be87878381811061149057611490614de2565b905060200201358686848181106114a9576114a9614de2565b90506020020160208101906105da9190614e11565b50600101611473565b5060019695505050505050565b6000818152600760205260408082205490516001600160a01b038581166024830152604482018590528392839291169060640160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fbd683872000000000000000000000000000000000000000000000000000000001790525161156a9190614da2565b600060405180830381855afa9150503d80600081146115a5576040519150601f19603f3d011682016040523d82523d6000602084013e6115aa565b606091505b50915091508180156115bd575080516040145b1561163c57600080828060200190518101906115d99190614dbe565b915091506002821080156115ed5750600281105b1561160b5780600114611601576000611604565b60015b9450611635565b60008681526008602090815260408083206001600160a01b038b16845290915290205460ff161594505b5050611666565b60008481526008602090815260408083206001600160a01b038916845290915290205460ff161592505b505092915050565b6001600160a01b0381166116ae576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116b7826131d1565b60008281526007602052604090206116e78160010154600160a01b90046b40000000000000000000000016151590565b61171d576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811782556040805185815260208101929092527f5f59e4feecec6992840f6f7c313415b21889d4445ea82fefd7f620aeb194461d9101610e33565b6000806003600061179786611e6f565b63ffffffff1663ffffffff168152602001908152602001600020549050806000036117ce576117c6848461290a565b915050610b84565b60006117de61092286600061290a565b90508363ffffffff168163ffffffff161161180a576118018561086d8387614e2c565b92505050610b84565b610cd68285611787565b60008281526007602052604081208054600160a01b900463ffffffff168203611871576040517fae231814000000000000000000000000000000000000000000000000000000008152600481018590526024015b60405180910390fd5b61187b83856127f5565b6118b1576040517ff8eb54de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118bb8185612edd565b6118f1576040517fe629aba300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118fa846131d1565b805463ffffffff600160a01b8204811678010000000000000000000000000000000000000000000000009092041610611962576040517f0cd96ab800000000000000000000000000000000000000000000000000000000815260048101859052602401611868565b6001600160a01b038316600090815260208181526040808320878452909152902054156119cd576040517f643d20830000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101859052604401611868565b6119d783856137de565b5060019392505050565b60006119ec82612eae565b156119f957506001919050565b6000611a0483611169565b9050600080611a14600184614e2c565b63ffffffff1690505b8015611a5e57611a2e81600e614e49565b611a39906010614e5c565b85901c91508161ffff16600003611a5557506000949350505050565b60001901611a1d565b506001949350505050565b60068054610b9790614ccc565b611a7f816131d1565b6000818152600760205260409020611aaf8160010154600160a01b90046b40000000000000000000000016151590565b611ae5576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810180546001600160a01b038116600160a01b918290046bbfffffffffffffffffffffff169091021790556040518281527f10bb2a0010ffb3a037a886128a37f6574be73acb0ee505c37a4f12e8d290ed8e9060200160405180910390a15050565b60008b818b82148015611b5b5750818a145b8015611b675750885182145b8015611b735750875182145b8015611b7e57508186145b8015611b8957508184145b905080611bc2576040517ffc5221bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060005b81811015611cbd57611cb48f8f83818110611be357611be3614de2565b905060200201358e8e84818110611bfc57611bfc614de2565b9050602002810190611c0e9190614e73565b8e8e86818110611c2057611c20614de2565b9050602002016020810190611c3591906142fe565b8d8681518110611c4757611c47614de2565b60200260200101518d8781518110611c6157611c61614de2565b60200260200101518d8d89818110611c7b57611c7b614de2565b9050602002016020810190611c909190614ed8565b8c8c8a818110611ca257611ca2614de2565b90506020028101906107a09190614e73565b50600101611bc6565b5060019e9d5050505050505050505050505050565b3360009081526020818152604080832084845290915290205460011115611d25576040517fae9f0ba500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d2f3382613de8565b50565b7fffffffff0000000000000000000000000000000000000000000000000000000060e083901b16611d62816131d1565b6001600160a01b0382161580611d7f5750611d7d8282611117565b155b15611db6576040517fa60d071800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff83166000818152600360209081526040808320839055600282528083208390558483526007825280832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811682556001820180549091169055815194855291840192909252917fd89812e6ebd66026da23b9c10923f8ec2d47c2f4bea260250e66d05ab76f6b8991015b60405180910390a150505050565b6000818152600760205260408120610b849083612edd565b6000611e7d600e6010614e5c565b9190911c919050565b63ffffffff8116600090815260036020526040812054808203611eaa575090919050565b610c6f6106e582611e6f565b600080611ec284611e86565b90506000611ecf84611e6f565b90506000611edc82611e86565b63ffffffff93841693169290921495945050505050565b600081600003611f0557506001610b84565b6000611f1083611e6f565b90508063ffffffff168463ffffffff1603611f2f576000915050610b84565b63ffffffff8116600090815260036020526040902054610cd68582611ef3565b611f58836131d1565b611f618361112c565b611fc257600083815260076020526040902060010154600160a01b90046b40000000000000000000000016611fc2576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000908152602081815260408083208684529091529020546001111561201e576040517fae9f0ba500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03811660009081526020818152604080832086845290915290205415612089576040517f643d20830000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101849052604401611868565b61209381846127f5565b6120c9576040517ff8eb54de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602052604090206120e19084612edd565b612117576040517fe629aba300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038281166000818152602081815260408083208884528252808320839055938516808352828252848320888452825291849020600190819055845188815291820152909233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4505050565b6060602060005281602052816121aa5760406000f35b60408260051b8085604037818101905b82518601604082018135602083018237600080833583305af46121e1573d6000803e3d6000fd5b8285526020850194503d81523d6000602083013e50503d01603f0167ffffffffffffffe0168183106121ba57604081016000f35b600084815260076020526040812080546001600160a01b03163314612266576040517f8bd78b5a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61227286868686613cd9565b9695505050505050565b600061ffff8a16156122ba576040517f7c9225c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0386166122fa576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03851661233a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123438a6119e1565b612379576040517fb43a065000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123828a610c23565b905061238d816131d1565b61239e818a8a8a8a8a8a8a8a61368e565b60008a81526007602052604090208054601c906123de907c0100000000000000000000000000000000000000000000000000000000900461ffff16614ef3565b91906101000a81548161ffff021916908361ffff1602179055509998505050505050505050565b600080600061241384612eae565b15612481576003600061242586611e6f565b63ffffffff1663ffffffff16815260200190815260200160002054915081600003612454576118018585611117565b61245e8583611117565b1561246e57600192505050610b84565b61247782611169565b9050819350612499565b600161248c85611169565b6124969190614e2c565b90505b63ffffffff8116156124cc576124b3856104dc868461290a565b156124c357600192505050610b84565b60001901612499565b6124db856104dc86600061290a565b156124eb57600192505050610b84565b600360006124f886611e6f565b63ffffffff1663ffffffff1681526020019081526020016000205491508160000361252857600092505050610b84565b6125328583611117565b1561254257600192505050610b84565b610cd68583612405565b600082815260076020526040812060018101546001600160a01b031633146125a0576040517feaca8b6500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61099c848461335a565b7fffffffff0000000000000000000000000000000000000000000000000000000060e083901b166125da816131d1565b63ffffffff8316600081815260026020908152604091829020859055815192835282018490527f81ae7626a9656578e59b92a7575fdbd9cfe59e467c1e88334e305e0b428e76669101610e33565b60008181526007602052604081208180612642838661321a565b915091508161267d576040517feaca8b6500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cd6858261335a565b60606000806000806060600080600080600760008c815260200190815260200160002090508060020180546126bb90614ccc565b80601f01602080910402602001604051908101604052809291908181526020018280546126e790614ccc565b80156127345780601f1061270957610100808354040283529160200191612734565b820191906000526020600020905b81548152906001019060200180831161271757829003601f168201915b505084546001860154949e5063ffffffff600160a01b820481169e5078010000000000000000000000000000000000000000000000008204169c506001600160a01b039081169b5093909316985061279192508d91506129399050565b815460018301549196507c0100000000000000000000000000000000000000000000000000000000900461ffff1694506b400000000000000000000000600160a01b90910416151592506127e5818c612edd565b9150509193959799909294969850565b6000818152600760205260408120610c6f9084908461301f565b611b5881111561284b576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612854836131d1565b600083815260076020526040902061286b8461112c565b6128c7576128918160010154600160a01b90046b40000000000000000000000016151590565b6128c7576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600381016128d6838583614f58565b507f26bb402a5ddddf109a54486ab4d62a69ae00966cbc94c57075787f70bf9cba6c848484604051611e4993929190615044565b60008061291e63ffffffff8416600e614e49565b612929906010614e5c565b600019901b939093169392505050565b6000818152600760205260408120600381018054606093919061295b90614ccc565b80601f016020809104026020016040519081016040528092919081815260200182805461298790614ccc565b80156129d45780601f106129a9576101008083540402835291602001916129d4565b820191906000526020600020905b8154815290600101906020018083116129b757829003601f168201915b505050505090506000815111156129ec579392505050565b60006129f785612e4f565b63ffffffff16905080600003612a9c5760068054612a1490614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612a4090614ccc565b8015612a8d5780601f10612a6257610100808354040283529160200191612a8d565b820191906000526020600020905b815481529060010190602001808311612a7057829003601f168201915b50505050509350505050919050565b600080612aaa600184614e49565b90505b8015612b7e57612abd8782611787565b6000818152600760205260409020600381018054919750919350612ae090614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612b0c90614ccc565b8015612b595780601f10612b2e57610100808354040283529160200191612b59565b820191906000526020600020905b815481529060010190602001808311612b3c57829003601f168201915b50505050509350600084511115612b7557509195945050505050565b60001901612aad565b50612b8a866000611787565b6000818152600760205260409020600381018054919650919250612bad90614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612bd990614ccc565b8015612c265780601f10612bfb57610100808354040283529160200191612c26565b820191906000526020600020905b815481529060010190602001808311612c0957829003601f168201915b50505050509250600083511115612c41575090949350505050565b60068054612c4e90614ccc565b80601f0160208091040260200160405190810160405280929190818152602001828054612c7a90614ccc565b8015612cc75780601f10612c9c57610100808354040283529160200191612cc7565b820191906000526020600020905b815481529060010190602001808311612caa57829003601f168201915b5050505050945050505050919050565b611b58811115612d13576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d1c836131d1565b6000838152600760205260409020612d338461112c565b612d8f57612d598160010154600160a01b90046b40000000000000000000000016151590565b612d8f576040517fbb7790e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028101612d9e838583614f58565b507fb8350431af3841b22f977d0e8fd4be94669ef68e2db1d7f02a731d5d09ed44cc848484604051611e4993929190615044565b60008060005b600e811015612e1c57600019602060108302011c9150848216600003612e1457806001600e03036010028461ffff16901b851792505050610b84565b600101612dd8565b506040517f7c9225c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612e5a82611169565b9050600060036000612e6b85611e6f565b63ffffffff16815260208101919091526040016000205490508015612ea857612e9381612e4f565b612e9e83600161505e565b610c6f919061505e565b50919050565b60008082118015610b845750507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b600182015460405160248101839052600091829182916001600160a01b03169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f96208f7a0000000000000000000000000000000000000000000000000000000017905251612f639190614da2565b600060405180830381855afa9150503d8060008114612f9e576040519150601f19603f3d011682016040523d82523d6000602084013e612fa3565b606091505b5091509150818015612fb6575080516020145b15613007576000612fc68261507b565b90506000819003612fda5760009350613001565b80600103612feb5760019350613001565b600180870154600160a01b9004605f1c16151593505b50611666565b600180860154600160a01b9004605f1c161515610cd6565b81546040516001600160a01b03858116602483015260448201849052600092839283929091169060640160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fbd68387200000000000000000000000000000000000000000000000000000000179052516130ac9190614da2565b600060405180830381855afa9150503d80600081146130e7576040519150601f19603f3d011682016040523d82523d6000602084013e6130ec565b606091505b50915091508180156130ff575080516040145b1561319e5760008060008380602001905181019061311d9190614dbe565b915091506002821080156131315750600281105b1561316c5780600114613145576000613148565b60015b92508280156131575750816001145b613162576000613165565b60015b9550613196565b60008781526008602090815260408083206001600160a01b038d16845290915290205460ff161595505b5050506131c8565b60008481526008602090815260408083206001600160a01b038a16845290915290205460ff161592505b50509392505050565b6131db3382612405565b611d2f576040517ff921ec0100000000000000000000000000000000000000000000000000000000815233600482015260248101829052604401611868565b60008060008360405160240161323291815260200190565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f96208f7a00000000000000000000000000000000000000000000000000000000179052600187015490519192506060916001600160a01b03909116906132ae908490614da2565b600060405180830381855afa9150503d80600081146132e9576040519150601f19603f3d011682016040523d82523d6000602084013e6132ee565b606091505b509094509050838015613302575080516020145b1561334c5760008180602001905181019061331d919061509f565b9050806000036133305760009350613346565b806001036133415760019350613346565b600094505b50613351565b600093505b50509250929050565b6000828152600760205260408120600180820154600160a01b9004605f1c16151515158315151461099f5761338f8184613ea4565b6040805185815284151560208201527fd07f9843f67faeb66cef933eec38bef71b53ef4086a2aa2a5b109b6ee531c751910160405180910390a15060019392505050565b60008181526007602052604081206060916133ed8461112c565b156133f9575082613415565b61341284600161340887612e4f565b6105c79190614e2c565b90505b600061342e61342386611e6f565b63ffffffff16613f16565b61343786613f16565b613442876020613f5a565b604051602001613454939291906150b8565b604051602081830303815290604052905060006134718487612edd565b6134b0576040518060400160405280600881526020017f696e6163746976650000000000000000000000000000000000000000000000008152506134e7565b6040518060400160405280600681526020017f61637469766500000000000000000000000000000000000000000000000000008152505b8454613514907801000000000000000000000000000000000000000000000000900463ffffffff16613f16565b855461352c90600160a01b900463ffffffff16613f16565b61353586613f16565b613540876020613f5a565b8854613554906001600160a01b0316614028565b60018a015461356b906001600160a01b0316614028565b61358d8b60010154600160a01b90046b40000000000000000000000016151590565b6135cc576040518060400160405280600581526020017f66616c7365000000000000000000000000000000000000000000000000000000815250613603565b6040518060400160405280600481526020017f74727565000000000000000000000000000000000000000000000000000000008152505b60405160200161361a9897969594939291906151a2565b60405160208183030381529060405290506136648460020161363b88612939565b84846040516020016136509493929190615380565b6040516020818303038152906040526140cb565b6040516020016136749190615573565b604051602081830303815290604052945050505050919050565b6000898152600760205260409020600281016136ab898b83614f58565b5080546001600160a01b038088167fffffffffffffffffffffffff000000000000000000000000000000000000000063ffffffff8b16600160a01b0281167fffffffffffffffff000000000000000000000000000000000000000000000000909416939093171783556001830180549188169190921617905560038101613733838583614f58565b508361374b576b800000000000000000000000613759565b6bc000000000000000000000005b8160010160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f4d38ad12136291322128027bb8c3af7db2261be395032c1d26dd0ad20cf294158a8a8a8a8a8a8a8a8a6040516137ca999897969594939291906155b8565b60405180910390a150505050505050505050565b6001600160a01b038216600081815260208181526040808320858452825280832060019081905560078352818420805463ffffffff780100000000000000000000000000000000000000000000000080830482168501909116027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff90911617905581518681529283015233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291015b60405180910390a45050565b6138a43382612405565b1580156138b857506138b63382611117565b155b15611d2f576040517fbc3a32ff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6138f98888611ef3565b61392f576040517f402128fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff88166000908152600360205260409020548015613a2757600060e06139588b611e86565b63ffffffff16901b905061396c3382611117565b6139e5577fffffffff00000000000000000000000000000000000000000000000000000000808a169083168082148015906139a75750828214155b156139de576040517f899c1ba600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050613a25565b6139ef8a8a611eb6565b613a25576040517f899c1ba600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b507fffffffff0000000000000000000000000000000000000000000000000000000060e089901b1660008181526007602052604090206001600160a01b03881615613ada5780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03891690811782556040805184815260208101929092527f5f59e4feecec6992840f6f7c313415b21889d4445ea82fefd7f620aeb194461d910160405180910390a15b6001600160a01b03871615613b5c576001810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0389169081179091556040805184815260208101929092527ff68bc34e5f23b18f8e3a63ff51c021c8fbc9266113a63a4c73a66b4ad9033638910160405180910390a15b848015613beb57611b58811115613b9f576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028201613bae878983614f58565b507fb8350431af3841b22f977d0e8fd4be94669ef68e2db1d7f02a731d5d09ed44cc838888604051613be293929190615044565b60405180910390a15b50828015613c7b57611b58811115613c2f576040517fb11b2ad800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60038201613c3e858783614f58565b507f26bb402a5ddddf109a54486ab4d62a69ae00966cbc94c57075787f70bf9cba6c838686604051613c7293929190615044565b60405180910390a15b63ffffffff8b166000818152600360209081526040918290208d9055815192835282018c90527fd89812e6ebd66026da23b9c10923f8ec2d47c2f4bea260250e66d05ab76f6b89910160405180910390a15050505050505050505050565b6001600160a01b03831660009081526020818152604080832087845290915281205415613d1a57821580613d0b575081155b15613d1a57613d1a8486613de8565b60008581526008602090815260408083206001600160a01b038816845290915290205460ff16151582151503613de0575060008481526008602090815260408083206001600160a01b03871680855290835292819020805485157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116811790915581518881529283019390935291158183015290516001917ff95db9732f1ede51ad19afa6ee380168a1be58df547533ff009c18ceacd01ef5919081900360600190a15b949350505050565b6001600160a01b03821660008181526020818152604080832085845282528083208390556007825280832080547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff811678010000000000000000000000000000000000000000000000009182900463ffffffff9081166000190116909102179055805185815260019281019290925291929133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910161388e565b8015613ee7575060010180546001600160a01b0381166b800000000000000000000000600160a01b928390046bffffffffffffffffffffffff1617909102179055565b5060010180546001600160a01b038116600160a01b918290046b7fffffffffffffffffffffff16909102179055565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480613f305750819003601f19909101908152919050565b60408051601f196062600185901b01811690910191829052600091019081526f30313233343536373839616263646566600f5280835b600f8116517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8401936000190153600f8160041c165183536000199093019260081c83613f90578015613feb57632194895a6000526004601cfd5b50613078601f198301528190036002017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffde90910190815292915050565b60408051606001908190526f30313233343536373839616263646566600f526014825b600f8116517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8401936000190153600f8160041c165183536000199091019060081c8161404b575050613078601f19820152602a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffde909101908152919050565b6060610b84826000806060835180156141cb576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526102308515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f03603f52602083018181015b6003880197508751603f8160121c16518353603f81600c1c16516001840153603f8160061c16516002840153603f81165160038401535060048201915080821061414457600384068680156141a4576001821482151501850387526141bc565b603d821515850353603d6001831460011b8503538487525b5050601f01601f191660405250505b509392505050565b80356001600160a01b03811681146141ea57600080fd5b919050565b6000806040838503121561420257600080fd5b61420b836141d3565b946020939093013593505050565b6000806040838503121561422c57600080fd5b8235915061423c602084016141d3565b90509250929050565b60006020828403121561425757600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6f57600080fd5b60005b838110156142a257818101518382015260200161428a565b50506000910152565b600081518084526142c3816020860160208601614287565b601f01601f19169290920160200192915050565b602081526000610c6f60208301846142ab565b803563ffffffff811681146141ea57600080fd5b60006020828403121561431057600080fd5b610c6f826142ea565b60006020828403121561432b57600080fd5b5035919050565b60008083601f84011261434457600080fd5b50813567ffffffffffffffff81111561435c57600080fd5b60208301915083602082850101111561437457600080fd5b9250929050565b60008060008060006060868803121561439357600080fd5b61439c866141d3565b9450602086013567ffffffffffffffff808211156143b957600080fd5b6143c589838a01614332565b909650945060408801359150808211156143de57600080fd5b506143eb88828901614332565b969995985093965092949392505050565b6000806040838503121561440f57600080fd5b8235915061423c602084016142ea565b60008083601f84011261443157600080fd5b50813567ffffffffffffffff81111561444957600080fd5b6020830191508360208260051b850101111561437457600080fd5b60008060008060008060008060a0898b03121561448057600080fd5b614489896141d3565b975061449760208a016141d3565b9650604089013567ffffffffffffffff808211156144b457600080fd5b6144c08c838d0161441f565b909850965060608b01359150808211156144d957600080fd5b6144e58c838d0161441f565b909650945060808b01359150808211156144fe57600080fd5b5061450b8b828c01614332565b999c989b5096995094979396929594505050565b60008060008060008060008060c0898b03121561453b57600080fd5b614544896142ea565b97506020890135965061455960408a016141d3565b955061456760608a016141d3565b9450608089013567ffffffffffffffff8082111561458457600080fd5b6145908c838d01614332565b909650945060a08b01359150808211156144fe57600080fd5b600080600080604085870312156145bf57600080fd5b843567ffffffffffffffff808211156145d757600080fd5b6145e38883890161441f565b909650945060208701359150808211156145fc57600080fd5b506146098782880161441f565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b8181101561464d57835183529284019291840191600101614631565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261469957600080fd5b8135602067ffffffffffffffff808311156146b6576146b6614659565b8260051b604051601f19603f830116810181811084821117156146db576146db614659565b6040529384528581018301938381019250878511156146f957600080fd5b83870191505b8482101561110c57614710826141d3565b835291830191908301906146ff565b60008060008060008060008060008060008060e08d8f03121561474157600080fd5b67ffffffffffffffff8d35111561475757600080fd5b6147648e8e358f0161441f565b909c509a5067ffffffffffffffff60208e0135111561478257600080fd5b6147928e60208f01358f0161441f565b909a50985067ffffffffffffffff60408e013511156147b057600080fd5b6147c08e60408f01358f0161441f565b909850965067ffffffffffffffff60608e013511156147de57600080fd5b6147ee8e60608f01358f01614688565b955067ffffffffffffffff60808e0135111561480957600080fd5b6148198e60808f01358f01614688565b945067ffffffffffffffff60a08e0135111561483457600080fd5b6148448e60a08f01358f0161441f565b909450925067ffffffffffffffff60c08e0135111561486257600080fd5b6148728e60c08f01358f0161441f565b81935080925050509295989b509295989b509295989b565b6000806040838503121561489d57600080fd5b6148a6836142ea565b915061423c602084016141d3565b600080604083850312156148c757600080fd5b61420b836142ea565b803580151581146141ea57600080fd5b600080604083850312156148f357600080fd5b6148fc836141d3565b915061423c602084016148d0565b60008060006060848603121561491f57600080fd5b8335925061492f602085016141d3565b915061493d604085016141d3565b90509250925092565b6000806020838503121561495957600080fd5b823567ffffffffffffffff81111561497057600080fd5b61497c8582860161441f565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156149fb577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526149e98583516142ab565b945092850192908501906001016149af565b5092979650505050505050565b60008060008060808587031215614a1e57600080fd5b84359350614a2e602086016141d3565b9250614a3c604086016148d0565b9150614a4a606086016148d0565b905092959194509250565b600080600080600080600080600060e08a8c031215614a7357600080fd5b8935985060208a013567ffffffffffffffff80821115614a9257600080fd5b614a9e8d838e01614332565b909a509850889150614ab260408d016142ea565b9750614ac060608d016141d3565b9650614ace60808d016141d3565b9550614adc60a08d016148d0565b945060c08c0135915080821115614af257600080fd5b50614aff8c828d01614332565b915080935050809150509295985092959850929598565b60008060408385031215614b2957600080fd5b8235915061423c602084016148d0565b6000610120808352614b4d8184018d6142ab565b63ffffffff8c811660208601528b1660408501526001600160a01b038a811660608601528916608085015283810360a08501529050614b8c81886142ab565b61ffff9690961660c0840152505091151560e08301521515610100909101529695505050505050565b600080600060408486031215614bca57600080fd5b83359250602084013567ffffffffffffffff811115614be857600080fd5b614bf486828701614332565b9497909650939450505050565b60008060408385031215614c1457600080fd5b6148a6836141d3565b60008060008060008060a08789031215614c3657600080fd5b614c3f876141d3565b9550614c4d602088016141d3565b94506040870135935060608701359250608087013567ffffffffffffffff811115614c7757600080fd5b614c8389828a01614332565b979a9699509497509295939492505050565b60008060408385031215614ca857600080fd5b82359150602083013561ffff81168114614cc157600080fd5b809150509250929050565b600181811c90821680614ce057607f821691505b602082108103612ea8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61ffff81811683821601908082111561099f5761099f614d19565b600063ffffffff808316818103614d7c57614d7c614d19565b6001019392505050565b60008151614d98818560208601614287565b9290920192915050565b60008251614db4818460208701614287565b9190910192915050565b60008060408385031215614dd157600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215614e2357600080fd5b610c6f826141d3565b63ffffffff82811682821603908082111561099f5761099f614d19565b81810381811115610b8457610b84614d19565b8082028115828204841417610b8457610b84614d19565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614ea857600080fd5b83018035915067ffffffffffffffff821115614ec357600080fd5b60200191503681900382131561437457600080fd5b600060208284031215614eea57600080fd5b610c6f826148d0565b600061ffff808316818103614d7c57614d7c614d19565b601f821115610e3c57600081815260208120601f850160051c81016020861015614f315750805b601f850160051c820191505b81811015614f5057828155600101614f3d565b505050505050565b67ffffffffffffffff831115614f7057614f70614659565b614f8483614f7e8354614ccc565b83614f0a565b6000601f841160018114614fb85760008515614fa05750838201355b600019600387901b1c1916600186901b178355615012565b600083815260209020601f19861690835b82811015614fe95786850135825560209485019460019092019101614fc9565b50868210156150065760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b838152604060208201526000610cd6604083018486615019565b63ffffffff81811683821601908082111561099f5761099f614d19565b80516020808301519190811015612ea85760001960209190910360031b1b16919050565b6000602082840312156150b157600080fd5b5051919050565b7f22646f6d61696e223a20220000000000000000000000000000000000000000008152600084516150f081600b850160208901614287565b7f222c20226964223a202200000000000000000000000000000000000000000000600b91840191820152845161512d816015840160208901614287565b7f222c2022707265747479206964223a202200000000000000000000000000000060159290910191820152835161516b816026840160208801614287565b7f222c0000000000000000000000000000000000000000000000000000000000006026929091019182015260280195945050505050565b7f22737461747573223a20220000000000000000000000000000000000000000008152600089516151da81600b850160208e01614287565b7f222c202263757272656e7420737570706c79223a202200000000000000000000600b918401918201528951615217816021840160208e01614287565b01615244602182017f222c2022737570706c7920636170223a202200000000000000000000000000009052565b615251603382018a614d86565b7f222c202261646d696e2028696429223a20220000000000000000000000000000815290506152836012820189614d86565b7f222c202261646d696e202870726574747920696429223a202200000000000000815290506152b56019820188614d86565b7f222c2022656c69676962696c697479206d6f64756c65223a2022000000000000815290506152e7601a820187614d86565b7f222c2022746f67676c65206d6f64756c65223a20220000000000000000000000815290506153196015820186614d86565b7f222c20226d757461626c65223a202200000000000000000000000000000000008152905061534b600f820185614d86565b7f220000000000000000000000000000000000000000000000000000000000000081526001019b9a5050505050505050505050565b7f7b226e616d65223a20220000000000000000000000000000000000000000000081527f4861740000000000000000000000000000000000000000000000000000000000600a8201527f222c20226465736372697074696f6e223a202200000000000000000000000000600d820152600060206000875461540081614ccc565b60018281168015615418576001811461544f5761547f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00841686890152858315158402890101945061547f565b8b6000528560002060005b848110156154755781548a820189015290830190870161545a565b5050858389010194505b507f222c2022696d616765223a20220000000000000000000000000000000000000084526154b0600d85018b614d86565b7f222c000000000000000000000000000000000000000000000000000000000000815294507f2270726f70657274696573223a2000000000000000000000000000000000000060028601527f7b000000000000000000000000000000000000000000000000000000000000006010860152615537615531601187018b614d86565b89614d86565b7f7d00000000000000000000000000000000000000000000000000000000000000808252918101919091526002019a9950505050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516155ab81601d850160208701614287565b91909101601d0192915050565b89815260e0602082015260006155d260e083018a8c615019565b63ffffffff891660408401526001600160a01b0388811660608501528716608084015285151560a084015282810360c0840152615610818587615019565b9c9b50505050505050505050505056fea26469706673582212203620611cb556a5437bbe468fe951b4a09dced80631c01465ad1b2a933f77eb6e64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010486174732050726f746f636f6c207631000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b726569666c657a706b336b6a7a367a737632337062766f777461746e6435686d71666b64726f333378356d6832617a6c686e6533616834000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): Hats Protocol v1
Arg [1] : _baseImageURI (string): ipfs://bafkreiflezpk3kjz6zsv23pbvowtatnd5hmqfkdro33x5mh2azlhne3ah4
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [3] : 486174732050726f746f636f6c20763100000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000042
Arg [5] : 697066733a2f2f6261666b726569666c657a706b336b6a7a367a737632337062
Arg [6] : 766f777461746e6435686d71666b64726f333378356d6832617a6c686e653361
Arg [7] : 6834000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode Sourcemap
1555:60942:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;57826:363;;;;;;:::i;:::-;;:::i;:::-;;;620:25:12;;;608:2;593:18;57826:363:4;;;;;;;;28151:865;;;;;;:::i;:::-;;:::i;:::-;;60940:332;;;;;;:::i;:::-;;:::i;:::-;;;1417:14:12;;1410:22;1392:41;;1380:2;1365:18;60940:332:4;1252:187:12;3543:18:4;;;:::i;:::-;;;;;;;:::i;1657:50:5:-;;;;;;:::i;:::-;;;;;;;;;;;;;;62363:132:4;;;;;;:::i;:::-;;:::i;10652:183::-;;;;;;:::i;:::-;;:::i;5666:535::-;;;;;;:::i;:::-;;:::i;30001:482::-;;;;;;:::i;:::-;;:::i;60230:179::-;;;;;;:::i;35967:1032::-;;;;;;:::i;:::-;;:::i;32384:1243::-;;;;;;:::i;:::-;;:::i;16855:1493::-;;;;;;:::i;:::-;;:::i;42293:148::-;;;;;;:::i;:::-;;:::i;6214:171:5:-;;;;;;:::i;:::-;;:::i;5066:997::-;;;;;;:::i;:::-;;:::i;:::-;;;6990:10:12;6978:23;;;6960:42;;6948:2;6933:18;5066:997:5;6816:192:12;61601:629:4;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;12503:416::-;;;;;;:::i;:::-;;:::i;47922:1262::-;;;;;;:::i;:::-;;:::i;52455:129::-;;;;;;:::i;:::-;52522:14;52557:13;;;:5;:13;;;;;:20;;;-1:-1:-1;;;;;52557:20:4;;52455:129;;;;-1:-1:-1;;;;;9370:55:12;;;9352:74;;9340:2;9325:18;52455:129:4;9206:226:12;27571:404:4;;;;;;:::i;:::-;;:::i;8118:523:5:-;;;;;;:::i;:::-;;:::i;11227:901:4:-;;;;;;:::i;:::-;;:::i;6809:933:5:-;;;;;;:::i;:::-;;:::i;51813:119:4:-;;;;;;:::i;:::-;51871:13;51905;;;:5;:13;;;;;:20;;;;;;;51813:119;3803:26;;;:::i;26348:289::-;;;;;;:::i;:::-;;:::i;9003:1407::-;;;;;;:::i;:::-;;:::i;18504:218::-;;;;;;:::i;:::-;;:::i;34139:957::-;;;;;;:::i;:::-;;:::i;46863:128::-;;;;;;:::i;:::-;;:::i;52129:149::-;;;;;;:::i;:::-;52201:19;52246:13;;;:5;:13;;;;;:25;-1:-1:-1;;;;;52246:25:4;;52129:149;9439:161:5;;;;;;:::i;:::-;;:::i;9812:295::-;;;;;;:::i;:::-;;:::i;11173:534::-;;;;;;:::i;:::-;;:::i;59739:88:4:-;;;;;;:::i;10369:400:5:-;;;;;;:::i;:::-;;:::i;4223:64:4:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;24966:1219;;;;;;:::i;:::-;;:::i;1082:2274:1:-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;16101:373:4:-;;;;;;:::i;:::-;;:::i;7133:1083::-;;;;;;:::i;:::-;;:::i;42888:2365::-;;;;;;:::i;:::-;;:::i;13233:280::-;;;;;;:::i;:::-;;:::i;1360:52:5:-;;;;;;:::i;:::-;;;;;;;;;;;;;;31145:494:4;;;;;;:::i;:::-;;:::i;13774:519::-;;;;;;:::i;:::-;;:::i;41260:732::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;;;;;;;:::i;51430:160::-;;;;;;:::i;:::-;;:::i;29246:528::-;;;;;;:::i;:::-;;:::i;8936:233:5:-;;;;;;:::i;:::-;;:::i;53226:1542:4:-;;;;;;:::i;:::-;;:::i;1193:68:0:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;59996:124:4;;;;;;:::i;26866:519::-;;;;;;:::i;:::-;;:::i;3188:1116:5:-;;;;;;:::i;:::-;;:::i;52790:134:4:-;;;;;;:::i;:::-;52854:16;52894:13;;;:5;:13;;;;;:23;-1:-1:-1;;;52894:23:4;;;;;52790:134;4473:337:5;;;;;;:::i;:::-;;:::i;3640:26:4:-;;;;;;;;;6654:149:5;;;;;;:::i;:::-;;:::i;57826:363:4:-;57956:15;58005:13;;;:5;:13;;;;;58055:22;58005:13;58011:6;58055:9;:22::i;:::-;:59;;;;;58081:33;58093:7;58102:3;58107:6;58081:11;:33::i;:::-;58051:132;;;-1:-1:-1;;;;;3954:17:0;;3917:15;3954:17;;;;;;;;;;;:21;;;;;;;;;58140:32:4;58130:42;;58051:132;57977:212;57826:363;;;;:::o;28151:865::-;-1:-1:-1;;;;;28235:24:4;;28231:50;;28268:13;;;;;;;;;;;;;;28231:50;28292:19;28304:6;28292:11;:19::i;:::-;28321:15;28339:13;;;:5;:13;;;;;28368:15;28339:13;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;:34;;;47550:140;28368:15;28363:65;;28406:11;;;;;;;;;;;;;;28363:65;28684:12;28698:14;28716:27;28731:3;28736:6;28716:14;:27::i;:::-;28683:60;;;;28848:7;28844:49;;;28857:36;28875:6;28883:9;28857:17;:36::i;:::-;;28844:49;28934:10;;;:23;;;;-1:-1:-1;;;;;28934:23:4;;;;;;;;28973:36;;;20181:25:12;;;20237:2;20222:18;;20215:83;;;;28973:36:4;;20154:18:12;28973:36:4;;;;;;;28221:795;;;28151:865;;:::o;60940:332::-;61017:4;61040:25;;;;;;:179;;-1:-1:-1;61194:25:4;;;;;61040:179;61033:186;60940:332;-1:-1:-1;;60940:332:4:o;3543:18::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;62363:132::-;62434:18;62471:17;62485:2;62471:13;:17::i;10652:183::-;10708:14;10753:13;;;:5;:13;;;;;:23;10708:14;;10753:27;;:23;;;;;10779:1;10753:27;:::i;:::-;10734:46;;10799:29;10810:6;10818:9;10799:10;:29::i;:::-;10790:38;10652:183;-1:-1:-1;;;10652:183:4:o;5666:535::-;5864:12;5862:14;;5788:16;;5881:3;;5788:16;;5862:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;5854:23;;:30;;5843:41;;5895:261;5919:8;5941;;5974:1;6014;6065;6101:5;6137:9;;5895:10;:261::i;:::-;6167:27;6176:7;6185:8;6167;:27::i;:::-;5666:535;;;;;;;:::o;30001:482::-;30086:19;30098:6;30086:11;:19::i;:::-;30115:15;30133:13;;;:5;:13;;;;;30162:15;30133:13;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;:34;;;47550:140;30162:15;30157:65;;30200:11;;;;;;;;;;;;;;30157:65;30252:10;;;;;;;;;30236:26;;;;30232:84;;;30285:20;;;;;;;;;;;;;;30232:84;30347:13;;;30330:30;;;-1:-1:-1;;;30347:13:4;;;;30330:30;30326:151;;30376:29;;;;-1:-1:-1;;;30376:29:4;;;;;;;;;;;;30424:42;;;21491:25:12;;;21547:2;21532:18;;21525:51;;;;30424:42:4;;21464:18:12;30424:42:4;;;;;;;;30326:151;30076:407;30001:482;;:::o;35967:1032::-;36231:29;36257:3;36231:29;;;;36408:25;36231:29;36408:11;:25::i;:::-;2879:2:5;36522:25:4;36534:12;36522:11;:25::i;:::-;:38;;;36518:318;;;36576:40;36588:27;36599:12;36613:1;36588:10;:27::i;:::-;36576:11;:40::i;:::-;36518:318;;;36792:33;36812:12;36792:19;:33::i;:::-;36902:90;36920:13;36935:12;36949;36963:7;36972:8;;36982:9;;36902:17;:90::i;:::-;36198:801;35967:1032;;;;;;;;:::o;32384:1243::-;2879:2:5;32798:25:4;32810:12;32798:11;:25::i;:::-;:38;;;32794:318;;;32852:40;32864:27;32875:12;32889:1;32864:10;:27::i;32852:40::-;32794:318;;;33068:33;33088:12;33068:19;:33::i;:::-;33193;;;;;;;:18;:33;;;;;;33177:49;;33173:83;;33235:21;;;;;;;;;;;;;;33173:83;33425:33;;;;;;;:18;:33;;;;;33418:40;33530:90;33444:13;33563:12;33577;33591:7;33600:8;;33610:9;;33530:17;:90::i;:::-;32384:1243;;;;;;;;:::o;16855:1493::-;16934:12;17047:13;;;:5;:13;;;;;;:25;17097:76;;-1:-1:-1;;;;;21779:55:12;;;17097:76:4;;;21761:74:12;21851:18;;;21844:34;;;16934:12:4;;;;;;;;17047:25;;21734:18:12;;17097:76:4;;;-1:-1:-1;;17097:76:4;;;;;;;;;;;;;;;;;;;;17047:136;;;17097:76;17047:136;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17005:178;;;;17612:7;:34;;;;;17623:10;:17;17644:2;17623:23;17612:34;17608:653;;;17708:17;17727:18;17760:10;17749:42;;;;;;;;;;;;:::i;:::-;17707:84;;;;17856:1;17844:9;:13;:31;;;;;17874:1;17861:10;:14;17844:31;17840:353;;;17907:10;17921:1;17907:15;17906:32;;17933:5;17906:32;;;17926:4;17906:32;17895:43;;18021:8;:26;;;;;18033:9;18046:1;18033:14;18021:26;18020:43;;18058:5;18020:43;;;18051:4;18020:43;18009:54;;17840:353;;;18158:20;;;;;;;;;;;;;;17840:353;17648:555;;18281:60;18305:6;18313:7;18322:8;18332;18281:23;:60::i;:::-;18271:70;16855:1493;-1:-1:-1;;;;;;;16855:1493:4:o;42293:148::-;42368:13;42432:1;42405:24;42415:5;42422:6;42405:9;:24::i;:::-;:28;;42293:148;-1:-1:-1;;;42293:148:4:o;6214:171:5:-;6269:14;6307:21;6321:6;6307:13;:21::i;:::-;:71;;;;;6332:16;:41;6349:23;6365:6;6349:15;:23::i;:::-;6332:41;;;;;;;;;;;;;-1:-1:-1;6332:41:5;;:46;6295:83;6214:171;-1:-1:-1;;6214:171:5:o;5066:997::-;5129:12;5174:17;5157:35;;:40;;5153:54;;-1:-1:-1;5206:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5153:54::-;5238:17;5221:35;;5260:1;5221:40;5217:54;;-1:-1:-1;5270:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5217:54::-;5302:17;5285:35;;5324:1;5285:40;5281:54;;-1:-1:-1;5334:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5281:54::-;5366:17;5349:35;;5388:1;5349:40;5345:54;;-1:-1:-1;5398:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5345:54::-;-1:-1:-1;;;;;5413:35:5;;5452:1;5413:40;5409:54;;-1:-1:-1;5462:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5409:54::-;5494:17;5477:35;;5516:1;5477:40;5473:54;;-1:-1:-1;5526:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5473:54::-;5558:17;5541:35;;5580:1;5541:40;5537:54;;-1:-1:-1;5590:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5537:54::-;5622:17;5605:35;;5644:1;5605:40;5601:54;;-1:-1:-1;5654:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5601:54::-;5686:16;5669:34;;5707:1;5669:39;5665:53;;-1:-1:-1;5717:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5665:53::-;5749:16;5732:34;;5770:1;5732:39;5728:53;;-1:-1:-1;5780:1:5;;5066:997;-1:-1:-1;5066:997:5:o;5728:53::-;5812:16;5795:34;;5833:1;5795:39;5791:54;;-1:-1:-1;5843:2:5;;5066:997;-1:-1:-1;5066:997:5:o;5791:54::-;5876:16;5859:34;;5897:1;5859:39;5855:54;;-1:-1:-1;5907:2:5;;5066:997;-1:-1:-1;5066:997:5:o;5855:54::-;5940:16;5923:34;;5961:1;5923:39;5919:54;;-1:-1:-1;5971:2:5;;5066:997;-1:-1:-1;5066:997:5:o;5919:54::-;6004:16;5987:34;;6025:1;5987:39;5983:54;;-1:-1:-1;6035:2:5;;5066:997;-1:-1:-1;5066:997:5:o;5983:54::-;-1:-1:-1;6054:2:5;;5066:997;-1:-1:-1;5066:997:5:o;61601:629:4:-;61760:25;61805:33;;;61801:72;;61847:26;;;;;;;;;;;;;;61801:72;61909:8;61895:30;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;61895:30:4;;61884:41;;62096:9;62091:123;62107:19;;;62091:123;;;62165:34;62175:8;;62184:1;62175:11;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;62188:7;;62196:1;62188:10;;;;;;;:::i;:::-;;;;;;;62165:9;:34::i;:::-;62151:8;62160:1;62151:11;;;;;;;;:::i;:::-;;;;;;;;;;:48;62128:3;;62091:123;;;;61601:629;;;;;;:::o;12503:416::-;12599:12;12640:7;12668:25;;;12664:64;;12702:26;;;;;;;;;;;;;;12664:64;12744:9;12739:149;12763:6;12759:1;:10;12739:149;;;12786:32;12794:7;;12802:1;12794:10;;;;;;;:::i;:::-;;;;;;;12806:8;;12815:1;12806:11;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;12786:32::-;-1:-1:-1;12860:3:4;;12739:149;;;-1:-1:-1;12908:4:4;;12503:416;-1:-1:-1;;;;;;12503:416:4:o;47922:1262::-;48002:13;48069;;;:5;:13;;;;;;:25;48119:76;;-1:-1:-1;;;;;21779:55:12;;;48119:76:4;;;21761:74:12;21851:18;;;21844:34;;;48002:13:4;;;;48069:25;;;21734:18:12;;48119:76:4;;;-1:-1:-1;;48119:76:4;;;;;;;;;;;;;;;;;;;;48069:136;;;48119:76;48069:136;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;48027:178;;;;48634:7;:34;;;;;48645:10;:17;48666:2;48645:23;48634:34;48630:548;;;48730:17;48749:18;48782:10;48771:42;;;;;;;;;;;;:::i;:::-;48729:84;;;;48878:1;48866:9;:13;:31;;;;;48896:1;48883:10;:14;48866:31;48862:234;;;48929:10;48943:1;48929:15;48928:32;;48955:5;48928:32;;;48948:4;48928:32;48917:43;;48862:234;;;49052:20;;;;:12;:20;;;;;;;;-1:-1:-1;;;;;49052:29:4;;;;;;;;;;;;49051:30;;-1:-1:-1;48862:234:4;48670:436;;48630:548;;;49138:20;;;;:12;:20;;;;;;;;-1:-1:-1;;;;;49138:29:4;;;;;;;;;;;;49137:30;;-1:-1:-1;48630:548:4;48017:1167;;47922:1262;;;;:::o;27571:404::-;-1:-1:-1;;;;;27665:29:4;;27661:55;;27703:13;;;;;;;;;;;;;;27661:55;27727:19;27739:6;27727:11;:19::i;:::-;27756:15;27774:13;;;:5;:13;;;;;27803:15;27774:13;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;:34;;;47550:140;27803:15;27798:65;;27841:11;;;;;;;;;;;;;;27798:65;27873:33;;;;-1:-1:-1;;;;;27873:33:4;;;;;;;27922:46;;;20181:25:12;;;20237:2;20222:18;;20215:83;;;;27922:46:4;;20154:18:12;27922:46:4;20007:297:12;8118:523:5;8195:13;8220:23;8246:16;:41;8263:23;8279:6;8263:15;:23::i;:::-;8246:41;;;;;;;;;;;;;;;;8220:67;;8301:15;8320:1;8301:20;8297:77;;8338:36;8359:6;8367;8338:20;:36::i;:::-;8330:44;;8323:51;;;8297:77;8385:23;8411:44;8423:31;8444:6;8452:1;8423:20;:31::i;8411:44::-;8385:70;;8490:6;8470:26;;:16;:26;;;8466:102;;8513:55;8534:6;8542:25;8551:16;8542:6;:25;:::i;8513:55::-;8505:63;;8498:70;;;;8466:102;8594:40;8610:15;8627:6;8594:15;:40::i;11227:901:4:-;11293:12;11335:13;;;:5;:13;;;;;11362;;-1:-1:-1;;;11362:13:4;;;;:18;;11358:54;;11389:23;;;;;;;;620:25:12;;;593:18;;11389:23:4;;;;;;;;11358:54;11484:27;11495:7;11504:6;11484:10;:27::i;:::-;11479:54;;11520:13;;;;;;;;;;;;;;11479:54;11590:22;11600:3;11605:6;11590:9;:22::i;:::-;11585:50;;11621:14;;;;;;;;;;;;;;11585:50;11709:19;11721:6;11709:11;:19::i;:::-;11802:13;;;-1:-1:-1;;;11802:13:4;;;;11788:10;;;;;:27;11784:59;;11824:19;;;;;;;;620:25:12;;;593:18;;11824:19:4;474:177:12;11784:59:4;-1:-1:-1;;;;;3954:17:0;;11952:1:4;3954:17:0;;;;;;;;;;;:21;;;;;;;;;11916:37:4;11912:84;;11962:34;;;;;-1:-1:-1;;;;;21779:55:12;;11962:34:4;;;21761:74:12;21851:18;;;21844:34;;;21734:18;;11962:34:4;21587:297:12;11912:84:4;12071:25;12080:7;12089:6;12071:8;:25::i;:::-;-1:-1:-1;12117:4:4;;11227:901;-1:-1:-1;;;11227:901:4:o;6809:933:5:-;6868:15;6940:21;6954:6;6940:13;:21::i;:::-;6936:38;;;-1:-1:-1;6970:4:5;;6809:933;-1:-1:-1;6809:933:5:o;6936:38::-;6985:12;7000:24;7017:6;7000:16;:24::i;:::-;6985:39;-1:-1:-1;7034:13:5;;7171:9;7179:1;6985:39;7171:9;:::i;:::-;7159:21;;;;7154:508;7182:5;;7154:508;;7435:14;7448:1;2879:2;7435:14;:::i;:::-;7406:44;;2686:2;7406:44;:::i;:::-;7395:6;:56;;7387:64;;7566:5;7559:18;;7576:1;7559:18;7555:36;;-1:-1:-1;7586:5:5;;6809:933;-1:-1:-1;;;;6809:933:5:o;7555:36::-;-1:-1:-1;;7634:3:5;7154:508;;;-1:-1:-1;7731:4:5;;6809:933;-1:-1:-1;;;;6809:933:5:o;3803:26:4:-;;;;;;;:::i;26348:289::-;26409:19;26421:6;26409:11;:19::i;:::-;26439:15;26457:13;;;:5;:13;;;;;26486:15;26457:13;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;:34;;;47550:140;26486:15;26481:65;;26524:11;;;;;;;;;;;;;;26481:65;26556:10;;;:30;;-1:-1:-1;;;;;26556:30:4;;-1:-1:-1;;;26556:30:4;;;;;;;;;;;;26602:28;;620:25:12;;;26602:28:4;;608:2:12;593:18;26602:28:4;;;;;;;26399:238;26348:289;:::o;9003:1407::-;9322:12;9410:7;9322:12;9503:25;;;:89;;;;-1:-1:-1;9563:29:4;;;9503:89;:161;;;;;9638:19;:26;9628:6;:36;9503:161;:231;;;;;9713:14;:21;9703:6;:31;9503:231;:291;;;;-1:-1:-1;9768:26:4;;;9503:291;:353;;;;-1:-1:-1;9829:27:4;;;9503:353;9466:404;;9901:11;9896:51;;9921:26;;;;;;;;;;;;;;9896:51;9452:506;10017:9;10012:367;10036:6;10032:1;:10;10012:367;;;10059:249;10086:7;;10094:1;10086:10;;;;;;;:::i;:::-;;;;;;;10114:8;;10123:1;10114:11;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;10143:12;;10156:1;10143:15;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;10176:19;10196:1;10176:22;;;;;;;;:::i;:::-;;;;;;;10216:14;10231:1;10216:17;;;;;;;;:::i;:::-;;;;;;;10251:9;;10261:1;10251:12;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;10281:10;;10292:1;10281:13;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;10059:249::-;-1:-1:-1;10351:3:4;;10012:367;;;-1:-1:-1;10399:4:4;;9003:1407;-1:-1:-1;;;;;;;;;;;;;;9003:1407:4:o;18504:218::-;18581:10;3917:15:0;3954:17;;;;;;;;;;;:21;;;;;;;;;18603:1:4;-1:-1:-1;18560:92:4;;;18627:14;;;;;;;;;;;;;;18560:92;18687:28;18696:10;18708:6;18687:8;:28::i;:::-;18504:218;:::o;34139:957::-;34250:29;34276:3;34250:29;;;;34322:25;34250:29;34322:11;:25::i;:::-;-1:-1:-1;;;;;34545:21:4;;;;:62;;;34571:36;34585:7;34594:12;34571:13;:36::i;:::-;34570:37;34545:62;34541:101;;;34616:26;;;;;;;;;;;;;;34541:101;34690:31;;;;;;;:16;:31;;;;;;;;34683:38;;;34828:18;:33;;;;;34821:40;;;34965:19;;;:5;:19;;;;;34994:22;;;;;;;;-1:-1:-1;35033:10:4;;35026:17;;;;;;;35059:30;;24450:42:12;;;24508:18;;;24501:34;;;;34965:19:4;35059:30;;24423:18:12;35059:30:4;;;;;;;;34217:879;;34139:957;;:::o;46863:128::-;46920:11;46962:13;;;:5;:13;;;;;46952:32;;46968:6;46952:9;:32::i;9439:161:5:-;9501:13;9553:38;2879:2;2686;9553:38;:::i;:::-;9542:50;;;;;9439:161;-1:-1:-1;9439:161:5:o;9812:295::-;9932:31;;;9885:13;9932:31;;;:16;:31;;;;;;9977:16;;;9973:51;;-1:-1:-1;10011:13:5;;9812:295;-1:-1:-1;9812:295:5:o;9973:51::-;10050:50;10071:28;10087:11;10071:15;:28::i;11173:534::-;11269:15;11371:31;11405:35;11426:13;11405:20;:35::i;:::-;11371:69;;11450:21;11474:29;11490:12;11474:15;:29::i;:::-;11450:53;;11513:28;11544:36;11565:14;11544:20;:36::i;:::-;11650:49;;;;;;;;;;;11173:534;-1:-1:-1;;;;;11173:534:5:o;10369:400::-;10461:16;10493:12;10509:1;10493:17;10489:34;;-1:-1:-1;10519:4:5;10512:11;;10489:34;10533:18;10554:29;10570:12;10554:15;:29::i;:::-;10533:50;;10614:11;10597:28;;:13;:28;;;10593:46;;10634:5;10627:12;;;;;10593:46;10671:29;;;10649:19;10671:29;;;:16;:29;;;;;;10717:45;10735:13;10671:29;10717:17;:45::i;24966:1219:4:-;25048:19;25060:6;25048:11;:19::i;:::-;25182:16;25191:6;25182:8;:16::i;:::-;25177:98;;25230:13;;;;:5;:13;;;;;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;25214:50;;25253:11;;;;;;;;;;;;;;25214:50;-1:-1:-1;;;;;3954:17:0;;3917:15;3954:17;;;;;;;;;;;:21;;;;;;;;;25437:1:4;-1:-1:-1;25399:62:4;;;25447:14;;;;;;;;;;;;;;25399:62;-1:-1:-1;;;;;3954:17:0;;25616:1:4;3954:17:0;;;;;;;;;;;:21;;;;;;;;;25584:33:4;25580:76;;25626:30;;;;;-1:-1:-1;;;;;21779:55:12;;25626:30:4;;;21761:74:12;21851:18;;;21844:34;;;21734:18;;25626:30:4;21587:297:12;25580:76:4;25733:23;25744:3;25749:6;25733:10;:23::i;:::-;25728:50;;25765:13;;;;;;;;;;;;;;25728:50;25850:13;;;;:5;:13;;;;;25840:32;;25856:6;25840:9;:32::i;:::-;25835:60;;25881:14;;;;;;;;;;;;;;25835:60;-1:-1:-1;;;;;25996:17:4;;;26024:1;25996:17;;;;;;;;;;;:25;;;;;;;;:29;;;26035:15;;;;;;;;;;;;:23;;;;;;;;;26061:1;26035:27;;;;26129:49;;24728:25:12;;;24769:18;;;24762:34;26035:15:4;;26144:10;;26129:49;;24701:18:12;26129:49:4;;;;;;;24966:1219;;;:::o;1082:2274:1:-;1148:14;1210:4;1204;1197:18;1241:11;1235:4;1228:25;1355:11;1345:45;;1383:4;1377;1370:18;1345:45;1419:4;1515:11;1512:1;1508:19;1631:3;1618:11;1612:4;1599:36;1778:17;;;;1809:1480;1939:7;1933:14;1920:11;1916:32;1998:4;1983:13;1979:24;2243:1;2230:15;2160:4;2157:1;2153:12;2125:6;2091:208;2388:4;2382;2378:1;2365:15;2357:6;2346:9;2339:5;2326:67;2316:287;;2517:16;2511:4;2505;2490:44;2568:16;2562:4;2555:30;2316:287;2706:13;2697:7;2690:30;2761:4;2752:7;2748:18;2737:29;;2869:16;2861:6;2854:32;2943:16;2937:4;2930;2922:6;2918:17;2903:57;-1:-1:-1;;3176:16:1;3157:36;3195:4;3153:47;3202:18;3149:72;3248:16;;;1809:1480;3238:37;3334:4;3319:13;3315:24;3309:4;3302:38;16101:373:4;16228:12;16274:13;;;:5;:13;;;;;16316:15;;-1:-1:-1;;;;;16316:15:4;16302:10;:29;16298:87;;16354:20;;;;;;;;;;;;;;16298:87;16405:62;16429:6;16437:7;16446:9;16457;16405:23;:62::i;:::-;16395:72;16101:373;-1:-1:-1;;;;;;16101:373:4:o;7133:1083::-;7372:16;7404:18;;;;7400:74;;7445:18;;;;;;;;;;;;;;7400:74;-1:-1:-1;;;;;7488:26:4;;7484:52;;7523:13;;;;;;;;;;;;;;7484:52;-1:-1:-1;;;;;7550:21:4;;7546:47;;7580:13;;;;;;;;;;;;;;7546:47;7708:20;7721:6;7708:12;:20::i;:::-;7703:48;;7737:14;;;;;;;;;;;;;;7703:48;7809:17;7819:6;7809:9;:17::i;:::-;7798:28;;7906:21;7918:8;7906:11;:21::i;:::-;7967:86;7978:8;7988;;7998:10;8010:12;8024:7;8033:8;8043:9;;7967:10;:86::i;:::-;8186:13;;;;:5;:13;;;;;8184:25;;8186:23;;8184:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;7133:1083;;;;;;;;;;;:::o;42888:2365::-;42962:12;42986:23;43019:25;43058:21;43072:6;43058:13;:21::i;:::-;43054:838;;;43113:16;:41;43130:23;43146:6;43130:15;:23::i;:::-;43113:41;;;;;;;;;;;;;;;;43095:59;;43172:15;43191:1;43172:20;43168:510;;43267:28;43281:5;43288:6;43267:13;:28::i;43168:510::-;43372:37;43386:5;43393:15;43372:13;:37::i;:::-;43368:296;;;43450:4;43440:14;;43433:21;;;;43368:296;43566:33;43583:15;43566:16;:33::i;:::-;43545:54;;43630:15;43621:24;;43054:838;;;43880:1;43853:24;43870:6;43853:16;:24::i;:::-;:28;;;;:::i;:::-;43832:49;;43054:838;43997:22;;;;43990:326;;44039:70;44053:5;44060:48;44081:6;44089:18;44060:20;:48::i;44039:70::-;44035:130;;;44146:4;44136:14;;44129:21;;;;44035:130;-1:-1:-1;;44271:20:4;43990:326;;;44475:53;44489:5;44496:31;44517:6;44525:1;44496:20;:31::i;44475:53::-;44471:80;;;44547:4;44537:14;;44530:21;;;;44471:80;44639:16;:41;44656:23;44672:6;44656:15;:23::i;:::-;44639:41;;;;;;;;;;;;;;;;44621:59;;44694:15;44713:1;44694:20;44690:557;;44909:5;44899:15;;44892:22;;;;44690:557;45037:37;45051:5;45058:15;45037:13;:37::i;:::-;45033:54;;;45083:4;45076:11;;;;;;45033:54;45200:36;45213:5;45220:15;45200:12;:36::i;13233:280::-;13306:12;13348:13;;;:5;:13;;;;;13390:10;;;;-1:-1:-1;;;;;13390:10:4;13376;:24;13372:77;;13423:15;;;;;;;;;;;;;;13372:77;13469:37;13487:6;13495:10;13469:17;:37::i;31145:494::-;31270:29;31296:3;31270:29;;;;31473:25;31270:29;31473:11;:25::i;:::-;31509:33;;;;;;;:18;:33;;;;;;;;;:54;;;31578;;24450:42:12;;;24508:18;;24501:34;;;31578:54:4;;24423:18:12;31578:54:4;24270:271:12;13774:519:4;13830:12;13872:13;;;:5;:13;;;;;13830:12;;14000:27;13872:13;13878:6;14000:14;:27::i;:::-;13967:60;;;;14121:7;14116:36;;14137:15;;;;;;;;;;;;;;14116:36;14250;14268:6;14276:9;14250:17;:36::i;41260:732::-;41351:21;41386:16;41416:13;41443:19;41476:14;41504:22;41540:16;41570:13;41597:11;41633:15;41651:5;:13;41657:6;41651:13;;;;;;;;;;;41633:31;;41684:3;:11;;41674:21;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;41717:13:4;;41783:15;41817:10;;;41674:21;;-1:-1:-1;41717:13:4;-1:-1:-1;;;41717:13:4;;;;;-1:-1:-1;41749:10:4;;;;;-1:-1:-1;;;;;;41783:15:4;;;;-1:-1:-1;41817:10:4;;;;;-1:-1:-1;41848:25:4;;-1:-1:-1;41866:6:4;;-1:-1:-1;41848:17:4;;-1:-1:-1;41848:25:4:i;:::-;41895:13;;47648:11;;;;41837:36;;-1:-1:-1;41895:13:4;;;;;;-1:-1:-1;47669:7:4;-1:-1:-1;;;47648:11:4;;;:29;:34;;41918:26;;41963:22;41973:3;41978:6;41963:9;:22::i;:::-;41954:31;;41623:369;41260:732;;;;;;;;;;;:::o;51430:160::-;51504:13;51561;;;:5;:13;;;;;51540:43;;51552:7;;51567:6;51540:11;:43::i;29246:528::-;29371:4;29342:33;;29338:61;;;29384:15;;;;;;;;;;;;;;29338:61;29410:19;29422:6;29410:11;:19::i;:::-;29439:15;29457:13;;;:5;:13;;;;;29591:16;29463:6;29591:8;:16::i;:::-;29586:88;;29628:15;29639:3;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;:34;;;47550:140;29628:15;29623:40;;29652:11;;;;;;;;;;;;;;29623:40;29684:12;;;:27;29699:12;;29684;:27;:::i;:::-;;29727:40;29746:6;29754:12;;29727:40;;;;;;;;:::i;8936:233:5:-;9018:13;;9109:19;;;;2879:2;9109:19;:::i;:::-;9080:49;;2686:2;9080:49;:::i;:::-;-1:-1:-1;;9058:72:5;;9149:13;;;;;8936:233;-1:-1:-1;;;8936:233:5:o;53226:1542:4:-;53394:15;53412:13;;;:5;:13;;;;;53461:12;;;53436:37;;53290:18;;53394:15;53461:12;53436:37;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53580:1;53561:8;53555:22;:26;53551:72;;;53604:8;53226:1542;-1:-1:-1;;;53226:1542:4:o;53551:72::-;53685:13;53701:19;53713:6;53701:11;:19::i;:::-;53685:35;;;;53839:5;53848:1;53839:10;53835:35;;53858:12;53851:19;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53226:1542;;;:::o;53835:35::-;53952:10;;54071:9;54079:1;54071:5;:9;:::i;:::-;54059:21;;54054:387;54082:5;;54054:387;;54109:34;54125:6;54140:1;54109:15;:34::i;:::-;54163:9;;;;:5;:9;;;;;54197:12;;;54186:23;;54163:9;;-1:-1:-1;54104:39:4;;-1:-1:-1;54186:23:4;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54253:1;54234:8;54228:22;:26;54224:80;;;-1:-1:-1;54281:8:4;;53226:1542;-1:-1:-1;;;;;53226:1542:4:o;54224:80::-;-1:-1:-1;;54413:3:4;54054:387;;;;54456:26;54472:6;54480:1;54456:15;:26::i;:::-;54498:9;;;;:5;:9;;;;;54528:12;;;54517:23;;54498:9;;-1:-1:-1;54451:31:4;;-1:-1:-1;54517:23:4;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54580:1;54561:8;54555:22;:26;54551:72;;;-1:-1:-1;54604:8:4;;53226:1542;-1:-1:-1;;;;53226:1542:4:o;54551:72::-;54749:12;54742:19;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53310:1458;;;;53226:1542;;;:::o;26866:519::-;26988:4;26960:32;;26956:60;;;27001:15;;;;;;;;;;;;;;26956:60;27027:19;27039:6;27027:11;:19::i;:::-;27057:15;27075:13;;;:5;:13;;;;;27206:16;27081:6;27206:8;:16::i;:::-;27201:88;;27243:15;27254:3;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;:34;;;47550:140;27243:15;27238:40;;27267:11;;;;;;;;;;;;;;27238:40;27299:11;;;:25;27313:11;;27299;:25;:::i;:::-;;27340:38;27358:6;27366:11;;27340:38;;;;;;;;:::i;3188:1116:5:-;3261:10;3283:12;3310:9;3305:868;2879:2;3325:1;:14;3305:868;;;-1:-1:-1;;2546:2:5;2686;3551:29;;3527:54;3420:162;;-1:-1:-1;3632:13:5;;;3649:1;3632:18;3628:399;;3938:1;3934;2879:2;3921:14;:18;2686:2;3892:48;3778:7;3770:16;;:171;;3707:6;:260;3702:265;;4003:9;;;;3628:399;4145:3;;3305:868;;;;4279:18;;;;;;;;;;;;;;4473:337;4531:12;4610:24;4627:6;4610:16;:24::i;:::-;4602:32;;4645:17;4665:16;:41;4682:23;4698:6;4682:15;:23::i;:::-;4665:41;;;;;;;;;;;;;-1:-1:-1;4665:41:5;;;-1:-1:-1;4721:14:5;;4717:87;;4771:22;4783:9;4771:11;:22::i;:::-;4759:9;4763:5;4759:1;:9;:::i;:::-;:34;;;;:::i;4717:87::-;4545:265;4473:337;;;:::o;6654:149::-;6714:19;6771:1;6762:6;:10;:34;;;;-1:-1:-1;;6776:20:5;;;;6654:149::o;45528:1190:4:-;45681:11;;;;45704:56;;;;;620:25:12;;;45604:11:4;;;;;;-1:-1:-1;;;;;45681:11:4;;593:18:12;;45704:56:4;;;-1:-1:-1;;45704:56:4;;;;;;;;;;;;;;;;;;;;45681:80;;;45704:56;45681:80;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;45627:134;;;;46155:7;:34;;;;;46166:10;:17;46187:2;46166:23;46155:34;46151:561;;;46250:22;46283:19;46291:10;46283:19;:::i;:::-;46275:28;-1:-1:-1;46275:28:4;46352:19;;;46348:295;;46400:5;46391:14;;46348:295;;;46464:14;46482:1;46464:19;46460:183;;46512:4;46503:13;;46460:183;;;47303:11;;;;;-1:-1:-1;;;47303:11:4;;47318:2;47303:17;;:22;;46600:28;;46460:183;46191:462;46151:561;;;47303:11;;;;;-1:-1:-1;;;47303:11:4;;47318:2;47303:17;;:22;;46682:19;47206:127;49691:1418;49865:16;;49893:76;;-1:-1:-1;;;;;21779:55:12;;;49893:76:4;;;21761:74:12;21851:18;;;21844:34;;;49786:13:4;;;;;;49865:16;;;;21734:18:12;;49893:76:4;;;-1:-1:-1;;49893:76:4;;;;;;;;;;;;;;;;;;;;49865:105;;;49893:76;49865:105;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49811:159;;;;50399:7;:34;;;;;50410:10;:17;50431:2;50410:23;50399:34;50395:708;;;50449:13;50522:17;50541:18;50574:10;50563:42;;;;;;;;;;;;:::i;:::-;50521:84;;;;50670:1;50658:9;:13;:31;;;;;50688:1;50675:10;:14;50658:31;50654:367;;;50721:10;50735:1;50721:15;50720:32;;50747:5;50720:32;;;50740:4;50720:32;50709:43;;50835:8;:26;;;;;50847:9;50860:1;50847:14;50835:26;50834:43;;50872:5;50834:43;;;50865:4;50834:43;50823:54;;50654:367;;;50977:20;;;;:12;:20;;;;;;;;-1:-1:-1;;;;;50977:29:4;;;;;;;;;;;;50976:30;;-1:-1:-1;50654:367:4;50435:596;;;50395:708;;;51063:20;;;;:12;:20;;;;;;;;-1:-1:-1;;;;;51063:29:4;;;;;;;;;;;;51062:30;;-1:-1:-1;50395:708:4;49801:1308;;49691:1418;;;;;:::o;24184:166::-;24250:32;24263:10;24275:6;24250:12;:32::i;:::-;24245:99;;24305:28;;;;;24314:10;24305:28;;;21761:74:12;21851:18;;;21844:34;;;21734:18;;24305:28:4;21587:297:12;14299:1237:4;14380:12;14394:14;14420:17;14489:6;14440:56;;;;;;620:25:12;;608:2;593:18;;474:177;14440:56:4;;;;-1:-1:-1;;14440:56:4;;;;;;;;;;;;;;;;;;;;14563:11;;;;:28;;14440:56;;-1:-1:-1;14506:23:4;;-1:-1:-1;;;;;14563:11:4;;;;:28;;14440:56;;14563:28;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;14539:52:4;;-1:-1:-1;14539:52:4;-1:-1:-1;14539:52:4;14988:34;;;;;14999:10;:17;15020:2;14999:23;14988:34;14984:546;;;15083:22;15119:10;15108:33;;;;;;;;;;;;:::i;:::-;15083:58;;15190:14;15208:1;15190:19;15186:288;;15241:5;15229:17;;15186:288;;;15305:14;15323:1;15305:19;15301:173;;15356:4;15344:16;;15301:173;;;15454:5;15444:15;;15301:173;15024:460;14984:546;;;15514:5;15504:15;;14984:546;14410:1126;;14299:1237;;;;;:::o;20967:352::-;21045:12;21113:13;;;:5;:13;;;;;47303:11;;;;;-1:-1:-1;;;47303:11:4;;47318:2;47303:17;;:22;;21141:32;;:10;:32;;;21137:176;;21189:30;21203:3;21208:10;21189:13;:30::i;:::-;21238:36;;;29064:25:12;;;29132:14;;29125:22;29120:2;29105:18;;29098:50;21238:36:4;;29037:18:12;21238:36:4;;;;;;;-1:-1:-1;21298:4:4;;20967:352;-1:-1:-1;;;20967:352:4:o;54946:2279::-;55038:15;55056:13;;;:5;:13;;;;;55008:18;;55111:16;55062:6;55111:8;:16::i;:::-;55107:154;;;-1:-1:-1;55154:6:4;55107:154;;;55202:48;55218:6;55248:1;55226:19;55238:6;55226:11;:19::i;:::-;:23;;;;:::i;55202:48::-;55191:59;;55107:154;55335:26;55418:43;55437:23;55453:6;55437:15;:23::i;:::-;55418:43;;:18;:43::i;:::-;55501:26;55520:6;55501:18;:26::i;:::-;55574:33;55596:6;55604:2;55574:21;:33::i;:::-;55364:271;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;55335:300;;55646:29;55733:22;55743:3;55748:6;55733:9;:22::i;:::-;:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55851:10;;55832:30;;55851:10;;;;;55832:18;:30::i;:::-;55929:13;;55910:33;;-1:-1:-1;;;55929:13:4;;;;55910:18;:33::i;:::-;55991:28;56010:8;55991:18;:28::i;:::-;56074:35;56096:8;56106:2;56074:21;:35::i;:::-;56187:15;;56165:38;;-1:-1:-1;;;;;56187:15:4;56165:21;:38::i;:::-;56276:10;;;;56254:33;;-1:-1:-1;;;;;56276:10:4;56254:21;:33::i;:::-;56332:15;56343:3;47648:11;;;-1:-1:-1;;;47648:11:4;;47669:7;47648:29;:34;;;47550:140;56332:15;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55678:715;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;55646:747;;56514:680;56751:3;:11;;56837:25;56855:6;56837:17;:25::i;:::-;57005:12;57047:15;56580:574;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;56514:13;:680::i;:::-;56431:777;;;;;;;;:::i;:::-;;;;;;;;;;;;;56404:814;;55028:2197;;;;54946:2279;;;:::o;19596:1079::-;20227:15;20245:10;;;:5;:10;;;;;20265:11;;;:22;20279:8;;20265:11;:22;:::i;:::-;-1:-1:-1;20297:26:4;;-1:-1:-1;;;;;20333:30:4;;;;20297:26;;;-1:-1:-1;;;20297:26:4;20333:30;;;;;;;;;;;;;-1:-1:-1;20373:10:4;;:20;;;;;;;;;;;;20403:12;;;:24;20418:9;;20403:12;:24;:::i;:::-;;20527:8;:44;;20563:7;20527:44;;;20545:7;20527:44;20514:3;:10;;;:57;;;;;;;;;;;;;;;;;;20587:81;20598:3;20603:8;;20613:10;20625:12;20639:7;20648:8;20658:9;;20587:81;;;;;;;;;;;;;;:::i;:::-;;;;;;;;19826:849;19596:1079;;;;;;;;;:::o;58474:446::-;-1:-1:-1;;;;;58645:19:4;;:10;:19;;;;;;;;;;;:27;;;;;;;;58675:1;58645:31;;;;58809:5;:13;;;;;58807:22;;;;;;;;;;;;;;;;;;;;;;58855:58;;24728:25:12;;;24769:18;;;24762:34;58870:10:4;;58855:58;;24701:18:12;58855:58:4;;;;;;;;58474:446;;:::o;24482:202::-;24556:32;24569:10;24581:6;24556:12;:32::i;:::-;24555:33;:71;;;;;24593:33;24607:10;24619:6;24593:13;:33::i;:::-;24592:34;24555:71;24551:127;;;24649:18;;;;;;;;;;;;;;37727:2615;37968:46;37986:13;38001:12;37968:17;:46::i;:::-;37963:77;;38023:17;;;;;;;;;;;;;;37963:77;38086:31;;;38064:19;38086:31;;;:16;:31;;;;;;38187:15;;38183:1048;;38222:19;38292:3;38252:35;38273:13;38252:20;:35::i;:::-;38244:44;;:51;;38222:73;;38318:38;38332:10;38344:11;38318:13;:38::i;:::-;38313:904;;38414:26;;;;;38745:25;;38829:36;;;;;;:70;;;38888:11;38869:15;:30;;38829:70;38825:150;;;38934:18;;;;;;;;;;;;;;38825:150;38358:730;;38313:904;;;39099:50;39121:13;39136:12;39099:21;:50::i;:::-;39094:123;;39180:18;;;;;;;;;;;;;;39094:123;38204:1027;38183:1048;-1:-1:-1;39353:29:4;39379:3;39353:29;;;;39334:16;39410:15;;;:5;:15;;;;;-1:-1:-1;;;;;39440:26:4;;;39436:151;;39482:30;;;;-1:-1:-1;;;;;39482:30:4;;;;;;;39531:45;;;20181:25:12;;;20237:2;20222:18;;20215:83;;;;39531:45:4;;20154:18:12;39531:45:4;;;;;;;39436:151;-1:-1:-1;;;;;39600:21:4;;;39596:126;;39637:10;;;:20;;;;-1:-1:-1;;;;;39637:20:4;;;;;;;;39676:35;;;20181:25:12;;;20237:2;20222:18;;20215:83;;;;39676:35:4;;20154:18:12;39676:35:4;;;;;;;39596:126;39755:8;39785:10;;39781:174;;39824:4;39815:6;:13;39811:41;;;39837:15;;;;;;;;;;;;;;39811:41;39866:11;;;:22;39880:8;;39866:11;:22;:::i;:::-;;39907:37;39925:8;39935;;39907:37;;;;;;;;:::i;:::-;;;;;;;;39781:174;-1:-1:-1;39980:9:4;40011:10;;40007:178;;40050:4;40041:6;:13;40037:41;;;40063:15;;;;;;;;;;;;;;40037:41;40092:12;;;:24;40107:9;;40092:12;:24;:::i;:::-;;40135:39;40154:8;40164:9;;40135:39;;;;;;;;:::i;:::-;;;;;;;;40007:178;40233:31;;;;;;;:16;:31;;;;;;;;;:46;;;40294:41;;24450:42:12;;;24508:18;;24501:34;;;40294:41:4;;24423:18:12;40294:41:4;;;;;;;37953:2389;;;37727:2615;;;;;;;;:::o;21910:1001::-;-1:-1:-1;;;;;3954:17:0;;22042:12:4;3954:17:0;;;;;;;;;;;:21;;;;;;;;;-1:-1:-1;22135:207:4;;22249:9;22248:10;:24;;;;22263:9;22262:10;22248:24;22244:88;;;22292:25;22301:7;22310:6;22292:8;:25::i;:::-;22710:20;;;;:12;:20;;;;;;;;-1:-1:-1;;;;;22710:29:4;;;;;;;;;;;;22697:42;;;;;;22693:212;;-1:-1:-1;22755:20:4;;;;:12;:20;;;;;;;;-1:-1:-1;;;;;22755:29:4;;;;;;;;;;;;:42;;22787:10;;22755:42;;;;;;;;;22845:49;;38917:25:12;;;38958:18;;;38951:83;;;;39070:22;;39050:18;;;39043:50;22845:49:4;;-1:-1:-1;;22845:49:4;;;;;;38905:2:12;22845:49:4;;;22693:212;21910:1001;;;;;;:::o;59185:390::-;-1:-1:-1;;;;;59372:19:4;;59402:1;59372:19;;;;;;;;;;;:27;;;;;;;;:31;;;59464:5;:13;;;;;59462:22;;;;;;;;;;;;;;-1:-1:-1;;59462:22:4;;;;;;;;59510:58;;24728:25:12;;;-1:-1:-1;24769:18:12;;;24762:34;;;;59402:1:4;;59372:19;59525:10;;59510:58;;24701:18:12;59510:58:4;24546:256:12;23140:210:4;23218:7;23214:130;;;-1:-1:-1;23241:11:4;;:30;;-1:-1:-1;;;;;23241:30:4;;23263:7;-1:-1:-1;;;23241:30:4;;;;;;;;;;;;;23140:210::o;23214:130::-;-1:-1:-1;23302:11:4;;:31;;-1:-1:-1;;;;;23302:31:4;;-1:-1:-1;;;23302:31:4;;;;;;;;;;;;23140:210::o;1231:1699:3:-;1287:17;1715:4;1708;1702:11;1698:22;1805:1;1799:4;1792:15;1878:4;1875:1;1871:12;1864:19;;;1958:1;1953:3;1946:14;2059:3;2293:5;2275:419;2340:1;2335:3;2331:11;2324:18;;2508:2;2502:4;2498:13;2494:2;2490:22;2485:3;2477:36;2600:2;2590:13;;2655:25;2275:419;2655:25;-1:-1:-1;2722:13:3;;;-1:-1:-1;;2835:14:3;;;2895:19;;;2835:14;1231:1699;-1:-1:-1;1231:1699:3:o;3476:2127::-;3622:4;3616:11;;-1:-1:-1;;3987:4:3;3975:1;3971:14;;;3967:25;3963:41;;3952:53;;;4054:15;;;;-1:-1:-1;4133:12:3;;4208:14;;;4394:34;4388:4;4381:48;4133:12;4455:5;4672:337;4774:2;4764:13;;4758:20;4709:11;;;;-1:-1:-1;;4745:11:3;4737:42;4833:2;4826:4;4823:1;4819:12;4815:21;4809:28;4804:3;4796:42;-1:-1:-1;;4902:14:3;;;;4867:1;4863:12;4968:27;4672:337;4968:27;5026:4;5023:223;;;5139:10;5133:4;5126:24;5227:4;5221;5214:18;5023:223;-1:-1:-1;5460:6:3;-1:-1:-1;;5421:14:3;;5448:19;5325:13;;;5340:1;5321:21;5541:11;;;;5565:22;;;5541:11;3476:2127;-1:-1:-1;;3476:2127:3:o;7767:1408::-;7897:4;7891:11;;7826:17;8122:16;8188:17;;;;8289:34;8283:4;8276:48;8352:2;8584:5;8566:356;8687:2;8677:13;;8671:20;8622:11;;;;-1:-1:-1;;8658:11:3;8650:42;8746:2;8739:4;8736:1;8732:12;8728:21;8722:28;8717:3;8709:42;-1:-1:-1;;8815:14:3;;;;8780:1;8776:12;8881:27;8566:356;8881:27;-1:-1:-1;;9039:6:3;-1:-1:-1;;9002:12:3;;9027:19;9156:2;9120:11;;;;9144:15;;;9120:11;7767:1408;-1:-1:-1;7767:1408:3:o;3669:132:2:-;3727:20;3768:26;3775:4;3781:5;3788;688:20;767:4;761:11;789:10;786:2732;;;989:1;985;973:10;969:18;965:26;962:1;958:34;1100:4;1094:11;1084:21;;1472:34;1466:4;1459:48;1599:6;1588:8;1581:16;1577:29;1541:34;1537:70;1531:4;1524:84;1714:4;1706:6;1702:17;1756:13;1751:3;1747:23;1881:687;1933:1;1927:4;1923:12;1915:20;;1995:4;1989:11;2145:4;2137:5;2133:2;2129:14;2125:25;2119:32;2110:3;2098:54;2220:4;2212:5;2208:2;2204:14;2200:25;2194:32;2190:1;2185:3;2181:11;2173:54;2295:4;2287:5;2284:1;2279:14;2275:25;2269:32;2265:1;2260:3;2256:11;2248:54;2370:4;2362:5;2350:25;2344:32;2340:1;2335:3;2331:11;2323:54;;2435:1;2430:3;2426:11;2419:18;;2535:3;2530;2527:12;1881:687;2517:33;2611:1;2595:18;;2638:9;2664:409;;;;3238:1;3235;3232:8;3227:1;3220:9;3213:17;3209:32;3194:13;3190:52;3182:6;3175:68;2631:630;;2664:409;2818:4;2812:1;2805:9;2798:17;2793:3;2789:27;2781:42;2912:4;2906:1;2903;2900:8;2897:1;2893:16;2888:3;2884:26;2876:41;3041:13;3033:6;3026:29;2631:630;-1:-1:-1;;3499:2:2;3481:12;-1:-1:-1;;3477:26:2;3471:4;3464:40;-1:-1:-1;;786:2732:2;;599:2935;;;;;:::o;14:196:12:-;82:20;;-1:-1:-1;;;;;131:54:12;;121:65;;111:93;;200:1;197;190:12;111:93;14:196;;;:::o;215:254::-;283:6;291;344:2;332:9;323:7;319:23;315:32;312:52;;;360:1;357;350:12;312:52;383:29;402:9;383:29;:::i;:::-;373:39;459:2;444:18;;;;431:32;;-1:-1:-1;;;215:254:12:o;656:::-;724:6;732;785:2;773:9;764:7;760:23;756:32;753:52;;;801:1;798;791:12;753:52;837:9;824:23;814:33;;866:38;900:2;889:9;885:18;866:38;:::i;:::-;856:48;;656:254;;;;;:::o;915:332::-;973:6;1026:2;1014:9;1005:7;1001:23;997:32;994:52;;;1042:1;1039;1032:12;994:52;1081:9;1068:23;1131:66;1124:5;1120:78;1113:5;1110:89;1100:117;;1213:1;1210;1203:12;1444:250;1529:1;1539:113;1553:6;1550:1;1547:13;1539:113;;;1629:11;;;1623:18;1610:11;;;1603:39;1575:2;1568:10;1539:113;;;-1:-1:-1;;1686:1:12;1668:16;;1661:27;1444:250::o;1699:330::-;1741:3;1779:5;1773:12;1806:6;1801:3;1794:19;1822:76;1891:6;1884:4;1879:3;1875:14;1868:4;1861:5;1857:16;1822:76;:::i;:::-;1943:2;1931:15;-1:-1:-1;;1927:88:12;1918:98;;;;2018:4;1914:109;;1699:330;-1:-1:-1;;1699:330:12:o;2034:220::-;2183:2;2172:9;2165:21;2146:4;2203:45;2244:2;2233:9;2229:18;2221:6;2203:45;:::i;2259:163::-;2326:20;;2386:10;2375:22;;2365:33;;2355:61;;2412:1;2409;2402:12;2427:184;2485:6;2538:2;2526:9;2517:7;2513:23;2509:32;2506:52;;;2554:1;2551;2544:12;2506:52;2577:28;2595:9;2577:28;:::i;2616:180::-;2675:6;2728:2;2716:9;2707:7;2703:23;2699:32;2696:52;;;2744:1;2741;2734:12;2696:52;-1:-1:-1;2767:23:12;;2616:180;-1:-1:-1;2616:180:12:o;2801:348::-;2853:8;2863:6;2917:3;2910:4;2902:6;2898:17;2894:27;2884:55;;2935:1;2932;2925:12;2884:55;-1:-1:-1;2958:20:12;;3001:18;2990:30;;2987:50;;;3033:1;3030;3023:12;2987:50;3070:4;3062:6;3058:17;3046:29;;3122:3;3115:4;3106:6;3098;3094:19;3090:30;3087:39;3084:59;;;3139:1;3136;3129:12;3084:59;2801:348;;;;;:::o;3154:795::-;3255:6;3263;3271;3279;3287;3340:2;3328:9;3319:7;3315:23;3311:32;3308:52;;;3356:1;3353;3346:12;3308:52;3379:29;3398:9;3379:29;:::i;:::-;3369:39;;3459:2;3448:9;3444:18;3431:32;3482:18;3523:2;3515:6;3512:14;3509:34;;;3539:1;3536;3529:12;3509:34;3578:59;3629:7;3620:6;3609:9;3605:22;3578:59;:::i;:::-;3656:8;;-1:-1:-1;3552:85:12;-1:-1:-1;3744:2:12;3729:18;;3716:32;;-1:-1:-1;3760:16:12;;;3757:36;;;3789:1;3786;3779:12;3757:36;;3828:61;3881:7;3870:8;3859:9;3855:24;3828:61;:::i;:::-;3154:795;;;;-1:-1:-1;3154:795:12;;-1:-1:-1;3908:8:12;;3802:87;3154:795;-1:-1:-1;;;3154:795:12:o;3954:252::-;4021:6;4029;4082:2;4070:9;4061:7;4057:23;4053:32;4050:52;;;4098:1;4095;4088:12;4050:52;4134:9;4121:23;4111:33;;4163:37;4196:2;4185:9;4181:18;4163:37;:::i;4211:367::-;4274:8;4284:6;4338:3;4331:4;4323:6;4319:17;4315:27;4305:55;;4356:1;4353;4346:12;4305:55;-1:-1:-1;4379:20:12;;4422:18;4411:30;;4408:50;;;4454:1;4451;4444:12;4408:50;4491:4;4483:6;4479:17;4467:29;;4551:3;4544:4;4534:6;4531:1;4527:14;4519:6;4515:27;4511:38;4508:47;4505:67;;;4568:1;4565;4558:12;4583:1211;4743:6;4751;4759;4767;4775;4783;4791;4799;4852:3;4840:9;4831:7;4827:23;4823:33;4820:53;;;4869:1;4866;4859:12;4820:53;4892:29;4911:9;4892:29;:::i;:::-;4882:39;;4940:38;4974:2;4963:9;4959:18;4940:38;:::i;:::-;4930:48;;5029:2;5018:9;5014:18;5001:32;5052:18;5093:2;5085:6;5082:14;5079:34;;;5109:1;5106;5099:12;5079:34;5148:70;5210:7;5201:6;5190:9;5186:22;5148:70;:::i;:::-;5237:8;;-1:-1:-1;5122:96:12;-1:-1:-1;5325:2:12;5310:18;;5297:32;;-1:-1:-1;5341:16:12;;;5338:36;;;5370:1;5367;5360:12;5338:36;5409:72;5473:7;5462:8;5451:9;5447:24;5409:72;:::i;:::-;5500:8;;-1:-1:-1;5383:98:12;-1:-1:-1;5588:3:12;5573:19;;5560:33;;-1:-1:-1;5605:16:12;;;5602:36;;;5634:1;5631;5624:12;5602:36;;5673:61;5726:7;5715:8;5704:9;5700:24;5673:61;:::i;:::-;4583:1211;;;;-1:-1:-1;4583:1211:12;;-1:-1:-1;4583:1211:12;;;;;;5753:8;-1:-1:-1;;;4583:1211:12:o;5799:1012::-;5926:6;5934;5942;5950;5958;5966;5974;5982;6035:3;6023:9;6014:7;6010:23;6006:33;6003:53;;;6052:1;6049;6042:12;6003:53;6075:28;6093:9;6075:28;:::i;:::-;6065:38;;6150:2;6139:9;6135:18;6122:32;6112:42;;6173:38;6207:2;6196:9;6192:18;6173:38;:::i;:::-;6163:48;;6230:38;6264:2;6253:9;6249:18;6230:38;:::i;:::-;6220:48;;6319:3;6308:9;6304:19;6291:33;6343:18;6384:2;6376:6;6373:14;6370:34;;;6400:1;6397;6390:12;6370:34;6439:59;6490:7;6481:6;6470:9;6466:22;6439:59;:::i;:::-;6517:8;;-1:-1:-1;6413:85:12;-1:-1:-1;6605:3:12;6590:19;;6577:33;;-1:-1:-1;6622:16:12;;;6619:36;;;6651:1;6648;6641:12;7013:773;7135:6;7143;7151;7159;7212:2;7200:9;7191:7;7187:23;7183:32;7180:52;;;7228:1;7225;7218:12;7180:52;7268:9;7255:23;7297:18;7338:2;7330:6;7327:14;7324:34;;;7354:1;7351;7344:12;7324:34;7393:70;7455:7;7446:6;7435:9;7431:22;7393:70;:::i;:::-;7482:8;;-1:-1:-1;7367:96:12;-1:-1:-1;7570:2:12;7555:18;;7542:32;;-1:-1:-1;7586:16:12;;;7583:36;;;7615:1;7612;7605:12;7583:36;;7654:72;7718:7;7707:8;7696:9;7692:24;7654:72;:::i;:::-;7013:773;;;;-1:-1:-1;7745:8:12;-1:-1:-1;;;;7013:773:12:o;7791:632::-;7962:2;8014:21;;;8084:13;;7987:18;;;8106:22;;;7933:4;;7962:2;8185:15;;;;8159:2;8144:18;;;7933:4;8228:169;8242:6;8239:1;8236:13;8228:169;;;8303:13;;8291:26;;8372:15;;;;8337:12;;;;8264:1;8257:9;8228:169;;;-1:-1:-1;8414:3:12;;7791:632;-1:-1:-1;;;;;;7791:632:12:o;9437:184::-;9489:77;9486:1;9479:88;9586:4;9583:1;9576:15;9610:4;9607:1;9600:15;9626:967;9680:5;9733:3;9726:4;9718:6;9714:17;9710:27;9700:55;;9751:1;9748;9741:12;9700:55;9787:6;9774:20;9813:4;9836:18;9873:2;9869;9866:10;9863:36;;;9879:18;;:::i;:::-;9925:2;9922:1;9918:10;9957:2;9951:9;-1:-1:-1;;10011:2:12;10007;10003:11;9999:84;9991:6;9987:97;10134:6;10122:10;10119:22;10114:2;10102:10;10099:18;10096:46;10093:72;;;10145:18;;:::i;:::-;10181:2;10174:22;10231:18;;;10307:15;;;10303:24;;;10265:15;;;;-1:-1:-1;10339:15:12;;;10336:35;;;10367:1;10364;10357:12;10336:35;10403:2;10395:6;10391:15;10380:26;;10415:148;10431:6;10426:3;10423:15;10415:148;;;10497:23;10516:3;10497:23;:::i;:::-;10485:36;;10541:12;;;;10448;;;;10415:148;;10598:2214;10916:6;10924;10932;10940;10948;10956;10964;10972;10980;10988;10996:7;11005;11059:3;11047:9;11038:7;11034:23;11030:33;11027:53;;;11076:1;11073;11066:12;11027:53;11120:18;11108:9;11095:23;11092:47;11089:67;;;11152:1;11149;11142:12;11089:67;11191:87;11270:7;11257:9;11244:23;11233:9;11229:39;11191:87;:::i;:::-;11297:8;;-1:-1:-1;11324:8:12;-1:-1:-1;11381:18:12;11375:2;11360:18;;11347:32;11344:56;11341:76;;;11413:1;11410;11403:12;11341:76;11452:96;11540:7;11533:2;11522:9;11518:18;11505:32;11494:9;11490:48;11452:96;:::i;:::-;11567:8;;-1:-1:-1;11594:8:12;-1:-1:-1;11651:18:12;11645:2;11630:18;;11617:32;11614:56;11611:76;;;11683:1;11680;11673:12;11611:76;11722:96;11810:7;11803:2;11792:9;11788:18;11775:32;11764:9;11760:48;11722:96;:::i;:::-;11837:8;;-1:-1:-1;11864:8:12;-1:-1:-1;11921:18:12;11915:2;11900:18;;11887:32;11884:56;11881:76;;;11953:1;11950;11943:12;11881:76;11976:87;12055:7;12048:2;12037:9;12033:18;12020:32;12009:9;12005:48;11976:87;:::i;:::-;11966:97;;12113:18;12106:3;12095:9;12091:19;12078:33;12075:57;12072:77;;;12145:1;12142;12135:12;12072:77;12168:88;12248:7;12240:3;12229:9;12225:19;12212:33;12201:9;12197:49;12168:88;:::i;:::-;12158:98;;12306:18;12299:3;12288:9;12284:19;12271:33;12268:57;12265:77;;;12338:1;12335;12328:12;12265:77;12377:97;12466:7;12458:3;12447:9;12443:19;12430:33;12419:9;12415:49;12377:97;:::i;:::-;12493:8;;-1:-1:-1;12520:8:12;-1:-1:-1;12578:18:12;12571:3;12556:19;;12543:33;12540:57;12537:77;;;12610:1;12607;12600:12;12537:77;12651:97;12740:7;12732:3;12721:9;12717:19;12704:33;12693:9;12689:49;12651:97;:::i;:::-;12768:9;12757:20;;12797:9;12786:20;;;;10598:2214;;;;;;;;;;;;;;:::o;12817:258::-;12884:6;12892;12945:2;12933:9;12924:7;12920:23;12916:32;12913:52;;;12961:1;12958;12951:12;12913:52;12984:28;13002:9;12984:28;:::i;:::-;12974:38;;13031;13065:2;13054:9;13050:18;13031:38;:::i;13080:252::-;13147:6;13155;13208:2;13196:9;13187:7;13183:23;13179:32;13176:52;;;13224:1;13221;13214:12;13176:52;13247:28;13265:9;13247:28;:::i;13337:160::-;13402:20;;13458:13;;13451:21;13441:32;;13431:60;;13487:1;13484;13477:12;13502:254;13567:6;13575;13628:2;13616:9;13607:7;13603:23;13599:32;13596:52;;;13644:1;13641;13634:12;13596:52;13667:29;13686:9;13667:29;:::i;:::-;13657:39;;13715:35;13746:2;13735:9;13731:18;13715:35;:::i;13761:328::-;13838:6;13846;13854;13907:2;13895:9;13886:7;13882:23;13878:32;13875:52;;;13923:1;13920;13913:12;13875:52;13959:9;13946:23;13936:33;;13988:38;14022:2;14011:9;14007:18;13988:38;:::i;:::-;13978:48;;14045:38;14079:2;14068:9;14064:18;14045:38;:::i;:::-;14035:48;;13761:328;;;;;:::o;14094:448::-;14191:6;14199;14252:2;14240:9;14231:7;14227:23;14223:32;14220:52;;;14268:1;14265;14258:12;14220:52;14308:9;14295:23;14341:18;14333:6;14330:30;14327:50;;;14373:1;14370;14363:12;14327:50;14412:70;14474:7;14465:6;14454:9;14450:22;14412:70;:::i;:::-;14501:8;;14386:96;;-1:-1:-1;14094:448:12;-1:-1:-1;;;;14094:448:12:o;14547:860::-;14707:4;14736:2;14776;14765:9;14761:18;14806:2;14795:9;14788:21;14829:6;14864;14858:13;14895:6;14887;14880:22;14933:2;14922:9;14918:18;14911:25;;14995:2;14985:6;14982:1;14978:14;14967:9;14963:30;14959:39;14945:53;;15033:2;15025:6;15021:15;15054:1;15064:314;15078:6;15075:1;15072:13;15064:314;;;15167:66;15155:9;15147:6;15143:22;15139:95;15134:3;15127:108;15258:40;15291:6;15282;15276:13;15258:40;:::i;:::-;15248:50;-1:-1:-1;15356:12:12;;;;15321:15;;;;15100:1;15093:9;15064:314;;;-1:-1:-1;15395:6:12;;14547:860;-1:-1:-1;;;;;;;14547:860:12:o;15412:391::-;15492:6;15500;15508;15516;15569:3;15557:9;15548:7;15544:23;15540:33;15537:53;;;15586:1;15583;15576:12;15537:53;15622:9;15609:23;15599:33;;15651:38;15685:2;15674:9;15670:18;15651:38;:::i;:::-;15641:48;;15708:35;15739:2;15728:9;15724:18;15708:35;:::i;:::-;15698:45;;15762:35;15793:2;15782:9;15778:18;15762:35;:::i;:::-;15752:45;;15412:391;;;;;;;:::o;15808:1081::-;15941:6;15949;15957;15965;15973;15981;15989;15997;16005;16058:3;16046:9;16037:7;16033:23;16029:33;16026:53;;;16075:1;16072;16065:12;16026:53;16111:9;16098:23;16088:33;;16172:2;16161:9;16157:18;16144:32;16195:18;16236:2;16228:6;16225:14;16222:34;;;16252:1;16249;16242:12;16222:34;16291:59;16342:7;16333:6;16322:9;16318:22;16291:59;:::i;:::-;16369:8;;-1:-1:-1;16265:85:12;-1:-1:-1;16265:85:12;;-1:-1:-1;16423:37:12;16456:2;16441:18;;16423:37;:::i;:::-;16413:47;;16479:38;16513:2;16502:9;16498:18;16479:38;:::i;:::-;16469:48;;16536:39;16570:3;16559:9;16555:19;16536:39;:::i;:::-;16526:49;;16594:36;16625:3;16614:9;16610:19;16594:36;:::i;:::-;16584:46;;16683:3;16672:9;16668:19;16655:33;16639:49;;16713:2;16703:8;16700:16;16697:36;;;16729:1;16726;16719:12;16697:36;;16768:61;16821:7;16810:8;16799:9;16795:24;16768:61;:::i;:::-;16742:87;;16848:8;16838:18;;;16875:8;16865:18;;;15808:1081;;;;;;;;;;;:::o;16894:248::-;16959:6;16967;17020:2;17008:9;16999:7;16995:23;16991:32;16988:52;;;17036:1;17033;17026:12;16988:52;17072:9;17059:23;17049:33;;17101:35;17132:2;17121:9;17117:18;17101:35;:::i;17147:1060::-;17485:4;17514:3;17544:2;17533:9;17526:21;17570:45;17611:2;17600:9;17596:18;17588:6;17570:45;:::i;:::-;17634:10;17680:15;;;17675:2;17660:18;;17653:43;17732:15;;17727:2;17712:18;;17705:43;-1:-1:-1;;;;;17845:15:12;;;17840:2;17825:18;;17818:43;17898:15;;17892:3;17877:19;;17870:44;17951:22;;;17945:3;17930:19;;17923:51;17556:59;-1:-1:-1;17991:33:12;17556:59;18009:6;17991:33;:::i;:::-;18073:6;18061:19;;;;18055:3;18040:19;;18033:48;-1:-1:-1;;18125:14:12;;18118:22;18112:3;18097:19;;18090:51;18185:14;18178:22;18172:3;18157:19;;;18150:51;17983:41;17147:1060;-1:-1:-1;;;;;;17147:1060:12:o;18212:479::-;18292:6;18300;18308;18361:2;18349:9;18340:7;18336:23;18332:32;18329:52;;;18377:1;18374;18367:12;18329:52;18413:9;18400:23;18390:33;;18474:2;18463:9;18459:18;18446:32;18501:18;18493:6;18490:30;18487:50;;;18533:1;18530;18523:12;18487:50;18572:59;18623:7;18614:6;18603:9;18599:22;18572:59;:::i;:::-;18212:479;;18650:8;;-1:-1:-1;18546:85:12;;-1:-1:-1;;;;18212:479:12:o;18696:260::-;18764:6;18772;18825:2;18813:9;18804:7;18800:23;18796:32;18793:52;;;18841:1;18838;18831:12;18793:52;18864:29;18883:9;18864:29;:::i;18961:696::-;19067:6;19075;19083;19091;19099;19107;19160:3;19148:9;19139:7;19135:23;19131:33;19128:53;;;19177:1;19174;19167:12;19128:53;19200:29;19219:9;19200:29;:::i;:::-;19190:39;;19248:38;19282:2;19271:9;19267:18;19248:38;:::i;:::-;19238:48;;19333:2;19322:9;19318:18;19305:32;19295:42;;19384:2;19373:9;19369:18;19356:32;19346:42;;19439:3;19428:9;19424:19;19411:33;19467:18;19459:6;19456:30;19453:50;;;19499:1;19496;19489:12;19453:50;19538:59;19589:7;19580:6;19569:9;19565:22;19538:59;:::i;:::-;18961:696;;;;-1:-1:-1;18961:696:12;;-1:-1:-1;18961:696:12;;19616:8;;18961:696;-1:-1:-1;;;18961:696:12:o;19662:340::-;19729:6;19737;19790:2;19778:9;19769:7;19765:23;19761:32;19758:52;;;19806:1;19803;19796:12;19758:52;19842:9;19829:23;19819:33;;19902:2;19891:9;19887:18;19874:32;19946:6;19939:5;19935:18;19928:5;19925:29;19915:57;;19968:1;19965;19958:12;19915:57;19991:5;19981:15;;;19662:340;;;;;:::o;20309:437::-;20388:1;20384:12;;;;20431;;;20452:61;;20506:4;20498:6;20494:17;20484:27;;20452:61;20559:2;20551:6;20548:14;20528:18;20525:38;20522:218;;20596:77;20593:1;20586:88;20697:4;20694:1;20687:15;20725:4;20722:1;20715:15;20751:184;20803:77;20800:1;20793:88;20900:4;20897:1;20890:15;20924:4;20921:1;20914:15;20940:168;21007:6;21033:10;;;21045;;;21029:27;;21068:11;;;21065:37;;;21082:18;;:::i;21113:201::-;21151:3;21179:10;21224:2;21217:5;21213:14;21251:2;21242:7;21239:15;21236:41;;21257:18;;:::i;:::-;21306:1;21293:15;;21113:201;-1:-1:-1;;;21113:201:12:o;21889:197::-;21930:3;21968:5;21962:12;21983:65;22041:6;22036:3;22029:4;22022:5;22018:16;21983:65;:::i;:::-;22064:16;;;;;21889:197;-1:-1:-1;;21889:197:12:o;22091:287::-;22220:3;22258:6;22252:13;22274:66;22333:6;22328:3;22321:4;22313:6;22309:17;22274:66;:::i;:::-;22356:16;;;;;22091:287;-1:-1:-1;;22091:287:12:o;22383:245::-;22462:6;22470;22523:2;22511:9;22502:7;22498:23;22494:32;22491:52;;;22539:1;22536;22529:12;22491:52;-1:-1:-1;;22562:16:12;;22618:2;22603:18;;;22597:25;22562:16;;22597:25;;-1:-1:-1;22383:245:12:o;22633:184::-;22685:77;22682:1;22675:88;22782:4;22779:1;22772:15;22806:4;22803:1;22796:15;22822:186;22881:6;22934:2;22922:9;22913:7;22909:23;22905:32;22902:52;;;22950:1;22947;22940:12;22902:52;22973:29;22992:9;22973:29;:::i;23013:175::-;23081:10;23124;;;23112;;;23108:27;;23147:12;;;23144:38;;;23162:18;;:::i;23193:128::-;23260:9;;;23281:11;;;23278:37;;;23295:18;;:::i;23326:168::-;23399:9;;;23430;;23447:15;;;23441:22;;23427:37;23417:71;;23468:18;;:::i;23499:581::-;23577:4;23583:6;23643:11;23630:25;23733:66;23722:8;23706:14;23702:29;23698:102;23678:18;23674:127;23664:155;;23815:1;23812;23805:12;23664:155;23842:33;;23894:20;;;-1:-1:-1;23937:18:12;23926:30;;23923:50;;;23969:1;23966;23959:12;23923:50;24002:4;23990:17;;-1:-1:-1;24033:14:12;24029:27;;;24019:38;;24016:58;;;24070:1;24067;24060:12;24085:180;24141:6;24194:2;24182:9;24173:7;24169:23;24165:32;24162:52;;;24210:1;24207;24200:12;24162:52;24233:26;24249:9;24233:26;:::i;24807:197::-;24845:3;24873:6;24914:2;24907:5;24903:14;24941:2;24932:7;24929:15;24926:41;;24947:18;;:::i;25403:545::-;25505:2;25500:3;25497:11;25494:448;;;25541:1;25566:5;25562:2;25555:17;25611:4;25607:2;25597:19;25681:2;25669:10;25665:19;25662:1;25658:27;25652:4;25648:38;25717:4;25705:10;25702:20;25699:47;;;-1:-1:-1;25740:4:12;25699:47;25795:2;25790:3;25786:12;25783:1;25779:20;25773:4;25769:31;25759:41;;25850:82;25868:2;25861:5;25858:13;25850:82;;;25913:17;;;25894:1;25883:13;25850:82;;;25854:3;;;25403:545;;;:::o;26184:1325::-;26308:18;26303:3;26300:27;26297:53;;;26330:18;;:::i;:::-;26359:94;26449:3;26409:38;26441:4;26435:11;26409:38;:::i;:::-;26403:4;26359:94;:::i;:::-;26479:1;26504:2;26499:3;26496:11;26521:1;26516:735;;;;27295:1;27312:3;27309:93;;;-1:-1:-1;27368:19:12;;;27355:33;27309:93;-1:-1:-1;;26081:1:12;26077:11;;;26073:84;26069:89;26059:100;26165:1;26161:11;;;26056:117;27415:78;;26489:1014;;26516:735;25350:1;25343:14;;;25387:4;25374:18;;-1:-1:-1;;26552:76:12;;;26712:9;26734:229;26748:7;26745:1;26742:14;26734:229;;;26837:19;;;26824:33;26809:49;;26944:4;26929:20;;;;26897:1;26885:14;;;;26764:12;26734:229;;;26738:3;26991;26982:7;26979:16;26976:219;;;-1:-1:-1;;27105:3:12;27099;27096:1;27092:11;27088:21;27084:94;27080:99;27067:9;27062:3;27058:19;27045:33;27041:139;27033:6;27026:155;26976:219;;;27238:1;27232:3;27229:1;27225:11;27221:19;27215:4;27208:33;26489:1014;;;26184:1325;;;:::o;27514:326::-;27603:6;27598:3;27591:19;27655:6;27648:5;27641:4;27636:3;27632:14;27619:43;;27707:1;27700:4;27691:6;27686:3;27682:16;27678:27;27671:38;27573:3;27829:4;-1:-1:-1;;27754:2:12;27746:6;27742:15;27738:88;27733:3;27729:98;27725:109;27718:116;;27514:326;;;;:::o;27845:318::-;28032:6;28021:9;28014:25;28075:2;28070;28059:9;28055:18;28048:30;27995:4;28095:62;28153:2;28142:9;28138:18;28130:6;28122;28095:62;:::i;28168:172::-;28235:10;28265;;;28277;;;28261:27;;28300:11;;;28297:37;;;28314:18;;:::i;28345:357::-;28463:12;;28510:4;28499:16;;;28493:23;;28463:12;28528:16;;28525:171;;;-1:-1:-1;;28602:4:12;28598:17;;;;28595:1;28591:25;28587:98;28576:110;;28345:357;-1:-1:-1;28345:357:12:o;28707:184::-;28777:6;28830:2;28818:9;28809:7;28805:23;28801:32;28798:52;;;28846:1;28843;28836:12;28798:52;-1:-1:-1;28869:16:12;;28707:184;-1:-1:-1;28707:184:12:o;29302:1481::-;29922:66;29917:3;29910:79;29892:3;30018:6;30012:13;30034:75;30102:6;30097:2;30092:3;30088:12;30081:4;30073:6;30069:17;30034:75;:::i;:::-;30173:66;30168:2;30128:16;;;30160:11;;;30153:87;30265:13;;30287:76;30265:13;30349:2;30341:11;;30334:4;30322:17;;30287:76;:::i;:::-;30428:66;30423:2;30382:17;;;;30415:11;;;30408:87;30520:13;;30542:76;30520:13;30604:2;30596:11;;30589:4;30577:17;;30542:76;:::i;:::-;30683:66;30678:2;30637:17;;;;30670:11;;;30663:87;30774:2;30766:11;;29302:1481;-1:-1:-1;;;;;29302:1481:12:o;31824:2517::-;33139:66;33134:3;33127:79;33109:3;33235:6;33229:13;33251:75;33319:6;33314:2;33309:3;33305:12;33298:4;33290:6;33286:17;33251:75;:::i;:::-;33390:66;33385:2;33345:16;;;33377:11;;;33370:87;33482:13;;33504:76;33482:13;33566:2;33558:11;;33551:4;33539:17;;33504:76;:::i;:::-;33599:17;33625:42;33663:2;33655:11;;30858:66;30846:79;;30788:143;33625:42;33689:37;33722:2;33718;33714:11;33706:6;33689:37;:::i;:::-;31006:66;30994:79;;33676:50;-1:-1:-1;33793:40:12;33829:2;33822:5;33818:14;33810:6;33793:40;:::i;:::-;31154:66;31142:79;;33780:53;-1:-1:-1;33900:40:12;33936:2;33929:5;33925:14;33917:6;33900:40;:::i;:::-;31302:66;31290:79;;33887:53;-1:-1:-1;34007:40:12;34043:2;34036:5;34032:14;34024:6;34007:40;:::i;:::-;31450:66;31438:79;;33994:53;-1:-1:-1;34114:40:12;34150:2;34143:5;34139:14;34131:6;34114:40;:::i;:::-;31598:66;31586:79;;34101:53;-1:-1:-1;34221:40:12;34257:2;34250:5;34246:14;34238:6;34221:40;:::i;:::-;31746:66;31734:79;;34333:1;34322:13;;;-1:-1:-1;;;;;;;;;;;31824:2517:12:o;34788:2556::-;35904:66;35899:3;35892:79;36001:5;35996:2;35991:3;35987:12;35980:27;36037:66;36032:2;36027:3;36023:12;36016:88;35874:3;36123:2;36145:1;36178:6;36172:13;36208:36;36234:9;36208:36;:::i;:::-;36263:1;36280:18;;;36307:209;;;;36530:1;36525:347;;;;36273:599;;36307:209;36364:66;36353:9;36349:82;36344:2;36339:3;36335:12;36328:104;36503:2;36491:6;36484:14;36477:22;36469:6;36465:35;36460:3;36456:45;36452:54;36445:61;;36307:209;;36525:347;36556:6;36553:1;36546:17;36604:2;36601:1;36591:16;36629:1;36643:174;36657:6;36654:1;36651:13;36643:174;;;36744:14;;36726:11;;;36722:20;;36715:44;36787:16;;;;36672:10;;36643:174;;;36647:3;;36859:2;36850:6;36845:3;36841:16;36837:25;36830:32;;36273:599;-1:-1:-1;34416:66:12;34404:79;;36937:38;36971:2;36966:3;36962:12;36954:6;36937:38;:::i;:::-;29224:66;29212:79;;36924:51;-1:-1:-1;34564:66:12;37065:1;37054:13;;34552:79;34704:3;37118:2;37107:14;;34692:16;37144:66;37169:40;37205:2;37198:5;37194:14;37186:6;37169:40;:::i;:::-;37161:6;37144:66;:::i;:::-;34777:3;34765:16;;;37294:14;;;34765:16;;;;37336:1;37325:13;;34788:2556;-1:-1:-1;;;;;;;;;;34788:2556:12:o;37349:461::-;37611:31;37606:3;37599:44;37581:3;37672:6;37666:13;37688:75;37756:6;37751:2;37746:3;37742:12;37735:4;37727:6;37723:17;37688:75;:::i;:::-;37783:16;;;;37801:2;37779:25;;37349:461;-1:-1:-1;;37349:461:12:o;37815:901::-;38164:6;38153:9;38146:25;38207:3;38202:2;38191:9;38187:18;38180:31;38127:4;38234:63;38292:3;38281:9;38277:19;38269:6;38261;38234:63;:::i;:::-;38345:10;38333:23;;38328:2;38313:18;;38306:51;-1:-1:-1;;;;;38454:15:12;;;38449:2;38434:18;;38427:43;38507:15;;38501:3;38486:19;;38479:44;38567:14;;38560:22;38554:3;38539:19;;38532:51;38620:22;;;38614:3;38599:19;;38592:51;38660:50;38624:6;38695;38687;38660:50;:::i;:::-;38652:58;37815:901;-1:-1:-1;;;;;;;;;;;;37815:901:12:o
Swarm Source
ipfs://3620611cb556a5437bbe468fe951b4a09dced80631c01465ad1b2a933f77eb6e
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.