Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ZoraCreator1155Impl
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 50 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ERC1155Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol"; import {UUPSUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol"; import {IERC1155MetadataURIUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1155MetadataURIUpgradeable.sol"; import {IERC165Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol"; import {IProtocolRewards} from "@zoralabs/protocol-rewards/src/interfaces/IProtocolRewards.sol"; import {ERC1155Rewards} from "@zoralabs/protocol-rewards/src/abstract/ERC1155/ERC1155Rewards.sol"; import {ERC1155RewardsStorageV1} from "@zoralabs/protocol-rewards/src/abstract/ERC1155/ERC1155RewardsStorageV1.sol"; import {IZoraCreator1155} from "../interfaces/IZoraCreator1155.sol"; import {IZoraCreator1155Initializer} from "../interfaces/IZoraCreator1155Initializer.sol"; import {ReentrancyGuardUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol"; import {UUPSUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol"; import {MathUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/math/MathUpgradeable.sol"; import {ContractVersionBase} from "../version/ContractVersionBase.sol"; import {CreatorPermissionControl} from "../permissions/CreatorPermissionControl.sol"; import {CreatorRendererControl} from "../renderer/CreatorRendererControl.sol"; import {CreatorRoyaltiesControl} from "../royalties/CreatorRoyaltiesControl.sol"; import {ICreatorCommands} from "../interfaces/ICreatorCommands.sol"; import {IMinter1155} from "../interfaces/IMinter1155.sol"; import {IRenderer1155} from "../interfaces/IRenderer1155.sol"; import {ITransferHookReceiver} from "../interfaces/ITransferHookReceiver.sol"; import {IUpgradeGate} from "../interfaces/IUpgradeGate.sol"; import {IZoraCreator1155} from "../interfaces/IZoraCreator1155.sol"; import {LegacyNamingControl} from "../legacy-naming/LegacyNamingControl.sol"; import {PublicMulticall} from "../utils/PublicMulticall.sol"; import {SharedBaseConstants} from "../shared/SharedBaseConstants.sol"; import {TransferHelperUtils} from "../utils/TransferHelperUtils.sol"; import {ZoraCreator1155StorageV1} from "./ZoraCreator1155StorageV1.sol"; import {IZoraCreator1155Errors} from "../interfaces/IZoraCreator1155Errors.sol"; import {ERC1155DelegationStorageV1} from "../delegation/ERC1155DelegationStorageV1.sol"; import {IZoraCreator1155DelegatedCreation} from "../interfaces/IZoraCreator1155DelegatedCreation.sol"; import {IMintWithRewardsRecipients} from "../interfaces/IMintWithRewardsRecipients.sol"; import {ZoraCreator1155Attribution, DecodedCreatorAttribution, PremintTokenSetup, PremintConfig, PremintConfigV2, DelegatedTokenCreation, DelegatedTokenSetup} from "../delegation/ZoraCreator1155Attribution.sol"; /// Imagine. Mint. Enjoy. /// @title ZoraCreator1155Impl /// @notice The core implementation contract for a creator's 1155 token /// @author @iainnash / @tbtstl contract ZoraCreator1155Impl is IZoraCreator1155, IZoraCreator1155Initializer, ContractVersionBase, ReentrancyGuardUpgradeable, PublicMulticall, ERC1155Upgradeable, UUPSUpgradeable, CreatorRendererControl, LegacyNamingControl, ZoraCreator1155StorageV1, CreatorPermissionControl, CreatorRoyaltiesControl, ERC1155Rewards, ERC1155RewardsStorageV1, ERC1155DelegationStorageV1 { /// @notice This user role allows for any action to be performed uint256 public constant PERMISSION_BIT_ADMIN = 2 ** 1; /// @notice This user role allows for only mint actions to be performed uint256 public constant PERMISSION_BIT_MINTER = 2 ** 2; /// @notice This user role allows for only managing sales configurations uint256 public constant PERMISSION_BIT_SALES = 2 ** 3; /// @notice This user role allows for only managing metadata configuration uint256 public constant PERMISSION_BIT_METADATA = 2 ** 4; /// @notice This user role allows for only withdrawing funds and setting funds withdraw address uint256 public constant PERMISSION_BIT_FUNDS_MANAGER = 2 ** 5; /// @notice Factory contract IUpgradeGate internal immutable upgradeGate; constructor(address _mintFeeRecipient, address _upgradeGate, address _protocolRewards) ERC1155Rewards(_protocolRewards, _mintFeeRecipient) initializer { upgradeGate = IUpgradeGate(_upgradeGate); } /// @notice Initializes the contract /// @param contractName the legacy on-chain contract name /// @param newContractURI The contract URI /// @param defaultRoyaltyConfiguration The default royalty configuration /// @param defaultAdmin The default admin to manage the token /// @param setupActions The setup actions to run, if any function initialize( string memory contractName, string memory newContractURI, RoyaltyConfiguration memory defaultRoyaltyConfiguration, address payable defaultAdmin, bytes[] calldata setupActions ) external nonReentrant initializer { // We are not initalizing the OZ 1155 implementation // to save contract storage space and runtime // since the only thing affected here is the uri. // __ERC1155_init(""); // Setup uups __UUPSUpgradeable_init(); // Setup re-entracy guard __ReentrancyGuard_init(); // Setup contract-default token ID _setupDefaultToken(defaultAdmin, newContractURI, defaultRoyaltyConfiguration); // Set owner to default admin _setOwner(defaultAdmin); _setFundsRecipient(defaultAdmin); _setName(contractName); // Run Setup actions if (setupActions.length > 0) { // Temporarily make sender admin _addPermission(CONTRACT_BASE_ID, msg.sender, PERMISSION_BIT_ADMIN); // Make calls multicall(setupActions); // Remove admin _removePermission(CONTRACT_BASE_ID, msg.sender, PERMISSION_BIT_ADMIN); } } /// @notice sets up the global configuration for the 1155 contract /// @param newContractURI The contract URI /// @param defaultRoyaltyConfiguration The default royalty configuration function _setupDefaultToken(address defaultAdmin, string memory newContractURI, RoyaltyConfiguration memory defaultRoyaltyConfiguration) internal { // Add admin permission to default admin to manage contract _addPermission(CONTRACT_BASE_ID, defaultAdmin, PERMISSION_BIT_ADMIN); // Mint token ID 0 / don't allow any user mints _setupNewToken(newContractURI, 0); // Update default royalties _updateRoyalties(CONTRACT_BASE_ID, defaultRoyaltyConfiguration); } /// @notice Updates the royalty configuration for a token /// @param tokenId The token ID to update /// @param newConfiguration The new royalty configuration function updateRoyaltiesForToken( uint256 tokenId, RoyaltyConfiguration memory newConfiguration ) external onlyAdminOrRole(tokenId, PERMISSION_BIT_FUNDS_MANAGER) { _updateRoyalties(tokenId, newConfiguration); } /// @notice remove this function from openzeppelin impl /// @dev This makes this internal function a no-op function _setURI(string memory newuri) internal virtual override {} /// @notice This gets the next token in line to be minted when minting linearly (default behavior) and updates the counter function _getAndUpdateNextTokenId() internal returns (uint256) { unchecked { return nextTokenId++; } } /// @notice Ensure that the next token ID is correct /// @dev This reverts if the invariant doesn't match. This is used for multil token id assumptions /// @param lastTokenId The last token ID function assumeLastTokenIdMatches(uint256 lastTokenId) external view { unchecked { if (nextTokenId - 1 != lastTokenId) { revert TokenIdMismatch(lastTokenId, nextTokenId - 1); } } } /// @notice Checks if a user either has a role for a token or if they are the admin /// @dev This is an internal function that is called by the external getter and internal functions /// @param user The user to check /// @param tokenId The token ID to check /// @param role The role to check /// @return true or false if the permission exists for the user given the token id function _isAdminOrRole(address user, uint256 tokenId, uint256 role) internal view returns (bool) { return _hasAnyPermission(tokenId, user, PERMISSION_BIT_ADMIN | role); } /// @notice Checks if a user either has a role for a token or if they are the admin /// @param user The user to check /// @param tokenId The token ID to check /// @param role The role to check /// @return true or false if the permission exists for the user given the token id function isAdminOrRole(address user, uint256 tokenId, uint256 role) external view returns (bool) { return _isAdminOrRole(user, tokenId, role); } /// @notice Checks if the user is an admin for the given tokenId /// @dev This function reverts if the permission does not exist for the given user and tokenId /// @param user user to check /// @param tokenId tokenId to check /// @param role role to check for admin function _requireAdminOrRole(address user, uint256 tokenId, uint256 role) internal view { if (!(_hasAnyPermission(tokenId, user, PERMISSION_BIT_ADMIN | role) || _hasAnyPermission(CONTRACT_BASE_ID, user, PERMISSION_BIT_ADMIN | role))) { revert UserMissingRoleForToken(user, tokenId, role); } } /// @notice Checks if the user is an admin /// @dev This reverts if the user is not an admin for the given token id or contract /// @param user user to check /// @param tokenId tokenId to check function _requireAdmin(address user, uint256 tokenId) internal view { if (!(_hasAnyPermission(tokenId, user, PERMISSION_BIT_ADMIN) || _hasAnyPermission(CONTRACT_BASE_ID, user, PERMISSION_BIT_ADMIN))) { revert UserMissingRoleForToken(user, tokenId, PERMISSION_BIT_ADMIN); } } /// @notice Modifier checking if the user is an admin or has a role /// @dev This reverts if the msg.sender is not an admin for the given token id or contract /// @param tokenId tokenId to check /// @param role role to check modifier onlyAdminOrRole(uint256 tokenId, uint256 role) { _requireAdminOrRole(msg.sender, tokenId, role); _; } /// @notice Modifier checking if the user is an admin /// @dev This reverts if the msg.sender is not an admin for the given token id or contract /// @param tokenId tokenId to check modifier onlyAdmin(uint256 tokenId) { _requireAdmin(msg.sender, tokenId); _; } /// @notice Modifier checking if the requested quantity of tokens can be minted for the tokenId /// @dev This reverts if the number that can be minted is exceeded /// @param tokenId token id to check available allowed quantity /// @param quantity requested to be minted modifier canMintQuantity(uint256 tokenId, uint256 quantity) { _requireCanMintQuantity(tokenId, quantity); _; } /// @notice Only from approved address for burn /// @param from address that the tokens will be burned from, validate that this is msg.sender or that msg.sender is approved modifier onlyFromApprovedForBurn(address from) { if (from != msg.sender && !isApprovedForAll(from, msg.sender)) { revert Burn_NotOwnerOrApproved(msg.sender, from); } _; } /// @notice Checks if a user can mint a quantity of a token /// @dev Reverts if the mint exceeds the allowed quantity (or if the token does not exist) /// @param tokenId The token ID to check /// @param quantity The quantity of tokens to mint to check function _requireCanMintQuantity(uint256 tokenId, uint256 quantity) internal view { TokenData storage tokenInformation = tokens[tokenId]; if (tokenInformation.totalMinted + quantity > tokenInformation.maxSupply) { revert CannotMintMoreTokens(tokenId, quantity, tokenInformation.totalMinted, tokenInformation.maxSupply); } } /// @notice Set up a new token /// @param newURI The URI for the token /// @param maxSupply The maximum supply of the token function setupNewToken( string calldata newURI, uint256 maxSupply ) public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_MINTER) nonReentrant returns (uint256) { uint256 tokenId = _setupNewTokenAndPermission(newURI, maxSupply, msg.sender, PERMISSION_BIT_ADMIN); return tokenId; } /// @notice Set up a new token with a create referral /// @param newURI The URI for the token /// @param maxSupply The maximum supply of the token /// @param createReferral The address of the create referral function setupNewTokenWithCreateReferral( string calldata newURI, uint256 maxSupply, address createReferral ) public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_MINTER) nonReentrant returns (uint256) { uint256 tokenId = _setupNewTokenAndPermission(newURI, maxSupply, msg.sender, PERMISSION_BIT_ADMIN); _setCreateReferral(tokenId, createReferral); return tokenId; } function _setupNewTokenAndPermission(string memory newURI, uint256 maxSupply, address user, uint256 permission) internal returns (uint256) { uint256 tokenId = _setupNewToken(newURI, maxSupply); _addPermission(tokenId, user, permission); if (bytes(newURI).length > 0) { emit URI(newURI, tokenId); } emit SetupNewToken(tokenId, user, newURI, maxSupply); return tokenId; } /// @notice Update the token URI for a token /// @param tokenId The token ID to update the URI for /// @param _newURI The new URI function updateTokenURI(uint256 tokenId, string memory _newURI) external onlyAdminOrRole(tokenId, PERMISSION_BIT_METADATA) { if (tokenId == CONTRACT_BASE_ID) { revert(); } emit URI(_newURI, tokenId); tokens[tokenId].uri = _newURI; } /// @notice Update the global contract metadata /// @param _newURI The new contract URI /// @param _newName The new contract name function updateContractMetadata(string memory _newURI, string memory _newName) external onlyAdminOrRole(0, PERMISSION_BIT_METADATA) { tokens[CONTRACT_BASE_ID].uri = _newURI; _setName(_newName); emit ContractMetadataUpdated(msg.sender, _newURI, _newName); } function _setupNewToken(string memory newURI, uint256 maxSupply) internal returns (uint256 tokenId) { tokenId = _getAndUpdateNextTokenId(); TokenData memory tokenData = TokenData({uri: newURI, maxSupply: maxSupply, totalMinted: 0}); tokens[tokenId] = tokenData; emit UpdatedToken(msg.sender, tokenId, tokenData); } /// @notice Add a role to a user for a token /// @param tokenId The token ID to add the role to /// @param user The user to add the role to /// @param permissionBits The permission bit to add function addPermission(uint256 tokenId, address user, uint256 permissionBits) external onlyAdmin(tokenId) { _addPermission(tokenId, user, permissionBits); } /// @notice Remove a role from a user for a token /// @param tokenId The token ID to remove the role from /// @param user The user to remove the role from /// @param permissionBits The permission bit to remove function removePermission(uint256 tokenId, address user, uint256 permissionBits) external onlyAdmin(tokenId) { _removePermission(tokenId, user, permissionBits); // Clear owner field if (tokenId == CONTRACT_BASE_ID && user == config.owner && !_hasAnyPermission(CONTRACT_BASE_ID, user, PERMISSION_BIT_ADMIN)) { _setOwner(address(0)); } } /// @notice Set the owner of the contract /// @param newOwner The new owner of the contract function setOwner(address newOwner) external onlyAdmin(CONTRACT_BASE_ID) { if (!_hasAnyPermission(CONTRACT_BASE_ID, newOwner, PERMISSION_BIT_ADMIN)) { revert NewOwnerNeedsToBeAdmin(); } // Update owner field _setOwner(newOwner); } /// @notice Getter for the owner singleton of the contract for outside interfaces /// @return the owner of the contract singleton for compat. function owner() external view returns (address) { return config.owner; } /// @notice Mint a token to a user as the admin or minter /// @param recipient The recipient of the token /// @param tokenId The token ID to mint /// @param quantity The quantity of tokens to mint /// @param data The data to pass to the onERC1155Received function function adminMint( address recipient, uint256 tokenId, uint256 quantity, bytes memory data ) external nonReentrant onlyAdminOrRole(tokenId, PERMISSION_BIT_MINTER) { // Mint the specified tokens _mint(recipient, tokenId, quantity, data); } /// @notice Batch mint tokens to a user as the admin or minter /// @param recipient The recipient of the tokens /// @param tokenIds The token IDs to mint /// @param quantities The quantities of tokens to mint /// @param data The data to pass to the onERC1155BatchReceived function function adminMintBatch(address recipient, uint256[] memory tokenIds, uint256[] memory quantities, bytes memory data) external nonReentrant { bool isGlobalAdminOrMinter = _isAdminOrRole(msg.sender, CONTRACT_BASE_ID, PERMISSION_BIT_MINTER); for (uint256 i = 0; i < tokenIds.length; ++i) { if (!isGlobalAdminOrMinter) { _requireAdminOrRole(msg.sender, tokenIds[i], PERMISSION_BIT_MINTER); } } _mintBatch(recipient, tokenIds, quantities, data); } /// @custom:deprecated mintWithRewards has been deprecated use mint instead /// @notice Mint tokens and payout rewards given a minter contract, minter arguments, and a mint referral /// @param minter The minter contract to use /// @param tokenId The token ID to mint /// @param quantity The quantity of tokens to mint /// @param minterArguments The arguments to pass to the minter /// @param mintReferral The referrer of the mint function mintWithRewards( IMinter1155 minter, uint256 tokenId, uint256 quantity, bytes calldata minterArguments, address mintReferral ) external payable nonReentrant { address[] memory rewardsRecipients = new address[](1); rewardsRecipients[0] = mintReferral; return _mint(minter, tokenId, quantity, rewardsRecipients, minterArguments); } /// @notice Mint tokens and payout rewards given a minter contract, minter arguments, and rewards arguments /// @param minter The minter contract to use /// @param tokenId The token ID to mint /// @param quantity The quantity of tokens to mint /// @param rewardsRecipients The addresses of rewards arguments - rewardsRecipients[0] = mintReferral, rewardsRecipients[1] = platformReferral /// @param minterArguments The arguments to pass to the minter function mint( IMinter1155 minter, uint256 tokenId, uint256 quantity, address[] calldata rewardsRecipients, bytes calldata minterArguments ) external payable nonReentrant { _mint(minter, tokenId, quantity, rewardsRecipients, minterArguments); } function _mint(IMinter1155 minter, uint256 tokenId, uint256 quantity, address[] memory rewardsRecipients, bytes calldata minterArguments) private { // Require admin from the minter to mint _requireAdminOrRole(address(minter), tokenId, PERMISSION_BIT_MINTER); address mintReferral = address(0); if (rewardsRecipients.length > 0) { mintReferral = rewardsRecipients[0]; } // Get value sent and handle mint rewards uint256 ethValueSent = _handleRewardsAndGetValueSent( msg.value, quantity, getCreatorRewardRecipient(tokenId), createReferrals[tokenId], mintReferral, firstMinters[tokenId] ); // Execute commands returned from minter _executeCommands(minter.requestMint(msg.sender, tokenId, quantity, ethValueSent, minterArguments).commands, ethValueSent, tokenId); emit Purchased(msg.sender, address(minter), tokenId, quantity, msg.value); } function mintFee() external pure returns (uint256) { return TOTAL_REWARD_PER_MINT; } /// @notice Get the creator reward recipient address for a specific token. /// @param tokenId The token id to get the creator reward recipient for /// @dev Returns the royalty recipient address for the token if set; otherwise uses the fundsRecipient. /// If both are not set, this contract will be set as the recipient, and an account with /// `PERMISSION_BIT_FUNDS_MANAGER` will be able to withdraw via the `withdrawFor` function. function getCreatorRewardRecipient(uint256 tokenId) public view returns (address) { address royaltyRecipient = getRoyalties(tokenId).royaltyRecipient; if (royaltyRecipient != address(0)) { return royaltyRecipient; } if (config.fundsRecipient != address(0)) { return config.fundsRecipient; } return address(this); } /// @notice Set a metadata renderer for a token /// @param tokenId The token ID to set the renderer for /// @param renderer The renderer to set function setTokenMetadataRenderer(uint256 tokenId, IRenderer1155 renderer) external nonReentrant onlyAdminOrRole(tokenId, PERMISSION_BIT_METADATA) { _setRenderer(tokenId, renderer); if (tokenId == 0) { emit ContractRendererUpdated(renderer); } else { // We don't know the uri from the renderer but can emit a notification to the indexer here emit URI("", tokenId); } } /// Execute Minter Commands /// /// @notice Internal functions to execute commands returned by the minter /// @param commands list of command structs /// @param ethValueSent the ethereum value sent in the mint transaction into the contract /// @param tokenId the token id the user requested to mint (0 if the token id is set by the minter itself across the whole contract) function _executeCommands(ICreatorCommands.Command[] memory commands, uint256 ethValueSent, uint256 tokenId) internal { for (uint256 i = 0; i < commands.length; ++i) { ICreatorCommands.CreatorActions method = commands[i].method; if (method == ICreatorCommands.CreatorActions.SEND_ETH) { (address recipient, uint256 amount) = abi.decode(commands[i].args, (address, uint256)); if (ethValueSent > amount) { revert Mint_InsolventSaleTransfer(); } if (!TransferHelperUtils.safeSendETH(recipient, amount, TransferHelperUtils.FUNDS_SEND_NORMAL_GAS_LIMIT)) { revert Mint_ValueTransferFail(); } } else if (method == ICreatorCommands.CreatorActions.MINT) { (address recipient, uint256 mintTokenId, uint256 quantity) = abi.decode(commands[i].args, (address, uint256, uint256)); if (tokenId != 0 && mintTokenId != tokenId) { revert Mint_TokenIDMintNotAllowed(); } _mint(recipient, tokenId, quantity, ""); } else { // no-op } } } /// @notice Token info getter /// @param tokenId token id to get info for /// @return TokenData struct returned function getTokenInfo(uint256 tokenId) external view returns (TokenData memory) { return tokens[tokenId]; } /// @notice Proxy setter for sale contracts (only callable by SALES permission or admin) /// @param tokenId The token ID to call the sale contract with /// @param salesConfig The sales config contract to call /// @param data The data to pass to the sales config contract function callSale(uint256 tokenId, IMinter1155 salesConfig, bytes calldata data) external onlyAdminOrRole(tokenId, PERMISSION_BIT_SALES) { _requireAdminOrRole(address(salesConfig), tokenId, PERMISSION_BIT_MINTER); if (!salesConfig.supportsInterface(type(IMinter1155).interfaceId)) { revert Sale_CannotCallNonSalesContract(address(salesConfig)); } // Get the token id encoded in the calldata for the sales config // Assume that it is the first 32 bytes following the function selector uint256 encodedTokenId = uint256(bytes32(data[4:36])); // Ensure the encoded token id matches the passed token id if (encodedTokenId != tokenId) { revert IZoraCreator1155Errors.Call_TokenIdMismatch(); } (bool success, bytes memory why) = address(salesConfig).call(data); if (!success) { revert CallFailed(why); } } /// @notice Proxy setter for renderer contracts (only callable by METADATA permission or admin) /// @param tokenId The token ID to call the renderer contract with /// @param data The data to pass to the renderer contract function callRenderer(uint256 tokenId, bytes memory data) external onlyAdminOrRole(tokenId, PERMISSION_BIT_METADATA) { // We assume any renderers set are checked for EIP165 signature during write stage. (bool success, bytes memory why) = address(getCustomRenderer(tokenId)).call(data); if (!success) { revert CallFailed(why); } } /// @notice Returns true if the contract implements the interface defined by interfaceId /// @param interfaceId The interface to check for /// @return if the interfaceId is marked as supported function supportsInterface( bytes4 interfaceId ) public view virtual override(CreatorRoyaltiesControl, ERC1155Upgradeable, IERC165Upgradeable) returns (bool) { return super.supportsInterface(interfaceId) || interfaceId == type(IZoraCreator1155).interfaceId || ERC1155Upgradeable.supportsInterface(interfaceId) || interfaceId == type(IZoraCreator1155DelegatedCreation).interfaceId || interfaceId == type(IMintWithRewardsRecipients).interfaceId; } /// Generic 1155 function overrides /// /// @notice Mint function that 1) checks quantity 2) keeps track of allowed tokens /// @param to to mint to /// @param id token id to mint /// @param amount of tokens to mint /// @param data as specified by 1155 standard function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual override { _requireCanMintQuantity(id, amount); tokens[id].totalMinted += amount; super._mint(to, id, amount, data); } /// @notice Mint batch function that 1) checks quantity and 2) keeps track of allowed tokens /// @param to to mint to /// @param ids token ids to mint /// @param amounts of tokens to mint /// @param data as specified by 1155 standard function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override { uint256 numTokens = ids.length; for (uint256 i; i < numTokens; ++i) { _requireCanMintQuantity(ids[i], amounts[i]); tokens[ids[i]].totalMinted += amounts[i]; } super._mintBatch(to, ids, amounts, data); } /// @notice Burns a batch of tokens /// @dev Only the current owner is allowed to burn /// @param from the user to burn from /// @param tokenIds The token ID to burn /// @param amounts The amount of tokens to burn function burnBatch(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external { if (from != msg.sender && !isApprovedForAll(from, msg.sender)) { revert Burn_NotOwnerOrApproved(msg.sender, from); } _burnBatch(from, tokenIds, amounts); } function setTransferHook(ITransferHookReceiver transferHook) external onlyAdmin(CONTRACT_BASE_ID) { if (address(transferHook) != address(0)) { if (!transferHook.supportsInterface(type(ITransferHookReceiver).interfaceId)) { revert Config_TransferHookNotSupported(address(transferHook)); } } config.transferHook = transferHook; emit ConfigUpdated(msg.sender, ConfigUpdate.TRANSFER_HOOK, config); } /// @notice Hook before token transfer that checks for a transfer hook integration /// @param operator operator moving the tokens /// @param from from address /// @param to to address /// @param id token id to move /// @param amount amount of token /// @param data data of token function _beforeTokenTransfer(address operator, address from, address to, uint256 id, uint256 amount, bytes memory data) internal override { super._beforeTokenTransfer(operator, from, to, id, amount, data); if (address(config.transferHook) != address(0)) { config.transferHook.onTokenTransfer(address(this), operator, from, to, id, amount, data); } } /// @notice Hook before token transfer that checks for a transfer hook integration /// @param operator operator moving the tokens /// @param from from address /// @param to to address /// @param ids token ids to move /// @param amounts amounts of tokens /// @param data data of tokens function _beforeBatchTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal override { super._beforeBatchTokenTransfer(operator, from, to, ids, amounts, data); if (address(config.transferHook) != address(0)) { config.transferHook.onTokenTransferBatch({target: address(this), operator: operator, from: from, to: to, ids: ids, amounts: amounts, data: data}); } } /// @notice Returns the URI for the contract function contractURI() external view returns (string memory) { IRenderer1155 customRenderer = getCustomRenderer(CONTRACT_BASE_ID); if (address(customRenderer) != address(0)) { return customRenderer.contractURI(); } return uri(0); } /// @notice Returns the URI for a token /// @param tokenId The token ID to return the URI for function uri(uint256 tokenId) public view override(ERC1155Upgradeable, IERC1155MetadataURIUpgradeable) returns (string memory) { if (bytes(tokens[tokenId].uri).length > 0) { return tokens[tokenId].uri; } return _render(tokenId); } /// @notice Internal setter for contract admin with no access checks /// @param newOwner new owner address function _setOwner(address newOwner) internal { address lastOwner = config.owner; config.owner = newOwner; emit OwnershipTransferred(lastOwner, newOwner); emit ConfigUpdated(msg.sender, ConfigUpdate.OWNER, config); } /// @notice Set funds recipient address /// @param fundsRecipient new funds recipient address function setFundsRecipient(address payable fundsRecipient) external onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_FUNDS_MANAGER) { _setFundsRecipient(fundsRecipient); } /// @notice Internal no-checks set funds recipient address /// @param fundsRecipient new funds recipient address function _setFundsRecipient(address payable fundsRecipient) internal { config.fundsRecipient = fundsRecipient; emit ConfigUpdated(msg.sender, ConfigUpdate.FUNDS_RECIPIENT, config); } /// @notice Allows the create referral to update the address that can claim their rewards function updateCreateReferral(uint256 tokenId, address recipient) external { if (msg.sender != createReferrals[tokenId]) revert ONLY_CREATE_REFERRAL(); _setCreateReferral(tokenId, recipient); } function _setCreateReferral(uint256 tokenId, address recipient) internal { createReferrals[tokenId] = recipient; } /// @notice Withdraws all ETH from the contract to the funds recipient address function withdraw() public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_FUNDS_MANAGER) { uint256 contractValue = address(this).balance; if (!TransferHelperUtils.safeSendETH(config.fundsRecipient, contractValue, TransferHelperUtils.FUNDS_SEND_NORMAL_GAS_LIMIT)) { revert ETHWithdrawFailed(config.fundsRecipient, contractValue); } } receive() external payable {} /// /// /// MANAGER UPGRADE /// /// /// /// @notice Ensures the caller is authorized to upgrade the contract /// @dev This function is called in `upgradeTo` & `upgradeToAndCall` /// @param _newImpl The new implementation address function _authorizeUpgrade(address _newImpl) internal view override onlyAdmin(CONTRACT_BASE_ID) { if (!upgradeGate.isRegisteredUpgradePath(_getImplementation(), _newImpl)) { revert(); } } /// @notice Returns the current implementation address function implementation() external view returns (address) { return _getImplementation(); } function supportedPremintSignatureVersions() external pure returns (string[] memory) { return DelegatedTokenCreation.supportedPremintSignatureVersions(); } /// Sets up a new token using a token configuration and a signature created for the token creation parameters. /// The signature must be created by an account with the PERMISSION_BIT_MINTER role on the contract. /// @param premintConfig abi encoded configuration of token to be created /// @param premintVersion version of the premint configuration /// @param signature EIP-712 Signature created on the premintConfig by an account with the PERMISSION_BIT_MINTER role on the contract. /// @param sender original sender of the transaction, used to set the firstMinter function delegateSetupNewToken( bytes memory premintConfig, bytes32 premintVersion, bytes calldata signature, address sender ) external nonReentrant returns (uint256 newTokenId) { (DelegatedTokenSetup memory params, DecodedCreatorAttribution memory attribution, bytes[] memory tokenSetupActions) = DelegatedTokenCreation .decodeAndRecoverDelegatedTokenSetup(premintConfig, premintVersion, signature, address(this), nextTokenId); // if a token has already been created for a premint config with this uid: if (delegatedTokenId[params.uid] != 0) { // return its token id return delegatedTokenId[params.uid]; } // this is what attributes this token to have been created by the original creator emit CreatorAttribution(attribution.structHash, attribution.domainName, attribution.version, attribution.creator, attribution.signature); return _delegateSetupNewToken(params, attribution.creator, tokenSetupActions, sender); } function _delegateSetupNewToken( DelegatedTokenSetup memory params, address creator, bytes[] memory tokenSetupActions, address sender ) internal returns (uint256 newTokenId) { // require that the signer can create new tokens (is a valid creator) _requireAdminOrRole(creator, CONTRACT_BASE_ID, PERMISSION_BIT_MINTER); // create the new token; msg sender will have PERMISSION_BIT_ADMIN on the new token newTokenId = _setupNewTokenAndPermission(params.tokenURI, params.maxSupply, msg.sender, PERMISSION_BIT_ADMIN); _setCreateReferral(newTokenId, params.createReferral); delegatedTokenId[params.uid] = newTokenId; firstMinters[newTokenId] = sender; // then invoke them, calling account should be original msg.sender, which has admin on the new token _multicallInternal(tokenSetupActions); // remove the token creator as admin of the newly created token: _removePermission(newTokenId, msg.sender, PERMISSION_BIT_ADMIN); // grant the token creator as admin of the newly created token _addPermission(newTokenId, creator, PERMISSION_BIT_ADMIN); } }
// SPDX-License-Identifier: MIT // Modifications from OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol): // - Revert strings replaced with custom errors // - Decoupled hooks // - `_beforeTokenTransfer` --> `_beforeTokenTransfer` & `_beforeBatchTokenTransfer` // - `_afterTokenTransfer` --> `_afterTokenTransfer` & `_afterBatchTokenTransfer` // - Minor gas optimizations (eg. array length caching, unchecked loop iteration) pragma solidity ^0.8.0; import "./IERC1155Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; import "./extensions/IERC1155MetadataURIUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; error ERC1155_ADDRESS_ZERO_IS_NOT_A_VALID_OWNER(); error ERC1155_ACCOUNTS_AND_IDS_LENGTH_MISMATCH(); error ERC1155_IDS_AND_AMOUNTS_LENGTH_MISMATCH(); error ERC1155_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED(); error ERC1155_TRANSFER_TO_ZERO_ADDRESS(); error ERC1155_INSUFFICIENT_BALANCE_FOR_TRANSFER(); error ERC1155_MINT_TO_ZERO_ADDRESS(); error ERC1155_BURN_FROM_ZERO_ADDRESS(); error ERC1155_BURN_AMOUNT_EXCEEDS_BALANCE(); error ERC1155_SETTING_APPROVAL_FOR_SELF(); error ERC1155_ERC1155RECEIVER_REJECTED_TOKENS(); error ERC1155_TRANSFER_TO_NON_ERC1155RECEIVER_IMPLEMENTER(); /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable { using AddressUpgradeable for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ function __ERC1155_init(string memory uri_) internal onlyInitializing { __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155Upgradeable).interfaceId || interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { if (account == address(0)) { revert ERC1155_ADDRESS_ZERO_IS_NOT_A_VALID_OWNER(); } return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory batchBalances) { uint256 numAccounts = accounts.length; if (numAccounts != ids.length) { revert ERC1155_ACCOUNTS_AND_IDS_LENGTH_MISMATCH(); } batchBalances = new uint256[](numAccounts); unchecked { for (uint256 i; i < numAccounts; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } } } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { if (from != _msgSender() && !isApprovedForAll(from, _msgSender())) { revert ERC1155_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED(); } _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { if (from != _msgSender() && !isApprovedForAll(from, _msgSender())) { revert ERC1155_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED(); } _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { if (to == address(0)) { revert ERC1155_TRANSFER_TO_ZERO_ADDRESS(); } address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, id, amount, data); uint256 fromBalance = _balances[id][from]; if (fromBalance < amount) { revert ERC1155_INSUFFICIENT_BALANCE_FOR_TRANSFER(); } unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, id, amount, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { uint256 numIds = ids.length; if (numIds != amounts.length) { revert ERC1155_ACCOUNTS_AND_IDS_LENGTH_MISMATCH(); } if (to == address(0)) { revert ERC1155_TRANSFER_TO_ZERO_ADDRESS(); } address operator = _msgSender(); _beforeBatchTokenTransfer(operator, from, to, ids, amounts, data); uint256 id; uint256 amount; uint256 fromBalance; for (uint256 i; i < numIds; ) { id = ids[i]; amount = amounts[i]; fromBalance = _balances[id][from]; if (fromBalance < amount) { revert ERC1155_INSUFFICIENT_BALANCE_FOR_TRANSFER(); } _balances[id][to] += amount; unchecked { _balances[id][from] = fromBalance - amount; ++i; } } emit TransferBatch(operator, from, to, ids, amounts); _afterBatchTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual { if (to == address(0)) { revert ERC1155_MINT_TO_ZERO_ADDRESS(); } address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, id, amount, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, id, amount, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { if (to == address(0)) { revert ERC1155_MINT_TO_ZERO_ADDRESS(); } uint256 numIds = ids.length; if (numIds != amounts.length) { revert ERC1155_IDS_AND_AMOUNTS_LENGTH_MISMATCH(); } address operator = _msgSender(); _beforeBatchTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i; i < numIds; ) { _balances[ids[i]][to] += amounts[i]; unchecked { ++i; } } emit TransferBatch(operator, address(0), to, ids, amounts); _afterBatchTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn(address from, uint256 id, uint256 amount) internal virtual { if (from == address(0)) { revert ERC1155_BURN_FROM_ZERO_ADDRESS(); } address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), id, amount, ""); uint256 fromBalance = _balances[id][from]; if (fromBalance < amount) { revert ERC1155_BURN_AMOUNT_EXCEEDS_BALANCE(); } unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), id, amount, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual { if (from == address(0)) { revert ERC1155_BURN_FROM_ZERO_ADDRESS(); } uint256 numIds = ids.length; if (numIds != amounts.length) { revert ERC1155_IDS_AND_AMOUNTS_LENGTH_MISMATCH(); } address operator = _msgSender(); _beforeBatchTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 id; uint256 amount; uint256 fromBalance; for (uint256 i; i < numIds; ) { id = ids[i]; amount = amounts[i]; fromBalance = _balances[id][from]; if (fromBalance < amount) { revert ERC1155_BURN_AMOUNT_EXCEEDS_BALANCE(); } unchecked { _balances[id][from] = fromBalance - amount; ++i; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterBatchTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (owner == operator) { revert ERC1155_SETTING_APPROVAL_FOR_SELF(); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before a single token transfer. */ function _beforeTokenTransfer( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { } /** * @dev Hook that is called before a batch token transfer. */ function _beforeBatchTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after a single token transfer. */ function _afterTokenTransfer( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual {} /** * @dev Hook that is called after a batch token transfer. */ function _afterBatchTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) { revert ERC1155_ERC1155RECEIVER_REJECTED_TOKENS(); } } catch Error(string memory reason) { revert(reason); } catch { revert ERC1155_TRANSFER_TO_NON_ERC1155RECEIVER_IMPLEMENTER(); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) { revert ERC1155_ERC1155RECEIVER_REJECTED_TOKENS(); } } catch Error(string memory reason) { revert(reason); } catch { revert ERC1155_TRANSFER_TO_NON_ERC1155RECEIVER_IMPLEMENTER(); } } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[47] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.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 ReentrancyGuardUpgradeable is Initializable { // 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; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _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() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; error FUNCTION_MUST_BE_CALLED_THROUGH_DELEGATECALL(); error FUNCTION_MUST_BE_CALLED_THROUGH_ACTIVE_PROXY(); error UUPS_UPGRADEABLE_MUST_NOT_BE_CALLED_THROUGH_DELEGATECALL(); /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { if (address(this) == __self) { revert FUNCTION_MUST_BE_CALLED_THROUGH_DELEGATECALL(); } if (_getImplementation() != __self) { revert FUNCTION_MUST_BE_CALLED_THROUGH_ACTIVE_PROXY(); } _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { if (address(this) != __self) { revert UUPS_UPGRADEABLE_MUST_NOT_BE_CALLED_THROUGH_DELEGATECALL(); } _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeTo(address newImplementation) public virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol";
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// @title IProtocolRewards /// @notice The interface for deposits & withdrawals for Protocol Rewards interface IProtocolRewards { /// @notice Rewards Deposit Event /// @param creator Creator for NFT rewards /// @param createReferral Creator referral /// @param mintReferral Mint referral user /// @param firstMinter First minter reward recipient /// @param zora ZORA recipient /// @param from The caller of the deposit /// @param creatorReward Creator reward amount /// @param createReferralReward Creator referral reward /// @param mintReferralReward Mint referral amount /// @param firstMinterReward First minter reward amount /// @param zoraReward ZORA amount event RewardsDeposit( address indexed creator, address indexed createReferral, address indexed mintReferral, address firstMinter, address zora, address from, uint256 creatorReward, uint256 createReferralReward, uint256 mintReferralReward, uint256 firstMinterReward, uint256 zoraReward ); /// @notice Deposit Event /// @param from From user /// @param to To user (within contract) /// @param reason Optional bytes4 reason for indexing /// @param amount Amount of deposit /// @param comment Optional user comment event Deposit(address indexed from, address indexed to, bytes4 indexed reason, uint256 amount, string comment); /// @notice Withdraw Event /// @param from From user /// @param to To user (within contract) /// @param amount Amount of deposit event Withdraw(address indexed from, address indexed to, uint256 amount); /// @notice Cannot send to address zero error ADDRESS_ZERO(); /// @notice Function argument array length mismatch error ARRAY_LENGTH_MISMATCH(); /// @notice Invalid deposit error INVALID_DEPOSIT(); /// @notice Invalid signature for deposit error INVALID_SIGNATURE(); /// @notice Invalid withdraw error INVALID_WITHDRAW(); /// @notice Signature for withdraw is too old and has expired error SIGNATURE_DEADLINE_EXPIRED(); /// @notice Low-level ETH transfer has failed error TRANSFER_FAILED(); /// @notice Generic function to deposit ETH for a recipient, with an optional comment /// @param to Address to deposit to /// @param to Reason system reason for deposit (used for indexing) /// @param comment Optional comment as reason for deposit function deposit(address to, bytes4 why, string calldata comment) external payable; /// @notice Generic function to deposit ETH for multiple recipients, with an optional comment /// @param recipients recipients to send the amount to, array aligns with amounts /// @param amounts amounts to send to each recipient, array aligns with recipients /// @param reasons optional bytes4 hash for indexing /// @param comment Optional comment to include with mint function depositBatch(address[] calldata recipients, uint256[] calldata amounts, bytes4[] calldata reasons, string calldata comment) external payable; /// @notice Used by Zora ERC-721 & ERC-1155 contracts to deposit protocol rewards /// @param creator Creator for NFT rewards /// @param creatorReward Creator reward amount /// @param createReferral Creator referral /// @param createReferralReward Creator referral reward /// @param mintReferral Mint referral user /// @param mintReferralReward Mint referral amount /// @param firstMinter First minter reward /// @param firstMinterReward First minter reward amount /// @param zora ZORA recipient /// @param zoraReward ZORA amount function depositRewards( address creator, uint256 creatorReward, address createReferral, uint256 createReferralReward, address mintReferral, uint256 mintReferralReward, address firstMinter, uint256 firstMinterReward, address zora, uint256 zoraReward ) external payable; /// @notice Withdraw protocol rewards /// @param to Withdraws from msg.sender to this address /// @param amount amount to withdraw function withdraw(address to, uint256 amount) external; /// @notice Execute a withdraw of protocol rewards via signature /// @param from Withdraw from this address /// @param to Withdraw to this address /// @param amount Amount to withdraw /// @param deadline Deadline for the signature to be valid /// @param v V component of signature /// @param r R component of signature /// @param s S component of signature function withdrawWithSig(address from, address to, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {RewardSplits} from "../RewardSplits.sol"; /// @notice The base logic for handling Zora ERC-1155 protocol rewards /// @dev Used in https://github.com/ourzora/zora-1155-contracts/blob/main/src/nft/ZoraCreator1155Impl.sol abstract contract ERC1155Rewards is RewardSplits { constructor(address _protocolRewards, address _zoraRewardRecipient) payable RewardSplits(_protocolRewards, _zoraRewardRecipient) {} function _handleRewardsAndGetValueSent( uint256 msgValue, uint256 numTokens, address creator, address createReferral, address mintReferral, address firstMinter ) internal returns (uint256) { uint256 totalReward = computeTotalReward(numTokens); // If we have no first minter, first minter should be the creator. if (firstMinter == address(0)) { firstMinter = creator; } if (msgValue < totalReward) { revert INVALID_ETH_AMOUNT(); } else if (msgValue == totalReward) { _depositFreeMintRewards(totalReward, numTokens, creator, createReferral, mintReferral, firstMinter); return 0; } else { _depositPaidMintRewards(totalReward, numTokens, createReferral, mintReferral, firstMinter); unchecked { return msgValue - totalReward; } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; contract ERC1155RewardsStorageV1 { mapping(uint256 => address) public createReferrals; mapping(uint256 => address) public firstMinters; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC165Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol"; import {IERC1155MetadataURIUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1155MetadataURIUpgradeable.sol"; import {IZoraCreator1155TypesV1} from "../nft/IZoraCreator1155TypesV1.sol"; import {IZoraCreator1155Errors} from "./IZoraCreator1155Errors.sol"; import {IRenderer1155} from "../interfaces/IRenderer1155.sol"; import {IMinter1155} from "../interfaces/IMinter1155.sol"; import {IOwnable} from "../interfaces/IOwnable.sol"; import {IVersionedContract} from "./IVersionedContract.sol"; import {ICreatorRoyaltiesControl} from "../interfaces/ICreatorRoyaltiesControl.sol"; import {IZoraCreator1155DelegatedCreation} from "./IZoraCreator1155DelegatedCreation.sol"; import {IMintWithRewardsRecipients} from "./IMintWithRewardsRecipients.sol"; /* ░░░░░░░░░░░░░░ ░░▒▒░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░░░ ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░ OURS TRULY, */ /// @notice Main interface for the ZoraCreator1155 contract /// @author @iainnash / @tbtstl interface IZoraCreator1155 is IZoraCreator1155TypesV1, IZoraCreator1155Errors, IVersionedContract, IOwnable, IERC1155MetadataURIUpgradeable, IZoraCreator1155DelegatedCreation, IMintWithRewardsRecipients { function PERMISSION_BIT_ADMIN() external returns (uint256); /// @notice This user role allows for only mint actions to be performed function PERMISSION_BIT_MINTER() external returns (uint256); /// @notice This user role allows for only managing sales configurations function PERMISSION_BIT_SALES() external returns (uint256); /// @notice This user role allows for only managing metadata configuration function PERMISSION_BIT_METADATA() external returns (uint256); /// @notice This user role allows for only withdrawing funds and setting funds withdraw address function PERMISSION_BIT_FUNDS_MANAGER() external returns (uint256); /// @notice Used to label the configuration update type enum ConfigUpdate { OWNER, FUNDS_RECIPIENT, TRANSFER_HOOK } event ConfigUpdated(address indexed updater, ConfigUpdate indexed updateType, ContractConfig newConfig); event UpdatedToken(address indexed from, uint256 indexed tokenId, TokenData tokenData); event SetupNewToken(uint256 indexed tokenId, address indexed sender, string newURI, uint256 maxSupply); function setOwner(address newOwner) external; function owner() external view returns (address); event ContractRendererUpdated(IRenderer1155 renderer); event ContractMetadataUpdated(address indexed updater, string uri, string name); event Purchased(address indexed sender, address indexed minter, uint256 indexed tokenId, uint256 quantity, uint256 value); /// @notice Mint tokens and payout rewards given a minter contract, minter arguments, and a mint referral /// @param minter The minter contract to use /// @param tokenId The token ID to mint /// @param quantity The quantity of tokens to mint /// @param minterArguments The arguments to pass to the minter /// @param mintReferral The referrer of the mint function mintWithRewards(IMinter1155 minter, uint256 tokenId, uint256 quantity, bytes calldata minterArguments, address mintReferral) external payable; function adminMint(address recipient, uint256 tokenId, uint256 quantity, bytes memory data) external; function adminMintBatch(address recipient, uint256[] memory tokenIds, uint256[] memory quantities, bytes memory data) external; function burnBatch(address user, uint256[] calldata tokenIds, uint256[] calldata amounts) external; /// @notice Contract call to setupNewToken /// @param tokenURI URI for the token /// @param maxSupply maxSupply for the token, set to 0 for open edition function setupNewToken(string memory tokenURI, uint256 maxSupply) external returns (uint256 tokenId); function setupNewTokenWithCreateReferral(string calldata newURI, uint256 maxSupply, address createReferral) external returns (uint256); function getCreatorRewardRecipient(uint256 tokenId) external view returns (address); function updateTokenURI(uint256 tokenId, string memory _newURI) external; function updateContractMetadata(string memory _newURI, string memory _newName) external; // Public interface for `setTokenMetadataRenderer(uint256, address) has been deprecated. function contractURI() external view returns (string memory); function assumeLastTokenIdMatches(uint256 tokenId) external; function updateRoyaltiesForToken(uint256 tokenId, ICreatorRoyaltiesControl.RoyaltyConfiguration memory royaltyConfiguration) external; /// @notice Set funds recipient address /// @param fundsRecipient new funds recipient address function setFundsRecipient(address payable fundsRecipient) external; /// @notice Allows the create referral to update the address that can claim their rewards function updateCreateReferral(uint256 tokenId, address recipient) external; function addPermission(uint256 tokenId, address user, uint256 permissionBits) external; function removePermission(uint256 tokenId, address user, uint256 permissionBits) external; function isAdminOrRole(address user, uint256 tokenId, uint256 role) external view returns (bool); function getTokenInfo(uint256 tokenId) external view returns (TokenData memory); function callRenderer(uint256 tokenId, bytes memory data) external; function callSale(uint256 tokenId, IMinter1155 salesConfig, bytes memory data) external; function mintFee() external view returns (uint256); /// @notice Withdraws all ETH from the contract to the funds recipient address function withdraw() external; /// @notice Returns the current implementation address function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ICreatorRoyaltiesControl} from "../interfaces/ICreatorRoyaltiesControl.sol"; interface IZoraCreator1155Initializer { function initialize( string memory contractName, string memory newContractURI, ICreatorRoyaltiesControl.RoyaltyConfiguration memory defaultRoyaltyConfiguration, address payable defaultAdmin, bytes[] calldata setupActions ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// This file is automatically generated by code; do not manually update // Last updated on 2023-12-14T19:14:19.476Z // SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IVersionedContract} from "../interfaces/IVersionedContract.sol"; /// @title ContractVersionBase /// @notice Base contract for versioning contracts contract ContractVersionBase is IVersionedContract { /// @notice The version of the contract function contractVersion() external pure override returns (string memory) { return "2.7.0"; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {CreatorPermissionStorageV1} from "./CreatorPermissionStorageV1.sol"; import {ICreatorPermissionControl} from "../interfaces/ICreatorPermissionControl.sol"; /// Imagine. Mint. Enjoy. /// @author @iainnash / @tbtstl contract CreatorPermissionControl is CreatorPermissionStorageV1, ICreatorPermissionControl { /// @notice Check if the user has any of the given permissions /// @dev if multiple permissions are passed in this checks for any one of those permissions /// @return true or false if any of the passed in permissions apply function _hasAnyPermission(uint256 tokenId, address user, uint256 permissionBits) internal view returns (bool) { // Does a bitwise and and checks if any of those permissions match return permissions[tokenId][user] & permissionBits > 0; } /// @notice addPermission – internal function to add a set of permission bits to a user /// @param tokenId token id to add the permission to (0 indicates contract-wide add) /// @param user user to update permissions for /// @param permissionBits bits to add permissions to function _addPermission(uint256 tokenId, address user, uint256 permissionBits) internal { uint256 tokenPermissions = permissions[tokenId][user]; tokenPermissions |= permissionBits; permissions[tokenId][user] = tokenPermissions; emit UpdatedPermissions(tokenId, user, tokenPermissions); } /// @notice _clearPermission clear permissions for user /// @param tokenId token id to clear permission from (0 indicates contract-wide action) function _clearPermissions(uint256 tokenId, address user) internal { permissions[tokenId][user] = 0; emit UpdatedPermissions(tokenId, user, 0); } /// @notice _removePermission removes permissions for user /// @param tokenId token id to clear permission from (0 indicates contract-wide action) /// @param user user to manage permissions for /// @param permissionBits set of permission bits to remove function _removePermission(uint256 tokenId, address user, uint256 permissionBits) internal { uint256 tokenPermissions = permissions[tokenId][user]; tokenPermissions &= ~permissionBits; permissions[tokenId][user] = tokenPermissions; emit UpdatedPermissions(tokenId, user, tokenPermissions); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {CreatorRendererStorageV1} from "./CreatorRendererStorageV1.sol"; import {IRenderer1155} from "../interfaces/IRenderer1155.sol"; import {ITransferHookReceiver} from "../interfaces/ITransferHookReceiver.sol"; import {SharedBaseConstants} from "../shared/SharedBaseConstants.sol"; /// @title CreatorRendererControl /// @notice Contract for managing the renderer of an 1155 contract abstract contract CreatorRendererControl is CreatorRendererStorageV1, SharedBaseConstants { function _setRenderer(uint256 tokenId, IRenderer1155 renderer) internal { customRenderers[tokenId] = renderer; if (address(renderer) != address(0)) { if (!renderer.supportsInterface(type(IRenderer1155).interfaceId)) { revert RendererNotValid(address(renderer)); } } emit RendererUpdated({tokenId: tokenId, renderer: address(renderer), user: msg.sender}); } /// @notice Return the renderer for a given token /// @dev Returns address 0 for no results /// @param tokenId The token to get the renderer for function getCustomRenderer(uint256 tokenId) public view returns (IRenderer1155 customRenderer) { customRenderer = customRenderers[tokenId]; if (address(customRenderer) == address(0)) { customRenderer = customRenderers[CONTRACT_BASE_ID]; } } /// @notice Function called to render when an empty tokenURI exists on the contract function _render(uint256 tokenId) internal view returns (string memory) { return getCustomRenderer(tokenId).uri(tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {CreatorRoyaltiesStorageV1} from "./CreatorRoyaltiesStorageV1.sol"; import {ICreatorRoyaltiesControl} from "../interfaces/ICreatorRoyaltiesControl.sol"; import {SharedBaseConstants} from "../shared/SharedBaseConstants.sol"; import {ICreatorRoyaltyErrors} from "../interfaces/ICreatorRoyaltiesControl.sol"; import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol"; /// Imagine. Mint. Enjoy. /// @title CreatorRoyaltiesControl /// @author ZORA @iainnash / @tbtstl /// @notice Contract for managing the royalties of an 1155 contract abstract contract CreatorRoyaltiesControl is CreatorRoyaltiesStorageV1, SharedBaseConstants { uint256 immutable ROYALTY_BPS_TO_PERCENT = 10_000; /// @notice The royalty information for a given token. /// @param tokenId The token ID to get the royalty information for. function getRoyalties(uint256 tokenId) public view returns (RoyaltyConfiguration memory) { if (royalties[tokenId].royaltyRecipient != address(0)) { return royalties[tokenId]; } // Otherwise, return default. return royalties[CONTRACT_BASE_ID]; } /// @notice Returns the royalty information for a given token. /// @param tokenId The token ID to get the royalty information for. /// @param salePrice The sale price of the NFT asset specified by tokenId function royaltyInfo(uint256 tokenId, uint256 salePrice) public view returns (address receiver, uint256 royaltyAmount) { RoyaltyConfiguration memory config = getRoyalties(tokenId); royaltyAmount = (config.royaltyBPS * salePrice) / ROYALTY_BPS_TO_PERCENT; receiver = config.royaltyRecipient; } function _updateRoyalties(uint256 tokenId, RoyaltyConfiguration memory configuration) internal { // If a nonzero royalty mint schedule is set: if (configuration.royaltyMintSchedule != 0) { // Set the value to zero configuration.royaltyMintSchedule = 0; } // Don't allow setting royalties to burn address if (configuration.royaltyRecipient == address(0) && configuration.royaltyBPS > 0) { revert ICreatorRoyaltyErrors.InvalidMintSchedule(); } royalties[tokenId] = configuration; emit UpdatedRoyalties(tokenId, msg.sender, configuration); } function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC2981).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// @notice Creator Commands used by minter modules passed back to the main modules interface ICreatorCommands { /// @notice This enum is used to define supported creator action types. /// This can change in the future enum CreatorActions { // No operation - also the default for mintings that may not return a command NO_OP, // Send ether SEND_ETH, // Mint operation MINT } /// @notice This command is for struct Command { // Method for operation CreatorActions method; // Arguments used for this operation bytes args; } /// @notice This command set is returned from the minter back to the user struct CommandSet { Command[] commands; uint256 at; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC165Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol"; import {ICreatorCommands} from "./ICreatorCommands.sol"; /// @notice Minter standard interface /// @dev Minters need to confirm to the ERC165 selector of type(IMinter1155).interfaceId interface IMinter1155 is IERC165Upgradeable { function requestMint( address sender, uint256 tokenId, uint256 quantity, uint256 ethValueSent, bytes calldata minterArguments ) external returns (ICreatorCommands.CommandSet memory commands); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC165Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol"; /// @dev IERC165 type required interface IRenderer1155 is IERC165Upgradeable { /// @notice Called for assigned tokenId, or when token id is globally set to a renderer /// @dev contract target is assumed to be msg.sender /// @param tokenId token id to get uri for function uri(uint256 tokenId) external view returns (string memory); /// @notice Only called for tokenId == 0 /// @dev contract target is assumed to be msg.sender function contractURI() external view returns (string memory); /// @notice Sets up renderer from contract /// @param initData data to setup renderer with /// @dev contract target is assumed to be msg.sender function setup(bytes memory initData) external; // IERC165 type required – set in base helper }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC165Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol"; interface ITransferHookReceiver is IERC165Upgradeable { /// @notice Token transfer batch callback /// @param target target contract for transfer /// @param operator operator address for transfer /// @param from user address for amount transferred /// @param to user address for amount transferred /// @param ids list of token ids transferred /// @param amounts list of values transferred /// @param data data as perscribed by 1155 standard function onTokenTransferBatch( address target, address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) external; /// @notice Token transfer batch callback /// @param target target contract for transfer /// @param operator operator address for transfer /// @param from user address for amount transferred /// @param to user address for amount transferred /// @param id token id transferred /// @param amount value transferred /// @param data data as perscribed by 1155 standard function onTokenTransfer(address target, address operator, address from, address to, uint256 id, uint256 amount, bytes memory data) external; // IERC165 type required }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// @notice Factory Upgrade Gate Admin Factory Implementation – Allows specific contract upgrades as a safety measure interface IUpgradeGate { /// @notice Event emitted when upgrade gate is emitted event UpgradeGateSetup(); /// @notice If an implementation is registered by the Builder DAO as an optional upgrade /// @param baseImpl The base implementation address /// @param upgradeImpl The upgrade implementation address function isRegisteredUpgradePath(address baseImpl, address upgradeImpl) external view returns (bool); /// @notice Called by the Builder DAO to offer implementation upgrades for created DAOs /// @param baseImpls The base implementation addresses /// @param upgradeImpl The upgrade implementation address function registerUpgradePath(address[] memory baseImpls, address upgradeImpl) external; /// @notice Called by the Builder DAO to remove an upgrade /// @param baseImpl The base implementation address /// @param upgradeImpl The upgrade implementation address function removeUpgradePath(address baseImpl, address upgradeImpl) external; event UpgradeRegistered(address indexed baseImpl, address indexed upgradeImpl); event UpgradeRemoved(address indexed baseImpl, address indexed upgradeImpl); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ILegacyNaming} from "../interfaces/ILegacyNaming.sol"; import {LegacyNamingStorageV1} from "./LegacyNamingStorageV1.sol"; /// @title LegacyNamingControl /// @notice Contract for managing the name and symbol of an 1155 contract in the legacy naming scheme contract LegacyNamingControl is LegacyNamingStorageV1, ILegacyNaming { /// @notice The name of the contract function name() external view returns (string memory) { return _name; } /// @notice The token symbol of the contract function symbol() external pure returns (string memory) {} function _setName(string memory _newName) internal { _name = _newName; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/utils/Address.sol"; /// @title PublicMulticall /// @notice Contract for executing a batch of function calls on this contract abstract contract PublicMulticall { /** * @notice Receives and executes a batch of function calls on this contract. */ function multicall(bytes[] calldata data) public virtual returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { results[i] = Address.functionDelegateCall(address(this), data[i]); } } /** * @notice Receives and executes a batch of function calls on this contract. */ function _multicallInternal(bytes[] memory data) internal virtual returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { results[i] = Address.functionDelegateCall(address(this), data[i]); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; contract SharedBaseConstants { uint256 public constant CONTRACT_BASE_ID = 0; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// @title TransferHelperUtils /// @notice Helper functions for sending ETH library TransferHelperUtils { /// @dev Gas limit to send funds uint256 internal constant FUNDS_SEND_LOW_GAS_LIMIT = 110_000; // @dev Gas limit to send funds – usable for splits, can use with withdraws uint256 internal constant FUNDS_SEND_NORMAL_GAS_LIMIT = 310_000; /// @notice Sends ETH to a recipient, making conservative estimates to not run out of gas /// @param recipient The address to send ETH to /// @param value The amount of ETH to send function safeSendETH(address recipient, uint256 value, uint256 gasLimit) internal returns (bool success) { (success, ) = recipient.call{value: value, gas: gasLimit}(""); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IZoraCreator1155TypesV1} from "./IZoraCreator1155TypesV1.sol"; /* ░░░░░░░░░░░░░░ ░░▒▒░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░░░ ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░ OURS TRULY, github.com/ourzora/zora-1155-contracts */ /// Imagine. Mint. Enjoy. /// @notice Storage for 1155 contract /// @author @iainnash / @tbtstl contract ZoraCreator1155StorageV1 is IZoraCreator1155TypesV1 { /// @notice token data stored for each token mapping(uint256 => TokenData) internal tokens; /// @notice metadata renderer contract for each token mapping(uint256 => address) public metadataRendererContract; /// @notice next token id available when using a linear mint style (default for launch) uint256 public nextTokenId; /// @notice Global contract configuration ContractConfig public config; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ICreatorRoyaltyErrors} from "./ICreatorRoyaltiesControl.sol"; import {ILimitedMintPerAddressErrors} from "./ILimitedMintPerAddress.sol"; import {IMinterErrors} from "./IMinterErrors.sol"; interface IZoraCreator1155Errors is ICreatorRoyaltyErrors, ILimitedMintPerAddressErrors, IMinterErrors { error Call_TokenIdMismatch(); error TokenIdMismatch(uint256 expected, uint256 actual); error UserMissingRoleForToken(address user, uint256 tokenId, uint256 role); error Config_TransferHookNotSupported(address proposedAddress); error Mint_InsolventSaleTransfer(); error Mint_ValueTransferFail(); error Mint_TokenIDMintNotAllowed(); error Mint_UnknownCommand(); error Burn_NotOwnerOrApproved(address operator, address user); error NewOwnerNeedsToBeAdmin(); error Sale_CannotCallNonSalesContract(address targetContract); error CallFailed(bytes reason); error Renderer_NotValidRendererContract(); error ETHWithdrawFailed(address recipient, uint256 amount); error FundsWithdrawInsolvent(uint256 amount, uint256 contractValue); error ProtocolRewardsWithdrawFailed(address caller, address recipient, uint256 amount); error CannotMintMoreTokens(uint256 tokenId, uint256 quantity, uint256 totalMinted, uint256 maxSupply); error MintNotYetStarted(); error PremintDeleted(); error InvalidSignatureVersion(); error ERC1155_MINT_TO_ZERO_ADDRESS(); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; contract ERC1155DelegationStorageV1 { mapping(uint32 => uint256) public delegatedTokenId; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IZoraCreator1155DelegatedCreation { event CreatorAttribution(bytes32 structHash, string domainName, string version, address creator, bytes signature); function supportedPremintSignatureVersions() external pure returns (string[] memory); function delegateSetupNewToken( bytes memory premintConfigEncoded, bytes32 premintVersion, bytes calldata signature, address sender ) external returns (uint256 newTokenId); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IMinter1155} from "./IMinter1155.sol"; interface IMintWithRewardsRecipients { /// @notice Mint tokens and payout rewards given a minter contract, minter arguments, and rewards arguments /// @param minter The minter contract to use /// @param tokenId The token ID to mint /// @param quantity The quantity of tokens to mint /// @param rewardsRecipients The addresses of rewards arguments - mintReferral and platformReferral /// @param minterArguments The arguments to pass to the minter function mint(IMinter1155 minter, uint256 tokenId, uint256 quantity, address[] memory rewardsRecipients, bytes calldata minterArguments) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IMinter1155} from "../interfaces/IMinter1155.sol"; import {IZoraCreator1155} from "../interfaces/IZoraCreator1155.sol"; import {IZoraCreator1155Errors} from "../interfaces/IZoraCreator1155Errors.sol"; import {ICreatorRoyaltiesControl} from "../interfaces/ICreatorRoyaltiesControl.sol"; import {ECDSAUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/ECDSAUpgradeable.sol"; import {ZoraCreatorFixedPriceSaleStrategy} from "../minters/fixed-price/ZoraCreatorFixedPriceSaleStrategy.sol"; struct ContractCreationConfig { // Creator/admin of the created contract. Must match the account that signed the message address contractAdmin; // Metadata URI for the created contract string contractURI; // Name of the created contract string contractName; } struct PremintConfig { // The config for the token to be created TokenCreationConfig tokenConfig; // Unique id of the token, used to ensure that multiple signatures can't be used to create the same intended token. // only one signature per token id, scoped to the contract hash can be executed. uint32 uid; // Version of this premint, scoped to the uid and contract. Not used for logic in the contract, but used externally to track the newest version uint32 version; // If executing this signature results in preventing any signature with this uid from being minted. bool deleted; } struct TokenCreationConfig { // Metadata URI for the created token string tokenURI; // Max supply of the created token uint256 maxSupply; // Max tokens that can be minted for an address, 0 if unlimited uint64 maxTokensPerAddress; // Price per token in eth wei. 0 for a free mint. uint96 pricePerToken; // The start time of the mint, 0 for immediate. Prevents signatures from being used until the start time. uint64 mintStart; // The duration of the mint, starting from the first mint of this token. 0 for infinite uint64 mintDuration; // deperecated field; will be ignored. uint32 royaltyMintSchedule; // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. uint32 royaltyBPS; // This is the address that will be set on the `royaltyRecipient` for the created token on the 1155 contract, // which is the address that receives creator rewards and secondary royalties for the token, // and on the `fundsRecipient` on the ZoraCreatorFixedPriceSaleStrategy contract for the token, // which is the address that receives paid mint funds for the token. address royaltyRecipient; // Fixed price minter address address fixedPriceMinter; } struct PremintConfigV2 { // The config for the token to be created TokenCreationConfigV2 tokenConfig; // Unique id of the token, used to ensure that multiple signatures can't be used to create the same intended token. // only one signature per token id, scoped to the contract hash can be executed. uint32 uid; // Version of this premint, scoped to the uid and contract. Not used for logic in the contract, but used externally to track the newest version uint32 version; // If executing this signature results in preventing any signature with this uid from being minted. bool deleted; } struct TokenCreationConfigV2 { // Metadata URI for the created token string tokenURI; // Max supply of the created token uint256 maxSupply; // Max tokens that can be minted for an address, 0 if unlimited uint64 maxTokensPerAddress; // Price per token in eth wei. 0 for a free mint. uint96 pricePerToken; // The start time of the mint, 0 for immediate. Prevents signatures from being used until the start time. uint64 mintStart; // The duration of the mint, starting from the first mint of this token. 0 for infinite uint64 mintDuration; // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. uint32 royaltyBPS; // This is the address that will be set on the `royaltyRecipient` for the created token on the 1155 contract, // which is the address that receives creator rewards and secondary royalties for the token, // and on the `fundsRecipient` on the ZoraCreatorFixedPriceSaleStrategy contract for the token, // which is the address that receives paid mint funds for the token. address payoutRecipient; // Fixed price minter address address fixedPriceMinter; // create referral address createReferral; } library ZoraCreator1155Attribution { string internal constant NAME = "Preminter"; bytes32 internal constant HASHED_NAME = keccak256(bytes(NAME)); string internal constant VERSION_1 = "1"; bytes32 internal constant HASHED_VERSION_1 = keccak256(bytes(VERSION_1)); string internal constant VERSION_2 = "2"; bytes32 internal constant HASHED_VERSION_2 = keccak256(bytes(VERSION_2)); /** * @dev Returns the domain separator for the specified chain. */ function _domainSeparatorV4(uint256 chainId, address verifyingContract, bytes32 hashedName, bytes32 hashedVersion) private pure returns (bytes32) { return _buildDomainSeparator(hashedName, hashedVersion, verifyingContract, chainId); } function _buildDomainSeparator(bytes32 nameHash, bytes32 versionHash, address verifyingContract, uint256 chainId) private pure returns (bytes32) { return keccak256(abi.encode(TYPE_HASH, nameHash, versionHash, chainId, verifyingContract)); } function _hashTypedDataV4( bytes32 structHash, bytes32 hashedName, bytes32 hashedVersion, address verifyingContract, uint256 chainId ) private pure returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(chainId, verifyingContract, hashedName, hashedVersion), structHash); } function recoverSignerHashed( bytes32 hashedPremintConfig, bytes calldata signature, address erc1155Contract, bytes32 signatureVersion, uint256 chainId ) internal pure returns (address signatory) { // first validate the signature - the creator must match the signer of the message bytes32 digest = premintHashedTypeDataV4( hashedPremintConfig, // here we pass the current contract and chain id, ensuring that the message // only works for the current chain and contract id erc1155Contract, signatureVersion, chainId ); (signatory, ) = ECDSAUpgradeable.tryRecover(digest, signature); } /// Gets hash data to sign for a premint. /// @param erc1155Contract Contract address that signature is to be verified against /// @param chainId Chain id that signature is to be verified on function premintHashedTypeDataV4(bytes32 structHash, address erc1155Contract, bytes32 signatureVersion, uint256 chainId) internal pure returns (bytes32) { // build the struct hash to be signed // here we pass the chain id, allowing the message to be signed for another chain return _hashTypedDataV4(structHash, HASHED_NAME, signatureVersion, erc1155Contract, chainId); } bytes32 constant ATTRIBUTION_DOMAIN_V1 = keccak256( "CreatorAttribution(TokenCreationConfig tokenConfig,uint32 uid,uint32 version,bool deleted)TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyMintSchedule,uint32 royaltyBPS,address royaltyRecipient,address fixedPriceMinter)" ); function hashPremint(PremintConfig memory premintConfig) internal pure returns (bytes32) { return keccak256( abi.encode(ATTRIBUTION_DOMAIN_V1, _hashToken(premintConfig.tokenConfig), premintConfig.uid, premintConfig.version, premintConfig.deleted) ); } bytes32 constant ATTRIBUTION_DOMAIN_V2 = keccak256( "CreatorAttribution(TokenCreationConfig tokenConfig,uint32 uid,uint32 version,bool deleted)TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyBPS,address payoutRecipient,address fixedPriceMinter,address createReferral)" ); function hashPremint(PremintConfigV2 memory premintConfig) internal pure returns (bytes32) { return keccak256( abi.encode(ATTRIBUTION_DOMAIN_V2, _hashToken(premintConfig.tokenConfig), premintConfig.uid, premintConfig.version, premintConfig.deleted) ); } bytes32 constant TOKEN_DOMAIN_V1 = keccak256( "TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyMintSchedule,uint32 royaltyBPS,address royaltyRecipient,address fixedPriceMinter)" ); function _hashToken(TokenCreationConfig memory tokenConfig) private pure returns (bytes32) { return keccak256( abi.encode( TOKEN_DOMAIN_V1, _stringHash(tokenConfig.tokenURI), tokenConfig.maxSupply, tokenConfig.maxTokensPerAddress, tokenConfig.pricePerToken, tokenConfig.mintStart, tokenConfig.mintDuration, tokenConfig.royaltyMintSchedule, tokenConfig.royaltyBPS, tokenConfig.royaltyRecipient, tokenConfig.fixedPriceMinter ) ); } bytes32 constant TOKEN_DOMAIN_V2 = keccak256( "TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyBPS,address payoutRecipient,address fixedPriceMinter,address createReferral)" ); function _hashToken(TokenCreationConfigV2 memory tokenConfig) private pure returns (bytes32) { return keccak256( abi.encode( TOKEN_DOMAIN_V2, _stringHash(tokenConfig.tokenURI), tokenConfig.maxSupply, tokenConfig.maxTokensPerAddress, tokenConfig.pricePerToken, tokenConfig.mintStart, tokenConfig.mintDuration, tokenConfig.royaltyBPS, tokenConfig.payoutRecipient, tokenConfig.fixedPriceMinter, tokenConfig.createReferral ) ); } bytes32 internal constant TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); function _stringHash(string memory value) private pure returns (bytes32) { return keccak256(bytes(value)); } /// @notice copied from SharedBaseConstants uint256 constant CONTRACT_BASE_ID = 0; /// @dev copied from ZoraCreator1155Impl uint256 constant PERMISSION_BIT_MINTER = 2 ** 2; function isAuthorizedToCreatePremint( address signer, address premintContractConfigContractAdmin, address contractAddress ) internal view returns (bool authorized) { // if contract hasn't been created, signer must be the contract admin on the premint config if (contractAddress.code.length == 0) { return signer == premintContractConfigContractAdmin; } else { // if contract has been created, signer must have mint new token permission authorized = IZoraCreator1155(contractAddress).isAdminOrRole(signer, CONTRACT_BASE_ID, PERMISSION_BIT_MINTER); } } } /// @notice Utility library to setup tokens created via premint. Functions exposed as external to not increase contract size in calling contract. /// @author oveddan library PremintTokenSetup { uint256 constant PERMISSION_BIT_MINTER = 2 ** 2; /// @notice Build token setup actions for a v2 preminted token function makeSetupNewTokenCalls(uint256 newTokenId, TokenCreationConfigV2 memory tokenConfig) internal view returns (bytes[] memory calls) { return _buildCalls({ newTokenId: newTokenId, fixedPriceMinterAddress: tokenConfig.fixedPriceMinter, pricePerToken: tokenConfig.pricePerToken, maxTokensPerAddress: tokenConfig.maxTokensPerAddress, mintDuration: tokenConfig.mintDuration, royaltyBPS: tokenConfig.royaltyBPS, payoutRecipient: tokenConfig.payoutRecipient }); } /// @notice Build token setup actions for a v1 preminted token function makeSetupNewTokenCalls(uint256 newTokenId, TokenCreationConfig memory tokenConfig) internal view returns (bytes[] memory calls) { return _buildCalls({ newTokenId: newTokenId, fixedPriceMinterAddress: tokenConfig.fixedPriceMinter, pricePerToken: tokenConfig.pricePerToken, maxTokensPerAddress: tokenConfig.maxTokensPerAddress, mintDuration: tokenConfig.mintDuration, royaltyBPS: tokenConfig.royaltyBPS, payoutRecipient: tokenConfig.royaltyRecipient }); } function _buildCalls( uint256 newTokenId, address fixedPriceMinterAddress, uint96 pricePerToken, uint64 maxTokensPerAddress, uint64 mintDuration, uint32 royaltyBPS, address payoutRecipient ) private view returns (bytes[] memory calls) { calls = new bytes[](3); // build array of the calls to make // get setup actions and invoke them // set up the sales strategy // first, grant the fixed price sale strategy minting capabilities on the token // tokenContract.addPermission(newTokenId, address(fixedPriceMinter), PERMISSION_BIT_MINTER); calls[0] = abi.encodeWithSelector(IZoraCreator1155.addPermission.selector, newTokenId, fixedPriceMinterAddress, PERMISSION_BIT_MINTER); // set the sales config on that token calls[1] = abi.encodeWithSelector( IZoraCreator1155.callSale.selector, newTokenId, IMinter1155(fixedPriceMinterAddress), abi.encodeWithSelector( ZoraCreatorFixedPriceSaleStrategy.setSale.selector, newTokenId, _buildNewSalesConfig(pricePerToken, maxTokensPerAddress, mintDuration, payoutRecipient) ) ); // set the royalty config on that token: calls[2] = abi.encodeWithSelector( IZoraCreator1155.updateRoyaltiesForToken.selector, newTokenId, ICreatorRoyaltiesControl.RoyaltyConfiguration({royaltyBPS: royaltyBPS, royaltyRecipient: payoutRecipient, royaltyMintSchedule: 0}) ); } function _buildNewSalesConfig( uint96 pricePerToken, uint64 maxTokensPerAddress, uint64 duration, address payoutRecipient ) private view returns (ZoraCreatorFixedPriceSaleStrategy.SalesConfig memory) { uint64 saleStart = uint64(block.timestamp); uint64 saleEnd = duration == 0 ? type(uint64).max : saleStart + duration; return ZoraCreatorFixedPriceSaleStrategy.SalesConfig({ pricePerToken: pricePerToken, saleStart: saleStart, saleEnd: saleEnd, maxTokensPerAddress: maxTokensPerAddress, fundsRecipient: payoutRecipient }); } } library PremintEncoding { function encodePremintV1(PremintConfig memory premintConfig) internal pure returns (bytes memory encodedPremintConfig, bytes32 hashedVersion) { return (abi.encode(premintConfig), ZoraCreator1155Attribution.HASHED_VERSION_1); } function encodePremintV2(PremintConfigV2 memory premintConfig) internal pure returns (bytes memory encodedPremintConfig, bytes32 hashedVersion) { return (abi.encode(premintConfig), ZoraCreator1155Attribution.HASHED_VERSION_2); } } struct DecodedCreatorAttribution { bytes32 structHash; string domainName; string version; address creator; bytes signature; } struct DelegatedTokenSetup { DecodedCreatorAttribution attribution; uint32 uid; string tokenURI; uint256 maxSupply; address createReferral; } /// @notice Utility library to decode and recover delegated token setup data from a signature. /// Function called by the erc1155 contract is marked external to reduce contract size in calling contract. library DelegatedTokenCreation { /// @notice Decode and recover delegated token setup data from a signature. Works with multiple versions of /// a signature. Takes an abi encoded premint config, version of the encoded premint config, and a signature, /// decodes the config, and recoveres the signer of the config. Based on the premint config, builds /// setup actions for the token to be created. /// @param premintConfigEncoded The abi encoded premint config /// @param premintVersion The version of the premint config /// @param signature The signature of the premint config /// @param tokenContract The address of the token contract that the premint config is for /// @param newTokenId The id of the token to be created function decodeAndRecoverDelegatedTokenSetup( bytes memory premintConfigEncoded, bytes32 premintVersion, bytes calldata signature, address tokenContract, uint256 newTokenId ) external view returns (DelegatedTokenSetup memory params, DecodedCreatorAttribution memory creatorAttribution, bytes[] memory tokenSetupActions) { // based on version of encoded premint config, decode corresponding premint config, // and then recover signer from the signature, and then build token setup actions based // on the decoded premint config. if (premintVersion == ZoraCreator1155Attribution.HASHED_VERSION_1) { PremintConfig memory premintConfig = abi.decode(premintConfigEncoded, (PremintConfig)); creatorAttribution = recoverCreatorAttribution( ZoraCreator1155Attribution.VERSION_1, ZoraCreator1155Attribution.hashPremint(premintConfig), tokenContract, signature ); (params, tokenSetupActions) = _recoverDelegatedTokenSetup(premintConfig, newTokenId); } else { PremintConfigV2 memory premintConfig = abi.decode(premintConfigEncoded, (PremintConfigV2)); creatorAttribution = recoverCreatorAttribution( ZoraCreator1155Attribution.VERSION_2, ZoraCreator1155Attribution.hashPremint(premintConfig), tokenContract, signature ); (params, tokenSetupActions) = _recoverDelegatedTokenSetup(premintConfig, newTokenId); } } function supportedPremintSignatureVersions() external pure returns (string[] memory versions) { return _supportedPremintSignatureVersions(); } function _supportedPremintSignatureVersions() internal pure returns (string[] memory versions) { versions = new string[](2); versions[0] = ZoraCreator1155Attribution.VERSION_1; versions[1] = ZoraCreator1155Attribution.VERSION_2; } function recoverCreatorAttribution( string memory version, bytes32 structHash, address tokenContract, bytes calldata signature ) internal view returns (DecodedCreatorAttribution memory attribution) { attribution.structHash = structHash; attribution.version = version; attribution.creator = ZoraCreator1155Attribution.recoverSignerHashed(structHash, signature, tokenContract, keccak256(bytes(version)), block.chainid); attribution.signature = signature; attribution.domainName = ZoraCreator1155Attribution.NAME; } function _recoverDelegatedTokenSetup( PremintConfigV2 memory premintConfig, uint256 nextTokenId ) private view returns (DelegatedTokenSetup memory params, bytes[] memory tokenSetupActions) { validatePremint(premintConfig.tokenConfig.mintStart, premintConfig.deleted); params.uid = premintConfig.uid; tokenSetupActions = PremintTokenSetup.makeSetupNewTokenCalls({newTokenId: nextTokenId, tokenConfig: premintConfig.tokenConfig}); params.tokenURI = premintConfig.tokenConfig.tokenURI; params.maxSupply = premintConfig.tokenConfig.maxSupply; params.createReferral = premintConfig.tokenConfig.createReferral; } function _recoverDelegatedTokenSetup( PremintConfig memory premintConfig, uint256 nextTokenId ) private view returns (DelegatedTokenSetup memory params, bytes[] memory tokenSetupActions) { validatePremint(premintConfig.tokenConfig.mintStart, premintConfig.deleted); params.uid = premintConfig.uid; tokenSetupActions = PremintTokenSetup.makeSetupNewTokenCalls(nextTokenId, premintConfig.tokenConfig); params.tokenURI = premintConfig.tokenConfig.tokenURI; params.maxSupply = premintConfig.tokenConfig.maxSupply; } function validatePremint(uint64 mintStart, bool deleted) private view { if (mintStart != 0 && mintStart > block.timestamp) { // if the mint start is in the future, then revert revert IZoraCreator1155Errors.MintNotYetStarted(); } if (deleted) { // if the signature says to be deleted, then dont execute any further minting logic; // return 0 revert IZoraCreator1155Errors.PremintDeleted(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155ReceiverUpgradeable is IERC165Upgradeable { /** * @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 v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155Upgradeable.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; error ADDRESS_INSUFFICIENT_BALANCE(); error ADDRESS_UNABLE_TO_SEND_VALUE(); error ADDRESS_LOW_LEVEL_CALL_FAILED(); error ADDRESS_LOW_LEVEL_CALL_WITH_VALUE_FAILED(); error ADDRESS_INSUFFICIENT_BALANCE_FOR_CALL(); error ADDRESS_LOW_LEVEL_STATIC_CALL_FAILED(); error ADDRESS_CALL_TO_NON_CONTRACT(); /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/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 { if (address(this).balance > amount) { revert ADDRESS_INSUFFICIENT_BALANCE(); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert ADDRESS_UNABLE_TO_SEND_VALUE(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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) { if (address(this).balance < value) { revert ADDRESS_INSUFFICIENT_BALANCE(); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (!isContract(target)) { revert ADDRESS_CALL_TO_NON_CONTRACT(); } } return returndata; } else { _revert(returndata); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata); } } function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert ADDRESS_LOW_LEVEL_CALL_FAILED(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; error INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED(); error INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING(); error INITIALIZABLE_CONTRACT_IS_INITIALIZING(); /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; if ((!isTopLevelCall || _initialized != 0) && (AddressUpgradeable.isContract(address(this)) || _initialized != 1)) { revert INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED(); } _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { if (_initializing || _initialized >= version) { revert INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED(); } _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { if (!_initializing) { revert INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING(); } _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { if (_initializing) { revert INITIALIZABLE_CONTRACT_IS_INITIALIZING(); } if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; error ERC1967_NEW_IMPL_NOT_CONTRACT(); error ERC1967_UNSUPPORTED_PROXIABLEUUID(); error ERC1967_NEW_IMPL_NOT_UUPS(); error ERC1967_NEW_ADMIN_IS_ZERO_ADDRESS(); error ERC1967_NEW_BEACON_IS_NOT_CONTRACT(); error ERC1967_BEACON_IMPL_IS_NOT_CONTRACT(); error ADDRESS_DELEGATECALL_TO_NON_CONTRACT(); /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { if (!AddressUpgradeable.isContract(newImplementation)) { revert ERC1967_NEW_IMPL_NOT_CONTRACT(); } StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { if (slot != _IMPLEMENTATION_SLOT) { revert ERC1967_UNSUPPORTED_PROXIABLEUUID(); } } catch { revert ERC1967_NEW_IMPL_NOT_UUPS(); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { if (newAdmin == address(0)) { revert ERC1967_NEW_ADMIN_IS_ZERO_ADDRESS(); } StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { if (!AddressUpgradeable.isContract(newBeacon)) { revert ERC1967_NEW_BEACON_IS_NOT_CONTRACT(); } if (!AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation())) { revert ERC1967_BEACON_IMPL_IS_NOT_CONTRACT(); } StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { if (!AddressUpgradeable.isContract(target)) { revert ADDRESS_DELEGATECALL_TO_NON_CONTRACT(); } // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IProtocolRewards} from "../interfaces/IProtocolRewards.sol"; struct RewardsSettings { uint256 creatorReward; uint256 createReferralReward; uint256 mintReferralReward; uint256 firstMinterReward; uint256 zoraReward; } interface IRewardsErrors { error CREATOR_FUNDS_RECIPIENT_NOT_SET(); error INVALID_ADDRESS_ZERO(); error INVALID_ETH_AMOUNT(); error ONLY_CREATE_REFERRAL(); } /// @notice Common logic for between Zora ERC-721 & ERC-1155 contracts for protocol reward splits & deposits abstract contract RewardSplits is IRewardsErrors { uint256 internal constant TOTAL_REWARD_PER_MINT = 0.000777 ether; uint256 internal constant CREATOR_REWARD = 0.000333 ether; uint256 internal constant FIRST_MINTER_REWARD = 0.000111 ether; uint256 internal constant CREATE_REFERRAL_FREE_MINT_REWARD = 0.000111 ether; uint256 internal constant MINT_REFERRAL_FREE_MINT_REWARD = 0.000111 ether; uint256 internal constant ZORA_FREE_MINT_REWARD = 0.000111 ether; uint256 internal constant MINT_REFERRAL_PAID_MINT_REWARD = 0.000222 ether; uint256 internal constant CREATE_REFERRAL_PAID_MINT_REWARD = 0.000222 ether; uint256 internal constant ZORA_PAID_MINT_REWARD = 0.000222 ether; address internal immutable zoraRewardRecipient; IProtocolRewards internal immutable protocolRewards; constructor(address _protocolRewards, address _zoraRewardRecipient) payable { if (_protocolRewards == address(0) || _zoraRewardRecipient == address(0)) { revert INVALID_ADDRESS_ZERO(); } protocolRewards = IProtocolRewards(_protocolRewards); zoraRewardRecipient = _zoraRewardRecipient; } function computeTotalReward(uint256 numTokens) public pure returns (uint256) { return numTokens * TOTAL_REWARD_PER_MINT; } function computeFreeMintRewards(uint256 numTokens) public pure returns (RewardsSettings memory) { return RewardsSettings({ creatorReward: numTokens * CREATOR_REWARD, createReferralReward: numTokens * CREATE_REFERRAL_FREE_MINT_REWARD, mintReferralReward: numTokens * MINT_REFERRAL_FREE_MINT_REWARD, firstMinterReward: numTokens * FIRST_MINTER_REWARD, zoraReward: numTokens * ZORA_FREE_MINT_REWARD }); } function computePaidMintRewards(uint256 numTokens) public pure returns (RewardsSettings memory) { return RewardsSettings({ creatorReward: 0, createReferralReward: numTokens * CREATE_REFERRAL_PAID_MINT_REWARD, mintReferralReward: numTokens * MINT_REFERRAL_PAID_MINT_REWARD, firstMinterReward: numTokens * FIRST_MINTER_REWARD, zoraReward: numTokens * ZORA_PAID_MINT_REWARD }); } function _depositFreeMintRewards( uint256 totalReward, uint256 numTokens, address creator, address createReferral, address mintReferral, address firstMinter ) internal { RewardsSettings memory settings = computeFreeMintRewards(numTokens); if (createReferral == address(0)) { createReferral = zoraRewardRecipient; } if (mintReferral == address(0)) { mintReferral = zoraRewardRecipient; } protocolRewards.depositRewards{value: totalReward}( creator, settings.creatorReward, createReferral, settings.createReferralReward, mintReferral, settings.mintReferralReward, firstMinter, settings.firstMinterReward, zoraRewardRecipient, settings.zoraReward ); } function _depositPaidMintRewards(uint256 totalReward, uint256 numTokens, address createReferral, address mintReferral, address firstMinter) internal { RewardsSettings memory settings = computePaidMintRewards(numTokens); if (createReferral == address(0)) { createReferral = zoraRewardRecipient; } if (mintReferral == address(0)) { mintReferral = zoraRewardRecipient; } protocolRewards.depositRewards{value: totalReward}( address(0), 0, createReferral, settings.createReferralReward, mintReferral, settings.mintReferralReward, firstMinter, settings.firstMinterReward, zoraRewardRecipient, settings.zoraReward ); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ITransferHookReceiver} from "../interfaces/ITransferHookReceiver.sol"; /* ░░░░░░░░░░░░░░ ░░▒▒░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░░░ ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░ OURS TRULY, */ /// Imagine. Mint. Enjoy. /// @notice Interface for types used across the ZoraCreator1155 contract /// @author @iainnash / @tbtstl interface IZoraCreator1155TypesV1 { /// @notice Used to store individual token data struct TokenData { string uri; uint256 maxSupply; uint256 totalMinted; } /// @notice Used to store contract-level configuration struct ContractConfig { address owner; uint96 __gap1; address payable fundsRecipient; uint96 __gap2; ITransferHookReceiver transferHook; uint96 __gap3; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IOwnable { function owner() external returns (address); event OwnershipTransferred(address lastOwner, address newOwner); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IVersionedContract { function contractVersion() external returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol"; interface ICreatorRoyaltyErrors { /// @notice Thrown when a user tries to have 100% supply royalties error InvalidMintSchedule(); } interface ICreatorRoyaltiesControl is IERC2981 { /// @notice The RoyaltyConfiguration struct is used to store the royalty configuration for a given token. /// @param royaltyMintSchedule Every nth token will go to the royalty recipient. /// @param royaltyBPS The royalty amount in basis points for secondary sales. /// @param royaltyRecipient The address that will receive the royalty payments. struct RoyaltyConfiguration { uint32 royaltyMintSchedule; uint32 royaltyBPS; address royaltyRecipient; } /// @notice Event emitted when royalties are updated event UpdatedRoyalties(uint256 indexed tokenId, address indexed user, RoyaltyConfiguration configuration); /// @notice External data getter to get royalties for a token /// @param tokenId tokenId to get royalties configuration for function getRoyalties(uint256 tokenId) external view returns (RoyaltyConfiguration memory); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// Imagine. Mint. Enjoy. /// @author @iainnash / @tbtstl contract CreatorPermissionStorageV1 { mapping(uint256 => mapping(address => uint256)) public permissions; uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// @notice Generic control interface for bit-based permissions-control interface ICreatorPermissionControl { /// @notice Emitted when permissions are updated event UpdatedPermissions(uint256 indexed tokenId, address indexed user, uint256 indexed permissions); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ICreatorRendererControl} from "../interfaces/ICreatorRendererControl.sol"; import {IRenderer1155} from "../interfaces/IRenderer1155.sol"; /// @notice Creator Renderer Storage Configuration Contract V1 abstract contract CreatorRendererStorageV1 is ICreatorRendererControl { /// @notice Mapping for custom renderers mapping(uint256 => IRenderer1155) public customRenderers; uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ICreatorRoyaltiesControl} from "../interfaces/ICreatorRoyaltiesControl.sol"; /// Imagine. Mint. Enjoy. /// @title CreatorRoyaltiesControl /// @author ZORA @iainnash / @tbtstl /// @notice Royalty storage contract pattern abstract contract CreatorRoyaltiesStorageV1 is ICreatorRoyaltiesControl { mapping(uint256 => RoyaltyConfiguration) public royalties; uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ILegacyNaming { function name() external returns (string memory); function symbol() external returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; contract LegacyNamingStorageV1 { string internal _name; uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC165Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol"; interface ILimitedMintPerAddressErrors { error UserExceedsMintLimit(address user, uint256 limit, uint256 requestedAmount); } interface ILimitedMintPerAddress is IERC165Upgradeable, ILimitedMintPerAddressErrors { function getMintedPerWallet(address token, uint256 tokenId, address wallet) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IMinterErrors { error CallerNotZoraCreator1155(); error MinterContractAlreadyExists(); error MinterContractDoesNotExist(); error SaleEnded(); error SaleHasNotStarted(); error WrongValueSent(); error InvalidMerkleProof(address mintTo, bytes32[] merkleProof, bytes32 merkleRoot); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {Enjoy} from "_imagine/mint/Enjoy.sol"; import {IMinter1155} from "../../interfaces/IMinter1155.sol"; import {ICreatorCommands} from "../../interfaces/ICreatorCommands.sol"; import {SaleStrategy} from "../SaleStrategy.sol"; import {SaleCommandHelper} from "../utils/SaleCommandHelper.sol"; import {LimitedMintPerAddress} from "../utils/LimitedMintPerAddress.sol"; import {IMinterErrors} from "../../interfaces/IMinterErrors.sol"; /* ░░░░░░░░░░░░░░ ░░▒▒░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░░░ ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░ OURS TRULY, github.com/ourzora/zora-1155-contracts */ /// @title ZoraCreatorFixedPriceSaleStrategy /// @notice A sale strategy for ZoraCreator that allows for fixed price sales over a given time period /// @author @iainnash / @tbtstl contract ZoraCreatorFixedPriceSaleStrategy is Enjoy, SaleStrategy, LimitedMintPerAddress, IMinterErrors { struct SalesConfig { /// @notice Unix timestamp for the sale start uint64 saleStart; /// @notice Unix timestamp for the sale end uint64 saleEnd; /// @notice Max tokens that can be minted for an address, 0 if unlimited uint64 maxTokensPerAddress; /// @notice Price per token in eth wei uint96 pricePerToken; /// @notice Funds recipient (0 if no different funds recipient than the contract global) address fundsRecipient; } // target -> tokenId -> settings mapping(address => mapping(uint256 => SalesConfig)) internal salesConfigs; using SaleCommandHelper for ICreatorCommands.CommandSet; function contractURI() external pure override returns (string memory) { return "https://github.com/ourzora/zora-1155-contracts/"; } /// @notice The name of the sale strategy function contractName() external pure override returns (string memory) { return "Fixed Price Sale Strategy"; } /// @notice The version of the sale strategy function contractVersion() external pure override returns (string memory) { return "1.1.0"; } event SaleSet(address indexed mediaContract, uint256 indexed tokenId, SalesConfig salesConfig); event MintComment(address indexed sender, address indexed tokenContract, uint256 indexed tokenId, uint256 quantity, string comment); /// @notice Compiles and returns the commands needed to mint a token using this sales strategy /// @param tokenId The token ID to mint /// @param quantity The quantity of tokens to mint /// @param ethValueSent The amount of ETH sent with the transaction /// @param minterArguments The arguments passed to the minter, which should be the address to mint to function requestMint( address, uint256 tokenId, uint256 quantity, uint256 ethValueSent, bytes calldata minterArguments ) external returns (ICreatorCommands.CommandSet memory commands) { address mintTo; string memory comment = ""; if (minterArguments.length == 32) { mintTo = abi.decode(minterArguments, (address)); } else { (mintTo, comment) = abi.decode(minterArguments, (address, string)); } SalesConfig storage config = salesConfigs[msg.sender][tokenId]; // If sales config does not exist this first check will always fail. // Check sale end if (block.timestamp > config.saleEnd) { revert SaleEnded(); } // Check sale start if (block.timestamp < config.saleStart) { revert SaleHasNotStarted(); } // Check value sent if (config.pricePerToken * quantity != ethValueSent) { revert WrongValueSent(); } // Check minted per address limit if (config.maxTokensPerAddress > 0) { _requireMintNotOverLimitAndUpdate(config.maxTokensPerAddress, quantity, msg.sender, tokenId, mintTo); } bool shouldTransferFunds = config.fundsRecipient != address(0); commands.setSize(shouldTransferFunds ? 2 : 1); // Mint command commands.mint(mintTo, tokenId, quantity); if (bytes(comment).length > 0) { emit MintComment(mintTo, msg.sender, tokenId, quantity, comment); } // Should transfer funds if funds recipient is set to a non-default address if (shouldTransferFunds) { commands.transfer(config.fundsRecipient, ethValueSent); } } /// @notice Sets the sale config for a given token function setSale(uint256 tokenId, SalesConfig memory salesConfig) external { salesConfigs[msg.sender][tokenId] = salesConfig; // Emit event emit SaleSet(msg.sender, tokenId, salesConfig); } /// @notice Deletes the sale config for a given token function resetSale(uint256 tokenId) external override { delete salesConfigs[msg.sender][tokenId]; // Deleted sale emit event emit SaleSet(msg.sender, tokenId, salesConfigs[msg.sender][tokenId]); } /// @notice Returns the sale config for a given token function sale(address tokenContract, uint256 tokenId) external view returns (SalesConfig memory) { return salesConfigs[tokenContract][tokenId]; } function supportsInterface(bytes4 interfaceId) public pure virtual override(LimitedMintPerAddress, SaleStrategy) returns (bool) { return super.supportsInterface(interfaceId) || LimitedMintPerAddress.supportsInterface(interfaceId) || SaleStrategy.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IRenderer1155} from "./IRenderer1155.sol"; /// @notice Interface for creator renderer controls interface ICreatorRendererControl { /// @notice Get the custom renderer contract (if any) for the given token id /// @dev Reverts if not custom renderer is set for this token function getCustomRenderer(uint256 tokenId) external view returns (IRenderer1155 renderer); error NoRendererForToken(uint256 tokenId); error RendererNotValid(address renderer); event RendererUpdated(uint256 indexed tokenId, address indexed renderer, address indexed user); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; import "./math/SignedMathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /* ░░░░░░░░░░░░░░ ░░▒▒░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░ ░░▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░░ ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░░░ ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░ ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░ ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░ OURS TRULY, */ interface Enjoy { }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC165Upgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol"; import {IMinter1155} from "../interfaces/IMinter1155.sol"; import {IContractMetadata} from "../interfaces/IContractMetadata.sol"; import {IVersionedContract} from "../interfaces/IVersionedContract.sol"; /// @notice Sales Strategy Helper contract template on top of IMinter1155 /// @author @iainnash / @tbtstl abstract contract SaleStrategy is IMinter1155, IVersionedContract, IContractMetadata { /// @notice This function resets the sales configuration for a given tokenId and contract. /// @dev This function is intentioned to be called directly from the affected sales contract function resetSale(uint256 tokenId) external virtual; function supportsInterface(bytes4 interfaceId) public pure virtual returns (bool) { return interfaceId == type(IMinter1155).interfaceId || interfaceId == type(IERC165Upgradeable).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ICreatorCommands} from "../../interfaces/ICreatorCommands.sol"; /// @title SaleCommandHelper /// @notice Helper library for creating commands for the sale contract /// @author @iainnash / @tbtstl library SaleCommandHelper { /// @notice Sets the size of commands and initializes command array. Empty entries are skipped by the resolver. /// @dev Beware: this removes all previous command entries from memory /// @param commandSet command set struct storage. /// @param size size to set for the new struct function setSize(ICreatorCommands.CommandSet memory commandSet, uint256 size) internal pure { commandSet.commands = new ICreatorCommands.Command[](size); } /// @notice Creates a command to mint a token /// @param commandSet The command set to add the command to /// @param to The address to mint to /// @param tokenId The token ID to mint /// @param quantity The quantity of tokens to mint function mint(ICreatorCommands.CommandSet memory commandSet, address to, uint256 tokenId, uint256 quantity) internal pure { unchecked { commandSet.commands[commandSet.at++] = ICreatorCommands.Command({ method: ICreatorCommands.CreatorActions.MINT, args: abi.encode(to, tokenId, quantity) }); } } /// @notice Creates a command to transfer ETH /// @param commandSet The command set to add the command to /// @param to The address to transfer to /// @param amount The amount of ETH to transfer function transfer(ICreatorCommands.CommandSet memory commandSet, address to, uint256 amount) internal pure { unchecked { commandSet.commands[commandSet.at++] = ICreatorCommands.Command({method: ICreatorCommands.CreatorActions.SEND_ETH, args: abi.encode(to, amount)}); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ILimitedMintPerAddress} from "../../interfaces/ILimitedMintPerAddress.sol"; contract LimitedMintPerAddress is ILimitedMintPerAddress { /// @notice Storage for slot to check user mints /// @notice target contract -> tokenId -> minter user -> numberMinted /// @dev No gap or stroage interface since this is used within non-upgradeable contracts mapping(address => mapping(uint256 => mapping(address => uint256))) internal mintedPerAddress; function getMintedPerWallet(address tokenContract, uint256 tokenId, address wallet) external view returns (uint256) { return mintedPerAddress[tokenContract][tokenId][wallet]; } function _requireMintNotOverLimitAndUpdate(uint256 limit, uint256 numRequestedMint, address tokenContract, uint256 tokenId, address wallet) internal { mintedPerAddress[tokenContract][tokenId][wallet] += numRequestedMint; if (mintedPerAddress[tokenContract][tokenId][wallet] > limit) { revert UserExceedsMintLimit(wallet, limit, mintedPerAddress[tokenContract][tokenId][wallet]); } } function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { return interfaceId == type(ILimitedMintPerAddress).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IHasContractName { /// @notice Contract name returns the pretty contract name function contractName() external returns (string memory); } interface IContractMetadata is IHasContractName { /// @notice Contract URI returns the uri for more information about the given contract function contractURI() external returns (string memory); }
{ "remappings": [ "ds-test/=node_modules/ds-test/src/", "forge-std/=node_modules/forge-std/src/", "@zoralabs/openzeppelin-contracts-upgradeable/=node_modules/@zoralabs/openzeppelin-contracts-upgradeable/", "@zoralabs/protocol-rewards/src/=node_modules/@zoralabs/protocol-rewards/src/", "@zoralabs/zora-1155-contracts/src/=node_modules/@zoralabs/zora-1155-contracts/src/", "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/", "_imagine/=node_modules/@zoralabs/zora-1155-contracts/_imagine/", "solemate/=/node_modules/solemate/src/", "solady/=node_modules/solady/src/", "solmate/=node_modules/solmate/" ], "optimizer": { "enabled": true, "runs": 50 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "viaIR": true, "libraries": { "node_modules/@zoralabs/zora-1155-contracts/src/delegation/ZoraCreator1155Attribution.sol": { "DelegatedTokenCreation": "0xecfbcf718e17b6e76a675ddb936a9249c69dd2aa" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_mintFeeRecipient","type":"address"},{"internalType":"address","name":"_upgradeGate","type":"address"},{"internalType":"address","name":"_protocolRewards","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ADDRESS_DELEGATECALL_TO_NON_CONTRACT","type":"error"},{"inputs":[],"name":"ADDRESS_LOW_LEVEL_CALL_FAILED","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"Burn_NotOwnerOrApproved","type":"error"},{"inputs":[],"name":"CREATOR_FUNDS_RECIPIENT_NOT_SET","type":"error"},{"inputs":[{"internalType":"bytes","name":"reason","type":"bytes"}],"name":"CallFailed","type":"error"},{"inputs":[],"name":"Call_TokenIdMismatch","type":"error"},{"inputs":[],"name":"CallerNotZoraCreator1155","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"totalMinted","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"CannotMintMoreTokens","type":"error"},{"inputs":[{"internalType":"address","name":"proposedAddress","type":"address"}],"name":"Config_TransferHookNotSupported","type":"error"},{"inputs":[],"name":"ERC1155_ACCOUNTS_AND_IDS_LENGTH_MISMATCH","type":"error"},{"inputs":[],"name":"ERC1155_ADDRESS_ZERO_IS_NOT_A_VALID_OWNER","type":"error"},{"inputs":[],"name":"ERC1155_BURN_AMOUNT_EXCEEDS_BALANCE","type":"error"},{"inputs":[],"name":"ERC1155_BURN_FROM_ZERO_ADDRESS","type":"error"},{"inputs":[],"name":"ERC1155_CALLER_IS_NOT_TOKEN_OWNER_OR_APPROVED","type":"error"},{"inputs":[],"name":"ERC1155_ERC1155RECEIVER_REJECTED_TOKENS","type":"error"},{"inputs":[],"name":"ERC1155_IDS_AND_AMOUNTS_LENGTH_MISMATCH","type":"error"},{"inputs":[],"name":"ERC1155_INSUFFICIENT_BALANCE_FOR_TRANSFER","type":"error"},{"inputs":[],"name":"ERC1155_MINT_TO_ZERO_ADDRESS","type":"error"},{"inputs":[],"name":"ERC1155_MINT_TO_ZERO_ADDRESS","type":"error"},{"inputs":[],"name":"ERC1155_SETTING_APPROVAL_FOR_SELF","type":"error"},{"inputs":[],"name":"ERC1155_TRANSFER_TO_NON_ERC1155RECEIVER_IMPLEMENTER","type":"error"},{"inputs":[],"name":"ERC1155_TRANSFER_TO_ZERO_ADDRESS","type":"error"},{"inputs":[],"name":"ERC1967_NEW_IMPL_NOT_CONTRACT","type":"error"},{"inputs":[],"name":"ERC1967_NEW_IMPL_NOT_UUPS","type":"error"},{"inputs":[],"name":"ERC1967_UNSUPPORTED_PROXIABLEUUID","type":"error"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ETHWithdrawFailed","type":"error"},{"inputs":[],"name":"FUNCTION_MUST_BE_CALLED_THROUGH_ACTIVE_PROXY","type":"error"},{"inputs":[],"name":"FUNCTION_MUST_BE_CALLED_THROUGH_DELEGATECALL","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"contractValue","type":"uint256"}],"name":"FundsWithdrawInsolvent","type":"error"},{"inputs":[],"name":"INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED","type":"error"},{"inputs":[],"name":"INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING","type":"error"},{"inputs":[],"name":"INVALID_ADDRESS_ZERO","type":"error"},{"inputs":[],"name":"INVALID_ETH_AMOUNT","type":"error"},{"inputs":[{"internalType":"address","name":"mintTo","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"InvalidMerkleProof","type":"error"},{"inputs":[],"name":"InvalidMintSchedule","type":"error"},{"inputs":[],"name":"InvalidSignatureVersion","type":"error"},{"inputs":[],"name":"MintNotYetStarted","type":"error"},{"inputs":[],"name":"Mint_InsolventSaleTransfer","type":"error"},{"inputs":[],"name":"Mint_TokenIDMintNotAllowed","type":"error"},{"inputs":[],"name":"Mint_UnknownCommand","type":"error"},{"inputs":[],"name":"Mint_ValueTransferFail","type":"error"},{"inputs":[],"name":"MinterContractAlreadyExists","type":"error"},{"inputs":[],"name":"MinterContractDoesNotExist","type":"error"},{"inputs":[],"name":"NewOwnerNeedsToBeAdmin","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NoRendererForToken","type":"error"},{"inputs":[],"name":"ONLY_CREATE_REFERRAL","type":"error"},{"inputs":[],"name":"PremintDeleted","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ProtocolRewardsWithdrawFailed","type":"error"},{"inputs":[{"internalType":"address","name":"renderer","type":"address"}],"name":"RendererNotValid","type":"error"},{"inputs":[],"name":"Renderer_NotValidRendererContract","type":"error"},{"inputs":[],"name":"SaleEnded","type":"error"},{"inputs":[],"name":"SaleHasNotStarted","type":"error"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"}],"name":"Sale_CannotCallNonSalesContract","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"actual","type":"uint256"}],"name":"TokenIdMismatch","type":"error"},{"inputs":[],"name":"UUPS_UPGRADEABLE_MUST_NOT_BE_CALLED_THROUGH_DELEGATECALL","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"name":"UserExceedsMintLimit","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"role","type":"uint256"}],"name":"UserMissingRoleForToken","type":"error"},{"inputs":[],"name":"WrongValueSent","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"updater","type":"address"},{"indexed":true,"internalType":"enum IZoraCreator1155.ConfigUpdate","name":"updateType","type":"uint8"},{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint96","name":"__gap1","type":"uint96"},{"internalType":"address payable","name":"fundsRecipient","type":"address"},{"internalType":"uint96","name":"__gap2","type":"uint96"},{"internalType":"contract ITransferHookReceiver","name":"transferHook","type":"address"},{"internalType":"uint96","name":"__gap3","type":"uint96"}],"indexed":false,"internalType":"struct IZoraCreator1155TypesV1.ContractConfig","name":"newConfig","type":"tuple"}],"name":"ConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"updater","type":"address"},{"indexed":false,"internalType":"string","name":"uri","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"ContractMetadataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IRenderer1155","name":"renderer","type":"address"}],"name":"ContractRendererUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"structHash","type":"bytes32"},{"indexed":false,"internalType":"string","name":"domainName","type":"string"},{"indexed":false,"internalType":"string","name":"version","type":"string"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"}],"name":"CreatorAttribution","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lastOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Purchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"renderer","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"RendererUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"SetupNewToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"permissions","type":"uint256"}],"name":"UpdatedPermissions","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"components":[{"internalType":"uint32","name":"royaltyMintSchedule","type":"uint32"},{"internalType":"uint32","name":"royaltyBPS","type":"uint32"},{"internalType":"address","name":"royaltyRecipient","type":"address"}],"indexed":false,"internalType":"struct ICreatorRoyaltiesControl.RoyaltyConfiguration","name":"configuration","type":"tuple"}],"name":"UpdatedRoyalties","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"totalMinted","type":"uint256"}],"indexed":false,"internalType":"struct IZoraCreator1155TypesV1.TokenData","name":"tokenData","type":"tuple"}],"name":"UpdatedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"CONTRACT_BASE_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMISSION_BIT_ADMIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMISSION_BIT_FUNDS_MANAGER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMISSION_BIT_METADATA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMISSION_BIT_MINTER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMISSION_BIT_SALES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"permissionBits","type":"uint256"}],"name":"addPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"adminMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"quantities","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"adminMintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lastTokenId","type":"uint256"}],"name":"assumeLastTokenIdMatches","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"batchBalances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"callRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"contract IMinter1155","name":"salesConfig","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"callSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numTokens","type":"uint256"}],"name":"computeFreeMintRewards","outputs":[{"components":[{"internalType":"uint256","name":"creatorReward","type":"uint256"},{"internalType":"uint256","name":"createReferralReward","type":"uint256"},{"internalType":"uint256","name":"mintReferralReward","type":"uint256"},{"internalType":"uint256","name":"firstMinterReward","type":"uint256"},{"internalType":"uint256","name":"zoraReward","type":"uint256"}],"internalType":"struct RewardsSettings","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"numTokens","type":"uint256"}],"name":"computePaidMintRewards","outputs":[{"components":[{"internalType":"uint256","name":"creatorReward","type":"uint256"},{"internalType":"uint256","name":"createReferralReward","type":"uint256"},{"internalType":"uint256","name":"mintReferralReward","type":"uint256"},{"internalType":"uint256","name":"firstMinterReward","type":"uint256"},{"internalType":"uint256","name":"zoraReward","type":"uint256"}],"internalType":"struct RewardsSettings","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"numTokens","type":"uint256"}],"name":"computeTotalReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint96","name":"__gap1","type":"uint96"},{"internalType":"address payable","name":"fundsRecipient","type":"address"},{"internalType":"uint96","name":"__gap2","type":"uint96"},{"internalType":"contract ITransferHookReceiver","name":"transferHook","type":"address"},{"internalType":"uint96","name":"__gap3","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"createReferrals","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"customRenderers","outputs":[{"internalType":"contract IRenderer1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"premintConfig","type":"bytes"},{"internalType":"bytes32","name":"premintVersion","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"sender","type":"address"}],"name":"delegateSetupNewToken","outputs":[{"internalType":"uint256","name":"newTokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"delegatedTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"firstMinters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCreatorRewardRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCustomRenderer","outputs":[{"internalType":"contract IRenderer1155","name":"customRenderer","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"components":[{"internalType":"uint32","name":"royaltyMintSchedule","type":"uint32"},{"internalType":"uint32","name":"royaltyBPS","type":"uint32"},{"internalType":"address","name":"royaltyRecipient","type":"address"}],"internalType":"struct ICreatorRoyaltiesControl.RoyaltyConfiguration","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenInfo","outputs":[{"components":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"totalMinted","type":"uint256"}],"internalType":"struct IZoraCreator1155TypesV1.TokenData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"contractName","type":"string"},{"internalType":"string","name":"newContractURI","type":"string"},{"components":[{"internalType":"uint32","name":"royaltyMintSchedule","type":"uint32"},{"internalType":"uint32","name":"royaltyBPS","type":"uint32"},{"internalType":"address","name":"royaltyRecipient","type":"address"}],"internalType":"struct ICreatorRoyaltiesControl.RoyaltyConfiguration","name":"defaultRoyaltyConfiguration","type":"tuple"},{"internalType":"address payable","name":"defaultAdmin","type":"address"},{"internalType":"bytes[]","name":"setupActions","type":"bytes[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"role","type":"uint256"}],"name":"isAdminOrRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"metadataRendererContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IMinter1155","name":"minter","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address[]","name":"rewardsRecipients","type":"address[]"},{"internalType":"bytes","name":"minterArguments","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"contract IMinter1155","name":"minter","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes","name":"minterArguments","type":"bytes"},{"internalType":"address","name":"mintReferral","type":"address"}],"name":"mintWithRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"permissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"permissionBits","type":"uint256"}],"name":"removePermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"royalties","outputs":[{"internalType":"uint32","name":"royaltyMintSchedule","type":"uint32"},{"internalType":"uint32","name":"royaltyBPS","type":"uint32"},{"internalType":"address","name":"royaltyRecipient","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"fundsRecipient","type":"address"}],"name":"setFundsRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"contract IRenderer1155","name":"renderer","type":"address"}],"name":"setTokenMetadataRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITransferHookReceiver","name":"transferHook","type":"address"}],"name":"setTransferHook","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newURI","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"setupNewToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newURI","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"address","name":"createReferral","type":"address"}],"name":"setupNewTokenWithCreateReferral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supportedPremintSignatureVersions","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"string","name":"_newURI","type":"string"},{"internalType":"string","name":"_newName","type":"string"}],"name":"updateContractMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"updateCreateReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint32","name":"royaltyMintSchedule","type":"uint32"},{"internalType":"uint32","name":"royaltyBPS","type":"uint32"},{"internalType":"address","name":"royaltyRecipient","type":"address"}],"internalType":"struct ICreatorRoyaltiesControl.RoyaltyConfiguration","name":"newConfiguration","type":"tuple"}],"name":"updateRoyaltiesForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_newURI","type":"string"}],"name":"updateTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
61012034620001f457601f62005c3638819003918201601f1916830191906001600160401b03831184841017620001f9578160609285926040958652833981010312620001f45762000051826200020f565b6200006c8262000064602086016200020f565b94016200020f565b3060805261271060a0526001600160a01b039190821680158015620001e9575b620001d85760e05260c0526000549060ff8260081c16159182801590620001cb575b80620001b1575b620001a05760ff198116600117600055826200018d575b506101009316835262000152575b51615a11918262000225833960805182818161254a015281816125e00152612a36015260a05182613030015260c051828181614961015281816149c2015281816149ea01528181614abb01528181614b2a0152614b52015260e0518281816148dd0152614a3a0152518181816126550152612aa90152f35b61ff0019600054166000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986020825160018152a1620000da565b61ffff19166101011760005538620000cc565b8351633d5c224160e11b8152600490fd5b50303b151580620000b55750600160ff82161415620000b5565b5060ff81161515620000ae565b8351632d87658960e01b8152600490fd5b50828216156200008c565b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620001f45756fe60a0604052600436101561001b575b361561001957600080fd5b005b60e0600035811c908162fdd58e14613594578163011442011461357857816301ffc9a7146134ab57816306fdde03146133f05781630e89341c146133d157816310a7eb5d1461337257816313966db51461335057816313af4035146132e557816317bd48bb1461327557816318711c7d1461325957816318e97fd1146130db57816323bd0386146130895781632a55205a14612ff35781632eb2c2d614612cf0578163300ecdb914612ca7578163359f130214612c325781633659cfe614612a105781633ccfd60b146129505781634132239b146129035781634e1273f4146128025781634f1ef286146125a257816352d1902d146125375781635c046084146125185781635c60da1b146124e25781635d0f6cba146123cd5781635e4e0404146123af5781636661a9ba1461225c578163674cbae6146121d857816369a5b302146121a35781636b20c45414611f4c578163722933f714611ef257816375794a3c14611ed357816379502c5514611e785781637dafae4d14611e435781637f2dc61c14611d6d5781637f77f57414611d1d5781638a08eb4c146118535781638c7a63ae146117dc5781638da5cb5b146117b25781638ec998a014611754578163929a71281461173957816395d89b41146116db5781639c5c63c9146116475781639dbb844d146115ad5781639ebb832414611578578163a0a8e46014611532578163a22cb46514611493578163a453eaf014611477578163ac9650d8146113de578163afed7e9e14611242578163bb3bafd614611217578163bdd864f2146111dc578163c0464356146111c0578163c238d1ee14611165578163d1ad846b14610dc7578163d258609a14610d6c578163d904b94a14610bb2578163dd15e05f14610b7d578163e72878b414610b3a578163e74d86c214610b0a578163e8a3d48514610ad6578163e985e9c514610a80578163ed78891314610929578163ef71c82e146106b6578163f1b0d6bb1461069a578163f242432a1461038e575063f9ce91a40361000e5734610389576080366003190112610389576001600160401b0360043581811161038957610334903690600401613729565b906044359081116103895761034d9036906004016137f7565b909190606435906001600160a01b03821682036103895760209361037c93610373613cdd565b60243590615252565b6001606555604051908152f35b600080fd5b346103895760a0366003190112610389576103a76135c3565b906103b06135d9565b91604435606435916084356001600160401b038111610389576103d7903690600401613729565b6001600160a01b03918216949091903386141580610675575b61066357818716918215610651576101cb541690816105ce575b5050826000526020956097875260406000208660005287526040600020548581106105bc578590856000526097895260406000208860005289520360406000205583600052609787526040600020826000528752604060002061046e868254613a0a565b90558186604051868152878a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a43b6104aa57005b6104ee93600087946040519687958694859363f23a6e6160e01b9b8c865233600487015260248601526044850152606484015260a0608484015260a4830190613612565b03925af16000918161058d575b5061056a57505060019061050d613a5c565b6308c379a014610531575b5061051f57005b6040516377d5b49160e11b8152600490fd5b610539613a7a565b90816105455750610518565b61056660405192839262461bcd60e51b845260048401526024830190613612565b0390fd5b6001600160e01b03191614905061001957604051633fbfe7f560e21b8152600490fd5b6105ae919250843d86116105b5575b6105a681836136b6565b810190613a3c565b90846104fb565b503d61059c565b604051636eaa1ea960e11b8152600490fd5b813b156103895760009060405192839163417b2f9760e11b83523060048401523360248401528960448401528560648401528760848401528860a484015260c483015281838161062160e482018a613612565b03925af1801561064557610636575b8061040a565b61063f90613688565b86610630565b6040513d6000823e3d90fd5b604051631c53f61160e21b8152600490fd5b604051633e2ea01560e21b8152600490fd5b5085600052609860205260406000203360005260205260ff60406000205416156103f0565b3461038957600036600319011261038957602060405160048152f35b34610389576040366003190112610389576001600160401b03600435818111610389576106e7903690600401613729565b602435828111610389576106ff903690600401613729565b3360009081526000805160206159bc833981519152602090815260409091205491939091601216158015906101fe90610905575b50156108df57600080526101c6825260406000209083519081116108c95761075b8254613bfd565b601f8111610883575b5082601f82116001146107f657927f74b7c2afa3f89c562b59674a101e2c48bceeb27cdb620afefa14446f1ffa487b9492826107e6936107d7966000916107eb575b508160011b916000199060031b1c19161790555b6107c386613d33565b604051938493604085526040850190613612565b90838203908401523395613612565b0390a2005b9050850151896107a6565b601f1982169083600052846000209160005b81811061086c5750836107d796937f74b7c2afa3f89c562b59674a101e2c48bceeb27cdb620afefa14446f1ffa487b9896936107e69660019410610853575b5050811b0190556107ba565b87015160001960f88460031b161c191690558980610847565b91928660018192868b015181550194019201610808565b8260005283600020601f830160051c8101918584106108bf575b601f0160051c01905b8181106108b35750610764565b600081556001016108a6565b909150819061089d565b634e487b7160e01b600052604160045260246000fd5b604051634baa2a4d60e01b81523360048201526000602482015260106044820152606490fd5b90506000805282526040600020336000528252601260406000205416151585610733565b346103895760003660031901126103895760405163ed78891360e01b815260008160048173ecfbcf718e17b6e76a675ddb936a9249c69dd2aa5af4908115610645576000916109d5575b5060405160209182820192808352815180945260408301938160408260051b8601019301916000955b8287106109a95785850386f35b9091929382806109c5600193603f198a82030186528851613612565b960192019601959291909261099c565b90503d806000833e6109e781836136b6565b810160209081838203126103895782516001600160401b0393848211610389570181601f82011215610389578051610a1e81613747565b94610a2c60405196876136b6565b818652848087019260051b8401019380851161038957858401925b858410610a5b575050505050505081610973565b8351838111610389578791610a75848480948a0101614352565b815201930192610a47565b3461038957604036600319011261038957610a996135c3565b610aa16135d9565b9060018060a01b03809116600052609860205260406000209116600052602052602060ff604060002054166040519015158152f35b3461038957600036600319011261038957610b06610af2614f3c565b604051918291602083526020830190613612565b0390f35b34610389576020366003190112610389576020610b286004356156c8565b6040516001600160a01b039091168152f35b34610389576020366003190112610389576004356000196101c8540190808203610b6057005b60449160405191634fa09b3f60e01b835260048301526024820152fd5b346103895760203660031901126103895760043560005261012d602052602060018060a01b0360406000205416604051908152f35b3461038957606036600319011261038957600435610bce6135d9565b906044356001600160401b03811161038957610bee9036906004016137f7565b91806000526101fe936020948086526040600020336000528652600a604060002054161590811591610d48575b5015610d22576001600160a01b031690610c358183613f51565b6040516301ffc9a760e01b8152636890e5b360e01b60048201528581602481865afa90811561064557600091610cf5575b5015610cdc578360241161038957600483013503610cca5782600080949381946040519384928337810182815203925af190610ca0613987565b9115610ca857005b61056660405192839263a5fa8d2b60e01b845260048401526024830190613612565b60405163fe486c2b60e01b8152600490fd5b6040516370adc70360e11b815260048101839052602490fd5b610d159150863d8811610d1b575b610d0d81836136b6565b810190614bfc565b86610c66565b503d610d03565b604051634baa2a4d60e01b81523360048201526024810183905260086044820152606490fd5b90506000805285526040600020336000528552600a60406000205416151586610c1b565b34610389576040366003190112610389576004356001600160401b0381116103895761037c610da160209236906004016137f7565b610daa33613ecb565b610db2613cdd565b610dc233926024359236916136f2565b613fca565b346103895760031960803682011261038957610de16135c3565b916001600160401b0360243581811161038957610e029036906004016137ac565b9260443582811161038957610e1b9036906004016137ac565b9160643590811161038957610e34903690600401613729565b91610e3d613cdd565b3360009081526000805160206159bc8339815191526020908152604082205460061615959094915b8751811015610e9a57610e7c9087610e8157614343565b610e65565b610e95610e8e828b6139f6565b5133613f51565b614343565b508694955087855160005b8181106111055750506001600160a01b038181169283156110f357875191865183036110e1576101cb54168061104a575b505060005b81811061100757505081600060405160008051602061591c833981519152339180610f078a8d83613a17565b0390a43b610f17575b6001606555005b610f6760008794610f7660405197889687958694610f5763bc197c8160e01b9d8e885233600489015288602489015260a0604489015260a4880190613882565b9084878303016064880152613882565b91848303016084850152613612565b03925af160009181610fe8575b50610fc5575050600190610f95613a5c565b6308c379a014610fb1575b5061051f575b808080808080610f10565b610fb9613a7a565b90816105455750610fa0565b6001600160e01b031916149050610fa657604051633fbfe7f560e21b8152600490fd5b611000919250843d86116105b5576105a681836136b6565b9084610f83565b80611014600192886139f6565b5161101f828b6139f6565b5160005260978b526040600020866000528b526110426040600020918254613a0a565b905501610edb565b803b15610389578860009161109d9383886110bd8d6110ad8e6040519a8b998a988997634058856760e11b89523060048a01523360248a01528960448a01526064890152608488015260e4870190613882565b90838683030160a4870152613882565b908382030160c48401528c613612565b03925af18015610645576110d2575b80610ed6565b6110db90613688565b886110cc565b60405163f9532c3960e01b8152600490fd5b6040516310227bb960e31b8152600490fd5b80611128611116611160938b6139f6565b51611121838a6139f6565b5190614e5c565b61113281886139f6565b5161113d828b6139f6565b516000526101c68b526111596002604060002001918254613a0a565b9055614343565b610ea5565b346103895760803660031901126103895761117e6135c3565b602435606435916001600160401b038311610389576111a4610f10933690600401613729565b916111ad613cdd565b6111b78133613f51565b60443591614c14565b3461038957600036600319011261038957602060405160028152f35b346103895760203660031901126103895760043563ffffffff8116809103610389576000526102336020526020604060002054604051908152f35b3461038957602036600319011261038957610b066112366004356156fd565b6040519182918261390f565b34610389576080366003190112610389576004356060366023190112610389576040519061126f82613637565b63ffffffff60243581811681036103895783526044358181168103610389576020848101918252606435906001600160a01b0380831683036103895760408701928352856000526101fe808352604060002033600052835260226040600020541615908115916113ba575b5015611396578487511661138d575b8251161580611381575b61136f5784600052610160815263ffffffff60201b6040600020948751169185549451901b1691600160401b600160e01b03905160401b169263ffffffff60e01b1617171790557f5837d55897cfc337f160a71d7b63a047abd50a3a8834f1c5d70f338846358c6d6040518061136a33958261390f565b0390a3005b604051630d9b92f160e01b8152600490fd5b508383511615156112f3565b600087526112e9565b6064868360405191634baa2a4d60e01b835233600484015260248301526044820152fd5b905060008052825260406000203360005282526022604060002054161515886112da565b3461038957602080600319360112610389576004356001600160401b038111610389576114126114189136906004016137c7565b906157c5565b6040519082820192808352815180945260408301938160408260051b8601019301916000955b82871061144b5785850386f35b909192938280611467600193603f198a82030186528851613612565b960192019601959291909261143e565b3461038957600036600319011261038957602060405160108152f35b34610389576040366003190112610389576114ac6135c3565b60243590811515809203610389576001600160a01b03169033821461152057336000526098602052604060002082600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b604051636b3fa0d960e11b8152600490fd5b3461038957600036600319011261038957610b066040516115528161366d565b60058152640322e372e360dc1b6020820152604051918291602083526020830190613612565b3461038957602036600319011261038957600435600052610232602052602060018060a01b0360406000205416604051908152f35b60a0366003190112610389576115c16135c3565b6064356001600160401b038111610389576115e09036906004016137f7565b906084359260018060a01b038416809403610389576115fd613cdd565b6040519061160a8261366d565b600182526020820194602036873782511561163157610f10955260443590602435906143b5565b634e487b7160e01b600052603260045260246000fd5b34610389576040366003190112610389576004356024356001600160401b0381116103895760009161167e83923690600401613729565b906116898133613e44565b6001600160a01b039061169b906156c8565b1682602083519301915af16116ae613987565b90156116b657005b60405163a5fa8d2b60e01b815260206004820152908190610566906024830190613612565b346103895760003660031901126103895760405160208082528160605191828183015260005b8381106117235750508160006040809484010152601f80199101168101030190f35b6080810151858201604001528492508101611701565b34610389576000366003190112610389576020604051818152f35b3461038957611762366138b6565b9161176d81336142e1565b60008181526101fe602090815260408083206001600160a01b03959095168084529490915281208054949094179384905560008051602061595c8339815191529080a4005b34610389576000366003190112610389576101c9546040516001600160a01b039091168152602090f35b34610389576020366003190112610389576000604080516117fc81613637565b6060815282602082015201526004356000526101c6602052610b06604060002060026040519161182b83613637565b61183481613c37565b83526001810154602084015201546040820152604051918291826138e0565b3461038957366003190112610389576004356001600160401b03811161038957611881903690600401613729565b6024356001600160401b038111610389576118a0903690600401613729565b6060366043190112610389576040516118b881613637565b60443563ffffffff8116810361038957815260643563ffffffff811681036103895760208201526084356001600160a01b038116810361038957604082015260a4356001600160a01b03811690036103895760c4356001600160401b038111610389576119299036906004016137c7565b9091611933613cdd565b60005493600885901c60ff1615801590611d11575b80611cf9575b611ce757600160ff1986161760005560ff8560081c1615611cd5575b60ff60005460081c1615611cc457600160655561199160a4356001600160a01b0316615685565b6101c890815491600183019055604051906119ab82613637565b81526000602082015260006040820152816000526101c6602052604060002081518051906001600160401b0382116108c95781906119e98454613bfd565b601f8111611c74575b50602090601f8311600114611c0857600092611bfd575b50508160011b916000199060031b1c19161781555b60208201516001820155600260408301519101557f5086d1bcea28999da9875111e3592688fbfa821db63214c695ca35768080c2fe60405180611a623394826138e0565b0390a363ffffffff815116611bf4575b60408101516001600160a01b03161580611be1575b61136f5760ff94611b3a9160008052610160602052604060002063ffffffff82511681549063ffffffff60201b602085015160201b1690600160401b600160e01b03604086015160401b169263ffffffff60e01b16171717905560007f5837d55897cfc337f160a71d7b63a047abd50a3a8834f1c5d70f338846358c6d60405180611b1333958261390f565b0390a3611b2a60a4356001600160a01b03166150f9565b611b3560a435615175565b613d33565b80611b8d575b505060081c1615611b52576001606555005b61ff0019600054166000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a1610f10565b611b9f91611b9a33615685565b6157c5565b503360008181526000805160206159bc8339815191526020526040812080546002191690819055919060008051602061595c8339815191528180a48280611b40565b5063ffffffff6020820151161515611a87565b60008152611a72565b015190508a80611a09565b9250836000526020600020906000935b601f1984168510611c59576001945083601f19811610611c40575b505050811b018155611a1e565b015160001960f88460031b161c191690558a8080611c33565b81810151835560209485019460019093019290910190611c18565b909150836000526020600020601f840160051c810160208510611cbd575b90849392915b601f830160051c82018110611cae5750506119f2565b60008155859450600101611c98565b5080611c92565b6040516296bfb160e81b8152600490fd5b61ffff1985166101011760005561196a565b604051633d5c224160e11b8152600490fd5b50303b15158061194e5750600160ff8616141561194e565b5060ff85161515611948565b346103895760203660031901126103895760043560005261016060205260606040600020546040519063ffffffff80821683528160201c16602083015260018060a01b039060401c166040820152f35b34610389576020366003190112610389576004356001600160a01b0381169081900361038957611d9c3361425b565b80611dd8575b6101cb80546001600160a01b0319169091179055604051600290339060008051602061593c833981519152908061136a81614ed1565b6040516301ffc9a760e01b815262123aaf60e51b6004820152602081602481855afa90811561064557600091611e25575b50611da2576024906040519062be74ab60e51b82526004820152fd5b611e3d915060203d8111610d1b57610d0d81836136b6565b82611e09565b3461038957602036600319011261038957600435600052610231602052602060018060a01b0360406000205416604051908152f35b346103895760003660031901126103895760c06101c9546101ca54906101cb54906040519260018060a01b0391828116855260a01c6020850152818116604085015260a01c60608401528116608083015260a01c60a0820152f35b346103895760003660031901126103895760206101c854604051908152f35b3461038957602036600319011261038957610b06611f11600435613b3c565b6040519182918291909160808060a0830194805184526020810151602085015260408101516040850152606081015160608501520151910152565b346103895760031960603682011261038957611f666135c3565b906001600160401b039060243582811161038957611f889036906004016137c7565b94909260443590811161038957611fa39036906004016137c7565b6001600160a01b039686881696919591338814158061217e575b6121605750611fda9291611fd291369161375e565b94369161375e565b94841561214e57835192865184036110e15760405191611ff98361369b565b600083526101cb5416806120b6575b5050505060005b81811061204957505060008051602061591c83398151915261203b600094604051918291339583613a17565b0390a461001960405161369b565b61205381846139f6565b519061205f81876139f6565b5182600052609760208181526040600020886000528152604060002054918383106120a45760019560005281526040600020908860005252036040600020550161200f565b604051632fc4b76160e11b8152600490fd5b803b156103895761210993600088612128899583976121198e6040519b8c9a8b998a98634058856760e11b8a523060048b01523360248b015260448a01528960648a0152608489015260e4880190613882565b90848783030160a4880152613882565b918483030160c4850152613612565b03925af180156106455761213f575b808080612008565b61214890613688565b84612137565b6040516345d40ad560e01b8152600490fd5b6040516341ce11f960e11b8152908190610566903360048401614eb7565b5087600052609860205260406000203360005260205260ff6040600020541615611fbd565b34610389576020366003190112610389576004356000526101c7602052602060018060a01b0360406000205416604051908152f35b34610389576060366003190112610389576004356001600160401b038111610389576122089036906004016137f7565b6044356001600160a01b03811691908290036103895760209261222e91610daa33613ecb565b6000818152610231845260409081902080546001600160a01b03191690931790925560016065559051908152f35b34610389576040366003190112610389576004356024356001600160a01b038116908190036103895761228d613cdd565b6122978233613e44565b600082815261012d6020908152604090912080546001600160a01b031916831790559080612344575b6040513382857f5010f780a0de79bcfb9f3d6fec3cfe29758ef5c5800d575af709bc590bd78ade600080a48361232257507f56e810c8cae84731149f628981d25769a084570b9ba6eebf3c32879e3dce56099250604051908152a16001606555005b6040915060008360008051602061597c833981519152948352820152a2610f10565b6040516301ffc9a760e01b8152633de3f32360e11b60048201528281602481855afa90811561064557600091612392575b506122c0576024906040519063da755beb60e01b82526004820152fd5b6123a99150833d8511610d1b57610d0d81836136b6565b84612375565b34610389576020366003190112610389576020610b28600435614b94565b34610389576123db366138b6565b6123e7839293336142e1565b60008281526101fe602081815260408084206001600160a01b0397881680865290835290842080549519909516948590559094919390928390839060008051602061595c8339815191529080a41591826124d3575b826124ae575b505061244a57005b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09160006040926101c99283549360018060a01b031985169055845193168352820152a1600060405160008051602061593c83398151915233918061136a81614ed1565b9091506000805282526040600020906000528152600260406000205416158380612442565b6101c95485168214925061243c565b346103895760003660031901126103895760008051602061599c833981519152546040516001600160a01b039091168152602090f35b3461038957602036600319011261038957610b06611f11600435613b9d565b34610389576000366003190112610389577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361259057602060405160008051602061599c8339815191528152f35b604051635e4c25f160e01b8152600490fd5b6040366003190112610389576125b66135c3565b6024356001600160401b038111610389576125d5903690600401613729565b906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116903082146127f05760008051602061599c83398151915290808254169283036127de57839261262f3361425b565b604051906321f7434760e01b82528180612650602097889460048401614eb7565b0381857f0000000000000000000000000000000000000000000000000000000000000000165afa908115610645576000916127c1575b5015610389577f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126c3575050506100199150613940565b8316906040516352d1902d60e01b81528381600481865afa60009181612792575b506126fb5760405163e5ec176960e01b8152600490fd5b036127805761270983613940565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2835115801590612778575b61274357005b823b15612769575082600092839261001995519201905af4612763613987565b90613ae8565b63369891e760e01b8152600490fd5b50600161273d565b6040516308373ebf60e41b8152600490fd5b9091508481813d83116127ba575b6127aa81836136b6565b81010312610389575190876126e4565b503d6127a0565b6127d89150843d8611610d1b57610d0d81836136b6565b86612686565b6040516364cd8d1960e01b8152600490fd5b604051631932df4560e01b8152600490fd5b34610389576040366003190112610389576001600160401b03600435818111610389573660238201121561038957612844903690602481600401359101613824565b906024359081116103895761285d9036906004016137ac565b815190805182036128f15761287182613747565b9261287f60405194856136b6565b828452601f1961288e84613747565b0136602086013760005b8381106128b55760405160208082528190610b0690820188613882565b6001906128e06001600160a01b036128cd83866139f6565b51166128d983876139f6565b51906139b7565b6128ea82886139f6565b5201612898565b60405163133933f760e21b8152600490fd5b34610389576020366003190112610389576602c2ad68fd900060043581810291811591830414171561293a57602090604051908152f35b634e487b7160e01b600052601160045260246000fd5b346103895760003660031901126103895761296a3361562d565b80156129e8575b156129c2574760018060a01b03906101ca91600080808085858854166204baf0f161299a613987565b50156129a257005b915460405163292264c360e21b8152921660048301526024820152604490fd5b604051634baa2a4d60e01b81523360048201526000602482015260206044820152606490fd5b503360009081526000805160206159bc83398151915260205260409020546022161515612971565b346103895760208060031936011261038957612a2a6135c3565b906001600160a01b03907f00000000000000000000000000000000000000000000000000000000000000008216903082146127f05760008051602061599c83398151915291838354169081036127de578185612aa492612a893361425b565b6040516321f7434760e01b8152938492839260048401614eb7565b0381877f0000000000000000000000000000000000000000000000000000000000000000165afa90811561064557600091612c15575b50156103895760405191818301938385106001600160401b038611176108c957846040526000845260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435416600014612b3c57505050505061001990613940565b6040516352d1902d60e01b8152908616928082600481875afa918291600093612be5575b5050612b785760405163e5ec176960e01b8152600490fd5b0361278057612b8684613940565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590612bdd575b612bc057005b833b15612769575061001992600092839251915af4612763613987565b506000612bba565b9080929350813d8311612c0e575b612bfd81836136b6565b810103126103895751908780612b60565b503d612bf3565b612c2c9150823d8411610d1b57610d0d81836136b6565b85612ada565b60a036600319011261038957612c466135c3565b6001600160401b039060643582811161038957612c679036906004016137c7565b909160843593841161038957612c99612c87610f109536906004016137f7565b949093612c92613cdd565b3691613824565b9060443590602435906143b5565b3461038957604036600319011261038957612cc06135d9565b6004356000526101fe60205260406000209060018060a01b03166000526020526020604060002054604051908152f35b346103895760031960a03682011261038957612d0a6135c3565b612d126135d9565b906001600160401b039060443582811161038957612d349036906004016137ac565b9260643583811161038957612d4d9036906004016137ac565b9260843590811161038957612d66903690600401613729565b6001600160a01b03928316969091903388141580612fce575b61066357855190855182036128f157848316948515610651576101cb541680612f47575b505060005b818110612ec6575050828760405160008051602061591c833981519152339180612dd38a8c83613a17565b0390a43b612ddd57005b6000602094612e1f610f6797610f5794604051998a988997889663bc197c8160e01b9e8f89523360048a0152602489015260a0604489015260a4880190613882565b03925af160009181612ea6575b50612e855750506001612e3d613a5c565b6308c379a014612e4e575b61051f57005b612e56613a7a565b80612e615750612e48565b60405162461bcd60e51b815260206004820152908190610566906024830190613612565b6001600160e01b0319161461001957604051633fbfe7f560e21b8152600490fd5b612ebf91925060203d81116105b5576105a681836136b6565b9083612e2c565b612ed081886139f6565b5190612edc81886139f6565b518260005260206097815260406000208c6000528152604060002054908282106105bc57846001956000526097825260406000208a60005282526040600020612f26858254613a0a565b9055600052609781526040600020908d600052520360406000205501612da8565b803b1561038957879160009187838d612faa8e612f9a8e61109d6040519b8c9a8b998a98634058856760e11b8a523060048b01523360248b015260448a01526064890152608488015260e4870190613882565b908382030160c48401528b613612565b03925af1801561064557612fbf575b80612da3565b612fc890613688565b88612fb9565b5087600052609860205260406000203360005260205260ff6040600020541615612d7f565b34610389576040366003190112610389576024356130126004356156fd565b9063ffffffff60208301511681810291818304149015171561293a577f000000000000000000000000000000000000000000000000000000000000000080156130735760409283015183516001600160a01b03909116815291046020820152f35b634e487b7160e01b600052601260045260246000fd5b34610389576060366003190112610389576130a26135c3565b6024356000526101fe60205260406000209060018060a01b03166000526020526020604435600217604060002054161515604051908152f35b34610389576040366003190112610389576001600160401b036004356024358281116103895761310f903690600401613729565b9161311a8233613e44565b811561038957604051918060008051602061597c8339815191526020948581528061314787820189613612565b0390a26000526101c6825260406000209183519182116108c95761316b8354613bfd565b601f8111613213575b5080601f83116001146131b057508192936000926131a5575b5050600019600383901b1c191660019190911b179055005b01519050838061318d565b90601f198316948460005282600020926000905b8782106131fb5750508360019596106131e2575b505050811b019055005b015160001960f88460031b161c191690558380806131d8565b806001859682949686015181550195019301906131c4565b8360005281600020601f840160051c81019183851061324f575b601f0160051c01905b8181106132435750613174565b60008155600101613236565b909150819061322d565b3461038957600036600319011261038957602060405160088152f35b34610389576040366003190112610389576004356132916135d9565b90806000526102318060205260018060a01b0391826040600020541633036132d3576000526020526040600020911660018060a01b0319825416179055600080f35b604051632afb0ecf60e01b8152600490fd5b34610389576020366003190112610389576132fe6135c3565b6133073361425b565b6001600160a01b03811660009081526000805160206159bc83398151915260205260409020546002161561333e57610019906150f9565b60405163131dd3a760e31b8152600490fd5b346103895760003660031901126103895760206040516602c2ad68fd90008152f35b346103895760203660031901126103895761338b6135c3565b6133943361562d565b80156133a9575b156129c25761001990615175565b503360009081526000805160206159bc8339815191526020526040902054602216151561339b565b3461038957602036600319011261038957610b06610af2600435615087565b346103895760003660031901126103895760405160009061019380549061341682613bfd565b9081845260019283811690816000146134835750600114613442575b610b0684610af2818803826136b6565b90935060005260209283600020916000925b8284106134705750505081610b0693610af29282010193613432565b8054858501870152928501928101613454565b610b069650610af29450602092508593915060ff191682840152151560051b82010193613432565b346103895760203660031901126103895760043563ffffffff60e01b81168091036103895760209063152a902d60e11b8114908115613567575b8115613527575b8115613516575b8115613505575b506040519015158152f35b631acf898160e11b149050826134fa565b6314b618b760e01b811491506134f3565b9050636cdb3d1360e11b81148015613557575b8015613547575b906134ec565b506301ffc9a760e01b8114613541565b506303a24d0760e21b811461353a565b6304aca5db60e51b811491506134e5565b3461038957600036600319011261038957602060405160008152f35b346103895760403660031901126103895760206135bb6135b26135c3565b602435906139b7565b604051908152f35b600435906001600160a01b038216820361038957565b602435906001600160a01b038216820361038957565b60005b8381106136025750506000910152565b81810151838201526020016135f2565b9060209161362b815180928185528580860191016135ef565b601f01601f1916010190565b606081019081106001600160401b038211176108c957604052565b60a081019081106001600160401b038211176108c957604052565b604081019081106001600160401b038211176108c957604052565b6001600160401b0381116108c957604052565b602081019081106001600160401b038211176108c957604052565b90601f801991011681019081106001600160401b038211176108c957604052565b6001600160401b0381116108c957601f01601f191660200190565b9291926136fe826136d7565b9161370c60405193846136b6565b829481845281830111610389578281602093846000960137010152565b9080601f8301121561038957816020613744933591016136f2565b90565b6001600160401b0381116108c95760051b60200190565b929161376982613747565b9161377760405193846136b6565b829481845260208094019160051b810192831161038957905b82821061379d5750505050565b81358152908301908301613790565b9080601f83011215610389578160206137449335910161375e565b9181601f84011215610389578235916001600160401b038311610389576020808501948460051b01011161038957565b9181601f84011215610389578235916001600160401b038311610389576020838186019501011161038957565b929161382f82613747565b9161383d60405193846136b6565b829481845260208094019160051b810192831161038957905b8282106138635750505050565b81356001600160a01b0381168103610389578152908301908301613856565b90815180825260208080930193019160005b8281106138a2575050505090565b835185529381019392810192600101613894565b606090600319011261038957600435906024356001600160a01b0381168103610389579060443590565b60208152606060406138fd84518360208601526080850190613612565b93602081015182850152015191015290565b9190916040606082019363ffffffff80825116845260208201511660208401528160018060a01b0391015116910152565b803b156139755760008051602061599c83398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405163529880eb60e01b8152600490fd5b3d156139b2573d90613998826136d7565b916139a660405193846136b6565b82523d6000602084013e565b606090565b6001600160a01b03169081156139e457600052609760205260406000209060005260205260406000205490565b604051632188330d60e21b8152600490fd5b80518210156116315760209160051b010190565b9190820180921161293a57565b9091613a2e61374493604084526040840190613882565b916020818403910152613882565b9081602091031261038957516001600160e01b0319811681036103895790565b60009060033d11613a6957565b905060046000803e60005160e01c90565b600060443d1061374457604051600319913d83016004833e81516001600160401b03918282113d602484011117613ad757818401948551938411613adf573d85010160208487010111613ad75750613744929101602001906136b6565b949350505050565b50949350505050565b15613af05790565b805115613aff57805190602001fd5b6040516350a28c9b60e11b8152600490fd5b60405190613b1e82613652565b60006080838281528260208201528260408201528260608201520152565b613b44613b11565b5066012edc9ab5d00090818102918115908284041481171561293a576564f43391f00080830292830414171561293a5760405191613b8183613652565b8252806020830152806040830152806060830152608082015290565b613ba5613b11565b5065c9e86723e000808202908215908383041481171561293a576564f43391f00080840293840414171561293a5760405191613be083613652565b600083528160208401528160408401526060830152608082015290565b90600182811c92168015613c2d575b6020831014613c1757565b634e487b7160e01b600052602260045260246000fd5b91607f1691613c0c565b9060405191826000825492613c4b84613bfd565b908184526001948581169081600014613cba5750600114613c77575b5050613c75925003836136b6565b565b9093915060005260209081600020936000915b818310613ca2575050613c7593508201013880613c67565b85548884018501529485019487945091830191613c8a565b915050613c7594506020925060ff191682840152151560051b8201013880613c67565b600260655414613cee576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9081516001600160401b0381116108c95761019390613d528254613bfd565b601f8111613dfc575b50602080601f8311600114613d98575081929394600092613d8d575b50508160011b916000199060031b1c1916179055565b015190503880613d77565b90601f198316958460005282600020926000905b888210613de457505083600195969710613dcb575b505050811b019055565b015160001960f88460031b161c19169055388080613dc1565b80600185968294968601518155019501930190613dac565b600083815260208120601f840160051c81019260208510613e3a575b601f0160051c01915b828110613e2f575050613d5b565b818155600101613e21565b9092508290613e18565b9060008181526101fe9081602052604081209360018060a01b03169384825260205260126040822054161591821592613ea8575b505015613e83575050565b6064925060405191634baa2a4d60e01b83526004830152602482015260106044820152fd5b601292509060409181805260205281812085825260205220541615153880613e78565b6001600160a01b031660008181526000805160206159bc8339815191526020526040812054600616158015906101fe90613f2f575b5015613f0a575050565b6064925060405191634baa2a4d60e01b83526004830152602482015260046044820152fd5b9050818052602052604081208282526020526006604082205416151538613f00565b90613f5c828261565a565b8015613f99575b15613f6c575050565b6064925060405191634baa2a4d60e01b835260018060a01b03166004830152602482015260046044820152fd5b506001600160a01b03821660009081526000805160206159bc83398151915260205260409020546006161515613f63565b9092916101c89182549260018401905560405194613fe786613637565b81865280602087015260006040870152836000526101c660205260406000209580519687516001600160401b0381116108c9576140248254613bfd565b98601f8a11614213575b87989950600097969750602090601f831160011461417d57928288937f1b944478023872bf91b25a13fdba3a686fdb1bf4dbb872f850240fad4b8cc0689896936141399896600092614172575b50508160011b916000199060031b1c19161781555b60208201516001820155600260408301519101557f5086d1bcea28999da9875111e3592688fbfa821db63214c695ca35768080c2fe604051806140d43394826138e0565b0390a360008581526101fe602090815260408083206001600160a01b0399909916808452989091528120805460021790819055908790879060008051602061595c8339815191529080a48151614145575b604051928392604084526040840190613612565b9060208301520390a390565b8460008051602061597c833981519152604051602081528061416a6020820187613612565b0390a2614125565b01519050388061407b565b908360005260206000209160005b601f19851681106141f85750837f1b944478023872bf91b25a13fdba3a686fdb1bf4dbb872f850240fad4b8cc0689896936141399896936001938c97601f198116106141df575b505050811b018155614090565b015160001960f88460031b161c191690553880806141d2565b8183015184558b99506001909301926020928301920161418b565b826000526020600020601f830160051c81019a60208410614251575b601f0160051c01995b8a8110614245575061402e565b60008155600101614238565b909a508a9061422f565b6001600160a01b031660008181526000805160206159bc8339815191526020526040812054600216158015906101fe906142bf575b501561429a575050565b6064925060405191634baa2a4d60e01b83526004830152602482015260026044820152fd5b9050818052602052604081208282526020526002604082205416151538614290565b9060008181526101fe9081602052604081209360018060a01b03169384825260205260026040822054161591821592614320575b50501561429a575050565b600292509060409181805260205281812085825260205220541615153880614315565b600019811461293a5760010190565b81601f82011215610389578051614368816136d7565b9261437660405194856136b6565b818452602082840101116103895761374491602080850191016135ef565b908060209392818452848401376000828201840152601f01601f1916010190565b949591929091906143cf6001600160a01b0387168461565a565b801561481a575b156147e957600081511580156147b7575b5061446a915061442d6000916143fc86614b94565b86845261023160209081526040808620546102329092528520546001600160a01b039081169392911690893461484b565b9560405180938192636890e5b360e01b835260049b338d8501528860248501528960448501528a606485015260a0608485015260a4840191614394565b0381836001600160a01b038b165af190811561064557600091614632575b50519260005b84518110156145ec576144a181866139f6565b51516144ac81614bc8565b6144b581614bc8565b60018103614548575060206144ca82876139f6565b5101516040818051810103126103895760406144e860208301614be8565b91015190818811614537576000918291829182916001600160a01b03166204baf0f1614512613987565b50156145265761452190614343565b61448e565b6040516338dcead760e21b81528890fd5b604051631913cf3760e21b81528a90fd5b80614554600292614bc8565b036145e357602061456582876139f6565b5101519060609182818051810103126103895761458460208201614be8565b926040820151910151908680151591826145d8575b50506145c75761452192610e959187604051926145b58461369b565b600084526001600160a01b0316614c14565b604051634cdcfbf960e01b81528a90fd5b141590508638614599565b61452190614343565b506040805191825234602083015291965091946001600160a01b031693503392507fb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e91a4565b903d918282823e61464383826136b6565b60208184810103126147ac578051916001600160401b0383116147b457604083830185840103126147b4576040519361467b8561366d565b838301516001600160401b0381116147b057818401601f82878701010112156147b057808585010151916146ae83613747565b936146bc60405195866136b6565b838552602085019282870160208660051b838b8b01010101116147ac576020818989010101935b60208660051b838b8b0101010185106147115750505050505090602092918452010151602082015238614488565b84516001600160401b0381116147a8576040898b0184018201868b0103601f1901126147a857604051906147448261366d565b602081858d8d010101015160038110156147a4578252604081858d8d0101010151906001600160401b0382116147a45792602093926147938c868f9581978a83988e8601950101010101614352565b8382015281520195019490506146e3565b8580fd5b8380fd5b5080fd5b8280fd5b80fd5b6147d557506020015161446a906001600160a01b031661442d6143e7565b634e487b7160e01b81526032600452602490fd5b604051634baa2a4d60e01b81526001600160a01b038716600480830191909152602482018590526044820152606490fd5b506001600160a01b03861660009081526000805160206159bc833981519152602052604090205460061615156143d6565b9394919060009485966602c2ad68fd900094858402958487041484151715614b80576001600160a01b039281841615614b78575b8681101561489957604051633b78763760e21b8152600490fd5b808703614a105750828792816148af8297613b3c565b9916156149e8575b16156149c0575b86519360208801519060408901519160608a0151946080809b015197877f000000000000000000000000000000000000000000000000000000000000000016998a3b156149bc579388969360648f9d9c9a968f906101449d9b9996899687809360405180875263faa3516f60e01b905216600485510152602484510152166044825101525101521660848c51015260a48b5101521660c48951015260e4885101527f000000000000000000000000000000000000000000000000000000000000000016610104875101526101248651015284519283915af180156149b1576149a557505090565b61374491925051613688565b6040513d84823e3d90fd5b8d80fd5b7f000000000000000000000000000000000000000000000000000000000000000093506148be565b7f000000000000000000000000000000000000000000000000000000000000000093506148b7565b9795985092918681979295509481614a288295613b9d565b931615614b50575b1615614b28575b857f000000000000000000000000000000000000000000000000000000000000000016926020820151926040830151906080606085015194015194863b15614b245760405163faa3516f60e01b8152600481018a9052602481018a9052978a16604489015260648801528816608487015260a4860152861660c485015260e48401527f0000000000000000000000000000000000000000000000000000000000000000909416610104830152610124820193909352918190839081875a9261014493f1908115614b185750614b0b57500390565b614b1490613688565b0390565b604051903d90823e3d90fd5b8880fd5b7f00000000000000000000000000000000000000000000000000000000000000009150614a37565b7f00000000000000000000000000000000000000000000000000000000000000009550614a30565b85915061487f565b634e487b7160e01b88526011600452602488fd5b6001600160a01b03908190604090614bab906156fd565b01511680614bc357506101ca54168061374457503090565b905090565b60031115614bd257565b634e487b7160e01b600052602160045260246000fd5b51906001600160a01b038216820361038957565b90816020910312610389575180151581036103895790565b90614c1f8382614e5c565b6000918183526020936101c68552604095600287862001614c41838254613a0a565b90556001600160a01b0383811693908415614e4b576101cb541680614dce575b50848652609787528786208487528752878620614c7f848254613a0a565b905583868951878152858a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628b3392a43b614cc1575b50505050505050565b614d0392869286895180968195829463f23a6e6160e01b9a8b85523360048601528560248601526044850152606484015260a0608484015260a4830190613612565b03925af1839181614daf575b50614d86575050600191614d21613a5c565b6308c379a014614d50575b5050614d4057505b38808080808080614cb8565b516377d5b49160e11b8152600490fd5b614d58613a7a565b9182614d645750614d2c565b8461056691505192839262461bcd60e51b845260048401526024830190613612565b6001600160e01b031916039150614d9f90505750614d34565b51633fbfe7f560e21b8152600490fd5b614dc7919250853d87116105b5576105a681836136b6565b9038614d0f565b803b15614e4757868951809263417b2f9760e11b82523060048301523360248301528260448301528760648301528860848301528660a483015260e060c4830152818381614e1f60e482018a613612565b03925af18015614e3d5715614c6157614e3790613688565b38614c61565b89513d89823e3d90fd5b8680fd5b88516310227bb960e31b8152600490fd5b90816000526101c66020526040600020906002820154906001614e7f8284613a0a565b930154809311614e8f5750505050565b6084945060405193631255c8fd60e01b85526004850152602484015260448301526064820152fd5b6001600160a01b0391821681529116602082015260400190565b6101c9546001600160a01b03808216835260a091821c60208401526101ca548082166040850152821c60608401526101cb549081166080840152811c9082015260c00190565b906020828203126103895781516001600160401b038111610389576137449201614352565b6000805261012d6020527fa581b17bfc4d6578e300cafbf34fd2dc1fef0270d8c73f88a99dcde2859a6639546001600160a01b039081168015614fce575b1680614f895750613744614fdc565b60006004916040519283809263e8a3d48560e01b82525afa90811561064557600091614fb3575090565b613744913d8091833e614fc681836136b6565b810190614f17565b508060406000205416614f7a565b60008080526101c69081602052604091614ff883832054613bfd565b615077575080805261012d602052818120546001600160a01b03919081908316801561506b575b60248551809581936303a24d0760e21b8352856004840152165afa9283156150615750809261504d57505090565b61374492503d8091833e614fc681836136b6565b51903d90823e3d90fd5b5082848220541661501f565b8180526020522061374490613c37565b6000908082526101c6806020526150a16040842054613bfd565b6150e65750816001600160a01b036150b8836156c8565b16916024604051809481936303a24d0760e21b835260048301525afa918215614b1857809261504d57505090565b9161374492604092825260205220613c37565b6101c980546001600160a01b038381166001600160a01b03198316179092556040517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0939092839261514d92911683614eb7565b0390a1600060405160008051602061593c83398151915233918061517081614ed1565b0390a3565b6101ca80546001600160a01b0319166001600160a01b03909216919091179055604051600190339060008051602061593c833981519152908061517081614ed1565b91909160a08184031261038957604051906001600160401b039060a08301828111848210176108c95760405282948151845260208201518381116103895781615201918401614352565b60208501526040820151838111610389578161521e918401614352565b604085015261522f60608301614be8565b606085015260808201519283116103895760809261524d9201614352565b910152565b9261529d61528695929693966101c854926040988951988998631fb6ecf560e21b8a5260a060048b015260a48a0190613612565b926024890152600319888403016044890152614394565b903060648601526084850152836000958692038173ecfbcf718e17b6e76a675ddb936a9249c69dd2aa5af4928315615623578491859186956154c6575b506020918284019063ffffffff808351168952610233918286528a8a20546154b2579161537c918b60806153ac8683999897517f06c5a80e592816bd4f60093568e69affa68b5e378a189b2f59a1121703de47de8c808401519261538e8886015195606081019560018060a01b039d8e9b8c9961536f8d8c8c51169601519460a084519a8b9a8b528a015260a0890190613612565b9187830390880152613612565b9160608501528382038a850152613612565b0390a151169861539d8a613ecb565b8b015160608c01513391613fca565b9901511693888c5261023188528c8c2060018060a01b0319958682541617905551168a528552858a8a205585895261023285528989209216908254161790556153f5855161577b565b96865b86518110156154395780615419615412615434938a6139f6565b5130615847565b615423828c6139f6565b5261542e818b6139f6565b50614343565b6153f8565b5091945092955081948281526101fe80865282822033835286526002198383205416928483528187528083203384528752838184205560008051602061595c833981519152933386868680a48483528187528083208684528752600281842054179687928685528152818420908785525282205580a490565b509598979650509250505051168152205490565b92509350503d8085833e6154da81836136b6565b810160608282031261561f578151906001600160401b0391828111614e4757830160a081830312614e475787519161551183613652565b8151848111614b2457816155269184016151b7565b83526020918281015163ffffffff8116810361561b57838501528981015185811161561b578161555d846080936155719501614352565b8c8701526060810151606087015201614be8565b608084015281850151848111614b24578161558d9187016151b7565b94898101519085821161561b57019080601f83011215614b24578151906155b382613747565b956155c08c5197886136b6565b828752848088019360051b8501019382851161561757858101935b8585106155f25750505050505050919093386152da565b84518381116149bc57879161560c86848094870101614352565b8152019401936155db565b8b80fd5b8980fd5b8480fd5b85513d86823e3d90fd5b6001600160a01b031660009081526000805160206159bc8339815191526020526040902054602216151590565b6000526101fe60205260406000209060018060a01b0316600052602052600660406000205416151590565b6001600160a01b031660008181526000805160206159bc83398151915260205260408120805460021790819055919060008051602061595c8339815191528180a4565b600090815261012d60205260409020546001600160a01b03908116919082156156ee5750565b60008080526040902054169150565b604080519161570b83613637565b6000908184528183602095828782015201528152816101609182855260018060a01b03928383832054841c1661576c578180528552209282519361574e85613637565b549063ffffffff808316865282821c1690850152821c169082015290565b50209282519361574e85613637565b9061578582613747565b61579260405191826136b6565b82815280926157a3601f1991613747565b019060005b8281106157b457505050565b8060606020809385010152016157a8565b91906157d08161577b565b9260005b8281106157e057505050565b8060051b820135601e1983360301811215610389578201908135916001600160401b0383116103895760200182360381136103895761582761582d916158429436916136f2565b30615847565b61583782886139f6565b5261542e81876139f6565b6157d4565b90613744916000806040519361585c85613637565b602785527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6020860152660819985a5b195960ca1b6040860152602081519101845af46158a7613987565b92901561590857508151156158ba575090565b3b156158c35790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612e615750805190602001fdfe4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3be6d3a1d957610f7e900c66889b874cdc9f0c22901aa8be6ec3d2d04c14ca0f35fb03d0d293ef5b362761900725ce891f8f766b5a662cdd445372355448e7ca6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f4301e3e862ad13c0503d3de32ba4e2e40c90733d1da23c9df4d0addbcf6508a2646970667358221220429facd3e43446e18dd89daa7159a5455e77973457a99c4277a34e7b9bc99ed664736f6c63430008110033000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0000000000000000000000000bc50029836a59a4e5e1bb8988272f46eba0f99000000000000000000000000007777777f279eba3d3ad8f4e708545291a6fdba8b
Deployed Bytecode
0x60a0604052600436101561001b575b361561001957600080fd5b005b60e0600035811c908162fdd58e14613594578163011442011461357857816301ffc9a7146134ab57816306fdde03146133f05781630e89341c146133d157816310a7eb5d1461337257816313966db51461335057816313af4035146132e557816317bd48bb1461327557816318711c7d1461325957816318e97fd1146130db57816323bd0386146130895781632a55205a14612ff35781632eb2c2d614612cf0578163300ecdb914612ca7578163359f130214612c325781633659cfe614612a105781633ccfd60b146129505781634132239b146129035781634e1273f4146128025781634f1ef286146125a257816352d1902d146125375781635c046084146125185781635c60da1b146124e25781635d0f6cba146123cd5781635e4e0404146123af5781636661a9ba1461225c578163674cbae6146121d857816369a5b302146121a35781636b20c45414611f4c578163722933f714611ef257816375794a3c14611ed357816379502c5514611e785781637dafae4d14611e435781637f2dc61c14611d6d5781637f77f57414611d1d5781638a08eb4c146118535781638c7a63ae146117dc5781638da5cb5b146117b25781638ec998a014611754578163929a71281461173957816395d89b41146116db5781639c5c63c9146116475781639dbb844d146115ad5781639ebb832414611578578163a0a8e46014611532578163a22cb46514611493578163a453eaf014611477578163ac9650d8146113de578163afed7e9e14611242578163bb3bafd614611217578163bdd864f2146111dc578163c0464356146111c0578163c238d1ee14611165578163d1ad846b14610dc7578163d258609a14610d6c578163d904b94a14610bb2578163dd15e05f14610b7d578163e72878b414610b3a578163e74d86c214610b0a578163e8a3d48514610ad6578163e985e9c514610a80578163ed78891314610929578163ef71c82e146106b6578163f1b0d6bb1461069a578163f242432a1461038e575063f9ce91a40361000e5734610389576080366003190112610389576001600160401b0360043581811161038957610334903690600401613729565b906044359081116103895761034d9036906004016137f7565b909190606435906001600160a01b03821682036103895760209361037c93610373613cdd565b60243590615252565b6001606555604051908152f35b600080fd5b346103895760a0366003190112610389576103a76135c3565b906103b06135d9565b91604435606435916084356001600160401b038111610389576103d7903690600401613729565b6001600160a01b03918216949091903386141580610675575b61066357818716918215610651576101cb541690816105ce575b5050826000526020956097875260406000208660005287526040600020548581106105bc578590856000526097895260406000208860005289520360406000205583600052609787526040600020826000528752604060002061046e868254613a0a565b90558186604051868152878a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a43b6104aa57005b6104ee93600087946040519687958694859363f23a6e6160e01b9b8c865233600487015260248601526044850152606484015260a0608484015260a4830190613612565b03925af16000918161058d575b5061056a57505060019061050d613a5c565b6308c379a014610531575b5061051f57005b6040516377d5b49160e11b8152600490fd5b610539613a7a565b90816105455750610518565b61056660405192839262461bcd60e51b845260048401526024830190613612565b0390fd5b6001600160e01b03191614905061001957604051633fbfe7f560e21b8152600490fd5b6105ae919250843d86116105b5575b6105a681836136b6565b810190613a3c565b90846104fb565b503d61059c565b604051636eaa1ea960e11b8152600490fd5b813b156103895760009060405192839163417b2f9760e11b83523060048401523360248401528960448401528560648401528760848401528860a484015260c483015281838161062160e482018a613612565b03925af1801561064557610636575b8061040a565b61063f90613688565b86610630565b6040513d6000823e3d90fd5b604051631c53f61160e21b8152600490fd5b604051633e2ea01560e21b8152600490fd5b5085600052609860205260406000203360005260205260ff60406000205416156103f0565b3461038957600036600319011261038957602060405160048152f35b34610389576040366003190112610389576001600160401b03600435818111610389576106e7903690600401613729565b602435828111610389576106ff903690600401613729565b3360009081526000805160206159bc833981519152602090815260409091205491939091601216158015906101fe90610905575b50156108df57600080526101c6825260406000209083519081116108c95761075b8254613bfd565b601f8111610883575b5082601f82116001146107f657927f74b7c2afa3f89c562b59674a101e2c48bceeb27cdb620afefa14446f1ffa487b9492826107e6936107d7966000916107eb575b508160011b916000199060031b1c19161790555b6107c386613d33565b604051938493604085526040850190613612565b90838203908401523395613612565b0390a2005b9050850151896107a6565b601f1982169083600052846000209160005b81811061086c5750836107d796937f74b7c2afa3f89c562b59674a101e2c48bceeb27cdb620afefa14446f1ffa487b9896936107e69660019410610853575b5050811b0190556107ba565b87015160001960f88460031b161c191690558980610847565b91928660018192868b015181550194019201610808565b8260005283600020601f830160051c8101918584106108bf575b601f0160051c01905b8181106108b35750610764565b600081556001016108a6565b909150819061089d565b634e487b7160e01b600052604160045260246000fd5b604051634baa2a4d60e01b81523360048201526000602482015260106044820152606490fd5b90506000805282526040600020336000528252601260406000205416151585610733565b346103895760003660031901126103895760405163ed78891360e01b815260008160048173ecfbcf718e17b6e76a675ddb936a9249c69dd2aa5af4908115610645576000916109d5575b5060405160209182820192808352815180945260408301938160408260051b8601019301916000955b8287106109a95785850386f35b9091929382806109c5600193603f198a82030186528851613612565b960192019601959291909261099c565b90503d806000833e6109e781836136b6565b810160209081838203126103895782516001600160401b0393848211610389570181601f82011215610389578051610a1e81613747565b94610a2c60405196876136b6565b818652848087019260051b8401019380851161038957858401925b858410610a5b575050505050505081610973565b8351838111610389578791610a75848480948a0101614352565b815201930192610a47565b3461038957604036600319011261038957610a996135c3565b610aa16135d9565b9060018060a01b03809116600052609860205260406000209116600052602052602060ff604060002054166040519015158152f35b3461038957600036600319011261038957610b06610af2614f3c565b604051918291602083526020830190613612565b0390f35b34610389576020366003190112610389576020610b286004356156c8565b6040516001600160a01b039091168152f35b34610389576020366003190112610389576004356000196101c8540190808203610b6057005b60449160405191634fa09b3f60e01b835260048301526024820152fd5b346103895760203660031901126103895760043560005261012d602052602060018060a01b0360406000205416604051908152f35b3461038957606036600319011261038957600435610bce6135d9565b906044356001600160401b03811161038957610bee9036906004016137f7565b91806000526101fe936020948086526040600020336000528652600a604060002054161590811591610d48575b5015610d22576001600160a01b031690610c358183613f51565b6040516301ffc9a760e01b8152636890e5b360e01b60048201528581602481865afa90811561064557600091610cf5575b5015610cdc578360241161038957600483013503610cca5782600080949381946040519384928337810182815203925af190610ca0613987565b9115610ca857005b61056660405192839263a5fa8d2b60e01b845260048401526024830190613612565b60405163fe486c2b60e01b8152600490fd5b6040516370adc70360e11b815260048101839052602490fd5b610d159150863d8811610d1b575b610d0d81836136b6565b810190614bfc565b86610c66565b503d610d03565b604051634baa2a4d60e01b81523360048201526024810183905260086044820152606490fd5b90506000805285526040600020336000528552600a60406000205416151586610c1b565b34610389576040366003190112610389576004356001600160401b0381116103895761037c610da160209236906004016137f7565b610daa33613ecb565b610db2613cdd565b610dc233926024359236916136f2565b613fca565b346103895760031960803682011261038957610de16135c3565b916001600160401b0360243581811161038957610e029036906004016137ac565b9260443582811161038957610e1b9036906004016137ac565b9160643590811161038957610e34903690600401613729565b91610e3d613cdd565b3360009081526000805160206159bc8339815191526020908152604082205460061615959094915b8751811015610e9a57610e7c9087610e8157614343565b610e65565b610e95610e8e828b6139f6565b5133613f51565b614343565b508694955087855160005b8181106111055750506001600160a01b038181169283156110f357875191865183036110e1576101cb54168061104a575b505060005b81811061100757505081600060405160008051602061591c833981519152339180610f078a8d83613a17565b0390a43b610f17575b6001606555005b610f6760008794610f7660405197889687958694610f5763bc197c8160e01b9d8e885233600489015288602489015260a0604489015260a4880190613882565b9084878303016064880152613882565b91848303016084850152613612565b03925af160009181610fe8575b50610fc5575050600190610f95613a5c565b6308c379a014610fb1575b5061051f575b808080808080610f10565b610fb9613a7a565b90816105455750610fa0565b6001600160e01b031916149050610fa657604051633fbfe7f560e21b8152600490fd5b611000919250843d86116105b5576105a681836136b6565b9084610f83565b80611014600192886139f6565b5161101f828b6139f6565b5160005260978b526040600020866000528b526110426040600020918254613a0a565b905501610edb565b803b15610389578860009161109d9383886110bd8d6110ad8e6040519a8b998a988997634058856760e11b89523060048a01523360248a01528960448a01526064890152608488015260e4870190613882565b90838683030160a4870152613882565b908382030160c48401528c613612565b03925af18015610645576110d2575b80610ed6565b6110db90613688565b886110cc565b60405163f9532c3960e01b8152600490fd5b6040516310227bb960e31b8152600490fd5b80611128611116611160938b6139f6565b51611121838a6139f6565b5190614e5c565b61113281886139f6565b5161113d828b6139f6565b516000526101c68b526111596002604060002001918254613a0a565b9055614343565b610ea5565b346103895760803660031901126103895761117e6135c3565b602435606435916001600160401b038311610389576111a4610f10933690600401613729565b916111ad613cdd565b6111b78133613f51565b60443591614c14565b3461038957600036600319011261038957602060405160028152f35b346103895760203660031901126103895760043563ffffffff8116809103610389576000526102336020526020604060002054604051908152f35b3461038957602036600319011261038957610b066112366004356156fd565b6040519182918261390f565b34610389576080366003190112610389576004356060366023190112610389576040519061126f82613637565b63ffffffff60243581811681036103895783526044358181168103610389576020848101918252606435906001600160a01b0380831683036103895760408701928352856000526101fe808352604060002033600052835260226040600020541615908115916113ba575b5015611396578487511661138d575b8251161580611381575b61136f5784600052610160815263ffffffff60201b6040600020948751169185549451901b1691600160401b600160e01b03905160401b169263ffffffff60e01b1617171790557f5837d55897cfc337f160a71d7b63a047abd50a3a8834f1c5d70f338846358c6d6040518061136a33958261390f565b0390a3005b604051630d9b92f160e01b8152600490fd5b508383511615156112f3565b600087526112e9565b6064868360405191634baa2a4d60e01b835233600484015260248301526044820152fd5b905060008052825260406000203360005282526022604060002054161515886112da565b3461038957602080600319360112610389576004356001600160401b038111610389576114126114189136906004016137c7565b906157c5565b6040519082820192808352815180945260408301938160408260051b8601019301916000955b82871061144b5785850386f35b909192938280611467600193603f198a82030186528851613612565b960192019601959291909261143e565b3461038957600036600319011261038957602060405160108152f35b34610389576040366003190112610389576114ac6135c3565b60243590811515809203610389576001600160a01b03169033821461152057336000526098602052604060002082600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b604051636b3fa0d960e11b8152600490fd5b3461038957600036600319011261038957610b066040516115528161366d565b60058152640322e372e360dc1b6020820152604051918291602083526020830190613612565b3461038957602036600319011261038957600435600052610232602052602060018060a01b0360406000205416604051908152f35b60a0366003190112610389576115c16135c3565b6064356001600160401b038111610389576115e09036906004016137f7565b906084359260018060a01b038416809403610389576115fd613cdd565b6040519061160a8261366d565b600182526020820194602036873782511561163157610f10955260443590602435906143b5565b634e487b7160e01b600052603260045260246000fd5b34610389576040366003190112610389576004356024356001600160401b0381116103895760009161167e83923690600401613729565b906116898133613e44565b6001600160a01b039061169b906156c8565b1682602083519301915af16116ae613987565b90156116b657005b60405163a5fa8d2b60e01b815260206004820152908190610566906024830190613612565b346103895760003660031901126103895760405160208082528160605191828183015260005b8381106117235750508160006040809484010152601f80199101168101030190f35b6080810151858201604001528492508101611701565b34610389576000366003190112610389576020604051818152f35b3461038957611762366138b6565b9161176d81336142e1565b60008181526101fe602090815260408083206001600160a01b03959095168084529490915281208054949094179384905560008051602061595c8339815191529080a4005b34610389576000366003190112610389576101c9546040516001600160a01b039091168152602090f35b34610389576020366003190112610389576000604080516117fc81613637565b6060815282602082015201526004356000526101c6602052610b06604060002060026040519161182b83613637565b61183481613c37565b83526001810154602084015201546040820152604051918291826138e0565b3461038957366003190112610389576004356001600160401b03811161038957611881903690600401613729565b6024356001600160401b038111610389576118a0903690600401613729565b6060366043190112610389576040516118b881613637565b60443563ffffffff8116810361038957815260643563ffffffff811681036103895760208201526084356001600160a01b038116810361038957604082015260a4356001600160a01b03811690036103895760c4356001600160401b038111610389576119299036906004016137c7565b9091611933613cdd565b60005493600885901c60ff1615801590611d11575b80611cf9575b611ce757600160ff1986161760005560ff8560081c1615611cd5575b60ff60005460081c1615611cc457600160655561199160a4356001600160a01b0316615685565b6101c890815491600183019055604051906119ab82613637565b81526000602082015260006040820152816000526101c6602052604060002081518051906001600160401b0382116108c95781906119e98454613bfd565b601f8111611c74575b50602090601f8311600114611c0857600092611bfd575b50508160011b916000199060031b1c19161781555b60208201516001820155600260408301519101557f5086d1bcea28999da9875111e3592688fbfa821db63214c695ca35768080c2fe60405180611a623394826138e0565b0390a363ffffffff815116611bf4575b60408101516001600160a01b03161580611be1575b61136f5760ff94611b3a9160008052610160602052604060002063ffffffff82511681549063ffffffff60201b602085015160201b1690600160401b600160e01b03604086015160401b169263ffffffff60e01b16171717905560007f5837d55897cfc337f160a71d7b63a047abd50a3a8834f1c5d70f338846358c6d60405180611b1333958261390f565b0390a3611b2a60a4356001600160a01b03166150f9565b611b3560a435615175565b613d33565b80611b8d575b505060081c1615611b52576001606555005b61ff0019600054166000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a1610f10565b611b9f91611b9a33615685565b6157c5565b503360008181526000805160206159bc8339815191526020526040812080546002191690819055919060008051602061595c8339815191528180a48280611b40565b5063ffffffff6020820151161515611a87565b60008152611a72565b015190508a80611a09565b9250836000526020600020906000935b601f1984168510611c59576001945083601f19811610611c40575b505050811b018155611a1e565b015160001960f88460031b161c191690558a8080611c33565b81810151835560209485019460019093019290910190611c18565b909150836000526020600020601f840160051c810160208510611cbd575b90849392915b601f830160051c82018110611cae5750506119f2565b60008155859450600101611c98565b5080611c92565b6040516296bfb160e81b8152600490fd5b61ffff1985166101011760005561196a565b604051633d5c224160e11b8152600490fd5b50303b15158061194e5750600160ff8616141561194e565b5060ff85161515611948565b346103895760203660031901126103895760043560005261016060205260606040600020546040519063ffffffff80821683528160201c16602083015260018060a01b039060401c166040820152f35b34610389576020366003190112610389576004356001600160a01b0381169081900361038957611d9c3361425b565b80611dd8575b6101cb80546001600160a01b0319169091179055604051600290339060008051602061593c833981519152908061136a81614ed1565b6040516301ffc9a760e01b815262123aaf60e51b6004820152602081602481855afa90811561064557600091611e25575b50611da2576024906040519062be74ab60e51b82526004820152fd5b611e3d915060203d8111610d1b57610d0d81836136b6565b82611e09565b3461038957602036600319011261038957600435600052610231602052602060018060a01b0360406000205416604051908152f35b346103895760003660031901126103895760c06101c9546101ca54906101cb54906040519260018060a01b0391828116855260a01c6020850152818116604085015260a01c60608401528116608083015260a01c60a0820152f35b346103895760003660031901126103895760206101c854604051908152f35b3461038957602036600319011261038957610b06611f11600435613b3c565b6040519182918291909160808060a0830194805184526020810151602085015260408101516040850152606081015160608501520151910152565b346103895760031960603682011261038957611f666135c3565b906001600160401b039060243582811161038957611f889036906004016137c7565b94909260443590811161038957611fa39036906004016137c7565b6001600160a01b039686881696919591338814158061217e575b6121605750611fda9291611fd291369161375e565b94369161375e565b94841561214e57835192865184036110e15760405191611ff98361369b565b600083526101cb5416806120b6575b5050505060005b81811061204957505060008051602061591c83398151915261203b600094604051918291339583613a17565b0390a461001960405161369b565b61205381846139f6565b519061205f81876139f6565b5182600052609760208181526040600020886000528152604060002054918383106120a45760019560005281526040600020908860005252036040600020550161200f565b604051632fc4b76160e11b8152600490fd5b803b156103895761210993600088612128899583976121198e6040519b8c9a8b998a98634058856760e11b8a523060048b01523360248b015260448a01528960648a0152608489015260e4880190613882565b90848783030160a4880152613882565b918483030160c4850152613612565b03925af180156106455761213f575b808080612008565b61214890613688565b84612137565b6040516345d40ad560e01b8152600490fd5b6040516341ce11f960e11b8152908190610566903360048401614eb7565b5087600052609860205260406000203360005260205260ff6040600020541615611fbd565b34610389576020366003190112610389576004356000526101c7602052602060018060a01b0360406000205416604051908152f35b34610389576060366003190112610389576004356001600160401b038111610389576122089036906004016137f7565b6044356001600160a01b03811691908290036103895760209261222e91610daa33613ecb565b6000818152610231845260409081902080546001600160a01b03191690931790925560016065559051908152f35b34610389576040366003190112610389576004356024356001600160a01b038116908190036103895761228d613cdd565b6122978233613e44565b600082815261012d6020908152604090912080546001600160a01b031916831790559080612344575b6040513382857f5010f780a0de79bcfb9f3d6fec3cfe29758ef5c5800d575af709bc590bd78ade600080a48361232257507f56e810c8cae84731149f628981d25769a084570b9ba6eebf3c32879e3dce56099250604051908152a16001606555005b6040915060008360008051602061597c833981519152948352820152a2610f10565b6040516301ffc9a760e01b8152633de3f32360e11b60048201528281602481855afa90811561064557600091612392575b506122c0576024906040519063da755beb60e01b82526004820152fd5b6123a99150833d8511610d1b57610d0d81836136b6565b84612375565b34610389576020366003190112610389576020610b28600435614b94565b34610389576123db366138b6565b6123e7839293336142e1565b60008281526101fe602081815260408084206001600160a01b0397881680865290835290842080549519909516948590559094919390928390839060008051602061595c8339815191529080a41591826124d3575b826124ae575b505061244a57005b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09160006040926101c99283549360018060a01b031985169055845193168352820152a1600060405160008051602061593c83398151915233918061136a81614ed1565b9091506000805282526040600020906000528152600260406000205416158380612442565b6101c95485168214925061243c565b346103895760003660031901126103895760008051602061599c833981519152546040516001600160a01b039091168152602090f35b3461038957602036600319011261038957610b06611f11600435613b9d565b34610389576000366003190112610389577f00000000000000000000000032006e298c19818cd5e8000e26439691f0ac21286001600160a01b0316300361259057602060405160008051602061599c8339815191528152f35b604051635e4c25f160e01b8152600490fd5b6040366003190112610389576125b66135c3565b6024356001600160401b038111610389576125d5903690600401613729565b906001600160a01b037f00000000000000000000000032006e298c19818cd5e8000e26439691f0ac21288116903082146127f05760008051602061599c83398151915290808254169283036127de57839261262f3361425b565b604051906321f7434760e01b82528180612650602097889460048401614eb7565b0381857f000000000000000000000000bc50029836a59a4e5e1bb8988272f46eba0f9900165afa908115610645576000916127c1575b5015610389577f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126c3575050506100199150613940565b8316906040516352d1902d60e01b81528381600481865afa60009181612792575b506126fb5760405163e5ec176960e01b8152600490fd5b036127805761270983613940565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2835115801590612778575b61274357005b823b15612769575082600092839261001995519201905af4612763613987565b90613ae8565b63369891e760e01b8152600490fd5b50600161273d565b6040516308373ebf60e41b8152600490fd5b9091508481813d83116127ba575b6127aa81836136b6565b81010312610389575190876126e4565b503d6127a0565b6127d89150843d8611610d1b57610d0d81836136b6565b86612686565b6040516364cd8d1960e01b8152600490fd5b604051631932df4560e01b8152600490fd5b34610389576040366003190112610389576001600160401b03600435818111610389573660238201121561038957612844903690602481600401359101613824565b906024359081116103895761285d9036906004016137ac565b815190805182036128f15761287182613747565b9261287f60405194856136b6565b828452601f1961288e84613747565b0136602086013760005b8381106128b55760405160208082528190610b0690820188613882565b6001906128e06001600160a01b036128cd83866139f6565b51166128d983876139f6565b51906139b7565b6128ea82886139f6565b5201612898565b60405163133933f760e21b8152600490fd5b34610389576020366003190112610389576602c2ad68fd900060043581810291811591830414171561293a57602090604051908152f35b634e487b7160e01b600052601160045260246000fd5b346103895760003660031901126103895761296a3361562d565b80156129e8575b156129c2574760018060a01b03906101ca91600080808085858854166204baf0f161299a613987565b50156129a257005b915460405163292264c360e21b8152921660048301526024820152604490fd5b604051634baa2a4d60e01b81523360048201526000602482015260206044820152606490fd5b503360009081526000805160206159bc83398151915260205260409020546022161515612971565b346103895760208060031936011261038957612a2a6135c3565b906001600160a01b03907f00000000000000000000000032006e298c19818cd5e8000e26439691f0ac21288216903082146127f05760008051602061599c83398151915291838354169081036127de578185612aa492612a893361425b565b6040516321f7434760e01b8152938492839260048401614eb7565b0381877f000000000000000000000000bc50029836a59a4e5e1bb8988272f46eba0f9900165afa90811561064557600091612c15575b50156103895760405191818301938385106001600160401b038611176108c957846040526000845260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435416600014612b3c57505050505061001990613940565b6040516352d1902d60e01b8152908616928082600481875afa918291600093612be5575b5050612b785760405163e5ec176960e01b8152600490fd5b0361278057612b8684613940565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590612bdd575b612bc057005b833b15612769575061001992600092839251915af4612763613987565b506000612bba565b9080929350813d8311612c0e575b612bfd81836136b6565b810103126103895751908780612b60565b503d612bf3565b612c2c9150823d8411610d1b57610d0d81836136b6565b85612ada565b60a036600319011261038957612c466135c3565b6001600160401b039060643582811161038957612c679036906004016137c7565b909160843593841161038957612c99612c87610f109536906004016137f7565b949093612c92613cdd565b3691613824565b9060443590602435906143b5565b3461038957604036600319011261038957612cc06135d9565b6004356000526101fe60205260406000209060018060a01b03166000526020526020604060002054604051908152f35b346103895760031960a03682011261038957612d0a6135c3565b612d126135d9565b906001600160401b039060443582811161038957612d349036906004016137ac565b9260643583811161038957612d4d9036906004016137ac565b9260843590811161038957612d66903690600401613729565b6001600160a01b03928316969091903388141580612fce575b61066357855190855182036128f157848316948515610651576101cb541680612f47575b505060005b818110612ec6575050828760405160008051602061591c833981519152339180612dd38a8c83613a17565b0390a43b612ddd57005b6000602094612e1f610f6797610f5794604051998a988997889663bc197c8160e01b9e8f89523360048a0152602489015260a0604489015260a4880190613882565b03925af160009181612ea6575b50612e855750506001612e3d613a5c565b6308c379a014612e4e575b61051f57005b612e56613a7a565b80612e615750612e48565b60405162461bcd60e51b815260206004820152908190610566906024830190613612565b6001600160e01b0319161461001957604051633fbfe7f560e21b8152600490fd5b612ebf91925060203d81116105b5576105a681836136b6565b9083612e2c565b612ed081886139f6565b5190612edc81886139f6565b518260005260206097815260406000208c6000528152604060002054908282106105bc57846001956000526097825260406000208a60005282526040600020612f26858254613a0a565b9055600052609781526040600020908d600052520360406000205501612da8565b803b1561038957879160009187838d612faa8e612f9a8e61109d6040519b8c9a8b998a98634058856760e11b8a523060048b01523360248b015260448a01526064890152608488015260e4870190613882565b908382030160c48401528b613612565b03925af1801561064557612fbf575b80612da3565b612fc890613688565b88612fb9565b5087600052609860205260406000203360005260205260ff6040600020541615612d7f565b34610389576040366003190112610389576024356130126004356156fd565b9063ffffffff60208301511681810291818304149015171561293a577f000000000000000000000000000000000000000000000000000000000000271080156130735760409283015183516001600160a01b03909116815291046020820152f35b634e487b7160e01b600052601260045260246000fd5b34610389576060366003190112610389576130a26135c3565b6024356000526101fe60205260406000209060018060a01b03166000526020526020604435600217604060002054161515604051908152f35b34610389576040366003190112610389576001600160401b036004356024358281116103895761310f903690600401613729565b9161311a8233613e44565b811561038957604051918060008051602061597c8339815191526020948581528061314787820189613612565b0390a26000526101c6825260406000209183519182116108c95761316b8354613bfd565b601f8111613213575b5080601f83116001146131b057508192936000926131a5575b5050600019600383901b1c191660019190911b179055005b01519050838061318d565b90601f198316948460005282600020926000905b8782106131fb5750508360019596106131e2575b505050811b019055005b015160001960f88460031b161c191690558380806131d8565b806001859682949686015181550195019301906131c4565b8360005281600020601f840160051c81019183851061324f575b601f0160051c01905b8181106132435750613174565b60008155600101613236565b909150819061322d565b3461038957600036600319011261038957602060405160088152f35b34610389576040366003190112610389576004356132916135d9565b90806000526102318060205260018060a01b0391826040600020541633036132d3576000526020526040600020911660018060a01b0319825416179055600080f35b604051632afb0ecf60e01b8152600490fd5b34610389576020366003190112610389576132fe6135c3565b6133073361425b565b6001600160a01b03811660009081526000805160206159bc83398151915260205260409020546002161561333e57610019906150f9565b60405163131dd3a760e31b8152600490fd5b346103895760003660031901126103895760206040516602c2ad68fd90008152f35b346103895760203660031901126103895761338b6135c3565b6133943361562d565b80156133a9575b156129c25761001990615175565b503360009081526000805160206159bc8339815191526020526040902054602216151561339b565b3461038957602036600319011261038957610b06610af2600435615087565b346103895760003660031901126103895760405160009061019380549061341682613bfd565b9081845260019283811690816000146134835750600114613442575b610b0684610af2818803826136b6565b90935060005260209283600020916000925b8284106134705750505081610b0693610af29282010193613432565b8054858501870152928501928101613454565b610b069650610af29450602092508593915060ff191682840152151560051b82010193613432565b346103895760203660031901126103895760043563ffffffff60e01b81168091036103895760209063152a902d60e11b8114908115613567575b8115613527575b8115613516575b8115613505575b506040519015158152f35b631acf898160e11b149050826134fa565b6314b618b760e01b811491506134f3565b9050636cdb3d1360e11b81148015613557575b8015613547575b906134ec565b506301ffc9a760e01b8114613541565b506303a24d0760e21b811461353a565b6304aca5db60e51b811491506134e5565b3461038957600036600319011261038957602060405160008152f35b346103895760403660031901126103895760206135bb6135b26135c3565b602435906139b7565b604051908152f35b600435906001600160a01b038216820361038957565b602435906001600160a01b038216820361038957565b60005b8381106136025750506000910152565b81810151838201526020016135f2565b9060209161362b815180928185528580860191016135ef565b601f01601f1916010190565b606081019081106001600160401b038211176108c957604052565b60a081019081106001600160401b038211176108c957604052565b604081019081106001600160401b038211176108c957604052565b6001600160401b0381116108c957604052565b602081019081106001600160401b038211176108c957604052565b90601f801991011681019081106001600160401b038211176108c957604052565b6001600160401b0381116108c957601f01601f191660200190565b9291926136fe826136d7565b9161370c60405193846136b6565b829481845281830111610389578281602093846000960137010152565b9080601f8301121561038957816020613744933591016136f2565b90565b6001600160401b0381116108c95760051b60200190565b929161376982613747565b9161377760405193846136b6565b829481845260208094019160051b810192831161038957905b82821061379d5750505050565b81358152908301908301613790565b9080601f83011215610389578160206137449335910161375e565b9181601f84011215610389578235916001600160401b038311610389576020808501948460051b01011161038957565b9181601f84011215610389578235916001600160401b038311610389576020838186019501011161038957565b929161382f82613747565b9161383d60405193846136b6565b829481845260208094019160051b810192831161038957905b8282106138635750505050565b81356001600160a01b0381168103610389578152908301908301613856565b90815180825260208080930193019160005b8281106138a2575050505090565b835185529381019392810192600101613894565b606090600319011261038957600435906024356001600160a01b0381168103610389579060443590565b60208152606060406138fd84518360208601526080850190613612565b93602081015182850152015191015290565b9190916040606082019363ffffffff80825116845260208201511660208401528160018060a01b0391015116910152565b803b156139755760008051602061599c83398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405163529880eb60e01b8152600490fd5b3d156139b2573d90613998826136d7565b916139a660405193846136b6565b82523d6000602084013e565b606090565b6001600160a01b03169081156139e457600052609760205260406000209060005260205260406000205490565b604051632188330d60e21b8152600490fd5b80518210156116315760209160051b010190565b9190820180921161293a57565b9091613a2e61374493604084526040840190613882565b916020818403910152613882565b9081602091031261038957516001600160e01b0319811681036103895790565b60009060033d11613a6957565b905060046000803e60005160e01c90565b600060443d1061374457604051600319913d83016004833e81516001600160401b03918282113d602484011117613ad757818401948551938411613adf573d85010160208487010111613ad75750613744929101602001906136b6565b949350505050565b50949350505050565b15613af05790565b805115613aff57805190602001fd5b6040516350a28c9b60e11b8152600490fd5b60405190613b1e82613652565b60006080838281528260208201528260408201528260608201520152565b613b44613b11565b5066012edc9ab5d00090818102918115908284041481171561293a576564f43391f00080830292830414171561293a5760405191613b8183613652565b8252806020830152806040830152806060830152608082015290565b613ba5613b11565b5065c9e86723e000808202908215908383041481171561293a576564f43391f00080840293840414171561293a5760405191613be083613652565b600083528160208401528160408401526060830152608082015290565b90600182811c92168015613c2d575b6020831014613c1757565b634e487b7160e01b600052602260045260246000fd5b91607f1691613c0c565b9060405191826000825492613c4b84613bfd565b908184526001948581169081600014613cba5750600114613c77575b5050613c75925003836136b6565b565b9093915060005260209081600020936000915b818310613ca2575050613c7593508201013880613c67565b85548884018501529485019487945091830191613c8a565b915050613c7594506020925060ff191682840152151560051b8201013880613c67565b600260655414613cee576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9081516001600160401b0381116108c95761019390613d528254613bfd565b601f8111613dfc575b50602080601f8311600114613d98575081929394600092613d8d575b50508160011b916000199060031b1c1916179055565b015190503880613d77565b90601f198316958460005282600020926000905b888210613de457505083600195969710613dcb575b505050811b019055565b015160001960f88460031b161c19169055388080613dc1565b80600185968294968601518155019501930190613dac565b600083815260208120601f840160051c81019260208510613e3a575b601f0160051c01915b828110613e2f575050613d5b565b818155600101613e21565b9092508290613e18565b9060008181526101fe9081602052604081209360018060a01b03169384825260205260126040822054161591821592613ea8575b505015613e83575050565b6064925060405191634baa2a4d60e01b83526004830152602482015260106044820152fd5b601292509060409181805260205281812085825260205220541615153880613e78565b6001600160a01b031660008181526000805160206159bc8339815191526020526040812054600616158015906101fe90613f2f575b5015613f0a575050565b6064925060405191634baa2a4d60e01b83526004830152602482015260046044820152fd5b9050818052602052604081208282526020526006604082205416151538613f00565b90613f5c828261565a565b8015613f99575b15613f6c575050565b6064925060405191634baa2a4d60e01b835260018060a01b03166004830152602482015260046044820152fd5b506001600160a01b03821660009081526000805160206159bc83398151915260205260409020546006161515613f63565b9092916101c89182549260018401905560405194613fe786613637565b81865280602087015260006040870152836000526101c660205260406000209580519687516001600160401b0381116108c9576140248254613bfd565b98601f8a11614213575b87989950600097969750602090601f831160011461417d57928288937f1b944478023872bf91b25a13fdba3a686fdb1bf4dbb872f850240fad4b8cc0689896936141399896600092614172575b50508160011b916000199060031b1c19161781555b60208201516001820155600260408301519101557f5086d1bcea28999da9875111e3592688fbfa821db63214c695ca35768080c2fe604051806140d43394826138e0565b0390a360008581526101fe602090815260408083206001600160a01b0399909916808452989091528120805460021790819055908790879060008051602061595c8339815191529080a48151614145575b604051928392604084526040840190613612565b9060208301520390a390565b8460008051602061597c833981519152604051602081528061416a6020820187613612565b0390a2614125565b01519050388061407b565b908360005260206000209160005b601f19851681106141f85750837f1b944478023872bf91b25a13fdba3a686fdb1bf4dbb872f850240fad4b8cc0689896936141399896936001938c97601f198116106141df575b505050811b018155614090565b015160001960f88460031b161c191690553880806141d2565b8183015184558b99506001909301926020928301920161418b565b826000526020600020601f830160051c81019a60208410614251575b601f0160051c01995b8a8110614245575061402e565b60008155600101614238565b909a508a9061422f565b6001600160a01b031660008181526000805160206159bc8339815191526020526040812054600216158015906101fe906142bf575b501561429a575050565b6064925060405191634baa2a4d60e01b83526004830152602482015260026044820152fd5b9050818052602052604081208282526020526002604082205416151538614290565b9060008181526101fe9081602052604081209360018060a01b03169384825260205260026040822054161591821592614320575b50501561429a575050565b600292509060409181805260205281812085825260205220541615153880614315565b600019811461293a5760010190565b81601f82011215610389578051614368816136d7565b9261437660405194856136b6565b818452602082840101116103895761374491602080850191016135ef565b908060209392818452848401376000828201840152601f01601f1916010190565b949591929091906143cf6001600160a01b0387168461565a565b801561481a575b156147e957600081511580156147b7575b5061446a915061442d6000916143fc86614b94565b86845261023160209081526040808620546102329092528520546001600160a01b039081169392911690893461484b565b9560405180938192636890e5b360e01b835260049b338d8501528860248501528960448501528a606485015260a0608485015260a4840191614394565b0381836001600160a01b038b165af190811561064557600091614632575b50519260005b84518110156145ec576144a181866139f6565b51516144ac81614bc8565b6144b581614bc8565b60018103614548575060206144ca82876139f6565b5101516040818051810103126103895760406144e860208301614be8565b91015190818811614537576000918291829182916001600160a01b03166204baf0f1614512613987565b50156145265761452190614343565b61448e565b6040516338dcead760e21b81528890fd5b604051631913cf3760e21b81528a90fd5b80614554600292614bc8565b036145e357602061456582876139f6565b5101519060609182818051810103126103895761458460208201614be8565b926040820151910151908680151591826145d8575b50506145c75761452192610e959187604051926145b58461369b565b600084526001600160a01b0316614c14565b604051634cdcfbf960e01b81528a90fd5b141590508638614599565b61452190614343565b506040805191825234602083015291965091946001600160a01b031693503392507fb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e91a4565b903d918282823e61464383826136b6565b60208184810103126147ac578051916001600160401b0383116147b457604083830185840103126147b4576040519361467b8561366d565b838301516001600160401b0381116147b057818401601f82878701010112156147b057808585010151916146ae83613747565b936146bc60405195866136b6565b838552602085019282870160208660051b838b8b01010101116147ac576020818989010101935b60208660051b838b8b0101010185106147115750505050505090602092918452010151602082015238614488565b84516001600160401b0381116147a8576040898b0184018201868b0103601f1901126147a857604051906147448261366d565b602081858d8d010101015160038110156147a4578252604081858d8d0101010151906001600160401b0382116147a45792602093926147938c868f9581978a83988e8601950101010101614352565b8382015281520195019490506146e3565b8580fd5b8380fd5b5080fd5b8280fd5b80fd5b6147d557506020015161446a906001600160a01b031661442d6143e7565b634e487b7160e01b81526032600452602490fd5b604051634baa2a4d60e01b81526001600160a01b038716600480830191909152602482018590526044820152606490fd5b506001600160a01b03861660009081526000805160206159bc833981519152602052604090205460061615156143d6565b9394919060009485966602c2ad68fd900094858402958487041484151715614b80576001600160a01b039281841615614b78575b8681101561489957604051633b78763760e21b8152600490fd5b808703614a105750828792816148af8297613b3c565b9916156149e8575b16156149c0575b86519360208801519060408901519160608a0151946080809b015197877f0000000000000000000000007777777f279eba3d3ad8f4e708545291a6fdba8b16998a3b156149bc579388969360648f9d9c9a968f906101449d9b9996899687809360405180875263faa3516f60e01b905216600485510152602484510152166044825101525101521660848c51015260a48b5101521660c48951015260e4885101527f000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d016610104875101526101248651015284519283915af180156149b1576149a557505090565b61374491925051613688565b6040513d84823e3d90fd5b8d80fd5b7f000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d093506148be565b7f000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d093506148b7565b9795985092918681979295509481614a288295613b9d565b931615614b50575b1615614b28575b857f0000000000000000000000007777777f279eba3d3ad8f4e708545291a6fdba8b16926020820151926040830151906080606085015194015194863b15614b245760405163faa3516f60e01b8152600481018a9052602481018a9052978a16604489015260648801528816608487015260a4860152861660c485015260e48401527f000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0909416610104830152610124820193909352918190839081875a9261014493f1908115614b185750614b0b57500390565b614b1490613688565b0390565b604051903d90823e3d90fd5b8880fd5b7f000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d09150614a37565b7f000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d09550614a30565b85915061487f565b634e487b7160e01b88526011600452602488fd5b6001600160a01b03908190604090614bab906156fd565b01511680614bc357506101ca54168061374457503090565b905090565b60031115614bd257565b634e487b7160e01b600052602160045260246000fd5b51906001600160a01b038216820361038957565b90816020910312610389575180151581036103895790565b90614c1f8382614e5c565b6000918183526020936101c68552604095600287862001614c41838254613a0a565b90556001600160a01b0383811693908415614e4b576101cb541680614dce575b50848652609787528786208487528752878620614c7f848254613a0a565b905583868951878152858a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628b3392a43b614cc1575b50505050505050565b614d0392869286895180968195829463f23a6e6160e01b9a8b85523360048601528560248601526044850152606484015260a0608484015260a4830190613612565b03925af1839181614daf575b50614d86575050600191614d21613a5c565b6308c379a014614d50575b5050614d4057505b38808080808080614cb8565b516377d5b49160e11b8152600490fd5b614d58613a7a565b9182614d645750614d2c565b8461056691505192839262461bcd60e51b845260048401526024830190613612565b6001600160e01b031916039150614d9f90505750614d34565b51633fbfe7f560e21b8152600490fd5b614dc7919250853d87116105b5576105a681836136b6565b9038614d0f565b803b15614e4757868951809263417b2f9760e11b82523060048301523360248301528260448301528760648301528860848301528660a483015260e060c4830152818381614e1f60e482018a613612565b03925af18015614e3d5715614c6157614e3790613688565b38614c61565b89513d89823e3d90fd5b8680fd5b88516310227bb960e31b8152600490fd5b90816000526101c66020526040600020906002820154906001614e7f8284613a0a565b930154809311614e8f5750505050565b6084945060405193631255c8fd60e01b85526004850152602484015260448301526064820152fd5b6001600160a01b0391821681529116602082015260400190565b6101c9546001600160a01b03808216835260a091821c60208401526101ca548082166040850152821c60608401526101cb549081166080840152811c9082015260c00190565b906020828203126103895781516001600160401b038111610389576137449201614352565b6000805261012d6020527fa581b17bfc4d6578e300cafbf34fd2dc1fef0270d8c73f88a99dcde2859a6639546001600160a01b039081168015614fce575b1680614f895750613744614fdc565b60006004916040519283809263e8a3d48560e01b82525afa90811561064557600091614fb3575090565b613744913d8091833e614fc681836136b6565b810190614f17565b508060406000205416614f7a565b60008080526101c69081602052604091614ff883832054613bfd565b615077575080805261012d602052818120546001600160a01b03919081908316801561506b575b60248551809581936303a24d0760e21b8352856004840152165afa9283156150615750809261504d57505090565b61374492503d8091833e614fc681836136b6565b51903d90823e3d90fd5b5082848220541661501f565b8180526020522061374490613c37565b6000908082526101c6806020526150a16040842054613bfd565b6150e65750816001600160a01b036150b8836156c8565b16916024604051809481936303a24d0760e21b835260048301525afa918215614b1857809261504d57505090565b9161374492604092825260205220613c37565b6101c980546001600160a01b038381166001600160a01b03198316179092556040517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0939092839261514d92911683614eb7565b0390a1600060405160008051602061593c83398151915233918061517081614ed1565b0390a3565b6101ca80546001600160a01b0319166001600160a01b03909216919091179055604051600190339060008051602061593c833981519152908061517081614ed1565b91909160a08184031261038957604051906001600160401b039060a08301828111848210176108c95760405282948151845260208201518381116103895781615201918401614352565b60208501526040820151838111610389578161521e918401614352565b604085015261522f60608301614be8565b606085015260808201519283116103895760809261524d9201614352565b910152565b9261529d61528695929693966101c854926040988951988998631fb6ecf560e21b8a5260a060048b015260a48a0190613612565b926024890152600319888403016044890152614394565b903060648601526084850152836000958692038173ecfbcf718e17b6e76a675ddb936a9249c69dd2aa5af4928315615623578491859186956154c6575b506020918284019063ffffffff808351168952610233918286528a8a20546154b2579161537c918b60806153ac8683999897517f06c5a80e592816bd4f60093568e69affa68b5e378a189b2f59a1121703de47de8c808401519261538e8886015195606081019560018060a01b039d8e9b8c9961536f8d8c8c51169601519460a084519a8b9a8b528a015260a0890190613612565b9187830390880152613612565b9160608501528382038a850152613612565b0390a151169861539d8a613ecb565b8b015160608c01513391613fca565b9901511693888c5261023188528c8c2060018060a01b0319958682541617905551168a528552858a8a205585895261023285528989209216908254161790556153f5855161577b565b96865b86518110156154395780615419615412615434938a6139f6565b5130615847565b615423828c6139f6565b5261542e818b6139f6565b50614343565b6153f8565b5091945092955081948281526101fe80865282822033835286526002198383205416928483528187528083203384528752838184205560008051602061595c833981519152933386868680a48483528187528083208684528752600281842054179687928685528152818420908785525282205580a490565b509598979650509250505051168152205490565b92509350503d8085833e6154da81836136b6565b810160608282031261561f578151906001600160401b0391828111614e4757830160a081830312614e475787519161551183613652565b8151848111614b2457816155269184016151b7565b83526020918281015163ffffffff8116810361561b57838501528981015185811161561b578161555d846080936155719501614352565b8c8701526060810151606087015201614be8565b608084015281850151848111614b24578161558d9187016151b7565b94898101519085821161561b57019080601f83011215614b24578151906155b382613747565b956155c08c5197886136b6565b828752848088019360051b8501019382851161561757858101935b8585106155f25750505050505050919093386152da565b84518381116149bc57879161560c86848094870101614352565b8152019401936155db565b8b80fd5b8980fd5b8480fd5b85513d86823e3d90fd5b6001600160a01b031660009081526000805160206159bc8339815191526020526040902054602216151590565b6000526101fe60205260406000209060018060a01b0316600052602052600660406000205416151590565b6001600160a01b031660008181526000805160206159bc83398151915260205260408120805460021790819055919060008051602061595c8339815191528180a4565b600090815261012d60205260409020546001600160a01b03908116919082156156ee5750565b60008080526040902054169150565b604080519161570b83613637565b6000908184528183602095828782015201528152816101609182855260018060a01b03928383832054841c1661576c578180528552209282519361574e85613637565b549063ffffffff808316865282821c1690850152821c169082015290565b50209282519361574e85613637565b9061578582613747565b61579260405191826136b6565b82815280926157a3601f1991613747565b019060005b8281106157b457505050565b8060606020809385010152016157a8565b91906157d08161577b565b9260005b8281106157e057505050565b8060051b820135601e1983360301811215610389578201908135916001600160401b0383116103895760200182360381136103895761582761582d916158429436916136f2565b30615847565b61583782886139f6565b5261542e81876139f6565b6157d4565b90613744916000806040519361585c85613637565b602785527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6020860152660819985a5b195960ca1b6040860152602081519101845af46158a7613987565b92901561590857508151156158ba575090565b3b156158c35790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612e615750805190602001fdfe4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3be6d3a1d957610f7e900c66889b874cdc9f0c22901aa8be6ec3d2d04c14ca0f35fb03d0d293ef5b362761900725ce891f8f766b5a662cdd445372355448e7ca6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f4301e3e862ad13c0503d3de32ba4e2e40c90733d1da23c9df4d0addbcf6508a2646970667358221220429facd3e43446e18dd89daa7159a5455e77973457a99c4277a34e7b9bc99ed664736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0000000000000000000000000bc50029836a59a4e5e1bb8988272f46eba0f99000000000000000000000000007777777f279eba3d3ad8f4e708545291a6fdba8b
-----Decoded View---------------
Arg [0] : _mintFeeRecipient (address): 0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0
Arg [1] : _upgradeGate (address): 0xbC50029836A59A4E5e1Bb8988272F46ebA0F9900
Arg [2] : _protocolRewards (address): 0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0
Arg [1] : 000000000000000000000000bc50029836a59a4e5e1bb8988272f46eba0f9900
Arg [2] : 0000000000000000000000007777777f279eba3d3ad8f4e708545291a6fdba8b
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.