Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60a06040 | 16794170 | 536 days ago | IN | 0 ETH | 0.08625166 |
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 Name:
MarketplaceV3
Compiler Version
v0.8.12+commit.f00d7308
Optimization Enabled:
Yes with 300 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb // $$\ $$\ $$\ $$\ $$\ // $$ | $$ | \__| $$ | $$ | // $$$$$$\ $$$$$$$\ $$\ $$$$$$\ $$$$$$$ |$$\ $$\ $$\ $$$$$$\ $$$$$$$\ // \_$$ _| $$ __$$\ $$ |$$ __$$\ $$ __$$ |$$ | $$ | $$ |$$ __$$\ $$ __$$\ // $$ | $$ | $$ |$$ |$$ | \__|$$ / $$ |$$ | $$ | $$ |$$$$$$$$ |$$ | $$ | // $$ |$$\ $$ | $$ |$$ |$$ | $$ | $$ |$$ | $$ | $$ |$$ ____|$$ | $$ | // \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ | // \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/ // ====== External imports ====== import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; // ========== Internal imports ========== import "./InitStorage.sol"; import { RouterImmutable, Router } from "../../extension/plugin/RouterImmutable.sol"; import "../../extension/plugin/ContractMetadataLogic.sol"; import "../../extension/plugin/PlatformFeeLogic.sol"; import "../../extension/plugin/PermissionsEnumerableLogic.sol"; import "../../extension/plugin/ReentrancyGuardLogic.sol"; import "../../extension/plugin/ERC2771ContextUpgradeableLogic.sol"; /** * @author thirdweb.com */ contract MarketplaceV3 is ContractMetadataLogic, PlatformFeeLogic, PermissionsEnumerableLogic, ReentrancyGuardLogic, ERC2771ContextUpgradeableLogic, RouterImmutable, IERC721Receiver, IERC1155Receiver { /*/////////////////////////////////////////////////////////////// State variables //////////////////////////////////////////////////////////////*/ bytes32 private constant MODULE_TYPE = bytes32("MarketplaceV3"); uint256 private constant VERSION = 1; /*/////////////////////////////////////////////////////////////// Constructor + initializer logic //////////////////////////////////////////////////////////////*/ constructor(address _pluginMap) RouterImmutable(_pluginMap) {} /// @dev Initiliazes the contract, like a constructor. function initialize( address _defaultAdmin, string memory _contractURI, address[] memory _trustedForwarders, address _platformFeeRecipient, uint16 _platformFeeBps ) external { InitStorage.Data storage data = InitStorage.initStorage(); require(!data.initialized, "Already initialized."); data.initialized = true; // Initialize inherited contracts, most base-like -> most derived. __ReentrancyGuard_init(); __ERC2771Context_init(_trustedForwarders); // Initialize this contract's state. _setupContractURI(_contractURI); _setupPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(keccak256("LISTER_ROLE"), address(0)); _setupRole(keccak256("ASSET_ROLE"), address(0)); } /*/////////////////////////////////////////////////////////////// Generic contract logic //////////////////////////////////////////////////////////////*/ /// @dev Returns the type of the contract. function contractType() external pure returns (bytes32) { return MODULE_TYPE; } /// @dev Returns the version of the contract. function contractVersion() external pure returns (uint8) { return uint8(VERSION); } /*/////////////////////////////////////////////////////////////// ERC 165 / 721 / 1155 logic //////////////////////////////////////////////////////////////*/ function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { return this.onERC721Received.selector; } function supportsInterface(bytes4 interfaceId) public view virtual override(Router, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || interfaceId == type(IERC721Receiver).interfaceId || super.supportsInterface(interfaceId); } /*/////////////////////////////////////////////////////////////// Overridable Permissions //////////////////////////////////////////////////////////////*/ /// @dev Checks whether platform fee info can be set in the given execution context. function _canSetPlatformFeeInfo() internal view override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Checks whether contract metadata can be set in the given execution context. function _canSetContractURI() internal view override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); } function _msgSender() internal view override(ERC2771ContextUpgradeableLogic, PermissionsLogic) returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return msg.sender; } } function _msgData() internal view override(ERC2771ContextUpgradeableLogic, PermissionsLogic) returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return msg.data; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; /// @author thirdweb /** * @author thirdweb.com */ library InitStorage { /// @dev The location of the storage of the entrypoint contract's data. bytes32 constant INIT_STORAGE_POSITION = keccak256("init.storage"); /// @dev Layout of the entrypoint contract's storage. struct Data { bool initialized; } /// @dev Returns the entrypoint contract's data at the relevant storage location. function initStorage() internal pure returns (Data storage initData) { bytes32 position = INIT_STORAGE_POSITION; assembly { initData.slot := position } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./Router.sol"; /** * @author thirdweb.com */ contract RouterImmutable is Router { /*/////////////////////////////////////////////////////////////// Constructor + initializer logic //////////////////////////////////////////////////////////////*/ constructor(address _pluginMap) Router(_pluginMap) {} /*/////////////////////////////////////////////////////////////// Internal functions //////////////////////////////////////////////////////////////*/ /// @dev Returns whether plug-in can be set in the given execution context. function _canSetPlugin() internal pure override returns (bool) { return false; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./ContractMetadataStorage.sol"; import "../../extension/interface/IContractMetadata.sol"; /** * @author thirdweb.com * * @title Contract Metadata * @notice Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI * for you contract. * Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea. */ abstract contract ContractMetadataLogic is IContractMetadata { /// @dev Returns the metadata URI of the contract. function contractURI() public view returns (string memory) { ContractMetadataStorage.Data storage data = ContractMetadataStorage.contractMetadataStorage(); return data.contractURI; } /** * @notice Lets a contract admin set the URI for contract-level metadata. * @dev Caller should be authorized to setup contractURI, e.g. contract admin. * See {_canSetContractURI}. * Emits {ContractURIUpdated Event}. * * @param _uri keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") */ function setContractURI(string memory _uri) external override { if (!_canSetContractURI()) { revert("Not authorized"); } _setupContractURI(_uri); } /// @dev Lets a contract admin set the URI for contract-level metadata. function _setupContractURI(string memory _uri) internal { ContractMetadataStorage.Data storage data = ContractMetadataStorage.contractMetadataStorage(); string memory prevURI = data.contractURI; data.contractURI = _uri; emit ContractURIUpdated(prevURI, _uri); } /// @dev Returns whether contract metadata can be set in the given execution context. function _canSetContractURI() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./PlatformFeeStorage.sol"; import "../../extension/interface/IPlatformFee.sol"; /** * @author thirdweb.com * * @title Platform Fee * @notice Thirdweb's `PlatformFee` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of platform fee and the platform fee basis points, and lets the inheriting contract perform conditional logic * that uses information about platform fees, if desired. */ abstract contract PlatformFeeLogic is IPlatformFee { /// @dev Returns the platform fee recipient and bps. function getPlatformFeeInfo() public view override returns (address, uint16) { PlatformFeeStorage.Data storage data = PlatformFeeStorage.platformFeeStorage(); return (data.platformFeeRecipient, uint16(data.platformFeeBps)); } /** * @notice Updates the platform fee recipient and bps. * @dev Caller should be authorized to set platform fee info. * See {_canSetPlatformFeeInfo}. * Emits {PlatformFeeInfoUpdated Event}; See {_setupPlatformFeeInfo}. * * @param _platformFeeRecipient Address to be set as new platformFeeRecipient. * @param _platformFeeBps Updated platformFeeBps. */ function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external override { if (!_canSetPlatformFeeInfo()) { revert("Not authorized"); } _setupPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps); } /// @dev Lets a contract admin update the platform fee recipient and bps function _setupPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) internal { PlatformFeeStorage.Data storage data = PlatformFeeStorage.platformFeeStorage(); if (_platformFeeBps > 10_000) { revert("Exceeds max bps"); } data.platformFeeBps = uint16(_platformFeeBps); data.platformFeeRecipient = _platformFeeRecipient; emit PlatformFeeInfoUpdated(_platformFeeRecipient, _platformFeeBps); } /// @dev Returns whether platform fee info can be set in the given execution context. function _canSetPlatformFeeInfo() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./PermissionsEnumerableStorage.sol"; import "./PermissionsLogic.sol"; /** * @author thirdweb.com * * @title PermissionsEnumerable * @dev This contracts provides extending-contracts with role-based access control mechanisms. * Also provides interfaces to view all members with a given role, and total count of members. */ contract PermissionsEnumerableLogic is IPermissionsEnumerable, PermissionsLogic { /** * @notice Returns the role-member from a list of members for a role, * at a given index. * @dev Returns `member` who has `role`, at `index` of role-members list. * See struct {RoleMembers}, and mapping {roleMembers} * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param index Index in list of current members for the role. * * @return member Address of account that has `role` */ function getRoleMember(bytes32 role, uint256 index) external view override returns (address member) { PermissionsEnumerableStorage.Data storage data = PermissionsEnumerableStorage.permissionsEnumerableStorage(); uint256 currentIndex = data.roleMembers[role].index; uint256 check; for (uint256 i = 0; i < currentIndex; i += 1) { if (data.roleMembers[role].members[i] != address(0)) { if (check == index) { member = data.roleMembers[role].members[i]; return member; } check += 1; } else if (hasRole(role, address(0)) && i == data.roleMembers[role].indexOf[address(0)]) { check += 1; } } } /** * @notice Returns total number of accounts that have a role. * @dev Returns `count` of accounts that have `role`. * See struct {RoleMembers}, and mapping {roleMembers} * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * * @return count Total number of accounts that have `role` */ function getRoleMemberCount(bytes32 role) external view override returns (uint256 count) { PermissionsEnumerableStorage.Data storage data = PermissionsEnumerableStorage.permissionsEnumerableStorage(); uint256 currentIndex = data.roleMembers[role].index; for (uint256 i = 0; i < currentIndex; i += 1) { if (data.roleMembers[role].members[i] != address(0)) { count += 1; } } if (hasRole(role, address(0))) { count += 1; } } /// @dev Revokes `role` from `account`, and removes `account` from {roleMembers} /// See {_removeMember} function _revokeRole(bytes32 role, address account) internal override { super._revokeRole(role, account); _removeMember(role, account); } /// @dev Grants `role` to `account`, and adds `account` to {roleMembers} /// See {_addMember} function _setupRole(bytes32 role, address account) internal override { super._setupRole(role, account); _addMember(role, account); } /// @dev adds `account` to {roleMembers}, for `role` function _addMember(bytes32 role, address account) internal { PermissionsEnumerableStorage.Data storage data = PermissionsEnumerableStorage.permissionsEnumerableStorage(); uint256 idx = data.roleMembers[role].index; data.roleMembers[role].index += 1; data.roleMembers[role].members[idx] = account; data.roleMembers[role].indexOf[account] = idx; } /// @dev removes `account` from {roleMembers}, for `role` function _removeMember(bytes32 role, address account) internal { PermissionsEnumerableStorage.Data storage data = PermissionsEnumerableStorage.permissionsEnumerableStorage(); uint256 idx = data.roleMembers[role].indexOf[account]; delete data.roleMembers[role].members[idx]; delete data.roleMembers[role].indexOf[account]; } }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./ReentrancyGuardStorage.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardLogic { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; function __ReentrancyGuard_init() internal { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal { ReentrancyGuardStorage.Data storage data = ReentrancyGuardStorage.reentrancyGuardStorage(); data._status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { ReentrancyGuardStorage.Data storage data = ReentrancyGuardStorage.reentrancyGuardStorage(); // On the first call to nonReentrant, _notEntered will be true require(data._status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail data._status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) data._status = _NOT_ENTERED; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./ERC2771ContextStorage.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771ContextUpgradeableLogic { function __ERC2771Context_init(address[] memory trustedForwarder) internal { __ERC2771Context_init_unchained(trustedForwarder); } function __ERC2771Context_init_unchained(address[] memory trustedForwarder) internal { ERC2771ContextStorage.Data storage data = ERC2771ContextStorage.erc2771ContextStorage(); for (uint256 i = 0; i < trustedForwarder.length; i++) { data._trustedForwarder[trustedForwarder[i]] = true; } } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { ERC2771ContextStorage.Data storage data = ERC2771ContextStorage.erc2771ContextStorage(); return data._trustedForwarder[forwarder]; } function _msgSender() internal view virtual returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return msg.sender; } } function _msgData() internal view virtual returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return msg.data; } } }
// 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: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "../interface/plugin/IRouter.sol"; import "../../extension/Multicall.sol"; import "../../eip/ERC165.sol"; import "../../openzeppelin-presets/utils/EnumerableSet.sol"; /** * @author thirdweb.com */ library RouterStorage { bytes32 public constant ROUTER_STORAGE_POSITION = keccak256("router.storage"); struct Data { EnumerableSet.Bytes32Set allSelectors; mapping(address => EnumerableSet.Bytes32Set) selectorsForPlugin; mapping(bytes4 => IPluginMap.Plugin) pluginForSelector; } function routerStorage() internal pure returns (Data storage routerData) { bytes32 position = ROUTER_STORAGE_POSITION; assembly { routerData.slot := position } } } abstract contract Router is Multicall, ERC165, IRouter { using EnumerableSet for EnumerableSet.Bytes32Set; /*/////////////////////////////////////////////////////////////// State variables //////////////////////////////////////////////////////////////*/ address public immutable pluginMap; /*/////////////////////////////////////////////////////////////// Constructor + initializer logic //////////////////////////////////////////////////////////////*/ constructor(address _pluginMap) { pluginMap = _pluginMap; } /*/////////////////////////////////////////////////////////////// ERC 165 //////////////////////////////////////////////////////////////*/ /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IRouter).interfaceId || super.supportsInterface(interfaceId); } /*/////////////////////////////////////////////////////////////// Generic contract logic //////////////////////////////////////////////////////////////*/ fallback() external payable virtual { address _pluginAddress = _getPluginForFunction(msg.sig); if (_pluginAddress == address(0)) { _pluginAddress = IPluginMap(pluginMap).getPluginForFunction(msg.sig); } _delegate(_pluginAddress); } receive() external payable {} function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /*/////////////////////////////////////////////////////////////// External functions //////////////////////////////////////////////////////////////*/ /// @dev Add functionality to the contract. function addPlugin(Plugin memory _plugin) external { require(_canSetPlugin(), "Router: Not authorized"); _addPlugin(_plugin); } /// @dev Update or override existing functionality. function updatePlugin(Plugin memory _plugin) external { require(_canSetPlugin(), "Map: Not authorized"); _updatePlugin(_plugin); } /// @dev Remove existing functionality from the contract. function removePlugin(bytes4 _selector) external { require(_canSetPlugin(), "Map: Not authorized"); _removePlugin(_selector); } /*/////////////////////////////////////////////////////////////// View functions //////////////////////////////////////////////////////////////*/ /// @dev View address of the plugged-in functionality contract for a given function signature. function getPluginForFunction(bytes4 _selector) public view returns (address) { address pluginAddress = _getPluginForFunction(_selector); return pluginAddress != address(0) ? pluginAddress : IPluginMap(pluginMap).getPluginForFunction(_selector); } /// @dev View all funtionality as list of function signatures. function getAllFunctionsOfPlugin(address _pluginAddress) external view returns (bytes4[] memory registered) { RouterStorage.Data storage data = RouterStorage.routerStorage(); EnumerableSet.Bytes32Set storage selectorsForPlugin = data.selectorsForPlugin[_pluginAddress]; bytes4[] memory defaultSelectors = IPluginMap(pluginMap).getAllFunctionsOfPlugin(_pluginAddress); uint256 len = defaultSelectors.length; uint256 count = selectorsForPlugin.length() + defaultSelectors.length; for (uint256 i = 0; i < len; i += 1) { if (selectorsForPlugin.contains(defaultSelectors[i])) { count -= 1; defaultSelectors[i] = bytes4(0); } } registered = new bytes4[](count); uint256 index; for (uint256 i = 0; i < len; i += 1) { if (defaultSelectors[i] != bytes4(0)) { registered[index++] = defaultSelectors[i]; } } len = selectorsForPlugin.length(); for (uint256 i = 0; i < len; i += 1) { registered[index++] = bytes4(data.selectorsForPlugin[_pluginAddress].at(i)); } } /// @dev View all funtionality existing on the contract. function getAllPlugins() external view returns (Plugin[] memory registered) { RouterStorage.Data storage data = RouterStorage.routerStorage(); EnumerableSet.Bytes32Set storage overrideSelectors = data.allSelectors; Plugin[] memory defaultPlugins = IPluginMap(pluginMap).getAllPlugins(); uint256 overrideSelectorsLen = overrideSelectors.length(); uint256 defaultPluginsLen = defaultPlugins.length; uint256 totalCount = overrideSelectorsLen + defaultPluginsLen; for (uint256 i = 0; i < overrideSelectorsLen; i += 1) { for (uint256 j = 0; j < defaultPluginsLen; j += 1) { if (bytes4(overrideSelectors.at(i)) == defaultPlugins[j].functionSelector) { totalCount -= 1; defaultPlugins[j].functionSelector = bytes4(0); } } } registered = new Plugin[](totalCount); uint256 index; for (uint256 i = 0; i < defaultPluginsLen; i += 1) { if (defaultPlugins[i].functionSelector != bytes4(0)) { registered[index] = defaultPlugins[i]; index += 1; } } for (uint256 i = 0; i < overrideSelectorsLen; i += 1) { registered[index] = data.pluginForSelector[bytes4(overrideSelectors.at(i))]; index += 1; } } /*/////////////////////////////////////////////////////////////// Internal functions //////////////////////////////////////////////////////////////*/ /// @dev View address of the plugged-in functionality contract for a given function signature. function _getPluginForFunction(bytes4 _selector) public view returns (address) { RouterStorage.Data storage data = RouterStorage.routerStorage(); address _pluginAddress = data.pluginForSelector[_selector].pluginAddress; return _pluginAddress; } /// @dev Add functionality to the contract. function _addPlugin(Plugin memory _plugin) internal { RouterStorage.Data storage data = RouterStorage.routerStorage(); // Revert: default plugin exists for function; use updatePlugin instead. try IPluginMap(pluginMap).getPluginForFunction(_plugin.functionSelector) returns (address) { revert("Router: default plugin exists for function."); } catch { require(data.allSelectors.add(bytes32(_plugin.functionSelector)), "Router: plugin exists for function."); } require( _plugin.functionSelector == bytes4(keccak256(abi.encodePacked(_plugin.functionSignature))), "Router: fn selector and signature mismatch." ); data.pluginForSelector[_plugin.functionSelector] = _plugin; data.selectorsForPlugin[_plugin.pluginAddress].add(bytes32(_plugin.functionSelector)); emit PluginAdded(_plugin.functionSelector, _plugin.pluginAddress); } /// @dev Update or override existing functionality. function _updatePlugin(Plugin memory _plugin) internal { address currentPlugin = getPluginForFunction(_plugin.functionSelector); require( _plugin.functionSelector == bytes4(keccak256(abi.encodePacked(_plugin.functionSignature))), "Router: fn selector and signature mismatch." ); RouterStorage.Data storage data = RouterStorage.routerStorage(); data.allSelectors.add(bytes32(_plugin.functionSelector)); data.pluginForSelector[_plugin.functionSelector] = _plugin; data.selectorsForPlugin[currentPlugin].remove(bytes32(_plugin.functionSelector)); data.selectorsForPlugin[_plugin.pluginAddress].add(bytes32(_plugin.functionSelector)); emit PluginUpdated(_plugin.functionSelector, currentPlugin, _plugin.pluginAddress); } /// @dev Remove existing functionality from the contract. function _removePlugin(bytes4 _selector) internal { RouterStorage.Data storage data = RouterStorage.routerStorage(); address currentPlugin = _getPluginForFunction(_selector); require(currentPlugin != address(0), "Router: No plugin available for selector"); delete data.pluginForSelector[_selector]; data.allSelectors.remove(_selector); data.selectorsForPlugin[currentPlugin].remove(bytes32(_selector)); emit PluginRemoved(_selector, currentPlugin); } function _canSetPlugin() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; /// @author thirdweb import "./IPluginMap.sol"; interface IRouter is IPluginMap { /// @dev Emitted when a functionality is added, or plugged-in. event PluginAdded(bytes4 indexed functionSelector, address indexed pluginAddress); /// @dev Emitted when a functionality is updated or overridden. event PluginUpdated( bytes4 indexed functionSelector, address indexed oldPluginAddress, address indexed newPluginAddress ); /// @dev Emitted when a functionality is removed. event PluginRemoved(bytes4 indexed functionSelector, address indexed pluginAddress); /// @dev Add a new plugin to the contract. function addPlugin(Plugin memory plugin) external; /// @dev Update / override an existing plugin. function updatePlugin(Plugin memory plugin) external; /// @dev Remove an existing plugin from the contract. function removePlugin(bytes4 functionSelector) external; }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; /// @author thirdweb import "../lib/TWAddress.sol"; import "./interface/IMulticall.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. * * _Available since v4.1._ */ contract Multicall is IMulticall { /** * @notice Receives and executes a batch of function calls on this contract. * @dev Receives and executes a batch of function calls on this contract. * * @param data The bytes data that makes up the batch of function calls to execute. * @return results The bytes data that makes up the result of the batch of function calls executed. */ function multicall(bytes[] calldata data) external virtual override returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { results[i] = TWAddress.functionDelegateCall(address(this), data[i]); } return results; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./interface/IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; /// @author thirdweb interface IPluginMap { /** * @notice An interface to describe a plug-in. * * @param functionSelector 4-byte function selector. * @param functionSignature Function representation as a string. E.g. "transfer(address,address,uint256)" * @param pluginAddress Address of the contract containing the function. */ struct Plugin { bytes4 functionSelector; string functionSignature; address pluginAddress; } /// @dev Emitted when a function selector is mapped to a particular plug-in smart contract, during construction of Map. event PluginSet(bytes4 indexed functionSelector, string indexed functionSignature, address indexed pluginAddress); /// @dev Returns the plug-in contract for a given function. function getPluginForFunction(bytes4 functionSelector) external view returns (address); /// @dev Returns all functions that are mapped to the given plug-in contract. function getAllFunctionsOfPlugin(address pluginAddress) external view returns (bytes4[] memory); /// @dev Returns all plug-ins known by Map. function getAllPlugins() external view returns (Plugin[] memory); }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @dev Collection of functions related to the address type */ library TWAddress { /** * @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. * * [EIP1884](https://eips.ethereum.org/EIPS/eip-1884) increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: value }(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @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, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author thirdweb /** * @dev Provides a function to batch together multiple calls in a single external call. * * _Available since v4.1._ */ interface IMulticall { /** * @dev Receives and executes a batch of function calls on this contract. */ function multicall(bytes[] calldata data) external returns (bytes[] memory results); }
// 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 * [EIP](https://eips.ethereum.org/EIPS/eip-165). * * 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 * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * 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: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @author thirdweb.com */ library ContractMetadataStorage { bytes32 public constant CONTRACT_METADATA_STORAGE_POSITION = keccak256("contract.metadata.storage"); struct Data { string contractURI; } function contractMetadataStorage() internal pure returns (Data storage contractMetadataData) { bytes32 position = CONTRACT_METADATA_STORAGE_POSITION; assembly { contractMetadataData.slot := position } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI * for you contract. * * Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea. */ interface IContractMetadata { /// @dev Returns the metadata URI of the contract. function contractURI() external view returns (string memory); /** * @dev Sets contract URI for the storefront-level metadata of the contract. * Only module admin can call this function. */ function setContractURI(string calldata _uri) external; /// @dev Emitted when the contract URI is updated. event ContractURIUpdated(string prevURI, string newURI); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @author thirdweb.com */ library PlatformFeeStorage { bytes32 public constant PLATFORM_FEE_STORAGE_POSITION = keccak256("platform.fee.storage"); struct Data { /// @dev The address that receives all platform fees from all sales. address platformFeeRecipient; /// @dev The % of primary sales collected as platform fees. uint16 platformFeeBps; } function platformFeeStorage() internal pure returns (Data storage platformFeeData) { bytes32 position = PLATFORM_FEE_STORAGE_POSITION; assembly { platformFeeData.slot := position } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `PlatformFee` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of platform fee and the platform fee basis points, and lets the inheriting contract perform conditional logic * that uses information about platform fees, if desired. */ interface IPlatformFee { /// @dev Returns the platform fee bps and recipient. function getPlatformFeeInfo() external view returns (address, uint16); /// @dev Lets a module admin update the fees on primary sales. function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external; /// @dev Emitted when fee on primary sales is updated. event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "../../extension/interface/IPermissionsEnumerable.sol"; /** * @author thirdweb.com */ library PermissionsEnumerableStorage { bytes32 public constant PERMISSIONS_ENUMERABLE_STORAGE_POSITION = keccak256("permissions.enumerable.storage"); /** * @notice A data structure to store data of members for a given role. * * @param index Current index in the list of accounts that have a role. * @param members map from index => address of account that has a role * @param indexOf map from address => index which the account has. */ struct RoleMembers { uint256 index; mapping(uint256 => address) members; mapping(address => uint256) indexOf; } struct Data { /// @dev map from keccak256 hash of a role to its members' data. See {RoleMembers}. mapping(bytes32 => RoleMembers) roleMembers; } function permissionsEnumerableStorage() internal pure returns (Data storage permissionsEnumerableData) { bytes32 position = PERMISSIONS_ENUMERABLE_STORAGE_POSITION; assembly { permissionsEnumerableData.slot := position } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "../../extension/interface/IPermissions.sol"; import "./PermissionsStorage.sol"; import "../../lib/TWStrings.sol"; /** * @author thirdweb.com * * @title Permissions * @dev This contracts provides extending-contracts with role-based access control mechanisms */ contract PermissionsLogic is IPermissions { /// @dev Default admin role for all roles. Only accounts with this role can grant/revoke other roles. bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /// @dev Modifier that checks if an account has the specified role; reverts otherwise. modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @notice Checks whether an account has a particular role. * @dev Returns `true` if `account` has been granted `role`. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account for which the role is being checked. */ function hasRole(bytes32 role, address account) public view override returns (bool) { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); return data._hasRole[role][account]; } /** * @notice Checks whether an account has a particular role; * role restrictions can be swtiched on and off. * * @dev Returns `true` if `account` has been granted `role`. * Role restrictions can be swtiched on and off: * - If address(0) has ROLE, then the ROLE restrictions * don't apply. * - If address(0) does not have ROLE, then the ROLE * restrictions will apply. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account for which the role is being checked. */ function hasRoleWithSwitch(bytes32 role, address account) public view returns (bool) { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); if (!data._hasRole[role][address(0)]) { return data._hasRole[role][account]; } return true; } /** * @notice Returns the admin role that controls the specified role. * @dev See {grantRole} and {revokeRole}. * To change a role's admin, use {_setRoleAdmin}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") */ function getRoleAdmin(bytes32 role) external view override returns (bytes32) { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); return data._getRoleAdmin[role]; } /** * @notice Grants a role to an account, if not previously granted. * @dev Caller must have admin role for the `role`. * Emits {RoleGranted Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account to which the role is being granted. */ function grantRole(bytes32 role, address account) public virtual override { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); _checkRole(data._getRoleAdmin[role], _msgSender()); if (data._hasRole[role][account]) { revert("Can only grant to non holders"); } _setupRole(role, account); } /** * @notice Revokes role from an account. * @dev Caller must have admin role for the `role`. * Emits {RoleRevoked Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account from which the role is being revoked. */ function revokeRole(bytes32 role, address account) public virtual override { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); _checkRole(data._getRoleAdmin[role], _msgSender()); _revokeRole(role, account); } /** * @notice Revokes role from the account. * @dev Caller must have the `role`, with caller being the same as `account`. * Emits {RoleRevoked Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account from which the role is being revoked. */ function renounceRole(bytes32 role, address account) public virtual override { if (_msgSender() != account) { revert("Can only renounce for self"); } _revokeRole(role, account); } /// @dev Sets `adminRole` as `role`'s admin role. function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); bytes32 previousAdminRole = data._getRoleAdmin[role]; data._getRoleAdmin[role] = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /// @dev Sets up `role` for `account` function _setupRole(bytes32 role, address account) internal virtual { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); data._hasRole[role][account] = true; emit RoleGranted(role, account, _msgSender()); } /// @dev Revokes `role` from `account` function _revokeRole(bytes32 role, address account) internal virtual { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); _checkRole(role, account); delete data._hasRole[role][account]; emit RoleRevoked(role, account, _msgSender()); } /// @dev Checks `role` for `account`. Reverts with a message including the required role. function _checkRole(bytes32 role, address account) internal view virtual { PermissionsStorage.Data storage data = PermissionsStorage.permissionsStorage(); if (!data._hasRole[role][account]) { revert( string( abi.encodePacked( "Permissions: account ", TWStrings.toHexString(uint160(account), 20), " is missing role ", TWStrings.toHexString(uint256(role), 32) ) ) ); } } /// @dev Checks `role` for `account`. Reverts with a message including the required role. function _checkRoleWithSwitch(bytes32 role, address account) internal view virtual { if (!hasRoleWithSwitch(role, account)) { revert( string( abi.encodePacked( "Permissions: account ", TWStrings.toHexString(uint160(account), 20), " is missing role ", TWStrings.toHexString(uint256(role), 32) ) ) ); } } function _msgSender() internal view virtual returns (address sender) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./IPermissions.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IPermissionsEnumerable is IPermissions { /** * @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 * [forum post](https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296) * 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: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IPermissions { /** * @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: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @author thirdweb.com */ library PermissionsStorage { bytes32 public constant PERMISSIONS_STORAGE_POSITION = keccak256("permissions.storage"); struct Data { /// @dev Map from keccak256 hash of a role => a map from address => whether address has role. mapping(bytes32 => mapping(address => bool)) _hasRole; /// @dev Map from keccak256 hash of a role to role admin. See {getRoleAdmin}. mapping(bytes32 => bytes32) _getRoleAdmin; } function permissionsStorage() internal pure returns (Data storage permissionsData) { bytes32 position = PERMISSIONS_STORAGE_POSITION; assembly { permissionsData.slot := position } } }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @dev String operations. */ library TWStrings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb library ReentrancyGuardStorage { bytes32 public constant REENTRANCY_GUARD_STORAGE_POSITION = keccak256("reentrancy.guard.storage"); struct Data { uint256 _status; } function reentrancyGuardStorage() internal pure returns (Data storage reentrancyGuardData) { bytes32 position = REENTRANCY_GUARD_STORAGE_POSITION; assembly { reentrancyGuardData.slot := position } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb library ERC2771ContextStorage { bytes32 public constant ERC2771_CONTEXT_STORAGE_POSITION = keccak256("erc2771.context.storage"); struct Data { mapping(address => bool) _trustedForwarder; } function erc2771ContextStorage() internal pure returns (Data storage erc2771ContextData) { bytes32 position = ERC2771_CONTEXT_STORAGE_POSITION; assembly { erc2771ContextData.slot := position } } }
{ "metadata": { "bytecodeHash": "ipfs" }, "optimizer": { "enabled": true, "runs": 300 }, "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":"_pluginMap","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"prevURI","type":"string"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"platformFeeRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"platformFeeBps","type":"uint256"}],"name":"PlatformFeeInfoUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"functionSelector","type":"bytes4"},{"indexed":true,"internalType":"address","name":"pluginAddress","type":"address"}],"name":"PluginAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"functionSelector","type":"bytes4"},{"indexed":true,"internalType":"address","name":"pluginAddress","type":"address"}],"name":"PluginRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"functionSelector","type":"bytes4"},{"indexed":true,"internalType":"string","name":"functionSignature","type":"string"},{"indexed":true,"internalType":"address","name":"pluginAddress","type":"address"}],"name":"PluginSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"functionSelector","type":"bytes4"},{"indexed":true,"internalType":"address","name":"oldPluginAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newPluginAddress","type":"address"}],"name":"PluginUpdated","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"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"_getPluginForFunction","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes4","name":"functionSelector","type":"bytes4"},{"internalType":"string","name":"functionSignature","type":"string"},{"internalType":"address","name":"pluginAddress","type":"address"}],"internalType":"struct IPluginMap.Plugin","name":"_plugin","type":"tuple"}],"name":"addPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_pluginAddress","type":"address"}],"name":"getAllFunctionsOfPlugin","outputs":[{"internalType":"bytes4[]","name":"registered","type":"bytes4[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllPlugins","outputs":[{"components":[{"internalType":"bytes4","name":"functionSelector","type":"bytes4"},{"internalType":"string","name":"functionSignature","type":"string"},{"internalType":"address","name":"pluginAddress","type":"address"}],"internalType":"struct IPluginMap.Plugin[]","name":"registered","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlatformFeeInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"getPluginForFunction","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"member","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"count","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":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRoleWithSwitch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_defaultAdmin","type":"address"},{"internalType":"string","name":"_contractURI","type":"string"},{"internalType":"address[]","name":"_trustedForwarders","type":"address[]"},{"internalType":"address","name":"_platformFeeRecipient","type":"address"},{"internalType":"uint16","name":"_platformFeeBps","type":"uint16"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"pluginMap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"removePlugin","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":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platformFeeRecipient","type":"address"},{"internalType":"uint256","name":"_platformFeeBps","type":"uint256"}],"name":"setPlatformFeeInfo","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":[{"components":[{"internalType":"bytes4","name":"functionSelector","type":"bytes4"},{"internalType":"string","name":"functionSignature","type":"string"},{"internalType":"address","name":"pluginAddress","type":"address"}],"internalType":"struct IPluginMap.Plugin","name":"_plugin","type":"tuple"}],"name":"updatePlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a06040523480156200001157600080fd5b5060405162002eb938038062002eb9833981016040819052620000349162000046565b6001600160a01b031660805262000078565b6000602082840312156200005957600080fd5b81516001600160a01b03811681146200007157600080fd5b9392505050565b608051612e09620000b0600039600081816102200152818161062201528181610ac501528181610d8d01526113640152612e096000f3fe6080604052600436106101d15760003560e01c8063a217fddf116100f7578063bc197c8111610095578063d45573f611610064578063d45573f6146106d3578063d547741f14610729578063e8a3d48514610749578063f23a6e611461076b576101d8565b8063bc197c8114610644578063c511f8fb14610670578063ca15c87314610690578063cb2ef6f7146106b0576101d8565b8063a5342fdf116100d1578063a5342fdf146105a8578063aaae5633146105c3578063ac9650d8146105e3578063b48912da14610610576101d8565b8063a217fddf14610553578063a32fa5b314610568578063a520a38a14610588576101d8565b80634cb5d8fd1161016f5780639010d07c1161013e5780639010d07c146104bf57806391d14854146104f7578063938e3d7b14610517578063a0a8e46014610537576101d8565b80634cb5d8fd146103f8578063572b6c05146104185780635c573f2e146104705780636b86400e1461049d576101d8565b80631e7ac488116101ab5780631e7ac4881461033e578063248a9ca31461035e5780632f2ff15d146103b857806336568abe146103d8576101d8565b806301ffc9a7146102a2578063150b7a02146102d75780631ab6b7051461031c576101d8565b366101d857005b60006101ef6000356001600160e01b031916610797565b90506001600160a01b0381166102965760405163529051c560e11b81526000356001600160e01b03191660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a520a38a90602401602060405180830381865afa15801561026f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102939190612179565b90505b61029f816107de565b50005b3480156102ae57600080fd5b506102c26102bd3660046121ac565b610807565b60405190151581526020015b60405180910390f35b3480156102e357600080fd5b506103036102f23660046121d4565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016102ce565b34801561032857600080fd5b5061033c610337366004612361565b61084d565b005b34801561034a57600080fd5b5061033c6103593660046123f8565b61089d565b34801561036a57600080fd5b506103aa610379366004612424565b60009081527fd0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed6602052604090205490565b6040519081526020016102ce565b3480156103c457600080fd5b5061033c6103d336600461243d565b6108f0565b3480156103e457600080fd5b5061033c6103f336600461243d565b6109ba565b34801561040457600080fd5b5061033c610413366004612361565b610a2c565b34801561042457600080fd5b506102c261043336600461246d565b6001600160a01b031660009081527fa140e363058a6cf3ca062c5e378319d7ddd21cedfbdca620f1c65b05028f156c602052604090205460ff1690565b34801561047c57600080fd5b5061049061048b36600461246d565b610a6a565b6040516102ce919061248a565b3480156104a957600080fd5b506104b2610d5a565b6040516102ce9190612534565b3480156104cb57600080fd5b506104df6104da3660046125ca565b611133565b6040516001600160a01b0390911681526020016102ce565b34801561050357600080fd5b506102c261051236600461243d565b611241565b34801561052357600080fd5b5061033c6105323660046125ec565b611279565b34801561054357600080fd5b50604051600181526020016102ce565b34801561055f57600080fd5b506103aa600081565b34801561057457600080fd5b506102c261058336600461243d565b6112c7565b34801561059457600080fd5b506104df6105a33660046121ac565b611329565b3480156105b457600080fd5b5061033c6104133660046121ac565b3480156105cf57600080fd5b5061033c6105de36600461265f565b6113e5565b3480156105ef57600080fd5b506106036105fe366004612756565b6114f4565b6040516102ce91906127cb565b34801561061c57600080fd5b506104df7f000000000000000000000000000000000000000000000000000000000000000081565b34801561065057600080fd5b5061030361065f366004612893565b63bc197c8160e01b95945050505050565b34801561067c57600080fd5b506104df61068b3660046121ac565b610797565b34801561069c57600080fd5b506103aa6106ab366004612424565b6115e9565b3480156106bc57600080fd5b506c4d61726b6574706c616365563360981b6103aa565b3480156106df57600080fd5b507f4aeb3f25cc46659cf4e4966e5c48b11e9400e6e4bfafae7e3dc6cc3fbc858deb54604080516001600160a01b0383168152600160a01b90920461ffff166020830152016102ce565b34801561073557600080fd5b5061033c61074436600461243d565b611692565b34801561075557600080fd5b5061075e6116e6565b6040516102ce9190612941565b34801561077757600080fd5b50610303610786366004612954565b63f23a6e6160e01b95945050505050565b6001600160e01b03191660009081527f1a3e4131826bb378aa43abb34a33a366bc4a35b55ab18a884fa205b59285ec4860205260409020600201546001600160a01b031690565b3660008037600080366000845af43d6000803e8080156107fd573d6000f35b3d6000fd5b505050565b60006001600160e01b03198216630271189760e51b148061083857506001600160e01b03198216630a85bd0160e11b145b8061084757506108478261179c565b92915050565b60405162461bcd60e51b815260206004820152601660248201527f526f757465723a204e6f7420617574686f72697a65640000000000000000000060448201526064015b60405180910390fd5b50565b6108a56117d1565b6108e25760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610891565b6108ec82826117e4565b5050565b60008281527fd0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed66020526040902054600080516020612d8d8339815191529061093f9061093a6118c1565b61190a565b6000838152602082815260408083206001600160a01b038616845290915290205460ff16156109b05760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c646572730000006044820152606401610891565b6108028383611998565b806001600160a01b03166109cc6118c1565b6001600160a01b031614610a225760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c660000000000006044820152606401610891565b6108ec82826119ac565b60405162461bcd60e51b815260206004820152601360248201527213585c0e88139bdd08185d5d1a1bdc9a5e9959606a1b6044820152606401610891565b606060007f1a3e4131826bb378aa43abb34a33a366bc4a35b55ab18a884fa205b59285ec456001600160a01b0384811660008181526002840160205260408082209051632e2b9f9760e11b81526004810193909352939450917f00000000000000000000000000000000000000000000000000000000000000001690635c573f2e90602401600060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b3491908101906129bd565b8051909150600081610b4585611a22565b610b4f9190612a6d565b905060005b82811015610be757610b92848281518110610b7157610b71612a85565b60200260200101516001600160e01b03191686611a2c90919063ffffffff16565b15610bd557610ba2600183612a9b565b9150600060e01b848281518110610bbb57610bbb612a85565b6001600160e01b0319909216602092830291909101909101525b610be0600182612a6d565b9050610b54565b508067ffffffffffffffff811115610c0157610c01612273565b604051908082528060200260200182016040528015610c2a578160200160208202803683370190505b5095506000805b83811015610ccb578451600090869083908110610c5057610c50612a85565b60200260200101516001600160e01b03191614610cb957848181518110610c7957610c79612a85565b6020026020010151888380610c8d90612ab2565b945081518110610c9f57610c9f612a85565b6001600160e01b0319909216602092830291909101909101525b610cc4600182612a6d565b9050610c31565b50610cd585611a22565b925060005b83811015610d4e576001600160a01b03891660009081526002880160205260409020610d069082611a44565b8883610d1181612ab2565b945081518110610d2357610d23612a85565b6001600160e01b031990921660209283029190910190910152610d47600182612a6d565b9050610cda565b50505050505050919050565b606060007f1a3e4131826bb378aa43abb34a33a366bc4a35b55ab18a884fa205b59285ec459050600081600001905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636b86400e6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610de9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e119190810190612acd565b90506000610e1e83611a22565b82519091506000610e2f8284612a6d565b905060005b83811015610eec5760005b83811015610ed957858181518110610e5957610e59612a85565b6020908102919091010151516001600160e01b031916610e798884611a44565b6001600160e01b0319161415610ec757610e94600184612a9b565b9250600060e01b868281518110610ead57610ead612a85565b60209081029190910101516001600160e01b031990911690525b610ed2600182612a6d565b9050610e3f565b50610ee5600182612a6d565b9050610e34565b508067ffffffffffffffff811115610f0657610f06612273565b604051908082528060200260200182016040528015610f5657816020015b60408051606080820183526000808352602083019190915291810191909152815260200190600190039081610f245790505b5096506000805b83811015610fee578551600090879083908110610f7c57610f7c612a85565b6020026020010151600001516001600160e01b03191614610fdc57858181518110610fa957610fa9612a85565b6020026020010151898381518110610fc357610fc3612a85565b6020908102919091010152610fd9600183612a6d565b91505b610fe7600182612a6d565b9050610f5d565b5060005b848110156111285760038801600061100a8984611a44565b6001600160e01b031990811682526020808301939093526040918201600020825160608101909352805460e01b9091168252600181018054929391929184019161105390612c0e565b80601f016020809104026020016040519081016040528092919081815260200182805461107f90612c0e565b80156110cc5780601f106110a1576101008083540402835291602001916110cc565b820191906000526020600020905b8154815290600101906020018083116110af57829003601f168201915b5050509183525050600291909101546001600160a01b031660209091015289518a90849081106110fe576110fe612a85565b6020908102919091010152611114600183612a6d565b9150611121600182612a6d565b9050610ff2565b505050505050505090565b60008281527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c6020819052604082205482805b82811015611237576000878152602085815260408083208484526001019091529020546001600160a01b0316156111e257858214156111d0576000878152602094855260408082209282526001909201909452909220546001600160a01b03169250610847915050565b6111db600183612a6d565b9150611225565b6111ed876000611241565b8015611212575060008781526020858152604080832083805260020190915290205481145b1561122557611222600183612a6d565b91505b611230600182612a6d565b9050611166565b5050505092915050565b6000918252600080516020612d8d833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6112816117d1565b6112be5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610891565b61089a81611a50565b6000828152600080516020612d8d8339815191526020818152604080842084805290915282205460ff1661131f576000848152602091825260408082206001600160a01b0386168352909252205460ff169050610847565b5060019392505050565b60008061133583610797565b90506001600160a01b0381166113dc5760405163529051c560e11b81526001600160e01b0319841660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a520a38a90602401602060405180830381865afa1580156113b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d79190612179565b6113de565b805b9392505050565b7f627d6cbb4eb558f37de3c2ec08b04710e54e06be936a302f087f7bfb80f39ae0805460ff16156114585760405162461bcd60e51b815260206004820152601460248201527f416c726561647920696e697469616c697a65642e0000000000000000000000006044820152606401610891565b805460ff1916600117815561146b611b54565b61147484611b7f565b61147d85611a50565b61148b838361ffff166117e4565b611496600087611998565b6114c17ff94103142c1baabe9ac2b5d1487bf783de9e69cfeea9a72f5c9c94afd7877b8c6000611998565b6114ec7f86d5cf0a6bdc8d859ba3bdc97043337c82a0e609035f378e419298b6a3e00ae66000611998565b505050505050565b60608167ffffffffffffffff81111561150f5761150f612273565b60405190808252806020026020018201604052801561154257816020015b606081526020019060019003908161152d5790505b50905060005b828110156115e2576115b23085858481811061156657611566612a85565b90506020028101906115789190612c49565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b8892505050565b8282815181106115c4576115c4612a85565b602002602001018190525080806115da90612ab2565b915050611548565b5092915050565b60008181527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c60208190526040822054825b8181101561166c576000858152602084815260408083208484526001019091529020546001600160a01b03161561165a57611657600185612a6d565b93505b611665600182612a6d565b905061161b565b50611678846000611241565b1561168b57611688600184612a6d565b92505b5050919050565b60008281527fd0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed66020526040902054600080516020612d8d833981519152906116dc9061093a6118c1565b61080283836119ac565b7fa7d40346e44ca145e94a946aa34a7d4a67245577dc18699a626fe0ffc6ce3281805460609190819061171890612c0e565b80601f016020809104026020016040519081016040528092919081815260200182805461174490612c0e565b80156117915780601f1061176657610100808354040283529160200191611791565b820191906000526020600020905b81548152906001019060200180831161177457829003601f168201915b505050505091505090565b60006001600160e01b0319821663f337402760e01b148061084757506301ffc9a760e01b6001600160e01b0319831614610847565b60006117df816105126118c1565b905090565b7f4aeb3f25cc46659cf4e4966e5c48b11e9400e6e4bfafae7e3dc6cc3fbc858deb6127108211156118495760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b6044820152606401610891565b805475ffffffffffffffffffffffffffffffffffffffffffff1916600160a01b61ffff8416026001600160a01b031916176001600160a01b03841690811782556040518381527fe2497bd806ec41a6e0dd992c29a72efc0ef8fec9092d1978fd4a1e00b2f183049060200160405180910390a2505050565b3360009081527fa140e363058a6cf3ca062c5e378319d7ddd21cedfbdca620f1c65b05028f156c602052604081205460ff1615611905575060131936013560601c90565b503390565b6000828152600080516020612d8d833981519152602081815260408084206001600160a01b03861685529091529091205460ff1661080257611956826001600160a01b03166014611bad565b611961846020611bad565b604051602001611972929190612cb3565b60408051601f198184030181529082905262461bcd60e51b825261089191600401612941565b6119a28282611d49565b6108ec8282611dd4565b6119b68282611e62565b60008281527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c602090815260408083206001600160a01b03851680855260028201808552838620805487526001909301855292852080546001600160a01b031916905584529152555050565b6000610847825490565b600081815260018301602052604081205415156113de565b60006113de8383611ef0565b7fa7d40346e44ca145e94a946aa34a7d4a67245577dc18699a626fe0ffc6ce328180546000908290611a8190612c0e565b80601f0160208091040260200160405190810160405280929190818152602001828054611aad90612c0e565b8015611afa5780601f10611acf57610100808354040283529160200191611afa565b820191906000526020600020905b815481529060010190602001808311611add57829003601f168201915b50508651939450611b159386935060208801925090506120bb565b507fc9c7c3fe08b88b4df9d4d47ef47d2c43d55c025a0ba88ca442580ed9e7348a168184604051611b47929190612d28565b60405180910390a1505050565b611b7d60017fbbf78d3411d42a81effd97bb8c69faae4e77e75cec462245c1001191a0634c6f55565b565b61089a81611f1a565b60606113de8383604051806060016040528060278152602001612dad60279139611fa5565b60606000611bbc836002612d56565b611bc7906002612a6d565b67ffffffffffffffff811115611bdf57611bdf612273565b6040519080825280601f01601f191660200182016040528015611c09576020820181803683370190505b509050600360fc1b81600081518110611c2457611c24612a85565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611c5357611c53612a85565b60200101906001600160f81b031916908160001a9053506000611c77846002612d56565b611c82906001612a6d565b90505b6001811115611cfa576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611cb657611cb6612a85565b1a60f81b828281518110611ccc57611ccc612a85565b60200101906001600160f81b031916908160001a90535060049490941c93611cf381612d75565b9050611c85565b5083156113de5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610891565b6000600080516020612d8d8339815191526000848152602082815260408083206001600160a01b03871684529091529020805460ff191660011790559050611d8f6118c1565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4505050565b60008281527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c6020819052604082208054919260019190611e158385612a6d565b909155505060009384526020918252604080852082865260018101845281862080546001600160a01b039096166001600160a01b0319909616861790559385526002909301909152912055565b600080516020612d8d833981519152611e7b838361190a565b6000838152602082815260408083206001600160a01b03861684529091529020805460ff19169055611eab6118c1565b6001600160a01b0316826001600160a01b0316847ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a4505050565b6000826000018281548110611f0757611f07612a85565b9060005260206000200154905092915050565b7fa140e363058a6cf3ca062c5e378319d7ddd21cedfbdca620f1c65b05028f156c60005b8251811015610802576001826000016000858481518110611f6157611f61612a85565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611f9d81612ab2565b915050611f3e565b60606001600160a01b0384163b61200d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610891565b600080856001600160a01b0316856040516120289190612c97565b600060405180830381855af49150503d8060008114612063576040519150601f19603f3d011682016040523d82523d6000602084013e612068565b606091505b5091509150612078828286612082565b9695505050505050565b606083156120915750816113de565b8251156120a15782518084602001fd5b8160405162461bcd60e51b81526004016108919190612941565b8280546120c790612c0e565b90600052602060002090601f0160209004810192826120e9576000855561212f565b82601f1061210257805160ff191683800117855561212f565b8280016001018555821561212f579182015b8281111561212f578251825591602001919060010190612114565b5061213b92915061213f565b5090565b5b8082111561213b5760008155600101612140565b6001600160a01b038116811461089a57600080fd5b805161217481612154565b919050565b60006020828403121561218b57600080fd5b81516113de81612154565b6001600160e01b03198116811461089a57600080fd5b6000602082840312156121be57600080fd5b81356113de81612196565b803561217481612154565b6000806000806000608086880312156121ec57600080fd5b85356121f781612154565b9450602086013561220781612154565b935060408601359250606086013567ffffffffffffffff8082111561222b57600080fd5b818801915088601f83011261223f57600080fd5b81358181111561224e57600080fd5b89602082850101111561226057600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156122ac576122ac612273565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156122db576122db612273565b604052919050565b600067ffffffffffffffff8211156122fd576122fd612273565b50601f01601f191660200190565b600082601f83011261231c57600080fd5b813561232f61232a826122e3565b6122b2565b81815284602083860101111561234457600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561237357600080fd5b813567ffffffffffffffff8082111561238b57600080fd5b908301906060828603121561239f57600080fd5b6123a7612289565b82356123b281612196565b81526020830135828111156123c657600080fd5b6123d28782860161230b565b602083015250604083013592506123e883612154565b6040810192909252509392505050565b6000806040838503121561240b57600080fd5b823561241681612154565b946020939093013593505050565b60006020828403121561243657600080fd5b5035919050565b6000806040838503121561245057600080fd5b82359150602083013561246281612154565b809150509250929050565b60006020828403121561247f57600080fd5b81356113de81612154565b6020808252825182820181905260009190848201906040850190845b818110156124cc5783516001600160e01b031916835292840192918401916001016124a6565b50909695505050505050565b60005b838110156124f35781810151838201526020016124db565b83811115612502576000848401525b50505050565b600081518084526125208160208601602086016124d8565b601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156125bc57888303603f19018552815180516001600160e01b03191684528781015160608986018190529061259582870182612508565b928901516001600160a01b031695890195909552509487019492509086019060010161255b565b509098975050505050505050565b600080604083850312156125dd57600080fd5b50508035926020909101359150565b6000602082840312156125fe57600080fd5b813567ffffffffffffffff81111561261557600080fd5b6126218482850161230b565b949350505050565b600067ffffffffffffffff82111561264357612643612273565b5060051b60200190565b803561ffff8116811461217457600080fd5b600080600080600060a0868803121561267757600080fd5b853561268281612154565b945060208681013567ffffffffffffffff808211156126a057600080fd5b6126ac8a838b0161230b565b965060408901359150808211156126c257600080fd5b508701601f810189136126d457600080fd5b80356126e261232a82612629565b81815260059190911b8201830190838101908b83111561270157600080fd5b928401925b8284101561272857833561271981612154565b82529284019290840190612706565b809750505050505061273c606087016121c9565b915061274a6080870161264d565b90509295509295909350565b6000806020838503121561276957600080fd5b823567ffffffffffffffff8082111561278157600080fd5b818501915085601f83011261279557600080fd5b8135818111156127a457600080fd5b8660208260051b85010111156127b957600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561282057603f1988860301845261280e858351612508565b945092850192908501906001016127f2565b5092979650505050505050565b600082601f83011261283e57600080fd5b8135602061284e61232a83612629565b82815260059290921b8401810191818101908684111561286d57600080fd5b8286015b848110156128885780358352918301918301612871565b509695505050505050565b600080600080600060a086880312156128ab57600080fd5b85356128b681612154565b945060208601356128c681612154565b9350604086013567ffffffffffffffff808211156128e357600080fd5b6128ef89838a0161282d565b9450606088013591508082111561290557600080fd5b61291189838a0161282d565b9350608088013591508082111561292757600080fd5b506129348882890161230b565b9150509295509295909350565b6020815260006113de6020830184612508565b600080600080600060a0868803121561296c57600080fd5b853561297781612154565b9450602086013561298781612154565b93506040860135925060608601359150608086013567ffffffffffffffff8111156129b157600080fd5b6129348882890161230b565b600060208083850312156129d057600080fd5b825167ffffffffffffffff8111156129e757600080fd5b8301601f810185136129f857600080fd5b8051612a0661232a82612629565b81815260059190911b82018301908381019087831115612a2557600080fd5b928401925b82841015612a4c578351612a3d81612196565b82529284019290840190612a2a565b979650505050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115612a8057612a80612a57565b500190565b634e487b7160e01b600052603260045260246000fd5b600082821015612aad57612aad612a57565b500390565b6000600019821415612ac657612ac6612a57565b5060010190565b60006020808385031215612ae057600080fd5b825167ffffffffffffffff80821115612af857600080fd5b818501915085601f830112612b0c57600080fd5b8151612b1a61232a82612629565b81815260059190911b83018401908481019088831115612b3957600080fd5b8585015b83811015612c0157805185811115612b5457600080fd5b86016060818c03601f19011215612b6b5760008081fd5b612b73612289565b88820151612b8081612196565b815260408281015188811115612b965760008081fd5b8301603f81018e13612ba85760008081fd5b8a810151612bb861232a826122e3565b8181528f84838501011115612bcd5760008081fd5b612bdc828e83018686016124d8565b848d015250612bef905060608401612169565b90820152845250918601918601612b3d565b5098975050505050505050565b600181811c90821680612c2257607f821691505b60208210811415612c4357634e487b7160e01b600052602260045260246000fd5b50919050565b6000808335601e19843603018112612c6057600080fd5b83018035915067ffffffffffffffff821115612c7b57600080fd5b602001915036819003821315612c9057600080fd5b9250929050565b60008251612ca98184602087016124d8565b9190910192915050565b7f5065726d697373696f6e733a206163636f756e74200000000000000000000000815260008351612ceb8160158501602088016124d8565b7001034b99036b4b9b9b4b733903937b6329607d1b6015918401918201528351612d1c8160268401602088016124d8565b01602601949350505050565b604081526000612d3b6040830185612508565b8281036020840152612d4d8185612508565b95945050505050565b6000816000190483118215151615612d7057612d70612a57565b500290565b600081612d8457612d84612a57565b50600019019056fed0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed5416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220cd27cecfe1b199c4905b4636edd776cccf600df4d52069156c9ded42258292df64736f6c634300080c0033000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca8
Deployed Bytecode
0x6080604052600436106101d15760003560e01c8063a217fddf116100f7578063bc197c8111610095578063d45573f611610064578063d45573f6146106d3578063d547741f14610729578063e8a3d48514610749578063f23a6e611461076b576101d8565b8063bc197c8114610644578063c511f8fb14610670578063ca15c87314610690578063cb2ef6f7146106b0576101d8565b8063a5342fdf116100d1578063a5342fdf146105a8578063aaae5633146105c3578063ac9650d8146105e3578063b48912da14610610576101d8565b8063a217fddf14610553578063a32fa5b314610568578063a520a38a14610588576101d8565b80634cb5d8fd1161016f5780639010d07c1161013e5780639010d07c146104bf57806391d14854146104f7578063938e3d7b14610517578063a0a8e46014610537576101d8565b80634cb5d8fd146103f8578063572b6c05146104185780635c573f2e146104705780636b86400e1461049d576101d8565b80631e7ac488116101ab5780631e7ac4881461033e578063248a9ca31461035e5780632f2ff15d146103b857806336568abe146103d8576101d8565b806301ffc9a7146102a2578063150b7a02146102d75780631ab6b7051461031c576101d8565b366101d857005b60006101ef6000356001600160e01b031916610797565b90506001600160a01b0381166102965760405163529051c560e11b81526000356001600160e01b03191660048201527f000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca86001600160a01b03169063a520a38a90602401602060405180830381865afa15801561026f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102939190612179565b90505b61029f816107de565b50005b3480156102ae57600080fd5b506102c26102bd3660046121ac565b610807565b60405190151581526020015b60405180910390f35b3480156102e357600080fd5b506103036102f23660046121d4565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016102ce565b34801561032857600080fd5b5061033c610337366004612361565b61084d565b005b34801561034a57600080fd5b5061033c6103593660046123f8565b61089d565b34801561036a57600080fd5b506103aa610379366004612424565b60009081527fd0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed6602052604090205490565b6040519081526020016102ce565b3480156103c457600080fd5b5061033c6103d336600461243d565b6108f0565b3480156103e457600080fd5b5061033c6103f336600461243d565b6109ba565b34801561040457600080fd5b5061033c610413366004612361565b610a2c565b34801561042457600080fd5b506102c261043336600461246d565b6001600160a01b031660009081527fa140e363058a6cf3ca062c5e378319d7ddd21cedfbdca620f1c65b05028f156c602052604090205460ff1690565b34801561047c57600080fd5b5061049061048b36600461246d565b610a6a565b6040516102ce919061248a565b3480156104a957600080fd5b506104b2610d5a565b6040516102ce9190612534565b3480156104cb57600080fd5b506104df6104da3660046125ca565b611133565b6040516001600160a01b0390911681526020016102ce565b34801561050357600080fd5b506102c261051236600461243d565b611241565b34801561052357600080fd5b5061033c6105323660046125ec565b611279565b34801561054357600080fd5b50604051600181526020016102ce565b34801561055f57600080fd5b506103aa600081565b34801561057457600080fd5b506102c261058336600461243d565b6112c7565b34801561059457600080fd5b506104df6105a33660046121ac565b611329565b3480156105b457600080fd5b5061033c6104133660046121ac565b3480156105cf57600080fd5b5061033c6105de36600461265f565b6113e5565b3480156105ef57600080fd5b506106036105fe366004612756565b6114f4565b6040516102ce91906127cb565b34801561061c57600080fd5b506104df7f000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca881565b34801561065057600080fd5b5061030361065f366004612893565b63bc197c8160e01b95945050505050565b34801561067c57600080fd5b506104df61068b3660046121ac565b610797565b34801561069c57600080fd5b506103aa6106ab366004612424565b6115e9565b3480156106bc57600080fd5b506c4d61726b6574706c616365563360981b6103aa565b3480156106df57600080fd5b507f4aeb3f25cc46659cf4e4966e5c48b11e9400e6e4bfafae7e3dc6cc3fbc858deb54604080516001600160a01b0383168152600160a01b90920461ffff166020830152016102ce565b34801561073557600080fd5b5061033c61074436600461243d565b611692565b34801561075557600080fd5b5061075e6116e6565b6040516102ce9190612941565b34801561077757600080fd5b50610303610786366004612954565b63f23a6e6160e01b95945050505050565b6001600160e01b03191660009081527f1a3e4131826bb378aa43abb34a33a366bc4a35b55ab18a884fa205b59285ec4860205260409020600201546001600160a01b031690565b3660008037600080366000845af43d6000803e8080156107fd573d6000f35b3d6000fd5b505050565b60006001600160e01b03198216630271189760e51b148061083857506001600160e01b03198216630a85bd0160e11b145b8061084757506108478261179c565b92915050565b60405162461bcd60e51b815260206004820152601660248201527f526f757465723a204e6f7420617574686f72697a65640000000000000000000060448201526064015b60405180910390fd5b50565b6108a56117d1565b6108e25760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610891565b6108ec82826117e4565b5050565b60008281527fd0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed66020526040902054600080516020612d8d8339815191529061093f9061093a6118c1565b61190a565b6000838152602082815260408083206001600160a01b038616845290915290205460ff16156109b05760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c646572730000006044820152606401610891565b6108028383611998565b806001600160a01b03166109cc6118c1565b6001600160a01b031614610a225760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c660000000000006044820152606401610891565b6108ec82826119ac565b60405162461bcd60e51b815260206004820152601360248201527213585c0e88139bdd08185d5d1a1bdc9a5e9959606a1b6044820152606401610891565b606060007f1a3e4131826bb378aa43abb34a33a366bc4a35b55ab18a884fa205b59285ec456001600160a01b0384811660008181526002840160205260408082209051632e2b9f9760e11b81526004810193909352939450917f000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca81690635c573f2e90602401600060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b3491908101906129bd565b8051909150600081610b4585611a22565b610b4f9190612a6d565b905060005b82811015610be757610b92848281518110610b7157610b71612a85565b60200260200101516001600160e01b03191686611a2c90919063ffffffff16565b15610bd557610ba2600183612a9b565b9150600060e01b848281518110610bbb57610bbb612a85565b6001600160e01b0319909216602092830291909101909101525b610be0600182612a6d565b9050610b54565b508067ffffffffffffffff811115610c0157610c01612273565b604051908082528060200260200182016040528015610c2a578160200160208202803683370190505b5095506000805b83811015610ccb578451600090869083908110610c5057610c50612a85565b60200260200101516001600160e01b03191614610cb957848181518110610c7957610c79612a85565b6020026020010151888380610c8d90612ab2565b945081518110610c9f57610c9f612a85565b6001600160e01b0319909216602092830291909101909101525b610cc4600182612a6d565b9050610c31565b50610cd585611a22565b925060005b83811015610d4e576001600160a01b03891660009081526002880160205260409020610d069082611a44565b8883610d1181612ab2565b945081518110610d2357610d23612a85565b6001600160e01b031990921660209283029190910190910152610d47600182612a6d565b9050610cda565b50505050505050919050565b606060007f1a3e4131826bb378aa43abb34a33a366bc4a35b55ab18a884fa205b59285ec459050600081600001905060007f000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca86001600160a01b0316636b86400e6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610de9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e119190810190612acd565b90506000610e1e83611a22565b82519091506000610e2f8284612a6d565b905060005b83811015610eec5760005b83811015610ed957858181518110610e5957610e59612a85565b6020908102919091010151516001600160e01b031916610e798884611a44565b6001600160e01b0319161415610ec757610e94600184612a9b565b9250600060e01b868281518110610ead57610ead612a85565b60209081029190910101516001600160e01b031990911690525b610ed2600182612a6d565b9050610e3f565b50610ee5600182612a6d565b9050610e34565b508067ffffffffffffffff811115610f0657610f06612273565b604051908082528060200260200182016040528015610f5657816020015b60408051606080820183526000808352602083019190915291810191909152815260200190600190039081610f245790505b5096506000805b83811015610fee578551600090879083908110610f7c57610f7c612a85565b6020026020010151600001516001600160e01b03191614610fdc57858181518110610fa957610fa9612a85565b6020026020010151898381518110610fc357610fc3612a85565b6020908102919091010152610fd9600183612a6d565b91505b610fe7600182612a6d565b9050610f5d565b5060005b848110156111285760038801600061100a8984611a44565b6001600160e01b031990811682526020808301939093526040918201600020825160608101909352805460e01b9091168252600181018054929391929184019161105390612c0e565b80601f016020809104026020016040519081016040528092919081815260200182805461107f90612c0e565b80156110cc5780601f106110a1576101008083540402835291602001916110cc565b820191906000526020600020905b8154815290600101906020018083116110af57829003601f168201915b5050509183525050600291909101546001600160a01b031660209091015289518a90849081106110fe576110fe612a85565b6020908102919091010152611114600183612a6d565b9150611121600182612a6d565b9050610ff2565b505050505050505090565b60008281527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c6020819052604082205482805b82811015611237576000878152602085815260408083208484526001019091529020546001600160a01b0316156111e257858214156111d0576000878152602094855260408082209282526001909201909452909220546001600160a01b03169250610847915050565b6111db600183612a6d565b9150611225565b6111ed876000611241565b8015611212575060008781526020858152604080832083805260020190915290205481145b1561122557611222600183612a6d565b91505b611230600182612a6d565b9050611166565b5050505092915050565b6000918252600080516020612d8d833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6112816117d1565b6112be5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610891565b61089a81611a50565b6000828152600080516020612d8d8339815191526020818152604080842084805290915282205460ff1661131f576000848152602091825260408082206001600160a01b0386168352909252205460ff169050610847565b5060019392505050565b60008061133583610797565b90506001600160a01b0381166113dc5760405163529051c560e11b81526001600160e01b0319841660048201527f000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca86001600160a01b03169063a520a38a90602401602060405180830381865afa1580156113b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d79190612179565b6113de565b805b9392505050565b7f627d6cbb4eb558f37de3c2ec08b04710e54e06be936a302f087f7bfb80f39ae0805460ff16156114585760405162461bcd60e51b815260206004820152601460248201527f416c726561647920696e697469616c697a65642e0000000000000000000000006044820152606401610891565b805460ff1916600117815561146b611b54565b61147484611b7f565b61147d85611a50565b61148b838361ffff166117e4565b611496600087611998565b6114c17ff94103142c1baabe9ac2b5d1487bf783de9e69cfeea9a72f5c9c94afd7877b8c6000611998565b6114ec7f86d5cf0a6bdc8d859ba3bdc97043337c82a0e609035f378e419298b6a3e00ae66000611998565b505050505050565b60608167ffffffffffffffff81111561150f5761150f612273565b60405190808252806020026020018201604052801561154257816020015b606081526020019060019003908161152d5790505b50905060005b828110156115e2576115b23085858481811061156657611566612a85565b90506020028101906115789190612c49565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b8892505050565b8282815181106115c4576115c4612a85565b602002602001018190525080806115da90612ab2565b915050611548565b5092915050565b60008181527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c60208190526040822054825b8181101561166c576000858152602084815260408083208484526001019091529020546001600160a01b03161561165a57611657600185612a6d565b93505b611665600182612a6d565b905061161b565b50611678846000611241565b1561168b57611688600184612a6d565b92505b5050919050565b60008281527fd0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed66020526040902054600080516020612d8d833981519152906116dc9061093a6118c1565b61080283836119ac565b7fa7d40346e44ca145e94a946aa34a7d4a67245577dc18699a626fe0ffc6ce3281805460609190819061171890612c0e565b80601f016020809104026020016040519081016040528092919081815260200182805461174490612c0e565b80156117915780601f1061176657610100808354040283529160200191611791565b820191906000526020600020905b81548152906001019060200180831161177457829003601f168201915b505050505091505090565b60006001600160e01b0319821663f337402760e01b148061084757506301ffc9a760e01b6001600160e01b0319831614610847565b60006117df816105126118c1565b905090565b7f4aeb3f25cc46659cf4e4966e5c48b11e9400e6e4bfafae7e3dc6cc3fbc858deb6127108211156118495760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b6044820152606401610891565b805475ffffffffffffffffffffffffffffffffffffffffffff1916600160a01b61ffff8416026001600160a01b031916176001600160a01b03841690811782556040518381527fe2497bd806ec41a6e0dd992c29a72efc0ef8fec9092d1978fd4a1e00b2f183049060200160405180910390a2505050565b3360009081527fa140e363058a6cf3ca062c5e378319d7ddd21cedfbdca620f1c65b05028f156c602052604081205460ff1615611905575060131936013560601c90565b503390565b6000828152600080516020612d8d833981519152602081815260408084206001600160a01b03861685529091529091205460ff1661080257611956826001600160a01b03166014611bad565b611961846020611bad565b604051602001611972929190612cb3565b60408051601f198184030181529082905262461bcd60e51b825261089191600401612941565b6119a28282611d49565b6108ec8282611dd4565b6119b68282611e62565b60008281527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c602090815260408083206001600160a01b03851680855260028201808552838620805487526001909301855292852080546001600160a01b031916905584529152555050565b6000610847825490565b600081815260018301602052604081205415156113de565b60006113de8383611ef0565b7fa7d40346e44ca145e94a946aa34a7d4a67245577dc18699a626fe0ffc6ce328180546000908290611a8190612c0e565b80601f0160208091040260200160405190810160405280929190818152602001828054611aad90612c0e565b8015611afa5780601f10611acf57610100808354040283529160200191611afa565b820191906000526020600020905b815481529060010190602001808311611add57829003601f168201915b50508651939450611b159386935060208801925090506120bb565b507fc9c7c3fe08b88b4df9d4d47ef47d2c43d55c025a0ba88ca442580ed9e7348a168184604051611b47929190612d28565b60405180910390a1505050565b611b7d60017fbbf78d3411d42a81effd97bb8c69faae4e77e75cec462245c1001191a0634c6f55565b565b61089a81611f1a565b60606113de8383604051806060016040528060278152602001612dad60279139611fa5565b60606000611bbc836002612d56565b611bc7906002612a6d565b67ffffffffffffffff811115611bdf57611bdf612273565b6040519080825280601f01601f191660200182016040528015611c09576020820181803683370190505b509050600360fc1b81600081518110611c2457611c24612a85565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611c5357611c53612a85565b60200101906001600160f81b031916908160001a9053506000611c77846002612d56565b611c82906001612a6d565b90505b6001811115611cfa576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611cb657611cb6612a85565b1a60f81b828281518110611ccc57611ccc612a85565b60200101906001600160f81b031916908160001a90535060049490941c93611cf381612d75565b9050611c85565b5083156113de5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610891565b6000600080516020612d8d8339815191526000848152602082815260408083206001600160a01b03871684529091529020805460ff191660011790559050611d8f6118c1565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4505050565b60008281527f0c4ba382c0009cf238e4c1ca1a52f51c61e6248a70bdfb34e5ed49d5578a5c0c6020819052604082208054919260019190611e158385612a6d565b909155505060009384526020918252604080852082865260018101845281862080546001600160a01b039096166001600160a01b0319909616861790559385526002909301909152912055565b600080516020612d8d833981519152611e7b838361190a565b6000838152602082815260408083206001600160a01b03861684529091529020805460ff19169055611eab6118c1565b6001600160a01b0316826001600160a01b0316847ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a4505050565b6000826000018281548110611f0757611f07612a85565b9060005260206000200154905092915050565b7fa140e363058a6cf3ca062c5e378319d7ddd21cedfbdca620f1c65b05028f156c60005b8251811015610802576001826000016000858481518110611f6157611f61612a85565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611f9d81612ab2565b915050611f3e565b60606001600160a01b0384163b61200d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610891565b600080856001600160a01b0316856040516120289190612c97565b600060405180830381855af49150503d8060008114612063576040519150601f19603f3d011682016040523d82523d6000602084013e612068565b606091505b5091509150612078828286612082565b9695505050505050565b606083156120915750816113de565b8251156120a15782518084602001fd5b8160405162461bcd60e51b81526004016108919190612941565b8280546120c790612c0e565b90600052602060002090601f0160209004810192826120e9576000855561212f565b82601f1061210257805160ff191683800117855561212f565b8280016001018555821561212f579182015b8281111561212f578251825591602001919060010190612114565b5061213b92915061213f565b5090565b5b8082111561213b5760008155600101612140565b6001600160a01b038116811461089a57600080fd5b805161217481612154565b919050565b60006020828403121561218b57600080fd5b81516113de81612154565b6001600160e01b03198116811461089a57600080fd5b6000602082840312156121be57600080fd5b81356113de81612196565b803561217481612154565b6000806000806000608086880312156121ec57600080fd5b85356121f781612154565b9450602086013561220781612154565b935060408601359250606086013567ffffffffffffffff8082111561222b57600080fd5b818801915088601f83011261223f57600080fd5b81358181111561224e57600080fd5b89602082850101111561226057600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156122ac576122ac612273565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156122db576122db612273565b604052919050565b600067ffffffffffffffff8211156122fd576122fd612273565b50601f01601f191660200190565b600082601f83011261231c57600080fd5b813561232f61232a826122e3565b6122b2565b81815284602083860101111561234457600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561237357600080fd5b813567ffffffffffffffff8082111561238b57600080fd5b908301906060828603121561239f57600080fd5b6123a7612289565b82356123b281612196565b81526020830135828111156123c657600080fd5b6123d28782860161230b565b602083015250604083013592506123e883612154565b6040810192909252509392505050565b6000806040838503121561240b57600080fd5b823561241681612154565b946020939093013593505050565b60006020828403121561243657600080fd5b5035919050565b6000806040838503121561245057600080fd5b82359150602083013561246281612154565b809150509250929050565b60006020828403121561247f57600080fd5b81356113de81612154565b6020808252825182820181905260009190848201906040850190845b818110156124cc5783516001600160e01b031916835292840192918401916001016124a6565b50909695505050505050565b60005b838110156124f35781810151838201526020016124db565b83811115612502576000848401525b50505050565b600081518084526125208160208601602086016124d8565b601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156125bc57888303603f19018552815180516001600160e01b03191684528781015160608986018190529061259582870182612508565b928901516001600160a01b031695890195909552509487019492509086019060010161255b565b509098975050505050505050565b600080604083850312156125dd57600080fd5b50508035926020909101359150565b6000602082840312156125fe57600080fd5b813567ffffffffffffffff81111561261557600080fd5b6126218482850161230b565b949350505050565b600067ffffffffffffffff82111561264357612643612273565b5060051b60200190565b803561ffff8116811461217457600080fd5b600080600080600060a0868803121561267757600080fd5b853561268281612154565b945060208681013567ffffffffffffffff808211156126a057600080fd5b6126ac8a838b0161230b565b965060408901359150808211156126c257600080fd5b508701601f810189136126d457600080fd5b80356126e261232a82612629565b81815260059190911b8201830190838101908b83111561270157600080fd5b928401925b8284101561272857833561271981612154565b82529284019290840190612706565b809750505050505061273c606087016121c9565b915061274a6080870161264d565b90509295509295909350565b6000806020838503121561276957600080fd5b823567ffffffffffffffff8082111561278157600080fd5b818501915085601f83011261279557600080fd5b8135818111156127a457600080fd5b8660208260051b85010111156127b957600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561282057603f1988860301845261280e858351612508565b945092850192908501906001016127f2565b5092979650505050505050565b600082601f83011261283e57600080fd5b8135602061284e61232a83612629565b82815260059290921b8401810191818101908684111561286d57600080fd5b8286015b848110156128885780358352918301918301612871565b509695505050505050565b600080600080600060a086880312156128ab57600080fd5b85356128b681612154565b945060208601356128c681612154565b9350604086013567ffffffffffffffff808211156128e357600080fd5b6128ef89838a0161282d565b9450606088013591508082111561290557600080fd5b61291189838a0161282d565b9350608088013591508082111561292757600080fd5b506129348882890161230b565b9150509295509295909350565b6020815260006113de6020830184612508565b600080600080600060a0868803121561296c57600080fd5b853561297781612154565b9450602086013561298781612154565b93506040860135925060608601359150608086013567ffffffffffffffff8111156129b157600080fd5b6129348882890161230b565b600060208083850312156129d057600080fd5b825167ffffffffffffffff8111156129e757600080fd5b8301601f810185136129f857600080fd5b8051612a0661232a82612629565b81815260059190911b82018301908381019087831115612a2557600080fd5b928401925b82841015612a4c578351612a3d81612196565b82529284019290840190612a2a565b979650505050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115612a8057612a80612a57565b500190565b634e487b7160e01b600052603260045260246000fd5b600082821015612aad57612aad612a57565b500390565b6000600019821415612ac657612ac6612a57565b5060010190565b60006020808385031215612ae057600080fd5b825167ffffffffffffffff80821115612af857600080fd5b818501915085601f830112612b0c57600080fd5b8151612b1a61232a82612629565b81815260059190911b83018401908481019088831115612b3957600080fd5b8585015b83811015612c0157805185811115612b5457600080fd5b86016060818c03601f19011215612b6b5760008081fd5b612b73612289565b88820151612b8081612196565b815260408281015188811115612b965760008081fd5b8301603f81018e13612ba85760008081fd5b8a810151612bb861232a826122e3565b8181528f84838501011115612bcd5760008081fd5b612bdc828e83018686016124d8565b848d015250612bef905060608401612169565b90820152845250918601918601612b3d565b5098975050505050505050565b600181811c90821680612c2257607f821691505b60208210811415612c4357634e487b7160e01b600052602260045260246000fd5b50919050565b6000808335601e19843603018112612c6057600080fd5b83018035915067ffffffffffffffff821115612c7b57600080fd5b602001915036819003821315612c9057600080fd5b9250929050565b60008251612ca98184602087016124d8565b9190910192915050565b7f5065726d697373696f6e733a206163636f756e74200000000000000000000000815260008351612ceb8160158501602088016124d8565b7001034b99036b4b9b9b4b733903937b6329607d1b6015918401918201528351612d1c8160268401602088016124d8565b01602601949350505050565b604081526000612d3b6040830185612508565b8281036020840152612d4d8185612508565b95945050505050565b6000816000190483118215151615612d7057612d70612a57565b500290565b600081612d8457612d84612a57565b50600019019056fed0ebebe8e6445c62babf8fef767eb39f1002bb957bb5b83258275a4e46428ed5416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220cd27cecfe1b199c4905b4636edd776cccf600df4d52069156c9ded42258292df64736f6c634300080c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca8
-----Decoded View---------------
Arg [0] : _pluginMap (address): 0xFeA560DB29aFE75F24e1da8bb9db35a585577Ca8
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000fea560db29afe75f24e1da8bb9db35a585577ca8
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.