Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
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:
TokenERC1155
Compiler Version
v0.8.12+commit.f00d7308
Optimization Enabled:
Yes with 490 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
// Interface
import { ITokenERC1155 } from "../interfaces/token/ITokenERC1155.sol";
import "../interfaces/IThirdwebContract.sol";
import "../extension/interface/IPlatformFee.sol";
import "../extension/interface/IPrimarySale.sol";
import "../extension/interface/IRoyalty.sol";
import "../extension/interface/IOwnable.sol";
// Token
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
// Signature utils
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
// Access Control + security
import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
// Utils
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol";
import "../lib/CurrencyTransferLib.sol";
import "../lib/FeeType.sol";
import "../openzeppelin-presets/metatx/ERC2771ContextUpgradeable.sol";
// Helper interfaces
import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol";
contract TokenERC1155 is
Initializable,
IThirdwebContract,
IOwnable,
IRoyalty,
IPrimarySale,
IPlatformFee,
EIP712Upgradeable,
ReentrancyGuardUpgradeable,
ERC2771ContextUpgradeable,
MulticallUpgradeable,
AccessControlEnumerableUpgradeable,
ERC1155Upgradeable,
ITokenERC1155
{
using ECDSAUpgradeable for bytes32;
using StringsUpgradeable for uint256;
bytes32 private constant MODULE_TYPE = bytes32("TokenERC1155");
uint256 private constant VERSION = 1;
// Token name
string public name;
// Token symbol
string public symbol;
bytes32 private constant TYPEHASH =
keccak256(
"MintRequest(address to,address royaltyRecipient,uint256 royaltyBps,address primarySaleRecipient,uint256 tokenId,string uri,uint256 quantity,uint256 pricePerToken,address currency,uint128 validityStartTimestamp,uint128 validityEndTimestamp,bytes32 uid)"
);
/// @dev Only TRANSFER_ROLE holders can have tokens transferred from or to them, during restricted transfers.
bytes32 private constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
/// @dev Only MINTER_ROLE holders can sign off on `MintRequest`s.
bytes32 private constant MINTER_ROLE = keccak256("MINTER_ROLE");
/// @dev Max bps in the thirdweb system
uint256 private constant MAX_BPS = 10_000;
/// @dev Owner of the contract (purpose: OpenSea compatibility, etc.)
address private _owner;
/// @dev The next token ID of the NFT to mint.
uint256 public nextTokenIdToMint;
/// @dev The adress that receives all primary sales value.
address public primarySaleRecipient;
/// @dev The adress that receives all primary sales value.
address public platformFeeRecipient;
/// @dev The recipient of who gets the royalty.
address private royaltyRecipient;
/// @dev The percentage of royalty how much royalty in basis points.
uint128 private royaltyBps;
/// @dev The % of primary sales collected by the contract as fees.
uint128 private platformFeeBps;
/// @dev Contract level metadata.
string public contractURI;
/// @dev Mapping from mint request UID => whether the mint request is processed.
mapping(bytes32 => bool) private minted;
mapping(uint256 => string) private _tokenURI;
/// @dev Token ID => total circulating supply of tokens with that ID.
mapping(uint256 => uint256) public totalSupply;
/// @dev Token ID => the address of the recipient of primary sales.
mapping(uint256 => address) public saleRecipientForToken;
/// @dev Token ID => royalty recipient and bps for token
mapping(uint256 => RoyaltyInfo) private royaltyInfoForToken;
constructor() initializer {}
/// @dev Initiliazes the contract, like a constructor.
function initialize(
address _defaultAdmin,
string memory _name,
string memory _symbol,
string memory _contractURI,
address[] memory _trustedForwarders,
address _primarySaleRecipient,
address _royaltyRecipient,
uint128 _royaltyBps,
uint128 _platformFeeBps,
address _platformFeeRecipient
) external initializer {
// Initialize inherited contracts, most base-like -> most derived.
__ReentrancyGuard_init();
__EIP712_init("TokenERC1155", "1");
__ERC2771Context_init(_trustedForwarders);
__ERC1155_init("");
// Initialize this contract's state.
name = _name;
symbol = _symbol;
royaltyRecipient = _royaltyRecipient;
royaltyBps = _royaltyBps;
platformFeeRecipient = _platformFeeRecipient;
primarySaleRecipient = _primarySaleRecipient;
contractURI = _contractURI;
require(_platformFeeBps <= MAX_BPS, "exceeds MAX_BPS");
platformFeeBps = _platformFeeBps;
_owner = _defaultAdmin;
_setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);
_setupRole(MINTER_ROLE, _defaultAdmin);
_setupRole(TRANSFER_ROLE, _defaultAdmin);
_setupRole(TRANSFER_ROLE, address(0));
}
/// ===== Public functions =====
/// @dev Returns the module type of the contract.
function contractType() external pure returns (bytes32) {
return MODULE_TYPE;
}
/// @dev Returns the version of the contract.
function contractVersion() external pure returns (uint8) {
return uint8(VERSION);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return hasRole(DEFAULT_ADMIN_ROLE, _owner) ? _owner : address(0);
}
/// @dev Verifies that a mint request is signed by an account holding MINTER_ROLE (at the time of the function call).
function verify(MintRequest calldata _req, bytes calldata _signature) public view returns (bool, address) {
address signer = recoverAddress(_req, _signature);
return (!minted[_req.uid] && hasRole(MINTER_ROLE, signer), signer);
}
/// @dev Returns the URI for a tokenId
function uri(uint256 _tokenId) public view override returns (string memory) {
return _tokenURI[_tokenId];
}
/// @dev Lets an account with MINTER_ROLE mint an NFT.
function mintTo(
address _to,
uint256 _tokenId,
string calldata _uri,
uint256 _amount
) external onlyRole(MINTER_ROLE) {
uint256 tokenIdToMint;
if (_tokenId == type(uint256).max) {
tokenIdToMint = nextTokenIdToMint;
nextTokenIdToMint += 1;
} else {
require(_tokenId < nextTokenIdToMint, "invalid id");
tokenIdToMint = _tokenId;
}
// `_mintTo` is re-used. `mintTo` just adds a minter role check.
_mintTo(_to, _uri, tokenIdToMint, _amount);
}
/// ===== External functions =====
/// @dev See EIP-2981
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
virtual
returns (address receiver, uint256 royaltyAmount)
{
(address recipient, uint256 bps) = getRoyaltyInfoForToken(tokenId);
receiver = recipient;
royaltyAmount = (salePrice * bps) / MAX_BPS;
}
/// @dev Mints an NFT according to the provided mint request.
function mintWithSignature(MintRequest calldata _req, bytes calldata _signature) external payable nonReentrant {
address signer = verifyRequest(_req, _signature);
address receiver = _req.to;
uint256 tokenIdToMint;
if (_req.tokenId == type(uint256).max) {
tokenIdToMint = nextTokenIdToMint;
nextTokenIdToMint += 1;
} else {
require(_req.tokenId < nextTokenIdToMint, "invalid id");
tokenIdToMint = _req.tokenId;
}
if (_req.royaltyRecipient != address(0)) {
royaltyInfoForToken[tokenIdToMint] = RoyaltyInfo({
recipient: _req.royaltyRecipient,
bps: _req.royaltyBps
});
}
_mintTo(receiver, _req.uri, tokenIdToMint, _req.quantity);
collectPrice(_req);
emit TokensMintedWithSignature(signer, receiver, tokenIdToMint, _req);
}
// ===== Setter functions =====
/// @dev Lets a module admin set the default recipient of all primary sales.
function setPrimarySaleRecipient(address _saleRecipient) external onlyRole(DEFAULT_ADMIN_ROLE) {
primarySaleRecipient = _saleRecipient;
emit PrimarySaleRecipientUpdated(_saleRecipient);
}
/// @dev Lets a module admin update the royalty bps and recipient.
function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
require(_royaltyBps <= MAX_BPS, "exceed royalty bps");
royaltyRecipient = _royaltyRecipient;
royaltyBps = uint128(_royaltyBps);
emit DefaultRoyalty(_royaltyRecipient, _royaltyBps);
}
/// @dev Lets a module admin set the royalty recipient for a particular token Id.
function setRoyaltyInfoForToken(
uint256 _tokenId,
address _recipient,
uint256 _bps
) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(_bps <= MAX_BPS, "exceed royalty bps");
royaltyInfoForToken[_tokenId] = RoyaltyInfo({ recipient: _recipient, bps: _bps });
emit RoyaltyForToken(_tokenId, _recipient, _bps);
}
/// @dev Lets a module admin update the fees on primary sales.
function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
require(_platformFeeBps <= MAX_BPS, "exceeds MAX_BPS");
platformFeeBps = uint64(_platformFeeBps);
platformFeeRecipient = _platformFeeRecipient;
emit PlatformFeeInfoUpdated(_platformFeeRecipient, _platformFeeBps);
}
/// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin.
function setOwner(address _newOwner) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(hasRole(DEFAULT_ADMIN_ROLE, _newOwner), "new owner not module admin.");
address _prevOwner = _owner;
_owner = _newOwner;
emit OwnerUpdated(_prevOwner, _newOwner);
}
/// @dev Lets a module admin set the URI for contract-level metadata.
function setContractURI(string calldata _uri) external onlyRole(DEFAULT_ADMIN_ROLE) {
contractURI = _uri;
}
/// ===== Getter functions =====
/// @dev Returns the platform fee bps and recipient.
function getPlatformFeeInfo() external view returns (address, uint16) {
return (platformFeeRecipient, uint16(platformFeeBps));
}
/// @dev Returns the platform fee bps and recipient.
function getDefaultRoyaltyInfo() external view returns (address, uint16) {
return (royaltyRecipient, uint16(royaltyBps));
}
/// @dev Returns the royalty recipient for a particular token Id.
function getRoyaltyInfoForToken(uint256 _tokenId) public view returns (address, uint16) {
RoyaltyInfo memory royaltyForToken = royaltyInfoForToken[_tokenId];
return
royaltyForToken.recipient == address(0)
? (royaltyRecipient, uint16(royaltyBps))
: (royaltyForToken.recipient, uint16(royaltyForToken.bps));
}
/// ===== Internal functions =====
/// @dev Mints an NFT to `to`
function _mintTo(
address _to,
string calldata _uri,
uint256 _tokenId,
uint256 _amount
) internal {
if (bytes(_tokenURI[_tokenId]).length == 0) {
require(bytes(_uri).length > 0, "empty uri.");
_tokenURI[_tokenId] = _uri;
}
_mint(_to, _tokenId, _amount, "");
emit TokensMinted(_to, _tokenId, _tokenURI[_tokenId], _amount);
}
/// @dev Returns the address of the signer of the mint request.
function recoverAddress(MintRequest calldata _req, bytes calldata _signature) internal view returns (address) {
return _hashTypedDataV4(keccak256(_encodeRequest(_req))).recover(_signature);
}
/// @dev Resolves 'stack too deep' error in `recoverAddress`.
function _encodeRequest(MintRequest calldata _req) internal pure returns (bytes memory) {
return
abi.encode(
TYPEHASH,
_req.to,
_req.royaltyRecipient,
_req.royaltyBps,
_req.primarySaleRecipient,
_req.tokenId,
keccak256(bytes(_req.uri)),
_req.quantity,
_req.pricePerToken,
_req.currency,
_req.validityStartTimestamp,
_req.validityEndTimestamp,
_req.uid
);
}
/// @dev Verifies that a mint request is valid.
function verifyRequest(MintRequest calldata _req, bytes calldata _signature) internal returns (address) {
(bool success, address signer) = verify(_req, _signature);
require(success, "invalid signature");
require(
_req.validityStartTimestamp <= block.timestamp && _req.validityEndTimestamp >= block.timestamp,
"request expired"
);
require(_req.to != address(0), "recipient undefined");
require(_req.quantity > 0, "zero quantity");
minted[_req.uid] = true;
return signer;
}
/// @dev Collects and distributes the primary sale value of tokens being claimed.
function collectPrice(MintRequest calldata _req) internal {
if (_req.pricePerToken == 0) {
return;
}
uint256 totalPrice = _req.pricePerToken * _req.quantity;
uint256 platformFees = (totalPrice * platformFeeBps) / MAX_BPS;
if (_req.currency == CurrencyTransferLib.NATIVE_TOKEN) {
require(msg.value == totalPrice, "must send total price.");
} else {
require(msg.value == 0, "msg value not zero");
}
address saleRecipient = _req.primarySaleRecipient == address(0)
? primarySaleRecipient
: _req.primarySaleRecipient;
CurrencyTransferLib.transferCurrency(_req.currency, _msgSender(), platformFeeRecipient, platformFees);
CurrencyTransferLib.transferCurrency(_req.currency, _msgSender(), saleRecipient, totalPrice - platformFees);
}
/// ===== Low-level overrides =====
/// @dev Lets a token owner burn the tokens they own (i.e. destroy for good)
function burn(
address account,
uint256 id,
uint256 value
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved."
);
_burn(account, id, value);
}
/// @dev Lets a token owner burn multiple tokens they own at once (i.e. destroy for good)
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved."
);
_burnBatch(account, ids, values);
}
/**
* @dev See {ERC1155-_beforeTokenTransfer}.
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
// if transfer is restricted on the contract, we still want to allow burning and minting
if (!hasRole(TRANSFER_ROLE, address(0)) && from != address(0) && to != address(0)) {
require(hasRole(TRANSFER_ROLE, from) || hasRole(TRANSFER_ROLE, to), "restricted to TRANSFER_ROLE holders.");
}
if (from == address(0)) {
for (uint256 i = 0; i < ids.length; ++i) {
totalSupply[ids[i]] += amounts[i];
}
}
if (to == address(0)) {
for (uint256 i = 0; i < ids.length; ++i) {
totalSupply[ids[i]] -= amounts[i];
}
}
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AccessControlEnumerableUpgradeable, ERC1155Upgradeable, IERC165Upgradeable, IERC165)
returns (bool)
{
return
super.supportsInterface(interfaceId) ||
interfaceId == type(IERC1155Upgradeable).interfaceId ||
interfaceId == type(IERC2981Upgradeable).interfaceId;
}
function _msgSender()
internal
view
virtual
override(ContextUpgradeable, ERC2771ContextUpgradeable)
returns (address sender)
{
return ERC2771ContextUpgradeable._msgSender();
}
function _msgData()
internal
view
virtual
override(ContextUpgradeable, ERC2771ContextUpgradeable)
returns (bytes calldata)
{
return ERC2771ContextUpgradeable._msgData();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* [EIP](https://eips.ethereum.org/EIPS/eip-165).
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.0;
import "./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 payed in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
/**
* Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading
* who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses
* information about who the contract's owner is.
*/
interface IOwnable {
/// @dev Returns the owner of the contract.
function owner() external view returns (address);
/// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin.
function setOwner(address _newOwner) external;
/// @dev Emitted when a new Owner is set.
event OwnerUpdated(address indexed prevOwner, address indexed newOwner);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
/**
* Thirdweb's `PlatformFee` is a contract extension to be used with any base contract. It exposes functions for setting and reading
* the recipient of platform fee and the platform fee basis points, and lets the inheriting contract perform conditional logic
* that uses information about platform fees, if desired.
*/
interface IPlatformFee {
/// @dev Returns the platform fee bps and recipient.
function getPlatformFeeInfo() external view returns (address, uint16);
/// @dev Lets a module admin update the fees on primary sales.
function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external;
/// @dev Emitted when fee on primary sales is updated.
event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
/**
* Thirdweb's `Primary` is a contract extension to be used with any base contract. It exposes functions for setting and reading
* the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about
* primary sales, if desired.
*/
interface IPrimarySale {
/// @dev The adress that receives all primary sales value.
function primarySaleRecipient() external view returns (address);
/// @dev Lets a module admin set the default recipient of all primary sales.
function setPrimarySaleRecipient(address _saleRecipient) external;
/// @dev Emitted when a new sale recipient is set.
event PrimarySaleRecipientUpdated(address indexed recipient);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "../../eip/interface/IERC2981.sol";
/**
* Thirdweb's `Royalty` is a contract extension to be used with any base contract. It exposes functions for setting and reading
* the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic
* that uses information about royalty fees, if desired.
*
* The `Royalty` contract is ERC2981 compliant.
*/
interface IRoyalty is IERC2981 {
struct RoyaltyInfo {
address recipient;
uint256 bps;
}
/// @dev Returns the royalty recipient and fee bps.
function getDefaultRoyaltyInfo() external view returns (address, uint16);
/// @dev Lets a module admin update the royalty bps and recipient.
function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external;
/// @dev Lets a module admin set the royalty recipient for a particular token Id.
function setRoyaltyInfoForToken(
uint256 tokenId,
address recipient,
uint256 bps
) external;
/// @dev Returns the royalty recipient for a particular token Id.
function getRoyaltyInfoForToken(uint256 tokenId) external view returns (address, uint16);
/// @dev Emitted when royalty info is updated.
event DefaultRoyalty(address indexed newRoyaltyRecipient, uint256 newRoyaltyBps);
/// @dev Emitted when royalty recipient for tokenId is set
event RoyaltyForToken(uint256 indexed tokenId, address indexed royaltyRecipient, uint256 royaltyBps);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
interface IThirdwebContract {
/// @dev Returns the module type of the contract.
function contractType() external pure returns (bytes32);
/// @dev Returns the version of the contract.
function contractVersion() external pure returns (uint8);
/// @dev Returns the metadata URI of the contract.
function contractURI() external view returns (string memory);
/**
* @dev Sets contract URI for the storefront-level metadata of the contract.
* Only module admin can call this function.
*/
function setContractURI(string calldata _uri) external;
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
interface IWETH {
function deposit() external payable;
function withdraw(uint256 amount) external;
function transfer(address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";
/**
* `SignatureMint1155` is an ERC 1155 contract. It lets anyone mint NFTs by producing a mint request
* and a signature (produced by an account with MINTER_ROLE, signing the mint request).
*/
interface ITokenERC1155 is IERC1155Upgradeable {
/**
* @notice The body of a request to mint NFTs.
*
* @param to The receiver of the NFTs to mint.
* @param royaltyRecipient The recipient of the minted NFT's secondary sales royalties.
* @param primarySaleRecipient The recipient of the minted NFT's primary sales proceeds.
* @param tokenId Optional: specify only if not first mint.
* @param uri The URI of the NFT to mint.
* @param quantity The quantity of NFTs to mint.
* @param pricePerToken Price to pay for minting with the signature.
* @param currency The currency in which the price per token must be paid.
* @param validityStartTimestamp The unix timestamp after which the request is valid.
* @param validityEndTimestamp The unix timestamp after which the request expires.
* @param uid A unique identifier for the request.
*/
struct MintRequest {
address to;
address royaltyRecipient;
uint256 royaltyBps;
address primarySaleRecipient;
uint256 tokenId;
string uri;
uint256 quantity;
uint256 pricePerToken;
address currency;
uint128 validityStartTimestamp;
uint128 validityEndTimestamp;
bytes32 uid;
}
/// @dev Emitted when an account with MINTER_ROLE mints an NFT.
event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri, uint256 quantityMinted);
/// @dev Emitted when tokens are minted.
event TokensMintedWithSignature(
address indexed signer,
address indexed mintedTo,
uint256 indexed tokenIdMinted,
MintRequest mintRequest
);
/**
* @notice Verifies that a mint request is signed by an account holding
* MINTER_ROLE (at the time of the function call).
*
* @param req The mint request.
* @param signature The signature produced by an account signing the mint request.
*
* returns (success, signer) Result of verification and the recovered address.
*/
function verify(MintRequest calldata req, bytes calldata signature)
external
view
returns (bool success, address signer);
/**
* @notice Lets an account with MINTER_ROLE mint an NFT.
*
* @param to The address to mint the NFT to.
* @param tokenId The tokenId of the NFTs to mint
* @param uri The URI to assign to the NFT.
* @param amount The number of copies of the NFT to mint.
*
*/
function mintTo(
address to,
uint256 tokenId,
string calldata uri,
uint256 amount
) external;
/**
* @notice Mints an NFT according to the provided mint request.
*
* @param req The mint request.
* @param signature he signature produced by an account signing the mint request.
*/
function mintWithSignature(MintRequest calldata req, bytes calldata signature) external payable;
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
// Helper interfaces
import { IWETH } from "../interfaces/IWETH.sol";
import "../openzeppelin-presets/token/ERC20/utils/SafeERC20.sol";
library CurrencyTransferLib {
using SafeERC20 for IERC20;
/// @dev The address interpreted as native token of the chain.
address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
/// @dev Transfers a given amount of currency.
function transferCurrency(
address _currency,
address _from,
address _to,
uint256 _amount
) internal {
if (_amount == 0) {
return;
}
if (_currency == NATIVE_TOKEN) {
safeTransferNativeToken(_to, _amount);
} else {
safeTransferERC20(_currency, _from, _to, _amount);
}
}
/// @dev Transfers a given amount of currency. (With native token wrapping)
function transferCurrencyWithWrapper(
address _currency,
address _from,
address _to,
uint256 _amount,
address _nativeTokenWrapper
) internal {
if (_amount == 0) {
return;
}
if (_currency == NATIVE_TOKEN) {
if (_from == address(this)) {
// withdraw from weth then transfer withdrawn native token to recipient
IWETH(_nativeTokenWrapper).withdraw(_amount);
safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);
} else if (_to == address(this)) {
// store native currency in weth
require(_amount == msg.value, "msg.value != amount");
IWETH(_nativeTokenWrapper).deposit{ value: _amount }();
} else {
safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);
}
} else {
safeTransferERC20(_currency, _from, _to, _amount);
}
}
/// @dev Transfer `amount` of ERC20 token from `from` to `to`.
function safeTransferERC20(
address _currency,
address _from,
address _to,
uint256 _amount
) internal {
if (_from == _to) {
return;
}
if (_from == address(this)) {
IERC20(_currency).safeTransfer(_to, _amount);
} else {
IERC20(_currency).safeTransferFrom(_from, _to, _amount);
}
}
/// @dev Transfers `amount` of native token to `to`.
function safeTransferNativeToken(address to, uint256 value) internal {
// solhint-disable avoid-low-level-calls
// slither-disable-next-line low-level-calls
(bool success, ) = to.call{ value: value }("");
require(success, "native token transfer failed");
}
/// @dev Transfers `amount` of native token to `to`. (With native token wrapping)
function safeTransferNativeTokenWithWrapper(
address to,
uint256 value,
address _nativeTokenWrapper
) internal {
// solhint-disable avoid-low-level-calls
// slither-disable-next-line low-level-calls
(bool success, ) = to.call{ value: value }("");
if (!success) {
IWETH(_nativeTokenWrapper).deposit{ value: value }();
IERC20(_nativeTokenWrapper).safeTransfer(to, value);
}
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
library FeeType {
uint256 internal constant PRIMARY_SALE = 0;
uint256 internal constant MARKET_SALE = 1;
uint256 internal constant SPLIT = 2;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library TWAddress {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* [EIP1884](https://eips.ethereum.org/EIPS/eip-1884) increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (metatx/ERC2771Context.sol)
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/**
* @dev Context variant with ERC2771 support.
*/
abstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable {
mapping(address => bool) private _trustedForwarder;
function __ERC2771Context_init(address[] memory trustedForwarder) internal onlyInitializing {
__Context_init_unchained();
__ERC2771Context_init_unchained(trustedForwarder);
}
function __ERC2771Context_init_unchained(address[] memory trustedForwarder) internal onlyInitializing {
for (uint256 i = 0; i < trustedForwarder.length; i++) {
_trustedForwarder[trustedForwarder[i]] = true;
}
}
function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
return _trustedForwarder[forwarder];
}
function _msgSender() internal view virtual override returns (address sender) {
if (isTrustedForwarder(msg.sender)) {
// The assembly code is more direct than the Solidity version using `abi.decode`.
assembly {
sender := shr(96, calldataload(sub(calldatasize(), 20)))
}
} else {
return super._msgSender();
}
}
function _msgData() internal view virtual override returns (bytes calldata) {
if (isTrustedForwarder(msg.sender)) {
return msg.data[:msg.data.length - 20];
} else {
return super._msgData();
}
}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../../../../eip/interface/IERC20.sol";
import "../../../../lib/TWAddress.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using TWAddress for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlEnumerableUpgradeable.sol";
import "./AccessControlUpgradeable.sol";
import "../utils/structs/EnumerableSetUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {
function __AccessControlEnumerable_init() internal onlyInitializing {
}
function __AccessControlEnumerable_init_unchained() internal onlyInitializing {
}
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
return _roleMembers[role].at(index);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
return _roleMembers[role].length();
}
/**
* @dev Overload {_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override {
super._grantRole(role, account);
_roleMembers[role].add(account);
}
/**
* @dev Overload {_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account) internal virtual override {
super._revokeRole(role, account);
_roleMembers[role].remove(account);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.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 IERC2981Upgradeable is IERC165Upgradeable {
/**
* @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 payed in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.0;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since 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.
*
* 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 initialize the implementation contract, you can either invoke the
* initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() initializer {}
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
// contract may have been reentered.
require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} modifier, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
function _isConstructor() private view returns (bool) {
return !AddressUpgradeable.isContract(address(this));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_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 v4.4.1 (token/ERC1155/ERC1155.sol)
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";
/**
* @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) {
require(account != address(0), "ERC1155: balance query for the zero address");
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)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @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 {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not owner nor 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 {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: transfer caller is not owner nor 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 {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_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 {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_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 {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* 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 {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* 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 {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
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");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
/**
* @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.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/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 be 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 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.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)
pragma solidity ^0.8.0;
import "./AddressUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides a function to batch together multiple calls in a single external call.
*
* _Available since v4.1._
*/
abstract contract MulticallUpgradeable is Initializable {
function __Multicall_init() internal onlyInitializing {
}
function __Multicall_init_unchained() internal onlyInitializing {
}
/**
* @dev Receives and executes a batch of function calls on this contract.
*/
function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i = 0; i < data.length; i++) {
results[i] = _functionDelegateCall(address(this), data[i]);
}
return results;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {
require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
}
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");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' 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) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
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.
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 if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} 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 (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// 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) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @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) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)
pragma solidity ^0.8.0;
import "./ECDSAUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
* they need in their contracts using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* _Available since v3.4._
*/
abstract contract EIP712Upgradeable is Initializable {
/* solhint-disable var-name-mixedcase */
bytes32 private _HASHED_NAME;
bytes32 private _HASHED_VERSION;
bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
/* solhint-enable var-name-mixedcase */
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
function __EIP712_init(string memory name, string memory version) internal onlyInitializing {
__EIP712_init_unchained(name, version);
}
function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
_HASHED_NAME = hashedName;
_HASHED_VERSION = hashedVersion;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());
}
function _buildDomainSeparator(
bytes32 typeHash,
bytes32 nameHash,
bytes32 versionHash
) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev The hash of the name parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712NameHash() internal virtual view returns (bytes32) {
return _HASHED_NAME;
}
/**
* @dev The hash of the version parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712VersionHash() internal virtual view returns (bytes32) {
return _HASHED_VERSION;
}
/**
* @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 v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSetUpgradeable {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}{
"optimizer": {
"enabled": true,
"runs": 490
},
"evmVersion": "london",
"remappings": [
":@chainlink/contracts/src/=node_modules/@chainlink/contracts/src/",
":@ds-test/=lib/ds-test/src/",
":@openzeppelin/=node_modules/@openzeppelin/",
":@std/=lib/forge-std/src/",
":contracts/=contracts/",
":ds-test/=lib/ds-test/src/",
":erc721a-upgradeable/=node_modules/erc721a-upgradeable/",
":erc721a/=node_modules/erc721a/",
":forge-std/=lib/forge-std/src/"
],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"newRoyaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"newRoyaltyBps","type":"uint256"}],"name":"DefaultRoyalty","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"platformFeeRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"platformFeeBps","type":"uint256"}],"name":"PlatformFeeInfoUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"PrimarySaleRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"royaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"royaltyBps","type":"uint256"}],"name":"RoyaltyForToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenIdMinted","type":"uint256"},{"indexed":false,"internalType":"string","name":"uri","type":"string"},{"indexed":false,"internalType":"uint256","name":"quantityMinted","type":"uint256"}],"name":"TokensMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenIdMinted","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"address","name":"primarySaleRecipient","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"indexed":false,"internalType":"struct ITokenERC1155.MintRequest","name":"mintRequest","type":"tuple"}],"name":"TokensMintedWithSignature","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getDefaultRoyaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlatformFeeInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getRoyaltyInfoForToken","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_defaultAdmin","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_contractURI","type":"string"},{"internalType":"address[]","name":"_trustedForwarders","type":"address[]"},{"internalType":"address","name":"_primarySaleRecipient","type":"address"},{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint128","name":"_royaltyBps","type":"uint128"},{"internalType":"uint128","name":"_platformFeeBps","type":"uint128"},{"internalType":"address","name":"_platformFeeRecipient","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"address","name":"primarySaleRecipient","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"internalType":"struct ITokenERC1155.MintRequest","name":"_req","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintWithSignature","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":"nextTokenIdToMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primarySaleRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","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":"uint256","name":"","type":"uint256"}],"name":"saleRecipientForToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint256","name":"_royaltyBps","type":"uint256"}],"name":"setDefaultRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platformFeeRecipient","type":"address"},{"internalType":"uint256","name":"_platformFeeBps","type":"uint256"}],"name":"setPlatformFeeInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_saleRecipient","type":"address"}],"name":"setPrimarySaleRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_bps","type":"uint256"}],"name":"setRoyaltyInfoForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"address","name":"primarySaleRecipient","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"internalType":"struct ITokenERC1155.MintRequest","name":"_req","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50600054610100900460ff166200002f5760005460ff161562000039565b62000039620000de565b620000a15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000c4576000805461ffff19166101011790555b8015620000d7576000805461ff00191690555b506200010b565b6000620000f630620000fc60201b62001c961760201c565b15905090565b6001600160a01b03163b151590565b615527806200011b6000396000f3fe6080604052600436106102c15760003560e01c8063938e3d7b1161017f578063bd85b039116100e1578063e8a3d4851161008a578063eb13554f11610064578063eb13554f14610941578063f242432a14610962578063f5298aca1461098257600080fd5b8063e8a3d485146108ab578063e985e9c5146108c0578063ea500d691461090a57600080fd5b8063d45573f6116100bb578063d45573f614610835578063d547741f1461086b578063e15916341461088b57600080fd5b8063bd85b039146107c5578063ca15c873146107f3578063cb2ef6f71461081357600080fd5b8063a217fddf11610143578063b03f45281161011d578063b03f452814610737578063b17cd86f14610757578063b24f2d391461079657600080fd5b8063a217fddf146106d5578063a22cb465146106ea578063ac9650d81461070a57600080fd5b8063938e3d7b1461065157806395d89b411461067157806398a6e993146106865780639bcf7a1514610699578063a0a8e460146106b957600080fd5b806336568abe11610228578063600dd5ea116101ec5780638da5cb5b116101c65780638da5cb5b146105d55780639010d07c146105ea57806391d148541461060a57600080fd5b8063600dd5ea146105755780636b20c454146105955780636f4f2837146105b557600080fd5b806336568abe146104965780633b1475a7146104b65780634cc157df146104cd5780634e1273f41461050f578063572b6c051461053c57600080fd5b806313af40351161028a5780632a55205a116102645780632a55205a146104175780632eb2c2d6146104565780632f2ff15d1461047657600080fd5b806313af4035146103a45780631e7ac488146103c6578063248a9ca3146103e657600080fd5b8062fdd58e146102c657806301ffc9a7146102f957806306fdde0314610329578063079fe40e1461034b5780630e89341c14610384575b600080fd5b3480156102d257600080fd5b506102e66102e13660046144eb565b6109a2565b6040519081526020015b60405180910390f35b34801561030557600080fd5b5061031961031436600461452b565b610a3f565b60405190151581526020016102f0565b34801561033557600080fd5b5061033e610a85565b6040516102f091906145a0565b34801561035757600080fd5b506101c95461036c906001600160a01b031681565b6040516001600160a01b0390911681526020016102f0565b34801561039057600080fd5b5061033e61039f3660046145b3565b610b14565b3480156103b057600080fd5b506103c46103bf3660046145cc565b610bb7565b005b3480156103d257600080fd5b506103c46103e13660046144eb565b610ca5565b3480156103f257600080fd5b506102e66104013660046145b3565b600090815261012f602052604090206001015490565b34801561042357600080fd5b506104376104323660046145e7565b610d71565b604080516001600160a01b0390931683526020830191909152016102f0565b34801561046257600080fd5b506103c4610471366004614755565b610dae565b34801561048257600080fd5b506103c46104913660046147ff565b610e62565b3480156104a257600080fd5b506103c46104b13660046147ff565b610e90565b3480156104c257600080fd5b506102e66101c85481565b3480156104d957600080fd5b506104ed6104e83660046145b3565b610f2c565b604080516001600160a01b03909316835261ffff9091166020830152016102f0565b34801561051b57600080fd5b5061052f61052a366004614898565b610f9c565b6040516102f09190614937565b34801561054857600080fd5b506103196105573660046145cc565b6001600160a01b031660009081526099602052604090205460ff1690565b34801561058157600080fd5b506103c46105903660046144eb565b6110c6565b3480156105a157600080fd5b506103c46105b036600461494a565b61118f565b3480156105c157600080fd5b506103c46105d03660046145cc565b611227565b3480156105e157600080fd5b5061036c611281565b3480156105f657600080fd5b5061036c6106053660046145e7565b6112dc565b34801561061657600080fd5b506103196106253660046147ff565b600091825261012f602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561065d57600080fd5b506103c461066c366004614a00565b6112fc565b34801561067d57600080fd5b5061033e61131d565b6103c4610694366004614a42565b61132b565b3480156106a557600080fd5b506103c46106b4366004614ab4565b61151e565b3480156106c557600080fd5b50604051600181526020016102f0565b3480156106e157600080fd5b506102e6600081565b3480156106f657600080fd5b506103c4610705366004614af7565b6115fa565b34801561071657600080fd5b5061072a610725366004614b2e565b61160c565b6040516102f09190614ba3565b34801561074357600080fd5b506103c4610752366004614c05565b611701565b34801561076357600080fd5b50610777610772366004614a42565b6117b3565b6040805192151583526001600160a01b039091166020830152016102f0565b3480156107a257600080fd5b506101cb546101cc546001600160a01b03909116906001600160801b03166104ed565b3480156107d157600080fd5b506102e66107e03660046145b3565b6101d06020526000908152604090205481565b3480156107ff57600080fd5b506102e661080e3660046145b3565b61182e565b34801561081f57600080fd5b506b546f6b656e4552433131353560a01b6102e6565b34801561084157600080fd5b506101ca546101cc546001600160a01b0390911690600160801b90046001600160801b03166104ed565b34801561087757600080fd5b506103c46108863660046147ff565b611846565b34801561089757600080fd5b506103c46108a6366004614c7e565b61186f565b3480156108b757600080fd5b5061033e611b57565b3480156108cc57600080fd5b506103196108db366004614d91565b6001600160a01b0391821660009081526101946020908152604080832093909416825291909152205460ff1690565b34801561091657600080fd5b5061036c6109253660046145b3565b6101d1602052600090815260409020546001600160a01b031681565b34801561094d57600080fd5b506101ca5461036c906001600160a01b031681565b34801561096e57600080fd5b506103c461097d366004614dbb565b611b65565b34801561098e57600080fd5b506103c461099d366004614e20565b611bfe565b60006001600160a01b038316610a135760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000818152610193602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610a4a82611ca5565b80610a6557506001600160e01b03198216636cdb3d1360e11b145b80610a3957506001600160e01b0319821663152a902d60e11b1492915050565b6101c58054610a9390614e53565b80601f0160208091040260200160405190810160405280929190818152602001828054610abf90614e53565b8015610b0c5780601f10610ae157610100808354040283529160200191610b0c565b820191906000526020600020905b815481529060010190602001808311610aef57829003601f168201915b505050505081565b60008181526101cf60205260409020805460609190610b3290614e53565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5e90614e53565b8015610bab5780601f10610b8057610100808354040283529160200191610bab565b820191906000526020600020905b815481529060010190602001808311610b8e57829003601f168201915b50505050509050919050565b6000610bca81610bc5611ce5565b611cef565b6001600160a01b03821660009081527fe9104285c6851efcbc5e0e70440200efbdcab556a1c8784776780f8bb44f2931602052604090205460ff16610c515760405162461bcd60e51b815260206004820152601b60248201527f6e6577206f776e6572206e6f74206d6f64756c652061646d696e2e00000000006044820152606401610a0a565b6101c780546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a3505050565b6000610cb381610bc5611ce5565b612710821115610cf75760405162461bcd60e51b815260206004820152600f60248201526e65786365656473204d41585f42505360881b6044820152606401610a0a565b6101cc80546001600160801b031667ffffffffffffffff8416600160801b021790556101ca80546001600160a01b0319166001600160a01b0385169081179091556040518381527fe2497bd806ec41a6e0dd992c29a72efc0ef8fec9092d1978fd4a1e00b2f18304906020015b60405180910390a2505050565b600080600080610d8086610f2c565b90945084925061ffff169050612710610d998287614ea4565b610da39190614ec3565b925050509250929050565b610db6611ce5565b6001600160a01b0316856001600160a01b03161480610ddc5750610ddc856108db611ce5565b610e4e5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610a0a565b610e5b8585858585611d70565b5050505050565b600082815261012f6020526040902060010154610e8181610bc5611ce5565b610e8b8383611fec565b505050565b610e98611ce5565b6001600160a01b0316816001600160a01b031614610f1e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610a0a565b610f28828261200f565b5050565b60008181526101d260209081526040808320815180830190925280546001600160a01b031680835260019091015492820192909252829115610f745780516020820151610f92565b6101cb546101cc546001600160a01b03909116906001600160801b03165b9250925050915091565b606081518351146110015760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610a0a565b6000835167ffffffffffffffff81111561101d5761101d614609565b604051908082528060200260200182016040528015611046578160200160208202803683370190505b50905060005b84518110156110be5761109185828151811061106a5761106a614ee5565b602002602001015185838151811061108457611084614ee5565b60200260200101516109a2565b8282815181106110a3576110a3614ee5565b60209081029190910101526110b781614efb565b905061104c565b509392505050565b60006110d481610bc5611ce5565b61271082111561111b5760405162461bcd60e51b815260206004820152601260248201527165786365656420726f79616c74792062707360701b6044820152606401610a0a565b6101cb80546001600160a01b0319166001600160a01b0385169081179091556101cc80546fffffffffffffffffffffffffffffffff19166001600160801b0385161790556040518381527f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb90602001610d64565b611197611ce5565b6001600160a01b0316836001600160a01b031614806111bd57506111bd836108db611ce5565b61121c5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f726044820152691030b8383937bb32b21760b11b6064820152608401610a0a565b610e8b838383612032565b600061123581610bc5611ce5565b6101c980546001600160a01b0319166001600160a01b0384169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a25050565b6101c7546001600160a01b031660009081527fe9104285c6851efcbc5e0e70440200efbdcab556a1c8784776780f8bb44f2931602052604081205460ff166112c95750600090565b6101c7546001600160a01b03165b905090565b6000828152610161602052604081206112f59083612285565b9392505050565b600061130a81610bc5611ce5565b6113176101cd84846143c2565b50505050565b6101c68054610a9390614e53565b6002603554141561137e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a0a565b60026035556000611390848484612291565b905060006113a160208601866145cc565b90506000600019866080013514156113d457506101c880549060019060006113c98385614f16565b9091555061141e9050565b6101c8548660800135106114175760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610a0a565b5060808501355b600061143060408801602089016145cc565b6001600160a01b0316146114a057604051806040016040528087602001602081019061145c91906145cc565b6001600160a01b03908116825260408981013560209384015260008581526101d2845220835181546001600160a01b03191692169190911781559101516001909101555b6114bc826114b160a0890189614f2e565b848a60c00135612456565b6114c586612547565b80826001600160a01b0316846001600160a01b03167f0b35afaf155daeef41cc46df86f058df2855c57d30ab134647a6b587e7cc8c39896040516115099190614fe4565b60405180910390a45050600160355550505050565b600061152c81610bc5611ce5565b6127108211156115735760405162461bcd60e51b815260206004820152601260248201527165786365656420726f79616c74792062707360701b6044820152606401610a0a565b6040805180820182526001600160a01b03858116808352602080840187815260008a81526101d28352869020945185546001600160a01b031916941693909317845591516001909301929092559151848152909186917f7365cf4122f072a3365c20d54eff9b38d73c096c28e1892ec8f5b0e403a0f12d910160405180910390a350505050565b610f28611605611ce5565b8383612716565b60608167ffffffffffffffff81111561162757611627614609565b60405190808252806020026020018201604052801561165a57816020015b60608152602001906001900390816116455790505b50905060005b828110156116fa576116ca3085858481811061167e5761167e614ee5565b90506020028101906116909190614f2e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506127f892505050565b8282815181106116dc576116dc614ee5565b602002602001018190525080806116f290614efb565b915050611660565b5092915050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a661172e81610bc5611ce5565b600060001986141561175b57506101c880549060019060006117508385614f16565b9091555061179d9050565b6101c854861061179a5760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610a0a565b50845b6117aa8786868487612456565b50505050505050565b60008060006117c38686866128ec565b61016087013560009081526101ce602052604090205490915060ff1615801561182357506001600160a01b03811660009081527fa2a71de801f4f5af590dd1e71778408c512ca00170a88b45ca00ba943b31e98e602052604090205460ff165b969095509350505050565b600081815261016160205260408120610a3990612950565b600082815261012f602052604090206001015461186581610bc5611ce5565b610e8b838361200f565b600054610100900460ff1661188a5760005460ff161561188e565b303b155b6118f15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a0a565b600054610100900460ff16158015611913576000805461ffff19166101011790555b61191b61295a565b6119626040518060400160405280600c81526020016b546f6b656e4552433131353560a01b815250604051806040016040528060018152602001603160f81b81525061298b565b61196b876129bc565b611983604051806020016040528060008152506129f7565b8951611997906101c59060208d0190614446565b5088516119ac906101c69060208c0190614446565b506101cb80546001600160a01b03199081166001600160a01b03888116919091179092556101cc80546fffffffffffffffffffffffffffffffff19166001600160801b0388161790556101ca805482168584161790556101c980549091169188169190911790558751611a27906101cd9060208b0190614446565b50612710836001600160801b03161115611a755760405162461bcd60e51b815260206004820152600f60248201526e65786365656473204d41585f42505360881b6044820152606401610a0a565b6101cc80546001600160801b03808616600160801b0291161790556101c780546001600160a01b038d166001600160a01b0319909116179055611ab960008c612a27565b611ae37f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68c612a27565b611b0d7f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c8c612a27565b611b387f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c6000612a27565b8015611b4a576000805461ff00191690555b5050505050505050505050565b6101cd8054610a9390614e53565b611b6d611ce5565b6001600160a01b0316856001600160a01b03161480611b935750611b93856108db611ce5565b611bf15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610a0a565b610e5b8585858585612a31565b611c06611ce5565b6001600160a01b0316836001600160a01b03161480611c2c5750611c2c836108db611ce5565b611c8b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f726044820152691030b8383937bb32b21760b11b6064820152608401610a0a565b610e8b838383612be6565b6001600160a01b03163b151590565b60006001600160e01b03198216636cdb3d1360e11b1480611cd657506001600160e01b031982166303a24d0760e21b145b80610a395750610a3982612d70565b60006112d7612d95565b600082815261012f602090815260408083206001600160a01b038516845290915290205460ff16610f2857611d2e816001600160a01b03166014612dc2565b611d39836020612dc2565b604051602001611d4a929190615113565b60408051601f198184030181529082905262461bcd60e51b8252610a0a916004016145a0565b8151835114611dd25760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610a0a565b6001600160a01b038416611e365760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610a0a565b6000611e40611ce5565b9050611e50818787878787612f6b565b60005b8451811015611f7e576000858281518110611e7057611e70614ee5565b602002602001015190506000858381518110611e8e57611e8e614ee5565b6020908102919091018101516000848152610193835260408082206001600160a01b038e168352909352919091205490915081811015611f235760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610a0a565b6000838152610193602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611f63908490614f16565b9250508190555050505080611f7790614efb565b9050611e53565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611fce929190615194565b60405180910390a4611fe48187878787876131c9565b505050505050565b611ff6828261336f565b600082815261016160205260409020610e8b9082613414565b6120198282613429565b600082815261016160205260409020610e8b90826134cc565b6001600160a01b0383166120945760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610a0a565b80518251146120f65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610a0a565b6000612100611ce5565b905061212081856000868660405180602001604052806000815250612f6b565b60005b835181101561222657600084828151811061214057612140614ee5565b60200260200101519050600084838151811061215e5761215e614ee5565b6020908102919091018101516000848152610193835260408082206001600160a01b038c1683529093529190912054909150818110156121ec5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610a0a565b6000928352610193602090815260408085206001600160a01b038b168652909152909220910390558061221e81614efb565b915050612123565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612277929190615194565b60405180910390a450505050565b60006112f583836134e1565b60008060006122a18686866117b3565b91509150816122f25760405162461bcd60e51b815260206004820152601160248201527f696e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610a0a565b42612305610140880161012089016151b9565b6001600160801b03161115801561233657504261232a610160880161014089016151b9565b6001600160801b031610155b6123825760405162461bcd60e51b815260206004820152600f60248201527f72657175657374206578706972656400000000000000000000000000000000006044820152606401610a0a565b600061239160208801886145cc565b6001600160a01b031614156123e85760405162461bcd60e51b815260206004820152601360248201527f726563697069656e7420756e646566696e6564000000000000000000000000006044820152606401610a0a565b60008660c001351161242c5760405162461bcd60e51b815260206004820152600d60248201526c7a65726f207175616e7469747960981b6044820152606401610a0a565b61016086013560009081526101ce60205260409020805460ff191660011790559150509392505050565b60008281526101cf60205260409020805461247090614e53565b151590506124ce57826124b25760405162461bcd60e51b815260206004820152600a60248201526932b6b83a3c903ab9349760b11b6044820152606401610a0a565b60008281526101cf602052604090206124cc9085856143c2565b505b6124e98583836040518060200160405280600081525061350b565b81856001600160a01b03167f04133ee4cb027e1c5fce5e3481289278a93bd16a65a3b65b428a6d239e706bfb6101cf6000868152602001908152602001600020846040516125389291906151d4565b60405180910390a35050505050565b60e08101356125535750565b600061256760c083013560e0840135614ea4565b6101cc549091506000906127109061258f90600160801b90046001600160801b031684614ea4565b6125999190614ec3565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6125c2610120850161010086016145cc565b6001600160a01b03161415612625578134146126205760405162461bcd60e51b815260206004820152601660248201527f6d7573742073656e6420746f74616c2070726963652e000000000000000000006044820152606401610a0a565b612673565b34156126735760405162461bcd60e51b815260206004820152601260248201527f6d73672076616c7565206e6f74207a65726f00000000000000000000000000006044820152606401610a0a565b60008061268660808601606087016145cc565b6001600160a01b0316146126a9576126a460808501606086016145cc565b6126b7565b6101c9546001600160a01b03165b90506126e96126ce610120860161010087016145cc565b6126d6611ce5565b6101ca546001600160a01b03168561361a565b6113176126fe610120860161010087016145cc565b612706611ce5565b836127118688615284565b61361a565b816001600160a01b0316836001600160a01b0316141561278a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610a0a565b6001600160a01b0383811660008181526101946020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60606001600160a01b0383163b6128605760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610a0a565b600080846001600160a01b03168460405161287b919061529b565b600060405180830381855af49150503d80600081146128b6576040519150601f19603f3d011682016040523d82523d6000602084013e6128bb565b606091505b50915091506128e382826040518060600160405280602781526020016154cb60279139613664565b95945050505050565b600061294883838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506129429250612936915088905061369d565b805190602001206137f3565b90613841565b949350505050565b6000610a39825490565b600054610100900460ff166129815760405162461bcd60e51b8152600401610a0a906152b7565b61298961385d565b565b600054610100900460ff166129b25760405162461bcd60e51b8152600401610a0a906152b7565b610f28828261388b565b600054610100900460ff166129e35760405162461bcd60e51b8152600401610a0a906152b7565b6129eb6138cc565b6129f4816138f3565b50565b600054610100900460ff16612a1e5760405162461bcd60e51b8152600401610a0a906152b7565b6129f481613982565b610f288282611fec565b6001600160a01b038416612a955760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610a0a565b6000612a9f611ce5565b9050612abf818787612ab0886139b2565b612ab9886139b2565b87612f6b565b6000848152610193602090815260408083206001600160a01b038a16845290915290205483811015612b465760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610a0a565b6000858152610193602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612b86908490614f16565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46117aa8288888888886139fd565b6001600160a01b038316612c485760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610a0a565b6000612c52611ce5565b9050612c8281856000612c64876139b2565b612c6d876139b2565b60405180602001604052806000815250612f6b565b6000838152610193602090815260408083206001600160a01b038816845290915290205482811015612d025760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610a0a565b6000848152610193602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b60006001600160e01b03198216635a05180f60e01b1480610a395750610a3982613af9565b3360009081526099602052604081205460ff1615612dba575060131936013560601c90565b503390565b90565b60606000612dd1836002614ea4565b612ddc906002614f16565b67ffffffffffffffff811115612df457612df4614609565b6040519080825280601f01601f191660200182016040528015612e1e576020820181803683370190505b509050600360fc1b81600081518110612e3957612e39614ee5565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612e6857612e68614ee5565b60200101906001600160f81b031916908160001a9053506000612e8c846002614ea4565b612e97906001614f16565b90505b6001811115612f1c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612ed857612ed8614ee5565b1a60f81b828281518110612eee57612eee614ee5565b60200101906001600160f81b031916908160001a90535060049490941c93612f1581615302565b9050612e9a565b5083156112f55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a0a565b600080527fdf45e191c6a8bff7d5b2484d5c1deccbd5b2abc06a2abf694394baf9d01cb5e56020527f2b85be2befc2dd713b2f771c3d841437400c04e85bacc15958c6dcadb2aa5c045460ff16158015612fcd57506001600160a01b03851615155b8015612fe157506001600160a01b03841615155b156130bb576001600160a01b03851660009081527fdf45e191c6a8bff7d5b2484d5c1deccbd5b2abc06a2abf694394baf9d01cb5e5602052604090205460ff168061306357506001600160a01b03841660009081527fdf45e191c6a8bff7d5b2484d5c1deccbd5b2abc06a2abf694394baf9d01cb5e5602052604090205460ff165b6130bb5760405162461bcd60e51b8152602060048201526024808201527f7265737472696374656420746f205452414e534645525f524f4c4520686f6c6460448201526332b9399760e11b6064820152608401610a0a565b6001600160a01b0385166131435760005b8351811015613141578281815181106130e7576130e7614ee5565b60200260200101516101d0600086848151811061310657613106614ee5565b60200260200101518152602001908152602001600020600082825461312b9190614f16565b9091555061313a905081614efb565b90506130cc565b505b6001600160a01b038416611fe45760005b83518110156117aa5782818151811061316f5761316f614ee5565b60200260200101516101d0600086848151811061318e5761318e614ee5565b6020026020010151815260200190815260200160002060008282546131b39190615284565b909155506131c2905081614efb565b9050613154565b6001600160a01b0384163b15611fe45760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061320d9089908990889088908890600401615319565b6020604051808303816000875af1925050508015613248575060408051601f3d908101601f1916820190925261324591810190615377565b60015b6132fe57613254615394565b806308c379a0141561328e57506132696153af565b806132745750613290565b8060405162461bcd60e51b8152600401610a0a91906145a0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610a0a565b6001600160e01b0319811663bc197c8160e01b146117aa5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610a0a565b600082815261012f602090815260408083206001600160a01b038516845290915290205460ff16610f2857600082815261012f602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133d0611ce5565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006112f5836001600160a01b038416613b2e565b600082815261012f602090815260408083206001600160a01b038516845290915290205460ff1615610f2857600082815261012f602090815260408083206001600160a01b03851684529091529020805460ff19169055613488611ce5565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60006112f5836001600160a01b038416613b7d565b60008260000182815481106134f8576134f8614ee5565b9060005260206000200154905092915050565b6001600160a01b03841661356b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610a0a565b6000613575611ce5565b905061358781600087612ab0886139b2565b6000848152610193602090815260408083206001600160a01b0389168452909152812080548592906135ba908490614f16565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610e5b816000878787876139fd565b8061362457611317565b6001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415613658576136538282613c70565b611317565b61131784848484613d13565b606083156136735750816112f5565b8251156136835782518084602001fd5b8160405162461bcd60e51b8152600401610a0a91906145a0565b60607fc7a95ef88f83fa833ccfce325157b7111633b181b6a27181b86415d8d501134d6136cd60208401846145cc565b6136dd60408501602086016145cc565b60408501356136f260808701606088016145cc565b608087013561370460a0890189614f2e565b604051613712929190615439565b60405190819003902060c089013560e08a01356137376101208c016101008d016145cc565b6137496101408d016101208e016151b9565b61375b6101608e016101408f016151b9565b60408051602081019d909d526001600160a01b039b8c16908d0152988a1660608c015260808b019790975294881660a08a015260c089019390935260e08801919091526101008701526101208601529092166101408401526001600160801b039182166101608085019190915291166101808301528301356101a08201526101c0016040516020818303038152906040529050919050565b6000610a39613800613d6c565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006138508585613de7565b915091506110be81613e57565b600054610100900460ff166138845760405162461bcd60e51b8152600401610a0a906152b7565b6001603555565b600054610100900460ff166138b25760405162461bcd60e51b8152600401610a0a906152b7565b815160209283012081519190920120600191909155600255565b600054610100900460ff166129895760405162461bcd60e51b8152600401610a0a906152b7565b600054610100900460ff1661391a5760405162461bcd60e51b8152600401610a0a906152b7565b60005b8151811015610f285760016099600084848151811061393e5761393e614ee5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061397a81614efb565b91505061391d565b600054610100900460ff166139a95760405162461bcd60e51b8152600401610a0a906152b7565b6129f481614012565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106139ec576139ec614ee5565b602090810291909101015292915050565b6001600160a01b0384163b15611fe45760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613a419089908990889088908890600401615449565b6020604051808303816000875af1925050508015613a7c575060408051601f3d908101601f19168201909252613a7991810190615377565b60015b613a8857613254615394565b6001600160e01b0319811663f23a6e6160e01b146117aa5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610a0a565b60006001600160e01b03198216637965db0b60e01b1480610a3957506301ffc9a760e01b6001600160e01b0319831614610a39565b6000818152600183016020526040812054613b7557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a39565b506000610a39565b60008181526001830160205260408120548015613c66576000613ba1600183615284565b8554909150600090613bb590600190615284565b9050818114613c1a576000866000018281548110613bd557613bd5614ee5565b9060005260206000200154905080876000018481548110613bf857613bf8614ee5565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613c2b57613c2b615481565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a39565b6000915050610a39565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613cbd576040519150601f19603f3d011682016040523d82523d6000602084013e613cc2565b606091505b5050905080610e8b5760405162461bcd60e51b815260206004820152601c60248201527f6e617469766520746f6b656e207472616e73666572206661696c6564000000006044820152606401610a0a565b816001600160a01b0316836001600160a01b03161415613d3257611317565b6001600160a01b038316301415613d57576136536001600160a01b0385168383614026565b6113176001600160a01b03851684848461409e565b60006112d77f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613d9b60015490565b6002546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b600080825160411415613e1e5760208301516040840151606085015160001a613e12878285856140d6565b94509450505050613e50565b825160401415613e485760208301516040840151613e3d8683836141c3565b935093505050613e50565b506000905060025b9250929050565b6000816004811115613e6b57613e6b615497565b1415613e745750565b6001816004811115613e8857613e88615497565b1415613ed65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a0a565b6002816004811115613eea57613eea615497565b1415613f385760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a0a565b6003816004811115613f4c57613f4c615497565b1415613fa55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a0a565b6004816004811115613fb957613fb9615497565b14156129f45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a0a565b8051610f2890610195906020840190614446565b6040516001600160a01b038316602482015260448101829052610e8b90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152614215565b6040516001600160a01b03808516602483015283166044820152606481018290526113179085906323b872dd60e01b90608401614052565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561410d57506000905060036141ba565b8460ff16601b1415801561412557508460ff16601c14155b1561413657506000905060046141ba565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561418a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166141b3576000600192509250506141ba565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316816141f960ff86901c601b614f16565b9050614207878288856140d6565b935093505050935093915050565b600061426a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166142e79092919063ffffffff16565b805190915015610e8b578080602001905181019061428891906154ad565b610e8b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a0a565b60606129488484600085856001600160a01b0385163b6143495760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a0a565b600080866001600160a01b03168587604051614365919061529b565b60006040518083038185875af1925050503d80600081146143a2576040519150601f19603f3d011682016040523d82523d6000602084013e6143a7565b606091505b50915091506143b7828286613664565b979650505050505050565b8280546143ce90614e53565b90600052602060002090601f0160209004810192826143f05760008555614436565b82601f106144095782800160ff19823516178555614436565b82800160010185558215614436579182015b8281111561443657823582559160200191906001019061441b565b506144429291506144ba565b5090565b82805461445290614e53565b90600052602060002090601f0160209004810192826144745760008555614436565b82601f1061448d57805160ff1916838001178555614436565b82800160010185558215614436579182015b8281111561443657825182559160200191906001019061449f565b5b8082111561444257600081556001016144bb565b80356001600160a01b03811681146144e657600080fd5b919050565b600080604083850312156144fe57600080fd5b614507836144cf565b946020939093013593505050565b6001600160e01b0319811681146129f457600080fd5b60006020828403121561453d57600080fd5b81356112f581614515565b60005b8381101561456357818101518382015260200161454b565b838111156113175750506000910152565b6000815180845261458c816020860160208601614548565b601f01601f19169290920160200192915050565b6020815260006112f56020830184614574565b6000602082840312156145c557600080fd5b5035919050565b6000602082840312156145de57600080fd5b6112f5826144cf565b600080604083850312156145fa57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff8111828210171561464557614645614609565b6040525050565b600067ffffffffffffffff82111561466657614666614609565b5060051b60200190565b600082601f83011261468157600080fd5b8135602061468e8261464c565b60405161469b828261461f565b83815260059390931b85018201928281019150868411156146bb57600080fd5b8286015b848110156146d657803583529183019183016146bf565b509695505050505050565b600082601f8301126146f257600080fd5b813567ffffffffffffffff81111561470c5761470c614609565b604051614723601f8301601f19166020018261461f565b81815284602083860101111561473857600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561476d57600080fd5b614776866144cf565b9450614784602087016144cf565b9350604086013567ffffffffffffffff808211156147a157600080fd5b6147ad89838a01614670565b945060608801359150808211156147c357600080fd5b6147cf89838a01614670565b935060808801359150808211156147e557600080fd5b506147f2888289016146e1565b9150509295509295909350565b6000806040838503121561481257600080fd5b82359150614822602084016144cf565b90509250929050565b600082601f83011261483c57600080fd5b813560206148498261464c565b604051614856828261461f565b83815260059390931b850182019282810191508684111561487657600080fd5b8286015b848110156146d65761488b816144cf565b835291830191830161487a565b600080604083850312156148ab57600080fd5b823567ffffffffffffffff808211156148c357600080fd5b6148cf8683870161482b565b935060208501359150808211156148e557600080fd5b506148f285828601614670565b9150509250929050565b600081518084526020808501945080840160005b8381101561492c57815187529582019590820190600101614910565b509495945050505050565b6020815260006112f560208301846148fc565b60008060006060848603121561495f57600080fd5b614968846144cf565b9250602084013567ffffffffffffffff8082111561498557600080fd5b61499187838801614670565b935060408601359150808211156149a757600080fd5b506149b486828701614670565b9150509250925092565b60008083601f8401126149d057600080fd5b50813567ffffffffffffffff8111156149e857600080fd5b602083019150836020828501011115613e5057600080fd5b60008060208385031215614a1357600080fd5b823567ffffffffffffffff811115614a2a57600080fd5b614a36858286016149be565b90969095509350505050565b600080600060408486031215614a5757600080fd5b833567ffffffffffffffff80821115614a6f57600080fd5b908501906101808288031215614a8457600080fd5b90935060208501359080821115614a9a57600080fd5b50614aa7868287016149be565b9497909650939450505050565b600080600060608486031215614ac957600080fd5b83359250614ad9602085016144cf565b9150604084013590509250925092565b80151581146129f457600080fd5b60008060408385031215614b0a57600080fd5b614b13836144cf565b91506020830135614b2381614ae9565b809150509250929050565b60008060208385031215614b4157600080fd5b823567ffffffffffffffff80821115614b5957600080fd5b818501915085601f830112614b6d57600080fd5b813581811115614b7c57600080fd5b8660208260051b8501011115614b9157600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614bf857603f19888603018452614be6858351614574565b94509285019290850190600101614bca565b5092979650505050505050565b600080600080600060808688031215614c1d57600080fd5b614c26866144cf565b945060208601359350604086013567ffffffffffffffff811115614c4957600080fd5b614c55888289016149be565b96999598509660600135949350505050565b80356001600160801b03811681146144e657600080fd5b6000806000806000806000806000806101408b8d031215614c9e57600080fd5b614ca78b6144cf565b995060208b013567ffffffffffffffff80821115614cc457600080fd5b614cd08e838f016146e1565b9a5060408d0135915080821115614ce657600080fd5b614cf28e838f016146e1565b995060608d0135915080821115614d0857600080fd5b614d148e838f016146e1565b985060808d0135915080821115614d2a57600080fd5b50614d378d828e0161482b565b965050614d4660a08c016144cf565b9450614d5460c08c016144cf565b9350614d6260e08c01614c67565b9250614d716101008c01614c67565b9150614d806101208c016144cf565b90509295989b9194979a5092959850565b60008060408385031215614da457600080fd5b614dad836144cf565b9150614822602084016144cf565b600080600080600060a08688031215614dd357600080fd5b614ddc866144cf565b9450614dea602087016144cf565b93506040860135925060608601359150608086013567ffffffffffffffff811115614e1457600080fd5b6147f2888289016146e1565b600080600060608486031215614e3557600080fd5b614e3e846144cf565b95602085013595506040909401359392505050565b600181811c90821680614e6757607f821691505b60208210811415614e8857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615614ebe57614ebe614e8e565b500290565b600082614ee057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000600019821415614f0f57614f0f614e8e565b5060010190565b60008219821115614f2957614f29614e8e565b500190565b6000808335601e19843603018112614f4557600080fd5b83018035915067ffffffffffffffff821115614f6057600080fd5b602001915036819003821315613e5057600080fd5b6000808335601e19843603018112614f8c57600080fd5b830160208101925035905067ffffffffffffffff811115614fac57600080fd5b803603831315613e5057600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815261500560208201614ff8846144cf565b6001600160a01b03169052565b6000615013602084016144cf565b6001600160a01b03811660408401525060408301356060830152615039606084016144cf565b6001600160a01b038116608084015250608083013560a083015261506060a0840184614f75565b6101808060c08601526150786101a086018385614fbb565b925060c086013560e0860152610100915060e08601358286015261509d8287016144cf565b91506101206150b6818701846001600160a01b03169052565b6150c1818801614c67565b9250506101406150db818701846001600160801b03169052565b6150e6818801614c67565b925050610160615100818701846001600160801b03169052565b9590950135939094019290925250919050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161514b816017850160208801614548565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351615188816028840160208801614548565b01602801949350505050565b6040815260006151a760408301856148fc565b82810360208401526128e381856148fc565b6000602082840312156151cb57600080fd5b6112f582614c67565b60408152600080845481600182811c9150808316806151f457607f831692505b602080841082141561521457634e487b7160e01b86526022600452602486fd5b604088018490526060880182801561523357600181146152445761526f565b60ff1987168252828201975061526f565b60008c81526020902060005b8781101561526957815484820152908601908401615250565b83019850505b50509690960196909652509095945050505050565b60008282101561529657615296614e8e565b500390565b600082516152ad818460208701614548565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008161531157615311614e8e565b506000190190565b60006001600160a01b03808816835280871660208401525060a0604083015261534560a08301866148fc565b828103606084015261535781866148fc565b9050828103608084015261536b8185614574565b98975050505050505050565b60006020828403121561538957600080fd5b81516112f581614515565b600060033d1115612dbf5760046000803e5060005160e01c90565b600060443d10156153bd5790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156153ed57505050505090565b82850191508151818111156154055750505050505090565b843d870101602082850101111561541f5750505050505090565b61542e6020828601018761461f565b509095945050505050565b8183823760009101908152919050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526143b760a0830184614574565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6000602082840312156154bf57600080fd5b81516112f581614ae956fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212209f19d50c30c6eca7b6a46105b0642a4c9fc325af759bbe11e4f5f9f0a65805de64736f6c634300080c0033
Deployed Bytecode
0x6080604052600436106102c15760003560e01c8063938e3d7b1161017f578063bd85b039116100e1578063e8a3d4851161008a578063eb13554f11610064578063eb13554f14610941578063f242432a14610962578063f5298aca1461098257600080fd5b8063e8a3d485146108ab578063e985e9c5146108c0578063ea500d691461090a57600080fd5b8063d45573f6116100bb578063d45573f614610835578063d547741f1461086b578063e15916341461088b57600080fd5b8063bd85b039146107c5578063ca15c873146107f3578063cb2ef6f71461081357600080fd5b8063a217fddf11610143578063b03f45281161011d578063b03f452814610737578063b17cd86f14610757578063b24f2d391461079657600080fd5b8063a217fddf146106d5578063a22cb465146106ea578063ac9650d81461070a57600080fd5b8063938e3d7b1461065157806395d89b411461067157806398a6e993146106865780639bcf7a1514610699578063a0a8e460146106b957600080fd5b806336568abe11610228578063600dd5ea116101ec5780638da5cb5b116101c65780638da5cb5b146105d55780639010d07c146105ea57806391d148541461060a57600080fd5b8063600dd5ea146105755780636b20c454146105955780636f4f2837146105b557600080fd5b806336568abe146104965780633b1475a7146104b65780634cc157df146104cd5780634e1273f41461050f578063572b6c051461053c57600080fd5b806313af40351161028a5780632a55205a116102645780632a55205a146104175780632eb2c2d6146104565780632f2ff15d1461047657600080fd5b806313af4035146103a45780631e7ac488146103c6578063248a9ca3146103e657600080fd5b8062fdd58e146102c657806301ffc9a7146102f957806306fdde0314610329578063079fe40e1461034b5780630e89341c14610384575b600080fd5b3480156102d257600080fd5b506102e66102e13660046144eb565b6109a2565b6040519081526020015b60405180910390f35b34801561030557600080fd5b5061031961031436600461452b565b610a3f565b60405190151581526020016102f0565b34801561033557600080fd5b5061033e610a85565b6040516102f091906145a0565b34801561035757600080fd5b506101c95461036c906001600160a01b031681565b6040516001600160a01b0390911681526020016102f0565b34801561039057600080fd5b5061033e61039f3660046145b3565b610b14565b3480156103b057600080fd5b506103c46103bf3660046145cc565b610bb7565b005b3480156103d257600080fd5b506103c46103e13660046144eb565b610ca5565b3480156103f257600080fd5b506102e66104013660046145b3565b600090815261012f602052604090206001015490565b34801561042357600080fd5b506104376104323660046145e7565b610d71565b604080516001600160a01b0390931683526020830191909152016102f0565b34801561046257600080fd5b506103c4610471366004614755565b610dae565b34801561048257600080fd5b506103c46104913660046147ff565b610e62565b3480156104a257600080fd5b506103c46104b13660046147ff565b610e90565b3480156104c257600080fd5b506102e66101c85481565b3480156104d957600080fd5b506104ed6104e83660046145b3565b610f2c565b604080516001600160a01b03909316835261ffff9091166020830152016102f0565b34801561051b57600080fd5b5061052f61052a366004614898565b610f9c565b6040516102f09190614937565b34801561054857600080fd5b506103196105573660046145cc565b6001600160a01b031660009081526099602052604090205460ff1690565b34801561058157600080fd5b506103c46105903660046144eb565b6110c6565b3480156105a157600080fd5b506103c46105b036600461494a565b61118f565b3480156105c157600080fd5b506103c46105d03660046145cc565b611227565b3480156105e157600080fd5b5061036c611281565b3480156105f657600080fd5b5061036c6106053660046145e7565b6112dc565b34801561061657600080fd5b506103196106253660046147ff565b600091825261012f602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561065d57600080fd5b506103c461066c366004614a00565b6112fc565b34801561067d57600080fd5b5061033e61131d565b6103c4610694366004614a42565b61132b565b3480156106a557600080fd5b506103c46106b4366004614ab4565b61151e565b3480156106c557600080fd5b50604051600181526020016102f0565b3480156106e157600080fd5b506102e6600081565b3480156106f657600080fd5b506103c4610705366004614af7565b6115fa565b34801561071657600080fd5b5061072a610725366004614b2e565b61160c565b6040516102f09190614ba3565b34801561074357600080fd5b506103c4610752366004614c05565b611701565b34801561076357600080fd5b50610777610772366004614a42565b6117b3565b6040805192151583526001600160a01b039091166020830152016102f0565b3480156107a257600080fd5b506101cb546101cc546001600160a01b03909116906001600160801b03166104ed565b3480156107d157600080fd5b506102e66107e03660046145b3565b6101d06020526000908152604090205481565b3480156107ff57600080fd5b506102e661080e3660046145b3565b61182e565b34801561081f57600080fd5b506b546f6b656e4552433131353560a01b6102e6565b34801561084157600080fd5b506101ca546101cc546001600160a01b0390911690600160801b90046001600160801b03166104ed565b34801561087757600080fd5b506103c46108863660046147ff565b611846565b34801561089757600080fd5b506103c46108a6366004614c7e565b61186f565b3480156108b757600080fd5b5061033e611b57565b3480156108cc57600080fd5b506103196108db366004614d91565b6001600160a01b0391821660009081526101946020908152604080832093909416825291909152205460ff1690565b34801561091657600080fd5b5061036c6109253660046145b3565b6101d1602052600090815260409020546001600160a01b031681565b34801561094d57600080fd5b506101ca5461036c906001600160a01b031681565b34801561096e57600080fd5b506103c461097d366004614dbb565b611b65565b34801561098e57600080fd5b506103c461099d366004614e20565b611bfe565b60006001600160a01b038316610a135760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000818152610193602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610a4a82611ca5565b80610a6557506001600160e01b03198216636cdb3d1360e11b145b80610a3957506001600160e01b0319821663152a902d60e11b1492915050565b6101c58054610a9390614e53565b80601f0160208091040260200160405190810160405280929190818152602001828054610abf90614e53565b8015610b0c5780601f10610ae157610100808354040283529160200191610b0c565b820191906000526020600020905b815481529060010190602001808311610aef57829003601f168201915b505050505081565b60008181526101cf60205260409020805460609190610b3290614e53565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5e90614e53565b8015610bab5780601f10610b8057610100808354040283529160200191610bab565b820191906000526020600020905b815481529060010190602001808311610b8e57829003601f168201915b50505050509050919050565b6000610bca81610bc5611ce5565b611cef565b6001600160a01b03821660009081527fe9104285c6851efcbc5e0e70440200efbdcab556a1c8784776780f8bb44f2931602052604090205460ff16610c515760405162461bcd60e51b815260206004820152601b60248201527f6e6577206f776e6572206e6f74206d6f64756c652061646d696e2e00000000006044820152606401610a0a565b6101c780546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a3505050565b6000610cb381610bc5611ce5565b612710821115610cf75760405162461bcd60e51b815260206004820152600f60248201526e65786365656473204d41585f42505360881b6044820152606401610a0a565b6101cc80546001600160801b031667ffffffffffffffff8416600160801b021790556101ca80546001600160a01b0319166001600160a01b0385169081179091556040518381527fe2497bd806ec41a6e0dd992c29a72efc0ef8fec9092d1978fd4a1e00b2f18304906020015b60405180910390a2505050565b600080600080610d8086610f2c565b90945084925061ffff169050612710610d998287614ea4565b610da39190614ec3565b925050509250929050565b610db6611ce5565b6001600160a01b0316856001600160a01b03161480610ddc5750610ddc856108db611ce5565b610e4e5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610a0a565b610e5b8585858585611d70565b5050505050565b600082815261012f6020526040902060010154610e8181610bc5611ce5565b610e8b8383611fec565b505050565b610e98611ce5565b6001600160a01b0316816001600160a01b031614610f1e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610a0a565b610f28828261200f565b5050565b60008181526101d260209081526040808320815180830190925280546001600160a01b031680835260019091015492820192909252829115610f745780516020820151610f92565b6101cb546101cc546001600160a01b03909116906001600160801b03165b9250925050915091565b606081518351146110015760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610a0a565b6000835167ffffffffffffffff81111561101d5761101d614609565b604051908082528060200260200182016040528015611046578160200160208202803683370190505b50905060005b84518110156110be5761109185828151811061106a5761106a614ee5565b602002602001015185838151811061108457611084614ee5565b60200260200101516109a2565b8282815181106110a3576110a3614ee5565b60209081029190910101526110b781614efb565b905061104c565b509392505050565b60006110d481610bc5611ce5565b61271082111561111b5760405162461bcd60e51b815260206004820152601260248201527165786365656420726f79616c74792062707360701b6044820152606401610a0a565b6101cb80546001600160a01b0319166001600160a01b0385169081179091556101cc80546fffffffffffffffffffffffffffffffff19166001600160801b0385161790556040518381527f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb90602001610d64565b611197611ce5565b6001600160a01b0316836001600160a01b031614806111bd57506111bd836108db611ce5565b61121c5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f726044820152691030b8383937bb32b21760b11b6064820152608401610a0a565b610e8b838383612032565b600061123581610bc5611ce5565b6101c980546001600160a01b0319166001600160a01b0384169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a25050565b6101c7546001600160a01b031660009081527fe9104285c6851efcbc5e0e70440200efbdcab556a1c8784776780f8bb44f2931602052604081205460ff166112c95750600090565b6101c7546001600160a01b03165b905090565b6000828152610161602052604081206112f59083612285565b9392505050565b600061130a81610bc5611ce5565b6113176101cd84846143c2565b50505050565b6101c68054610a9390614e53565b6002603554141561137e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a0a565b60026035556000611390848484612291565b905060006113a160208601866145cc565b90506000600019866080013514156113d457506101c880549060019060006113c98385614f16565b9091555061141e9050565b6101c8548660800135106114175760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610a0a565b5060808501355b600061143060408801602089016145cc565b6001600160a01b0316146114a057604051806040016040528087602001602081019061145c91906145cc565b6001600160a01b03908116825260408981013560209384015260008581526101d2845220835181546001600160a01b03191692169190911781559101516001909101555b6114bc826114b160a0890189614f2e565b848a60c00135612456565b6114c586612547565b80826001600160a01b0316846001600160a01b03167f0b35afaf155daeef41cc46df86f058df2855c57d30ab134647a6b587e7cc8c39896040516115099190614fe4565b60405180910390a45050600160355550505050565b600061152c81610bc5611ce5565b6127108211156115735760405162461bcd60e51b815260206004820152601260248201527165786365656420726f79616c74792062707360701b6044820152606401610a0a565b6040805180820182526001600160a01b03858116808352602080840187815260008a81526101d28352869020945185546001600160a01b031916941693909317845591516001909301929092559151848152909186917f7365cf4122f072a3365c20d54eff9b38d73c096c28e1892ec8f5b0e403a0f12d910160405180910390a350505050565b610f28611605611ce5565b8383612716565b60608167ffffffffffffffff81111561162757611627614609565b60405190808252806020026020018201604052801561165a57816020015b60608152602001906001900390816116455790505b50905060005b828110156116fa576116ca3085858481811061167e5761167e614ee5565b90506020028101906116909190614f2e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506127f892505050565b8282815181106116dc576116dc614ee5565b602002602001018190525080806116f290614efb565b915050611660565b5092915050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a661172e81610bc5611ce5565b600060001986141561175b57506101c880549060019060006117508385614f16565b9091555061179d9050565b6101c854861061179a5760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610a0a565b50845b6117aa8786868487612456565b50505050505050565b60008060006117c38686866128ec565b61016087013560009081526101ce602052604090205490915060ff1615801561182357506001600160a01b03811660009081527fa2a71de801f4f5af590dd1e71778408c512ca00170a88b45ca00ba943b31e98e602052604090205460ff165b969095509350505050565b600081815261016160205260408120610a3990612950565b600082815261012f602052604090206001015461186581610bc5611ce5565b610e8b838361200f565b600054610100900460ff1661188a5760005460ff161561188e565b303b155b6118f15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a0a565b600054610100900460ff16158015611913576000805461ffff19166101011790555b61191b61295a565b6119626040518060400160405280600c81526020016b546f6b656e4552433131353560a01b815250604051806040016040528060018152602001603160f81b81525061298b565b61196b876129bc565b611983604051806020016040528060008152506129f7565b8951611997906101c59060208d0190614446565b5088516119ac906101c69060208c0190614446565b506101cb80546001600160a01b03199081166001600160a01b03888116919091179092556101cc80546fffffffffffffffffffffffffffffffff19166001600160801b0388161790556101ca805482168584161790556101c980549091169188169190911790558751611a27906101cd9060208b0190614446565b50612710836001600160801b03161115611a755760405162461bcd60e51b815260206004820152600f60248201526e65786365656473204d41585f42505360881b6044820152606401610a0a565b6101cc80546001600160801b03808616600160801b0291161790556101c780546001600160a01b038d166001600160a01b0319909116179055611ab960008c612a27565b611ae37f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68c612a27565b611b0d7f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c8c612a27565b611b387f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c6000612a27565b8015611b4a576000805461ff00191690555b5050505050505050505050565b6101cd8054610a9390614e53565b611b6d611ce5565b6001600160a01b0316856001600160a01b03161480611b935750611b93856108db611ce5565b611bf15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610a0a565b610e5b8585858585612a31565b611c06611ce5565b6001600160a01b0316836001600160a01b03161480611c2c5750611c2c836108db611ce5565b611c8b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f726044820152691030b8383937bb32b21760b11b6064820152608401610a0a565b610e8b838383612be6565b6001600160a01b03163b151590565b60006001600160e01b03198216636cdb3d1360e11b1480611cd657506001600160e01b031982166303a24d0760e21b145b80610a395750610a3982612d70565b60006112d7612d95565b600082815261012f602090815260408083206001600160a01b038516845290915290205460ff16610f2857611d2e816001600160a01b03166014612dc2565b611d39836020612dc2565b604051602001611d4a929190615113565b60408051601f198184030181529082905262461bcd60e51b8252610a0a916004016145a0565b8151835114611dd25760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610a0a565b6001600160a01b038416611e365760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610a0a565b6000611e40611ce5565b9050611e50818787878787612f6b565b60005b8451811015611f7e576000858281518110611e7057611e70614ee5565b602002602001015190506000858381518110611e8e57611e8e614ee5565b6020908102919091018101516000848152610193835260408082206001600160a01b038e168352909352919091205490915081811015611f235760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610a0a565b6000838152610193602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611f63908490614f16565b9250508190555050505080611f7790614efb565b9050611e53565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611fce929190615194565b60405180910390a4611fe48187878787876131c9565b505050505050565b611ff6828261336f565b600082815261016160205260409020610e8b9082613414565b6120198282613429565b600082815261016160205260409020610e8b90826134cc565b6001600160a01b0383166120945760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610a0a565b80518251146120f65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610a0a565b6000612100611ce5565b905061212081856000868660405180602001604052806000815250612f6b565b60005b835181101561222657600084828151811061214057612140614ee5565b60200260200101519050600084838151811061215e5761215e614ee5565b6020908102919091018101516000848152610193835260408082206001600160a01b038c1683529093529190912054909150818110156121ec5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610a0a565b6000928352610193602090815260408085206001600160a01b038b168652909152909220910390558061221e81614efb565b915050612123565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612277929190615194565b60405180910390a450505050565b60006112f583836134e1565b60008060006122a18686866117b3565b91509150816122f25760405162461bcd60e51b815260206004820152601160248201527f696e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610a0a565b42612305610140880161012089016151b9565b6001600160801b03161115801561233657504261232a610160880161014089016151b9565b6001600160801b031610155b6123825760405162461bcd60e51b815260206004820152600f60248201527f72657175657374206578706972656400000000000000000000000000000000006044820152606401610a0a565b600061239160208801886145cc565b6001600160a01b031614156123e85760405162461bcd60e51b815260206004820152601360248201527f726563697069656e7420756e646566696e6564000000000000000000000000006044820152606401610a0a565b60008660c001351161242c5760405162461bcd60e51b815260206004820152600d60248201526c7a65726f207175616e7469747960981b6044820152606401610a0a565b61016086013560009081526101ce60205260409020805460ff191660011790559150509392505050565b60008281526101cf60205260409020805461247090614e53565b151590506124ce57826124b25760405162461bcd60e51b815260206004820152600a60248201526932b6b83a3c903ab9349760b11b6044820152606401610a0a565b60008281526101cf602052604090206124cc9085856143c2565b505b6124e98583836040518060200160405280600081525061350b565b81856001600160a01b03167f04133ee4cb027e1c5fce5e3481289278a93bd16a65a3b65b428a6d239e706bfb6101cf6000868152602001908152602001600020846040516125389291906151d4565b60405180910390a35050505050565b60e08101356125535750565b600061256760c083013560e0840135614ea4565b6101cc549091506000906127109061258f90600160801b90046001600160801b031684614ea4565b6125999190614ec3565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6125c2610120850161010086016145cc565b6001600160a01b03161415612625578134146126205760405162461bcd60e51b815260206004820152601660248201527f6d7573742073656e6420746f74616c2070726963652e000000000000000000006044820152606401610a0a565b612673565b34156126735760405162461bcd60e51b815260206004820152601260248201527f6d73672076616c7565206e6f74207a65726f00000000000000000000000000006044820152606401610a0a565b60008061268660808601606087016145cc565b6001600160a01b0316146126a9576126a460808501606086016145cc565b6126b7565b6101c9546001600160a01b03165b90506126e96126ce610120860161010087016145cc565b6126d6611ce5565b6101ca546001600160a01b03168561361a565b6113176126fe610120860161010087016145cc565b612706611ce5565b836127118688615284565b61361a565b816001600160a01b0316836001600160a01b0316141561278a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610a0a565b6001600160a01b0383811660008181526101946020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60606001600160a01b0383163b6128605760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610a0a565b600080846001600160a01b03168460405161287b919061529b565b600060405180830381855af49150503d80600081146128b6576040519150601f19603f3d011682016040523d82523d6000602084013e6128bb565b606091505b50915091506128e382826040518060600160405280602781526020016154cb60279139613664565b95945050505050565b600061294883838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506129429250612936915088905061369d565b805190602001206137f3565b90613841565b949350505050565b6000610a39825490565b600054610100900460ff166129815760405162461bcd60e51b8152600401610a0a906152b7565b61298961385d565b565b600054610100900460ff166129b25760405162461bcd60e51b8152600401610a0a906152b7565b610f28828261388b565b600054610100900460ff166129e35760405162461bcd60e51b8152600401610a0a906152b7565b6129eb6138cc565b6129f4816138f3565b50565b600054610100900460ff16612a1e5760405162461bcd60e51b8152600401610a0a906152b7565b6129f481613982565b610f288282611fec565b6001600160a01b038416612a955760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610a0a565b6000612a9f611ce5565b9050612abf818787612ab0886139b2565b612ab9886139b2565b87612f6b565b6000848152610193602090815260408083206001600160a01b038a16845290915290205483811015612b465760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610a0a565b6000858152610193602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612b86908490614f16565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46117aa8288888888886139fd565b6001600160a01b038316612c485760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610a0a565b6000612c52611ce5565b9050612c8281856000612c64876139b2565b612c6d876139b2565b60405180602001604052806000815250612f6b565b6000838152610193602090815260408083206001600160a01b038816845290915290205482811015612d025760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610a0a565b6000848152610193602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b60006001600160e01b03198216635a05180f60e01b1480610a395750610a3982613af9565b3360009081526099602052604081205460ff1615612dba575060131936013560601c90565b503390565b90565b60606000612dd1836002614ea4565b612ddc906002614f16565b67ffffffffffffffff811115612df457612df4614609565b6040519080825280601f01601f191660200182016040528015612e1e576020820181803683370190505b509050600360fc1b81600081518110612e3957612e39614ee5565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612e6857612e68614ee5565b60200101906001600160f81b031916908160001a9053506000612e8c846002614ea4565b612e97906001614f16565b90505b6001811115612f1c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612ed857612ed8614ee5565b1a60f81b828281518110612eee57612eee614ee5565b60200101906001600160f81b031916908160001a90535060049490941c93612f1581615302565b9050612e9a565b5083156112f55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a0a565b600080527fdf45e191c6a8bff7d5b2484d5c1deccbd5b2abc06a2abf694394baf9d01cb5e56020527f2b85be2befc2dd713b2f771c3d841437400c04e85bacc15958c6dcadb2aa5c045460ff16158015612fcd57506001600160a01b03851615155b8015612fe157506001600160a01b03841615155b156130bb576001600160a01b03851660009081527fdf45e191c6a8bff7d5b2484d5c1deccbd5b2abc06a2abf694394baf9d01cb5e5602052604090205460ff168061306357506001600160a01b03841660009081527fdf45e191c6a8bff7d5b2484d5c1deccbd5b2abc06a2abf694394baf9d01cb5e5602052604090205460ff165b6130bb5760405162461bcd60e51b8152602060048201526024808201527f7265737472696374656420746f205452414e534645525f524f4c4520686f6c6460448201526332b9399760e11b6064820152608401610a0a565b6001600160a01b0385166131435760005b8351811015613141578281815181106130e7576130e7614ee5565b60200260200101516101d0600086848151811061310657613106614ee5565b60200260200101518152602001908152602001600020600082825461312b9190614f16565b9091555061313a905081614efb565b90506130cc565b505b6001600160a01b038416611fe45760005b83518110156117aa5782818151811061316f5761316f614ee5565b60200260200101516101d0600086848151811061318e5761318e614ee5565b6020026020010151815260200190815260200160002060008282546131b39190615284565b909155506131c2905081614efb565b9050613154565b6001600160a01b0384163b15611fe45760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061320d9089908990889088908890600401615319565b6020604051808303816000875af1925050508015613248575060408051601f3d908101601f1916820190925261324591810190615377565b60015b6132fe57613254615394565b806308c379a0141561328e57506132696153af565b806132745750613290565b8060405162461bcd60e51b8152600401610a0a91906145a0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610a0a565b6001600160e01b0319811663bc197c8160e01b146117aa5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610a0a565b600082815261012f602090815260408083206001600160a01b038516845290915290205460ff16610f2857600082815261012f602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133d0611ce5565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006112f5836001600160a01b038416613b2e565b600082815261012f602090815260408083206001600160a01b038516845290915290205460ff1615610f2857600082815261012f602090815260408083206001600160a01b03851684529091529020805460ff19169055613488611ce5565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60006112f5836001600160a01b038416613b7d565b60008260000182815481106134f8576134f8614ee5565b9060005260206000200154905092915050565b6001600160a01b03841661356b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610a0a565b6000613575611ce5565b905061358781600087612ab0886139b2565b6000848152610193602090815260408083206001600160a01b0389168452909152812080548592906135ba908490614f16565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610e5b816000878787876139fd565b8061362457611317565b6001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415613658576136538282613c70565b611317565b61131784848484613d13565b606083156136735750816112f5565b8251156136835782518084602001fd5b8160405162461bcd60e51b8152600401610a0a91906145a0565b60607fc7a95ef88f83fa833ccfce325157b7111633b181b6a27181b86415d8d501134d6136cd60208401846145cc565b6136dd60408501602086016145cc565b60408501356136f260808701606088016145cc565b608087013561370460a0890189614f2e565b604051613712929190615439565b60405190819003902060c089013560e08a01356137376101208c016101008d016145cc565b6137496101408d016101208e016151b9565b61375b6101608e016101408f016151b9565b60408051602081019d909d526001600160a01b039b8c16908d0152988a1660608c015260808b019790975294881660a08a015260c089019390935260e08801919091526101008701526101208601529092166101408401526001600160801b039182166101608085019190915291166101808301528301356101a08201526101c0016040516020818303038152906040529050919050565b6000610a39613800613d6c565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006138508585613de7565b915091506110be81613e57565b600054610100900460ff166138845760405162461bcd60e51b8152600401610a0a906152b7565b6001603555565b600054610100900460ff166138b25760405162461bcd60e51b8152600401610a0a906152b7565b815160209283012081519190920120600191909155600255565b600054610100900460ff166129895760405162461bcd60e51b8152600401610a0a906152b7565b600054610100900460ff1661391a5760405162461bcd60e51b8152600401610a0a906152b7565b60005b8151811015610f285760016099600084848151811061393e5761393e614ee5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061397a81614efb565b91505061391d565b600054610100900460ff166139a95760405162461bcd60e51b8152600401610a0a906152b7565b6129f481614012565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106139ec576139ec614ee5565b602090810291909101015292915050565b6001600160a01b0384163b15611fe45760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613a419089908990889088908890600401615449565b6020604051808303816000875af1925050508015613a7c575060408051601f3d908101601f19168201909252613a7991810190615377565b60015b613a8857613254615394565b6001600160e01b0319811663f23a6e6160e01b146117aa5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610a0a565b60006001600160e01b03198216637965db0b60e01b1480610a3957506301ffc9a760e01b6001600160e01b0319831614610a39565b6000818152600183016020526040812054613b7557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a39565b506000610a39565b60008181526001830160205260408120548015613c66576000613ba1600183615284565b8554909150600090613bb590600190615284565b9050818114613c1a576000866000018281548110613bd557613bd5614ee5565b9060005260206000200154905080876000018481548110613bf857613bf8614ee5565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613c2b57613c2b615481565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a39565b6000915050610a39565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613cbd576040519150601f19603f3d011682016040523d82523d6000602084013e613cc2565b606091505b5050905080610e8b5760405162461bcd60e51b815260206004820152601c60248201527f6e617469766520746f6b656e207472616e73666572206661696c6564000000006044820152606401610a0a565b816001600160a01b0316836001600160a01b03161415613d3257611317565b6001600160a01b038316301415613d57576136536001600160a01b0385168383614026565b6113176001600160a01b03851684848461409e565b60006112d77f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613d9b60015490565b6002546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b600080825160411415613e1e5760208301516040840151606085015160001a613e12878285856140d6565b94509450505050613e50565b825160401415613e485760208301516040840151613e3d8683836141c3565b935093505050613e50565b506000905060025b9250929050565b6000816004811115613e6b57613e6b615497565b1415613e745750565b6001816004811115613e8857613e88615497565b1415613ed65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a0a565b6002816004811115613eea57613eea615497565b1415613f385760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a0a565b6003816004811115613f4c57613f4c615497565b1415613fa55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a0a565b6004816004811115613fb957613fb9615497565b14156129f45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a0a565b8051610f2890610195906020840190614446565b6040516001600160a01b038316602482015260448101829052610e8b90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152614215565b6040516001600160a01b03808516602483015283166044820152606481018290526113179085906323b872dd60e01b90608401614052565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561410d57506000905060036141ba565b8460ff16601b1415801561412557508460ff16601c14155b1561413657506000905060046141ba565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561418a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166141b3576000600192509250506141ba565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316816141f960ff86901c601b614f16565b9050614207878288856140d6565b935093505050935093915050565b600061426a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166142e79092919063ffffffff16565b805190915015610e8b578080602001905181019061428891906154ad565b610e8b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a0a565b60606129488484600085856001600160a01b0385163b6143495760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a0a565b600080866001600160a01b03168587604051614365919061529b565b60006040518083038185875af1925050503d80600081146143a2576040519150601f19603f3d011682016040523d82523d6000602084013e6143a7565b606091505b50915091506143b7828286613664565b979650505050505050565b8280546143ce90614e53565b90600052602060002090601f0160209004810192826143f05760008555614436565b82601f106144095782800160ff19823516178555614436565b82800160010185558215614436579182015b8281111561443657823582559160200191906001019061441b565b506144429291506144ba565b5090565b82805461445290614e53565b90600052602060002090601f0160209004810192826144745760008555614436565b82601f1061448d57805160ff1916838001178555614436565b82800160010185558215614436579182015b8281111561443657825182559160200191906001019061449f565b5b8082111561444257600081556001016144bb565b80356001600160a01b03811681146144e657600080fd5b919050565b600080604083850312156144fe57600080fd5b614507836144cf565b946020939093013593505050565b6001600160e01b0319811681146129f457600080fd5b60006020828403121561453d57600080fd5b81356112f581614515565b60005b8381101561456357818101518382015260200161454b565b838111156113175750506000910152565b6000815180845261458c816020860160208601614548565b601f01601f19169290920160200192915050565b6020815260006112f56020830184614574565b6000602082840312156145c557600080fd5b5035919050565b6000602082840312156145de57600080fd5b6112f5826144cf565b600080604083850312156145fa57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff8111828210171561464557614645614609565b6040525050565b600067ffffffffffffffff82111561466657614666614609565b5060051b60200190565b600082601f83011261468157600080fd5b8135602061468e8261464c565b60405161469b828261461f565b83815260059390931b85018201928281019150868411156146bb57600080fd5b8286015b848110156146d657803583529183019183016146bf565b509695505050505050565b600082601f8301126146f257600080fd5b813567ffffffffffffffff81111561470c5761470c614609565b604051614723601f8301601f19166020018261461f565b81815284602083860101111561473857600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561476d57600080fd5b614776866144cf565b9450614784602087016144cf565b9350604086013567ffffffffffffffff808211156147a157600080fd5b6147ad89838a01614670565b945060608801359150808211156147c357600080fd5b6147cf89838a01614670565b935060808801359150808211156147e557600080fd5b506147f2888289016146e1565b9150509295509295909350565b6000806040838503121561481257600080fd5b82359150614822602084016144cf565b90509250929050565b600082601f83011261483c57600080fd5b813560206148498261464c565b604051614856828261461f565b83815260059390931b850182019282810191508684111561487657600080fd5b8286015b848110156146d65761488b816144cf565b835291830191830161487a565b600080604083850312156148ab57600080fd5b823567ffffffffffffffff808211156148c357600080fd5b6148cf8683870161482b565b935060208501359150808211156148e557600080fd5b506148f285828601614670565b9150509250929050565b600081518084526020808501945080840160005b8381101561492c57815187529582019590820190600101614910565b509495945050505050565b6020815260006112f560208301846148fc565b60008060006060848603121561495f57600080fd5b614968846144cf565b9250602084013567ffffffffffffffff8082111561498557600080fd5b61499187838801614670565b935060408601359150808211156149a757600080fd5b506149b486828701614670565b9150509250925092565b60008083601f8401126149d057600080fd5b50813567ffffffffffffffff8111156149e857600080fd5b602083019150836020828501011115613e5057600080fd5b60008060208385031215614a1357600080fd5b823567ffffffffffffffff811115614a2a57600080fd5b614a36858286016149be565b90969095509350505050565b600080600060408486031215614a5757600080fd5b833567ffffffffffffffff80821115614a6f57600080fd5b908501906101808288031215614a8457600080fd5b90935060208501359080821115614a9a57600080fd5b50614aa7868287016149be565b9497909650939450505050565b600080600060608486031215614ac957600080fd5b83359250614ad9602085016144cf565b9150604084013590509250925092565b80151581146129f457600080fd5b60008060408385031215614b0a57600080fd5b614b13836144cf565b91506020830135614b2381614ae9565b809150509250929050565b60008060208385031215614b4157600080fd5b823567ffffffffffffffff80821115614b5957600080fd5b818501915085601f830112614b6d57600080fd5b813581811115614b7c57600080fd5b8660208260051b8501011115614b9157600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614bf857603f19888603018452614be6858351614574565b94509285019290850190600101614bca565b5092979650505050505050565b600080600080600060808688031215614c1d57600080fd5b614c26866144cf565b945060208601359350604086013567ffffffffffffffff811115614c4957600080fd5b614c55888289016149be565b96999598509660600135949350505050565b80356001600160801b03811681146144e657600080fd5b6000806000806000806000806000806101408b8d031215614c9e57600080fd5b614ca78b6144cf565b995060208b013567ffffffffffffffff80821115614cc457600080fd5b614cd08e838f016146e1565b9a5060408d0135915080821115614ce657600080fd5b614cf28e838f016146e1565b995060608d0135915080821115614d0857600080fd5b614d148e838f016146e1565b985060808d0135915080821115614d2a57600080fd5b50614d378d828e0161482b565b965050614d4660a08c016144cf565b9450614d5460c08c016144cf565b9350614d6260e08c01614c67565b9250614d716101008c01614c67565b9150614d806101208c016144cf565b90509295989b9194979a5092959850565b60008060408385031215614da457600080fd5b614dad836144cf565b9150614822602084016144cf565b600080600080600060a08688031215614dd357600080fd5b614ddc866144cf565b9450614dea602087016144cf565b93506040860135925060608601359150608086013567ffffffffffffffff811115614e1457600080fd5b6147f2888289016146e1565b600080600060608486031215614e3557600080fd5b614e3e846144cf565b95602085013595506040909401359392505050565b600181811c90821680614e6757607f821691505b60208210811415614e8857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615614ebe57614ebe614e8e565b500290565b600082614ee057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000600019821415614f0f57614f0f614e8e565b5060010190565b60008219821115614f2957614f29614e8e565b500190565b6000808335601e19843603018112614f4557600080fd5b83018035915067ffffffffffffffff821115614f6057600080fd5b602001915036819003821315613e5057600080fd5b6000808335601e19843603018112614f8c57600080fd5b830160208101925035905067ffffffffffffffff811115614fac57600080fd5b803603831315613e5057600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815261500560208201614ff8846144cf565b6001600160a01b03169052565b6000615013602084016144cf565b6001600160a01b03811660408401525060408301356060830152615039606084016144cf565b6001600160a01b038116608084015250608083013560a083015261506060a0840184614f75565b6101808060c08601526150786101a086018385614fbb565b925060c086013560e0860152610100915060e08601358286015261509d8287016144cf565b91506101206150b6818701846001600160a01b03169052565b6150c1818801614c67565b9250506101406150db818701846001600160801b03169052565b6150e6818801614c67565b925050610160615100818701846001600160801b03169052565b9590950135939094019290925250919050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161514b816017850160208801614548565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351615188816028840160208801614548565b01602801949350505050565b6040815260006151a760408301856148fc565b82810360208401526128e381856148fc565b6000602082840312156151cb57600080fd5b6112f582614c67565b60408152600080845481600182811c9150808316806151f457607f831692505b602080841082141561521457634e487b7160e01b86526022600452602486fd5b604088018490526060880182801561523357600181146152445761526f565b60ff1987168252828201975061526f565b60008c81526020902060005b8781101561526957815484820152908601908401615250565b83019850505b50509690960196909652509095945050505050565b60008282101561529657615296614e8e565b500390565b600082516152ad818460208701614548565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008161531157615311614e8e565b506000190190565b60006001600160a01b03808816835280871660208401525060a0604083015261534560a08301866148fc565b828103606084015261535781866148fc565b9050828103608084015261536b8185614574565b98975050505050505050565b60006020828403121561538957600080fd5b81516112f581614515565b600060033d1115612dbf5760046000803e5060005160e01c90565b600060443d10156153bd5790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156153ed57505050505090565b82850191508151818111156154055750505050505090565b843d870101602082850101111561541f5750505050505090565b61542e6020828601018761461f565b509095945050505050565b8183823760009101908152919050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526143b760a0830184614574565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6000602082840312156154bf57600080fd5b81516112f581614ae956fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212209f19d50c30c6eca7b6a46105b0642a4c9fc325af759bbe11e4f5f9f0a65805de64736f6c634300080c0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.