Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- ERC721RaribleMeta
- Optimization enabled
- true
- Compiler version
- v0.7.6+commit.7338295f
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2024-02-09T06:48:32.249506Z
@rarible/tokens/contracts/erc-721-minimal/erc-721-minimal-meta/ERC721RaribleMeta.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "@rarible/meta-tx/contracts/EIP712MetaTransaction.sol"; import "../ERC721BaseMinimal.sol"; import "../../IsPrivateCollection.sol"; import "../../access/MinterAccessControl.sol"; contract ERC721RaribleMeta is ERC721BaseMinimal, IsPrivateCollection, MinterAccessControl, EIP712MetaTransaction { event CreateERC721Rarible(address owner, string name, string symbol); event CreateERC721RaribleUser(address owner, string name, string symbol); function __ERC721RaribleUser_init(string memory _name, string memory _symbol, string memory baseURI, string memory contractURI, address[] memory operators, address transferProxy, address lazyTransferProxy) external { __ERC721Rarible_init_unchained(_name, _symbol, baseURI, contractURI, transferProxy, lazyTransferProxy); __MetaTransaction_init_unchained("ERC721RaribleUserMeta", "1"); isPrivate = true; emit CreateERC721RaribleUser(_msgSender(), _name, _symbol); } function __ERC721Rarible_init(string memory _name, string memory _symbol, string memory baseURI, string memory contractURI, address transferProxy, address lazyTransferProxy) external { __ERC721Rarible_init_unchained(_name, _symbol, baseURI, contractURI, transferProxy, lazyTransferProxy); __MetaTransaction_init_unchained("ERC721RaribleMeta", "1"); isPrivate = false; emit CreateERC721Rarible(_msgSender(), _name, _symbol); } function _msgSender() internal view virtual override(ContextUpgradeable, EIP712MetaTransaction) returns (address payable) { return super._msgSender(); } function __ERC721Rarible_init_unchained(string memory _name, string memory _symbol, string memory baseURI, string memory contractURI, address transferProxy, address lazyTransferProxy) internal initializer { _setBaseURI(baseURI); __ERC721Lazy_init_unchained(); __RoyaltiesV2Upgradeable_init_unchained(); __Context_init_unchained(); __ERC165_init_unchained(); __Ownable_init_unchained(); __ERC721Burnable_init_unchained(); __Mint721Validator_init_unchained(); __MinterAccessControl_init_unchained(); __HasContractURI_init_unchained(contractURI); __ERC721_init_unchained(_name, _symbol); //setting default approver for transferProxies _setDefaultApproval(transferProxy, true); _setDefaultApproval(lazyTransferProxy, true); } function mintAndTransfer(LibERC721LazyMint.Mint721Data memory data, address to) public override virtual { if (isPrivate){ require(owner() == data.creators[0].account || isMinter(data.creators[0].account), "not owner or minter"); } super.mintAndTransfer(data, to); } }
@rarible/royalties-upgradeable/contracts/RoyaltiesV2Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/introspection/ERC165Upgradeable.sol"; import "@rarible/royalties/contracts/LibRoyaltiesV2.sol"; import "@rarible/royalties/contracts/RoyaltiesV2.sol"; abstract contract RoyaltiesV2Upgradeable is ERC165Upgradeable, RoyaltiesV2 { function __RoyaltiesV2Upgradeable_init_unchained() internal initializer { _registerInterface(LibRoyaltiesV2._INTERFACE_ID_ROYALTIES); } }
@rarible/lib-signature/contracts/LibSignature.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; library LibSignature { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Check the signature length if (signature.length != 65) { revert("ECDSA: invalid signature length"); } // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return recover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. require( uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value" ); // If the signature is valid (and not malleable), return the signer address // v > 30 is a special case, we need to adjust hash with "\x19Ethereum Signed Message:\n32" // and v = v - 4 address signer; if (v > 30) { require( v - 4 == 27 || v - 4 == 28, "ECDSA: invalid signature 'v' value" ); signer = ecrecover(toEthSignedMessageHash(hash), v - 4, r, s); } else { require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value"); signer = ecrecover(hash, v, r, s); } require(signer != address(0), "ECDSA: invalid signature"); return signer; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * replicates the behavior of the * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`] * JSON-RPC method. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", hash) ); } }
@rarible/lib-signature/contracts/ERC1271.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; abstract contract ERC1271 { bytes4 constant public ERC1271_INTERFACE_ID = 0xfb855dc9; // this.isValidSignature.selector bytes4 constant public ERC1271_RETURN_VALID_SIGNATURE = 0x1626ba7e; bytes4 constant public ERC1271_RETURN_INVALID_SIGNATURE = 0x00000000; /** * @dev Function must be implemented by deriving contract * @param _hash Arbitrary length data signed on the behalf of address(this) * @param _signature Signature byte array associated with _data * @return A bytes4 magic value 0x1626ba7e if the signature check passes, 0x00000000 if not * * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5) * MUST allow external calls */ function isValidSignature(bytes32 _hash, bytes memory _signature) public virtual view returns (bytes4); function returnIsValidSignatureMagicNumber(bool isValid) internal pure returns (bytes4) { return isValid ? ERC1271_RETURN_VALID_SIGNATURE : ERC1271_RETURN_INVALID_SIGNATURE; } }
@rarible/tokens/contracts/HasContractURI.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/introspection/ERC165Upgradeable.sol"; abstract contract HasContractURI is ERC165Upgradeable { string public contractURI; /* * bytes4(keccak256('contractURI()')) == 0xe8a3d485 */ bytes4 private constant _INTERFACE_ID_CONTRACT_URI = 0xe8a3d485; function __HasContractURI_init_unchained(string memory _contractURI) internal initializer { contractURI = _contractURI; _registerInterface(_INTERFACE_ID_CONTRACT_URI); } /** * @dev Internal function to set the contract URI * @param _contractURI string URI prefix to assign */ function _setContractURI(string memory _contractURI) internal { contractURI = _contractURI; } uint256[49] private __gap; }
@openzeppelin/contracts-upgradeable/introspection/IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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); }
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
@rarible/tokens/contracts/erc-721-minimal/ERC721BurnableUpgradeableMinimal.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "./ERC721UpgradeableMinimal.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be irreversibly burned (destroyed). */ abstract contract ERC721BurnableUpgradeableMinimal is Initializable, ContextUpgradeable, ERC721UpgradeableMinimal { function __ERC721Burnable_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721Burnable_init_unchained(); } function __ERC721Burnable_init_unchained() internal initializer { } /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { if(!_exists(tokenId)) { address owner = address(tokenId >> 96); require(owner == _msgSender(), "ERC721Burnable: caller is not owner, not burn"); _setBurned(tokenId); } else { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); } } uint256[50] private __gap; }
@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 `IERC721.onERC721Received.selector`. */ function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); }
@rarible/tokens/contracts/erc-721-minimal/ERC721LazyMinimal.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "./ERC721UpgradeableMinimal.sol"; import "@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol"; import "@rarible/royalties-upgradeable/contracts/RoyaltiesV2Upgradeable.sol"; import "@rarible/lazy-mint/contracts/erc-721/IERC721LazyMint.sol"; import "../Mint721Validator.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "./ERC721URI.sol"; abstract contract ERC721LazyMinimal is IERC721LazyMint, ERC721UpgradeableMinimal, Mint721Validator, RoyaltiesV2Upgradeable, RoyaltiesV2Impl, ERC721URI { using SafeMathUpgradeable for uint; bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; // tokenId => creators mapping(uint256 => LibPart.Part[]) private creators; function __ERC721Lazy_init_unchained() internal initializer { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { return interfaceId == LibERC721LazyMint._INTERFACE_ID_MINT_AND_TRANSFER || interfaceId == LibRoyaltiesV2._INTERFACE_ID_ROYALTIES || interfaceId == LibRoyalties2981._INTERFACE_ID_ROYALTIES || interfaceId == _INTERFACE_ID_ERC165 || interfaceId == _INTERFACE_ID_ERC721 || interfaceId == _INTERFACE_ID_ERC721_METADATA || interfaceId == _INTERFACE_ID_ERC721_ENUMERABLE; } function transferFromOrMint( LibERC721LazyMint.Mint721Data memory data, address from, address to ) override external { if (_exists(data.tokenId)) { safeTransferFrom(from, to, data.tokenId); } else { require(from == data.creators[0].account, "wrong order maker"); mintAndTransfer(data, to); } } function mintAndTransfer(LibERC721LazyMint.Mint721Data memory data, address to) public override virtual { address minter = address(data.tokenId >> 96); address sender = _msgSender(); require(minter == data.creators[0].account, "tokenId incorrect"); require(data.creators.length == data.signatures.length); require(minter == sender || isApprovedForAll(minter, sender), "ERC721: transfer caller is not owner nor approved"); bytes32 hash = LibERC721LazyMint.hash(data); for (uint i = 0; i < data.creators.length; ++i) { address creator = data.creators[i].account; if (creator != sender) { validate(creator, hash, data.signatures[i]); } } _safeMint(to, data.tokenId); _saveRoyalties(data.tokenId, data.royalties); _saveCreators(data.tokenId, data.creators); _setTokenURI(data.tokenId, data.tokenURI); } function _emitMintEvent(address to, uint tokenId) internal override virtual { address minter = address(tokenId >> 96); if (minter != to) { emit Transfer(address(0), minter, tokenId); emit Transfer(minter, to, tokenId); } else { emit Transfer(address(0), to, tokenId); } } function _saveCreators(uint tokenId, LibPart.Part[] memory _creators) internal { LibPart.Part[] storage creatorsOfToken = creators[tokenId]; uint total = 0; for (uint i = 0; i < _creators.length; ++i) { require(_creators[i].account != address(0x0), "Account should be present"); require(_creators[i].value != 0, "Creator share should be positive"); creatorsOfToken.push(_creators[i]); total = total.add(_creators[i].value); } require(total == 10000, "total amount of creators share should be 10000"); emit Creators(tokenId, _creators); } function updateAccount(uint256 _id, address _from, address _to) external { require(_msgSender() == _from, "not allowed"); super._updateAccount(_id, _from, _to); } function getCreators(uint256 _id) external view returns (LibPart.Part[] memory) { return creators[_id]; } function tokenURI(uint256 tokenId) public view virtual override(ERC721UpgradeableMinimal, ERC721URI) returns (string memory) { return ERC721URI.tokenURI(tokenId); } function _clearMetadata(uint256 tokenId) internal override(ERC721UpgradeableMinimal, ERC721URI) virtual { return ERC721URI._clearMetadata(tokenId); } uint256[50] private __gap; }
@rarible/tokens/contracts/Mint721Validator.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "./erc-1271/ERC1271Validator.sol"; import "@rarible/lazy-mint/contracts/erc-721/LibERC721LazyMint.sol"; contract Mint721Validator is ERC1271Validator { function __Mint721Validator_init_unchained() internal initializer { __EIP712_init_unchained("Mint721", "1"); } function validate(address account, bytes32 hash, bytes memory signature) internal view { validate1271(account, hash, signature); } uint256[50] private __gap; }
@openzeppelin/contracts-upgradeable/introspection/ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC165Upgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts may inherit from this and call {_registerInterface} to declare * their support of an interface. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { /* * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7 */ bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * @dev Mapping of interface ids to whether or not it's supported. */ mapping(bytes4 => bool) private _supportedInterfaces; function __ERC165_init() internal initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { // Derived contracts need only register support for their own interfaces, // we register support for ERC165 itself here _registerInterface(_INTERFACE_ID_ERC165); } /** * @dev See {IERC165-supportsInterface}. * * Time complexity O(1), guaranteed to always use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return _supportedInterfaces[interfaceId]; } /** * @dev Registers the contract as an implementer of the interface defined by * `interfaceId`. Support of the actual ERC165 interface is automatic and * registering its interface id is not required. * * See {IERC165-supportsInterface}. * * Requirements: * * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`). */ function _registerInterface(bytes4 interfaceId) internal virtual { require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true; } uint256[49] private __gap; }
@openzeppelin/contracts-upgradeable/proxy/Initializable.sol
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; 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 a proxied contract can't have 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. * * 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 {UpgradeableProxy-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. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
@rarible/tokens/contracts/IsPrivateCollection.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; contract IsPrivateCollection { /// @dev true if collection is private, false if public bool isPrivate; uint256[49] private __gap; }
@rarible/royalties/contracts/impl/AbstractRoyalties.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "@rarible/lib-part/contracts/LibPart.sol"; abstract contract AbstractRoyalties { mapping (uint256 => LibPart.Part[]) internal royalties; function _saveRoyalties(uint256 id, LibPart.Part[] memory _royalties) internal { uint256 totalValue; for (uint i = 0; i < _royalties.length; ++i) { require(_royalties[i].account != address(0x0), "Recipient should be present"); require(_royalties[i].value != 0, "Royalty value should be positive"); totalValue += _royalties[i].value; royalties[id].push(_royalties[i]); } require(totalValue < 10000, "Royalty total value should be < 10000"); _onRoyaltiesSet(id, _royalties); } function _updateAccount(uint256 _id, address _from, address _to) internal { uint length = royalties[_id].length; for(uint i = 0; i < length; ++i) { if (royalties[_id][i].account == _from) { royalties[_id][i].account = payable(address(uint160(_to))); } } } function _onRoyaltiesSet(uint256 id, LibPart.Part[] memory _royalties) virtual internal; }
@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev String operations. */ library StringsUpgradeable { /** * @dev Converts a `uint256` to its ASCII `string` 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); uint256 index = digits - 1; temp = value; while (temp != 0) { buffer[index--] = bytes1(uint8(48 + temp % 10)); temp /= 10; } return string(buffer); } }
@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712Upgradeable is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal initializer { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal initializer { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) { return keccak256( abi.encode( typeHash, name, version, _getChainId(), address(this) ) ); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash)); } function _getChainId() private view returns (uint256 chainId) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 // solhint-disable-next-line no-inline-assembly assembly { chainId := chainid() } } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } uint256[50] private __gap; }
@rarible/tokens/contracts/erc-721-minimal/ERC721URI.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "./ERC721UpgradeableMinimal.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "../LibURI.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be irreversibly burned (destroyed). */ abstract contract ERC721URI is ContextUpgradeable, ERC721UpgradeableMinimal { using StringsUpgradeable for uint256; // Optional mapping for token URIs mapping (uint256 => string) private _tokenURIs; // Base URI string private _baseURI; /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev Internal function to set the base URI for all token IDs. It is * automatically added as a prefix to the value returned in {tokenURI}, * or to the token ID if {tokenURI} is empty. */ function _setBaseURI(string memory baseURI_) internal virtual { _baseURI = baseURI_; } /** * @dev Returns the base URI set via {_setBaseURI}. This will be * automatically added as a prefix in {tokenURI} to each token's URI, or * to the token ID if no specific URI is set for that token ID. */ function baseURI() public view virtual returns (string memory) { return _baseURI; } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _clearMetadata(uint256 tokenId) internal override virtual { // Clear metadata (if any) if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return LibURI.checkPrefix(base, _tokenURI); } // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI. return string(abi.encodePacked(base, tokenId.toString())); } uint256[50] private __gap; }
@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; pragma abicoder v2; import "./AbstractRoyalties.sol"; import "../RoyaltiesV2.sol"; import "../IERC2981.sol"; import "../LibRoyalties2981.sol"; contract RoyaltiesV2Impl is AbstractRoyalties, RoyaltiesV2, IERC2981 { function getRaribleV2Royalties(uint256 id) override external view returns (LibPart.Part[] memory) { return royalties[id]; } function _onRoyaltiesSet(uint256 id, LibPart.Part[] memory _royalties) override internal { emit RoyaltiesSet(id, _royalties); } /* *Token (ERC721, ERC721Minimal, ERC721MinimalMeta, ERC1155 ) can have a number of different royalties beneficiaries *calculate sum all royalties, but royalties beneficiary will be only one royalties[0].account, according to rules of IERC2981 */ function royaltyInfo(uint256 id, uint256 _salePrice) override external view returns (address receiver, uint256 royaltyAmount) { if (royalties[id].length == 0) { receiver = address(0); royaltyAmount = 0; return(receiver, royaltyAmount); } LibPart.Part[] memory _royalties = royalties[id]; receiver = _royalties[0].account; uint percent; for (uint i = 0; i < _royalties.length; ++i) { percent += _royalties[i].value; } //don`t need require(percent < 10000, "Token royalty > 100%"); here, because check later in calculateRoyalties royaltyAmount = percent * _salePrice / 10000; } }
@rarible/lazy-mint/contracts/erc-721/LibERC721LazyMint.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "@rarible/lib-part/contracts/LibPart.sol"; library LibERC721LazyMint { bytes4 constant public ERC721_LAZY_ASSET_CLASS = bytes4(keccak256("ERC721_LAZY")); bytes4 constant _INTERFACE_ID_MINT_AND_TRANSFER = 0x8486f69f; struct Mint721Data { uint tokenId; string tokenURI; LibPart.Part[] creators; LibPart.Part[] royalties; bytes[] signatures; } bytes32 public constant MINT_AND_TRANSFER_TYPEHASH = keccak256("Mint721(uint256 tokenId,string tokenURI,Part[] creators,Part[] royalties)Part(address account,uint96 value)"); function hash(Mint721Data memory data) internal pure returns (bytes32) { bytes32[] memory royaltiesBytes = new bytes32[](data.royalties.length); for (uint i = 0; i < data.royalties.length; ++i) { royaltiesBytes[i] = LibPart.hash(data.royalties[i]); } bytes32[] memory creatorsBytes = new bytes32[](data.creators.length); for (uint i = 0; i < data.creators.length; ++i) { creatorsBytes[i] = LibPart.hash(data.creators[i]); } return keccak256(abi.encode( MINT_AND_TRANSFER_TYPEHASH, data.tokenId, keccak256(bytes(data.tokenURI)), keccak256(abi.encodePacked(creatorsBytes)), keccak256(abi.encodePacked(royaltiesBytes)) )); } }
@rarible/royalties/contracts/LibRoyalties2981.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "@rarible/lib-part/contracts/LibPart.sol"; library LibRoyalties2981 { /* * https://eips.ethereum.org/EIPS/eip-2981: bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; */ bytes4 constant _INTERFACE_ID_ROYALTIES = 0x2a55205a; uint96 constant _WEIGHT_VALUE = 1000000; /*Method for converting amount to percent and forming LibPart*/ function calculateRoyalties(address to, uint256 amount) internal view returns (LibPart.Part[] memory) { LibPart.Part[] memory result; if (amount == 0) { return result; } uint256 percent = amount * 10000 / _WEIGHT_VALUE; require(percent < 10000, "Royalties 2981 exceeds 100%"); result = new LibPart.Part[](1); result[0].account = payable(to); result[0].value = uint96(percent); return result; } }
@rarible/tokens/contracts/access/MinterAccessControl.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; abstract contract MinterAccessControl is OwnableUpgradeable { mapping(address => bool) private _minters; event MinterStatusChanged(address indexed minter, bool indexed status); function __MinterAccessControl_init() internal initializer { __Ownable_init_unchained(); __MinterAccessControl_init_unchained(); } function __MinterAccessControl_init_unchained() internal initializer { } /** * @dev Add `minter` to the list of allowed minters. */ function addMinter(address minter) external onlyOwner { _minters[minter] = true; emit MinterStatusChanged(minter, true); } /** * @dev Add `minters` to the list of allowed minters. */ function addMinters(address[] memory minters) external onlyOwner { for (uint i = 0; i < minters.length; ++i) { address minter = minters[i]; _minters[minter] = true; emit MinterStatusChanged(minter, true); } } /** * @dev Revoke `_minter` from the list of allowed minters. */ function removeMinter(address _minter) external onlyOwner { _minters[_minter] = false; emit MinterStatusChanged(_minter, false); } /** * @dev Returns `true` if `account` has been granted to minters. */ function isMinter(address account) public view returns (bool) { return _minters[account]; } uint256[50] private __gap; }
@rarible/tokens/contracts/erc-721-minimal/ERC721UpgradeableMinimal.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/introspection/ERC165Upgradeable.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 ERC721UpgradeableMinimal 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; /* * bytes4(keccak256('balanceOf(address)')) == 0x70a08231 * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5 * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde * * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^ * 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd */ bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; /* * bytes4(keccak256('name()')) == 0x06fdde03 * bytes4(keccak256('symbol()')) == 0x95d89b41 * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd * * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f */ bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; // Mapping from token ID to flag == true, means token already burned mapping(uint256 => bool) private _burnedTokens; /** * @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 initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; // register the supported interfaces to conform to ERC721 via ERC165 _registerInterface(_INTERFACE_ID_ERC721); _registerInterface(_INTERFACE_ID_ERC721_METADATA); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); 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: owner query for nonexistent token"); 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) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721UpgradeableMinimal.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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: transfer caller is not 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: transfer caller is not 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) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721UpgradeableMinimal.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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(!_burnedTokens[tokenId], "token already burned"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; _emitMintEvent(to, tokenId); } function _emitMintEvent(address to, uint tokenId) internal virtual { emit Transfer(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 = ERC721UpgradeableMinimal.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _clearMetadata(tokenId); _balances[owner] -= 1; delete _owners[tokenId]; //set token is burned _setBurned(tokenId); emit Transfer(owner, address(0), tokenId); } /*Set token with tokenId burned*/ function _setBurned(uint256 tokenId) internal { _burnedTokens[tokenId] = true; } function _clearMetadata(uint256 tokenId) internal virtual { } /** * @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(ERC721UpgradeableMinimal.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); 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); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721UpgradeableMinimal.ownerOf(tokenId), to, tokenId); } /** * @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 { 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 {} uint256[43] private __gap; }
@rarible/lib-part/contracts/LibPart.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; library LibPart { bytes32 public constant TYPE_HASH = keccak256("Part(address account,uint96 value)"); struct Part { address payable account; uint96 value; } function hash(Part memory part) internal pure returns (bytes32) { return keccak256(abi.encode(TYPE_HASH, part.account, part.value)); } }
@rarible/tokens/contracts/erc-721-minimal/ERC721DefaultApprovalMinimal.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "./ERC721UpgradeableMinimal.sol"; abstract contract ERC721DefaultApprovalMinimal is ERC721UpgradeableMinimal { mapping(address => bool) private defaultApprovals; event DefaultApproval(address indexed operator, bool hasApproval); function _setDefaultApproval(address operator, bool hasApproval) internal { defaultApprovals[operator] = hasApproval; emit DefaultApproval(operator, hasApproval); } function _isApprovedOrOwner(address spender, uint256 tokenId) internal virtual override view returns (bool) { return defaultApprovals[spender] || super._isApprovedOrOwner(spender, tokenId); } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return defaultApprovals[operator] || super.isApprovedForAll(owner, operator); } uint256[50] private __gap; }
@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "../../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`, 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 be 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal initializer { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal initializer { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } uint256[49] private __gap; }
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/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 GSN 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 initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } uint256[50] private __gap; }
@rarible/royalties/contracts/IERC2981.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "@rarible/lib-part/contracts/LibPart.sol"; /// /// @dev Interface for the NFT Royalty Standard /// //interface IERC2981 is IERC165 { interface IERC2981 { /// ERC165 bytes to add to interface array - set in parent contract /// implementing this standard /// /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a /// bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; /// _registerInterface(_INTERFACE_ID_ERC2981); /// @notice Called with the sale price to determine how much royalty // is owed and to whom. /// @param _tokenId - the NFT asset queried for royalty information /// @param _salePrice - the sale price of the NFT asset specified by _tokenId /// @return receiver - address of who should be sent the royalty payment /// @return royaltyAmount - the royalty payment amount for _salePrice function royaltyInfo( uint256 _tokenId, uint256 _salePrice ) external view returns ( address receiver, uint256 royaltyAmount ); }
@openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
@rarible/royalties/contracts/LibRoyaltiesV2.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; library LibRoyaltiesV2 { /* * bytes4(keccak256('getRaribleV2Royalties(uint256)')) == 0xcad96cca */ bytes4 constant _INTERFACE_ID_ROYALTIES = 0xcad96cca; }
@rarible/tokens/contracts/erc-721-minimal/ERC721BaseMinimal.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./ERC721BurnableUpgradeableMinimal.sol"; import "./ERC721DefaultApprovalMinimal.sol"; import "./ERC721LazyMinimal.sol"; import "../HasContractURI.sol"; abstract contract ERC721BaseMinimal is OwnableUpgradeable, ERC721DefaultApprovalMinimal, ERC721BurnableUpgradeableMinimal, ERC721LazyMinimal, HasContractURI { event BaseUriChanged(string newBaseURI); function _isApprovedOrOwner(address spender, uint256 tokenId) internal virtual override(ERC721UpgradeableMinimal, ERC721DefaultApprovalMinimal) view returns (bool) { return ERC721DefaultApprovalMinimal._isApprovedOrOwner(spender, tokenId); } function isApprovedForAll(address owner, address operator) public view virtual override(ERC721DefaultApprovalMinimal, ERC721UpgradeableMinimal, IERC721Upgradeable) returns (bool) { return ERC721DefaultApprovalMinimal.isApprovedForAll(owner, operator); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, ERC721LazyMinimal) returns (bool) { return super.supportsInterface(interfaceId); } function tokenURI(uint256 tokenId) public view virtual override(ERC721UpgradeableMinimal, ERC721LazyMinimal) returns (string memory) { return ERC721LazyMinimal.tokenURI(tokenId); } function _clearMetadata(uint256 tokenId) internal override(ERC721UpgradeableMinimal, ERC721LazyMinimal) virtual { return ERC721LazyMinimal._clearMetadata(tokenId); } function _emitMintEvent(address to, uint tokenId) internal override(ERC721UpgradeableMinimal, ERC721LazyMinimal) virtual { return ERC721LazyMinimal._emitMintEvent(to, tokenId); } function setBaseURI(string memory newBaseURI) external onlyOwner { super._setBaseURI(newBaseURI); emit BaseUriChanged(newBaseURI); } uint256[50] private __gap; }
@rarible/meta-tx/contracts/EIP712MetaTransaction.sol
//SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; abstract contract EIP712MetaTransaction is ContextUpgradeable { using SafeMath for uint256; bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256(bytes("MetaTransaction(uint256 nonce,address from,bytes functionSignature)")); bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)"); mapping(address => uint256) private nonces; bytes32 internal domainSeparator; /* * Meta transaction structure. * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas * He should call the desired function directly in that case. */ struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } /* * Domain structure. * Data(information to for making metaTransaction method uniq.) about method and contract */ struct EIP712Domain { string name; string version; address verifyingContract; bytes32 salt; } event MetaTransactionExecuted(address userAddress, address payable relayerAddress, bytes functionSignature); function __MetaTransaction_init_unchained(string memory name, string memory version) internal { domainSeparator = keccak256(abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(name)), keccak256(bytes(version)), address(this), getSalt() )); } function convertBytesToBytes4(bytes memory inBytes) internal pure returns (bytes4 outBytes4) { if (inBytes.length == 0) { return 0x0; } assembly { outBytes4 := mload(add(inBytes, 32)) } } function executeMetaTransaction(address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV) external payable returns (bytes memory) { bytes4 destinationFunctionSig = convertBytesToBytes4(functionSignature); require(destinationFunctionSig != msg.sig, "Wrong functionSignature"); MetaTransaction memory metaTx = MetaTransaction({ nonce : nonces[userAddress], from : userAddress, functionSignature : functionSignature }); require(verify(userAddress, metaTx, sigR, sigS, sigV), "Signer and signature do not match"); nonces[userAddress] = nonces[userAddress].add(1); // Append userAddress at the end to extract it from calling context (bool success, bytes memory returnData) = address(this).call(abi.encodePacked(functionSignature, userAddress)); require(success, "Function call not successful"); emit MetaTransactionExecuted(userAddress, msg.sender, functionSignature); return returnData; } function hashMetaTransaction(MetaTransaction memory metaTx) internal pure returns (bytes32) { return keccak256(abi.encode( META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature) )); } function getNonce(address user) external view returns (uint256 nonce) { nonce = nonces[user]; } function verify(address user, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV) internal view returns (bool) { address signer = ecrecover(toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS); require(signer != address(0), "Invalid signature"); return signer == user; } function _msgSender() internal view virtual override returns (address payable sender) { if (msg.sender == address(this)) { bytes memory array = msg.data; uint256 index = msg.data.length; assembly { // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those. sender := and(mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff) } } else { sender = msg.sender; } return sender; } function getSalt() internal pure returns (bytes32) { return bytes32(getChainID()); } function getChainID() internal pure returns (uint256 id) { assembly { id := chainid() } } function getDomainSeparator() private view returns (bytes32) { return domainSeparator; } /** * Accept message hash and returns hash message in EIP712 compatible form * So that it can be used to recover signer from signature signed using EIP712 formatted data * https://eips.ethereum.org/EIPS/eip-712 * "\\x19" makes the encoding deterministic * "\\x01" is the version byte to make it compatible to EIP-191 */ function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", getDomainSeparator(), messageHash)); } /** * @dev verifies the call result and bubbles up revert reason for failed calls * * @param success : outcome of forwarded call * @param returndata : returned data from the frowarded call * @param errorMessage : fallback error message to show */ function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure { if (!success) { // 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
@rarible/lazy-mint/contracts/erc-721/IERC721LazyMint.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "./LibERC721LazyMint.sol"; import "@rarible/lib-part/contracts/LibPart.sol"; interface IERC721LazyMint is IERC721Upgradeable { event Creators( uint256 tokenId, LibPart.Part[] creators ); function mintAndTransfer( LibERC721LazyMint.Mint721Data memory data, address to ) external; function transferFromOrMint( LibERC721LazyMint.Mint721Data memory data, address from, address to ) external; }
@rarible/tokens/contracts/erc-1271/ERC1271Validator.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@rarible/lib-signature/contracts/ERC1271.sol"; import "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol"; import "@rarible/lib-signature/contracts/LibSignature.sol"; abstract contract ERC1271Validator is EIP712Upgradeable { using AddressUpgradeable for address; using LibSignature for bytes32; string constant SIGNATURE_ERROR = "signature verification error"; bytes4 constant internal MAGICVALUE = 0x1626ba7e; function validate1271(address signer, bytes32 structHash, bytes memory signature) internal view { bytes32 hash = _hashTypedDataV4(structHash); address signerFromSig; if (signature.length == 65) { signerFromSig = hash.recover(signature); } if (signerFromSig != signer) { if (signer.isContract()) { require( ERC1271(signer).isValidSignature(hash, signature) == MAGICVALUE, SIGNATURE_ERROR ); } else { revert(SIGNATURE_ERROR); } } } uint256[50] private __gap; }
@rarible/tokens/contracts/LibURI.sol
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; library LibURI { /// @dev checks if _tokenURI starts with base. if true returns _tokenURI, else base + _tokenURI function checkPrefix(string memory base, string memory _tokenURI) internal pure returns (string memory) { bytes memory whatBytes = bytes(base); bytes memory whereBytes = bytes(_tokenURI); if (whatBytes.length > whereBytes.length) { return string(abi.encodePacked(base, _tokenURI)); } for (uint256 j = 0; j < whatBytes.length; j++) { if (whereBytes[j] != whatBytes[j]) { return string(abi.encodePacked(base, _tokenURI)); } } return _tokenURI; } }
@rarible/royalties/contracts/RoyaltiesV2.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; pragma abicoder v2; import "@rarible/lib-part/contracts/LibPart.sol"; interface RoyaltiesV2 { event RoyaltiesSet(uint256 tokenId, LibPart.Part[] royalties); function getRaribleV2Royalties(uint256 id) external view returns (LibPart.Part[] memory); }
@openzeppelin/contracts-upgradeable/token/ERC721/IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <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); }
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul"}
Contract ABI
[{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"approved","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"BaseUriChanged","inputs":[{"type":"string","name":"newBaseURI","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"CreateERC721Rarible","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":false},{"type":"string","name":"name","internalType":"string","indexed":false},{"type":"string","name":"symbol","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"CreateERC721RaribleUser","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":false},{"type":"string","name":"name","internalType":"string","indexed":false},{"type":"string","name":"symbol","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"Creators","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"tuple[]","name":"creators","internalType":"struct LibPart.Part[]","indexed":false,"components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]}],"anonymous":false},{"type":"event","name":"DefaultApproval","inputs":[{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"hasApproval","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"MetaTransactionExecuted","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":false},{"type":"address","name":"relayerAddress","internalType":"address payable","indexed":false},{"type":"bytes","name":"functionSignature","internalType":"bytes","indexed":false}],"anonymous":false},{"type":"event","name":"MinterStatusChanged","inputs":[{"type":"address","name":"minter","internalType":"address","indexed":true},{"type":"bool","name":"status","internalType":"bool","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoyaltiesSet","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"tuple[]","name":"royalties","internalType":"struct LibPart.Part[]","indexed":false,"components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__ERC721RaribleUser_init","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"string","name":"baseURI","internalType":"string"},{"type":"string","name":"contractURI","internalType":"string"},{"type":"address[]","name":"operators","internalType":"address[]"},{"type":"address","name":"transferProxy","internalType":"address"},{"type":"address","name":"lazyTransferProxy","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__ERC721Rarible_init","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"string","name":"baseURI","internalType":"string"},{"type":"string","name":"contractURI","internalType":"string"},{"type":"address","name":"transferProxy","internalType":"address"},{"type":"address","name":"lazyTransferProxy","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMinter","inputs":[{"type":"address","name":"minter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMinters","inputs":[{"type":"address[]","name":"minters","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"baseURI","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"contractURI","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"executeMetaTransaction","inputs":[{"type":"address","name":"userAddress","internalType":"address"},{"type":"bytes","name":"functionSignature","internalType":"bytes"},{"type":"bytes32","name":"sigR","internalType":"bytes32"},{"type":"bytes32","name":"sigS","internalType":"bytes32"},{"type":"uint8","name":"sigV","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct LibPart.Part[]","components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]}],"name":"getCreators","inputs":[{"type":"uint256","name":"_id","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"nonce","internalType":"uint256"}],"name":"getNonce","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct LibPart.Part[]","components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]}],"name":"getRaribleV2Royalties","inputs":[{"type":"uint256","name":"id","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isMinter","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintAndTransfer","inputs":[{"type":"tuple","name":"data","internalType":"struct LibERC721LazyMint.Mint721Data","components":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"string","name":"tokenURI","internalType":"string"},{"type":"tuple[]","name":"creators","internalType":"struct LibPart.Part[]","components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]},{"type":"tuple[]","name":"royalties","internalType":"struct LibPart.Part[]","components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]},{"type":"bytes[]","name":"signatures","internalType":"bytes[]"}]},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeMinter","inputs":[{"type":"address","name":"_minter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint256","name":"royaltyAmount","internalType":"uint256"}],"name":"royaltyInfo","inputs":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"_salePrice","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBaseURI","inputs":[{"type":"string","name":"newBaseURI","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFromOrMint","inputs":[{"type":"tuple","name":"data","internalType":"struct LibERC721LazyMint.Mint721Data","components":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"string","name":"tokenURI","internalType":"string"},{"type":"tuple[]","name":"creators","internalType":"struct LibPart.Part[]","components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]},{"type":"tuple[]","name":"royalties","internalType":"struct LibPart.Part[]","components":[{"type":"address","name":"account","internalType":"address payable"},{"type":"uint96","name":"value","internalType":"uint96"}]},{"type":"bytes[]","name":"signatures","internalType":"bytes[]"}]},{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateAccount","inputs":[{"type":"uint256","name":"_id","internalType":"uint256"},{"type":"address","name":"_from","internalType":"address"},{"type":"address","name":"_to","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b5061530d806100206000396000f3fe6080604052600436106101f95760003560e01c806370a082311161010d578063a22cb465116100a0578063cad96cca1161006f578063cad96cca146105b4578063e07f2319146105d4578063e8a3d485146105f4578063e985e9c514610609578063f2fde38b14610629576101f9565b8063a22cb46514610534578063aa271e1a14610554578063b88d4fde14610574578063c87b56dd14610594576101f9565b8063891be974116100dc578063891be974146104bd5780638da5cb5b146104ea57806395d89b41146104ff578063983b2d5614610514576101f9565b806370a0823114610448578063715018a61461046857806371e2a6571461047d578063832fbb291461049d576101f9565b80632d0335ab1161019057806342966c681161015f57806342966c68146103b35780634648eb9d146103d357806355f804b3146103f35780636352211e146104135780636c0360eb14610433576101f9565b80632d0335ab146103265780633092afd5146103535780633db397c61461037357806342842e0e14610393576101f9565b80630c53c51c116101cc5780630c53c51c146102a557806322a775b6146102b857806323b872dd146102d85780632a55205a146102f8576101f9565b806301ffc9a7146101fe57806306fdde0314610234578063081812fc14610256578063095ea7b314610283575b600080fd5b34801561020a57600080fd5b5061021e610219366004614899565b610649565b60405161022b9190614cc2565b60405180910390f35b34801561024057600080fd5b5061024961065c565b60405161022b9190614ccd565b34801561026257600080fd5b50610276610271366004614b4b565b6106f3565b60405161022b9190614c4c565b34801561028f57600080fd5b506102a361029e36600461483c565b610756565b005b6102496102b33660046147c2565b61082c565b3480156102c457600080fd5b506102a36102d3366004614aa6565b610ba5565b3480156102e457600080fd5b506102a36102f33660046146e8565b610c47565b34801561030457600080fd5b50610318610313366004614b89565b610c9e565b60405161022b929190614c96565b34801561033257600080fd5b50610346610341366004614694565b610dac565b60405161022b9190614e93565b34801561035f57600080fd5b506102a361036e366004614694565b610dc8565b34801561037f57600080fd5b506102a361038e3660046148f3565b610e78565b34801561039f57600080fd5b506102a36103ae3660046146e8565b610f27565b3480156103bf57600080fd5b506102a36103ce366004614b4b565b610f42565b3480156103df57600080fd5b506102a36103ee3660046149ba565b61100c565b3480156103ff57600080fd5b506102a361040e3660046148c1565b6110c3565b34801561041f57600080fd5b5061027661042e366004614b4b565b611168565b34801561043f57600080fd5b506102496111bc565b34801561045457600080fd5b50610346610463366004614694565b61121e565b34801561047457600080fd5b506102a3611282565b34801561048957600080fd5b506102a3610498366004614867565b61132e565b3480156104a957600080fd5b506102a36104b8366004614aea565b611413565b3480156104c957600080fd5b506104dd6104d8366004614b4b565b61148e565b60405161022b9190614caf565b3480156104f657600080fd5b5061027661151e565b34801561050b57600080fd5b5061024961152d565b34801561052057600080fd5b506102a361052f366004614694565b61158e565b34801561054057600080fd5b506102a361054f366004614791565b611643565b34801561056057600080fd5b5061021e61056f366004614694565b611749565b34801561058057600080fd5b506102a361058f366004614728565b611768565b3480156105a057600080fd5b506102496105af366004614b4b565b6117c6565b3480156105c057600080fd5b506104dd6105cf366004614b4b565b6117d1565b3480156105e057600080fd5b506102a36105ef366004614b63565b61184c565b34801561060057600080fd5b5061024961188f565b34801561061557600080fd5b5061021e6106243660046146b0565b61191e565b34801561063557600080fd5b506102a3610644366004614694565b611933565b600061065482611a36565b90505b919050565b60fd8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106e85780601f106106bd576101008083540402835291602001916106e8565b820191906000526020600020905b8154815290600101906020018083116106cb57829003601f168201915b505050505090505b90565b60006106fe82611af0565b6107395760405162461bcd60e51b815260040180806020018281038252602c815260200180615120602c913960400191505060405180910390fd5b50600090815261010160205260409020546001600160a01b031690565b600061076182611168565b9050806001600160a01b0316836001600160a01b031614156107b45760405162461bcd60e51b81526004018080602001828103825260218152602001806152316021913960400191505060405180910390fd5b806001600160a01b03166107c6611b0d565b6001600160a01b031614806107e257506107e281610624611b0d565b61081d5760405162461bcd60e51b81526004018080602001828103825260388152602001806150186038913960400191505060405180910390fd5b6108278383611b1c565b505050565b6060600061083986611b8b565b90506000356001600160e01b031990811690821614156108a0576040805162461bcd60e51b815260206004820152601760248201527f57726f6e672066756e6374696f6e5369676e6174757265000000000000000000604482015290519081900360640190fd5b604080516060810182526001600160a01b03891660008181526102f76020908152908490205483528201529081018790526108de8882888888611ba7565b6109195760405162461bcd60e51b81526004018080602001828103825260218152602001806151c16021913960400191505060405180910390fd5b6001600160a01b03881660009081526102f7602052604090205461093e906001611c91565b6102f760008a6001600160a01b03166001600160a01b0316815260200190815260200160002081905550600080306001600160a01b0316898b6040516020018083805190602001908083835b602083106109a95780518252601f19909201916020918201910161098a565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b031660601b8152601401925050506040516020818303038152906040526040518082805190602001908083835b60208310610a1f5780518252601f199092019160209182019101610a00565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610a81576040519150601f19603f3d011682016040523d82523d6000602084013e610a86565b606091505b509150915081610add576040805162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604482015290519081900360640190fd5b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8a338b60405180846001600160a01b03168152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b5c578181015183820152602001610b44565b50505050905090810190601f168015610b895780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a19998505050505050505050565b6102925460ff1615610c39578160400151600081518110610bc257fe5b6020026020010151600001516001600160a01b0316610bdf61151e565b6001600160a01b03161480610c145750610c148260400151600081518110610c0357fe5b602002602001015160000151611749565b610c395760405162461bcd60e51b8152600401610c3090614d0b565b60405180910390fd5b610c438282611ceb565b5050565b610c58610c52611b0d565b82611e6d565b610c935760405162461bcd60e51b81526004018080602001828103825260318152602001806152526031913960400191505060405180910390fd5b610827838383611e79565b60008281526101c660205260408120548190610cbf57506000905080610da5565b60008481526101c66020908152604080832080548251818502810185019093528083529192909190849084015b82821015610d3b57600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b031681830152825260019092019101610cec565b50505050905080600081518110610d4e57fe5b60209081029190910101515192506000805b8251811015610d9957828181518110610d7557fe5b6020026020010151602001516001600160601b031682019150806001019050610d60565b50612710908502049150505b9250929050565b6001600160a01b031660009081526102f7602052604090205490565b610dd0611b0d565b6001600160a01b0316610de161151e565b6001600160a01b031614610e2a576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526102c46020526040808220805460ff19169055519091907f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd908390a350565b610e86868686868686611f98565b610ed26040518060400160405280601181526020017045524337323152617269626c654d65746160781b815250604051806040016040528060018152602001603160f81b8152506120b2565b610292805460ff191690557ff05e55f0a9d205977ca8cc02236338b6a361376f404cf0b3019b2111964a01fd610f06611b0d565b8787604051610f1793929190614c60565b60405180910390a1505050505050565b61082783838360405180602001604052806000815250611768565b610f4b81611af0565b610fba57606081901c610f5c611b0d565b6001600160a01b0316816001600160a01b031614610fab5760405162461bcd60e51b815260040180806020018281038252602d8152602001806150f3602d913960400191505060405180910390fd5b610fb482612142565b50611009565b610fc5610c52611b0d565b6110005760405162461bcd60e51b81526004018080602001828103825260308152602001806152a86030913960400191505060405180910390fd5b6110098161215e565b50565b61101a878787878686611f98565b61106a6040518060400160405280601581526020017445524337323152617269626c65557365724d65746160581b815250604051806040016040528060018152602001603160f81b8152506120b2565b610292805460ff191660011790557fd901a467fa419f379a67636a1de44cc2ed772beb43a0c05fa1ddcad5d59e99136110a1611b0d565b88886040516110b293929190614c60565b60405180910390a150505050505050565b6110cb611b0d565b6001600160a01b03166110dc61151e565b6001600160a01b031614611125576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b61112e816121fa565b7f87cdeaffd8e70903d6ce7cc983fac3b09ca79e83818124c98e47a1d70f8027d68160405161115d9190614ccd565b60405180910390a150565b600081815260ff60205260408120546001600160a01b0316806106545760405162461bcd60e51b815260040180806020018281038252602981526020018061507a6029913960400191505060405180910390fd5b6101c88054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106e85780601f106106bd576101008083540402835291602001916106e8565b60006001600160a01b0382166112655760405162461bcd60e51b815260040180806020018281038252602a815260200180615050602a913960400191505060405180910390fd5b506001600160a01b03166000908152610100602052604090205490565b61128a611b0d565b6001600160a01b031661129b61151e565b6001600160a01b0316146112e4576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b611336611b0d565b6001600160a01b031661134761151e565b6001600160a01b031614611390576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b60005b8151811015610c435760008282815181106113aa57fe5b6020908102919091018101516001600160a01b03811660008181526102c49093526040808420805460ff1916600190811790915590519294509290917f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd9190a350600101611393565b825161141e90611af0565b156114375761143282828560000151610f27565b610827565b826040015160008151811061144857fe5b6020026020010151600001516001600160a01b0316826001600160a01b0316146114845760405162461bcd60e51b8152600401610c3090614ce0565b6108278382610ba5565b60606101fb6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561151357600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b0316818301528252600190920191016114c4565b505050509050919050565b6033546001600160a01b031690565b60fe8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106e85780601f106106bd576101008083540402835291602001916106e8565b611596611b0d565b6001600160a01b03166115a761151e565b6001600160a01b0316146115f0576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526102c46020526040808220805460ff1916600190811790915590519092917f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd91a350565b61164b611b0d565b6001600160a01b0316826001600160a01b031614156116b1576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b8061010260006116bf611b0d565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611703611b0d565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b6001600160a01b031660009081526102c4602052604090205460ff1690565b611779611773611b0d565b83611e6d565b6117b45760405162461bcd60e51b81526004018080602001828103825260318152602001806152526031913960400191505060405180910390fd5b6117c08484848461220e565b50505050565b606061065482612260565b60008181526101c66020908152604080832080548251818502810185019093528083526060949293919290918401821561151357600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b0316818301528252600190920191016114c4565b816001600160a01b031661185e611b0d565b6001600160a01b0316146118845760405162461bcd60e51b8152600401610c3090614d98565b61082783838361226b565b61022e805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156119165780601f106118eb57610100808354040283529160200191611916565b820191906000526020600020905b8154815290600101906020018083116118f957829003601f168201915b505050505081565b600061192a8383612317565b90505b92915050565b61193b611b0d565b6001600160a01b031661194c61151e565b6001600160a01b031614611995576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6001600160a01b0381166119da5760405162461bcd60e51b8152600401808060200182810382526026815260200180614f806026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b03198216638486f69f60e01b1480611a6757506001600160e01b0319821663656cb66560e11b145b80611a8257506001600160e01b0319821663152a902d60e11b145b80611a9d57506001600160e01b031982166301ffc9a760e01b145b80611ab857506001600160e01b031982166380ac58cd60e01b145b80611ad357506001600160e01b03198216635b5e139f60e01b145b806106545750506001600160e01b03191663780e9d6360e01b1490565b600090815260ff60205260409020546001600160a01b0316151590565b6000611b17612344565b905090565b60008181526101016020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b5282611168565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000815160001415611b9f57506000610657565b506020015190565b6000806001611bbd611bb8886123a0565b612423565b84878760405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611c14573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611c70576040805162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015290519081900360640190fd5b866001600160a01b0316816001600160a01b03161491505095945050505050565b60008282018381101561192a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b815160601c6000611cfa611b0d565b90508360400151600081518110611d0d57fe5b6020026020010151600001516001600160a01b0316826001600160a01b031614611d495760405162461bcd60e51b8152600401610c3090614d6d565b83608001515184604001515114611d5f57600080fd5b806001600160a01b0316826001600160a01b03161480611d845750611d84828261191e565b611da05760405162461bcd60e51b8152600401610c3090614df4565b6000611dab8561246f565b905060005b856040015151811015611e2157600086604001518281518110611dcf57fe5b6020026020010151600001519050836001600160a01b0316816001600160a01b031614611e1857611e18818489608001518581518110611e0b57fe5b60200260200101516126b6565b50600101611db0565b50611e308486600001516126c1565b611e42856000015186606001516126db565b611e54856000015186604001516128ca565b611e6685600001518660200151612a79565b5050505050565b600061192a8383612add565b826001600160a01b0316611e8c82611168565b6001600160a01b031614611ed15760405162461bcd60e51b81526004018080602001828103825260298152602001806151986029913960400191505060405180910390fd5b6001600160a01b038216611f165760405162461bcd60e51b8152600401808060200182810382526024815260200180614fa66024913960400191505060405180910390fd5b611f21838383610827565b611f2c600082611b1c565b6001600160a01b0380841660008181526101006020908152604080832080546000190190559386168083528483208054600101905585835260ff90915283822080546001600160a01b0319168217905592518493929160008051602061521183398151915291a4505050565b600054610100900460ff1680611fb15750611fb1612b0a565b80611fbf575060005460ff16155b611ffa5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612025576000805460ff1961ff0019909116610100171660011790555b61202e856121fa565b612036612b1b565b61203e612bbc565b612046612b1b565b61204e612c59565b612056612cf6565b61205e612b1b565b612066612def565b61206e612b1b565b61207784612ebe565b6120818787612f85565b61208c836001613070565b612097826001613070565b80156120a9576000805461ff00191690555b50505050505050565b7f36c25de3e541d5d970f66e4210d728721220fff5c077cc6cd008b3a0c62adab782805190602001208280519060200120306120ec6130d1565b60405160200180868152602001858152602001848152602001836001600160a01b0316815260200182815260200195505050505050604051602081830303815290604052805190602001206102f8819055505050565b600090815261010360205260409020805460ff19166001179055565b600061216982611168565b905061217781600084610827565b612182600083611b1c565b61218b826130db565b6001600160a01b038116600090815261010060209081526040808320805460001901905584835260ff909152902080546001600160a01b03191690556121d082612142565b60405182906000906001600160a01b03841690600080516020615211833981519152908390a45050565b8051610c43906101c89060208401906142fc565b612219848484611e79565b612225848484846130e4565b6117c05760405162461bcd60e51b8152600401808060200182810382526032815260200180614f0b6032913960400191505060405180910390fd5b60606106548261329a565b60008381526101c66020526040812054905b81811015611e665760008581526101c66020526040902080546001600160a01b0386169190839081106122ac57fe5b6000918252602090912001546001600160a01b0316141561230f5760008581526101c6602052604090208054849190839081106122e557fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790555b60010161227d565b6001600160a01b038116600090815261012f602052604081205460ff168061192a575061192a8383613475565b60003330141561239b57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506106f09050565b503390565b6000604051806080016040528060438152602001614f3d60439139805190602001208260000151836020015184604001518051906020012060405160200180858152602001848152602001836001600160a01b03168152602001828152602001945050505050604051602081830303815290604052805190602001209050919050565b600061242d6134a4565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b6000808260600151516001600160401b038111801561248d57600080fd5b506040519080825280602002602001820160405280156124b7578160200160208202803683370190505b50905060005b836060015151811015612509576124ea846060015182815181106124dd57fe5b60200260200101516134ab565b8282815181106124f657fe5b60209081029190910101526001016124bd565b5060008360400151516001600160401b038111801561252757600080fd5b50604051908082528060200260200182016040528015612551578160200160208202803683370190505b50905060005b84604001515181101561259657612577856040015182815181106124dd57fe5b82828151811061258357fe5b6020908102919091010152600101612557565b507ff64326045af5fd7e15297ba939f85b550474d3899daa47d2bc1ffbdb9ced344e84600001518560200151805190602001208360405160200180828051906020019060200280838360005b838110156125fa5781810151838201526020016125e2565b50505050905001915050604051602081830303815290604052805190602001208560405160200180828051906020019060200280838360005b8381101561264b578181015183820152602001612633565b505050509050019150506040516020818303038152906040528051906020012060405160200180868152602001858152602001848152602001838152602001828152602001955050505050506040516020818303038152906040528051906020012092505050919050565b610827838383613518565b610c43828260405180602001604052806000815250613797565b6000805b825181101561287f5760006001600160a01b03168382815181106126ff57fe5b6020026020010151600001516001600160a01b03161415612767576040805162461bcd60e51b815260206004820152601b60248201527f526563697069656e742073686f756c642062652070726573656e740000000000604482015290519081900360640190fd5b82818151811061277357fe5b6020026020010151602001516001600160601b0316600014156127dd576040805162461bcd60e51b815260206004820181905260248201527f526f79616c74792076616c75652073686f756c6420626520706f736974697665604482015290519081900360640190fd5b8281815181106127e957fe5b6020026020010151602001516001600160601b0316820191506101c6600085815260200190815260200160002083828151811061282257fe5b60209081029190910181015182546001818101855560009485529383902082519101805492909301516001600160601b0316600160a01b026001600160a01b039182166001600160a01b03199093169290921716179055016126df565b5061271081106128c05760405162461bcd60e51b81526004018080602001828103825260258152602001806152836025913960400191505060405180910390fd5b61082783836137e9565b60008281526101fb6020526040812090805b8351811015612a185760006001600160a01b03168482815181106128fc57fe5b6020026020010151600001516001600160a01b0316141561292f5760405162461bcd60e51b8152600401610c3090614dbd565b83818151811061293b57fe5b6020026020010151602001516001600160601b0316600014156129705760405162461bcd60e51b8152600401610c3090614d38565b8284828151811061297d57fe5b602090810291909101810151825460018101845560009384529282902081519301805491909201516001600160601b0316600160a01b026001600160a01b039384166001600160a01b0319909216919091179092169190911790558351612a0e908590839081106129ea57fe5b6020026020010151602001516001600160601b031683611c9190919063ffffffff16565b91506001016128dc565b508061271014612a3a5760405162461bcd60e51b8152600401610c3090614e45565b7f841ffb90d4cabdd1f16034f3fa831d79060febbb8167bdd54a49269365bdf78f8484604051612a6b929190614e9c565b60405180910390a150505050565b612a8282611af0565b612abd5760405162461bcd60e51b815260040180806020018281038252602c81526020018061514c602c913960400191505060405180910390fd5b60008281526101c7602090815260409091208251610827928401906142fc565b6001600160a01b038216600090815261012f602052604081205460ff168061192a575061192a8383613826565b6000612b15306138c2565b15905090565b600054610100900460ff1680612b345750612b34612b0a565b80612b42575060005460ff16155b612b7d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612ba8576000805460ff1961ff0019909116610100171660011790555b8015611009576000805461ff001916905550565b600054610100900460ff1680612bd55750612bd5612b0a565b80612be3575060005460ff16155b612c1e5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612c49576000805460ff1961ff0019909116610100171660011790555b612ba863656cb66560e11b6138c8565b600054610100900460ff1680612c725750612c72612b0a565b80612c80575060005460ff16155b612cbb5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612ce6576000805460ff1961ff0019909116610100171660011790555b612ba86301ffc9a760e01b6138c8565b600054610100900460ff1680612d0f5750612d0f612b0a565b80612d1d575060005460ff16155b612d585760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612d83576000805460ff1961ff0019909116610100171660011790555b6000612d8d611b0d565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015611009576000805461ff001916905550565b600054610100900460ff1680612e085750612e08612b0a565b80612e16575060005460ff16155b612e515760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612e7c576000805460ff1961ff0019909116610100171660011790555b612ba8604051806040016040528060078152602001664d696e7437323160c81b815250604051806040016040528060018152602001603160f81b81525061394c565b600054610100900460ff1680612ed75750612ed7612b0a565b80612ee5575060005460ff16155b612f205760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612f4b576000805460ff1961ff0019909116610100171660011790555b8151612f5f9061022e9060208501906142fc565b50612f7063e8a3d48560e01b6138c8565b8015610c43576000805461ff00191690555050565b600054610100900460ff1680612f9e5750612f9e612b0a565b80612fac575060005460ff16155b612fe75760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015613012576000805460ff1961ff0019909116610100171660011790555b82516130259060fd9060208601906142fc565b5081516130399060fe9060208501906142fc565b5061304a6380ac58cd60e01b6138c8565b61305a635b5e139f60e01b6138c8565b8015610827576000805461ff0019169055505050565b6001600160a01b038216600081815261012f6020908152604091829020805460ff1916851515908117909155825190815291517f270dbb8ba4292910ae92862466486be25c355c837270a3d8824b36a8bc7c653b9281900390910190a25050565b6000611b17613a0c565b61100981613a10565b60006130f8846001600160a01b03166138c2565b1561328e57836001600160a01b031663150b7a02613114611b0d565b8786866040518563ffffffff1660e01b815260040180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561318757818101518382015260200161316f565b50505050905090810190601f1680156131b45780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156131d657600080fd5b505af19250505080156131fb57506040513d60208110156131f657600080fd5b505160015b613274573d808015613229576040519150601f19603f3d011682016040523d82523d6000602084013e61322e565b606091505b50805161326c5760405162461bcd60e51b8152600401808060200182810382526032815260200180614f0b6032913960400191505060405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613292565b5060015b949350505050565b60606132a582611af0565b6132e05760405162461bcd60e51b815260040180806020018281038252602f8152602001806151e2602f913960400191505060405180910390fd5b60008281526101c7602090815260408083208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156133745780601f1061334957610100808354040283529160200191613374565b820191906000526020600020905b81548152906001019060200180831161335757829003601f168201915b5050505050905060006133856111bc565b905080516000141561339957509050610657565b8151156133b3576133aa8183613a19565b92505050610657565b806133bd85613bfe565b6040516020018083805190602001908083835b602083106133ef5780518252601f1990920191602091820191016133d0565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106134375780518252601f199092019160209182019101613418565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405292505050919050565b6001600160a01b0391821660009081526101026020908152604080832093909416825291909152205460ff1690565b6102f85490565b8051602091820151604080517f397e04204c1e1a60ee8724b71f8244e10ab5f2e9009854d80f602bda21b59ebb818601526001600160a01b03909316838201526001600160601b039091166060808401919091528151808403909101815260809092019052805191012090565b600061352383613cd8565b9050600082516041141561353e5761353b8284613ce2565b90505b846001600160a01b0316816001600160a01b031614611e6657613569856001600160a01b03166138c2565b1561371f5760408051630b135d3f60e11b808252600482018581526024830193845286516044840152865191936001600160a01b038a1693631626ba7e9388938a9390929091606490910190602085019080838360005b838110156135d85781810151838201526020016135c0565b50505050905090810190601f1680156136055780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561362357600080fd5b505afa158015613637573d6000803e3d6000fd5b505050506040513d602081101561364d57600080fd5b505160408051808201909152601c81527f7369676e617475726520766572696669636174696f6e206572726f72000000006020820152916001600160e01b0319909116146137195760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156136de5781810151838201526020016136c6565b50505050905090810190601f16801561370b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50611e66565b604080518082018252601c81527f7369676e617475726520766572696669636174696f6e206572726f72000000006020808301918252925162461bcd60e51b815260048101938452825160248201528251929392839260449092019190808383600083156136de5781810151838201526020016136c6565b6137a18383613d62565b6137ae60008484846130e4565b6108275760405162461bcd60e51b8152600401808060200182810382526032815260200180614f0b6032913960400191505060405180910390fd5b7f3fa96d7b6bcbfe71ef171666d84db3cf52fa2d1c8afdb1cc8e486177f208b7df828260405161381a929190614e9c565b60405180910390a15050565b600061383182611af0565b61386c5760405162461bcd60e51b815260040180806020018281038252602c815260200180614fec602c913960400191505060405180910390fd5b600061387783611168565b9050806001600160a01b0316846001600160a01b031614806138b25750836001600160a01b03166138a7846106f3565b6001600160a01b0316145b806132925750613292818561191e565b3b151590565b6001600160e01b03198082161415613927576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152606560205260409020805460ff19166001179055565b600054610100900460ff16806139655750613965612b0a565b80613973575060005460ff16155b6139ae5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff161580156139d9576000805460ff1961ff0019909116610100171660011790555b82516020808501919091208351918401919091206097919091556098558015610827576000805461ff0019169055505050565b4690565b61100981613ec8565b80518251606091849184911015613ae45784846040516020018083805190602001908083835b60208310613a5e5780518252601f199092019160209182019101613a3f565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310613aa65780518252601f199092019160209182019101613a87565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529250505061192d565b60005b8251811015613bf457828181518110613afc57fe5b602001015160f81c60f81b6001600160f81b031916828281518110613b1d57fe5b01602001516001600160f81b03191614613bec5785856040516020018083805190602001908083835b60208310613b655780518252601f199092019160209182019101613b46565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310613bad5780518252601f199092019160209182019101613b8e565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052935050505061192d565b600101613ae7565b5092949350505050565b606081613c2357506040805180820190915260018152600360fc1b6020820152610657565b8160005b8115613c3b57600101600a82049150613c27565b6000816001600160401b0381118015613c5357600080fd5b506040519080825280601f01601f191660200182016040528015613c7e576020820181803683370190505b50859350905060001982015b8315613ccf57600a840660300160f81b82828060019003935081518110613cad57fe5b60200101906001600160f81b031916908160001a905350600a84049350613c8a565b50949350505050565b600061242d613f08565b60008151604114613d3a576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a613d5886828585613f43565b9695505050505050565b6001600160a01b038216613dbd576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b6000818152610103602052604090205460ff1615613e19576040805162461bcd60e51b81526020600482015260146024820152731d1bdad95b88185b1c9958591e48189d5c9b995960621b604482015290519081900360640190fd5b613e2281611af0565b15613e74576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b613e8060008383610827565b6001600160a01b0382166000818152610100602090815260408083208054600101905584835260ff909152902080546001600160a01b0319169091179055610c438282614199565b60008181526101c7602052604090205460026000196101006001841615020190911604156110095760008181526101c76020526040812061100991614388565b6000611b177f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613f366141a3565b613f3e6141a9565b6141af565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613fa45760405162461bcd60e51b8152600401808060200182810382526022815260200180614fca6022913960400191505060405180910390fd5b6000601e8560ff16111561407e576004850360ff16601b1480613fcd57506004850360ff16601c145b6140085760405162461bcd60e51b81526004018080602001828103825260228152602001806150d16022913960400191505060405180910390fd5b600161401387614211565b60048703868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561406d573d6000803e3d6000fd5b505050602060405103519050614135565b8460ff16601b148061409357508460ff16601c145b6140ce5760405162461bcd60e51b81526004018080602001828103825260228152602001806150d16022913960400191505060405180910390fd5b60018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015614128573d6000803e3d6000fd5b5050506020604051035190505b6001600160a01b038116614190576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b610c438282614262565b60975490565b60985490565b60008383836141bc613a0c565b3060405160200180868152602001858152602001848152602001838152602001826001600160a01b03168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b606081901c6001600160a01b03831681146142d15760405182906001600160a01b03831690600090600080516020615211833981519152908290a481836001600160a01b0316826001600160a01b031660008051602061521183398151915260405160405180910390a4610827565b60405182906001600160a01b03851690600090600080516020615211833981519152908290a4505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826143325760008555614378565b82601f1061434b57805160ff1916838001178555614378565b82800160010185558215614378579182015b8281111561437857825182559160200191906001019061435d565b506143849291506143c8565b5090565b50805460018160011615610100020316600290046000825580601f106143ae5750611009565b601f01602090049060005260206000209081019061100991905b5b8082111561438457600081556001016143c9565b803561065781614ef5565b600082601f8301126143f8578081fd5b8135602061440d61440883614ed8565b614eb5565b8281528181019085830183850287018401881015614429578586fd5b855b8581101561445057813561443e81614ef5565b8452928401929084019060010161442b565b5090979650505050505050565b600082601f83011261446d578081fd5b8135602061447d61440883614ed8565b82815281810190858301855b85811015614450576144a0898684358b010161456d565b84529284019290840190600101614489565b600082601f8301126144c2578081fd5b813560206144d261440883614ed8565b828152818101908583016040808602880185018910156144f0578687fd5b865b8681101561455f5781838b031215614508578788fd5b81518281018181106001600160401b038211171561452257fe5b8352833561452f81614ef5565b8152838701356001600160601b038116811461454957898afd5b81880152855293850193918101916001016144f2565b509198975050505050505050565b600082601f83011261457d578081fd5b81356001600160401b0381111561459057fe5b6145a3601f8201601f1916602001614eb5565b8181528460208386010111156145b7578283fd5b816020850160208301379081016020019190915292915050565b600060a082840312156145e2578081fd5b6145ec60a0614eb5565b90508135815260208201356001600160401b038082111561460c57600080fd5b6146188583860161456d565b6020840152604084013591508082111561463157600080fd5b61463d858386016144b2565b6040840152606084013591508082111561465657600080fd5b614662858386016144b2565b6060840152608084013591508082111561467b57600080fd5b506146888482850161445d565b60808301525092915050565b6000602082840312156146a5578081fd5b813561192a81614ef5565b600080604083850312156146c2578081fd5b82356146cd81614ef5565b915060208301356146dd81614ef5565b809150509250929050565b6000806000606084860312156146fc578081fd5b833561470781614ef5565b9250602084013561471781614ef5565b929592945050506040919091013590565b6000806000806080858703121561473d578182fd5b843561474881614ef5565b9350602085013561475881614ef5565b92506040850135915060608501356001600160401b03811115614779578182fd5b6147858782880161456d565b91505092959194509250565b600080604083850312156147a3578182fd5b82356147ae81614ef5565b9150602083013580151581146146dd578182fd5b600080600080600060a086880312156147d9578283fd5b85356147e481614ef5565b945060208601356001600160401b038111156147fe578384fd5b61480a8882890161456d565b9450506040860135925060608601359150608086013560ff8116811461482e578182fd5b809150509295509295909350565b6000806040838503121561484e578182fd5b823561485981614ef5565b946020939093013593505050565b600060208284031215614878578081fd5b81356001600160401b0381111561488d578182fd5b613292848285016143e8565b6000602082840312156148aa578081fd5b81356001600160e01b03198116811461192a578182fd5b6000602082840312156148d2578081fd5b81356001600160401b038111156148e7578182fd5b6132928482850161456d565b60008060008060008060c0878903121561490b578384fd5b86356001600160401b0380821115614921578586fd5b61492d8a838b0161456d565b97506020890135915080821115614942578586fd5b61494e8a838b0161456d565b96506040890135915080821115614963578586fd5b61496f8a838b0161456d565b95506060890135915080821115614984578283fd5b5061499189828a0161456d565b9350506149a0608088016143dd565b91506149ae60a088016143dd565b90509295509295509295565b600080600080600080600060e0888a0312156149d4578485fd5b87356001600160401b03808211156149ea578687fd5b6149f68b838c0161456d565b985060208a0135915080821115614a0b578687fd5b614a178b838c0161456d565b975060408a0135915080821115614a2c578687fd5b614a388b838c0161456d565b965060608a0135915080821115614a4d578283fd5b614a598b838c0161456d565b955060808a0135915080821115614a6e578283fd5b50614a7b8a828b016143e8565b935050614a8a60a089016143dd565b9150614a9860c089016143dd565b905092959891949750929550565b60008060408385031215614ab8578182fd5b82356001600160401b03811115614acd578283fd5b614ad9858286016145d1565b92505060208301356146dd81614ef5565b600080600060608486031215614afe578081fd5b83356001600160401b03811115614b13578182fd5b614b1f868287016145d1565b9350506020840135614b3081614ef5565b91506040840135614b4081614ef5565b809150509250925092565b600060208284031215614b5c578081fd5b5035919050565b600080600060608486031215614b77578081fd5b833592506020840135614b3081614ef5565b60008060408385031215614b9b578182fd5b50508035926020909101359150565b6000815180845260208085019450808401835b83811015614bf657815180516001600160a01b031688528301516001600160601b03168388015260409096019590820190600101614bbd565b509495945050505050565b60008151808452815b81811015614c2657602081850181015186830182015201614c0a565b81811115614c375782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0384168152606060208201819052600090614c8490830185614c01565b8281036040840152613d588185614c01565b6001600160a01b03929092168252602082015260400190565b60006020825261192a6020830184614baa565b901515815260200190565b60006020825261192a6020830184614c01565b6020808252601190820152703bb937b7339037b93232b91036b0b5b2b960791b604082015260600190565b6020808252601390820152723737ba1037bbb732b91037b91036b4b73a32b960691b604082015260600190565b6020808252818101527f43726561746f722073686172652073686f756c6420626520706f736974697665604082015260600190565b6020808252601190820152701d1bdad95b9259081a5b98dbdc9c9958dd607a1b604082015260600190565b6020808252600b908201526a1b9bdd08185b1b1bddd95960aa1b604082015260600190565b60208082526019908201527f4163636f756e742073686f756c642062652070726573656e7400000000000000604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602e908201527f746f74616c20616d6f756e74206f662063726561746f7273207368617265207360408201526d0686f756c642062652031303030360941b606082015260800190565b90815260200190565b6000838252604060208301526132926040830184614baa565b6040518181016001600160401b0381118282101715614ed057fe5b604052919050565b60006001600160401b03821115614eeb57fe5b5060209081020190565b6001600160a01b038116811461100957600080fdfe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e6174757265294f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f206164647265737345434453413a20696e76616c6964207369676e6174757265202773272076616c75654552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c75654552433732314275726e61626c653a2063616c6c6572206973206e6f74206f776e65722c206e6f74206275726e4552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e5369676e657220616e64207369676e617475726520646f206e6f74206d617463684552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564526f79616c747920746f74616c2076616c75652073686f756c64206265203c2031303030304552433732314275726e61626c653a2063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564a2646970667358221220a4af80d98c1ea06b28253abe062a76cad67681536d192b48c743dfd2de8061ed64736f6c63430007060033
Deployed ByteCode
0x6080604052600436106101f95760003560e01c806370a082311161010d578063a22cb465116100a0578063cad96cca1161006f578063cad96cca146105b4578063e07f2319146105d4578063e8a3d485146105f4578063e985e9c514610609578063f2fde38b14610629576101f9565b8063a22cb46514610534578063aa271e1a14610554578063b88d4fde14610574578063c87b56dd14610594576101f9565b8063891be974116100dc578063891be974146104bd5780638da5cb5b146104ea57806395d89b41146104ff578063983b2d5614610514576101f9565b806370a0823114610448578063715018a61461046857806371e2a6571461047d578063832fbb291461049d576101f9565b80632d0335ab1161019057806342966c681161015f57806342966c68146103b35780634648eb9d146103d357806355f804b3146103f35780636352211e146104135780636c0360eb14610433576101f9565b80632d0335ab146103265780633092afd5146103535780633db397c61461037357806342842e0e14610393576101f9565b80630c53c51c116101cc5780630c53c51c146102a557806322a775b6146102b857806323b872dd146102d85780632a55205a146102f8576101f9565b806301ffc9a7146101fe57806306fdde0314610234578063081812fc14610256578063095ea7b314610283575b600080fd5b34801561020a57600080fd5b5061021e610219366004614899565b610649565b60405161022b9190614cc2565b60405180910390f35b34801561024057600080fd5b5061024961065c565b60405161022b9190614ccd565b34801561026257600080fd5b50610276610271366004614b4b565b6106f3565b60405161022b9190614c4c565b34801561028f57600080fd5b506102a361029e36600461483c565b610756565b005b6102496102b33660046147c2565b61082c565b3480156102c457600080fd5b506102a36102d3366004614aa6565b610ba5565b3480156102e457600080fd5b506102a36102f33660046146e8565b610c47565b34801561030457600080fd5b50610318610313366004614b89565b610c9e565b60405161022b929190614c96565b34801561033257600080fd5b50610346610341366004614694565b610dac565b60405161022b9190614e93565b34801561035f57600080fd5b506102a361036e366004614694565b610dc8565b34801561037f57600080fd5b506102a361038e3660046148f3565b610e78565b34801561039f57600080fd5b506102a36103ae3660046146e8565b610f27565b3480156103bf57600080fd5b506102a36103ce366004614b4b565b610f42565b3480156103df57600080fd5b506102a36103ee3660046149ba565b61100c565b3480156103ff57600080fd5b506102a361040e3660046148c1565b6110c3565b34801561041f57600080fd5b5061027661042e366004614b4b565b611168565b34801561043f57600080fd5b506102496111bc565b34801561045457600080fd5b50610346610463366004614694565b61121e565b34801561047457600080fd5b506102a3611282565b34801561048957600080fd5b506102a3610498366004614867565b61132e565b3480156104a957600080fd5b506102a36104b8366004614aea565b611413565b3480156104c957600080fd5b506104dd6104d8366004614b4b565b61148e565b60405161022b9190614caf565b3480156104f657600080fd5b5061027661151e565b34801561050b57600080fd5b5061024961152d565b34801561052057600080fd5b506102a361052f366004614694565b61158e565b34801561054057600080fd5b506102a361054f366004614791565b611643565b34801561056057600080fd5b5061021e61056f366004614694565b611749565b34801561058057600080fd5b506102a361058f366004614728565b611768565b3480156105a057600080fd5b506102496105af366004614b4b565b6117c6565b3480156105c057600080fd5b506104dd6105cf366004614b4b565b6117d1565b3480156105e057600080fd5b506102a36105ef366004614b63565b61184c565b34801561060057600080fd5b5061024961188f565b34801561061557600080fd5b5061021e6106243660046146b0565b61191e565b34801561063557600080fd5b506102a3610644366004614694565b611933565b600061065482611a36565b90505b919050565b60fd8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106e85780601f106106bd576101008083540402835291602001916106e8565b820191906000526020600020905b8154815290600101906020018083116106cb57829003601f168201915b505050505090505b90565b60006106fe82611af0565b6107395760405162461bcd60e51b815260040180806020018281038252602c815260200180615120602c913960400191505060405180910390fd5b50600090815261010160205260409020546001600160a01b031690565b600061076182611168565b9050806001600160a01b0316836001600160a01b031614156107b45760405162461bcd60e51b81526004018080602001828103825260218152602001806152316021913960400191505060405180910390fd5b806001600160a01b03166107c6611b0d565b6001600160a01b031614806107e257506107e281610624611b0d565b61081d5760405162461bcd60e51b81526004018080602001828103825260388152602001806150186038913960400191505060405180910390fd5b6108278383611b1c565b505050565b6060600061083986611b8b565b90506000356001600160e01b031990811690821614156108a0576040805162461bcd60e51b815260206004820152601760248201527f57726f6e672066756e6374696f6e5369676e6174757265000000000000000000604482015290519081900360640190fd5b604080516060810182526001600160a01b03891660008181526102f76020908152908490205483528201529081018790526108de8882888888611ba7565b6109195760405162461bcd60e51b81526004018080602001828103825260218152602001806151c16021913960400191505060405180910390fd5b6001600160a01b03881660009081526102f7602052604090205461093e906001611c91565b6102f760008a6001600160a01b03166001600160a01b0316815260200190815260200160002081905550600080306001600160a01b0316898b6040516020018083805190602001908083835b602083106109a95780518252601f19909201916020918201910161098a565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b031660601b8152601401925050506040516020818303038152906040526040518082805190602001908083835b60208310610a1f5780518252601f199092019160209182019101610a00565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610a81576040519150601f19603f3d011682016040523d82523d6000602084013e610a86565b606091505b509150915081610add576040805162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604482015290519081900360640190fd5b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8a338b60405180846001600160a01b03168152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b5c578181015183820152602001610b44565b50505050905090810190601f168015610b895780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a19998505050505050505050565b6102925460ff1615610c39578160400151600081518110610bc257fe5b6020026020010151600001516001600160a01b0316610bdf61151e565b6001600160a01b03161480610c145750610c148260400151600081518110610c0357fe5b602002602001015160000151611749565b610c395760405162461bcd60e51b8152600401610c3090614d0b565b60405180910390fd5b610c438282611ceb565b5050565b610c58610c52611b0d565b82611e6d565b610c935760405162461bcd60e51b81526004018080602001828103825260318152602001806152526031913960400191505060405180910390fd5b610827838383611e79565b60008281526101c660205260408120548190610cbf57506000905080610da5565b60008481526101c66020908152604080832080548251818502810185019093528083529192909190849084015b82821015610d3b57600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b031681830152825260019092019101610cec565b50505050905080600081518110610d4e57fe5b60209081029190910101515192506000805b8251811015610d9957828181518110610d7557fe5b6020026020010151602001516001600160601b031682019150806001019050610d60565b50612710908502049150505b9250929050565b6001600160a01b031660009081526102f7602052604090205490565b610dd0611b0d565b6001600160a01b0316610de161151e565b6001600160a01b031614610e2a576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526102c46020526040808220805460ff19169055519091907f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd908390a350565b610e86868686868686611f98565b610ed26040518060400160405280601181526020017045524337323152617269626c654d65746160781b815250604051806040016040528060018152602001603160f81b8152506120b2565b610292805460ff191690557ff05e55f0a9d205977ca8cc02236338b6a361376f404cf0b3019b2111964a01fd610f06611b0d565b8787604051610f1793929190614c60565b60405180910390a1505050505050565b61082783838360405180602001604052806000815250611768565b610f4b81611af0565b610fba57606081901c610f5c611b0d565b6001600160a01b0316816001600160a01b031614610fab5760405162461bcd60e51b815260040180806020018281038252602d8152602001806150f3602d913960400191505060405180910390fd5b610fb482612142565b50611009565b610fc5610c52611b0d565b6110005760405162461bcd60e51b81526004018080602001828103825260308152602001806152a86030913960400191505060405180910390fd5b6110098161215e565b50565b61101a878787878686611f98565b61106a6040518060400160405280601581526020017445524337323152617269626c65557365724d65746160581b815250604051806040016040528060018152602001603160f81b8152506120b2565b610292805460ff191660011790557fd901a467fa419f379a67636a1de44cc2ed772beb43a0c05fa1ddcad5d59e99136110a1611b0d565b88886040516110b293929190614c60565b60405180910390a150505050505050565b6110cb611b0d565b6001600160a01b03166110dc61151e565b6001600160a01b031614611125576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b61112e816121fa565b7f87cdeaffd8e70903d6ce7cc983fac3b09ca79e83818124c98e47a1d70f8027d68160405161115d9190614ccd565b60405180910390a150565b600081815260ff60205260408120546001600160a01b0316806106545760405162461bcd60e51b815260040180806020018281038252602981526020018061507a6029913960400191505060405180910390fd5b6101c88054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106e85780601f106106bd576101008083540402835291602001916106e8565b60006001600160a01b0382166112655760405162461bcd60e51b815260040180806020018281038252602a815260200180615050602a913960400191505060405180910390fd5b506001600160a01b03166000908152610100602052604090205490565b61128a611b0d565b6001600160a01b031661129b61151e565b6001600160a01b0316146112e4576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b611336611b0d565b6001600160a01b031661134761151e565b6001600160a01b031614611390576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b60005b8151811015610c435760008282815181106113aa57fe5b6020908102919091018101516001600160a01b03811660008181526102c49093526040808420805460ff1916600190811790915590519294509290917f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd9190a350600101611393565b825161141e90611af0565b156114375761143282828560000151610f27565b610827565b826040015160008151811061144857fe5b6020026020010151600001516001600160a01b0316826001600160a01b0316146114845760405162461bcd60e51b8152600401610c3090614ce0565b6108278382610ba5565b60606101fb6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561151357600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b0316818301528252600190920191016114c4565b505050509050919050565b6033546001600160a01b031690565b60fe8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106e85780601f106106bd576101008083540402835291602001916106e8565b611596611b0d565b6001600160a01b03166115a761151e565b6001600160a01b0316146115f0576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526102c46020526040808220805460ff1916600190811790915590519092917f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd91a350565b61164b611b0d565b6001600160a01b0316826001600160a01b031614156116b1576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b8061010260006116bf611b0d565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611703611b0d565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b6001600160a01b031660009081526102c4602052604090205460ff1690565b611779611773611b0d565b83611e6d565b6117b45760405162461bcd60e51b81526004018080602001828103825260318152602001806152526031913960400191505060405180910390fd5b6117c08484848461220e565b50505050565b606061065482612260565b60008181526101c66020908152604080832080548251818502810185019093528083526060949293919290918401821561151357600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b0316818301528252600190920191016114c4565b816001600160a01b031661185e611b0d565b6001600160a01b0316146118845760405162461bcd60e51b8152600401610c3090614d98565b61082783838361226b565b61022e805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156119165780601f106118eb57610100808354040283529160200191611916565b820191906000526020600020905b8154815290600101906020018083116118f957829003601f168201915b505050505081565b600061192a8383612317565b90505b92915050565b61193b611b0d565b6001600160a01b031661194c61151e565b6001600160a01b031614611995576040805162461bcd60e51b81526020600482018190526024820152600080516020615178833981519152604482015290519081900360640190fd5b6001600160a01b0381166119da5760405162461bcd60e51b8152600401808060200182810382526026815260200180614f806026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b03198216638486f69f60e01b1480611a6757506001600160e01b0319821663656cb66560e11b145b80611a8257506001600160e01b0319821663152a902d60e11b145b80611a9d57506001600160e01b031982166301ffc9a760e01b145b80611ab857506001600160e01b031982166380ac58cd60e01b145b80611ad357506001600160e01b03198216635b5e139f60e01b145b806106545750506001600160e01b03191663780e9d6360e01b1490565b600090815260ff60205260409020546001600160a01b0316151590565b6000611b17612344565b905090565b60008181526101016020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b5282611168565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000815160001415611b9f57506000610657565b506020015190565b6000806001611bbd611bb8886123a0565b612423565b84878760405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611c14573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611c70576040805162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015290519081900360640190fd5b866001600160a01b0316816001600160a01b03161491505095945050505050565b60008282018381101561192a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b815160601c6000611cfa611b0d565b90508360400151600081518110611d0d57fe5b6020026020010151600001516001600160a01b0316826001600160a01b031614611d495760405162461bcd60e51b8152600401610c3090614d6d565b83608001515184604001515114611d5f57600080fd5b806001600160a01b0316826001600160a01b03161480611d845750611d84828261191e565b611da05760405162461bcd60e51b8152600401610c3090614df4565b6000611dab8561246f565b905060005b856040015151811015611e2157600086604001518281518110611dcf57fe5b6020026020010151600001519050836001600160a01b0316816001600160a01b031614611e1857611e18818489608001518581518110611e0b57fe5b60200260200101516126b6565b50600101611db0565b50611e308486600001516126c1565b611e42856000015186606001516126db565b611e54856000015186604001516128ca565b611e6685600001518660200151612a79565b5050505050565b600061192a8383612add565b826001600160a01b0316611e8c82611168565b6001600160a01b031614611ed15760405162461bcd60e51b81526004018080602001828103825260298152602001806151986029913960400191505060405180910390fd5b6001600160a01b038216611f165760405162461bcd60e51b8152600401808060200182810382526024815260200180614fa66024913960400191505060405180910390fd5b611f21838383610827565b611f2c600082611b1c565b6001600160a01b0380841660008181526101006020908152604080832080546000190190559386168083528483208054600101905585835260ff90915283822080546001600160a01b0319168217905592518493929160008051602061521183398151915291a4505050565b600054610100900460ff1680611fb15750611fb1612b0a565b80611fbf575060005460ff16155b611ffa5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612025576000805460ff1961ff0019909116610100171660011790555b61202e856121fa565b612036612b1b565b61203e612bbc565b612046612b1b565b61204e612c59565b612056612cf6565b61205e612b1b565b612066612def565b61206e612b1b565b61207784612ebe565b6120818787612f85565b61208c836001613070565b612097826001613070565b80156120a9576000805461ff00191690555b50505050505050565b7f36c25de3e541d5d970f66e4210d728721220fff5c077cc6cd008b3a0c62adab782805190602001208280519060200120306120ec6130d1565b60405160200180868152602001858152602001848152602001836001600160a01b0316815260200182815260200195505050505050604051602081830303815290604052805190602001206102f8819055505050565b600090815261010360205260409020805460ff19166001179055565b600061216982611168565b905061217781600084610827565b612182600083611b1c565b61218b826130db565b6001600160a01b038116600090815261010060209081526040808320805460001901905584835260ff909152902080546001600160a01b03191690556121d082612142565b60405182906000906001600160a01b03841690600080516020615211833981519152908390a45050565b8051610c43906101c89060208401906142fc565b612219848484611e79565b612225848484846130e4565b6117c05760405162461bcd60e51b8152600401808060200182810382526032815260200180614f0b6032913960400191505060405180910390fd5b60606106548261329a565b60008381526101c66020526040812054905b81811015611e665760008581526101c66020526040902080546001600160a01b0386169190839081106122ac57fe5b6000918252602090912001546001600160a01b0316141561230f5760008581526101c6602052604090208054849190839081106122e557fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790555b60010161227d565b6001600160a01b038116600090815261012f602052604081205460ff168061192a575061192a8383613475565b60003330141561239b57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506106f09050565b503390565b6000604051806080016040528060438152602001614f3d60439139805190602001208260000151836020015184604001518051906020012060405160200180858152602001848152602001836001600160a01b03168152602001828152602001945050505050604051602081830303815290604052805190602001209050919050565b600061242d6134a4565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b6000808260600151516001600160401b038111801561248d57600080fd5b506040519080825280602002602001820160405280156124b7578160200160208202803683370190505b50905060005b836060015151811015612509576124ea846060015182815181106124dd57fe5b60200260200101516134ab565b8282815181106124f657fe5b60209081029190910101526001016124bd565b5060008360400151516001600160401b038111801561252757600080fd5b50604051908082528060200260200182016040528015612551578160200160208202803683370190505b50905060005b84604001515181101561259657612577856040015182815181106124dd57fe5b82828151811061258357fe5b6020908102919091010152600101612557565b507ff64326045af5fd7e15297ba939f85b550474d3899daa47d2bc1ffbdb9ced344e84600001518560200151805190602001208360405160200180828051906020019060200280838360005b838110156125fa5781810151838201526020016125e2565b50505050905001915050604051602081830303815290604052805190602001208560405160200180828051906020019060200280838360005b8381101561264b578181015183820152602001612633565b505050509050019150506040516020818303038152906040528051906020012060405160200180868152602001858152602001848152602001838152602001828152602001955050505050506040516020818303038152906040528051906020012092505050919050565b610827838383613518565b610c43828260405180602001604052806000815250613797565b6000805b825181101561287f5760006001600160a01b03168382815181106126ff57fe5b6020026020010151600001516001600160a01b03161415612767576040805162461bcd60e51b815260206004820152601b60248201527f526563697069656e742073686f756c642062652070726573656e740000000000604482015290519081900360640190fd5b82818151811061277357fe5b6020026020010151602001516001600160601b0316600014156127dd576040805162461bcd60e51b815260206004820181905260248201527f526f79616c74792076616c75652073686f756c6420626520706f736974697665604482015290519081900360640190fd5b8281815181106127e957fe5b6020026020010151602001516001600160601b0316820191506101c6600085815260200190815260200160002083828151811061282257fe5b60209081029190910181015182546001818101855560009485529383902082519101805492909301516001600160601b0316600160a01b026001600160a01b039182166001600160a01b03199093169290921716179055016126df565b5061271081106128c05760405162461bcd60e51b81526004018080602001828103825260258152602001806152836025913960400191505060405180910390fd5b61082783836137e9565b60008281526101fb6020526040812090805b8351811015612a185760006001600160a01b03168482815181106128fc57fe5b6020026020010151600001516001600160a01b0316141561292f5760405162461bcd60e51b8152600401610c3090614dbd565b83818151811061293b57fe5b6020026020010151602001516001600160601b0316600014156129705760405162461bcd60e51b8152600401610c3090614d38565b8284828151811061297d57fe5b602090810291909101810151825460018101845560009384529282902081519301805491909201516001600160601b0316600160a01b026001600160a01b039384166001600160a01b0319909216919091179092169190911790558351612a0e908590839081106129ea57fe5b6020026020010151602001516001600160601b031683611c9190919063ffffffff16565b91506001016128dc565b508061271014612a3a5760405162461bcd60e51b8152600401610c3090614e45565b7f841ffb90d4cabdd1f16034f3fa831d79060febbb8167bdd54a49269365bdf78f8484604051612a6b929190614e9c565b60405180910390a150505050565b612a8282611af0565b612abd5760405162461bcd60e51b815260040180806020018281038252602c81526020018061514c602c913960400191505060405180910390fd5b60008281526101c7602090815260409091208251610827928401906142fc565b6001600160a01b038216600090815261012f602052604081205460ff168061192a575061192a8383613826565b6000612b15306138c2565b15905090565b600054610100900460ff1680612b345750612b34612b0a565b80612b42575060005460ff16155b612b7d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612ba8576000805460ff1961ff0019909116610100171660011790555b8015611009576000805461ff001916905550565b600054610100900460ff1680612bd55750612bd5612b0a565b80612be3575060005460ff16155b612c1e5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612c49576000805460ff1961ff0019909116610100171660011790555b612ba863656cb66560e11b6138c8565b600054610100900460ff1680612c725750612c72612b0a565b80612c80575060005460ff16155b612cbb5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612ce6576000805460ff1961ff0019909116610100171660011790555b612ba86301ffc9a760e01b6138c8565b600054610100900460ff1680612d0f5750612d0f612b0a565b80612d1d575060005460ff16155b612d585760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612d83576000805460ff1961ff0019909116610100171660011790555b6000612d8d611b0d565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015611009576000805461ff001916905550565b600054610100900460ff1680612e085750612e08612b0a565b80612e16575060005460ff16155b612e515760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612e7c576000805460ff1961ff0019909116610100171660011790555b612ba8604051806040016040528060078152602001664d696e7437323160c81b815250604051806040016040528060018152602001603160f81b81525061394c565b600054610100900460ff1680612ed75750612ed7612b0a565b80612ee5575060005460ff16155b612f205760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612f4b576000805460ff1961ff0019909116610100171660011790555b8151612f5f9061022e9060208501906142fc565b50612f7063e8a3d48560e01b6138c8565b8015610c43576000805461ff00191690555050565b600054610100900460ff1680612f9e5750612f9e612b0a565b80612fac575060005460ff16155b612fe75760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff16158015613012576000805460ff1961ff0019909116610100171660011790555b82516130259060fd9060208601906142fc565b5081516130399060fe9060208501906142fc565b5061304a6380ac58cd60e01b6138c8565b61305a635b5e139f60e01b6138c8565b8015610827576000805461ff0019169055505050565b6001600160a01b038216600081815261012f6020908152604091829020805460ff1916851515908117909155825190815291517f270dbb8ba4292910ae92862466486be25c355c837270a3d8824b36a8bc7c653b9281900390910190a25050565b6000611b17613a0c565b61100981613a10565b60006130f8846001600160a01b03166138c2565b1561328e57836001600160a01b031663150b7a02613114611b0d565b8786866040518563ffffffff1660e01b815260040180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561318757818101518382015260200161316f565b50505050905090810190601f1680156131b45780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156131d657600080fd5b505af19250505080156131fb57506040513d60208110156131f657600080fd5b505160015b613274573d808015613229576040519150601f19603f3d011682016040523d82523d6000602084013e61322e565b606091505b50805161326c5760405162461bcd60e51b8152600401808060200182810382526032815260200180614f0b6032913960400191505060405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613292565b5060015b949350505050565b60606132a582611af0565b6132e05760405162461bcd60e51b815260040180806020018281038252602f8152602001806151e2602f913960400191505060405180910390fd5b60008281526101c7602090815260408083208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156133745780601f1061334957610100808354040283529160200191613374565b820191906000526020600020905b81548152906001019060200180831161335757829003601f168201915b5050505050905060006133856111bc565b905080516000141561339957509050610657565b8151156133b3576133aa8183613a19565b92505050610657565b806133bd85613bfe565b6040516020018083805190602001908083835b602083106133ef5780518252601f1990920191602091820191016133d0565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106134375780518252601f199092019160209182019101613418565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405292505050919050565b6001600160a01b0391821660009081526101026020908152604080832093909416825291909152205460ff1690565b6102f85490565b8051602091820151604080517f397e04204c1e1a60ee8724b71f8244e10ab5f2e9009854d80f602bda21b59ebb818601526001600160a01b03909316838201526001600160601b039091166060808401919091528151808403909101815260809092019052805191012090565b600061352383613cd8565b9050600082516041141561353e5761353b8284613ce2565b90505b846001600160a01b0316816001600160a01b031614611e6657613569856001600160a01b03166138c2565b1561371f5760408051630b135d3f60e11b808252600482018581526024830193845286516044840152865191936001600160a01b038a1693631626ba7e9388938a9390929091606490910190602085019080838360005b838110156135d85781810151838201526020016135c0565b50505050905090810190601f1680156136055780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561362357600080fd5b505afa158015613637573d6000803e3d6000fd5b505050506040513d602081101561364d57600080fd5b505160408051808201909152601c81527f7369676e617475726520766572696669636174696f6e206572726f72000000006020820152916001600160e01b0319909116146137195760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156136de5781810151838201526020016136c6565b50505050905090810190601f16801561370b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50611e66565b604080518082018252601c81527f7369676e617475726520766572696669636174696f6e206572726f72000000006020808301918252925162461bcd60e51b815260048101938452825160248201528251929392839260449092019190808383600083156136de5781810151838201526020016136c6565b6137a18383613d62565b6137ae60008484846130e4565b6108275760405162461bcd60e51b8152600401808060200182810382526032815260200180614f0b6032913960400191505060405180910390fd5b7f3fa96d7b6bcbfe71ef171666d84db3cf52fa2d1c8afdb1cc8e486177f208b7df828260405161381a929190614e9c565b60405180910390a15050565b600061383182611af0565b61386c5760405162461bcd60e51b815260040180806020018281038252602c815260200180614fec602c913960400191505060405180910390fd5b600061387783611168565b9050806001600160a01b0316846001600160a01b031614806138b25750836001600160a01b03166138a7846106f3565b6001600160a01b0316145b806132925750613292818561191e565b3b151590565b6001600160e01b03198082161415613927576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152606560205260409020805460ff19166001179055565b600054610100900460ff16806139655750613965612b0a565b80613973575060005460ff16155b6139ae5760405162461bcd60e51b815260040180806020018281038252602e8152602001806150a3602e913960400191505060405180910390fd5b600054610100900460ff161580156139d9576000805460ff1961ff0019909116610100171660011790555b82516020808501919091208351918401919091206097919091556098558015610827576000805461ff0019169055505050565b4690565b61100981613ec8565b80518251606091849184911015613ae45784846040516020018083805190602001908083835b60208310613a5e5780518252601f199092019160209182019101613a3f565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310613aa65780518252601f199092019160209182019101613a87565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529250505061192d565b60005b8251811015613bf457828181518110613afc57fe5b602001015160f81c60f81b6001600160f81b031916828281518110613b1d57fe5b01602001516001600160f81b03191614613bec5785856040516020018083805190602001908083835b60208310613b655780518252601f199092019160209182019101613b46565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310613bad5780518252601f199092019160209182019101613b8e565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052935050505061192d565b600101613ae7565b5092949350505050565b606081613c2357506040805180820190915260018152600360fc1b6020820152610657565b8160005b8115613c3b57600101600a82049150613c27565b6000816001600160401b0381118015613c5357600080fd5b506040519080825280601f01601f191660200182016040528015613c7e576020820181803683370190505b50859350905060001982015b8315613ccf57600a840660300160f81b82828060019003935081518110613cad57fe5b60200101906001600160f81b031916908160001a905350600a84049350613c8a565b50949350505050565b600061242d613f08565b60008151604114613d3a576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a613d5886828585613f43565b9695505050505050565b6001600160a01b038216613dbd576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b6000818152610103602052604090205460ff1615613e19576040805162461bcd60e51b81526020600482015260146024820152731d1bdad95b88185b1c9958591e48189d5c9b995960621b604482015290519081900360640190fd5b613e2281611af0565b15613e74576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b613e8060008383610827565b6001600160a01b0382166000818152610100602090815260408083208054600101905584835260ff909152902080546001600160a01b0319169091179055610c438282614199565b60008181526101c7602052604090205460026000196101006001841615020190911604156110095760008181526101c76020526040812061100991614388565b6000611b177f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613f366141a3565b613f3e6141a9565b6141af565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613fa45760405162461bcd60e51b8152600401808060200182810382526022815260200180614fca6022913960400191505060405180910390fd5b6000601e8560ff16111561407e576004850360ff16601b1480613fcd57506004850360ff16601c145b6140085760405162461bcd60e51b81526004018080602001828103825260228152602001806150d16022913960400191505060405180910390fd5b600161401387614211565b60048703868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561406d573d6000803e3d6000fd5b505050602060405103519050614135565b8460ff16601b148061409357508460ff16601c145b6140ce5760405162461bcd60e51b81526004018080602001828103825260228152602001806150d16022913960400191505060405180910390fd5b60018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015614128573d6000803e3d6000fd5b5050506020604051035190505b6001600160a01b038116614190576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b610c438282614262565b60975490565b60985490565b60008383836141bc613a0c565b3060405160200180868152602001858152602001848152602001838152602001826001600160a01b03168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b606081901c6001600160a01b03831681146142d15760405182906001600160a01b03831690600090600080516020615211833981519152908290a481836001600160a01b0316826001600160a01b031660008051602061521183398151915260405160405180910390a4610827565b60405182906001600160a01b03851690600090600080516020615211833981519152908290a4505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826143325760008555614378565b82601f1061434b57805160ff1916838001178555614378565b82800160010185558215614378579182015b8281111561437857825182559160200191906001019061435d565b506143849291506143c8565b5090565b50805460018160011615610100020316600290046000825580601f106143ae5750611009565b601f01602090049060005260206000209081019061100991905b5b8082111561438457600081556001016143c9565b803561065781614ef5565b600082601f8301126143f8578081fd5b8135602061440d61440883614ed8565b614eb5565b8281528181019085830183850287018401881015614429578586fd5b855b8581101561445057813561443e81614ef5565b8452928401929084019060010161442b565b5090979650505050505050565b600082601f83011261446d578081fd5b8135602061447d61440883614ed8565b82815281810190858301855b85811015614450576144a0898684358b010161456d565b84529284019290840190600101614489565b600082601f8301126144c2578081fd5b813560206144d261440883614ed8565b828152818101908583016040808602880185018910156144f0578687fd5b865b8681101561455f5781838b031215614508578788fd5b81518281018181106001600160401b038211171561452257fe5b8352833561452f81614ef5565b8152838701356001600160601b038116811461454957898afd5b81880152855293850193918101916001016144f2565b509198975050505050505050565b600082601f83011261457d578081fd5b81356001600160401b0381111561459057fe5b6145a3601f8201601f1916602001614eb5565b8181528460208386010111156145b7578283fd5b816020850160208301379081016020019190915292915050565b600060a082840312156145e2578081fd5b6145ec60a0614eb5565b90508135815260208201356001600160401b038082111561460c57600080fd5b6146188583860161456d565b6020840152604084013591508082111561463157600080fd5b61463d858386016144b2565b6040840152606084013591508082111561465657600080fd5b614662858386016144b2565b6060840152608084013591508082111561467b57600080fd5b506146888482850161445d565b60808301525092915050565b6000602082840312156146a5578081fd5b813561192a81614ef5565b600080604083850312156146c2578081fd5b82356146cd81614ef5565b915060208301356146dd81614ef5565b809150509250929050565b6000806000606084860312156146fc578081fd5b833561470781614ef5565b9250602084013561471781614ef5565b929592945050506040919091013590565b6000806000806080858703121561473d578182fd5b843561474881614ef5565b9350602085013561475881614ef5565b92506040850135915060608501356001600160401b03811115614779578182fd5b6147858782880161456d565b91505092959194509250565b600080604083850312156147a3578182fd5b82356147ae81614ef5565b9150602083013580151581146146dd578182fd5b600080600080600060a086880312156147d9578283fd5b85356147e481614ef5565b945060208601356001600160401b038111156147fe578384fd5b61480a8882890161456d565b9450506040860135925060608601359150608086013560ff8116811461482e578182fd5b809150509295509295909350565b6000806040838503121561484e578182fd5b823561485981614ef5565b946020939093013593505050565b600060208284031215614878578081fd5b81356001600160401b0381111561488d578182fd5b613292848285016143e8565b6000602082840312156148aa578081fd5b81356001600160e01b03198116811461192a578182fd5b6000602082840312156148d2578081fd5b81356001600160401b038111156148e7578182fd5b6132928482850161456d565b60008060008060008060c0878903121561490b578384fd5b86356001600160401b0380821115614921578586fd5b61492d8a838b0161456d565b97506020890135915080821115614942578586fd5b61494e8a838b0161456d565b96506040890135915080821115614963578586fd5b61496f8a838b0161456d565b95506060890135915080821115614984578283fd5b5061499189828a0161456d565b9350506149a0608088016143dd565b91506149ae60a088016143dd565b90509295509295509295565b600080600080600080600060e0888a0312156149d4578485fd5b87356001600160401b03808211156149ea578687fd5b6149f68b838c0161456d565b985060208a0135915080821115614a0b578687fd5b614a178b838c0161456d565b975060408a0135915080821115614a2c578687fd5b614a388b838c0161456d565b965060608a0135915080821115614a4d578283fd5b614a598b838c0161456d565b955060808a0135915080821115614a6e578283fd5b50614a7b8a828b016143e8565b935050614a8a60a089016143dd565b9150614a9860c089016143dd565b905092959891949750929550565b60008060408385031215614ab8578182fd5b82356001600160401b03811115614acd578283fd5b614ad9858286016145d1565b92505060208301356146dd81614ef5565b600080600060608486031215614afe578081fd5b83356001600160401b03811115614b13578182fd5b614b1f868287016145d1565b9350506020840135614b3081614ef5565b91506040840135614b4081614ef5565b809150509250925092565b600060208284031215614b5c578081fd5b5035919050565b600080600060608486031215614b77578081fd5b833592506020840135614b3081614ef5565b60008060408385031215614b9b578182fd5b50508035926020909101359150565b6000815180845260208085019450808401835b83811015614bf657815180516001600160a01b031688528301516001600160601b03168388015260409096019590820190600101614bbd565b509495945050505050565b60008151808452815b81811015614c2657602081850181015186830182015201614c0a565b81811115614c375782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0384168152606060208201819052600090614c8490830185614c01565b8281036040840152613d588185614c01565b6001600160a01b03929092168252602082015260400190565b60006020825261192a6020830184614baa565b901515815260200190565b60006020825261192a6020830184614c01565b6020808252601190820152703bb937b7339037b93232b91036b0b5b2b960791b604082015260600190565b6020808252601390820152723737ba1037bbb732b91037b91036b4b73a32b960691b604082015260600190565b6020808252818101527f43726561746f722073686172652073686f756c6420626520706f736974697665604082015260600190565b6020808252601190820152701d1bdad95b9259081a5b98dbdc9c9958dd607a1b604082015260600190565b6020808252600b908201526a1b9bdd08185b1b1bddd95960aa1b604082015260600190565b60208082526019908201527f4163636f756e742073686f756c642062652070726573656e7400000000000000604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602e908201527f746f74616c20616d6f756e74206f662063726561746f7273207368617265207360408201526d0686f756c642062652031303030360941b606082015260800190565b90815260200190565b6000838252604060208301526132926040830184614baa565b6040518181016001600160401b0381118282101715614ed057fe5b604052919050565b60006001600160401b03821115614eeb57fe5b5060209081020190565b6001600160a01b038116811461100957600080fdfe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e6174757265294f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f206164647265737345434453413a20696e76616c6964207369676e6174757265202773272076616c75654552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c75654552433732314275726e61626c653a2063616c6c6572206973206e6f74206f776e65722c206e6f74206275726e4552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e5369676e657220616e64207369676e617475726520646f206e6f74206d617463684552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564526f79616c747920746f74616c2076616c75652073686f756c64206265203c2031303030304552433732314275726e61626c653a2063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564a2646970667358221220a4af80d98c1ea06b28253abe062a76cad67681536d192b48c743dfd2de8061ed64736f6c63430007060033