Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
PassRegistry
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: None pragma solidity >=0.8.4; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "./interfaces/IDoidRegistry.sol"; //import "hardhat/console.sol"; contract PassRegistryStorage { struct PassInfo { uint passId; bytes32 passClass; bytes32 passHash; } mapping(address => uint) userInvitedNum; mapping(address => uint) userInvitesMax; /** * Deprecated, do not use. Use getUserByHash instead. * @custom:deprecated */ mapping(bytes32 => address) hashToOwner; mapping(bytes32 => string) hashToName; mapping(uint => PassInfo) passInfo; CountersUpgradeable.Counter internal passId; mapping(bytes32 => bool) reserveNames; mapping(address => bool) userActivated; mapping(bytes32 => uint) hashToPass; IDoidRegistry doidRegistry; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * The size of the __gap array is calculated so that the amount of storage used by a * contract always adds up to the same number (in this case 50 storage slots). * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[40] private __gap; } contract PassRegistry is PassRegistryStorage, ERC721EnumerableUpgradeable, AccessControlEnumerableUpgradeable { using CountersUpgradeable for CountersUpgradeable.Counter; using StringsUpgradeable for uint256; uint8 constant ClassAInvitationNum = 5; uint8 constant ClassBInvitationNum = 5; uint8 constant ClassCInvitationNum = 0; uint8 constant ClassANameLen = 2; uint8 constant ClassBNameLen = 4; uint8 constant ClassCNameLen = 6; bytes32 constant ClassA = 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760; // A bytes32 constant ClassB = 0x1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a69111; // B bytes32 constant ClassC = 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72; //C /** @dev 全局邀请权限 */ bytes32 public constant INVITER_ROLE = keccak256("INVITER_ROLE"); // EVENTs event LockPass(address user, uint passNumber); event LockName(address user, uint passId, string name); event Failure(string error); function initialize( address _admin, string memory _name, string memory _symbol ) public initializer { _setupRole(DEFAULT_ADMIN_ROLE, _admin); __ERC721_init(_name, _symbol); passId._value = 100000; } function updatePassIdStart(uint _start) external onlyRole(DEFAULT_ADMIN_ROLE) { passId._value = _start; } function setDoidRegistry(address addr) external onlyRole(DEFAULT_ADMIN_ROLE) { doidRegistry = IDoidRegistry(addr); } function claimDoid(uint256 _passId) external { require(ownerOf(_passId) == _msgSender(), "IP"); bytes32 hash = passInfo[_passId].passHash; require(hash != 0, "IN"); doidRegistry.claimLockedName(getNameByHash(hash), _msgSender()); _burn(_passId); } function getClassInfo( bytes32 _hash ) public pure returns (uint invNum, uint nameLen, bytes32 class) { invNum = ClassCInvitationNum; nameLen = ClassCNameLen; class = ClassC; if (_hash == ClassA) { invNum = ClassAInvitationNum; nameLen = ClassANameLen; class = ClassA; } else if (_hash == ClassB) { invNum = ClassBInvitationNum; nameLen = ClassBNameLen; class = ClassB; } } function isUserActivated(address _user) public view returns (bool) { return userActivated[_user]; } /** * @notice lock a name with code */ function lockPass( bytes memory _invitationCode, string memory _name, bytes32 _classHash, uint _passId ) external { require(!isUserActivated(msg.sender), "IU"); userActivated[msg.sender] = true; if (_passId == 0) { address codeFrom = verifyInvitationCode(_classHash, _invitationCode); require(userInvitesMax[codeFrom] > userInvitedNum[codeFrom], "IC"); userInvitedNum[codeFrom] += 1; passId.increment(); _passId = passId.current(); } else { require(!_exists(_passId), "II"); bytes32 hashedMsg = keccak256(abi.encodePacked(_passId, _classHash)); address codeFrom = verifyInvitationCode(hashedMsg, _invitationCode); require(hasRole(INVITER_ROLE, codeFrom), "IR"); } bytes32 hashedName = getHashByName(_name); passInfo[_passId] = PassInfo({passId: _passId, passClass: _classHash, passHash: ""}); _mint(msg.sender, _passId); (uint passNum, uint nameLen, ) = getClassInfo(_classHash); // mint extra passes for (uint256 index = 0; index < passNum; index++) { passId.increment(); passInfo[passId.current()] = PassInfo({ passId: passId.current(), passClass: ClassC, passHash: 0 }); _mint(msg.sender, passId.current()); } _lockName(_passId, _name, hashedName, nameLen); emit LockPass(msg.sender, passNum + 1); } /** * @notice lock a name with given passid */ function lockName(uint _passId, string memory _name) external { bytes32 hashedName = getHashByName(_name); PassInfo memory pass = passInfo[_passId]; (, uint nameLen, ) = getClassInfo(pass.passClass); require(_lockName(_passId, _name, hashedName, nameLen), "IN"); } function _lockName( uint _passId, string memory _name, bytes32 _hashedName, uint _minLen ) internal returns (bool) { if (bytes(_name).length <= 0) return false; require(ownerOf(_passId) == msg.sender, "IP"); require(passInfo[_passId].passHash == 0, "AL"); if (!nameAvaliable(_minLen, _name)) { emit Failure("IN"); return false; } //lock name hashToName[_hashedName] = _name; hashToPass[_hashedName] = _passId; passInfo[_passId].passHash = _hashedName; // init invatations at first time if (userInvitesMax[msg.sender] == 0) { userInvitedNum[msg.sender] = 0; userInvitesMax[msg.sender] = 3 * balanceOf(msg.sender); } emit LockName(msg.sender, _passId, _name); return true; } /** * @dev Lock a name and mint a pass. * @notice Can only be excuted by address with DEFAULT_ADMIN_ROLE. */ function lockAndMint(string memory _name, address _to) external onlyRole(DEFAULT_ADMIN_ROLE) { passId.increment(); uint _passId = passId.current(); passInfo[_passId] = PassInfo({passId: _passId, passClass: ClassC, passHash: 0}); _mint(msg.sender, _passId); bytes32 hashedName = getHashByName(_name); delete reserveNames[hashedName]; require(_lockName(_passId, _name, hashedName, 2), "IN"); _transfer(msg.sender, _to, _passId); } /** * @dev Request user's pass id list * @return Array of tokenId. */ function getUserPassList(address _user) external view returns (uint[] memory) { //string[] memory names = new string[](balanceOf(_user)); uint[] memory passList = new uint[](balanceOf(_user)); for (uint256 index = 0; index < balanceOf(_user); index++) { //names[index] = hashToName[passIdToHash[tokenOfOwnerByIndex(_user, index)]]; passList[index] = tokenOfOwnerByIndex(_user, index); } return passList; } /** * @dev Request user's pass info list * @return Array of PassInfo. */ function getUserPassesInfo(address _user) external view returns (PassInfo[] memory) { PassInfo[] memory info = new PassInfo[](balanceOf(_user)); for (uint256 index = 0; index < balanceOf(_user); index++) { info[index] = passInfo[tokenOfOwnerByIndex(_user, index)]; } return info; } function getUserPassInfo(uint _passId) external view returns (PassInfo memory) { return passInfo[_passId]; } function getUserInvitedNumber(address _user) external view returns (uint, uint) { return (userInvitedNum[_user], userInvitesMax[_user]); } function getNameByHash(bytes32 _hash) public view returns (string memory) { require(bytes(hashToName[_hash]).length != 0); return hashToName[_hash]; } function getHashByName(string memory _name) public pure returns (bytes32) { return keccak256(bytes(_name)); } function getUserByHash(bytes32 _hash) public view returns (address) { return ownerOf(getPassByHash(_hash)); } function getUserByName(string memory _name) public view returns (address) { return getUserByHash(getHashByName(_name)); } function getPassByHash(bytes32 _hash) public view returns (uint) { uint256 tokenId = hashToPass[_hash]; return tokenId; } function getPassByName(string memory _name) public view returns (uint) { return getPassByHash(getHashByName(_name)); } function exists(uint _passId) public view returns (bool) { return _exists(_passId); } /** * @notice check name length */ function lenValid(uint _minLen, string memory _name) public pure returns (bool) { return strlen(_name) >= _minLen && strlen(_name) <= 64; } /** * @notice reserve a brunch of name */ function reserveName(bytes32[] memory _hashes) external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "IR"); for (uint256 index = 0; index < _hashes.length; index++) { reserveNames[_hashes[index]] = true; } } /** * @notice check if name in reservation list */ function nameReserves(string memory _name) public view returns (bool) { return reserveNames[getHashByName(_name)]; } // for testing function deactivateUser(address _to) external { _checkRole(DEFAULT_ADMIN_ROLE, 0xAFB2e1145f1a88CE489D22425AC84003Fe50b3BE); delete userActivated[_to]; } /** * @notice check if name has already been registered */ function nameExists(string memory _name) public view returns (bool) { // is locked before bytes32 nameHash = getHashByName(_name); if (reserveNames[nameHash]) { // for testing // if (hasRole(DEFAULT_ADMIN_ROLE, 0xAFB2e1145f1a88CE489D22425AC84003Fe50b3BE)) // return false; return true; } if (hashToPass[nameHash] == 0) { return false; } return true; } function nameAvaliable(uint _minLen, string memory _name) public view returns (bool) { if (!lenValid(_minLen, _name)) { return false; } // for testing // if ( // hasRole(DEFAULT_ADMIN_ROLE, 0xAFB2e1145f1a88CE489D22425AC84003Fe50b3BE) && // nameReserves(_name) // ) { // return false; // } if (nameExists(_name)) { return false; } return true; } function strlen(string memory s) internal pure returns (uint256) { uint256 len; uint256 i = 0; uint256 bytelength = bytes(s).length; for (len = 0; i < bytelength; len++) { bytes1 b = bytes(s)[i]; if (b < 0x80) { i += 1; } else { len++; if (b < 0xE0) { i += 2; } else if (b < 0xF0) { i += 3; } else if (b < 0xF8) { i += 4; } else if (b < 0xFC) { i += 5; } else { i += 6; } } } return len; } /** * @notice verify a request code by message and its signature */ function verifyInvitationCode(bytes32 _msg, bytes memory _sig) public pure returns (address) { if (_msg == ClassC && _sig.length == 32) { bytes32 chunk; assembly { chunk := mload(add(_sig, 32)) chunk := xor(chunk, _msg) } return address(uint160(uint256(chunk))); } bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes32 _hashMessage = keccak256(abi.encodePacked(prefix, _msg)); return recoverSigner(_hashMessage, _sig); } function recoverSigner( bytes32 _hashMessage, bytes memory _sig ) internal pure returns (address) { bytes32 r; bytes32 s; uint8 v; assembly { /* First 32 bytes stores the length of the signature add(sig, 32) = pointer of sig + 32 effectively, skips first 32 bytes of signature mload(p) loads next 32 bytes starting at the memory address p into memory */ // first 32 bytes, after the length prefix r := mload(add(_sig, 32)) // second 32 bytes s := mload(add(_sig, 64)) // final byte (first byte of the next 32 bytes) v := byte(0, mload(add(_sig, 96))) } return ecrecover(_hashMessage, v, r, s); } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory nameInDescription; string memory imageData; PassInfo memory _passInfo = passInfo[tokenId]; if (_passInfo.passHash != 0) { bytes memory passName = bytes(getNameByHash(_passInfo.passHash)); nameInDescription = string(abi.encodePacked(passName, bytes(".doid%20locked"))); imageData = string( abi.encodePacked( // <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" fill="#fff"><defs><radialGradient cx="30%" cy="-30%" r="2" id="a"><stop offset="20%" stop-color="#FFEA94"/><stop offset="45%" stop-color="#D39750"/><stop offset="80%" stop-color="#51290F"/></radialGradient></defs><rect width="100%" height="100%" fill="url(#a)"/><path d="m23.706 15.918 2.602 1.38c.337.208.548.548.548.936v5.909c0 .365-.183.677-.47.885l-2.76 1.77a1.045 1.045 0 0 1-1.092.054l-2.212-1.197 3.802-2.29.026-4.426-2.864-1.51 2.422-1.508zm-1.692 7.419.624.311-2.422 1.484-.624-.312 2.422-1.483zm-.416-1.068.624.312-2.422 1.483-.652-.312 2.447-1.483zm-1.562-9.709 2.107 1.119-3.799 2.318-.025 4.4 2.863 1.537-2.422 1.51-2.498-1.355c-.416-.208-.652-.652-.652-1.093V15.32c0-.416.208-.832.573-1.068l2.552-1.638a1.234 1.234 0 0 1 1.3-.054zm2.967 2.498.624.312-2.422 1.484-.624-.312 2.422-1.484zm-.441-1.068.652.338-2.422 1.483-.652-.337 2.422-1.484z"/> // <text x="15" y="128" font-size="12" font-family="Arial,sans-serif"> bytes( "%253Csvg%2520xmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2000%252Fsvg%2522%2520viewBox%253D%25220%25200%2520128%2520128%2522%2520fill%253D%2522%2523fff%2522%253E%253Cdefs%253E%253CradialGradient%2520cx%253D%252230%2525%2522%2520cy%253D%2522-30%2525%2522%2520r%253D%25222%2522%2520id%253D%2522a%2522%253E%253Cstop%2520offset%253D%252220%2525%2522%2520stop-color%253D%2522%2523FFEA94%2522%252F%253E%253Cstop%2520offset%253D%252245%2525%2522%2520stop-color%253D%2522%2523D39750%2522%252F%253E%253Cstop%2520offset%253D%252280%2525%2522%2520stop-color%253D%2522%252351290F%2522%252F%253E%253C%252FradialGradient%253E%253C%252Fdefs%253E%253Crect%2520width%253D%2522100%2525%2522%2520height%253D%2522100%2525%2522%2520fill%253D%2522url(%2523a)%2522%252F%253E%253Cpath%2520d%253D%2522m23.706%252015.918%25202.602%25201.38c.337.208.548.548.548.936v5.909c0%2520.365-.183.677-.47.885l-2.76%25201.77a1.045%25201.045%25200%25200%25201-1.092.054l-2.212-1.197%25203.802-2.29.026-4.426-2.864-1.51%25202.422-1.508zm-1.692%25207.419.624.311-2.422%25201.484-.624-.312%25202.422-1.483zm-.416-1.068.624.312-2.422%25201.483-.652-.312%25202.447-1.483zm-1.562-9.709%25202.107%25201.119-3.799%25202.318-.025%25204.4%25202.863%25201.537-2.422%25201.51-2.498-1.355c-.416-.208-.652-.652-.652-1.093V15.32c0-.416.208-.832.573-1.068l2.552-1.638a1.234%25201.234%25200%25200%25201%25201.3-.054zm2.967%25202.498.624.312-2.422%25201.484-.624-.312%25202.422-1.484zm-.441-1.068.652.338-2.422%25201.483-.652-.337%25202.422-1.484z%2522%252F%253E" "%253Ctext%2520x%253D%252215%2522%2520y%253D%2522110%2522%2520font-size%253D%252212%2522%2520font-family%253D%2522Arial%252Csans-serif%2522%253E" ), passName, // .doid</text></svg> bytes(".doid%253C%252Ftext%253E%253C%252Fsvg%253E") ) ); } else { nameInDescription = "no%20name%20locked%20yet"; // <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" fill="#fff"><defs><radialGradient cx="30%" cy="-30%" r="2" id="a"><stop offset="20%" stop-color="#FFEA94"/><stop offset="45%" stop-color="#D39750"/><stop offset="80%" stop-color="#51290F"/></radialGradient></defs><rect width="100%" height="100%" fill="url(#a)"/><path fill-rule="evenodd" d="M23.712 15.99l2.6 1.378c.338.208.546.546.546.936v5.902c0 .364-.182.676-.468.884l-2.756 1.768a1.037 1.037 0 01-1.092.052l-2.21-1.196 3.796-2.288.026-4.42-2.86-1.508zm-1.69 7.41l.624.312-2.418 1.482-.624-.312zm-.416-1.066l.624.312-2.418 1.482-.65-.312zm21.008-6.578q.91 0 1.664.312.754.312 1.326.832.546.52.858 1.248.286.702.286 1.534 0 .832-.286 1.534-.312.728-.858 1.248-.572.546-1.326.832-.754.312-1.664.312-.91 0-1.664-.312-.754-.286-1.3-.832-.546-.52-.858-1.248-.312-.702-.312-1.534 0-.832.312-1.534.312-.728.858-1.248t1.3-.832q.754-.312 1.664-.312zm-22.568-3.12l2.106 1.118-3.796 2.314-.026 4.394 2.86 1.534-2.418 1.508-2.496-1.352c-.416-.208-.65-.65-.65-1.092v-5.668c0-.416.208-.832.572-1.066l2.548-1.638c.39-.26.884-.286 1.3-.052zm13.858 3.354q.754 0 1.43.312.676.312 1.17.806.494.52.78 1.196.286.676.286 1.43 0 .728-.286 1.404-.286.676-.78 1.196-.494.494-1.17.806-.65.312-1.43.312h-2.418a.456.456 0 01-.442-.442v-6.552c0-.26.208-.468.442-.468zm15.6 0c.26 0 .442.208.442.468v6.552a.438.438 0 01-.442.442h-1.066c-.26 0-.468-.208-.468-.442v-6.552a.465.465 0 01.468-.468zm4.836 0q.754 0 1.43.312.676.312 1.17.806.494.52.78 1.196.286.676.286 1.43 0 .728-.286 1.404-.286.676-.78 1.196-.494.494-1.17.806-.65.312-1.43.312h-2.418a.456.456 0 01-.442-.442v-6.552c0-.26.208-.468.442-.468zm-11.778 1.664q-.416 0-.806.156-.364.156-.65.416-.286.286-.468.676-.156.364-.156.832 0 .442.156.806.182.39.468.676.286.26.65.416.39.156.806.156.416 0 .806-.156.364-.156.65-.416.312-.286.468-.676.156-.364.156-.806 0-.468-.156-.832-.156-.39-.468-.676-.286-.26-.65-.416-.39-.156-.806-.156zm-9.152-.078h-.156c-.156 0-.286.13-.286.312v3.536a.289.289 0 00.286.286h.156q.494 0 .91-.156.39-.156.65-.416.286-.286.416-.65.156-.39.156-.832 0-.442-.156-.832-.13-.39-.416-.65-.26-.286-.676-.442-.39-.156-.884-.156zm20.488 0h-.13a.3.3 0 00-.312.312v3.536c0 .156.13.286.312.286h.13q.52 0 .91-.156t.676-.416q.26-.286.416-.65.13-.39.13-.832 0-.442-.13-.832-.156-.39-.442-.65-.26-.286-.65-.442-.416-.156-.91-.156zM23.01 15.132l.624.312-2.418 1.482-.624-.312zm-.442-1.066l.65.338-2.418 1.482-.65-.338z"/></svg> imageData = "%253Csvg%2520xmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2000%252Fsvg%2522%2520viewBox%253D%25220%25200%2520128%2520128%2522%2520fill%253D%2522%2523fff%2522%253E%253Cdefs%253E%253CradialGradient%2520cx%253D%252230%2525%2522%2520cy%253D%2522-30%2525%2522%2520r%253D%25222%2522%2520id%253D%2522a%2522%253E%253Cstop%2520offset%253D%252220%2525%2522%2520stop-color%253D%2522%2523FFEA94%2522%252F%253E%253Cstop%2520offset%253D%252245%2525%2522%2520stop-color%253D%2522%2523D39750%2522%252F%253E%253Cstop%2520offset%253D%252280%2525%2522%2520stop-color%253D%2522%252351290F%2522%252F%253E%253C%252FradialGradient%253E%253C%252Fdefs%253E%253Crect%2520width%253D%2522100%2525%2522%2520height%253D%2522100%2525%2522%2520fill%253D%2522url(%2523a)%2522%252F%253E%253Cpath%2520fill-rule%253D%2522evenodd%2522%2520d%253D%2522M23.712%252015.99l2.6%25201.378c.338.208.546.546.546.936v5.902c0%2520.364-.182.676-.468.884l-2.756%25201.768a1.037%25201.037%25200%252001-1.092.052l-2.21-1.196%25203.796-2.288.026-4.42-2.86-1.508zm-1.69%25207.41l.624.312-2.418%25201.482-.624-.312zm-.416-1.066l.624.312-2.418%25201.482-.65-.312zm21.008-6.578q.91%25200%25201.664.312.754.312%25201.326.832.546.52.858%25201.248.286.702.286%25201.534%25200%2520.832-.286%25201.534-.312.728-.858%25201.248-.572.546-1.326.832-.754.312-1.664.312-.91%25200-1.664-.312-.754-.286-1.3-.832-.546-.52-.858-1.248-.312-.702-.312-1.534%25200-.832.312-1.534.312-.728.858-1.248t1.3-.832q.754-.312%25201.664-.312zm-22.568-3.12l2.106%25201.118-3.796%25202.314-.026%25204.394%25202.86%25201.534-2.418%25201.508-2.496-1.352c-.416-.208-.65-.65-.65-1.092v-5.668c0-.416.208-.832.572-1.066l2.548-1.638c.39-.26.884-.286%25201.3-.052zm13.858%25203.354q.754%25200%25201.43.312.676.312%25201.17.806.494.52.78%25201.196.286.676.286%25201.43%25200%2520.728-.286%25201.404-.286.676-.78%25201.196-.494.494-1.17.806-.65.312-1.43.312h-2.418a.456.456%25200%252001-.442-.442v-6.552c0-.26.208-.468.442-.468zm15.6%25200c.26%25200%2520.442.208.442.468v6.552a.438.438%25200%252001-.442.442h-1.066c-.26%25200-.468-.208-.468-.442v-6.552a.465.465%25200%252001.468-.468zm4.836%25200q.754%25200%25201.43.312.676.312%25201.17.806.494.52.78%25201.196.286.676.286%25201.43%25200%2520.728-.286%25201.404-.286.676-.78%25201.196-.494.494-1.17.806-.65.312-1.43.312h-2.418a.456.456%25200%252001-.442-.442v-6.552c0-.26.208-.468.442-.468zm-11.778%25201.664q-.416%25200-.806.156-.364.156-.65.416-.286.286-.468.676-.156.364-.156.832%25200%2520.442.156.806.182.39.468.676.286.26.65.416.39.156.806.156.416%25200%2520.806-.156.364-.156.65-.416.312-.286.468-.676.156-.364.156-.806%25200-.468-.156-.832-.156-.39-.468-.676-.286-.26-.65-.416-.39-.156-.806-.156zm-9.152-.078h-.156c-.156%25200-.286.13-.286.312v3.536a.289.289%25200%252000.286.286h.156q.494%25200%2520.91-.156.39-.156.65-.416.286-.286.416-.65.156-.39.156-.832%25200-.442-.156-.832-.13-.39-.416-.65-.26-.286-.676-.442-.39-.156-.884-.156zm20.488%25200h-.13a.3.3%25200%252000-.312.312v3.536c0%2520.156.13.286.312.286h.13q.52%25200%2520.91-.156t.676-.416q.26-.286.416-.65.13-.39.13-.832%25200-.442-.13-.832-.156-.39-.442-.65-.26-.286-.65-.442-.416-.156-.91-.156zM23.01%252015.132l.624.312-2.418%25201.482-.624-.312zm-.442-1.066l.65.338-2.418%25201.482-.65-.338z%2522%252F%253E%253C%252Fsvg%253E"; } return string( abi.encodePacked( // {"name":"DOID Lock Pass # bytes("data:application/json;utf8,%7B%22name%22%3A%22DOID%20Lock%20Pass%20%23"), tokenId.toString(), // ","description":"A DOID lock pass, with bytes("%22%2C%22description%22%3A%22A%20DOID%20lock%20pass%2C%20with%20"), bytes(nameInDescription), // .","image":"data:image/svg+xml;utf8, bytes(".%22%2C%22image%22%3A%22data%3Aimage%2Fsvg%2Bxml%3Butf8%2C"), bytes(imageData), // "} bytes("%22%7D") ) ); } // The following functions are overrides required by Solidity. function supportsInterface( bytes4 interfaceId ) public view virtual override(AccessControlEnumerableUpgradeable, ERC721EnumerableUpgradeable) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: None pragma solidity >=0.8.4; interface IDoidRegistry { event NameMigrated(uint256 indexed id, address indexed owner, uint256 expires); event NameRegistered(uint256 indexed id, string indexed name, address indexed owner); event NameRenewed(uint256 indexed id, uint256 expires); struct DoidInfo { uint256 tokenId; string name; } /** * @dev Request user's tokens * @return tokenIds. */ function tokensOfOwner(address _user) external view returns (uint256[] memory); /** * @dev Request user's names * @return names with tokenId. */ function namesOfOwner(address _user) external view returns (DoidInfo[] memory); /** * @dev Request status of a name * @return status 'available' or 'registered' or 'locked', or 'reserved'. * @return owner address that owns or locks this name * @return id token id of name (if registered) or pass (if locked) or 0 (if available or reserved). */ function statusOfName( string memory name ) external view returns (string memory status, address owner, uint id); function nameHash(string memory name) external view returns (bytes32); function valid(string memory name) external pure returns (bool); function available(string memory name) external view returns (bool); function available(uint256 id) external view returns (bool); function makeCommitment( string memory name, address owner, bytes32 secret, bytes[] calldata data ) external pure returns (bytes32); function commit(bytes32 commitment) external; function register( string calldata name, address owner, bytes32 secret, bytes[] calldata data ) external; /** * @dev Claim a locked name for PassRegistry. * @notice Can only be called by PassRegistry. */ function claimLockedName(string memory name, address owner) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library CountersUpgradeable { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721Upgradeable.sol"; import "./IERC721EnumerableUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable { function __ERC721Enumerable_init() internal onlyInitializing { } function __ERC721Enumerable_init_unchained() internal onlyInitializing { } // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721Upgradeable.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[46] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"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":"string","name":"error","type":"string"}],"name":"Failure","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"passId","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"LockName","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"passNumber","type":"uint256"}],"name":"LockPass","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INVITER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_passId","type":"uint256"}],"name":"claimDoid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"deactivateUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_passId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"getClassInfo","outputs":[{"internalType":"uint256","name":"invNum","type":"uint256"},{"internalType":"uint256","name":"nameLen","type":"uint256"},{"internalType":"bytes32","name":"class","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getHashByName","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"getNameByHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"getPassByHash","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getPassByName","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"getUserByHash","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getUserByName","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserInvitedNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_passId","type":"uint256"}],"name":"getUserPassInfo","outputs":[{"components":[{"internalType":"uint256","name":"passId","type":"uint256"},{"internalType":"bytes32","name":"passClass","type":"bytes32"},{"internalType":"bytes32","name":"passHash","type":"bytes32"}],"internalType":"struct PassRegistryStorage.PassInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserPassList","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserPassesInfo","outputs":[{"components":[{"internalType":"uint256","name":"passId","type":"uint256"},{"internalType":"bytes32","name":"passClass","type":"bytes32"},{"internalType":"bytes32","name":"passHash","type":"bytes32"}],"internalType":"struct PassRegistryStorage.PassInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isUserActivated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minLen","type":"uint256"},{"internalType":"string","name":"_name","type":"string"}],"name":"lenValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_to","type":"address"}],"name":"lockAndMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_passId","type":"uint256"},{"internalType":"string","name":"_name","type":"string"}],"name":"lockName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_invitationCode","type":"bytes"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"bytes32","name":"_classHash","type":"bytes32"},{"internalType":"uint256","name":"_passId","type":"uint256"}],"name":"lockPass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minLen","type":"uint256"},{"internalType":"string","name":"_name","type":"string"}],"name":"nameAvaliable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"nameExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"nameReserves","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_hashes","type":"bytes32[]"}],"name":"reserveName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setDoidRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"}],"name":"updatePassIdStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_msg","type":"bytes32"},{"internalType":"bytes","name":"_sig","type":"bytes"}],"name":"verifyInvitationCode","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50615109806100206000396000f3fe608060405234801561001057600080fd5b506004361061030c5760003560e01c806391d148541161019d578063cad637c9116100e9578063e985e9c5116100a2578063ebedf8501161007c578063ebedf850146107de578063f03590bf146107f1578063f17f68ad14610804578063fc4ddc621461082b57600080fd5b8063e985e9c51461077c578063ea5f3188146107b8578063eac9fa4c146107cb57600080fd5b8063cad637c9146106ae578063cc637afe146106ce578063d547741f146106e1578063dfdf9e65146106f4578063e4b781db14610720578063e787a2171461076957600080fd5b8063a579549311610156578063c317891a11610130578063c317891a14610662578063c45a499114610675578063c87b56dd14610688578063ca15c8731461069b57600080fd5b8063a57954931461061c578063b88d4fde1461062f578063c2cd43241461064257600080fd5b806391d14854146105c057806395d89b41146105d35780639dd984b1146105db5780639ef502a4146105ee578063a217fddf14610601578063a22cb4651461060957600080fd5b80633b05e85f1161025c5780635a588d7b1161021557806379c7db5a116101ef57806379c7db5a1461051b57806385cc8d1d146105345780639010d07c1461059a57806390657147146105ad57600080fd5b80635a588d7b146104d55780636352211e146104f557806370a082311461050857600080fd5b80633b05e85f1461046357806342842e0e146104765780634bff5009146104895780634ec0b21e1461049c5780634f558e79146104af5780634f6ccce7146104c257600080fd5b806323b872dd116102c95780632698d205116102a35780632698d205146104175780632f2ff15d1461042a5780632f745c591461043d57806336568abe1461045057600080fd5b806323b872dd146103b3578063248a9ca3146103c6578063250c72d9146103e957600080fd5b806301ffc9a71461031157806306fdde0314610339578063081812fc1461034e578063095ea7b31461037957806318160ddd1461038e5780631a47767b146103a0575b600080fd5b61032461031f3660046135bf565b61083e565b60405190151581526020015b60405180910390f35b61034161084f565b60405161033091906139a0565b61036161035c366004613520565b6108e1565b6040516001600160a01b039091168152602001610330565b61038c610387366004613450565b610908565b005b60cb545b604051908152602001610330565b61038c6103ae3660046132ba565b610a23565b61038c6103c1366004613306565b610a63565b6103926103d4366004613520565b600090815260fb602052604090206001015490565b6103fc6103f7366004613520565b610a94565b60408051938452602084019290925290820152606001610330565b61038c6104253660046135f7565b610b58565b61038c610438366004613538565b610eb5565b61039261044b366004613450565b610eda565b61038c61045e366004613538565b610f70565b61038c610471366004613520565b610fee565b61038c610484366004613306565b610fff565b610361610497366004613667565b61101a565b6103616104aa36600461355a565b61102d565b6103246104bd366004613520565b6110d9565b6103926104d0366004613520565b6110f8565b6104e86104e33660046132ba565b611199565b6040516103309190613906565b610361610503366004613520565b6112b6565b6103926105163660046132ba565b611316565b610392610529366004613667565b805160209091012090565b61058d610542366004613520565b60408051606080820183526000808352602080840182905292840181905293845260048252928290208251938401835280548452600181015491840191909152600201549082015290565b6040516103309190613ae4565b6103616105a836600461359e565b61139c565b61038c6105bb3660046133e0565b6113bc565b6103246105ce366004613538565b6114e4565b61034161150f565b61038c6105e9366004613520565b61151e565b6103246105fc366004613667565b611605565b610392600081565b61038c6106173660046133a6565b611634565b61039261062a366004613667565b61163f565b61038c61063d366004613341565b611652565b610392610650366004613520565b60009081526008602052604090205490565b61038c610670366004613479565b611684565b61032461068336600461355a565b611732565b610341610696366004613520565b611769565b6103926106a9366004613520565b611963565b6106c16106bc3660046132ba565b61197b565b6040516103309190613968565b6103246106dc366004613667565b611a33565b61038c6106ef366004613538565b611a7a565b6103246107023660046132ba565b6001600160a01b031660009081526007602052604090205460ff1690565b61075461072e3660046132ba565b6001600160a01b0316600090815260208181526040808320546001909252909120549091565b60408051928352602083019190915201610330565b61038c61077736600461355a565b611a9f565b61032461078a3660046132d4565b6001600160a01b039182166000908152609c6020908152604080832093909416825291909152205460ff1690565b61038c6107c6366004613699565b611b1a565b61038c6107d93660046132ba565b611bea565b6103246107ec36600461355a565b611c18565b6103416107ff366004613520565b611c41565b6103927f639cc15674e3ab889ef8ffacb1499d6c868345f7a98e2158a7d43d23a757f8e081565b610361610839366004613520565b611d09565b600061084982611d21565b92915050565b60606097805461085e90613bda565b80601f016020809104026020016040519081016040528092919081815260200182805461088a90613bda565b80156108d75780601f106108ac576101008083540402835291602001916108d7565b820191906000526020600020905b8154815290600101906020018083116108ba57829003601f168201915b5050505050905090565b60006108ec82611d46565b506000908152609b60205260409020546001600160a01b031690565b6000610913826112b6565b9050806001600160a01b0316836001600160a01b031614156109865760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806109a257506109a2813361078a565b610a145760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000606482015260840161097d565b610a1e8383611da8565b505050565b610a42600073afb2e1145f1a88ce489d22425ac84003fe50b3be611e16565b6001600160a01b03166000908152600760205260409020805460ff19169055565b610a6d3382611e7a565b610a895760405162461bcd60e51b815260040161097d90613a96565b610a1e838383611ef9565b600060066000805160206143138339815191527f03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760841415610afe575060059150600290507f03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760610b51565b7f1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a69111841415610b51575060059150600490507f1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a691115b9193909250565b3360009081526007602052604090205460ff1615610b9d5760405162461bcd60e51b8152602060048201526002602482015261495560f01b604482015260640161097d565b336000908152600760205260409020805460ff1916600117905580610c62576000610bc8838661102d565b6001600160a01b0381166000908152602081815260408083205460019092529091205491925010610c205760405162461bcd60e51b8152602060048201526002602482015261494360f01b604482015260640161097d565b6001600160a01b0381166000908152602081905260408120805460019290610c49908490613b35565b9091555050600580546001019055600554915050610d40565b6000818152609960205260409020546001600160a01b031615610cac5760405162461bcd60e51b8152602060048201526002602482015261494960f01b604482015260640161097d565b604080516020808201849052818301859052825180830384018152606090920190925280519101206000610ce0828761102d565b9050610d0c7f639cc15674e3ab889ef8ffacb1499d6c868345f7a98e2158a7d43d23a757f8e0826114e4565b610d3d5760405162461bcd60e51b815260206004820152600260248201526124a960f11b604482015260640161097d565b50505b825160208401206000906040805160608101825284815260208082018781526000838501818152888252600490935293909320915182559151600182015590516002909101559050610d9233836120a0565b600080610d9e85610a94565b509150915060005b82811015610e4f57610dbc600580546001019055565b6040518060600160405280610dd060055490565b8152600080516020614313833981519152602082015260006040909101819052600490610dfc60055490565b8152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050610e3d33610e3860055490565b6120a0565b80610e4781613c15565b915050610da6565b50610e5c848785846121ee565b507f3c4c11cb99694364366ba395fa5e9613f318b30e96d8469e5a109fce66a345d333610e8a846001613b35565b604080516001600160a01b03909316835260208301919091520160405180910390a150505050505050565b600082815260fb6020526040902060010154610ed0816123a2565b610a1e83836123ac565b6000610ee583611316565b8210610f475760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161097d565b506001600160a01b0391909116600090815260c960209081526040808320938352929052205490565b6001600160a01b0381163314610fe05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161097d565b610fea82826123cf565b5050565b6000610ff9816123a2565b50600555565b610a1e83838360405180602001604052806000815250611652565b8051602082012060009061084990611d09565b60006000805160206143138339815191528314801561104d575081516020145b1561105f575060208101518218610849565b60006040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152509050600081856040516020016110ae929190613707565b6040516020818303038152906040528051906020012090506110d081856123f2565b95945050505050565b6000818152609960205260408120546001600160a01b03161515610849565b600061110360cb5490565b82106111665760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161097d565b60cb828154811061118757634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b606060006111a683611316565b6001600160401b038111156111cb57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561121657816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816111e95790505b50905060005b61122584611316565b8110156112af576004600061123a8684610eda565b8152602001908152602001600020604051806060016040529081600082015481526020016001820154815260200160028201548152505082828151811061129157634e487b7160e01b600052603260045260246000fd5b602002602001018190525080806112a790613c15565b91505061121c565b5092915050565b6000818152609960205260408120546001600160a01b0316806108495760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161097d565b60006001600160a01b0382166113805760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161097d565b506001600160a01b03166000908152609a602052604090205490565b600082815261012d602052604081206113b5908361246a565b9392505050565b603254610100900460ff16158080156113dc5750603254600160ff909116105b806113f65750303b1580156113f6575060325460ff166001145b6114595760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161097d565b6032805460ff19166001179055801561147c576032805461ff0019166101001790555b611487600085612476565b6114918383612480565b620186a060055580156114de576032805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606098805461085e90613bda565b33611528826112b6565b6001600160a01b0316146115635760405162461bcd60e51b8152602060048201526002602482015261049560f41b604482015260640161097d565b600081815260046020526040902060020154806115925760405162461bcd60e51b815260040161097d906139dd565b6009546001600160a01b031663141eed676115ac83611c41565b336040518363ffffffff1660e01b81526004016115ca9291906139b3565b600060405180830381600087803b1580156115e457600080fd5b505af11580156115f8573d6000803e3d6000fd5b50505050610fea826124b1565b60006006600061161a84805160209091012090565b815260208101919091526040016000205460ff1692915050565b610fea338383612558565b8051602082012060009061084990610650565b61165c3383611e7a565b6116785760405162461bcd60e51b815260040161097d90613a96565b6114de84848484612627565b61168f6000336114e4565b6116c05760405162461bcd60e51b815260206004820152600260248201526124a960f11b604482015260640161097d565b60005b8151811015610fea576001600660008484815181106116f257634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061172a90613c15565b9150506116c3565b600061173e8383611c18565b61174a57506000610849565b61175382611a33565b1561176057506000610849565b50600192915050565b606061177482611d46565b600082815260046020908152604091829020825160608181018552825482526001830154938201939093526002909101549281018390529091829190156118685760006117c48260400151611c41565b9050806040518060400160405280600e81526020016d0b991bda59094c8c1b1bd8dad95960921b8152506040516020016117ff929190613729565b60408051601f198184030181526106a08301909152610676808352909550613c9d6020830139816040518060600160405280602a8152602001614333602a913960405160200161185193929190613758565b6040516020818303038152906040529250506118bf565b6040518060400160405280601881526020017f6e6f2532306e616d652532306c6f636b65642532307965740000000000000000815250925060405180610ce00160405280610cb7815260200161435d610cb7913991505b60405180608001604052806046815260200161508e604691396118e18661265a565b60405180606001604052806040815260200161501460409139856040518060600160405280603a8152602001615054603a91398660405180604001604052806006815260200165094c8c894dd160d21b81525060405160200161194a979695949392919061379b565b6040516020818303038152906040529350505050919050565b600081815261012d6020526040812061084990612773565b6060600061198883611316565b6001600160401b038111156119ad57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156119d6578160200160208202803683370190505b50905060005b6119e584611316565b8110156112af576119f68482610eda565b828281518110611a1657634e487b7160e01b600052603260045260246000fd5b602090810291909101015280611a2b81613c15565b9150506119dc565b805160208083019190912060008181526006909252604082205460ff1615611a5e5750600192915050565b6000818152600860205260409020546117605750600092915050565b600082815260fb6020526040902060010154611a95816123a2565b610a1e83836123cf565b805160208083019190912060008481526004835260408082208151606081018352815481526001820154958101869052600290910154918101919091529192611ae790610a94565b50915050611af7858585846121ee565b611b135760405162461bcd60e51b815260040161097d906139dd565b5050505050565b6000611b25816123a2565b611b33600580546001019055565b6000611b3e60055490565b60408051606081018252828152600080516020614313833981519152602080830191825260008385018181528682526004909252939093209151825551600182015590516002909101559050611b9433826120a0565b835160208501206000906000818152600660205260409020805460ff191690559050611bc382868360026121ee565b611bdf5760405162461bcd60e51b815260040161097d906139dd565b611b13338584611ef9565b6000611bf5816123a2565b50600980546001600160a01b0319166001600160a01b0392909216919091179055565b600082611c248361277d565b101580156113b557506040611c388361277d565b11159392505050565b6000818152600360205260409020805460609190611c5e90613bda565b15159050611c6b57600080fd5b60008281526003602052604090208054611c8490613bda565b80601f0160208091040260200160405190810160405280929190818152602001828054611cb090613bda565b8015611cfd5780601f10611cd257610100808354040283529160200191611cfd565b820191906000526020600020905b815481529060010190602001808311611ce057829003601f168201915b50505050509050919050565b600081815260086020526040812054610849906112b6565b60006001600160e01b03198216635a05180f60e01b148061084957506108498261289b565b6000818152609960205260409020546001600160a01b0316611da55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161097d565b50565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611ddd826112b6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611e2082826114e4565b610fea57611e38816001600160a01b031660146128c0565b611e438360206128c0565b604051602001611e5492919061382d565b60408051601f198184030181529082905262461bcd60e51b825261097d916004016139a0565b600080611e86836112b6565b9050806001600160a01b0316846001600160a01b03161480611ecd57506001600160a01b038082166000908152609c602090815260408083209388168352929052205460ff165b80611ef15750836001600160a01b0316611ee6846108e1565b6001600160a01b0316145b949350505050565b826001600160a01b0316611f0c826112b6565b6001600160a01b031614611f705760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161097d565b6001600160a01b038216611fd25760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161097d565b611fdd838383612aa1565b611fe8600082611da8565b6001600160a01b0383166000908152609a60205260408120805460019290612011908490613b80565b90915550506001600160a01b0382166000908152609a6020526040812080546001929061203f908490613b35565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0382166120f65760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161097d565b6000818152609960205260409020546001600160a01b03161561215b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161097d565b61216760008383612aa1565b6001600160a01b0382166000908152609a60205260408120805460019290612190908490613b35565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008084511161220057506000611ef1565b3361220a866112b6565b6001600160a01b0316146122455760405162461bcd60e51b8152602060048201526002602482015261049560f41b604482015260640161097d565b600085815260046020526040902060020154156122895760405162461bcd60e51b8152602060048201526002602482015261105360f21b604482015260640161097d565b6122938285611732565b6122d4577ffd5de27667e5407df5be0b6efb7f86ae8c40433040399a5e4d36a46ccc50638d6040516122c4906139dd565b60405180910390a1506000611ef1565b600083815260036020908152604090912085516122f39287019061319b565b50600083815260086020908152604080832088905587835260048252808320600201869055338352600190915290205461235c573360008181526020819052604081205561234090611316565b61234b906003613b61565b336000908152600160205260409020555b7fe027feb30eed511dd4e4d2b66336f11312e4d33989a51f4891ee80a5a98e950833868660405161238f939291906138df565b60405180910390a1506001949350505050565b611da58133611e16565b6123b68282612b59565b600082815261012d60205260409020610a1e9082612bdf565b6123d98282612bf4565b600082815261012d60205260409020610a1e9082612c5b565b6020818101516040808401516060808601518351600080825296810180865289905290861a9381018490529081018490526080810182905290919060019060a0016020604051602081039080840390855afa158015612455573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b60006113b58383612c70565b610fea82826123ac565b603254610100900460ff166124a75760405162461bcd60e51b815260040161097d90613a4b565b610fea8282612ca8565b60006124bc826112b6565b90506124ca81600084612aa1565b6124d5600083611da8565b6001600160a01b0381166000908152609a602052604081208054600192906124fe908490613b80565b909155505060008281526099602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031614156125ba5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161097d565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612632848484611ef9565b61263e84848484612cf6565b6114de5760405162461bcd60e51b815260040161097d906139f9565b60608161267e5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156126a8578061269281613c15565b91506126a19050600a83613b4d565b9150612682565b6000816001600160401b038111156126d057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156126fa576020820181803683370190505b5090505b8415611ef15761270f600183613b80565b915061271c600a86613c30565b612727906030613b35565b60f81b81838151811061274a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061276c600a86613b4d565b94506126fe565b6000610849825490565b8051600090819081905b808210156128925760008583815181106127b157634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b0319169050600160ff1b8110156127e0576127d9600184613b35565b925061287f565b836127ea81613c15565b945050600760fd1b6001600160f81b03198216101561280e576127d9600284613b35565b600f60fc1b6001600160f81b03198216101561282f576127d9600384613b35565b601f60fb1b6001600160f81b031982161015612850576127d9600484613b35565b603f60fa1b6001600160f81b031982161015612871576127d9600584613b35565b61287c600684613b35565b92505b508261288a81613c15565b935050612787565b50909392505050565b60006001600160e01b03198216637965db0b60e01b1480610849575061084982612e00565b606060006128cf836002613b61565b6128da906002613b35565b6001600160401b038111156128ff57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612929576020820181803683370190505b509050600360fc1b8160008151811061295257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061298f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006129b3846002613b61565b6129be906001613b35565b90505b6001811115612a52576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612a0057634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110612a2457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612a4b81613bc3565b90506129c1565b5083156113b55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161097d565b6001600160a01b038316612afc57612af78160cb8054600083815260cc60205260408120829055600182018355919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0155565b612b1f565b816001600160a01b0316836001600160a01b031614612b1f57612b1f8382612e25565b6001600160a01b038216612b3657610a1e81612ec2565b826001600160a01b0316826001600160a01b031614610a1e57610a1e8282612f9b565b612b6382826114e4565b610fea57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612b9b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113b5836001600160a01b038416612fdf565b612bfe82826114e4565b15610fea57600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006113b5836001600160a01b03841661302e565b6000826000018281548110612c9557634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b603254610100900460ff16612ccf5760405162461bcd60e51b815260040161097d90613a4b565b8151612ce290609790602085019061319b565b508051610a1e90609890602084019061319b565b60006001600160a01b0384163b15612df857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612d3a9033908990889088906004016138a2565b602060405180830381600087803b158015612d5457600080fd5b505af1925050508015612d84575060408051601f3d908101601f19168201909252612d81918101906135db565b60015b612dde573d808015612db2576040519150601f19603f3d011682016040523d82523d6000602084013e612db7565b606091505b508051612dd65760405162461bcd60e51b815260040161097d906139f9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ef1565b506001611ef1565b60006001600160e01b0319821663780e9d6360e01b148061084957506108498261314b565b60006001612e3284611316565b612e3c9190613b80565b600083815260ca6020526040902054909150808214612e8f576001600160a01b038416600090815260c960209081526040808320858452825280832054848452818420819055835260ca90915290208190555b50600091825260ca602090815260408084208490556001600160a01b03909416835260c981528383209183525290812055565b60cb54600090612ed490600190613b80565b600083815260cc602052604081205460cb8054939450909284908110612f0a57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508060cb8381548110612f3957634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260cc909152604080822084905585825281205560cb805480612f7f57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000612fa683611316565b6001600160a01b03909316600090815260c960209081526040808320868452825280832085905593825260ca9052919091209190915550565b600081815260018301602052604081205461302657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610849565b506000610849565b60008181526001830160205260408120548015613141576000613052600183613b80565b855490915060009061306690600190613b80565b90508181146130e757600086600001828154811061309457634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050808760000184815481106130c557634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061310657634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610849565b6000915050610849565b60006001600160e01b031982166380ac58cd60e01b148061317c57506001600160e01b03198216635b5e139f60e01b145b8061084957506301ffc9a760e01b6001600160e01b0319831614610849565b8280546131a790613bda565b90600052602060002090601f0160209004810192826131c9576000855561320f565b82601f106131e257805160ff191683800117855561320f565b8280016001018555821561320f579182015b8281111561320f5782518255916020019190600101906131f4565b5061321b92915061321f565b5090565b5b8082111561321b5760008155600101613220565b80356001600160a01b038116811461324b57600080fd5b919050565b600082601f830112613260578081fd5b81356001600160401b0381111561327957613279613c70565b61328c601f8201601f1916602001613b05565b8181528460208386010111156132a0578283fd5b816020850160208301379081016020019190915292915050565b6000602082840312156132cb578081fd5b6113b582613234565b600080604083850312156132e6578081fd5b6132ef83613234565b91506132fd60208401613234565b90509250929050565b60008060006060848603121561331a578081fd5b61332384613234565b925061333160208501613234565b9150604084013590509250925092565b60008060008060808587031215613356578081fd5b61335f85613234565b935061336d60208601613234565b92506040850135915060608501356001600160401b0381111561338e578182fd5b61339a87828801613250565b91505092959194509250565b600080604083850312156133b8578182fd5b6133c183613234565b9150602083013580151581146133d5578182fd5b809150509250929050565b6000806000606084860312156133f4578283fd5b6133fd84613234565b925060208401356001600160401b0380821115613418578384fd5b61342487838801613250565b93506040860135915080821115613439578283fd5b5061344686828701613250565b9150509250925092565b60008060408385031215613462578182fd5b61346b83613234565b946020939093013593505050565b6000602080838503121561348b578182fd5b82356001600160401b03808211156134a1578384fd5b818501915085601f8301126134b4578384fd5b8135818111156134c6576134c6613c70565b8060051b91506134d7848301613b05565b8181528481019084860184860187018a10156134f1578788fd5b8795505b838610156135135780358352600195909501949186019186016134f5565b5098975050505050505050565b600060208284031215613531578081fd5b5035919050565b6000806040838503121561354a578182fd5b823591506132fd60208401613234565b6000806040838503121561356c578182fd5b8235915060208301356001600160401b03811115613588578182fd5b61359485828601613250565b9150509250929050565b600080604083850312156135b0578182fd5b50508035926020909101359150565b6000602082840312156135d0578081fd5b81356113b581613c86565b6000602082840312156135ec578081fd5b81516113b581613c86565b6000806000806080858703121561360c578182fd5b84356001600160401b0380821115613622578384fd5b61362e88838901613250565b95506020870135915080821115613643578384fd5b5061365087828801613250565b949794965050505060408301359260600135919050565b600060208284031215613678578081fd5b81356001600160401b0381111561368d578182fd5b611ef184828501613250565b600080604083850312156136ab578182fd5b82356001600160401b038111156136c0578283fd5b6136cc85828601613250565b9250506132fd60208401613234565b600081518084526136f3816020860160208601613b97565b601f01601f19169290920160200192915050565b60008351613719818460208801613b97565b9190910191825250602001919050565b6000835161373b818460208801613b97565b83519083019061374f818360208801613b97565b01949350505050565b6000845161376a818460208901613b97565b84519083019061377e818360208901613b97565b8451910190613791818360208801613b97565b0195945050505050565b6000885160206137ae8285838e01613b97565b8951918401916137c18184848e01613b97565b89519201916137d38184848d01613b97565b88519201916137e58184848c01613b97565b87519201916137f78184848b01613b97565b86519201916138098184848a01613b97565b855192019161381b8184848901613b97565b919091019a9950505050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613865816017850160208801613b97565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613896816028840160208801613b97565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906138d5908301846136db565b9695505050505050565b60018060a01b03841681528260208201526060604082015260006110d060608301846136db565b6020808252825182820181905260009190848201906040850190845b8181101561395c576139498385518051825260208082015190830152604090810151910152565b9284019260609290920191600101613922565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561395c57835183529284019291840191600101613984565b6020815260006113b560208301846136db565b6040815260006139c660408301856136db565b905060018060a01b03831660208301529392505050565b60208082526002908201526124a760f11b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b81518152602080830151908201526040808301519082015260608101610849565b604051601f8201601f191681016001600160401b0381118282101715613b2d57613b2d613c70565b604052919050565b60008219821115613b4857613b48613c44565b500190565b600082613b5c57613b5c613c5a565b500490565b6000816000190483118215151615613b7b57613b7b613c44565b500290565b600082821015613b9257613b92613c44565b500390565b60005b83811015613bb2578181015183820152602001613b9a565b838111156114de5750506000910152565b600081613bd257613bd2613c44565b506000190190565b600181811c90821680613bee57607f821691505b60208210811415613c0f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613c2957613c29613c44565b5060010190565b600082613c3f57613c3f613c5a565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114611da557600080fdfe25323533437376672532353230786d6c6e7325323533442532353232687474702532353341253235324625323532467777772e77332e6f726725323532463230303025323532467376672532353232253235323076696577426f782532353344253235323230253235323030253235323031323825323532303132382532353232253235323066696c6c253235334425323532322532353233666666253235323225323533452532353343646566732532353345253235334372616469616c4772616469656e74253235323063782532353344253235323233302532353235253235323225323532306379253235334425323532322d3330253235323525323532322532353230722532353344253235323232253235323225323532306964253235334425323532326125323532322532353345253235334373746f7025323532306f666673657425323533442532353232323025323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233464645413934253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232343525323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233443339373530253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232383025323532352532353232253235323073746f702d636f6c6f722532353344253235323225323532333531323930462532353232253235324625323533452532353343253235324672616469616c4772616469656e7425323533452532353343253235324664656673253235334525323533437265637425323532307769647468253235334425323532323130302532353235253235323225323532306865696768742532353344253235323231303025323532352532353232253235323066696c6c2532353344253235323275726c2825323532336129253235323225323532462532353345253235334370617468253235323064253235334425323532326d32332e373036253235323031352e3931382532353230322e3630322532353230312e3338632e3333372e3230382e3534382e3534382e3534382e39333676352e393039633025323532302e3336352d2e3138332e3637372d2e34372e3838356c2d322e37362532353230312e373761312e3034352532353230312e3034352532353230302532353230302532353230312d312e3039322e3035346c2d322e3231322d312e3139372532353230332e3830322d322e32392e3032362d342e3432362d322e3836342d312e35312532353230322e3432322d312e3530387a6d2d312e3639322532353230372e3431392e3632342e3331312d322e3432322532353230312e3438342d2e3632342d2e3331322532353230322e3432322d312e3438337a6d2d2e3431362d312e3036382e3632342e3331322d322e3432322532353230312e3438332d2e3635322d2e3331322532353230322e3434372d312e3438337a6d2d312e3536322d392e3730392532353230322e3130372532353230312e3131392d332e3739392532353230322e3331382d2e3032352532353230342e342532353230322e3836332532353230312e3533372d322e3432322532353230312e35312d322e3439382d312e333535632d2e3431362d2e3230382d2e3635322d2e3635322d2e3635322d312e3039335631352e333263302d2e3431362e3230382d2e3833322e3537332d312e3036386c322e3535322d312e36333861312e3233342532353230312e3233342532353230302532353230302532353230312532353230312e332d2e3035347a6d322e3936372532353230322e3439382e3632342e3331322d322e3432322532353230312e3438342d2e3632342d2e3331322532353230322e3432322d312e3438347a6d2d2e3434312d312e3036382e3635322e3333382d322e3432322532353230312e3438332d2e3635322d2e3333372532353230322e3432322d312e3438347a25323532322532353246253235334525323533437465787425323532307825323533442532353232313525323532322532353230792532353344253235323231313025323532322532353230666f6e742d73697a6525323533442532353232313225323532322532353230666f6e742d66616d696c7925323533442532353232417269616c253235324373616e732d736572696625323532322532353345017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f722e646f69642532353343253235324674657874253235334525323533432532353246737667253235334525323533437376672532353230786d6c6e7325323533442532353232687474702532353341253235324625323532467777772e77332e6f726725323532463230303025323532467376672532353232253235323076696577426f782532353344253235323230253235323030253235323031323825323532303132382532353232253235323066696c6c253235334425323532322532353233666666253235323225323533452532353343646566732532353345253235334372616469616c4772616469656e74253235323063782532353344253235323233302532353235253235323225323532306379253235334425323532322d3330253235323525323532322532353230722532353344253235323232253235323225323532306964253235334425323532326125323532322532353345253235334373746f7025323532306f666673657425323533442532353232323025323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233464645413934253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232343525323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233443339373530253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232383025323532352532353232253235323073746f702d636f6c6f722532353344253235323225323532333531323930462532353232253235324625323533452532353343253235324672616469616c4772616469656e7425323533452532353343253235324664656673253235334525323533437265637425323532307769647468253235334425323532323130302532353235253235323225323532306865696768742532353344253235323231303025323532352532353232253235323066696c6c2532353344253235323275726c2825323532336129253235323225323532462532353345253235334370617468253235323066696c6c2d72756c65253235334425323532326576656e6f64642532353232253235323064253235334425323532324d32332e373132253235323031352e39396c322e362532353230312e333738632e3333382e3230382e3534362e3534362e3534362e39333676352e393032633025323532302e3336342d2e3138322e3637362d2e3436382e3838346c2d322e3735362532353230312e37363861312e3033372532353230312e303337253235323030253235323030312d312e3039322e3035326c2d322e32312d312e3139362532353230332e3739362d322e3238382e3032362d342e34322d322e38362d312e3530387a6d2d312e36392532353230372e34316c2e3632342e3331322d322e3431382532353230312e3438322d2e3632342d2e3331327a6d2d2e3431362d312e3036366c2e3632342e3331322d322e3431382532353230312e3438322d2e36352d2e3331327a6d32312e3030382d362e353738712e39312532353230302532353230312e3636342e3331322e3735342e3331322532353230312e3332362e3833322e3534362e35322e3835382532353230312e3234382e3238362e3730322e3238362532353230312e35333425323532303025323532302e3833322d2e3238362532353230312e3533342d2e3331322e3732382d2e3835382532353230312e3234382d2e3537322e3534362d312e3332362e3833322d2e3735342e3331322d312e3636342e3331322d2e39312532353230302d312e3636342d2e3331322d2e3735342d2e3238362d312e332d2e3833322d2e3534362d2e35322d2e3835382d312e3234382d2e3331322d2e3730322d2e3331322d312e3533342532353230302d2e3833322e3331322d312e3533342e3331322d2e3732382e3835382d312e32343874312e332d2e383332712e3735342d2e3331322532353230312e3636342d2e3331327a6d2d32322e3536382d332e31326c322e3130362532353230312e3131382d332e3739362532353230322e3331342d2e3032362532353230342e3339342532353230322e38362532353230312e3533342d322e3431382532353230312e3530382d322e3439362d312e333532632d2e3431362d2e3230382d2e36352d2e36352d2e36352d312e303932762d352e36363863302d2e3431362e3230382d2e3833322e3537322d312e3036366c322e3534382d312e363338632e33392d2e32362e3838342d2e3238362532353230312e332d2e3035327a6d31332e3835382532353230332e333534712e3735342532353230302532353230312e34332e3331322e3637362e3331322532353230312e31372e3830362e3439342e35322e37382532353230312e3139362e3238362e3637362e3238362532353230312e343325323532303025323532302e3732382d2e3238362532353230312e3430342d2e3238362e3637362d2e37382532353230312e3139362d2e3439342e3439342d312e31372e3830362d2e36352e3331322d312e34332e333132682d322e343138612e3435362e343536253235323030253235323030312d2e3434322d2e343432762d362e35353263302d2e32362e3230382d2e3436382e3434322d2e3436387a6d31352e36253235323030632e323625323532303025323532302e3434322e3230382e3434322e34363876362e353532612e3433382e343338253235323030253235323030312d2e3434322e343432682d312e303636632d2e32362532353230302d2e3436382d2e3230382d2e3436382d2e343432762d362e353532612e3436352e343635253235323030253235323030312e3436382d2e3436387a6d342e383336253235323030712e3735342532353230302532353230312e34332e3331322e3637362e3331322532353230312e31372e3830362e3439342e35322e37382532353230312e3139362e3238362e3637362e3238362532353230312e343325323532303025323532302e3732382d2e3238362532353230312e3430342d2e3238362e3637362d2e37382532353230312e3139362d2e3439342e3439342d312e31372e3830362d2e36352e3331322d312e34332e333132682d322e343138612e3435362e343536253235323030253235323030312d2e3434322d2e343432762d362e35353263302d2e32362e3230382d2e3436382e3434322d2e3436387a6d2d31312e3737382532353230312e363634712d2e3431362532353230302d2e3830362e3135362d2e3336342e3135362d2e36352e3431362d2e3238362e3238362d2e3436382e3637362d2e3135362e3336342d2e3135362e38333225323532303025323532302e3434322e3135362e3830362e3138322e33392e3436382e3637362e3238362e32362e36352e3431362e33392e3135362e3830362e3135362e34313625323532303025323532302e3830362d2e3135362e3336342d2e3135362e36352d2e3431362e3331322d2e3238362e3436382d2e3637362e3135362d2e3336342e3135362d2e3830362532353230302d2e3436382d2e3135362d2e3833322d2e3135362d2e33392d2e3436382d2e3637362d2e3238362d2e32362d2e36352d2e3431362d2e33392d2e3135362d2e3830362d2e3135367a6d2d392e3135322d2e303738682d2e313536632d2e3135362532353230302d2e3238362e31332d2e3238362e33313276332e353336612e3238392e323839253235323030253235323030302e3238362e323836682e313536712e34393425323532303025323532302e39312d2e3135362e33392d2e3135362e36352d2e3431362e3238362d2e3238362e3431362d2e36352e3135362d2e33392e3135362d2e3833322532353230302d2e3434322d2e3135362d2e3833322d2e31332d2e33392d2e3431362d2e36352d2e32362d2e3238362d2e3637362d2e3434322d2e33392d2e3135362d2e3838342d2e3135367a6d32302e343838253235323030682d2e3133612e332e33253235323030253235323030302d2e3331322e33313276332e353336633025323532302e3135362e31332e3238362e3331322e323836682e3133712e353225323532303025323532302e39312d2e313536742e3637362d2e343136712e32362d2e3238362e3431362d2e36352e31332d2e33392e31332d2e3833322532353230302d2e3434322d2e31332d2e3833322d2e3135362d2e33392d2e3434322d2e36352d2e32362d2e3238362d2e36352d2e3434322d2e3431362d2e3135362d2e39312d2e3135367a4d32332e3031253235323031352e3133326c2e3632342e3331322d322e3431382532353230312e3438322d2e3632342d2e3331327a6d2d2e3434322d312e3036366c2e36352e3333382d322e3431382532353230312e3438322d2e36352d2e3333387a2532353232253235324625323533452532353343253235324673766725323533452532322532432532326465736372697074696f6e25323225334125323241253230444f49442532306c6f636b25323070617373253243253230776974682532302e253232253243253232696d61676525323225334125323264617461253341696d616765253246737667253242786d6c25334275746638253243646174613a6170706c69636174696f6e2f6a736f6e3b757466382c2537422532326e616d65253232253341253232444f49442532304c6f636b25323050617373253230253233a26469706673582212200400a10de8c7d1b18f7efe1a187c5411ec24541d2c98de47888c2febf378198864736f6c63430008040033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061030c5760003560e01c806391d148541161019d578063cad637c9116100e9578063e985e9c5116100a2578063ebedf8501161007c578063ebedf850146107de578063f03590bf146107f1578063f17f68ad14610804578063fc4ddc621461082b57600080fd5b8063e985e9c51461077c578063ea5f3188146107b8578063eac9fa4c146107cb57600080fd5b8063cad637c9146106ae578063cc637afe146106ce578063d547741f146106e1578063dfdf9e65146106f4578063e4b781db14610720578063e787a2171461076957600080fd5b8063a579549311610156578063c317891a11610130578063c317891a14610662578063c45a499114610675578063c87b56dd14610688578063ca15c8731461069b57600080fd5b8063a57954931461061c578063b88d4fde1461062f578063c2cd43241461064257600080fd5b806391d14854146105c057806395d89b41146105d35780639dd984b1146105db5780639ef502a4146105ee578063a217fddf14610601578063a22cb4651461060957600080fd5b80633b05e85f1161025c5780635a588d7b1161021557806379c7db5a116101ef57806379c7db5a1461051b57806385cc8d1d146105345780639010d07c1461059a57806390657147146105ad57600080fd5b80635a588d7b146104d55780636352211e146104f557806370a082311461050857600080fd5b80633b05e85f1461046357806342842e0e146104765780634bff5009146104895780634ec0b21e1461049c5780634f558e79146104af5780634f6ccce7146104c257600080fd5b806323b872dd116102c95780632698d205116102a35780632698d205146104175780632f2ff15d1461042a5780632f745c591461043d57806336568abe1461045057600080fd5b806323b872dd146103b3578063248a9ca3146103c6578063250c72d9146103e957600080fd5b806301ffc9a71461031157806306fdde0314610339578063081812fc1461034e578063095ea7b31461037957806318160ddd1461038e5780631a47767b146103a0575b600080fd5b61032461031f3660046135bf565b61083e565b60405190151581526020015b60405180910390f35b61034161084f565b60405161033091906139a0565b61036161035c366004613520565b6108e1565b6040516001600160a01b039091168152602001610330565b61038c610387366004613450565b610908565b005b60cb545b604051908152602001610330565b61038c6103ae3660046132ba565b610a23565b61038c6103c1366004613306565b610a63565b6103926103d4366004613520565b600090815260fb602052604090206001015490565b6103fc6103f7366004613520565b610a94565b60408051938452602084019290925290820152606001610330565b61038c6104253660046135f7565b610b58565b61038c610438366004613538565b610eb5565b61039261044b366004613450565b610eda565b61038c61045e366004613538565b610f70565b61038c610471366004613520565b610fee565b61038c610484366004613306565b610fff565b610361610497366004613667565b61101a565b6103616104aa36600461355a565b61102d565b6103246104bd366004613520565b6110d9565b6103926104d0366004613520565b6110f8565b6104e86104e33660046132ba565b611199565b6040516103309190613906565b610361610503366004613520565b6112b6565b6103926105163660046132ba565b611316565b610392610529366004613667565b805160209091012090565b61058d610542366004613520565b60408051606080820183526000808352602080840182905292840181905293845260048252928290208251938401835280548452600181015491840191909152600201549082015290565b6040516103309190613ae4565b6103616105a836600461359e565b61139c565b61038c6105bb3660046133e0565b6113bc565b6103246105ce366004613538565b6114e4565b61034161150f565b61038c6105e9366004613520565b61151e565b6103246105fc366004613667565b611605565b610392600081565b61038c6106173660046133a6565b611634565b61039261062a366004613667565b61163f565b61038c61063d366004613341565b611652565b610392610650366004613520565b60009081526008602052604090205490565b61038c610670366004613479565b611684565b61032461068336600461355a565b611732565b610341610696366004613520565b611769565b6103926106a9366004613520565b611963565b6106c16106bc3660046132ba565b61197b565b6040516103309190613968565b6103246106dc366004613667565b611a33565b61038c6106ef366004613538565b611a7a565b6103246107023660046132ba565b6001600160a01b031660009081526007602052604090205460ff1690565b61075461072e3660046132ba565b6001600160a01b0316600090815260208181526040808320546001909252909120549091565b60408051928352602083019190915201610330565b61038c61077736600461355a565b611a9f565b61032461078a3660046132d4565b6001600160a01b039182166000908152609c6020908152604080832093909416825291909152205460ff1690565b61038c6107c6366004613699565b611b1a565b61038c6107d93660046132ba565b611bea565b6103246107ec36600461355a565b611c18565b6103416107ff366004613520565b611c41565b6103927f639cc15674e3ab889ef8ffacb1499d6c868345f7a98e2158a7d43d23a757f8e081565b610361610839366004613520565b611d09565b600061084982611d21565b92915050565b60606097805461085e90613bda565b80601f016020809104026020016040519081016040528092919081815260200182805461088a90613bda565b80156108d75780601f106108ac576101008083540402835291602001916108d7565b820191906000526020600020905b8154815290600101906020018083116108ba57829003601f168201915b5050505050905090565b60006108ec82611d46565b506000908152609b60205260409020546001600160a01b031690565b6000610913826112b6565b9050806001600160a01b0316836001600160a01b031614156109865760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806109a257506109a2813361078a565b610a145760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000606482015260840161097d565b610a1e8383611da8565b505050565b610a42600073afb2e1145f1a88ce489d22425ac84003fe50b3be611e16565b6001600160a01b03166000908152600760205260409020805460ff19169055565b610a6d3382611e7a565b610a895760405162461bcd60e51b815260040161097d90613a96565b610a1e838383611ef9565b600060066000805160206143138339815191527f03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760841415610afe575060059150600290507f03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760610b51565b7f1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a69111841415610b51575060059150600490507f1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a691115b9193909250565b3360009081526007602052604090205460ff1615610b9d5760405162461bcd60e51b8152602060048201526002602482015261495560f01b604482015260640161097d565b336000908152600760205260409020805460ff1916600117905580610c62576000610bc8838661102d565b6001600160a01b0381166000908152602081815260408083205460019092529091205491925010610c205760405162461bcd60e51b8152602060048201526002602482015261494360f01b604482015260640161097d565b6001600160a01b0381166000908152602081905260408120805460019290610c49908490613b35565b9091555050600580546001019055600554915050610d40565b6000818152609960205260409020546001600160a01b031615610cac5760405162461bcd60e51b8152602060048201526002602482015261494960f01b604482015260640161097d565b604080516020808201849052818301859052825180830384018152606090920190925280519101206000610ce0828761102d565b9050610d0c7f639cc15674e3ab889ef8ffacb1499d6c868345f7a98e2158a7d43d23a757f8e0826114e4565b610d3d5760405162461bcd60e51b815260206004820152600260248201526124a960f11b604482015260640161097d565b50505b825160208401206000906040805160608101825284815260208082018781526000838501818152888252600490935293909320915182559151600182015590516002909101559050610d9233836120a0565b600080610d9e85610a94565b509150915060005b82811015610e4f57610dbc600580546001019055565b6040518060600160405280610dd060055490565b8152600080516020614313833981519152602082015260006040909101819052600490610dfc60055490565b8152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050610e3d33610e3860055490565b6120a0565b80610e4781613c15565b915050610da6565b50610e5c848785846121ee565b507f3c4c11cb99694364366ba395fa5e9613f318b30e96d8469e5a109fce66a345d333610e8a846001613b35565b604080516001600160a01b03909316835260208301919091520160405180910390a150505050505050565b600082815260fb6020526040902060010154610ed0816123a2565b610a1e83836123ac565b6000610ee583611316565b8210610f475760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161097d565b506001600160a01b0391909116600090815260c960209081526040808320938352929052205490565b6001600160a01b0381163314610fe05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161097d565b610fea82826123cf565b5050565b6000610ff9816123a2565b50600555565b610a1e83838360405180602001604052806000815250611652565b8051602082012060009061084990611d09565b60006000805160206143138339815191528314801561104d575081516020145b1561105f575060208101518218610849565b60006040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152509050600081856040516020016110ae929190613707565b6040516020818303038152906040528051906020012090506110d081856123f2565b95945050505050565b6000818152609960205260408120546001600160a01b03161515610849565b600061110360cb5490565b82106111665760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161097d565b60cb828154811061118757634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b606060006111a683611316565b6001600160401b038111156111cb57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561121657816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816111e95790505b50905060005b61122584611316565b8110156112af576004600061123a8684610eda565b8152602001908152602001600020604051806060016040529081600082015481526020016001820154815260200160028201548152505082828151811061129157634e487b7160e01b600052603260045260246000fd5b602002602001018190525080806112a790613c15565b91505061121c565b5092915050565b6000818152609960205260408120546001600160a01b0316806108495760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161097d565b60006001600160a01b0382166113805760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161097d565b506001600160a01b03166000908152609a602052604090205490565b600082815261012d602052604081206113b5908361246a565b9392505050565b603254610100900460ff16158080156113dc5750603254600160ff909116105b806113f65750303b1580156113f6575060325460ff166001145b6114595760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161097d565b6032805460ff19166001179055801561147c576032805461ff0019166101001790555b611487600085612476565b6114918383612480565b620186a060055580156114de576032805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606098805461085e90613bda565b33611528826112b6565b6001600160a01b0316146115635760405162461bcd60e51b8152602060048201526002602482015261049560f41b604482015260640161097d565b600081815260046020526040902060020154806115925760405162461bcd60e51b815260040161097d906139dd565b6009546001600160a01b031663141eed676115ac83611c41565b336040518363ffffffff1660e01b81526004016115ca9291906139b3565b600060405180830381600087803b1580156115e457600080fd5b505af11580156115f8573d6000803e3d6000fd5b50505050610fea826124b1565b60006006600061161a84805160209091012090565b815260208101919091526040016000205460ff1692915050565b610fea338383612558565b8051602082012060009061084990610650565b61165c3383611e7a565b6116785760405162461bcd60e51b815260040161097d90613a96565b6114de84848484612627565b61168f6000336114e4565b6116c05760405162461bcd60e51b815260206004820152600260248201526124a960f11b604482015260640161097d565b60005b8151811015610fea576001600660008484815181106116f257634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061172a90613c15565b9150506116c3565b600061173e8383611c18565b61174a57506000610849565b61175382611a33565b1561176057506000610849565b50600192915050565b606061177482611d46565b600082815260046020908152604091829020825160608181018552825482526001830154938201939093526002909101549281018390529091829190156118685760006117c48260400151611c41565b9050806040518060400160405280600e81526020016d0b991bda59094c8c1b1bd8dad95960921b8152506040516020016117ff929190613729565b60408051601f198184030181526106a08301909152610676808352909550613c9d6020830139816040518060600160405280602a8152602001614333602a913960405160200161185193929190613758565b6040516020818303038152906040529250506118bf565b6040518060400160405280601881526020017f6e6f2532306e616d652532306c6f636b65642532307965740000000000000000815250925060405180610ce00160405280610cb7815260200161435d610cb7913991505b60405180608001604052806046815260200161508e604691396118e18661265a565b60405180606001604052806040815260200161501460409139856040518060600160405280603a8152602001615054603a91398660405180604001604052806006815260200165094c8c894dd160d21b81525060405160200161194a979695949392919061379b565b6040516020818303038152906040529350505050919050565b600081815261012d6020526040812061084990612773565b6060600061198883611316565b6001600160401b038111156119ad57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156119d6578160200160208202803683370190505b50905060005b6119e584611316565b8110156112af576119f68482610eda565b828281518110611a1657634e487b7160e01b600052603260045260246000fd5b602090810291909101015280611a2b81613c15565b9150506119dc565b805160208083019190912060008181526006909252604082205460ff1615611a5e5750600192915050565b6000818152600860205260409020546117605750600092915050565b600082815260fb6020526040902060010154611a95816123a2565b610a1e83836123cf565b805160208083019190912060008481526004835260408082208151606081018352815481526001820154958101869052600290910154918101919091529192611ae790610a94565b50915050611af7858585846121ee565b611b135760405162461bcd60e51b815260040161097d906139dd565b5050505050565b6000611b25816123a2565b611b33600580546001019055565b6000611b3e60055490565b60408051606081018252828152600080516020614313833981519152602080830191825260008385018181528682526004909252939093209151825551600182015590516002909101559050611b9433826120a0565b835160208501206000906000818152600660205260409020805460ff191690559050611bc382868360026121ee565b611bdf5760405162461bcd60e51b815260040161097d906139dd565b611b13338584611ef9565b6000611bf5816123a2565b50600980546001600160a01b0319166001600160a01b0392909216919091179055565b600082611c248361277d565b101580156113b557506040611c388361277d565b11159392505050565b6000818152600360205260409020805460609190611c5e90613bda565b15159050611c6b57600080fd5b60008281526003602052604090208054611c8490613bda565b80601f0160208091040260200160405190810160405280929190818152602001828054611cb090613bda565b8015611cfd5780601f10611cd257610100808354040283529160200191611cfd565b820191906000526020600020905b815481529060010190602001808311611ce057829003601f168201915b50505050509050919050565b600081815260086020526040812054610849906112b6565b60006001600160e01b03198216635a05180f60e01b148061084957506108498261289b565b6000818152609960205260409020546001600160a01b0316611da55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161097d565b50565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611ddd826112b6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611e2082826114e4565b610fea57611e38816001600160a01b031660146128c0565b611e438360206128c0565b604051602001611e5492919061382d565b60408051601f198184030181529082905262461bcd60e51b825261097d916004016139a0565b600080611e86836112b6565b9050806001600160a01b0316846001600160a01b03161480611ecd57506001600160a01b038082166000908152609c602090815260408083209388168352929052205460ff165b80611ef15750836001600160a01b0316611ee6846108e1565b6001600160a01b0316145b949350505050565b826001600160a01b0316611f0c826112b6565b6001600160a01b031614611f705760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161097d565b6001600160a01b038216611fd25760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161097d565b611fdd838383612aa1565b611fe8600082611da8565b6001600160a01b0383166000908152609a60205260408120805460019290612011908490613b80565b90915550506001600160a01b0382166000908152609a6020526040812080546001929061203f908490613b35565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0382166120f65760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161097d565b6000818152609960205260409020546001600160a01b03161561215b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161097d565b61216760008383612aa1565b6001600160a01b0382166000908152609a60205260408120805460019290612190908490613b35565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008084511161220057506000611ef1565b3361220a866112b6565b6001600160a01b0316146122455760405162461bcd60e51b8152602060048201526002602482015261049560f41b604482015260640161097d565b600085815260046020526040902060020154156122895760405162461bcd60e51b8152602060048201526002602482015261105360f21b604482015260640161097d565b6122938285611732565b6122d4577ffd5de27667e5407df5be0b6efb7f86ae8c40433040399a5e4d36a46ccc50638d6040516122c4906139dd565b60405180910390a1506000611ef1565b600083815260036020908152604090912085516122f39287019061319b565b50600083815260086020908152604080832088905587835260048252808320600201869055338352600190915290205461235c573360008181526020819052604081205561234090611316565b61234b906003613b61565b336000908152600160205260409020555b7fe027feb30eed511dd4e4d2b66336f11312e4d33989a51f4891ee80a5a98e950833868660405161238f939291906138df565b60405180910390a1506001949350505050565b611da58133611e16565b6123b68282612b59565b600082815261012d60205260409020610a1e9082612bdf565b6123d98282612bf4565b600082815261012d60205260409020610a1e9082612c5b565b6020818101516040808401516060808601518351600080825296810180865289905290861a9381018490529081018490526080810182905290919060019060a0016020604051602081039080840390855afa158015612455573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b60006113b58383612c70565b610fea82826123ac565b603254610100900460ff166124a75760405162461bcd60e51b815260040161097d90613a4b565b610fea8282612ca8565b60006124bc826112b6565b90506124ca81600084612aa1565b6124d5600083611da8565b6001600160a01b0381166000908152609a602052604081208054600192906124fe908490613b80565b909155505060008281526099602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031614156125ba5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161097d565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612632848484611ef9565b61263e84848484612cf6565b6114de5760405162461bcd60e51b815260040161097d906139f9565b60608161267e5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156126a8578061269281613c15565b91506126a19050600a83613b4d565b9150612682565b6000816001600160401b038111156126d057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156126fa576020820181803683370190505b5090505b8415611ef15761270f600183613b80565b915061271c600a86613c30565b612727906030613b35565b60f81b81838151811061274a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061276c600a86613b4d565b94506126fe565b6000610849825490565b8051600090819081905b808210156128925760008583815181106127b157634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b0319169050600160ff1b8110156127e0576127d9600184613b35565b925061287f565b836127ea81613c15565b945050600760fd1b6001600160f81b03198216101561280e576127d9600284613b35565b600f60fc1b6001600160f81b03198216101561282f576127d9600384613b35565b601f60fb1b6001600160f81b031982161015612850576127d9600484613b35565b603f60fa1b6001600160f81b031982161015612871576127d9600584613b35565b61287c600684613b35565b92505b508261288a81613c15565b935050612787565b50909392505050565b60006001600160e01b03198216637965db0b60e01b1480610849575061084982612e00565b606060006128cf836002613b61565b6128da906002613b35565b6001600160401b038111156128ff57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612929576020820181803683370190505b509050600360fc1b8160008151811061295257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061298f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006129b3846002613b61565b6129be906001613b35565b90505b6001811115612a52576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612a0057634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110612a2457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612a4b81613bc3565b90506129c1565b5083156113b55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161097d565b6001600160a01b038316612afc57612af78160cb8054600083815260cc60205260408120829055600182018355919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0155565b612b1f565b816001600160a01b0316836001600160a01b031614612b1f57612b1f8382612e25565b6001600160a01b038216612b3657610a1e81612ec2565b826001600160a01b0316826001600160a01b031614610a1e57610a1e8282612f9b565b612b6382826114e4565b610fea57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612b9b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113b5836001600160a01b038416612fdf565b612bfe82826114e4565b15610fea57600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006113b5836001600160a01b03841661302e565b6000826000018281548110612c9557634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b603254610100900460ff16612ccf5760405162461bcd60e51b815260040161097d90613a4b565b8151612ce290609790602085019061319b565b508051610a1e90609890602084019061319b565b60006001600160a01b0384163b15612df857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612d3a9033908990889088906004016138a2565b602060405180830381600087803b158015612d5457600080fd5b505af1925050508015612d84575060408051601f3d908101601f19168201909252612d81918101906135db565b60015b612dde573d808015612db2576040519150601f19603f3d011682016040523d82523d6000602084013e612db7565b606091505b508051612dd65760405162461bcd60e51b815260040161097d906139f9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ef1565b506001611ef1565b60006001600160e01b0319821663780e9d6360e01b148061084957506108498261314b565b60006001612e3284611316565b612e3c9190613b80565b600083815260ca6020526040902054909150808214612e8f576001600160a01b038416600090815260c960209081526040808320858452825280832054848452818420819055835260ca90915290208190555b50600091825260ca602090815260408084208490556001600160a01b03909416835260c981528383209183525290812055565b60cb54600090612ed490600190613b80565b600083815260cc602052604081205460cb8054939450909284908110612f0a57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508060cb8381548110612f3957634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260cc909152604080822084905585825281205560cb805480612f7f57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000612fa683611316565b6001600160a01b03909316600090815260c960209081526040808320868452825280832085905593825260ca9052919091209190915550565b600081815260018301602052604081205461302657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610849565b506000610849565b60008181526001830160205260408120548015613141576000613052600183613b80565b855490915060009061306690600190613b80565b90508181146130e757600086600001828154811061309457634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050808760000184815481106130c557634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061310657634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610849565b6000915050610849565b60006001600160e01b031982166380ac58cd60e01b148061317c57506001600160e01b03198216635b5e139f60e01b145b8061084957506301ffc9a760e01b6001600160e01b0319831614610849565b8280546131a790613bda565b90600052602060002090601f0160209004810192826131c9576000855561320f565b82601f106131e257805160ff191683800117855561320f565b8280016001018555821561320f579182015b8281111561320f5782518255916020019190600101906131f4565b5061321b92915061321f565b5090565b5b8082111561321b5760008155600101613220565b80356001600160a01b038116811461324b57600080fd5b919050565b600082601f830112613260578081fd5b81356001600160401b0381111561327957613279613c70565b61328c601f8201601f1916602001613b05565b8181528460208386010111156132a0578283fd5b816020850160208301379081016020019190915292915050565b6000602082840312156132cb578081fd5b6113b582613234565b600080604083850312156132e6578081fd5b6132ef83613234565b91506132fd60208401613234565b90509250929050565b60008060006060848603121561331a578081fd5b61332384613234565b925061333160208501613234565b9150604084013590509250925092565b60008060008060808587031215613356578081fd5b61335f85613234565b935061336d60208601613234565b92506040850135915060608501356001600160401b0381111561338e578182fd5b61339a87828801613250565b91505092959194509250565b600080604083850312156133b8578182fd5b6133c183613234565b9150602083013580151581146133d5578182fd5b809150509250929050565b6000806000606084860312156133f4578283fd5b6133fd84613234565b925060208401356001600160401b0380821115613418578384fd5b61342487838801613250565b93506040860135915080821115613439578283fd5b5061344686828701613250565b9150509250925092565b60008060408385031215613462578182fd5b61346b83613234565b946020939093013593505050565b6000602080838503121561348b578182fd5b82356001600160401b03808211156134a1578384fd5b818501915085601f8301126134b4578384fd5b8135818111156134c6576134c6613c70565b8060051b91506134d7848301613b05565b8181528481019084860184860187018a10156134f1578788fd5b8795505b838610156135135780358352600195909501949186019186016134f5565b5098975050505050505050565b600060208284031215613531578081fd5b5035919050565b6000806040838503121561354a578182fd5b823591506132fd60208401613234565b6000806040838503121561356c578182fd5b8235915060208301356001600160401b03811115613588578182fd5b61359485828601613250565b9150509250929050565b600080604083850312156135b0578182fd5b50508035926020909101359150565b6000602082840312156135d0578081fd5b81356113b581613c86565b6000602082840312156135ec578081fd5b81516113b581613c86565b6000806000806080858703121561360c578182fd5b84356001600160401b0380821115613622578384fd5b61362e88838901613250565b95506020870135915080821115613643578384fd5b5061365087828801613250565b949794965050505060408301359260600135919050565b600060208284031215613678578081fd5b81356001600160401b0381111561368d578182fd5b611ef184828501613250565b600080604083850312156136ab578182fd5b82356001600160401b038111156136c0578283fd5b6136cc85828601613250565b9250506132fd60208401613234565b600081518084526136f3816020860160208601613b97565b601f01601f19169290920160200192915050565b60008351613719818460208801613b97565b9190910191825250602001919050565b6000835161373b818460208801613b97565b83519083019061374f818360208801613b97565b01949350505050565b6000845161376a818460208901613b97565b84519083019061377e818360208901613b97565b8451910190613791818360208801613b97565b0195945050505050565b6000885160206137ae8285838e01613b97565b8951918401916137c18184848e01613b97565b89519201916137d38184848d01613b97565b88519201916137e58184848c01613b97565b87519201916137f78184848b01613b97565b86519201916138098184848a01613b97565b855192019161381b8184848901613b97565b919091019a9950505050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613865816017850160208801613b97565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613896816028840160208801613b97565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906138d5908301846136db565b9695505050505050565b60018060a01b03841681528260208201526060604082015260006110d060608301846136db565b6020808252825182820181905260009190848201906040850190845b8181101561395c576139498385518051825260208082015190830152604090810151910152565b9284019260609290920191600101613922565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561395c57835183529284019291840191600101613984565b6020815260006113b560208301846136db565b6040815260006139c660408301856136db565b905060018060a01b03831660208301529392505050565b60208082526002908201526124a760f11b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b81518152602080830151908201526040808301519082015260608101610849565b604051601f8201601f191681016001600160401b0381118282101715613b2d57613b2d613c70565b604052919050565b60008219821115613b4857613b48613c44565b500190565b600082613b5c57613b5c613c5a565b500490565b6000816000190483118215151615613b7b57613b7b613c44565b500290565b600082821015613b9257613b92613c44565b500390565b60005b83811015613bb2578181015183820152602001613b9a565b838111156114de5750506000910152565b600081613bd257613bd2613c44565b506000190190565b600181811c90821680613bee57607f821691505b60208210811415613c0f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613c2957613c29613c44565b5060010190565b600082613c3f57613c3f613c5a565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114611da557600080fdfe25323533437376672532353230786d6c6e7325323533442532353232687474702532353341253235324625323532467777772e77332e6f726725323532463230303025323532467376672532353232253235323076696577426f782532353344253235323230253235323030253235323031323825323532303132382532353232253235323066696c6c253235334425323532322532353233666666253235323225323533452532353343646566732532353345253235334372616469616c4772616469656e74253235323063782532353344253235323233302532353235253235323225323532306379253235334425323532322d3330253235323525323532322532353230722532353344253235323232253235323225323532306964253235334425323532326125323532322532353345253235334373746f7025323532306f666673657425323533442532353232323025323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233464645413934253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232343525323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233443339373530253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232383025323532352532353232253235323073746f702d636f6c6f722532353344253235323225323532333531323930462532353232253235324625323533452532353343253235324672616469616c4772616469656e7425323533452532353343253235324664656673253235334525323533437265637425323532307769647468253235334425323532323130302532353235253235323225323532306865696768742532353344253235323231303025323532352532353232253235323066696c6c2532353344253235323275726c2825323532336129253235323225323532462532353345253235334370617468253235323064253235334425323532326d32332e373036253235323031352e3931382532353230322e3630322532353230312e3338632e3333372e3230382e3534382e3534382e3534382e39333676352e393039633025323532302e3336352d2e3138332e3637372d2e34372e3838356c2d322e37362532353230312e373761312e3034352532353230312e3034352532353230302532353230302532353230312d312e3039322e3035346c2d322e3231322d312e3139372532353230332e3830322d322e32392e3032362d342e3432362d322e3836342d312e35312532353230322e3432322d312e3530387a6d2d312e3639322532353230372e3431392e3632342e3331312d322e3432322532353230312e3438342d2e3632342d2e3331322532353230322e3432322d312e3438337a6d2d2e3431362d312e3036382e3632342e3331322d322e3432322532353230312e3438332d2e3635322d2e3331322532353230322e3434372d312e3438337a6d2d312e3536322d392e3730392532353230322e3130372532353230312e3131392d332e3739392532353230322e3331382d2e3032352532353230342e342532353230322e3836332532353230312e3533372d322e3432322532353230312e35312d322e3439382d312e333535632d2e3431362d2e3230382d2e3635322d2e3635322d2e3635322d312e3039335631352e333263302d2e3431362e3230382d2e3833322e3537332d312e3036386c322e3535322d312e36333861312e3233342532353230312e3233342532353230302532353230302532353230312532353230312e332d2e3035347a6d322e3936372532353230322e3439382e3632342e3331322d322e3432322532353230312e3438342d2e3632342d2e3331322532353230322e3432322d312e3438347a6d2d2e3434312d312e3036382e3635322e3333382d322e3432322532353230312e3438332d2e3635322d2e3333372532353230322e3432322d312e3438347a25323532322532353246253235334525323533437465787425323532307825323533442532353232313525323532322532353230792532353344253235323231313025323532322532353230666f6e742d73697a6525323533442532353232313225323532322532353230666f6e742d66616d696c7925323533442532353232417269616c253235324373616e732d736572696625323532322532353345017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f722e646f69642532353343253235324674657874253235334525323533432532353246737667253235334525323533437376672532353230786d6c6e7325323533442532353232687474702532353341253235324625323532467777772e77332e6f726725323532463230303025323532467376672532353232253235323076696577426f782532353344253235323230253235323030253235323031323825323532303132382532353232253235323066696c6c253235334425323532322532353233666666253235323225323533452532353343646566732532353345253235334372616469616c4772616469656e74253235323063782532353344253235323233302532353235253235323225323532306379253235334425323532322d3330253235323525323532322532353230722532353344253235323232253235323225323532306964253235334425323532326125323532322532353345253235334373746f7025323532306f666673657425323533442532353232323025323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233464645413934253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232343525323532352532353232253235323073746f702d636f6c6f72253235334425323532322532353233443339373530253235323225323532462532353345253235334373746f7025323532306f666673657425323533442532353232383025323532352532353232253235323073746f702d636f6c6f722532353344253235323225323532333531323930462532353232253235324625323533452532353343253235324672616469616c4772616469656e7425323533452532353343253235324664656673253235334525323533437265637425323532307769647468253235334425323532323130302532353235253235323225323532306865696768742532353344253235323231303025323532352532353232253235323066696c6c2532353344253235323275726c2825323532336129253235323225323532462532353345253235334370617468253235323066696c6c2d72756c65253235334425323532326576656e6f64642532353232253235323064253235334425323532324d32332e373132253235323031352e39396c322e362532353230312e333738632e3333382e3230382e3534362e3534362e3534362e39333676352e393032633025323532302e3336342d2e3138322e3637362d2e3436382e3838346c2d322e3735362532353230312e37363861312e3033372532353230312e303337253235323030253235323030312d312e3039322e3035326c2d322e32312d312e3139362532353230332e3739362d322e3238382e3032362d342e34322d322e38362d312e3530387a6d2d312e36392532353230372e34316c2e3632342e3331322d322e3431382532353230312e3438322d2e3632342d2e3331327a6d2d2e3431362d312e3036366c2e3632342e3331322d322e3431382532353230312e3438322d2e36352d2e3331327a6d32312e3030382d362e353738712e39312532353230302532353230312e3636342e3331322e3735342e3331322532353230312e3332362e3833322e3534362e35322e3835382532353230312e3234382e3238362e3730322e3238362532353230312e35333425323532303025323532302e3833322d2e3238362532353230312e3533342d2e3331322e3732382d2e3835382532353230312e3234382d2e3537322e3534362d312e3332362e3833322d2e3735342e3331322d312e3636342e3331322d2e39312532353230302d312e3636342d2e3331322d2e3735342d2e3238362d312e332d2e3833322d2e3534362d2e35322d2e3835382d312e3234382d2e3331322d2e3730322d2e3331322d312e3533342532353230302d2e3833322e3331322d312e3533342e3331322d2e3732382e3835382d312e32343874312e332d2e383332712e3735342d2e3331322532353230312e3636342d2e3331327a6d2d32322e3536382d332e31326c322e3130362532353230312e3131382d332e3739362532353230322e3331342d2e3032362532353230342e3339342532353230322e38362532353230312e3533342d322e3431382532353230312e3530382d322e3439362d312e333532632d2e3431362d2e3230382d2e36352d2e36352d2e36352d312e303932762d352e36363863302d2e3431362e3230382d2e3833322e3537322d312e3036366c322e3534382d312e363338632e33392d2e32362e3838342d2e3238362532353230312e332d2e3035327a6d31332e3835382532353230332e333534712e3735342532353230302532353230312e34332e3331322e3637362e3331322532353230312e31372e3830362e3439342e35322e37382532353230312e3139362e3238362e3637362e3238362532353230312e343325323532303025323532302e3732382d2e3238362532353230312e3430342d2e3238362e3637362d2e37382532353230312e3139362d2e3439342e3439342d312e31372e3830362d2e36352e3331322d312e34332e333132682d322e343138612e3435362e343536253235323030253235323030312d2e3434322d2e343432762d362e35353263302d2e32362e3230382d2e3436382e3434322d2e3436387a6d31352e36253235323030632e323625323532303025323532302e3434322e3230382e3434322e34363876362e353532612e3433382e343338253235323030253235323030312d2e3434322e343432682d312e303636632d2e32362532353230302d2e3436382d2e3230382d2e3436382d2e343432762d362e353532612e3436352e343635253235323030253235323030312e3436382d2e3436387a6d342e383336253235323030712e3735342532353230302532353230312e34332e3331322e3637362e3331322532353230312e31372e3830362e3439342e35322e37382532353230312e3139362e3238362e3637362e3238362532353230312e343325323532303025323532302e3732382d2e3238362532353230312e3430342d2e3238362e3637362d2e37382532353230312e3139362d2e3439342e3439342d312e31372e3830362d2e36352e3331322d312e34332e333132682d322e343138612e3435362e343536253235323030253235323030312d2e3434322d2e343432762d362e35353263302d2e32362e3230382d2e3436382e3434322d2e3436387a6d2d31312e3737382532353230312e363634712d2e3431362532353230302d2e3830362e3135362d2e3336342e3135362d2e36352e3431362d2e3238362e3238362d2e3436382e3637362d2e3135362e3336342d2e3135362e38333225323532303025323532302e3434322e3135362e3830362e3138322e33392e3436382e3637362e3238362e32362e36352e3431362e33392e3135362e3830362e3135362e34313625323532303025323532302e3830362d2e3135362e3336342d2e3135362e36352d2e3431362e3331322d2e3238362e3436382d2e3637362e3135362d2e3336342e3135362d2e3830362532353230302d2e3436382d2e3135362d2e3833322d2e3135362d2e33392d2e3436382d2e3637362d2e3238362d2e32362d2e36352d2e3431362d2e33392d2e3135362d2e3830362d2e3135367a6d2d392e3135322d2e303738682d2e313536632d2e3135362532353230302d2e3238362e31332d2e3238362e33313276332e353336612e3238392e323839253235323030253235323030302e3238362e323836682e313536712e34393425323532303025323532302e39312d2e3135362e33392d2e3135362e36352d2e3431362e3238362d2e3238362e3431362d2e36352e3135362d2e33392e3135362d2e3833322532353230302d2e3434322d2e3135362d2e3833322d2e31332d2e33392d2e3431362d2e36352d2e32362d2e3238362d2e3637362d2e3434322d2e33392d2e3135362d2e3838342d2e3135367a6d32302e343838253235323030682d2e3133612e332e33253235323030253235323030302d2e3331322e33313276332e353336633025323532302e3135362e31332e3238362e3331322e323836682e3133712e353225323532303025323532302e39312d2e313536742e3637362d2e343136712e32362d2e3238362e3431362d2e36352e31332d2e33392e31332d2e3833322532353230302d2e3434322d2e31332d2e3833322d2e3135362d2e33392d2e3434322d2e36352d2e32362d2e3238362d2e36352d2e3434322d2e3431362d2e3135362d2e39312d2e3135367a4d32332e3031253235323031352e3133326c2e3632342e3331322d322e3431382532353230312e3438322d2e3632342d2e3331327a6d2d2e3434322d312e3036366c2e36352e3333382d322e3431382532353230312e3438322d2e36352d2e3333387a2532353232253235324625323533452532353343253235324673766725323533452532322532432532326465736372697074696f6e25323225334125323241253230444f49442532306c6f636b25323070617373253243253230776974682532302e253232253243253232696d61676525323225334125323264617461253341696d616765253246737667253242786d6c25334275746638253243646174613a6170706c69636174696f6e2f6a736f6e3b757466382c2537422532326e616d65253232253341253232444f49442532304c6f636b25323050617373253230253233a26469706673582212200400a10de8c7d1b18f7efe1a187c5411ec24541d2c98de47888c2febf378198864736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.