Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
Minterceptor
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@manifoldxyz/royalty-registry-solidity/contracts/overrides/IRoyaltySplitter.sol"; import "./interfaces/IMinterceptor.sol"; import "./interfaces/ICollection.sol"; import "./MinterceptorStorage.sol"; import "../ManageableUpgradeable.sol"; import "../QuantumBlackListable.sol"; error NotAuthorized(); error InvalidTargetContract(address collectionContract); error InvalidTreasuryAddress(); contract Minterceptor is IMinterceptor, OwnableUpgradeable, ManageableUpgradeable, PausableUpgradeable, UUPSUpgradeable { using MinterceptorStorage for MinterceptorStorage.Layout; using AddressUpgradeable for address; using AddressUpgradeable for address payable; event MintForwarded( uint256 voucherId, address collectionContract, uint256 indexed itemId, address to ); event MintEditionsForwarded( uint256 voucherId, address collectionContract, uint256 indexed itemId, uint256 indexed tokenId, uint256 quantity, address to ); /// >>>>>>>>>>>>>>>>>>>>> INITIALIZER <<<<<<<<<<<<<<<<<<<<<< /// function initialize( address admin, address blacklist, address payable treasury ) public initializer { __Minterceptor_init(admin, blacklist, treasury); } function __Minterceptor_init( address admin, address blacklist, address payable treasury ) internal onlyInitializing { __Ownable_init(); __UUPSUpgradeable_init(); __Minterceptor_init_unchained(admin, blacklist, treasury); } function __Minterceptor_init_unchained( address admin, address blacklist, address payable treasury ) internal onlyInitializing { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(MANAGER_ROLE, msg.sender); _setupRole(DEFAULT_ADMIN_ROLE, admin); _setupRole(MANAGER_ROLE, admin); setBlacklist(blacklist); MinterceptorStorage.Layout storage m = MinterceptorStorage.layout(); m.treasury = treasury; m.defaultPlatformFee = 500; //bps } /// >>>>>>>>>>>>>>>>>>>>> PERMISSIONS <<<<<<<<<<<<<<<<<<<<<< /// function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} /// @notice set address of the minter /// @param owner The address of the new owner function setOwner(address owner) public onlyOwner { transferOwnership(owner); } /// @notice add a contract manager /// @param manager The address of the maanger function setManager(address manager) public onlyRole(DEFAULT_ADMIN_ROLE) { grantRole(MANAGER_ROLE, manager); } /// @notice add a contract manager /// @param manager The address of the maanger function unsetManager(address manager) public onlyRole(DEFAULT_ADMIN_ROLE) { revokeRole(MANAGER_ROLE, manager); } /// @notice update the blacklist contract /// @param blacklist The address of the blacklist contract function setBlacklist(address blacklist) public onlyRole(DEFAULT_ADMIN_ROLE) whenNotPaused { MinterceptorStorage.Layout storage m = MinterceptorStorage.layout(); m.blackListAddress = blacklist; } /// @notice update the default platform fees /// @param fee BPS value of the studio platform fee function setDefaultPlaformFee(uint256 fee) public onlyRole(DEFAULT_ADMIN_ROLE) whenNotPaused { MinterceptorStorage.Layout storage m = MinterceptorStorage.layout(); m.defaultPlatformFee = fee; } /// @notice Set the treasury address /// @param treasury Address of the treasury function setTreasury(address payable treasury) public onlyRole(DEFAULT_ADMIN_ROLE) whenNotPaused { if (treasury == address(0)) revert InvalidTreasuryAddress(); MinterceptorStorage.Layout storage m = MinterceptorStorage.layout(); m.treasury = treasury; } /// >>>>>>>>>>>>>>>>>>>>> CONTRACT MANAGEMENT <<<<<<<<<<<<<<<<<<<<<< /// /// @notice Pause contract function pause() public onlyRole(DEFAULT_ADMIN_ROLE) { _pause(); } /// @notice Unpause contract function unpause() public onlyRole(DEFAULT_ADMIN_ROLE) { _unpause(); } /// >>>>>>>>>>>>>>>>>>>>> BLACKLIST OPS <<<<<<<<<<<<<<<<<<<<<< /// modifier isNotBlackListed(address user) { if ( QuantumBlackListable.isBlackListed( user, MinterceptorStorage.layout().blackListAddress ) ) { revert QuantumBlackListable.BlackListedAddress(user); } _; } /// >>>>>>>>>>>>>>>>>>>>> CORE FUNCTIONALITY <<<<<<<<<<<<<<<<<<<<<< /// // Pay splits if royalty splitting supported function handleRoyalties(address collection) private { MinterceptorStorage.Layout storage m = MinterceptorStorage.layout(); uint256 platformValue = (msg.value * m.defaultPlatformFee) / 10000; m.treasury.sendValue(platformValue); // Pay splits if royalty splitting supported try IERC165Upgradeable(collection).supportsInterface( type(IRoyaltySplitter).interfaceId ) returns (bool royaltySplitSupported) { if (royaltySplitSupported) { // Get receiver addresses and splits from the collection contract Recipient[] memory recipients = IRoyaltySplitter(collection) .getRecipients(); // Pay artist royalty splits for (uint256 i = 0; i < recipients.length; i++) { payable(recipients[i].recipient).sendValue( ((msg.value - platformValue) * recipients[i].bps) / 10000 ); } } else { // Get receiver address from the collection contract (address receiver, uint256 royaltyAmount) = IERC2981(collection) .royaltyInfo(0, 1 ether); // Pay single artist payable(receiver).sendValue(msg.value - platformValue); } } catch {} } function mintByUri( uint256 voucherId, address collectionContract, uint256 itemId, address to, string calldata uri, bytes calldata data ) public payable onlyRole(MANAGER_ROLE) whenNotPaused isNotBlackListed(to) { if (!collectionContract.isContract()) revert InvalidTargetContract(collectionContract); try IERC165Upgradeable(collectionContract).supportsInterface( type(IERC2981).interfaceId ) returns (bool supported) { if (supported) { IMintByUri collection = IMintByUri(collectionContract); collection.mint(to, uri, data); emit MintForwarded(voucherId, collectionContract, itemId, to); handleRoyalties(collectionContract); } else { revert InvalidTargetContract(collectionContract); } } catch ( bytes memory /*lowLevelData*/ ) { // Contracts doesn't support IStudioRoyalties revert InvalidTargetContract(collectionContract); } } function _setItemTokenId(address collectionContract, uint256 itemId) internal returns (uint256) { MinterceptorStorage.Layout storage m = MinterceptorStorage.layout(); if (m.itemIdToTokenId[collectionContract][itemId] == 0) { m.currentTokenId[collectionContract]++; m.itemIdToTokenId[collectionContract][itemId] = m.currentTokenId[ collectionContract ]; } return m.itemIdToTokenId[collectionContract][itemId]; } function mintEditions( MintEditionsParams calldata mintParams, bytes calldata data ) public payable onlyRole(MANAGER_ROLE) whenNotPaused isNotBlackListed(mintParams.to) { if (!mintParams.collection.isContract()) revert InvalidTargetContract(mintParams.collection); try IERC165Upgradeable(mintParams.collection).supportsInterface( type(IERC2981).interfaceId ) returns (bool supported) { if (supported) { uint256 tokenId = _setItemTokenId( mintParams.collection, mintParams.itemId ); IMintEditions collection = IMintEditions(mintParams.collection); collection.mint( mintParams.to, tokenId, mintParams.quantity, data ); emit MintEditionsForwarded( mintParams.voucherId, mintParams.collection, mintParams.itemId, tokenId, mintParams.quantity, mintParams.to ); handleRoyalties(mintParams.collection); } else { revert InvalidTargetContract(mintParams.collection); } } catch ( bytes memory /*lowLevelData*/ ) { // Contracts doesn't support IStudioRoyalties revert InvalidTargetContract(mintParams.collection); } } function mintEditions( MintEditionsParams calldata mintParams, string calldata _tokenUri, bytes calldata data ) public payable onlyRole(MANAGER_ROLE) whenNotPaused isNotBlackListed(mintParams.to) { if (!mintParams.collection.isContract()) revert InvalidTargetContract(mintParams.collection); try IERC165Upgradeable(mintParams.collection).supportsInterface( type(IERC2981).interfaceId ) returns (bool supported) { if (supported) { uint256 tokenId = _setItemTokenId( mintParams.collection, mintParams.itemId ); IMintEditions collection = IMintEditions(mintParams.collection); collection.mint( mintParams.to, tokenId, _tokenUri, mintParams.quantity, data ); emit MintEditionsForwarded( mintParams.voucherId, mintParams.collection, mintParams.itemId, tokenId, mintParams.quantity, mintParams.to ); handleRoyalties(mintParams.collection); } else { revert InvalidTargetContract(mintParams.collection); } } catch ( bytes memory /*lowLevelData*/ ) { // Contracts doesn't support IStudioRoyalties revert InvalidTargetContract(mintParams.collection); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/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 onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; struct Recipient { address payable recipient; uint16 bps; } interface IRoyaltySplitter is IERC165 { /** * @dev Set the splitter recipients. Total bps must total 10000. */ function setRecipients(Recipient[] calldata recipients) external; /** * @dev Get the splitter recipients; */ function getRecipients() external view returns (Recipient[] memory); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.11; struct MintEditionsParams { uint256 voucherId; uint256 itemId; uint256 quantity; address to; address collection; } interface IMinterceptor { function mintByUri( uint256 voucherId, address collectionContract, uint256 itemId, address to, string calldata uri, bytes calldata data ) external payable; function mintEditions( MintEditionsParams calldata mintParams, bytes calldata data ) external payable; function mintEditions( MintEditionsParams calldata mintParams, string calldata uri, bytes calldata data ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; interface IMintByUri { function mint( address to, string memory uri, bytes memory data ) external; } interface IMintEditions { function mint( address to, uint256 tokenId, string calldata uri, uint256 quantity, bytes calldata data ) external; function mint( address to, uint256 tokenId, uint256 quantity, bytes calldata data ) external; } interface ICollectionSupplyDeprecated { function maxSupply() external view returns (uint256); function setSupply(uint256 _maxSupply) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.11; import "../interfaces/IQuantumBlackList.sol"; library MinterceptorStorage { struct Layout { address blackListAddress; address payable treasury; uint256 defaultPlatformFee; mapping(address => mapping(uint256 => uint256)) itemIdToTokenId; mapping(address => uint256) currentTokenId; // allows for sequential tokenId's for a given collection } bytes32 internal constant STORAGE_SLOT = keccak256("quantum.contracts.storage.minterceptor.v1"); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; abstract contract ManageableUpgradeable is AccessControlEnumerableUpgradeable { bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); function __Manageable_init() internal onlyInitializing { __AccessControl_init_unchained(); __Manageable_init_unchained(); } function __Manageable_init_unchained() internal onlyInitializing {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "./QuantumBlackList.sol"; // contracts that want to implement blackListing on specific methods (e.g. minting) can and use the functions in this library // due to issues with upgrading storage on already deployed contracts, the blackListContractAddress must be stored in the contract itself library QuantumBlackListable { error BlackListedAddress(address _address); error InvalidBlackListAddress(); error BlackListedAddressNotSet(); function isBlackListed(address user, address blContractAddress) internal view returns (bool) { QuantumBlackList qbl = QuantumBlackList(blContractAddress); if (blContractAddress == address(0)) { revert BlackListedAddressNotSet(); } if (qbl.isBlackListed(user)) { return true; } return false; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; interface IQuantumBlackList { function initialize(address admin) external; function addToBlackList(address[] calldata users) external; function removeFromBlackList(address user) external; function isBlackListed(address user) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(account), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "./interfaces/IQuantumBlackList.sol"; import "./QuantumBlackListStorage.sol"; import "./ManageableUpgradeable.sol"; error AlreadyBlackListed(); error NotBlackListed(address _address); contract QuantumBlackList is IQuantumBlackList, OwnableUpgradeable, ManageableUpgradeable, UUPSUpgradeable { using QuantumBlackListStorage for QuantumBlackListStorage.Layout; event BlackListAddress(address indexed user, bool isBlackListed); /// >>>>>>>>>>>>>>>>>>>>> INITIALIZER <<<<<<<<<<<<<<<<<<<<<< /// function initialize(address admin) public initializer { __QuantumBlackList_init(admin); } function __QuantumBlackList_init(address admin) internal onlyInitializing { __Ownable_init(); __UUPSUpgradeable_init(); __QuantumBlackList_init_unchained(admin); } function __QuantumBlackList_init_unchained(address admin) internal onlyInitializing { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(MANAGER_ROLE, msg.sender); _setupRole(DEFAULT_ADMIN_ROLE, admin); _setupRole(MANAGER_ROLE, admin); } /// >>>>>>>>>>>>>>>>>>>>> PERMISSIONS <<<<<<<<<<<<<<<<<<<<<< /// function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} /// @notice set address of the minter /// @param owner The address of the new owner function setOwner(address owner) public onlyOwner { transferOwnership(owner); } /// @notice add a contract manager /// @param manager The address of the maanger function setManager(address manager) public onlyRole(DEFAULT_ADMIN_ROLE) { grantRole(MANAGER_ROLE, manager); } /// @notice add a contract manager /// @param manager The address of the maanger function unsetManager(address manager) public onlyRole(DEFAULT_ADMIN_ROLE) { revokeRole(MANAGER_ROLE, manager); } /// >>>>>>>>>>>>>>>>>>>>> CORE FUNCTIONALITY <<<<<<<<<<<<<<<<<<<<<< /// /// @notice bulk add addresses to blackList /// @param users The list of address to add to the blackList function addToBlackList(address[] calldata users) public onlyRole(MANAGER_ROLE) { QuantumBlackListStorage.Layout storage qbl = QuantumBlackListStorage .layout(); for (uint256 i = 0; i < users.length; i++) { address user = users[i]; if (user != address(0) && !qbl.blackList[user]) { qbl.blackList[user] = true; emit BlackListAddress(user, true); } } } /// @notice remove single address from blackList /// @param user The address to remove from the blackList function removeFromBlackList(address user) public onlyRole(MANAGER_ROLE) { QuantumBlackListStorage.Layout storage qbl = QuantumBlackListStorage .layout(); if (qbl.blackList[user]) { qbl.blackList[user] = false; emit BlackListAddress(user, false); } else { revert NotBlackListed(user); } } function isBlackListed(address user) public view returns (bool) { return QuantumBlackListStorage.layout().blackList[user]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; library QuantumBlackListStorage { struct Layout { mapping(address => bool) blackList; } bytes32 internal constant STORAGE_SLOT = keccak256("quantum.contracts.storage.quantumblacklist.v1"); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"BlackListedAddress","type":"error"},{"inputs":[],"name":"BlackListedAddressNotSet","type":"error"},{"inputs":[{"internalType":"address","name":"collectionContract","type":"address"}],"name":"InvalidTargetContract","type":"error"},{"inputs":[],"name":"InvalidTreasuryAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voucherId","type":"uint256"},{"indexed":false,"internalType":"address","name":"collectionContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"MintEditionsForwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voucherId","type":"uint256"},{"indexed":false,"internalType":"address","name":"collectionContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"MintForwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"blacklist","type":"address"},{"internalType":"address payable","name":"treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"voucherId","type":"uint256"},{"internalType":"address","name":"collectionContract","type":"address"},{"internalType":"uint256","name":"itemId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintByUri","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"voucherId","type":"uint256"},{"internalType":"uint256","name":"itemId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"collection","type":"address"}],"internalType":"struct MintEditionsParams","name":"mintParams","type":"tuple"},{"internalType":"string","name":"_tokenUri","type":"string"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintEditions","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"voucherId","type":"uint256"},{"internalType":"uint256","name":"itemId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"collection","type":"address"}],"internalType":"struct MintEditionsParams","name":"mintParams","type":"tuple"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintEditions","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"blacklist","type":"address"}],"name":"setBlacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setDefaultPlaformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"manager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"manager","type":"address"}],"name":"unsetManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60a06040523060805234801561001457600080fd5b50608051612f5061004c60003960008181610960015281816109a001528181610a9201528181610ad20152610b610152612f506000f3fe6080604052600436106101c25760003560e01c8063715018a6116100f7578063ba3d10c811610095578063d547741f11610064578063d547741f146104bb578063ec87621c146104db578063f0f44260146104fd578063f2fde38b1461051d57600080fd5b8063ba3d10c81461043b578063c0c53b8b1461045b578063ca15c8731461047b578063d0ebdbe71461049b57600080fd5b80638da5cb5b116100d15780638da5cb5b146103b45780639010d07c146103e657806391d1485414610406578063a217fddf1461042657600080fd5b8063715018a6146103775780637796dca01461038c5780638456cb591461039f57600080fd5b80633659cfe6116101645780634f1ef2861161013e5780634f1ef2861461032457806352d1902d1461033757806352d7c2921461034c5780635c975abb1461035f57600080fd5b80633659cfe6146102cf5780633f4ba83a146102ef5780634e054a671461030457600080fd5b8063248a9ca3116101a0578063248a9ca31461023157806329b0de1e1461026f5780632f2ff15d1461028f57806336568abe146102af57600080fd5b806301ffc9a7146101c75780630765df5f146101fc57806313af403514610211575b600080fd5b3480156101d357600080fd5b506101e76101e236600461259a565b61053d565b60405190151581526020015b60405180910390f35b61020f61020a366004612625565b610568565b005b34801561021d57600080fd5b5061020f61022c3660046126bc565b610877565b34801561023d57600080fd5b5061026161024c3660046126d9565b60009081526097602052604090206001015490565b6040519081526020016101f3565b34801561027b57600080fd5b5061020f61028a3660046126bc565b61088b565b34801561029b57600080fd5b5061020f6102aa3660046126f2565b6108b2565b3480156102bb57600080fd5b5061020f6102ca3660046126f2565b6108dc565b3480156102db57600080fd5b5061020f6102ea3660046126bc565b610956565b3480156102fb57600080fd5b5061020f610a32565b34801561031057600080fd5b5061020f61031f3660046126bc565b610a45565b61020f610332366004612792565b610a88565b34801561034357600080fd5b50610261610b54565b61020f61035a36600461283a565b610c07565b34801561036b57600080fd5b5060fb5460ff166101e7565b34801561038357600080fd5b5061020f610ec2565b61020f61039a36600461288e565b610ed6565b3480156103ab57600080fd5b5061020f61112e565b3480156103c057600080fd5b506033546001600160a01b03165b6040516001600160a01b0390911681526020016101f3565b3480156103f257600080fd5b506103ce610401366004612936565b611141565b34801561041257600080fd5b506101e76104213660046126f2565b611160565b34801561043257600080fd5b50610261600081565b34801561044757600080fd5b5061020f6104563660046126d9565b61118b565b34801561046757600080fd5b5061020f610476366004612958565b6111c3565b34801561048757600080fd5b506102616104963660046126d9565b6112da565b3480156104a757600080fd5b5061020f6104b63660046126bc565b6112f1565b3480156104c757600080fd5b5061020f6104d63660046126f2565b611314565b3480156104e757600080fd5b50610261600080516020612ed483398151915281565b34801561050957600080fd5b5061020f6105183660046126bc565b611339565b34801561052957600080fd5b5061020f6105383660046126bc565b6113b5565b60006001600160e01b03198216635a05180f60e01b148061056257506105628261142b565b92915050565b600080516020612ed483398151915261058081611460565b61058861146a565b61059860808701606088016126bc565b6105bb81600080516020612e948339815191525b546001600160a01b03166114b0565b156105e957604051630e277acb60e31b81526001600160a01b03821660048201526024015b60405180910390fd5b61060b6105fc60a0890160808a016126bc565b6001600160a01b03163b151590565b6106445761061f60a08801608089016126bc565b604051637b1dc55d60e01b81526001600160a01b0390911660048201526024016105e0565b61065460a08801608089016126bc565b6040516301ffc9a760e01b815263152a902d60e11b60048201526001600160a01b0391909116906301ffc9a790602401602060405180830381865afa9250505080156106bd575060408051601f3d908101601f191682019092526106ba918101906129a3565b60015b610701573d8080156106eb576040519150601f19603f3d011682016040523d82523d6000602084013e6106f0565b606091505b5061061f60a0890160808a016126bc565b801561085d57600061072661071c60a08b0160808c016126bc565b8a6020013561155d565b9050600061073a60a08b0160808c016126bc565b90506001600160a01b03811663cf237fc061075b60808d0160608e016126bc565b848c8c8f604001358d8d6040518863ffffffff1660e01b815260040161078797969594939291906129ee565b600060405180830381600087803b1580156107a157600080fd5b505af11580156107b5573d6000803e3d6000fd5b50505050818a602001357f3a1501949f4fcb896124b2ef3aec2ad731cb25b915e06bcd8173828af40457648c600001358d60800160208101906107f891906126bc565b8e604001358f606001602081019061081091906126bc565b604080519485526001600160a01b03938416602086015284019190915216606082015260800160405180910390a361085661085160a08c0160808d016126bc565b611640565b505061086d565b61061f60a0890160808a016126bc565b5050505050505050565b61087f6118c3565b610888816113b5565b50565b600061089681611460565b6108ae600080516020612ed483398151915283611314565b5050565b6000828152609760205260409020600101546108cd81611460565b6108d7838361191d565b505050565b6001600160a01b038116331461094c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e0565b6108ae828261193f565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361099e5760405162461bcd60e51b81526004016105e090612a3d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166109e7600080516020612eb4833981519152546001600160a01b031690565b6001600160a01b031614610a0d5760405162461bcd60e51b81526004016105e090612a89565b610a1681611961565b6040805160008082526020820190925261088891839190611969565b6000610a3d81611460565b610888611ad4565b6000610a5081611460565b610a5861146a565b50600080516020612e9483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ad05760405162461bcd60e51b81526004016105e090612a3d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610b19600080516020612eb4833981519152546001600160a01b031690565b6001600160a01b031614610b3f5760405162461bcd60e51b81526004016105e090612a89565b610b4882611961565b6108ae82826001611969565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bf45760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016105e0565b50600080516020612eb483398151915290565b600080516020612ed4833981519152610c1f81611460565b610c2761146a565b610c3760808501606086016126bc565b610c4f81600080516020612e948339815191526105ac565b15610c7857604051630e277acb60e31b81526001600160a01b03821660048201526024016105e0565b610c8b6105fc60a08701608088016126bc565b610c9f5761061f60a08601608087016126bc565b610caf60a08601608087016126bc565b6040516301ffc9a760e01b815263152a902d60e11b60048201526001600160a01b0391909116906301ffc9a790602401602060405180830381865afa925050508015610d18575060408051601f3d908101601f19168201909252610d15918101906129a3565b60015b610d5c573d808015610d46576040519150601f19603f3d011682016040523d82523d6000602084013e610d4b565b606091505b5061061f60a08701608088016126bc565b8015610eaa576000610d81610d7760a0890160808a016126bc565b886020013561155d565b90506000610d9560a0890160808a016126bc565b90506001600160a01b03811663731133e9610db660808b0160608c016126bc565b848b604001358b8b6040518663ffffffff1660e01b8152600401610dde959493929190612ad5565b600060405180830381600087803b158015610df857600080fd5b505af1158015610e0c573d6000803e3d6000fd5b50849250505060208901357f3a1501949f4fcb896124b2ef3aec2ad731cb25b915e06bcd8173828af40457648a35610e4a60a08d0160808e016126bc565b8c604001358d6060016020810190610e6291906126bc565b604080519485526001600160a01b03938416602086015284019190915216606082015260800160405180910390a3610ea361085160a08a0160808b016126bc565b5050610eba565b61061f60a08701608088016126bc565b505050505050565b610eca6118c3565b610ed46000611b26565b565b600080516020612ed4833981519152610eee81611460565b610ef661146a565b85610f0f81600080516020612e948339815191526105ac565b15610f3857604051630e277acb60e31b81526001600160a01b03821660048201526024016105e0565b6001600160a01b0389163b610f6b57604051637b1dc55d60e01b81526001600160a01b038a1660048201526024016105e0565b6040516301ffc9a760e01b815263152a902d60e11b60048201526001600160a01b038a16906301ffc9a790602401602060405180830381865afa925050508015610fd2575060408051601f3d908101601f19168201909252610fcf918101906129a3565b60015b61102a573d808015611000576040519150601f19603f3d011682016040523d82523d6000602084013e611005565b606091505b50604051637b1dc55d60e01b81526001600160a01b038b1660048201526024016105e0565b80156110fd57604051638d75533f60e01b81528a906001600160a01b03821690638d75533f90611066908c908c908c908c908c90600401612b0e565b600060405180830381600087803b15801561108057600080fd5b505af1158015611094573d6000803e3d6000fd5b50505050897fb5d2c2d90ccb07016f2fb3c540f93380d94949fc927245e209eedf76344875158d8d8c6040516110e6939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a26110f78b611640565b50611121565b604051637b1dc55d60e01b81526001600160a01b038b1660048201526024016105e0565b5050505050505050505050565b600061113981611460565b610888611b78565b600082815260c9602052604081206111599083611bb5565b9392505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600061119681611460565b61119e61146a565b507f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052555565b600054610100900460ff16158080156111e35750600054600160ff909116105b806111fd5750303b1580156111fd575060005460ff166001145b6112605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e0565b6000805460ff191660011790558015611283576000805461ff0019166101001790555b61128e848484611bc1565b80156112d4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600081815260c96020526040812061056290611c03565b60006112fc81611460565b6108ae600080516020612ed4833981519152836108b2565b60008281526097602052604090206001015461132f81611460565b6108d7838361193f565b600061134481611460565b61134c61146a565b6001600160a01b0382166113735760405163cfe2ea6360e01b815260040160405180910390fd5b507f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052480546001600160a01b0319166001600160a01b0392909216919091179055565b6113bd6118c3565b6001600160a01b0381166114225760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e0565b61088881611b26565b60006001600160e01b03198216637965db0b60e01b148061056257506301ffc9a760e01b6001600160e01b0319831614610562565b6108888133611c0d565b60fb5460ff1615610ed45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105e0565b6000816001600160a01b0381166114da57604051635f8773f560e01b815260040160405180910390fd5b604051630723eb0360e51b81526001600160a01b03858116600483015282169063e47d606090602401602060405180830381865afa158015611520573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154491906129a3565b15611553576001915050610562565b5060009392505050565b6001600160a01b03821660009081527f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052660209081526040808320848452909152812054600080516020612e94833981519152908203611613576001600160a01b038416600090815260048201602052604081208054916115dc83612b68565b90915550506001600160a01b0384166000908152600482016020908152604080832054600385018352818420878552909252909120555b6001600160a01b039390931660009081526003909301602090815260408085209385529290525090205490565b7f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052554600080516020612e9483398151915290600090612710906116839034612b81565b61168d9190612ba0565b60018301549091506116a8906001600160a01b031682611c66565b6040516301ffc9a760e01b81526316cf0c0560e01b60048201526001600160a01b038416906301ffc9a790602401602060405180830381865afa92505050801561170f575060408051601f3d908101601f1916820190925261170c918101906129a3565b60015b156108d7578015611826576000846001600160a01b031663d78d610b6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561175a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117829190810190612bc2565b905060005b815181101561181f5761180d6127108383815181106117a8576117a8612c9f565b60200260200101516020015161ffff1686346117c49190612cb5565b6117ce9190612b81565b6117d89190612ba0565b8383815181106117ea576117ea612c9f565b6020026020010151600001516001600160a01b0316611c6690919063ffffffff16565b8061181781612b68565b915050611787565b50506112d4565b60405163152a902d60e11b8152600060048201819052670de0b6b3a764000060248301529081906001600160a01b03871690632a55205a906044016040805180830381865afa15801561187d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a19190612ccc565b9092509050610eba6118b38534612cb5565b6001600160a01b03841690611c66565b6033546001600160a01b03163314610ed45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e0565b6119278282611d7f565b600082815260c9602052604090206108d79082611e05565b6119498282611e1a565b600082815260c9602052604090206108d79082611e81565b6108886118c3565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561199c576108d783611e96565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119f6575060408051601f3d908101601f191682019092526119f391810190612cfa565b60015b611a595760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016105e0565b600080516020612eb48339815191528114611ac85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016105e0565b506108d7838383611f32565b611adc611f57565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611b8061146a565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b093390565b60006111598383611fa0565b600054610100900460ff16611be85760405162461bcd60e51b81526004016105e090612d13565b611bf0611fca565b611bf8611ff9565b6108d7838383612020565b6000610562825490565b611c178282611160565b6108ae57611c24816120fe565b611c2f836020612110565b604051602001611c40929190612d8a565b60408051601f198184030181529082905262461bcd60e51b82526105e091600401612dff565b80471015611cb65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016105e0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611d03576040519150601f19603f3d011682016040523d82523d6000602084013e611d08565b606091505b50509050806108d75760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016105e0565b611d898282611160565b6108ae5760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611dc13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611159836001600160a01b0384166122ac565b611e248282611160565b156108ae5760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611159836001600160a01b0384166122fb565b6001600160a01b0381163b611f035760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016105e0565b600080516020612eb483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611f3b836123ee565b600082511180611f485750805b156108d7576112d4838361242e565b60fb5460ff16610ed45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105e0565b6000826000018281548110611fb757611fb7612c9f565b9060005260206000200154905092915050565b600054610100900460ff16611ff15760405162461bcd60e51b81526004016105e090612d13565b610ed4612522565b600054610100900460ff16610ed45760405162461bcd60e51b81526004016105e090612d13565b600054610100900460ff166120475760405162461bcd60e51b81526004016105e090612d13565b612052600033612552565b61206a600080516020612ed483398151915233612552565b612075600084612552565b61208d600080516020612ed483398151915284612552565b61209682610a45565b7f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052480546001600160a01b0319166001600160a01b039290921691909117905550506101f47f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052555565b60606105626001600160a01b03831660145b6060600061211f836002612b81565b61212a906002612e32565b67ffffffffffffffff81111561214257612142612722565b6040519080825280601f01601f19166020018201604052801561216c576020820181803683370190505b509050600360fc1b8160008151811061218757612187612c9f565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106121b6576121b6612c9f565b60200101906001600160f81b031916908160001a90535060006121da846002612b81565b6121e5906001612e32565b90505b600181111561225d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061221957612219612c9f565b1a60f81b82828151811061222f5761222f612c9f565b60200101906001600160f81b031916908160001a90535060049490941c9361225681612e4a565b90506121e8565b5083156111595760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e0565b60008181526001830160205260408120546122f357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610562565b506000610562565b600081815260018301602052604081205480156123e457600061231f600183612cb5565b855490915060009061233390600190612cb5565b905081811461239857600086600001828154811061235357612353612c9f565b906000526020600020015490508087600001848154811061237657612376612c9f565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806123a9576123a9612e61565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610562565b6000915050610562565b6123f781611e96565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6124965760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016105e0565b600080846001600160a01b0316846040516124b19190612e77565b600060405180830381855af49150503d80600081146124ec576040519150601f19603f3d011682016040523d82523d6000602084013e6124f1565b606091505b50915091506125198282604051806060016040528060278152602001612ef46027913961255c565b95945050505050565b600054610100900460ff166125495760405162461bcd60e51b81526004016105e090612d13565b610ed433611b26565b6108ae828261191d565b6060831561256b575081611159565b61115983838151156125805781518083602001fd5b8060405162461bcd60e51b81526004016105e09190612dff565b6000602082840312156125ac57600080fd5b81356001600160e01b03198116811461115957600080fd5b600060a082840312156125d657600080fd5b50919050565b60008083601f8401126125ee57600080fd5b50813567ffffffffffffffff81111561260657600080fd5b60208301915083602082850101111561261e57600080fd5b9250929050565b600080600080600060e0868803121561263d57600080fd5b61264787876125c4565b945060a086013567ffffffffffffffff8082111561266457600080fd5b61267089838a016125dc565b909650945060c088013591508082111561268957600080fd5b50612696888289016125dc565b969995985093965092949392505050565b6001600160a01b038116811461088857600080fd5b6000602082840312156126ce57600080fd5b8135611159816126a7565b6000602082840312156126eb57600080fd5b5035919050565b6000806040838503121561270557600080fd5b823591506020830135612717816126a7565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561275b5761275b612722565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561278a5761278a612722565b604052919050565b600080604083850312156127a557600080fd5b82356127b0816126a7565b915060208381013567ffffffffffffffff808211156127ce57600080fd5b818601915086601f8301126127e257600080fd5b8135818111156127f4576127f4612722565b612806601f8201601f19168501612761565b9150808252878482850101111561281c57600080fd5b80848401858401376000848284010152508093505050509250929050565b600080600060c0848603121561284f57600080fd5b61285985856125c4565b925060a084013567ffffffffffffffff81111561287557600080fd5b612881868287016125dc565b9497909650939450505050565b60008060008060008060008060c0898b0312156128aa57600080fd5b8835975060208901356128bc816126a7565b96506040890135955060608901356128d3816126a7565b9450608089013567ffffffffffffffff808211156128f057600080fd5b6128fc8c838d016125dc565b909650945060a08b013591508082111561291557600080fd5b506129228b828c016125dc565b999c989b5096995094979396929594505050565b6000806040838503121561294957600080fd5b50508035926020909101359150565b60008060006060848603121561296d57600080fd5b8335612978816126a7565b92506020840135612988816126a7565b91506040840135612998816126a7565b809150509250925092565b6000602082840312156129b557600080fd5b8151801515811461115957600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038816815286602082015260a060408201526000612a1660a0830187896129c5565b8560608401528281036080840152612a2f8185876129c5565b9a9950505050505050505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60018060a01b0386168152846020820152836040820152608060608201526000612b036080830184866129c5565b979650505050505050565b6001600160a01b0386168152606060208201819052600090612b3390830186886129c5565b8281036040840152612b468185876129c5565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201612b7a57612b7a612b52565b5060010190565b6000816000190483118215151615612b9b57612b9b612b52565b500290565b600082612bbd57634e487b7160e01b600052601260045260246000fd5b500490565b60006020808385031215612bd557600080fd5b825167ffffffffffffffff80821115612bed57600080fd5b818501915085601f830112612c0157600080fd5b815181811115612c1357612c13612722565b612c21848260051b01612761565b818152848101925060069190911b830184019087821115612c4157600080fd5b928401925b81841015612b035760408489031215612c5f5760008081fd5b612c67612738565b8451612c72816126a7565b81528486015161ffff81168114612c895760008081fd5b8187015283526040939093019291840191612c46565b634e487b7160e01b600052603260045260246000fd5b600082821015612cc757612cc7612b52565b500390565b60008060408385031215612cdf57600080fd5b8251612cea816126a7565b6020939093015192949293505050565b600060208284031215612d0c57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015612d79578181015183820152602001612d61565b838111156112d45750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612dc2816017850160208801612d5e565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612df3816028840160208801612d5e565b01602801949350505050565b6020815260008251806020840152612e1e816040850160208701612d5e565b601f01601f19169190910160400192915050565b60008219821115612e4557612e45612b52565b500190565b600081612e5957612e59612b52565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60008251612e89818460208701612d5e565b919091019291505056fe2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c0523360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220fb448854daa5670d9722ffa7eda536e463ba3de573b87fa43d787c22d2cb35e064736f6c634300080d0033
Deployed Bytecode
0x6080604052600436106101c25760003560e01c8063715018a6116100f7578063ba3d10c811610095578063d547741f11610064578063d547741f146104bb578063ec87621c146104db578063f0f44260146104fd578063f2fde38b1461051d57600080fd5b8063ba3d10c81461043b578063c0c53b8b1461045b578063ca15c8731461047b578063d0ebdbe71461049b57600080fd5b80638da5cb5b116100d15780638da5cb5b146103b45780639010d07c146103e657806391d1485414610406578063a217fddf1461042657600080fd5b8063715018a6146103775780637796dca01461038c5780638456cb591461039f57600080fd5b80633659cfe6116101645780634f1ef2861161013e5780634f1ef2861461032457806352d1902d1461033757806352d7c2921461034c5780635c975abb1461035f57600080fd5b80633659cfe6146102cf5780633f4ba83a146102ef5780634e054a671461030457600080fd5b8063248a9ca3116101a0578063248a9ca31461023157806329b0de1e1461026f5780632f2ff15d1461028f57806336568abe146102af57600080fd5b806301ffc9a7146101c75780630765df5f146101fc57806313af403514610211575b600080fd5b3480156101d357600080fd5b506101e76101e236600461259a565b61053d565b60405190151581526020015b60405180910390f35b61020f61020a366004612625565b610568565b005b34801561021d57600080fd5b5061020f61022c3660046126bc565b610877565b34801561023d57600080fd5b5061026161024c3660046126d9565b60009081526097602052604090206001015490565b6040519081526020016101f3565b34801561027b57600080fd5b5061020f61028a3660046126bc565b61088b565b34801561029b57600080fd5b5061020f6102aa3660046126f2565b6108b2565b3480156102bb57600080fd5b5061020f6102ca3660046126f2565b6108dc565b3480156102db57600080fd5b5061020f6102ea3660046126bc565b610956565b3480156102fb57600080fd5b5061020f610a32565b34801561031057600080fd5b5061020f61031f3660046126bc565b610a45565b61020f610332366004612792565b610a88565b34801561034357600080fd5b50610261610b54565b61020f61035a36600461283a565b610c07565b34801561036b57600080fd5b5060fb5460ff166101e7565b34801561038357600080fd5b5061020f610ec2565b61020f61039a36600461288e565b610ed6565b3480156103ab57600080fd5b5061020f61112e565b3480156103c057600080fd5b506033546001600160a01b03165b6040516001600160a01b0390911681526020016101f3565b3480156103f257600080fd5b506103ce610401366004612936565b611141565b34801561041257600080fd5b506101e76104213660046126f2565b611160565b34801561043257600080fd5b50610261600081565b34801561044757600080fd5b5061020f6104563660046126d9565b61118b565b34801561046757600080fd5b5061020f610476366004612958565b6111c3565b34801561048757600080fd5b506102616104963660046126d9565b6112da565b3480156104a757600080fd5b5061020f6104b63660046126bc565b6112f1565b3480156104c757600080fd5b5061020f6104d63660046126f2565b611314565b3480156104e757600080fd5b50610261600080516020612ed483398151915281565b34801561050957600080fd5b5061020f6105183660046126bc565b611339565b34801561052957600080fd5b5061020f6105383660046126bc565b6113b5565b60006001600160e01b03198216635a05180f60e01b148061056257506105628261142b565b92915050565b600080516020612ed483398151915261058081611460565b61058861146a565b61059860808701606088016126bc565b6105bb81600080516020612e948339815191525b546001600160a01b03166114b0565b156105e957604051630e277acb60e31b81526001600160a01b03821660048201526024015b60405180910390fd5b61060b6105fc60a0890160808a016126bc565b6001600160a01b03163b151590565b6106445761061f60a08801608089016126bc565b604051637b1dc55d60e01b81526001600160a01b0390911660048201526024016105e0565b61065460a08801608089016126bc565b6040516301ffc9a760e01b815263152a902d60e11b60048201526001600160a01b0391909116906301ffc9a790602401602060405180830381865afa9250505080156106bd575060408051601f3d908101601f191682019092526106ba918101906129a3565b60015b610701573d8080156106eb576040519150601f19603f3d011682016040523d82523d6000602084013e6106f0565b606091505b5061061f60a0890160808a016126bc565b801561085d57600061072661071c60a08b0160808c016126bc565b8a6020013561155d565b9050600061073a60a08b0160808c016126bc565b90506001600160a01b03811663cf237fc061075b60808d0160608e016126bc565b848c8c8f604001358d8d6040518863ffffffff1660e01b815260040161078797969594939291906129ee565b600060405180830381600087803b1580156107a157600080fd5b505af11580156107b5573d6000803e3d6000fd5b50505050818a602001357f3a1501949f4fcb896124b2ef3aec2ad731cb25b915e06bcd8173828af40457648c600001358d60800160208101906107f891906126bc565b8e604001358f606001602081019061081091906126bc565b604080519485526001600160a01b03938416602086015284019190915216606082015260800160405180910390a361085661085160a08c0160808d016126bc565b611640565b505061086d565b61061f60a0890160808a016126bc565b5050505050505050565b61087f6118c3565b610888816113b5565b50565b600061089681611460565b6108ae600080516020612ed483398151915283611314565b5050565b6000828152609760205260409020600101546108cd81611460565b6108d7838361191d565b505050565b6001600160a01b038116331461094c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e0565b6108ae828261193f565b6001600160a01b037f00000000000000000000000067739e102112d6309e47e831fd7369a78c5e72d916300361099e5760405162461bcd60e51b81526004016105e090612a3d565b7f00000000000000000000000067739e102112d6309e47e831fd7369a78c5e72d96001600160a01b03166109e7600080516020612eb4833981519152546001600160a01b031690565b6001600160a01b031614610a0d5760405162461bcd60e51b81526004016105e090612a89565b610a1681611961565b6040805160008082526020820190925261088891839190611969565b6000610a3d81611460565b610888611ad4565b6000610a5081611460565b610a5861146a565b50600080516020612e9483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b037f00000000000000000000000067739e102112d6309e47e831fd7369a78c5e72d9163003610ad05760405162461bcd60e51b81526004016105e090612a3d565b7f00000000000000000000000067739e102112d6309e47e831fd7369a78c5e72d96001600160a01b0316610b19600080516020612eb4833981519152546001600160a01b031690565b6001600160a01b031614610b3f5760405162461bcd60e51b81526004016105e090612a89565b610b4882611961565b6108ae82826001611969565b6000306001600160a01b037f00000000000000000000000067739e102112d6309e47e831fd7369a78c5e72d91614610bf45760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016105e0565b50600080516020612eb483398151915290565b600080516020612ed4833981519152610c1f81611460565b610c2761146a565b610c3760808501606086016126bc565b610c4f81600080516020612e948339815191526105ac565b15610c7857604051630e277acb60e31b81526001600160a01b03821660048201526024016105e0565b610c8b6105fc60a08701608088016126bc565b610c9f5761061f60a08601608087016126bc565b610caf60a08601608087016126bc565b6040516301ffc9a760e01b815263152a902d60e11b60048201526001600160a01b0391909116906301ffc9a790602401602060405180830381865afa925050508015610d18575060408051601f3d908101601f19168201909252610d15918101906129a3565b60015b610d5c573d808015610d46576040519150601f19603f3d011682016040523d82523d6000602084013e610d4b565b606091505b5061061f60a08701608088016126bc565b8015610eaa576000610d81610d7760a0890160808a016126bc565b886020013561155d565b90506000610d9560a0890160808a016126bc565b90506001600160a01b03811663731133e9610db660808b0160608c016126bc565b848b604001358b8b6040518663ffffffff1660e01b8152600401610dde959493929190612ad5565b600060405180830381600087803b158015610df857600080fd5b505af1158015610e0c573d6000803e3d6000fd5b50849250505060208901357f3a1501949f4fcb896124b2ef3aec2ad731cb25b915e06bcd8173828af40457648a35610e4a60a08d0160808e016126bc565b8c604001358d6060016020810190610e6291906126bc565b604080519485526001600160a01b03938416602086015284019190915216606082015260800160405180910390a3610ea361085160a08a0160808b016126bc565b5050610eba565b61061f60a08701608088016126bc565b505050505050565b610eca6118c3565b610ed46000611b26565b565b600080516020612ed4833981519152610eee81611460565b610ef661146a565b85610f0f81600080516020612e948339815191526105ac565b15610f3857604051630e277acb60e31b81526001600160a01b03821660048201526024016105e0565b6001600160a01b0389163b610f6b57604051637b1dc55d60e01b81526001600160a01b038a1660048201526024016105e0565b6040516301ffc9a760e01b815263152a902d60e11b60048201526001600160a01b038a16906301ffc9a790602401602060405180830381865afa925050508015610fd2575060408051601f3d908101601f19168201909252610fcf918101906129a3565b60015b61102a573d808015611000576040519150601f19603f3d011682016040523d82523d6000602084013e611005565b606091505b50604051637b1dc55d60e01b81526001600160a01b038b1660048201526024016105e0565b80156110fd57604051638d75533f60e01b81528a906001600160a01b03821690638d75533f90611066908c908c908c908c908c90600401612b0e565b600060405180830381600087803b15801561108057600080fd5b505af1158015611094573d6000803e3d6000fd5b50505050897fb5d2c2d90ccb07016f2fb3c540f93380d94949fc927245e209eedf76344875158d8d8c6040516110e6939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a26110f78b611640565b50611121565b604051637b1dc55d60e01b81526001600160a01b038b1660048201526024016105e0565b5050505050505050505050565b600061113981611460565b610888611b78565b600082815260c9602052604081206111599083611bb5565b9392505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600061119681611460565b61119e61146a565b507f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052555565b600054610100900460ff16158080156111e35750600054600160ff909116105b806111fd5750303b1580156111fd575060005460ff166001145b6112605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e0565b6000805460ff191660011790558015611283576000805461ff0019166101001790555b61128e848484611bc1565b80156112d4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600081815260c96020526040812061056290611c03565b60006112fc81611460565b6108ae600080516020612ed4833981519152836108b2565b60008281526097602052604090206001015461132f81611460565b6108d7838361193f565b600061134481611460565b61134c61146a565b6001600160a01b0382166113735760405163cfe2ea6360e01b815260040160405180910390fd5b507f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052480546001600160a01b0319166001600160a01b0392909216919091179055565b6113bd6118c3565b6001600160a01b0381166114225760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e0565b61088881611b26565b60006001600160e01b03198216637965db0b60e01b148061056257506301ffc9a760e01b6001600160e01b0319831614610562565b6108888133611c0d565b60fb5460ff1615610ed45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105e0565b6000816001600160a01b0381166114da57604051635f8773f560e01b815260040160405180910390fd5b604051630723eb0360e51b81526001600160a01b03858116600483015282169063e47d606090602401602060405180830381865afa158015611520573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154491906129a3565b15611553576001915050610562565b5060009392505050565b6001600160a01b03821660009081527f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052660209081526040808320848452909152812054600080516020612e94833981519152908203611613576001600160a01b038416600090815260048201602052604081208054916115dc83612b68565b90915550506001600160a01b0384166000908152600482016020908152604080832054600385018352818420878552909252909120555b6001600160a01b039390931660009081526003909301602090815260408085209385529290525090205490565b7f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052554600080516020612e9483398151915290600090612710906116839034612b81565b61168d9190612ba0565b60018301549091506116a8906001600160a01b031682611c66565b6040516301ffc9a760e01b81526316cf0c0560e01b60048201526001600160a01b038416906301ffc9a790602401602060405180830381865afa92505050801561170f575060408051601f3d908101601f1916820190925261170c918101906129a3565b60015b156108d7578015611826576000846001600160a01b031663d78d610b6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561175a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117829190810190612bc2565b905060005b815181101561181f5761180d6127108383815181106117a8576117a8612c9f565b60200260200101516020015161ffff1686346117c49190612cb5565b6117ce9190612b81565b6117d89190612ba0565b8383815181106117ea576117ea612c9f565b6020026020010151600001516001600160a01b0316611c6690919063ffffffff16565b8061181781612b68565b915050611787565b50506112d4565b60405163152a902d60e11b8152600060048201819052670de0b6b3a764000060248301529081906001600160a01b03871690632a55205a906044016040805180830381865afa15801561187d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a19190612ccc565b9092509050610eba6118b38534612cb5565b6001600160a01b03841690611c66565b6033546001600160a01b03163314610ed45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e0565b6119278282611d7f565b600082815260c9602052604090206108d79082611e05565b6119498282611e1a565b600082815260c9602052604090206108d79082611e81565b6108886118c3565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561199c576108d783611e96565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119f6575060408051601f3d908101601f191682019092526119f391810190612cfa565b60015b611a595760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016105e0565b600080516020612eb48339815191528114611ac85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016105e0565b506108d7838383611f32565b611adc611f57565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611b8061146a565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b093390565b60006111598383611fa0565b600054610100900460ff16611be85760405162461bcd60e51b81526004016105e090612d13565b611bf0611fca565b611bf8611ff9565b6108d7838383612020565b6000610562825490565b611c178282611160565b6108ae57611c24816120fe565b611c2f836020612110565b604051602001611c40929190612d8a565b60408051601f198184030181529082905262461bcd60e51b82526105e091600401612dff565b80471015611cb65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016105e0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611d03576040519150601f19603f3d011682016040523d82523d6000602084013e611d08565b606091505b50509050806108d75760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016105e0565b611d898282611160565b6108ae5760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611dc13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611159836001600160a01b0384166122ac565b611e248282611160565b156108ae5760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611159836001600160a01b0384166122fb565b6001600160a01b0381163b611f035760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016105e0565b600080516020612eb483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611f3b836123ee565b600082511180611f485750805b156108d7576112d4838361242e565b60fb5460ff16610ed45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105e0565b6000826000018281548110611fb757611fb7612c9f565b9060005260206000200154905092915050565b600054610100900460ff16611ff15760405162461bcd60e51b81526004016105e090612d13565b610ed4612522565b600054610100900460ff16610ed45760405162461bcd60e51b81526004016105e090612d13565b600054610100900460ff166120475760405162461bcd60e51b81526004016105e090612d13565b612052600033612552565b61206a600080516020612ed483398151915233612552565b612075600084612552565b61208d600080516020612ed483398151915284612552565b61209682610a45565b7f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052480546001600160a01b0319166001600160a01b039290921691909117905550506101f47f2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c052555565b60606105626001600160a01b03831660145b6060600061211f836002612b81565b61212a906002612e32565b67ffffffffffffffff81111561214257612142612722565b6040519080825280601f01601f19166020018201604052801561216c576020820181803683370190505b509050600360fc1b8160008151811061218757612187612c9f565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106121b6576121b6612c9f565b60200101906001600160f81b031916908160001a90535060006121da846002612b81565b6121e5906001612e32565b90505b600181111561225d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061221957612219612c9f565b1a60f81b82828151811061222f5761222f612c9f565b60200101906001600160f81b031916908160001a90535060049490941c9361225681612e4a565b90506121e8565b5083156111595760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e0565b60008181526001830160205260408120546122f357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610562565b506000610562565b600081815260018301602052604081205480156123e457600061231f600183612cb5565b855490915060009061233390600190612cb5565b905081811461239857600086600001828154811061235357612353612c9f565b906000526020600020015490508087600001848154811061237657612376612c9f565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806123a9576123a9612e61565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610562565b6000915050610562565b6123f781611e96565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6124965760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016105e0565b600080846001600160a01b0316846040516124b19190612e77565b600060405180830381855af49150503d80600081146124ec576040519150601f19603f3d011682016040523d82523d6000602084013e6124f1565b606091505b50915091506125198282604051806060016040528060278152602001612ef46027913961255c565b95945050505050565b600054610100900460ff166125495760405162461bcd60e51b81526004016105e090612d13565b610ed433611b26565b6108ae828261191d565b6060831561256b575081611159565b61115983838151156125805781518083602001fd5b8060405162461bcd60e51b81526004016105e09190612dff565b6000602082840312156125ac57600080fd5b81356001600160e01b03198116811461115957600080fd5b600060a082840312156125d657600080fd5b50919050565b60008083601f8401126125ee57600080fd5b50813567ffffffffffffffff81111561260657600080fd5b60208301915083602082850101111561261e57600080fd5b9250929050565b600080600080600060e0868803121561263d57600080fd5b61264787876125c4565b945060a086013567ffffffffffffffff8082111561266457600080fd5b61267089838a016125dc565b909650945060c088013591508082111561268957600080fd5b50612696888289016125dc565b969995985093965092949392505050565b6001600160a01b038116811461088857600080fd5b6000602082840312156126ce57600080fd5b8135611159816126a7565b6000602082840312156126eb57600080fd5b5035919050565b6000806040838503121561270557600080fd5b823591506020830135612717816126a7565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561275b5761275b612722565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561278a5761278a612722565b604052919050565b600080604083850312156127a557600080fd5b82356127b0816126a7565b915060208381013567ffffffffffffffff808211156127ce57600080fd5b818601915086601f8301126127e257600080fd5b8135818111156127f4576127f4612722565b612806601f8201601f19168501612761565b9150808252878482850101111561281c57600080fd5b80848401858401376000848284010152508093505050509250929050565b600080600060c0848603121561284f57600080fd5b61285985856125c4565b925060a084013567ffffffffffffffff81111561287557600080fd5b612881868287016125dc565b9497909650939450505050565b60008060008060008060008060c0898b0312156128aa57600080fd5b8835975060208901356128bc816126a7565b96506040890135955060608901356128d3816126a7565b9450608089013567ffffffffffffffff808211156128f057600080fd5b6128fc8c838d016125dc565b909650945060a08b013591508082111561291557600080fd5b506129228b828c016125dc565b999c989b5096995094979396929594505050565b6000806040838503121561294957600080fd5b50508035926020909101359150565b60008060006060848603121561296d57600080fd5b8335612978816126a7565b92506020840135612988816126a7565b91506040840135612998816126a7565b809150509250925092565b6000602082840312156129b557600080fd5b8151801515811461115957600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038816815286602082015260a060408201526000612a1660a0830187896129c5565b8560608401528281036080840152612a2f8185876129c5565b9a9950505050505050505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60018060a01b0386168152846020820152836040820152608060608201526000612b036080830184866129c5565b979650505050505050565b6001600160a01b0386168152606060208201819052600090612b3390830186886129c5565b8281036040840152612b468185876129c5565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201612b7a57612b7a612b52565b5060010190565b6000816000190483118215151615612b9b57612b9b612b52565b500290565b600082612bbd57634e487b7160e01b600052601260045260246000fd5b500490565b60006020808385031215612bd557600080fd5b825167ffffffffffffffff80821115612bed57600080fd5b818501915085601f830112612c0157600080fd5b815181811115612c1357612c13612722565b612c21848260051b01612761565b818152848101925060069190911b830184019087821115612c4157600080fd5b928401925b81841015612b035760408489031215612c5f5760008081fd5b612c67612738565b8451612c72816126a7565b81528486015161ffff81168114612c895760008081fd5b8187015283526040939093019291840191612c46565b634e487b7160e01b600052603260045260246000fd5b600082821015612cc757612cc7612b52565b500390565b60008060408385031215612cdf57600080fd5b8251612cea816126a7565b6020939093015192949293505050565b600060208284031215612d0c57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015612d79578181015183820152602001612d61565b838111156112d45750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612dc2816017850160208801612d5e565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612df3816028840160208801612d5e565b01602801949350505050565b6020815260008251806020840152612e1e816040850160208701612d5e565b601f01601f19169190910160400192915050565b60008219821115612e4557612e45612b52565b500190565b600081612e5957612e59612b52565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60008251612e89818460208701612d5e565b919091019291505056fe2df2b11fc13363496abe810bf3d4628da7ab0342f58cfa8e6444feb46b5c0523360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220fb448854daa5670d9722ffa7eda536e463ba3de573b87fa43d787c22d2cb35e064736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.