Feature Tip: Add private address tag to any address under My Name Tag !
ERC-1155
Overview
Max Total Supply
0 CASSETTE
Holders
311
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Cassette
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import { IONFT1155 } from "@layerzerolabs/solidity-examples/contracts/token/onft/IONFT1155.sol"; import { IONFT1155Core } from "@layerzerolabs/solidity-examples/contracts/token/onft/IONFT1155Core.sol"; import { ONFT1155Core } from "@layerzerolabs/solidity-examples/contracts/token/onft/ONFT1155Core.sol"; import { ERC1155 } from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import { ICassette } from "./interfaces/ICassette.sol"; error Cassette_ExceedsMaxPage(); error Cassette_FunctionLocked(); error Cassette_IncorrectValue(); error Cassette_InvalidConfiguration(); error Cassette_InvalidSendData(); error Cassette_MintClosed(); error Cassette_NotAllowed(); error Cassette_ValueOutOfRange(); error Cassette_WithdrawFailed(); /** . :++- *##- +####* -##+ *####- :%######%. -%###* *######: =##########= .######* *#######*-#############*-*#######* *################################* *################################* *################################* *################################* *################################* :*******************************+. .:. *###%*=: .##########+-. +###############=: %##################%+ =###################### -######################++++++++++++++++++=-: =###########################################*: =#############################################. +####%#*+=-:. -#############################################: %############################################################= %############################################################## %##############################################################%=----::. %#######################################################################%: %##########################################+: :+%#######################: *########################################* *####################### -%###################################### %###################### -%###################################% ####################### =###################################- :####################### ....+##################################*. .+######################## +###########################################%*++*%########################## %#########################################################################*. %#######################################################################+ ########################################################################- *#######################################################################- .######################################################################%. :+#################################################################- :=#####################################################:..... :--:.:##############################################+ :: +###############################################%- ####%+-. %##################################################. %#######%*-. :###################################################% %###########%*=*####################################################= %#################################################################### %####################################################################+ %#####################################################################. %#####################################################################% %######################################################################- .+*********************************************************************. * @title KAIJU ORIGINS: The Journals of Stod - Cassette * @notice See https://origins.kaijukingz.io/ for more details. * @author Augminted Labs, LLC */ contract Cassette is ONFT1155Core, ERC1155, IONFT1155, ICassette { uint16 public constant FUNCTION_TYPE_BURN = uint16(uint256(keccak256("BURN"))); uint256 public immutable MAX_PAGE; uint256 public immutable TOTAL_CHAINS; uint256 public immutable TOKEN_OFFSET; address public replicator; uint256 public currentMaxPage; uint256 public price; uint256 public totalMinted; bool public mintEnabled; mapping(bytes4 => bool) public functionLocked; constructor( string memory _uri, address _endpoint, uint256 _maxPage, uint256 _totalChains, uint256 _tokenOffset, uint256 _price ) ERC1155(_uri) ONFT1155Core(_endpoint) { if (_tokenOffset >= _totalChains) revert Cassette_InvalidConfiguration(); MAX_PAGE = _maxPage; TOTAL_CHAINS = _totalChains; TOKEN_OFFSET = _tokenOffset; price = _price; } /** * @notice Modifier applied to functions that will be disabled when they're no longer needed */ modifier lockable() { if (functionLocked[msg.sig]) revert Cassette_FunctionLocked(); _; } /** * @inheritdoc ERC1155 */ function supportsInterface( bytes4 interfaceId ) public view override(ONFT1155Core, ERC1155, IERC165) returns (bool) { return interfaceId == type(IONFT1155).interfaceId || super.supportsInterface(interfaceId); } /** * @notice Emulates ERC721 "name" function * @return string Contract name */ function name() public pure returns (string memory) { return "KAIJU ORIGINS: The Journals of Stod - Cassette"; } /** * @notice Emulates ERC721 "symbol" function * @return string Token symbol */ function symbol() public pure returns (string memory) { return "CASSETTE"; } /** * @notice Calculate page number of a specified token ID * @param _tokenId Token ID to return the page number of * @return uint256 A token's corresponding page number */ function page(uint256 _tokenId) public view returns (uint256) { if (_tokenId > MAX_PAGE * TOTAL_CHAINS) revert Cassette_ValueOutOfRange(); return _tokenId == 0 ? 0 : (_tokenId + TOTAL_CHAINS - 1) / TOTAL_CHAINS; } /** * @notice Calculate token ID of a specified page * @dev This will vary depending on which chain this contract is deployed to * @param _page Page to return the token ID of * @return uint256 A page's corresponding token ID */ function tokenId(uint256 _page) public view returns (uint256) { if (_page > MAX_PAGE) revert Cassette_ValueOutOfRange(); return _page == 0 ? 0 : ((_page - 1) * TOTAL_CHAINS) + TOKEN_OFFSET + 1; } /** * @notice Return an array of token balances for a specified address * @param _account Address to return the token balances of * @return uint256[] Balances for every valid token ID */ function balancesOf(address _account) public view returns (uint256[] memory) { uint256[] memory balances = new uint256[](TOTAL_CHAINS * MAX_PAGE + 1); for (uint256 i; i < balances.length;) { balances[i] = balanceOf(_account, i); unchecked { ++i; } } return balances; } /** * @notice Set the address of the replicator contract * @param _replicator Address of the replicator contract */ function setReplicator(address _replicator) public payable lockable onlyOwner { replicator = _replicator; } /** * @notice Set the price of a single cassette * @param _price Price of a single cassette */ function setPrice(uint256 _price) public payable lockable onlyOwner { price = _price; } /** * @notice Set the metadata URI for the contract * @param _uri Metadata URI for the contract */ function setURI(string calldata _uri) public payable lockable onlyOwner { _setURI(_uri); } /** * @notice Set the current maximum page * @param _currentMaxPage Current maximum page */ function setCurrentMaxPage(uint256 _currentMaxPage) public payable lockable onlyOwner { if (_currentMaxPage > MAX_PAGE) revert Cassette_ExceedsMaxPage(); currentMaxPage = _currentMaxPage; } /** * @notice Set the current state of cassette minting * @param _mintEnabled Current mint state */ function setMintEnabled(bool _mintEnabled) public payable lockable onlyOwner { mintEnabled = _mintEnabled; } /** * @notice Airdrop a specified amount of blank cassettes to a specified list of receivers * @param _receivers List of receivers of the airdrop * @param _amounts List of amounts to airdrop */ function airdrop(address[] calldata _receivers, uint256[] calldata _amounts) public payable lockable onlyOwner { if (_receivers.length != _amounts.length) revert Cassette_ValueOutOfRange(); for (uint i; i < _receivers.length;) { _mint(_receivers[i], 0, _amounts[i]); unchecked { ++i; } } } /** * @notice Send all ETH transferred to the contract to a specified receiver * @param _receiver Address to receive all the ETH in the contract */ function withdraw(address _receiver) public payable onlyOwner { (bool success, ) = _receiver.call{value: address(this).balance}(""); if (!success) revert Cassette_WithdrawFailed(); } /** * @notice Mint a specified number of a specific page using a replicator * @param _to Address receiving the pages * @param _page Page to mint * @param _amount Amount of pages to mint */ function replicatorMint(address _to, uint256 _page, uint256 _amount) public payable { if (msg.sender != replicator) revert Cassette_NotAllowed(); _mint(_to, _page, _amount); } /** * @notice Mint a specified number of blank cassettes * @param _amount Amount of blank cassettes to mint */ function mint(uint256 _amount) public payable { if (!mintEnabled) revert Cassette_MintClosed(); if (_amount * price != msg.value) revert Cassette_IncorrectValue(); _mint(msg.sender, 0, _amount); } /** * @notice Internal function for minting cassettes * @param _to Address receiving the cassettes * @param _page Page to mint * @param _amount Amount of cassettes to mint */ function _mint(address _to, uint256 _page, uint256 _amount) internal { if (_page > MAX_PAGE) revert Cassette_ExceedsMaxPage(); _mint(_to, tokenId(_page), _amount, ""); unchecked { totalMinted += _amount; } } /** * @notice Burn a token to receive the next page in the series * @param _tokenId Token to burn * @param _amount Amount of tokens to burn */ function burn(uint256 _tokenId, uint256 _amount) public payable { uint256 _page = page(_tokenId); if (_page + 1 > currentMaxPage) revert Cassette_ExceedsMaxPage(); _burn(msg.sender, _tokenId, _amount); _mint(msg.sender, _page + 1, _amount); } /** * @notice Burn a batch of tokens to receive the next page in the series * @param _tokenIds Tokens to burn * @param _amounts Amounts of tokens to burn */ function burnBatch( uint256[] memory _tokenIds, uint256[] memory _amounts ) public payable { for (uint256 i; i < _tokenIds.length;) { uint256 _page = page(_tokenIds[i]); if (_page + 1 > currentMaxPage) revert Cassette_ExceedsMaxPage(); _burn(msg.sender, _tokenIds[i], _amounts[i]); _mint(msg.sender, _page + 1, _amounts[i]); unchecked { ++i; } } } /** * @notice Burn a token on the current chain to receive the next page in the series on a destination chain * @dev For more details see https://layerzero.gitbook.io/docs/evm-guides/master * @param _from Address to burn a token from * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the next page in the series * @param _tokenId Token to burn * @param _amount Amount of tokens to burn * @param _refundAddress Address to send refund to if transaction is cheaper than expected * @param _zroPaymentAddress Address of $ZRO token holder that will pay for the transaction * @param _adapterParams Parameters for custom functionality */ function burnFrom( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, uint256 _amount, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) public payable { if (page(_tokenId) + 1 > currentMaxPage) revert Cassette_ExceedsMaxPage(); _sendBatch( FUNCTION_TYPE_BURN, _from, _dstChainId, _toAddress, _toSingletonArray(_tokenId), _toSingletonArray(_amount), _refundAddress, _zroPaymentAddress, _adapterParams ); } /** * @notice Burn a batch of tokens on the current chain to receive the next pages in the series on a destination chain * @dev For more details see https://layerzero.gitbook.io/docs/evm-guides/master * @param _from Address to burn tokens from * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the next pages in the series * @param _tokenIds Tokens to burn * @param _amounts Amounts of tokens to burn * @param _refundAddress Address to send refund to if transaction is cheaper than expected * @param _zroPaymentAddress Address of $ZRO token holder that will pay for the transaction * @param _adapterParams Parameters for custom functionality */ function burnBatchFrom( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) public payable { for (uint256 i; i < _tokenIds.length;) { if (page(_tokenIds[i]) + 1 > currentMaxPage) revert Cassette_ExceedsMaxPage(); unchecked { ++i; } } _sendBatch( FUNCTION_TYPE_BURN, _from, _dstChainId, _toAddress, _tokenIds, _amounts, _refundAddress, _zroPaymentAddress, _adapterParams ); } /** * @notice Estimate the cost of sending a token to a destination chain * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the token * @param _tokenId Token to send * @param _amount Amount of tokens to send * @param _useZro Flag indicating whether to use $ZRO for payment * @param _adapterParams Parameters for custom functionality */ function estimateSendFee( uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, uint256 _amount, bool _useZro, bytes memory _adapterParams ) public view override(ONFT1155Core, IONFT1155Core) returns (uint256 nativeFee, uint256 zroFee) { return estimateBatchFee( FUNCTION_TYPE_SEND, _dstChainId, _toAddress, _toSingletonArray(_tokenId), _toSingletonArray(_amount), _useZro, _adapterParams ); } /* * @notice Estimate the cost of sending a batch of tokens to a destination chain * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the tokens * @param _tokenId Tokens to send * @param _amount Amounts of tokens to send * @param _useZro Flag indicating whether to use $ZRO for payment * @param _adapterParams Parameters for custom functionality */ function estimateSendBatchFee( uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, bool _useZro, bytes memory _adapterParams ) public view override(ONFT1155Core, IONFT1155Core) returns (uint256 nativeFee, uint256 zroFee) { return estimateBatchFee( FUNCTION_TYPE_SEND_BATCH, _dstChainId, _toAddress, _tokenIds, _amounts, _useZro, _adapterParams ); } /* * @notice Estimate the cost of performing a specified cross-chain function on a token * @param _functionType Cross-chain function to perform * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the tokens * @param _tokenId Tokens to send * @param _amount Amounts of tokens to send * @param _useZro Flag indicating whether to use $ZRO for payment * @param _adapterParams Parameters for custom functionality */ function estimateFee( uint16 _functionType, uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, uint256 _amount, bool _useZro, bytes memory _adapterParams ) public view returns (uint256 nativeFee, uint256 zroFee) { return estimateBatchFee( _functionType, _dstChainId, _toAddress, _toSingletonArray(_tokenId), _toSingletonArray(_amount), _useZro, _adapterParams ); } /* * @notice Estimate the cost of performing a specified cross-chain function on a batch of tokens * @param _functionType Cross-chain function to perform * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the tokens * @param _tokenIds Tokens to burn * @param _amounts Amounts of tokens to burn * @param _useZro Flag indicating whether to use $ZRO for payment * @param _adapterParams Parameters for custom functionality */ function estimateBatchFee( uint16 _functionType, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, bool _useZro, bytes memory _adapterParams ) public view returns (uint256 nativeFee, uint256 zroFee) { bytes memory payload = abi.encode(_functionType, _toAddress, _tokenIds, _amounts); return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams); } /** * @notice Override `ONFT1155Core` function to debit a batch of tokens from the current chain * @dev For more details see https://layerzero.gitbook.io/docs/evm-guides/master * @param _from Address to debit tokens from * @param _tokenIds Tokens to debit * @param _amounts Amounts of tokens to debit */ function _debitFrom( address _from, uint16, // _dstChainId bytes memory, // _toAddress uint256[] memory _tokenIds, uint256[] memory _amounts ) internal override { if (msg.sender != _from && !isApprovedForAll(_from, msg.sender)) revert Cassette_NotAllowed(); _burnBatch(_from, _tokenIds, _amounts); } /** * @notice Override `ONFT1155Core` function to credit a batch of tokens on the current chain * @dev For more details see https://layerzero.gitbook.io/docs/evm-guides/master * @param _toAddress Address to credit tokens to * @param _tokenIds Tokens to credit * @param _amounts Amounts of tokens to credit */ function _creditTo( uint16, // _srcChainId address _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts ) internal override { _mintBatch(_toAddress, _tokenIds, _amounts, ""); } /** * @notice Override `ONFT1155Core` function to send a batch of tokens from the current chain to a destination chain * @dev For more details see https://layerzero.gitbook.io/docs/evm-guides/master * @param _from Address to send tokens from * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the tokens * @param _tokenIds Tokens to send * @param _amounts Amounts of tokens to send * @param _refundAddress Address to send refund to if transaction is cheaper than expected * @param _zroPaymentAddress Address of $ZRO token holder that will pay for the transaction * @param _adapterParams Parameters for custom functionality */ function _sendBatch( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) internal override { _sendBatch( _tokenIds.length == 1 ? FUNCTION_TYPE_SEND : FUNCTION_TYPE_SEND_BATCH, _from, _dstChainId, _toAddress, _tokenIds, _amounts, _refundAddress, _zroPaymentAddress, _adapterParams ); } /** * @notice Send a batch of tokens from the current chain to a destination chain with a specified operation * @dev For more details see https://layerzero.gitbook.io/docs/evm-guides/master * @param _functionType Function to perform on the destination chain * @param _from Address to send tokens from * @param _dstChainId Destination chain's LayerZero ID * @param _toAddress Address to receive the tokens * @param _tokenIds Tokens to send * @param _amounts Amounts of tokens to send * @param _refundAddress Address to send refund to if transaction is cheaper than expected * @param _zroPaymentAddress Address of $ZRO token holder that will pay for the transaction * @param _adapterParams Parameters for custom functionality */ function _sendBatch( uint16 _functionType, address _from, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) internal { if (_tokenIds.length == 0 || _tokenIds.length != _amounts.length) revert Cassette_InvalidSendData(); if (_functionType == FUNCTION_TYPE_SEND || _functionType == FUNCTION_TYPE_SEND_BATCH) { for (uint256 i; i < _tokenIds.length;) { if (_tokenIds[i] != 0) revert Cassette_InvalidSendData(); unchecked { ++i; } } } _debitFrom(_from, _dstChainId, _toAddress, _tokenIds, _amounts); bytes memory payload = abi.encode(_functionType, _toAddress, _tokenIds, _amounts); _checkGasLimit(_dstChainId, _functionType, _adapterParams, NO_EXTRA_GAS); _lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value); if (_tokenIds.length == 1) { emit SendToChain(_dstChainId, _from, _toAddress, _tokenIds[0], _amounts[0]); } else if (_tokenIds.length > 1) { emit SendBatchToChain(_dstChainId, _from, _toAddress, _tokenIds, _amounts); } } /** * @notice Override `ONFT1155Core` function that processes a payload from a source chain * @dev For more details see https://layerzero.gitbook.io/docs/evm-guides/master * @param _srcChainId Source chain's LayerZero ID * @param _srcAddress Address that sent the payload from the source chain * @param _payload Payload to process */ function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64, // _nonce bytes memory _payload ) internal override { ( uint16 functionType, bytes memory toAddressBytes, uint256[] memory tokenIds, uint256[] memory amounts ) = abi.decode(_payload, (uint16, bytes, uint256[], uint256[])); address toAddress; assembly { toAddress := mload(add(toAddressBytes, 20)) } uint256[] memory _tokenIds = functionType == FUNCTION_TYPE_BURN ? _bumpTokenIds(tokenIds) : tokenIds; _creditTo(_srcChainId, toAddress, _tokenIds, amounts); if (tokenIds.length == 1) { emit ReceiveFromChain(_srcChainId, _srcAddress, toAddress, _tokenIds[0], amounts[0]); } else if (tokenIds.length > 1) { emit ReceiveBatchFromChain(_srcChainId, _srcAddress, toAddress, _tokenIds, amounts); } } /** * @notice Bump token IDs to those corresponding to the next page in the series * @param _tokenIds Tokens to bump to the next page * @return uint256[] Tokens corresponding to the next page in the series */ function _bumpTokenIds(uint256[] memory _tokenIds) internal view returns (uint256[] memory) { for (uint256 i; i < _tokenIds.length;) { unchecked { _tokenIds[i] = tokenId(page(_tokenIds[i]) + 1); ++i; } } return _tokenIds; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "./ILayerZeroUserApplicationConfig.sol"; interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig { // @notice send a LayerZero message to the specified address at a LayerZero endpoint. // @param _dstChainId - the destination chain identifier // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains // @param _payload - a custom bytes payload to send to the destination contract // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable; // @notice used by the messaging library to publish verified payload // @param _srcChainId - the source chain identifier // @param _srcAddress - the source contract (as bytes) at the source chain // @param _dstAddress - the address on destination chain // @param _nonce - the unbound message ordering nonce // @param _gasLimit - the gas limit for external contract execution // @param _payload - verified payload to send to the destination contract function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external; // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64); // @notice get the outboundNonce from this source chain which, consequently, is always an EVM // @param _srcAddress - the source chain contract address function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64); // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery // @param _dstChainId - the destination chain identifier // @param _userApplication - the user app address on this EVM chain // @param _payload - the custom message to send over LayerZero // @param _payInZRO - if false, user app pays the protocol fee in native token // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee); // @notice get this Endpoint's immutable source identifier function getChainId() external view returns (uint16); // @notice the interface to retry failed message on this Endpoint destination // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address // @param _payload - the payload to be retried function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external; // @notice query if any STORED payload (message blocking) at the endpoint. // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool); // @notice query if the _libraryAddress is valid for sending msgs. // @param _userApplication - the user app address on this EVM chain function getSendLibraryAddress(address _userApplication) external view returns (address); // @notice query if the _libraryAddress is valid for receiving msgs. // @param _userApplication - the user app address on this EVM chain function getReceiveLibraryAddress(address _userApplication) external view returns (address); // @notice query if the non-reentrancy guard for send() is on // @return true if the guard is on. false otherwise function isSendingPayload() external view returns (bool); // @notice query if the non-reentrancy guard for receive() is on // @return true if the guard is on. false otherwise function isReceivingPayload() external view returns (bool); // @notice get the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _userApplication - the contract address of the user application // @param _configType - type of configuration. every messaging library has its own convention. function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory); // @notice get the send() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getSendVersion(address _userApplication) external view returns (uint16); // @notice get the lzReceive() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getReceiveVersion(address _userApplication) external view returns (uint16); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ILayerZeroReceiver { // @notice LayerZero endpoint will invoke this function to deliver the message on the destination // @param _srcChainId - the source endpoint identifier // @param _srcAddress - the source sending contract address from the source chain // @param _nonce - the ordered message nonce // @param _payload - the signed payload is the UA bytes has encoded to be sent function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ILayerZeroUserApplicationConfig { // @notice set the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _configType - type of configuration. every messaging library has its own convention. // @param _config - configuration in the bytes. can encode arbitrary content. function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external; // @notice set the send() LayerZero messaging library version to _version // @param _version - new messaging library version function setSendVersion(uint16 _version) external; // @notice set the lzReceive() LayerZero messaging library version to _version // @param _version - new messaging library version function setReceiveVersion(uint16 _version) external; // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload // @param _srcChainId - the chainId of the source chain // @param _srcAddress - the contract address of the source contract at the source chain function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/ILayerZeroReceiver.sol"; import "../interfaces/ILayerZeroUserApplicationConfig.sol"; import "../interfaces/ILayerZeroEndpoint.sol"; import "../util/BytesLib.sol"; /* * a generic LzReceiver implementation */ abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig { using BytesLib for bytes; // ua can not send payload larger than this by default, but it can be changed by the ua owner uint constant public DEFAULT_PAYLOAD_SIZE_LIMIT = 10000; ILayerZeroEndpoint public immutable lzEndpoint; mapping(uint16 => bytes) public trustedRemoteLookup; mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup; mapping(uint16 => uint) public payloadSizeLimitLookup; address public precrime; event SetPrecrime(address precrime); event SetTrustedRemote(uint16 _remoteChainId, bytes _path); event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress); event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas); constructor(address _endpoint) { lzEndpoint = ILayerZeroEndpoint(_endpoint); } function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual override { // lzReceive must be called by the endpoint for security require(_msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller"); bytes memory trustedRemote = trustedRemoteLookup[_srcChainId]; // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote. require(_srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote), "LzApp: invalid source sending contract"); _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual; function _lzSend(uint16 _dstChainId, bytes memory _payload, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams, uint _nativeFee) internal virtual { bytes memory trustedRemote = trustedRemoteLookup[_dstChainId]; require(trustedRemote.length != 0, "LzApp: destination chain is not a trusted source"); _checkPayloadSize(_dstChainId, _payload.length); lzEndpoint.send{value: _nativeFee}(_dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams); } function _checkGasLimit(uint16 _dstChainId, uint16 _type, bytes memory _adapterParams, uint _extraGas) internal view virtual { uint providedGasLimit = _getGasLimit(_adapterParams); uint minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas; require(minGasLimit > 0, "LzApp: minGasLimit not set"); require(providedGasLimit >= minGasLimit, "LzApp: gas limit is too low"); } function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) { require(_adapterParams.length >= 34, "LzApp: invalid adapterParams"); assembly { gasLimit := mload(add(_adapterParams, 34)) } } function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual { uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId]; if (payloadSizeLimit == 0) { // use default if not set payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT; } require(_payloadSize <= payloadSizeLimit, "LzApp: payload size is too large"); } //---------------------------UserApplication config---------------------------------------- function getConfig(uint16 _version, uint16 _chainId, address, uint _configType) external view returns (bytes memory) { return lzEndpoint.getConfig(_version, _chainId, address(this), _configType); } // generic config for LayerZero user Application function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override onlyOwner { lzEndpoint.setConfig(_version, _chainId, _configType, _config); } function setSendVersion(uint16 _version) external override onlyOwner { lzEndpoint.setSendVersion(_version); } function setReceiveVersion(uint16 _version) external override onlyOwner { lzEndpoint.setReceiveVersion(_version); } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner { lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress); } // _path = abi.encodePacked(remoteAddress, localAddress) // this function set the trusted path for the cross-chain communication function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external onlyOwner { trustedRemoteLookup[_srcChainId] = _path; emit SetTrustedRemote(_srcChainId, _path); } function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner { trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this)); emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress); } function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) { bytes memory path = trustedRemoteLookup[_remoteChainId]; require(path.length != 0, "LzApp: no trusted path record"); return path.slice(0, path.length - 20); // the last 20 bytes should be address(this) } function setPrecrime(address _precrime) external onlyOwner { precrime = _precrime; emit SetPrecrime(_precrime); } function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner { require(_minGas > 0, "LzApp: invalid minGas"); minDstGasLookup[_dstChainId][_packetType] = _minGas; emit SetMinDstGas(_dstChainId, _packetType, _minGas); } // if the size is 0, it means default size limit function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner { payloadSizeLimitLookup[_dstChainId] = _size; } //--------------------------- VIEW FUNCTION ---------------------------------------- function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) { bytes memory trustedSource = trustedRemoteLookup[_srcChainId]; return keccak256(trustedSource) == keccak256(_srcAddress); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./LzApp.sol"; import "../util/ExcessivelySafeCall.sol"; /* * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress) */ abstract contract NonblockingLzApp is LzApp { using ExcessivelySafeCall for address; constructor(address _endpoint) LzApp(_endpoint) {} mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages; event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason); event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash); // overriding the virtual function in LzReceiver function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override { (bool success, bytes memory reason) = address(this).excessivelySafeCall(gasleft(), 150, abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload)); // try-catch all errors/exceptions if (!success) { _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason); } } function _storeFailedMessage(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload, bytes memory _reason) internal virtual { failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload); emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason); } function nonblockingLzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual { // only internal transaction require(_msgSender() == address(this), "NonblockingLzApp: caller must be LzApp"); _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } //@notice override this function function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual; function retryMessage(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public payable virtual { // assert there is message to retry bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce]; require(payloadHash != bytes32(0), "NonblockingLzApp: no stored message"); require(keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload"); // clear the stored message failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0); // execute the message. revert if it fails again _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "./IONFT1155Core.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; /** * @dev Interface of the ONFT standard */ interface IONFT1155 is IONFT1155Core, IERC1155 { }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Interface of the ONFT Core standard */ interface IONFT1155Core is IERC165 { event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes indexed _toAddress, uint _tokenId, uint _amount); event SendBatchToChain(uint16 indexed _dstChainId, address indexed _from, bytes indexed _toAddress, uint[] _tokenIds, uint[] _amounts); event ReceiveFromChain(uint16 indexed _srcChainId, bytes indexed _srcAddress, address indexed _toAddress, uint _tokenId, uint _amount); event ReceiveBatchFromChain(uint16 indexed _srcChainId, bytes indexed _srcAddress, address indexed _toAddress, uint[] _tokenIds, uint[] _amounts); // _from - address where tokens should be deducted from on behalf of // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenId - token Id to transfer // _amount - amount of the tokens to transfer // _refundAddress - address on src that will receive refund for any overpayment of L0 fees // _zroPaymentAddress - if paying in zro, pass the address to use. using 0x0 indicates not paying fees in zro // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function sendFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint _tokenId, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable; // _from - address where tokens should be deducted from on behalf of // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenIds - token Ids to transfer // _amounts - amounts of the tokens to transfer // _refundAddress - address on src that will receive refund for any overpayment of L0 fees // _zroPaymentAddress - if paying in zro, pass the address to use. using 0x0 indicates not paying fees in zro // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function sendBatchFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint[] calldata _tokenIds, uint[] calldata _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable; // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenId - token Id to transfer // _amount - amount of the tokens to transfer // _useZro - indicates to use zro to pay L0 fees // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function estimateSendFee(uint16 _dstChainId, bytes calldata _toAddress, uint _tokenId, uint _amount, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee); // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenIds - tokens Id to transfer // _amounts - amounts of the tokens to transfer // _useZro - indicates to use zro to pay L0 fees // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function estimateSendBatchFee(uint16 _dstChainId, bytes calldata _toAddress, uint[] calldata _tokenIds, uint[] calldata _amounts, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IONFT1155Core.sol"; import "../../lzApp/NonblockingLzApp.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; abstract contract ONFT1155Core is NonblockingLzApp, ERC165, IONFT1155Core { uint public constant NO_EXTRA_GAS = 0; uint16 public constant FUNCTION_TYPE_SEND = 1; uint16 public constant FUNCTION_TYPE_SEND_BATCH = 2; bool public useCustomAdapterParams; event SetUseCustomAdapterParams(bool _useCustomAdapterParams); constructor(address _lzEndpoint) NonblockingLzApp(_lzEndpoint) {} function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IONFT1155Core).interfaceId || super.supportsInterface(interfaceId); } function estimateSendFee(uint16 _dstChainId, bytes memory _toAddress, uint _tokenId, uint _amount, bool _useZro, bytes memory _adapterParams) public view virtual override returns (uint nativeFee, uint zroFee) { return estimateSendBatchFee(_dstChainId, _toAddress, _toSingletonArray(_tokenId), _toSingletonArray(_amount), _useZro, _adapterParams); } function estimateSendBatchFee(uint16 _dstChainId, bytes memory _toAddress, uint[] memory _tokenIds, uint[] memory _amounts, bool _useZro, bytes memory _adapterParams) public view virtual override returns (uint nativeFee, uint zroFee) { bytes memory payload = abi.encode(_toAddress, _tokenIds, _amounts); return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams); } function sendFrom(address _from, uint16 _dstChainId, bytes memory _toAddress, uint _tokenId, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) public payable virtual override { _sendBatch(_from, _dstChainId, _toAddress, _toSingletonArray(_tokenId), _toSingletonArray(_amount), _refundAddress, _zroPaymentAddress, _adapterParams); } function sendBatchFrom(address _from, uint16 _dstChainId, bytes memory _toAddress, uint[] memory _tokenIds, uint[] memory _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) public payable virtual override { _sendBatch(_from, _dstChainId, _toAddress, _tokenIds, _amounts, _refundAddress, _zroPaymentAddress, _adapterParams); } function _sendBatch(address _from, uint16 _dstChainId, bytes memory _toAddress, uint[] memory _tokenIds, uint[] memory _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) internal virtual { _debitFrom(_from, _dstChainId, _toAddress, _tokenIds, _amounts); bytes memory payload = abi.encode(_toAddress, _tokenIds, _amounts); if (_tokenIds.length == 1) { if (useCustomAdapterParams) { _checkGasLimit(_dstChainId, FUNCTION_TYPE_SEND, _adapterParams, NO_EXTRA_GAS); } else { require(_adapterParams.length == 0, "LzApp: _adapterParams must be empty."); } _lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value); emit SendToChain(_dstChainId, _from, _toAddress, _tokenIds[0], _amounts[0]); } else if (_tokenIds.length > 1) { if (useCustomAdapterParams) { _checkGasLimit(_dstChainId, FUNCTION_TYPE_SEND_BATCH, _adapterParams, NO_EXTRA_GAS); } else { require(_adapterParams.length == 0, "LzApp: _adapterParams must be empty."); } _lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value); emit SendBatchToChain(_dstChainId, _from, _toAddress, _tokenIds, _amounts); } } function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64, /*_nonce*/ bytes memory _payload ) internal virtual override { // decode and load the toAddress (bytes memory toAddressBytes, uint[] memory tokenIds, uint[] memory amounts) = abi.decode(_payload, (bytes, uint[], uint[])); address toAddress; assembly { toAddress := mload(add(toAddressBytes, 20)) } _creditTo(_srcChainId, toAddress, tokenIds, amounts); if (tokenIds.length == 1) { emit ReceiveFromChain(_srcChainId, _srcAddress, toAddress, tokenIds[0], amounts[0]); } else if (tokenIds.length > 1) { emit ReceiveBatchFromChain(_srcChainId, _srcAddress, toAddress, tokenIds, amounts); } } function setUseCustomAdapterParams(bool _useCustomAdapterParams) external onlyOwner { useCustomAdapterParams = _useCustomAdapterParams; emit SetUseCustomAdapterParams(_useCustomAdapterParams); } function _debitFrom(address _from, uint16 _dstChainId, bytes memory _toAddress, uint[] memory _tokenIds, uint[] memory _amounts) internal virtual; function _creditTo(uint16 _srcChainId, address _toAddress, uint[] memory _tokenIds, uint[] memory _amounts) internal virtual; function _toSingletonArray(uint element) internal pure returns (uint[] memory) { uint[] memory array = new uint[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: Unlicense /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá <[email protected]> * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity >=0.8.0 <0.9.0; library BytesLib { function concat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory) { bytes memory tempBytes; assembly { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // Store the length of the first bytes array at the beginning of // the memory for tempBytes. let length := mload(_preBytes) mstore(tempBytes, length) // Maintain a memory counter for the current write location in the // temp bytes array by adding the 32 bytes for the array length to // the starting location. let mc := add(tempBytes, 0x20) // Stop copying when the memory counter reaches the length of the // first bytes array. let end := add(mc, length) for { // Initialize a copy counter to the start of the _preBytes data, // 32 bytes into its memory. let cc := add(_preBytes, 0x20) } lt(mc, end) { // Increase both counters by 32 bytes each iteration. mc := add(mc, 0x20) cc := add(cc, 0x20) } { // Write the _preBytes data into the tempBytes memory 32 bytes // at a time. mstore(mc, mload(cc)) } // Add the length of _postBytes to the current length of tempBytes // and store it as the new length in the first 32 bytes of the // tempBytes memory. length := mload(_postBytes) mstore(tempBytes, add(length, mload(tempBytes))) // Move the memory counter back from a multiple of 0x20 to the // actual end of the _preBytes data. mc := end // Stop copying when the memory counter reaches the new combined // length of the arrays. end := add(mc, length) for { let cc := add(_postBytes, 0x20) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } // Update the free-memory pointer by padding our last write location // to 32 bytes: add 31 bytes to the end of tempBytes to move to the // next 32 byte block, then round down to the nearest multiple of // 32. If the sum of the length of the two arrays is zero then add // one before rounding down to leave a blank 32 bytes (the length block with 0). mstore(0x40, and( add(add(end, iszero(add(length, mload(_preBytes)))), 31), not(31) // Round down to the nearest 32 bytes. )) } return tempBytes; } function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal { assembly { // Read the first 32 bytes of _preBytes storage, which is the length // of the array. (We don't need to use the offset into the slot // because arrays use the entire slot.) let fslot := sload(_preBytes.slot) // Arrays of 31 bytes or less have an even value in their slot, // while longer arrays have an odd value. The actual length is // the slot divided by two for odd values, and the lowest order // byte divided by two for even values. // If the slot is even, bitwise and the slot with 255 and divide by // two to get the length. If the slot is odd, bitwise and the slot // with -1 and divide by two. let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) let newlength := add(slength, mlength) // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage switch add(lt(slength, 32), lt(newlength, 32)) case 2 { // Since the new array still fits in the slot, we just need to // update the contents of the slot. // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length sstore( _preBytes.slot, // all the modifications to the slot are inside this // next block add( // we can just add to the slot contents because the // bytes we want to change are the LSBs fslot, add( mul( div( // load the bytes from memory mload(add(_postBytes, 0x20)), // zero all bytes to the right exp(0x100, sub(32, mlength)) ), // and now shift left the number of bytes to // leave space for the length in the slot exp(0x100, sub(32, newlength)) ), // increase length by the double of the memory // bytes length mul(mlength, 2) ) ) ) } case 1 { // The stored value fits in the slot, but the combined value // will exceed it. // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // The contents of the _postBytes array start 32 bytes into // the structure. Our first read should obtain the `submod` // bytes that can fit into the unused space in the last word // of the stored array. To get this, we read 32 bytes starting // from `submod`, so the data we read overlaps with the array // contents by `submod` bytes. Masking the lowest-order // `submod` bytes allows us to add that value directly to the // stored value. let submod := sub(32, slength) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore( sc, add( and( fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00 ), and(mload(mc), mask) ) ) for { mc := add(mc, 0x20) sc := add(sc, 1) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } default { // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) // Start copying to the last used word of the stored array. let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // Copy over the first `submod` bytes of the new data as in // case 1 above. let slengthmod := mod(slength, 32) let mlengthmod := mod(mlength, 32) let submod := sub(32, slengthmod) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore(sc, add(sload(sc), and(mload(mc), mask))) for { sc := add(sc, 1) mc := add(mc, 0x20) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } } } function slice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, "slice_overflow"); require(_bytes.length >= _start + _length, "slice_outOfBounds"); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) { require(_bytes.length >= _start + 1 , "toUint8_outOfBounds"); uint8 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x1), _start)) } return tempUint; } function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) { require(_bytes.length >= _start + 2, "toUint16_outOfBounds"); uint16 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x2), _start)) } return tempUint; } function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) { require(_bytes.length >= _start + 4, "toUint32_outOfBounds"); uint32 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x4), _start)) } return tempUint; } function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) { require(_bytes.length >= _start + 8, "toUint64_outOfBounds"); uint64 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x8), _start)) } return tempUint; } function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) { require(_bytes.length >= _start + 12, "toUint96_outOfBounds"); uint96 tempUint; assembly { tempUint := mload(add(add(_bytes, 0xc), _start)) } return tempUint; } function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) { require(_bytes.length >= _start + 16, "toUint128_outOfBounds"); uint128 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x10), _start)) } return tempUint; } function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) { require(_bytes.length >= _start + 32, "toUint256_outOfBounds"); uint256 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x20), _start)) } return tempUint; } function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) { require(_bytes.length >= _start + 32, "toBytes32_outOfBounds"); bytes32 tempBytes32; assembly { tempBytes32 := mload(add(add(_bytes, 0x20), _start)) } return tempBytes32; } function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) { bool success = true; assembly { let length := mload(_preBytes) // if lengths don't match the arrays are not equal switch eq(length, mload(_postBytes)) case 1 { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 let mc := add(_preBytes, 0x20) let end := add(mc, length) for { let cc := add(_postBytes, 0x20) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) } eq(add(lt(mc, end), cb), 2) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { // if any of these checks fails then arrays are not equal if iszero(eq(mload(mc), mload(cc))) { // unsuccess: success := 0 cb := 0 } } } default { // unsuccess: success := 0 } } return success; } function equalStorage( bytes storage _preBytes, bytes memory _postBytes ) internal view returns (bool) { bool success = true; assembly { // we know _preBytes_offset is 0 let fslot := sload(_preBytes.slot) // Decode the length of the stored array like in concatStorage(). let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) // if lengths don't match the arrays are not equal switch eq(slength, mlength) case 1 { // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage if iszero(iszero(slength)) { switch lt(slength, 32) case 1 { // blank the last byte which is the length fslot := mul(div(fslot, 0x100), 0x100) if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) { // unsuccess: success := 0 } } default { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := keccak256(0x0, 0x20) let mc := add(_postBytes, 0x20) let end := add(mc, mlength) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) for {} eq(add(lt(mc, end), cb), 2) { sc := add(sc, 1) mc := add(mc, 0x20) } { if iszero(eq(sload(sc), mload(mc))) { // unsuccess: success := 0 cb := 0 } } } } } default { // unsuccess: success := 0 } } return success; } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.7.6; library ExcessivelySafeCall { uint256 constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff; /// @notice Use when you _really_ really _really_ don't trust the called /// contract. This prevents the called contract from causing reversion of /// the caller in as many ways as we can. /// @dev The main difference between this and a solidity low-level call is /// that we limit the number of bytes that the callee can cause to be /// copied to caller memory. This prevents stupid things like malicious /// contracts returning 10,000,000 bytes causing a local OOG when copying /// to memory. /// @param _target The address to call /// @param _gas The amount of gas to forward to the remote contract /// @param _maxCopy The maximum number of bytes of returndata to copy /// to memory. /// @param _calldata The data to send to the remote contract /// @return success and returndata, as `.call()`. Returndata is capped to /// `_maxCopy` bytes. function excessivelySafeCall( address _target, uint256 _gas, uint16 _maxCopy, bytes memory _calldata ) internal returns (bool, bytes memory) { // set up for assembly call uint256 _toCopy; bool _success; bytes memory _returnData = new bytes(_maxCopy); // dispatch message to recipient // by assembly calling "handle" function // we call via assembly to avoid memcopying a very large returndata // returned by a malicious contract assembly { _success := call( _gas, // gas _target, // recipient 0, // ether value add(_calldata, 0x20), // inloc mload(_calldata), // inlen 0, // outloc 0 // outlen ) // limit our copy to 256 bytes _toCopy := returndatasize() if gt(_toCopy, _maxCopy) { _toCopy := _maxCopy } // Store the length of the copied bytes mstore(_returnData, _toCopy) // copy the bytes from returndata[0:_toCopy] returndatacopy(add(_returnData, 0x20), 0, _toCopy) } return (_success, _returnData); } /// @notice Use when you _really_ really _really_ don't trust the called /// contract. This prevents the called contract from causing reversion of /// the caller in as many ways as we can. /// @dev The main difference between this and a solidity low-level call is /// that we limit the number of bytes that the callee can cause to be /// copied to caller memory. This prevents stupid things like malicious /// contracts returning 10,000,000 bytes causing a local OOG when copying /// to memory. /// @param _target The address to call /// @param _gas The amount of gas to forward to the remote contract /// @param _maxCopy The maximum number of bytes of returndata to copy /// to memory. /// @param _calldata The data to send to the remote contract /// @return success and returndata, as `.call()`. Returndata is capped to /// `_maxCopy` bytes. function excessivelySafeStaticCall( address _target, uint256 _gas, uint16 _maxCopy, bytes memory _calldata ) internal view returns (bool, bytes memory) { // set up for assembly call uint256 _toCopy; bool _success; bytes memory _returnData = new bytes(_maxCopy); // dispatch message to recipient // by assembly calling "handle" function // we call via assembly to avoid memcopying a very large returndata // returned by a malicious contract assembly { _success := staticcall( _gas, // gas _target, // recipient add(_calldata, 0x20), // inloc mload(_calldata), // inlen 0, // outloc 0 // outlen ) // limit our copy to 256 bytes _toCopy := returndatasize() if gt(_toCopy, _maxCopy) { _toCopy := _maxCopy } // Store the length of the copied bytes mstore(_returnData, _toCopy) // copy the bytes from returndata[0:_toCopy] returndatacopy(add(_returnData, 0x20), 0, _toCopy) } return (_success, _returnData); } /** * @notice Swaps function selectors in encoded contract calls * @dev Allows reuse of encoded calldata for functions with identical * argument types but different names. It simply swaps out the first 4 bytes * for the new selector. This function modifies memory in place, and should * only be used with caution. * @param _newSelector The new 4-byte selector * @param _buf The encoded contract args */ function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure { require(_buf.length >= 4); uint256 _mask = LOW_28_MASK; assembly { // load the first word of let _word := mload(add(_buf, 0x20)) // mask out the top 4 bytes // /x _word := and(_word, _mask) _word := or(_newSelector, _word) mstore(add(_buf, 0x20), _word) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.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 ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address 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}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).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: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { 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 token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, 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); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { 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); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { 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); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); 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); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { 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); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { 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 `ids` and `amounts` 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 {} /** * @dev Hook that is called after 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 _afterTokenTransfer( 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 IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.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 IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.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 IERC1155MetadataURI is IERC1155 { /** * @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.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.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 IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; interface ICassette { function currentMaxPage() external view returns (uint); function replicatorMint(address to, uint256 chapter, uint256 amount) external payable; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_uri","type":"string"},{"internalType":"address","name":"_endpoint","type":"address"},{"internalType":"uint256","name":"_maxPage","type":"uint256"},{"internalType":"uint256","name":"_totalChains","type":"uint256"},{"internalType":"uint256","name":"_tokenOffset","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Cassette_ExceedsMaxPage","type":"error"},{"inputs":[],"name":"Cassette_FunctionLocked","type":"error"},{"inputs":[],"name":"Cassette_IncorrectValue","type":"error"},{"inputs":[],"name":"Cassette_InvalidConfiguration","type":"error"},{"inputs":[],"name":"Cassette_InvalidSendData","type":"error"},{"inputs":[],"name":"Cassette_MintClosed","type":"error"},{"inputs":[],"name":"Cassette_NotAllowed","type":"error"},{"inputs":[],"name":"Cassette_ValueOutOfRange","type":"error"},{"inputs":[],"name":"Cassette_WithdrawFailed","type":"error"},{"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":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"_toAddress","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"ReceiveBatchFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"_toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ReceiveFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"RetryMessageSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"SendBatchToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"SendToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"_type","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_minDstGas","type":"uint256"}],"name":"SetMinDstGas","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"precrime","type":"address"}],"name":"SetPrecrime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_path","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"SetTrustedRemoteAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_useCustomAdapterParams","type":"bool"}],"name":"SetUseCustomAdapterParams","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_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNCTION_TYPE_BURN","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNCTION_TYPE_SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNCTION_TYPE_SEND_BATCH","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NO_EXTRA_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_OFFSET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_CHAINS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_receivers","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"payable","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"}],"name":"balancesOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"burnBatchFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"burnFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"currentMaxPage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_functionType","type":"uint16"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateBatchFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_functionType","type":"uint16"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendBatchFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"name":"functionLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"}],"name":"getTrustedRemoteAddress","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"minDstGasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"page","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"payloadSizeLimitLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"replicator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_page","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"replicatorMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendBatchFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_currentMaxPage","type":"uint256"}],"name":"setCurrentMaxPage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_packetType","type":"uint16"},{"internalType":"uint256","name":"_minGas","type":"uint256"}],"name":"setMinDstGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_mintEnabled","type":"bool"}],"name":"setMintEnabled","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setPayloadSizeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_precrime","type":"address"}],"name":"setPrecrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_replicator","type":"address"}],"name":"setReplicator","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"setTrustedRemoteAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useCustomAdapterParams","type":"bool"}],"name":"setUseCustomAdapterParams","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":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_page","type":"uint256"}],"name":"tokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useCustomAdapterParams","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
6101006040523480156200001257600080fd5b5060405162005b5138038062005b51833981016040819052620000359162000130565b8585808062000044336200009b565b6001600160a01b0316608052506200005e905081620000eb565b508282106200008057604051636e3def5760e11b815260040160405180910390fd5b60a09390935260c09190915260e052600c5550620003989050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6009620000f98282620002cc565b5050565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200012b57600080fd5b919050565b60008060008060008060c087890312156200014a57600080fd5b86516001600160401b03808211156200016257600080fd5b818901915089601f8301126200017757600080fd5b8151818111156200018c576200018c620000fd565b604051601f8201601f19908116603f01168101908382118183101715620001b757620001b7620000fd565b81604052828152602093508c84848701011115620001d457600080fd5b600091505b82821015620001f85784820184015181830185015290830190620001d9565b6000848483010152809a5050505062000213818a0162000113565b9650505060408701519350606087015192506080870151915060a087015190509295509295509295565b600181811c908216806200025257607f821691505b6020821081036200027357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002c757600081815260208120601f850160051c81016020861015620002a25750805b601f850160051c820191505b81811015620002c357828155600101620002ae565b5050505b505050565b81516001600160401b03811115620002e857620002e8620000fd565b6200030081620002f984546200023d565b8462000279565b602080601f8311600181146200033857600084156200031f5750858301515b600019600386901b1c1916600185901b178555620002c3565b600085815260208120601f198616915b82811015620003695788860151825594840194600190910190840162000348565b5085821015620003885787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e05161570162000450600039600081816105920152611aa3015260008181610d3c0152818161172801528181611ac401528181611f3b0152611fa80152600081816107b80152818161170701528181611a5c01528181611f5c0152818161274a0152612ab4015260008181610a4901528181610d610152818161110901528181611245015281816112bf0152818161147d0152818161206301528181612685015261391c01526157016000f3fe6080604052600436106104195760003560e01c8063950c8a741161021e578063cbed8b9c11610123578063ee617261116100ab578063f5ecbdbc1161007a578063f5ecbdbc14610cad578063f86a66fa14610ccd578063fa07974d14610ce3578063fd8177ab14610d17578063ff565ba414610d2a57600080fd5b8063ee61726114610c47578063f242432a14610c5a578063f2fde38b14610c7a578063f46a04eb14610c9a57600080fd5b8063df2a5b3b116100f2578063df2a5b3b14610b84578063e985e9c514610ba4578063eab45d9c14610bed578063eb8d72b714610c0d578063ed629c5c14610c2d57600080fd5b8063cbed8b9c14610b24578063d123973014610b44578063d1deba1f14610b5e578063d74855ac14610b7157600080fd5b8063b2535663116101a6578063b90ad5ac11610175578063b90ad5ac14610a7e578063b94bac3314610a9e578063baf3292d14610abe578063bbadfe7614610ade578063c446183414610b0e57600080fd5b8063b253566314610a04578063b2fcf6c814610a24578063b353aaa714610a37578063b390c0ab14610a6b57600080fd5b8063a0712d68116101ed578063a0712d6814610986578063a22cb46514610999578063a2309ff8146109b9578063a6c3d165146109cf578063af3fb21c146109ef57600080fd5b8063950c8a74146108ff57806395d89b411461091f5780639f38369a14610950578063a035b1fe1461097057600080fd5b80634db8226a11610324578063715018a6116102ac57806383ca4b6f1161027b57806383ca4b6f1461084f5780638608e5f8146108625780638cfd8f5c146108825780638da5cb5b146108ba57806391b7f5ed146108ec57600080fd5b8063715018a6146107da57806374b6e8fd146107ef5780637533d7881461080f5780637dcb0e5f1461082f57600080fd5b80635b8c41e6116102f35780635b8c41e6146107045780636392a51f1461075357806366ad5c8a14610773578063672434821461079357806369fc09b9146107a657600080fd5b80634db8226a1461069e5780634e1273f4146106b157806351cff8d9146106de5780635b13db68146106f157600080fd5b8063149e3e1f116103a75780633d8b38f6116103765780633d8b38f6146106095780633f1f4fa41461062957806342d65a8d1461065657806344770515146106765780634ab4e6871461068b57600080fd5b8063149e3e1f1461055857806315d4e5d9146105805780631dc2f750146105b45780632eb2c2d6146105e957600080fd5b806306fdde03116103ee57806306fdde03146104b657806307e0db17146104d85780630df37483146104f85780630e89341c1461051857806310ddb1371461053857600080fd5b80621d35671461041e578062fdd58e1461044057806301ffc9a71461047357806302fe5305146104a3575b600080fd5b34801561042a57600080fd5b5061043e610439366004613e78565b610d5e565b005b34801561044c57600080fd5b5061046061045b366004613f2d565b610f8f565b6040519081526020015b60405180910390f35b34801561047f57600080fd5b5061049361048e366004613f6f565b611025565b604051901515815260200161046a565b61043e6104b1366004613f8c565b611042565b3480156104c257600080fd5b506104cb6110c8565b60405161046a919061401d565b3480156104e457600080fd5b5061043e6104f3366004614030565b6110e8565b34801561050457600080fd5b5061043e61051336600461404d565b611171565b34801561052457600080fd5b506104cb61053336600461406b565b611190565b34801561054457600080fd5b5061043e610553366004614030565b611224565b34801561056457600080fd5b5061056d600281565b60405161ffff909116815260200161046a565b34801561058c57600080fd5b506104607f000000000000000000000000000000000000000000000000000000000000000081565b3480156105c057600080fd5b506105d46105cf3660046141ed565b61127c565b6040805192835260208301919091520161046a565b3480156105f557600080fd5b5061043e6106043660046142cb565b61134d565b34801561061557600080fd5b50610493610624366004614378565b611392565b34801561063557600080fd5b50610460610644366004614030565b60036020526000908152604090205481565b34801561066257600080fd5b5061043e610671366004614378565b61145e565b34801561068257600080fd5b50610460600081565b61043e6106993660046143cc565b6114e4565b61043e6106ac3660046144bb565b6114fe565b3480156106bd57600080fd5b506106d16106cc366004614563565b61151e565b60405161046a919061466a565b61043e6106ec36600461467d565b611647565b61043e6106ff36600461469a565b6116c3565b34801561071057600080fd5b5061046061071f3660046146cf565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561075f57600080fd5b506106d161076e36600461467d565b6116fe565b34801561077f57600080fd5b5061043e61078e366004613e78565b6117dc565b61043e6107a1366004614772565b6118b8565b3480156107b257600080fd5b506104607f000000000000000000000000000000000000000000000000000000000000000081565b3480156107e657600080fd5b5061043e611978565b3480156107fb57600080fd5b506105d461080a3660046147dd565b61198c565b34801561081b57600080fd5b506104cb61082a366004614030565b6119be565b34801561083b57600080fd5b5061046061084a36600461406b565b611a58565b61043e61085d366004614857565b611b1a565b34801561086e57600080fd5b506105d461087d3660046148a3565b611bee565b34801561088e57600080fd5b5061046061089d36600461493b565b600260209081526000928352604080842090915290825290205481565b3480156108c657600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161046a565b61043e6108fa36600461406b565b611c10565b34801561090b57600080fd5b506004546108d4906001600160a01b031681565b34801561092b57600080fd5b50604080518082019091526008815267434153534554544560c01b60208201526104cb565b34801561095c57600080fd5b506104cb61096b366004614030565b611c58565b34801561097c57600080fd5b50610460600c5481565b61043e61099436600461406b565b611d6e565b3480156109a557600080fd5b5061043e6109b4366004614974565b611dcd565b3480156109c557600080fd5b50610460600d5481565b3480156109db57600080fd5b5061043e6109ea366004614378565b611dd8565b3480156109fb57600080fd5b5061056d600181565b348015610a1057600080fd5b506105d4610a1f3660046149a9565b611e61565b61043e610a3236600461467d565b611e74565b348015610a4357600080fd5b506108d47f000000000000000000000000000000000000000000000000000000000000000081565b61043e610a79366004614a45565b611ed9565b348015610a8a57600080fd5b50600a546108d4906001600160a01b031681565b348015610aaa57600080fd5b50610460610ab936600461406b565b611f34565b348015610aca57600080fd5b5061043e610ad936600461467d565b611fe7565b348015610aea57600080fd5b50610493610af9366004613f6f565b600f6020526000908152604090205460ff1681565b348015610b1a57600080fd5b5061046061271081565b348015610b3057600080fd5b5061043e610b3f366004614a67565b612044565b348015610b5057600080fd5b50600e546104939060ff1681565b61043e610b6c366004613e78565b6120d9565b61043e610b7f3660046144bb565b6122ef565b348015610b9057600080fd5b5061043e610b9f366004614ad9565b612366565b348015610bb057600080fd5b50610493610bbf366004614b1a565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b348015610bf957600080fd5b5061043e610c08366004614b48565b612418565b348015610c1957600080fd5b5061043e610c28366004614378565b612461565b348015610c3957600080fd5b506006546104939060ff1681565b61043e610c553660046143cc565b6124bb565b348015610c6657600080fd5b5061043e610c75366004614b63565b612543565b348015610c8657600080fd5b5061043e610c9536600461467d565b612588565b61043e610ca8366004614b48565b6125fe565b348015610cb957600080fd5b506104cb610cc8366004614bcb565b612654565b348015610cd957600080fd5b50610460600b5481565b348015610cef57600080fd5b5061056d7f04c6a47ae7910ef8b295215a97e8495a9eaf57b7b05bfd8bf951edb3fd4a16a381565b61043e610d2536600461406b565b612705565b348015610d3657600080fd5b506104607f000000000000000000000000000000000000000000000000000000000000000081565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614610ddb5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff861660009081526001602052604081208054610df990614c1c565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2590614c1c565b8015610e725780601f10610e4757610100808354040283529160200191610e72565b820191906000526020600020905b815481529060010190602001808311610e5557829003601f168201915b50505050509050805186869050148015610e8d575060008151115b8015610eb5575080516020820120604051610eab9088908890614c56565b6040518091039020145b610f105760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610dd2565b610f868787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061278e92505050565b50505050505050565b60006001600160a01b038316610ffa5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610dd2565b5060008181526007602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216158061101f575061101f82612807565b600080356001600160e01b0319168152600f602052604090205460ff161561107d576040516360bc62bd60e11b815260040160405180910390fd5b611085612847565b6110c482828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128a192505050565b5050565b60606040518060600160405280602e815260200161569e602e9139905090565b6110f0612847565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906307e0db17906024015b600060405180830381600087803b15801561115657600080fd5b505af115801561116a573d6000803e3d6000fd5b5050505050565b611179612847565b61ffff909116600090815260036020526040902055565b60606009805461119f90614c1c565b80601f01602080910402602001604051908101604052809291908181526020018280546111cb90614c1c565b80156112185780601f106111ed57610100808354040283529160200191611218565b820191906000526020600020905b8154815290600101906020018083116111fb57829003601f168201915b50505050509050919050565b61122c612847565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906310ddb1379060240161113c565b6000806000898888886040516020016112989493929190614c66565b60408051601f198184030181529082905263040a7bb160e41b825291506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340a7bb10906112fc908c90309086908b908b90600401614cb4565b6040805180830381865afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133c9190614d08565b925092505097509795505050505050565b6001600160a01b03851633148061136957506113698533610bbf565b6113855760405162461bcd60e51b8152600401610dd290614d2c565b61116a85858585856128ad565b61ffff8316600090815260016020526040812080548291906113b390614c1c565b80601f01602080910402602001604051908101604052809291908181526020018280546113df90614c1c565b801561142c5780601f106114015761010080835404028352916020019161142c565b820191906000526020600020905b81548152906001019060200180831161140f57829003601f168201915b505050505090508383604051611443929190614c56565b60405180910390208180519060200120149150509392505050565b611466612847565b6040516342d65a8d60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342d65a8d906114b690869086908690600401614da3565b600060405180830381600087803b1580156114d057600080fd5b505af1158015610f86573d6000803e3d6000fd5b6114f48888888888888888612a44565b5050505050505050565b6114f488888861150d89612a67565b61151689612a67565b888888612a44565b606081518351146115835760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610dd2565b600083516001600160401b0381111561159e5761159e614084565b6040519080825280602002602001820160405280156115c7578160200160208202803683370190505b50905060005b845181101561163f576116128582815181106115eb576115eb614dc1565b602002602001015185838151811061160557611605614dc1565b6020026020010151610f8f565b82828151811061162457611624614dc1565b602090810291909101015261163881614ded565b90506115cd565b509392505050565b61164f612847565b6000816001600160a01b03164760405160006040518083038185875af1925050503d806000811461169c576040519150601f19603f3d011682016040523d82523d6000602084013e6116a1565b606091505b50509050806110c45760405163c25edec560e01b815260040160405180910390fd5b600a546001600160a01b031633146116ee5760405163365cccbb60e21b815260040160405180910390fd5b6116f9838383612ab2565b505050565b6060600061174c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000614e06565b611757906001614e1d565b6001600160401b0381111561176e5761176e614084565b604051908082528060200260200182016040528015611797578160200160208202803683370190505b50905060005b81518110156117d5576117b08482610f8f565b8282815181106117c2576117c2614dc1565b602090810291909101015260010161179d565b5092915050565b33301461183a5760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610dd2565b6118b08686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f890181900481028201810190925287815289935091508790879081908401838280828437600092019190915250612b2392505050565b505050505050565b600080356001600160e01b0319168152600f602052604090205460ff16156118f3576040516360bc62bd60e11b815260040160405180910390fd5b6118fb612847565b82811461191b57604051631b50aa5360e01b815260040160405180910390fd5b60005b8381101561116a5761197085858381811061193b5761193b614dc1565b9050602002016020810190611950919061467d565b600085858581811061196457611964614dc1565b90506020020135612ab2565b60010161191e565b611980612847565b61198a6000612c96565b565b6000806119ae89898961199e8a612a67565b6119a78a612a67565b898961127c565b9150915097509795505050505050565b600160205260009081526040902080546119d790614c1c565b80601f0160208091040260200160405190810160405280929190818152602001828054611a0390614c1c565b8015611a505780601f10611a2557610100808354040283529160200191611a50565b820191906000526020600020905b815481529060010190602001808311611a3357829003601f168201915b505050505081565b60007f0000000000000000000000000000000000000000000000000000000000000000821115611a9b57604051631b50aa5360e01b815260040160405180910390fd5b8115611b12577f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611aee600185614e30565b611af89190614e06565b611b029190614e1d565b611b0d906001614e1d565b61101f565b600092915050565b60005b82518110156116f9576000611b4a848381518110611b3d57611b3d614dc1565b6020026020010151611f34565b600b54909150611b5b826001614e1d565b1115611b7a576040516302524f6f60e31b815260040160405180910390fd5b611bb733858481518110611b9057611b90614dc1565b6020026020010151858581518110611baa57611baa614dc1565b6020026020010151612ce6565b611be533611bc6836001614e1d565b858581518110611bd857611bd8614dc1565b6020026020010151612ab2565b50600101611b1d565b600080611c016001898961199e8a612a67565b91509150965096945050505050565b600080356001600160e01b0319168152600f602052604090205460ff1615611c4b576040516360bc62bd60e11b815260040160405180910390fd5b611c53612847565b600c55565b61ffff8116600090815260016020526040812080546060929190611c7b90614c1c565b80601f0160208091040260200160405190810160405280929190818152602001828054611ca790614c1c565b8015611cf45780601f10611cc957610100808354040283529160200191611cf4565b820191906000526020600020905b815481529060010190602001808311611cd757829003601f168201915b505050505090508051600003611d4c5760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f72640000006044820152606401610dd2565b611d67600060148351611d5f9190614e30565b839190612ded565b9392505050565b600e5460ff16611d91576040516359e8867760e01b815260040160405180910390fd5b34600c5482611da09190614e06565b14611dbe5760405163bbfcfc8760e01b815260040160405180910390fd5b611dca33600083612ab2565b50565b6110c4338383612efa565b611de0612847565b818130604051602001611df593929190614e43565b60408051601f1981840301815291815261ffff8516600090815260016020522090611e209082614eaf565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051611e5493929190614da3565b60405180910390a1505050565b600080611c01600289898989898961127c565b600080356001600160e01b0319168152600f602052604090205460ff1615611eaf576040516360bc62bd60e11b815260040160405180910390fd5b611eb7612847565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6000611ee483611f34565b600b54909150611ef5826001614e1d565b1115611f14576040516302524f6f60e31b815260040160405180910390fd5b611f1f338484612ce6565b6116f933611f2e836001614e1d565b84612ab2565b6000611f807f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000614e06565b821115611fa057604051631b50aa5360e01b815260040160405180910390fd5b8115611b12577f00000000000000000000000000000000000000000000000000000000000000006001611fd38285614e1d565b611fdd9190614e30565b611b0d9190614f6e565b611fef612847565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b61204c612847565b6040516332fb62e760e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cbed8b9c906120a09088908890889088908890600401614f90565b600060405180830381600087803b1580156120ba57600080fd5b505af11580156120ce573d6000803e3d6000fd5b505050505050505050565b61ffff861660009081526005602052604080822090516120fc9088908890614c56565b90815260408051602092819003830190206001600160401b0387166000908152925290205490508061217c5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610dd2565b80838360405161218d929190614c56565b6040518091039020146121ec5760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610dd2565b61ffff8716600090815260056020526040808220905161220f9089908990614c56565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f880182900482028301820190528682526122a7918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250612b2392505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e587878787856040516122de959493929190614fbe565b60405180910390a150505050505050565b600b546122fb86611f34565b612306906001614e1d565b1115612325576040516302524f6f60e31b815260040160405180910390fd5b6114f47f04c6a47ae7910ef8b295215a97e8495a9eaf57b7b05bfd8bf951edb3fd4a16a38989896123558a612a67565b61235e8a612a67565b898989612fda565b61236e612847565b600081116123b65760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b6044820152606401610dd2565b61ffff83811660008181526002602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001611e54565b612420612847565b6006805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a490602001612039565b612469612847565b61ffff83166000908152600160205260409020612487828483614ff9565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051611e5493929190614da3565b60005b855181101561251157600b546124df878381518110611b3d57611b3d614dc1565b6124ea906001614e1d565b1115612509576040516302524f6f60e31b815260040160405180910390fd5b6001016124be565b506114f47f04c6a47ae7910ef8b295215a97e8495a9eaf57b7b05bfd8bf951edb3fd4a16a38989898989898989612fda565b6001600160a01b03851633148061255f575061255f8533610bbf565b61257b5760405162461bcd60e51b8152600401610dd290614d2c565b61116a85858585856131a3565b612590612847565b6001600160a01b0381166125f55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610dd2565b611dca81612c96565b600080356001600160e01b0319168152600f602052604090205460ff1615612639576040516360bc62bd60e11b815260040160405180910390fd5b612641612847565b600e805460ff1916911515919091179055565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5ecbdbc90608401600060405180830381865afa1580156126d4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126fc9190810190615107565b95945050505050565b600080356001600160e01b0319168152600f602052604090205460ff1615612740576040516360bc62bd60e11b815260040160405180910390fd5b612748612847565b7f0000000000000000000000000000000000000000000000000000000000000000811115612789576040516302524f6f60e31b815260040160405180910390fd5b600b55565b6000806127f15a60966366ad5c8a60e01b898989896040516024016127b69493929190615143565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152309291906132c6565b91509150816118b0576118b08686868685613350565b60006001600160e01b03198216636cdb3d1360e11b148061283857506001600160e01b031982166303a24d0760e21b145b8061101f575061101f826133ed565b6000546001600160a01b0316331461198a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dd2565b60096110c48282614eaf565b81518351146128ce5760405162461bcd60e51b8152600401610dd290615181565b6001600160a01b0384166128f45760405162461bcd60e51b8152600401610dd2906151c9565b3360005b84518110156129de57600085828151811061291557612915614dc1565b60200260200101519050600085838151811061293357612933614dc1565b60209081029190910181015160008481526007835260408082206001600160a01b038e1683529093529190912054909150818110156129845760405162461bcd60e51b8152600401610dd29061520e565b60008381526007602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906129c3908490614e1d565b92505081905550505050806129d790614ded565b90506128f8565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612a2e929190615258565b60405180910390a46118b0818787878787613422565b6114f48551600114612a57576002612a5a565b60015b8989898989898989612fda565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612aa157612aa1614dc1565b602090810291909101015292915050565b7f0000000000000000000000000000000000000000000000000000000000000000821115612af3576040516302524f6f60e31b815260040160405180910390fd5b612b1683612b0084611a58565b836040518060200160405280600081525061357d565b600d805490910190555050565b60008060008084806020019051810190612b3d91906152e3565b601483015193975091955093509150600061ffff86166116a314612b615783612b6a565b612b6a84613650565b9050612b788a8383866136aa565b8351600103612c2157816001600160a01b031689604051612b99919061537e565b60405180910390208b61ffff167f1bf64e58d19fc43de4c44b3d1bb1fae313979af831a7a39f3297564294329f0f84600081518110612bda57612bda614dc1565b602002602001015187600081518110612bf557612bf5614dc1565b6020026020010151604051612c14929190918252602082015260400190565b60405180910390a4612c8a565b600184511115612c8a57816001600160a01b031689604051612c43919061537e565b60405180910390208b61ffff167f1ae08edbbcd7baa8d064835de8593ce16b313414525ac89534e349f4da7926e48487604051612c81929190615258565b60405180910390a45b50505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038316612d0c5760405162461bcd60e51b8152600401610dd29061539a565b336000612d1884612a67565b90506000612d2584612a67565b6040805160208082018352600091829052888252600781528282206001600160a01b038b1683529052205490915084811015612d735760405162461bcd60e51b8152600401610dd2906153dd565b60008681526007602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610f86565b606081612dfb81601f614e1d565b1015612e3a5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610dd2565b612e448284614e1d565b84511015612e885760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610dd2565b606082158015612ea75760405191506000825260208201604052612ef1565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612ee0578051835260209283019201612ec8565b5050858452601f01601f1916604052505b50949350505050565b816001600160a01b0316836001600160a01b031603612f6d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610dd2565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b84511580612fea57508351855114155b156130085760405163166d9d2560e21b815260040160405180910390fd5b61ffff89166001148061301f575061ffff89166002145b156130745760005b85518110156130725785818151811061304257613042614dc1565b602002602001015160001461306a5760405163166d9d2560e21b815260040160405180910390fd5b600101613027565b505b61308188888888886136cb565b60008987878760405160200161309a9493929190614c66565b60405160208183030381529060405290506130b8888b846000613714565b6130c68882868686346137f3565b855160010361314357866040516130dd919061537e565b6040518091039020896001600160a01b03168961ffff167f968b0d61ebcf43e5d76ed87bd2c4ee2f22b4969b9f4ca49e3373c025eddd5eeb8960008151811061312857613128614dc1565b602002602001015189600081518110612bf557612bf5614dc1565b600186511115612c8a578660405161315b919061537e565b6040518091039020896001600160a01b03168961ffff167fddd15f7cfbd674ac2096d598f1650367f8a8bd72b4e3abd85591099ea3b57e338989604051612c81929190615258565b6001600160a01b0384166131c95760405162461bcd60e51b8152600401610dd2906151c9565b3360006131d585612a67565b905060006131e285612a67565b905060008681526007602090815260408083206001600160a01b038c168452909152902054858110156132275760405162461bcd60e51b8152600401610dd29061520e565b60008781526007602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613266908490614e1d565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46120ce848a8a8a8a8a613998565b6000606060008060008661ffff166001600160401b038111156132eb576132eb614084565b6040519080825280601f01601f191660200182016040528015613315576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115613337578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff16815260200190815260200160002085604051613381919061537e565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906133de9087908790879087908790615421565b60405180910390a15050505050565b60006001600160e01b031982166319abbbbb60e11b148061101f57506301ffc9a760e01b6001600160e01b031983161461101f565b6001600160a01b0384163b156118b05760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906134669089908990889088908890600401615473565b6020604051808303816000875af19250505080156134a1575060408051601f3d908101601f1916820190925261349e918101906154b1565b60015b61354d576134ad6154ce565b806308c379a0036134e657506134c16154ea565b806134cc57506134e8565b8060405162461bcd60e51b8152600401610dd2919061401d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610dd2565b6001600160e01b0319811663bc197c8160e01b14610f865760405162461bcd60e51b8152600401610dd290615573565b6001600160a01b0384166135a35760405162461bcd60e51b8152600401610dd2906155bb565b3360006135af85612a67565b905060006135bc85612a67565b905060008681526007602090815260408083206001600160a01b038b168452909152812080548792906135f0908490614e1d565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610f8683600089898989613998565b606060005b82518110156136a35761367e613676848381518110611b3d57611b3d614dc1565b600101611a58565b83828151811061369057613690614dc1565b6020908102919091010152600101613655565b5090919050565b6136c583838360405180602001604052806000815250613a53565b50505050565b336001600160a01b038616148015906136eb57506136e98533610bbf565b155b156137095760405163365cccbb60e21b815260040160405180910390fd5b61116a858383613b9f565b600061371f83613d2c565b61ffff808716600090815260026020908152604080832093891683529290529081205491925090613751908490614e1d565b9050600081116137a35760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610dd2565b808210156118b05760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610dd2565b61ffff86166000908152600160205260408120805461381190614c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461383d90614c1c565b801561388a5780601f1061385f5761010080835404028352916020019161388a565b820191906000526020600020905b81548152906001019060200180831161386d57829003601f168201915b5050505050905080516000036138fb5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b6064820152608401610dd2565b613906878751613d88565b60405162c5803160e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c580310090849061395d908b9086908c908c908c908c906004016155fc565b6000604051808303818588803b15801561397657600080fd5b505af115801561398a573d6000803e3d6000fd5b505050505050505050505050565b6001600160a01b0384163b156118b05760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906139dc9089908990889088908890600401615663565b6020604051808303816000875af1925050508015613a17575060408051601f3d908101601f19168201909252613a14918101906154b1565b60015b613a23576134ad6154ce565b6001600160e01b0319811663f23a6e6160e01b14610f865760405162461bcd60e51b8152600401610dd290615573565b6001600160a01b038416613a795760405162461bcd60e51b8152600401610dd2906155bb565b8151835114613a9a5760405162461bcd60e51b8152600401610dd290615181565b3360005b8451811015613b3757838181518110613ab957613ab9614dc1565b602002602001015160076000878481518110613ad757613ad7614dc1565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254613b1f9190614e1d565b90915550819050613b2f81614ded565b915050613a9e565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051613b88929190615258565b60405180910390a461116a81600087878787613422565b6001600160a01b038316613bc55760405162461bcd60e51b8152600401610dd29061539a565b8051825114613be65760405162461bcd60e51b8152600401610dd290615181565b604080516020810190915260009081905233905b8351811015613cbf576000848281518110613c1757613c17614dc1565b602002602001015190506000848381518110613c3557613c35614dc1565b60209081029190910181015160008481526007835260408082206001600160a01b038c168352909352919091205490915081811015613c865760405162461bcd60e51b8152600401610dd2906153dd565b60009283526007602090815260408085206001600160a01b038b1686529091529092209103905580613cb781614ded565b915050613bfa565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613d10929190615258565b60405180910390a46040805160208101909152600090526136c5565b6000602282511015613d805760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d73000000006044820152606401610dd2565b506022015190565b61ffff821660009081526003602052604081205490819003613da957506127105b808211156116f95760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c617267656044820152606401610dd2565b61ffff81168114611dca57600080fd5b8035613e1481613df9565b919050565b60008083601f840112613e2b57600080fd5b5081356001600160401b03811115613e4257600080fd5b602083019150836020828501011115613e5a57600080fd5b9250929050565b80356001600160401b0381168114613e1457600080fd5b60008060008060008060808789031215613e9157600080fd5b8635613e9c81613df9565b955060208701356001600160401b0380821115613eb857600080fd5b613ec48a838b01613e19565b9097509550859150613ed860408a01613e61565b94506060890135915080821115613eee57600080fd5b50613efb89828a01613e19565b979a9699509497509295939492505050565b6001600160a01b0381168114611dca57600080fd5b8035613e1481613f0d565b60008060408385031215613f4057600080fd5b8235613f4b81613f0d565b946020939093013593505050565b6001600160e01b031981168114611dca57600080fd5b600060208284031215613f8157600080fd5b8135611d6781613f59565b60008060208385031215613f9f57600080fd5b82356001600160401b03811115613fb557600080fd5b613fc185828601613e19565b90969095509350505050565b60005b83811015613fe8578181015183820152602001613fd0565b50506000910152565b60008151808452614009816020860160208601613fcd565b601f01601f19169290920160200192915050565b602081526000611d676020830184613ff1565b60006020828403121561404257600080fd5b8135611d6781613df9565b6000806040838503121561406057600080fd5b8235613f4b81613df9565b60006020828403121561407d57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156140bf576140bf614084565b6040525050565b60006001600160401b038211156140df576140df614084565b50601f01601f191660200190565b600082601f8301126140fe57600080fd5b8135614109816140c6565b604051614116828261409a565b82815285602084870101111561412b57600080fd5b82602086016020830137600092810160200192909252509392505050565b60006001600160401b0382111561416257614162614084565b5060051b60200190565b600082601f83011261417d57600080fd5b8135602061418a82614149565b604051614197828261409a565b83815260059390931b85018201928281019150868411156141b757600080fd5b8286015b848110156141d257803583529183019183016141bb565b509695505050505050565b80358015158114613e1457600080fd5b600080600080600080600060e0888a03121561420857600080fd5b61421188613e09565b965061421f60208901613e09565b955060408801356001600160401b038082111561423b57600080fd5b6142478b838c016140ed565b965060608a013591508082111561425d57600080fd5b6142698b838c0161416c565b955060808a013591508082111561427f57600080fd5b61428b8b838c0161416c565b945061429960a08b016141dd565b935060c08a01359150808211156142af57600080fd5b506142bc8a828b016140ed565b91505092959891949750929550565b600080600080600060a086880312156142e357600080fd5b85356142ee81613f0d565b945060208601356142fe81613f0d565b935060408601356001600160401b038082111561431a57600080fd5b61432689838a0161416c565b9450606088013591508082111561433c57600080fd5b61434889838a0161416c565b9350608088013591508082111561435e57600080fd5b5061436b888289016140ed565b9150509295509295909350565b60008060006040848603121561438d57600080fd5b833561439881613df9565b925060208401356001600160401b038111156143b357600080fd5b6143bf86828701613e19565b9497909650939450505050565b600080600080600080600080610100898b0312156143e957600080fd5b6143f289613f22565b975061440060208a01613e09565b965060408901356001600160401b038082111561441c57600080fd5b6144288c838d016140ed565b975060608b013591508082111561443e57600080fd5b61444a8c838d0161416c565b965060808b013591508082111561446057600080fd5b61446c8c838d0161416c565b955061447a60a08c01613f22565b945061448860c08c01613f22565b935060e08b013591508082111561449e57600080fd5b506144ab8b828c016140ed565b9150509295985092959890939650565b600080600080600080600080610100898b0312156144d857600080fd5b88356144e381613f0d565b975060208901356144f381613df9565b965060408901356001600160401b038082111561450f57600080fd5b61451b8c838d016140ed565b975060608b0135965060808b0135955060a08b0135915061453b82613f0d565b90935060c08a01359061454d82613f0d565b90925060e08a0135908082111561449e57600080fd5b6000806040838503121561457657600080fd5b82356001600160401b038082111561458d57600080fd5b818501915085601f8301126145a157600080fd5b813560206145ae82614149565b6040516145bb828261409a565b83815260059390931b85018201928281019150898411156145db57600080fd5b948201945b838610156146025785356145f381613f0d565b825294820194908201906145e0565b9650508601359250508082111561461857600080fd5b506146258582860161416c565b9150509250929050565b600081518084526020808501945080840160005b8381101561465f57815187529582019590820190600101614643565b509495945050505050565b602081526000611d67602083018461462f565b60006020828403121561468f57600080fd5b8135611d6781613f0d565b6000806000606084860312156146af57600080fd5b83356146ba81613f0d565b95602085013595506040909401359392505050565b6000806000606084860312156146e457600080fd5b83356146ef81613df9565b925060208401356001600160401b0381111561470a57600080fd5b614716868287016140ed565b92505061472560408501613e61565b90509250925092565b60008083601f84011261474057600080fd5b5081356001600160401b0381111561475757600080fd5b6020830191508360208260051b8501011115613e5a57600080fd5b6000806000806040858703121561478857600080fd5b84356001600160401b038082111561479f57600080fd5b6147ab8883890161472e565b909650945060208701359150808211156147c457600080fd5b506147d18782880161472e565b95989497509550505050565b600080600080600080600060e0888a0312156147f857600080fd5b873561480381613df9565b9650602088013561481381613df9565b955060408801356001600160401b038082111561482f57600080fd5b61483b8b838c016140ed565b965060608a0135955060808a0135945061429960a08b016141dd565b6000806040838503121561486a57600080fd5b82356001600160401b038082111561488157600080fd5b61488d8683870161416c565b9350602085013591508082111561461857600080fd5b60008060008060008060c087890312156148bc57600080fd5b86356148c781613df9565b955060208701356001600160401b03808211156148e357600080fd5b6148ef8a838b016140ed565b9650604089013595506060890135945061490b60808a016141dd565b935060a089013591508082111561492157600080fd5b5061492e89828a016140ed565b9150509295509295509295565b6000806040838503121561494e57600080fd5b823561495981613df9565b9150602083013561496981613df9565b809150509250929050565b6000806040838503121561498757600080fd5b823561499281613f0d565b91506149a0602084016141dd565b90509250929050565b60008060008060008060c087890312156149c257600080fd5b6149cb87613e09565b955060208701356001600160401b03808211156149e757600080fd5b6149f38a838b016140ed565b96506040890135915080821115614a0957600080fd5b614a158a838b0161416c565b95506060890135915080821115614a2b57600080fd5b614a378a838b0161416c565b945061490b60808a016141dd565b60008060408385031215614a5857600080fd5b50508035926020909101359150565b600080600080600060808688031215614a7f57600080fd5b8535614a8a81613df9565b94506020860135614a9a81613df9565b93506040860135925060608601356001600160401b03811115614abc57600080fd5b614ac888828901613e19565b969995985093965092949392505050565b600080600060608486031215614aee57600080fd5b8335614af981613df9565b92506020840135614b0981613df9565b929592945050506040919091013590565b60008060408385031215614b2d57600080fd5b8235614b3881613f0d565b9150602083013561496981613f0d565b600060208284031215614b5a57600080fd5b611d67826141dd565b600080600080600060a08688031215614b7b57600080fd5b8535614b8681613f0d565b94506020860135614b9681613f0d565b9350604086013592506060860135915060808601356001600160401b03811115614bbf57600080fd5b61436b888289016140ed565b60008060008060808587031215614be157600080fd5b8435614bec81613df9565b93506020850135614bfc81613df9565b92506040850135614c0c81613f0d565b9396929550929360600135925050565b600181811c90821680614c3057607f821691505b602082108103614c5057634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b61ffff85168152608060208201526000614c836080830186613ff1565b8281036040840152614c95818661462f565b90508281036060840152614ca9818561462f565b979650505050505050565b61ffff861681526001600160a01b038516602082015260a060408201819052600090614ce290830186613ff1565b84151560608401528281036080840152614cfc8185613ff1565b98975050505050505050565b60008060408385031215614d1b57600080fd5b505080516020909101519092909150565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff841681526040602082015260006126fc604083018486614d7a565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614dff57614dff614dd7565b5060010190565b808202811582820484141761101f5761101f614dd7565b8082018082111561101f5761101f614dd7565b8181038181111561101f5761101f614dd7565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b601f8211156116f957600081815260208120601f850160051c81016020861015614e905750805b601f850160051c820191505b818110156118b057828155600101614e9c565b81516001600160401b03811115614ec857614ec8614084565b614edc81614ed68454614c1c565b84614e69565b602080601f831160018114614f115760008415614ef95750858301515b600019600386901b1c1916600185901b1785556118b0565b600085815260208120601f198616915b82811015614f4057888601518255948401946001909101908401614f21565b5085821015614f5e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082614f8b57634e487b7160e01b600052601260045260246000fd5b500490565b600061ffff808816835280871660208401525084604083015260806060830152614ca9608083018486614d7a565b61ffff86168152608060208201526000614fdc608083018688614d7a565b6001600160401b0394909416604083015250606001529392505050565b6001600160401b0383111561501057615010614084565b6150248361501e8354614c1c565b83614e69565b6000601f84116001811461505857600085156150405750838201355b600019600387901b1c1916600186901b17835561116a565b600083815260209020601f19861690835b828110156150895786850135825560209485019460019092019101615069565b50868210156150a65760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600082601f8301126150c957600080fd5b81516150d4816140c6565b6040516150e1828261409a565b8281528560208487010111156150f657600080fd5b6126fc836020830160208801613fcd565b60006020828403121561511957600080fd5b81516001600160401b0381111561512f57600080fd5b61513b848285016150b8565b949350505050565b61ffff851681526080602082015260006151606080830186613ff1565b6001600160401b03851660408401528281036060840152614ca98185613ff1565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061526b604083018561462f565b82810360208401526126fc818561462f565b600082601f83011261528e57600080fd5b8151602061529b82614149565b6040516152a8828261409a565b83815260059390931b85018201928281019150868411156152c857600080fd5b8286015b848110156141d257805183529183019183016152cc565b600080600080608085870312156152f957600080fd5b845161530481613df9565b60208601519094506001600160401b038082111561532157600080fd5b61532d888389016150b8565b9450604087015191508082111561534357600080fd5b61534f8883890161527d565b9350606087015191508082111561536557600080fd5b506153728782880161527d565b91505092959194509250565b60008251615390818460208701613fcd565b9190910192915050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b61ffff8616815260a06020820152600061543e60a0830187613ff1565b6001600160401b0386166040840152828103606084015261545f8186613ff1565b90508281036080840152614cfc8185613ff1565b6001600160a01b0386811682528516602082015260a06040820181905260009061549f9083018661462f565b828103606084015261545f818661462f565b6000602082840312156154c357600080fd5b8151611d6781613f59565b600060033d11156154e75760046000803e5060005160e01c5b90565b600060443d10156154f85790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561552757505050505090565b828501915081518181111561553f5750505050505090565b843d87010160208285010111156155595750505050505090565b6155686020828601018761409a565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b61ffff8716815260c06020820152600061561960c0830188613ff1565b828103604084015261562b8188613ff1565b6001600160a01b0387811660608601528616608085015283810360a085015290506156568185613ff1565b9998505050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614ca990830184613ff156fe4b41494a55204f524947494e533a20546865204a6f75726e616c73206f662053746f64202d204361737365747465a26469706673582212200a028cf83a3143687e48ade23cdf78587b23725301cc61499fc3fa2c59efb49064736f6c6343000813003300000000000000000000000000000000000000000000000000000000000000c000000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c0a75e0b440000000000000000000000000000000000000000000000000000000000000000007697066733a2f2f00000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106104195760003560e01c8063950c8a741161021e578063cbed8b9c11610123578063ee617261116100ab578063f5ecbdbc1161007a578063f5ecbdbc14610cad578063f86a66fa14610ccd578063fa07974d14610ce3578063fd8177ab14610d17578063ff565ba414610d2a57600080fd5b8063ee61726114610c47578063f242432a14610c5a578063f2fde38b14610c7a578063f46a04eb14610c9a57600080fd5b8063df2a5b3b116100f2578063df2a5b3b14610b84578063e985e9c514610ba4578063eab45d9c14610bed578063eb8d72b714610c0d578063ed629c5c14610c2d57600080fd5b8063cbed8b9c14610b24578063d123973014610b44578063d1deba1f14610b5e578063d74855ac14610b7157600080fd5b8063b2535663116101a6578063b90ad5ac11610175578063b90ad5ac14610a7e578063b94bac3314610a9e578063baf3292d14610abe578063bbadfe7614610ade578063c446183414610b0e57600080fd5b8063b253566314610a04578063b2fcf6c814610a24578063b353aaa714610a37578063b390c0ab14610a6b57600080fd5b8063a0712d68116101ed578063a0712d6814610986578063a22cb46514610999578063a2309ff8146109b9578063a6c3d165146109cf578063af3fb21c146109ef57600080fd5b8063950c8a74146108ff57806395d89b411461091f5780639f38369a14610950578063a035b1fe1461097057600080fd5b80634db8226a11610324578063715018a6116102ac57806383ca4b6f1161027b57806383ca4b6f1461084f5780638608e5f8146108625780638cfd8f5c146108825780638da5cb5b146108ba57806391b7f5ed146108ec57600080fd5b8063715018a6146107da57806374b6e8fd146107ef5780637533d7881461080f5780637dcb0e5f1461082f57600080fd5b80635b8c41e6116102f35780635b8c41e6146107045780636392a51f1461075357806366ad5c8a14610773578063672434821461079357806369fc09b9146107a657600080fd5b80634db8226a1461069e5780634e1273f4146106b157806351cff8d9146106de5780635b13db68146106f157600080fd5b8063149e3e1f116103a75780633d8b38f6116103765780633d8b38f6146106095780633f1f4fa41461062957806342d65a8d1461065657806344770515146106765780634ab4e6871461068b57600080fd5b8063149e3e1f1461055857806315d4e5d9146105805780631dc2f750146105b45780632eb2c2d6146105e957600080fd5b806306fdde03116103ee57806306fdde03146104b657806307e0db17146104d85780630df37483146104f85780630e89341c1461051857806310ddb1371461053857600080fd5b80621d35671461041e578062fdd58e1461044057806301ffc9a71461047357806302fe5305146104a3575b600080fd5b34801561042a57600080fd5b5061043e610439366004613e78565b610d5e565b005b34801561044c57600080fd5b5061046061045b366004613f2d565b610f8f565b6040519081526020015b60405180910390f35b34801561047f57600080fd5b5061049361048e366004613f6f565b611025565b604051901515815260200161046a565b61043e6104b1366004613f8c565b611042565b3480156104c257600080fd5b506104cb6110c8565b60405161046a919061401d565b3480156104e457600080fd5b5061043e6104f3366004614030565b6110e8565b34801561050457600080fd5b5061043e61051336600461404d565b611171565b34801561052457600080fd5b506104cb61053336600461406b565b611190565b34801561054457600080fd5b5061043e610553366004614030565b611224565b34801561056457600080fd5b5061056d600281565b60405161ffff909116815260200161046a565b34801561058c57600080fd5b506104607f000000000000000000000000000000000000000000000000000000000000000081565b3480156105c057600080fd5b506105d46105cf3660046141ed565b61127c565b6040805192835260208301919091520161046a565b3480156105f557600080fd5b5061043e6106043660046142cb565b61134d565b34801561061557600080fd5b50610493610624366004614378565b611392565b34801561063557600080fd5b50610460610644366004614030565b60036020526000908152604090205481565b34801561066257600080fd5b5061043e610671366004614378565b61145e565b34801561068257600080fd5b50610460600081565b61043e6106993660046143cc565b6114e4565b61043e6106ac3660046144bb565b6114fe565b3480156106bd57600080fd5b506106d16106cc366004614563565b61151e565b60405161046a919061466a565b61043e6106ec36600461467d565b611647565b61043e6106ff36600461469a565b6116c3565b34801561071057600080fd5b5061046061071f3660046146cf565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561075f57600080fd5b506106d161076e36600461467d565b6116fe565b34801561077f57600080fd5b5061043e61078e366004613e78565b6117dc565b61043e6107a1366004614772565b6118b8565b3480156107b257600080fd5b506104607f000000000000000000000000000000000000000000000000000000000000000581565b3480156107e657600080fd5b5061043e611978565b3480156107fb57600080fd5b506105d461080a3660046147dd565b61198c565b34801561081b57600080fd5b506104cb61082a366004614030565b6119be565b34801561083b57600080fd5b5061046061084a36600461406b565b611a58565b61043e61085d366004614857565b611b1a565b34801561086e57600080fd5b506105d461087d3660046148a3565b611bee565b34801561088e57600080fd5b5061046061089d36600461493b565b600260209081526000928352604080842090915290825290205481565b3480156108c657600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161046a565b61043e6108fa36600461406b565b611c10565b34801561090b57600080fd5b506004546108d4906001600160a01b031681565b34801561092b57600080fd5b50604080518082019091526008815267434153534554544560c01b60208201526104cb565b34801561095c57600080fd5b506104cb61096b366004614030565b611c58565b34801561097c57600080fd5b50610460600c5481565b61043e61099436600461406b565b611d6e565b3480156109a557600080fd5b5061043e6109b4366004614974565b611dcd565b3480156109c557600080fd5b50610460600d5481565b3480156109db57600080fd5b5061043e6109ea366004614378565b611dd8565b3480156109fb57600080fd5b5061056d600181565b348015610a1057600080fd5b506105d4610a1f3660046149a9565b611e61565b61043e610a3236600461467d565b611e74565b348015610a4357600080fd5b506108d47f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67581565b61043e610a79366004614a45565b611ed9565b348015610a8a57600080fd5b50600a546108d4906001600160a01b031681565b348015610aaa57600080fd5b50610460610ab936600461406b565b611f34565b348015610aca57600080fd5b5061043e610ad936600461467d565b611fe7565b348015610aea57600080fd5b50610493610af9366004613f6f565b600f6020526000908152604090205460ff1681565b348015610b1a57600080fd5b5061046061271081565b348015610b3057600080fd5b5061043e610b3f366004614a67565b612044565b348015610b5057600080fd5b50600e546104939060ff1681565b61043e610b6c366004613e78565b6120d9565b61043e610b7f3660046144bb565b6122ef565b348015610b9057600080fd5b5061043e610b9f366004614ad9565b612366565b348015610bb057600080fd5b50610493610bbf366004614b1a565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b348015610bf957600080fd5b5061043e610c08366004614b48565b612418565b348015610c1957600080fd5b5061043e610c28366004614378565b612461565b348015610c3957600080fd5b506006546104939060ff1681565b61043e610c553660046143cc565b6124bb565b348015610c6657600080fd5b5061043e610c75366004614b63565b612543565b348015610c8657600080fd5b5061043e610c9536600461467d565b612588565b61043e610ca8366004614b48565b6125fe565b348015610cb957600080fd5b506104cb610cc8366004614bcb565b612654565b348015610cd957600080fd5b50610460600b5481565b348015610cef57600080fd5b5061056d7f04c6a47ae7910ef8b295215a97e8495a9eaf57b7b05bfd8bf951edb3fd4a16a381565b61043e610d2536600461406b565b612705565b348015610d3657600080fd5b506104607f000000000000000000000000000000000000000000000000000000000000000581565b337f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b031614610ddb5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff861660009081526001602052604081208054610df990614c1c565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2590614c1c565b8015610e725780601f10610e4757610100808354040283529160200191610e72565b820191906000526020600020905b815481529060010190602001808311610e5557829003601f168201915b50505050509050805186869050148015610e8d575060008151115b8015610eb5575080516020820120604051610eab9088908890614c56565b6040518091039020145b610f105760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610dd2565b610f868787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061278e92505050565b50505050505050565b60006001600160a01b038316610ffa5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b6064820152608401610dd2565b5060008181526007602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216158061101f575061101f82612807565b600080356001600160e01b0319168152600f602052604090205460ff161561107d576040516360bc62bd60e11b815260040160405180910390fd5b611085612847565b6110c482828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128a192505050565b5050565b60606040518060600160405280602e815260200161569e602e9139905090565b6110f0612847565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316906307e0db17906024015b600060405180830381600087803b15801561115657600080fd5b505af115801561116a573d6000803e3d6000fd5b5050505050565b611179612847565b61ffff909116600090815260036020526040902055565b60606009805461119f90614c1c565b80601f01602080910402602001604051908101604052809291908181526020018280546111cb90614c1c565b80156112185780601f106111ed57610100808354040283529160200191611218565b820191906000526020600020905b8154815290600101906020018083116111fb57829003601f168201915b50505050509050919050565b61122c612847565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316906310ddb1379060240161113c565b6000806000898888886040516020016112989493929190614c66565b60408051601f198184030181529082905263040a7bb160e41b825291506001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906340a7bb10906112fc908c90309086908b908b90600401614cb4565b6040805180830381865afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133c9190614d08565b925092505097509795505050505050565b6001600160a01b03851633148061136957506113698533610bbf565b6113855760405162461bcd60e51b8152600401610dd290614d2c565b61116a85858585856128ad565b61ffff8316600090815260016020526040812080548291906113b390614c1c565b80601f01602080910402602001604051908101604052809291908181526020018280546113df90614c1c565b801561142c5780601f106114015761010080835404028352916020019161142c565b820191906000526020600020905b81548152906001019060200180831161140f57829003601f168201915b505050505090508383604051611443929190614c56565b60405180910390208180519060200120149150509392505050565b611466612847565b6040516342d65a8d60e01b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906342d65a8d906114b690869086908690600401614da3565b600060405180830381600087803b1580156114d057600080fd5b505af1158015610f86573d6000803e3d6000fd5b6114f48888888888888888612a44565b5050505050505050565b6114f488888861150d89612a67565b61151689612a67565b888888612a44565b606081518351146115835760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610dd2565b600083516001600160401b0381111561159e5761159e614084565b6040519080825280602002602001820160405280156115c7578160200160208202803683370190505b50905060005b845181101561163f576116128582815181106115eb576115eb614dc1565b602002602001015185838151811061160557611605614dc1565b6020026020010151610f8f565b82828151811061162457611624614dc1565b602090810291909101015261163881614ded565b90506115cd565b509392505050565b61164f612847565b6000816001600160a01b03164760405160006040518083038185875af1925050503d806000811461169c576040519150601f19603f3d011682016040523d82523d6000602084013e6116a1565b606091505b50509050806110c45760405163c25edec560e01b815260040160405180910390fd5b600a546001600160a01b031633146116ee5760405163365cccbb60e21b815260040160405180910390fd5b6116f9838383612ab2565b505050565b6060600061174c7f00000000000000000000000000000000000000000000000000000000000000057f0000000000000000000000000000000000000000000000000000000000000005614e06565b611757906001614e1d565b6001600160401b0381111561176e5761176e614084565b604051908082528060200260200182016040528015611797578160200160208202803683370190505b50905060005b81518110156117d5576117b08482610f8f565b8282815181106117c2576117c2614dc1565b602090810291909101015260010161179d565b5092915050565b33301461183a5760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610dd2565b6118b08686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f890181900481028201810190925287815289935091508790879081908401838280828437600092019190915250612b2392505050565b505050505050565b600080356001600160e01b0319168152600f602052604090205460ff16156118f3576040516360bc62bd60e11b815260040160405180910390fd5b6118fb612847565b82811461191b57604051631b50aa5360e01b815260040160405180910390fd5b60005b8381101561116a5761197085858381811061193b5761193b614dc1565b9050602002016020810190611950919061467d565b600085858581811061196457611964614dc1565b90506020020135612ab2565b60010161191e565b611980612847565b61198a6000612c96565b565b6000806119ae89898961199e8a612a67565b6119a78a612a67565b898961127c565b9150915097509795505050505050565b600160205260009081526040902080546119d790614c1c565b80601f0160208091040260200160405190810160405280929190818152602001828054611a0390614c1c565b8015611a505780601f10611a2557610100808354040283529160200191611a50565b820191906000526020600020905b815481529060010190602001808311611a3357829003601f168201915b505050505081565b60007f0000000000000000000000000000000000000000000000000000000000000005821115611a9b57604051631b50aa5360e01b815260040160405180910390fd5b8115611b12577f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000005611aee600185614e30565b611af89190614e06565b611b029190614e1d565b611b0d906001614e1d565b61101f565b600092915050565b60005b82518110156116f9576000611b4a848381518110611b3d57611b3d614dc1565b6020026020010151611f34565b600b54909150611b5b826001614e1d565b1115611b7a576040516302524f6f60e31b815260040160405180910390fd5b611bb733858481518110611b9057611b90614dc1565b6020026020010151858581518110611baa57611baa614dc1565b6020026020010151612ce6565b611be533611bc6836001614e1d565b858581518110611bd857611bd8614dc1565b6020026020010151612ab2565b50600101611b1d565b600080611c016001898961199e8a612a67565b91509150965096945050505050565b600080356001600160e01b0319168152600f602052604090205460ff1615611c4b576040516360bc62bd60e11b815260040160405180910390fd5b611c53612847565b600c55565b61ffff8116600090815260016020526040812080546060929190611c7b90614c1c565b80601f0160208091040260200160405190810160405280929190818152602001828054611ca790614c1c565b8015611cf45780601f10611cc957610100808354040283529160200191611cf4565b820191906000526020600020905b815481529060010190602001808311611cd757829003601f168201915b505050505090508051600003611d4c5760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f72640000006044820152606401610dd2565b611d67600060148351611d5f9190614e30565b839190612ded565b9392505050565b600e5460ff16611d91576040516359e8867760e01b815260040160405180910390fd5b34600c5482611da09190614e06565b14611dbe5760405163bbfcfc8760e01b815260040160405180910390fd5b611dca33600083612ab2565b50565b6110c4338383612efa565b611de0612847565b818130604051602001611df593929190614e43565b60408051601f1981840301815291815261ffff8516600090815260016020522090611e209082614eaf565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051611e5493929190614da3565b60405180910390a1505050565b600080611c01600289898989898961127c565b600080356001600160e01b0319168152600f602052604090205460ff1615611eaf576040516360bc62bd60e11b815260040160405180910390fd5b611eb7612847565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6000611ee483611f34565b600b54909150611ef5826001614e1d565b1115611f14576040516302524f6f60e31b815260040160405180910390fd5b611f1f338484612ce6565b6116f933611f2e836001614e1d565b84612ab2565b6000611f807f00000000000000000000000000000000000000000000000000000000000000057f0000000000000000000000000000000000000000000000000000000000000005614e06565b821115611fa057604051631b50aa5360e01b815260040160405180910390fd5b8115611b12577f00000000000000000000000000000000000000000000000000000000000000056001611fd38285614e1d565b611fdd9190614e30565b611b0d9190614f6e565b611fef612847565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b61204c612847565b6040516332fb62e760e21b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063cbed8b9c906120a09088908890889088908890600401614f90565b600060405180830381600087803b1580156120ba57600080fd5b505af11580156120ce573d6000803e3d6000fd5b505050505050505050565b61ffff861660009081526005602052604080822090516120fc9088908890614c56565b90815260408051602092819003830190206001600160401b0387166000908152925290205490508061217c5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610dd2565b80838360405161218d929190614c56565b6040518091039020146121ec5760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610dd2565b61ffff8716600090815260056020526040808220905161220f9089908990614c56565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f880182900482028301820190528682526122a7918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250612b2392505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e587878787856040516122de959493929190614fbe565b60405180910390a150505050505050565b600b546122fb86611f34565b612306906001614e1d565b1115612325576040516302524f6f60e31b815260040160405180910390fd5b6114f47f04c6a47ae7910ef8b295215a97e8495a9eaf57b7b05bfd8bf951edb3fd4a16a38989896123558a612a67565b61235e8a612a67565b898989612fda565b61236e612847565b600081116123b65760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b6044820152606401610dd2565b61ffff83811660008181526002602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001611e54565b612420612847565b6006805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a490602001612039565b612469612847565b61ffff83166000908152600160205260409020612487828483614ff9565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051611e5493929190614da3565b60005b855181101561251157600b546124df878381518110611b3d57611b3d614dc1565b6124ea906001614e1d565b1115612509576040516302524f6f60e31b815260040160405180910390fd5b6001016124be565b506114f47f04c6a47ae7910ef8b295215a97e8495a9eaf57b7b05bfd8bf951edb3fd4a16a38989898989898989612fda565b6001600160a01b03851633148061255f575061255f8533610bbf565b61257b5760405162461bcd60e51b8152600401610dd290614d2c565b61116a85858585856131a3565b612590612847565b6001600160a01b0381166125f55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610dd2565b611dca81612c96565b600080356001600160e01b0319168152600f602052604090205460ff1615612639576040516360bc62bd60e11b815260040160405180910390fd5b612641612847565b600e805460ff1916911515919091179055565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b03169063f5ecbdbc90608401600060405180830381865afa1580156126d4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126fc9190810190615107565b95945050505050565b600080356001600160e01b0319168152600f602052604090205460ff1615612740576040516360bc62bd60e11b815260040160405180910390fd5b612748612847565b7f0000000000000000000000000000000000000000000000000000000000000005811115612789576040516302524f6f60e31b815260040160405180910390fd5b600b55565b6000806127f15a60966366ad5c8a60e01b898989896040516024016127b69493929190615143565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152309291906132c6565b91509150816118b0576118b08686868685613350565b60006001600160e01b03198216636cdb3d1360e11b148061283857506001600160e01b031982166303a24d0760e21b145b8061101f575061101f826133ed565b6000546001600160a01b0316331461198a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dd2565b60096110c48282614eaf565b81518351146128ce5760405162461bcd60e51b8152600401610dd290615181565b6001600160a01b0384166128f45760405162461bcd60e51b8152600401610dd2906151c9565b3360005b84518110156129de57600085828151811061291557612915614dc1565b60200260200101519050600085838151811061293357612933614dc1565b60209081029190910181015160008481526007835260408082206001600160a01b038e1683529093529190912054909150818110156129845760405162461bcd60e51b8152600401610dd29061520e565b60008381526007602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906129c3908490614e1d565b92505081905550505050806129d790614ded565b90506128f8565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612a2e929190615258565b60405180910390a46118b0818787878787613422565b6114f48551600114612a57576002612a5a565b60015b8989898989898989612fda565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612aa157612aa1614dc1565b602090810291909101015292915050565b7f0000000000000000000000000000000000000000000000000000000000000005821115612af3576040516302524f6f60e31b815260040160405180910390fd5b612b1683612b0084611a58565b836040518060200160405280600081525061357d565b600d805490910190555050565b60008060008084806020019051810190612b3d91906152e3565b601483015193975091955093509150600061ffff86166116a314612b615783612b6a565b612b6a84613650565b9050612b788a8383866136aa565b8351600103612c2157816001600160a01b031689604051612b99919061537e565b60405180910390208b61ffff167f1bf64e58d19fc43de4c44b3d1bb1fae313979af831a7a39f3297564294329f0f84600081518110612bda57612bda614dc1565b602002602001015187600081518110612bf557612bf5614dc1565b6020026020010151604051612c14929190918252602082015260400190565b60405180910390a4612c8a565b600184511115612c8a57816001600160a01b031689604051612c43919061537e565b60405180910390208b61ffff167f1ae08edbbcd7baa8d064835de8593ce16b313414525ac89534e349f4da7926e48487604051612c81929190615258565b60405180910390a45b50505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038316612d0c5760405162461bcd60e51b8152600401610dd29061539a565b336000612d1884612a67565b90506000612d2584612a67565b6040805160208082018352600091829052888252600781528282206001600160a01b038b1683529052205490915084811015612d735760405162461bcd60e51b8152600401610dd2906153dd565b60008681526007602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610f86565b606081612dfb81601f614e1d565b1015612e3a5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610dd2565b612e448284614e1d565b84511015612e885760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610dd2565b606082158015612ea75760405191506000825260208201604052612ef1565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612ee0578051835260209283019201612ec8565b5050858452601f01601f1916604052505b50949350505050565b816001600160a01b0316836001600160a01b031603612f6d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610dd2565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b84511580612fea57508351855114155b156130085760405163166d9d2560e21b815260040160405180910390fd5b61ffff89166001148061301f575061ffff89166002145b156130745760005b85518110156130725785818151811061304257613042614dc1565b602002602001015160001461306a5760405163166d9d2560e21b815260040160405180910390fd5b600101613027565b505b61308188888888886136cb565b60008987878760405160200161309a9493929190614c66565b60405160208183030381529060405290506130b8888b846000613714565b6130c68882868686346137f3565b855160010361314357866040516130dd919061537e565b6040518091039020896001600160a01b03168961ffff167f968b0d61ebcf43e5d76ed87bd2c4ee2f22b4969b9f4ca49e3373c025eddd5eeb8960008151811061312857613128614dc1565b602002602001015189600081518110612bf557612bf5614dc1565b600186511115612c8a578660405161315b919061537e565b6040518091039020896001600160a01b03168961ffff167fddd15f7cfbd674ac2096d598f1650367f8a8bd72b4e3abd85591099ea3b57e338989604051612c81929190615258565b6001600160a01b0384166131c95760405162461bcd60e51b8152600401610dd2906151c9565b3360006131d585612a67565b905060006131e285612a67565b905060008681526007602090815260408083206001600160a01b038c168452909152902054858110156132275760405162461bcd60e51b8152600401610dd29061520e565b60008781526007602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613266908490614e1d565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46120ce848a8a8a8a8a613998565b6000606060008060008661ffff166001600160401b038111156132eb576132eb614084565b6040519080825280601f01601f191660200182016040528015613315576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115613337578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff16815260200190815260200160002085604051613381919061537e565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906133de9087908790879087908790615421565b60405180910390a15050505050565b60006001600160e01b031982166319abbbbb60e11b148061101f57506301ffc9a760e01b6001600160e01b031983161461101f565b6001600160a01b0384163b156118b05760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906134669089908990889088908890600401615473565b6020604051808303816000875af19250505080156134a1575060408051601f3d908101601f1916820190925261349e918101906154b1565b60015b61354d576134ad6154ce565b806308c379a0036134e657506134c16154ea565b806134cc57506134e8565b8060405162461bcd60e51b8152600401610dd2919061401d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610dd2565b6001600160e01b0319811663bc197c8160e01b14610f865760405162461bcd60e51b8152600401610dd290615573565b6001600160a01b0384166135a35760405162461bcd60e51b8152600401610dd2906155bb565b3360006135af85612a67565b905060006135bc85612a67565b905060008681526007602090815260408083206001600160a01b038b168452909152812080548792906135f0908490614e1d565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610f8683600089898989613998565b606060005b82518110156136a35761367e613676848381518110611b3d57611b3d614dc1565b600101611a58565b83828151811061369057613690614dc1565b6020908102919091010152600101613655565b5090919050565b6136c583838360405180602001604052806000815250613a53565b50505050565b336001600160a01b038616148015906136eb57506136e98533610bbf565b155b156137095760405163365cccbb60e21b815260040160405180910390fd5b61116a858383613b9f565b600061371f83613d2c565b61ffff808716600090815260026020908152604080832093891683529290529081205491925090613751908490614e1d565b9050600081116137a35760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610dd2565b808210156118b05760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610dd2565b61ffff86166000908152600160205260408120805461381190614c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461383d90614c1c565b801561388a5780601f1061385f5761010080835404028352916020019161388a565b820191906000526020600020905b81548152906001019060200180831161386d57829003601f168201915b5050505050905080516000036138fb5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b6064820152608401610dd2565b613906878751613d88565b60405162c5803160e81b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063c580310090849061395d908b9086908c908c908c908c906004016155fc565b6000604051808303818588803b15801561397657600080fd5b505af115801561398a573d6000803e3d6000fd5b505050505050505050505050565b6001600160a01b0384163b156118b05760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906139dc9089908990889088908890600401615663565b6020604051808303816000875af1925050508015613a17575060408051601f3d908101601f19168201909252613a14918101906154b1565b60015b613a23576134ad6154ce565b6001600160e01b0319811663f23a6e6160e01b14610f865760405162461bcd60e51b8152600401610dd290615573565b6001600160a01b038416613a795760405162461bcd60e51b8152600401610dd2906155bb565b8151835114613a9a5760405162461bcd60e51b8152600401610dd290615181565b3360005b8451811015613b3757838181518110613ab957613ab9614dc1565b602002602001015160076000878481518110613ad757613ad7614dc1565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254613b1f9190614e1d565b90915550819050613b2f81614ded565b915050613a9e565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051613b88929190615258565b60405180910390a461116a81600087878787613422565b6001600160a01b038316613bc55760405162461bcd60e51b8152600401610dd29061539a565b8051825114613be65760405162461bcd60e51b8152600401610dd290615181565b604080516020810190915260009081905233905b8351811015613cbf576000848281518110613c1757613c17614dc1565b602002602001015190506000848381518110613c3557613c35614dc1565b60209081029190910181015160008481526007835260408082206001600160a01b038c168352909352919091205490915081811015613c865760405162461bcd60e51b8152600401610dd2906153dd565b60009283526007602090815260408085206001600160a01b038b1686529091529092209103905580613cb781614ded565b915050613bfa565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613d10929190615258565b60405180910390a46040805160208101909152600090526136c5565b6000602282511015613d805760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d73000000006044820152606401610dd2565b506022015190565b61ffff821660009081526003602052604081205490819003613da957506127105b808211156116f95760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c617267656044820152606401610dd2565b61ffff81168114611dca57600080fd5b8035613e1481613df9565b919050565b60008083601f840112613e2b57600080fd5b5081356001600160401b03811115613e4257600080fd5b602083019150836020828501011115613e5a57600080fd5b9250929050565b80356001600160401b0381168114613e1457600080fd5b60008060008060008060808789031215613e9157600080fd5b8635613e9c81613df9565b955060208701356001600160401b0380821115613eb857600080fd5b613ec48a838b01613e19565b9097509550859150613ed860408a01613e61565b94506060890135915080821115613eee57600080fd5b50613efb89828a01613e19565b979a9699509497509295939492505050565b6001600160a01b0381168114611dca57600080fd5b8035613e1481613f0d565b60008060408385031215613f4057600080fd5b8235613f4b81613f0d565b946020939093013593505050565b6001600160e01b031981168114611dca57600080fd5b600060208284031215613f8157600080fd5b8135611d6781613f59565b60008060208385031215613f9f57600080fd5b82356001600160401b03811115613fb557600080fd5b613fc185828601613e19565b90969095509350505050565b60005b83811015613fe8578181015183820152602001613fd0565b50506000910152565b60008151808452614009816020860160208601613fcd565b601f01601f19169290920160200192915050565b602081526000611d676020830184613ff1565b60006020828403121561404257600080fd5b8135611d6781613df9565b6000806040838503121561406057600080fd5b8235613f4b81613df9565b60006020828403121561407d57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156140bf576140bf614084565b6040525050565b60006001600160401b038211156140df576140df614084565b50601f01601f191660200190565b600082601f8301126140fe57600080fd5b8135614109816140c6565b604051614116828261409a565b82815285602084870101111561412b57600080fd5b82602086016020830137600092810160200192909252509392505050565b60006001600160401b0382111561416257614162614084565b5060051b60200190565b600082601f83011261417d57600080fd5b8135602061418a82614149565b604051614197828261409a565b83815260059390931b85018201928281019150868411156141b757600080fd5b8286015b848110156141d257803583529183019183016141bb565b509695505050505050565b80358015158114613e1457600080fd5b600080600080600080600060e0888a03121561420857600080fd5b61421188613e09565b965061421f60208901613e09565b955060408801356001600160401b038082111561423b57600080fd5b6142478b838c016140ed565b965060608a013591508082111561425d57600080fd5b6142698b838c0161416c565b955060808a013591508082111561427f57600080fd5b61428b8b838c0161416c565b945061429960a08b016141dd565b935060c08a01359150808211156142af57600080fd5b506142bc8a828b016140ed565b91505092959891949750929550565b600080600080600060a086880312156142e357600080fd5b85356142ee81613f0d565b945060208601356142fe81613f0d565b935060408601356001600160401b038082111561431a57600080fd5b61432689838a0161416c565b9450606088013591508082111561433c57600080fd5b61434889838a0161416c565b9350608088013591508082111561435e57600080fd5b5061436b888289016140ed565b9150509295509295909350565b60008060006040848603121561438d57600080fd5b833561439881613df9565b925060208401356001600160401b038111156143b357600080fd5b6143bf86828701613e19565b9497909650939450505050565b600080600080600080600080610100898b0312156143e957600080fd5b6143f289613f22565b975061440060208a01613e09565b965060408901356001600160401b038082111561441c57600080fd5b6144288c838d016140ed565b975060608b013591508082111561443e57600080fd5b61444a8c838d0161416c565b965060808b013591508082111561446057600080fd5b61446c8c838d0161416c565b955061447a60a08c01613f22565b945061448860c08c01613f22565b935060e08b013591508082111561449e57600080fd5b506144ab8b828c016140ed565b9150509295985092959890939650565b600080600080600080600080610100898b0312156144d857600080fd5b88356144e381613f0d565b975060208901356144f381613df9565b965060408901356001600160401b038082111561450f57600080fd5b61451b8c838d016140ed565b975060608b0135965060808b0135955060a08b0135915061453b82613f0d565b90935060c08a01359061454d82613f0d565b90925060e08a0135908082111561449e57600080fd5b6000806040838503121561457657600080fd5b82356001600160401b038082111561458d57600080fd5b818501915085601f8301126145a157600080fd5b813560206145ae82614149565b6040516145bb828261409a565b83815260059390931b85018201928281019150898411156145db57600080fd5b948201945b838610156146025785356145f381613f0d565b825294820194908201906145e0565b9650508601359250508082111561461857600080fd5b506146258582860161416c565b9150509250929050565b600081518084526020808501945080840160005b8381101561465f57815187529582019590820190600101614643565b509495945050505050565b602081526000611d67602083018461462f565b60006020828403121561468f57600080fd5b8135611d6781613f0d565b6000806000606084860312156146af57600080fd5b83356146ba81613f0d565b95602085013595506040909401359392505050565b6000806000606084860312156146e457600080fd5b83356146ef81613df9565b925060208401356001600160401b0381111561470a57600080fd5b614716868287016140ed565b92505061472560408501613e61565b90509250925092565b60008083601f84011261474057600080fd5b5081356001600160401b0381111561475757600080fd5b6020830191508360208260051b8501011115613e5a57600080fd5b6000806000806040858703121561478857600080fd5b84356001600160401b038082111561479f57600080fd5b6147ab8883890161472e565b909650945060208701359150808211156147c457600080fd5b506147d18782880161472e565b95989497509550505050565b600080600080600080600060e0888a0312156147f857600080fd5b873561480381613df9565b9650602088013561481381613df9565b955060408801356001600160401b038082111561482f57600080fd5b61483b8b838c016140ed565b965060608a0135955060808a0135945061429960a08b016141dd565b6000806040838503121561486a57600080fd5b82356001600160401b038082111561488157600080fd5b61488d8683870161416c565b9350602085013591508082111561461857600080fd5b60008060008060008060c087890312156148bc57600080fd5b86356148c781613df9565b955060208701356001600160401b03808211156148e357600080fd5b6148ef8a838b016140ed565b9650604089013595506060890135945061490b60808a016141dd565b935060a089013591508082111561492157600080fd5b5061492e89828a016140ed565b9150509295509295509295565b6000806040838503121561494e57600080fd5b823561495981613df9565b9150602083013561496981613df9565b809150509250929050565b6000806040838503121561498757600080fd5b823561499281613f0d565b91506149a0602084016141dd565b90509250929050565b60008060008060008060c087890312156149c257600080fd5b6149cb87613e09565b955060208701356001600160401b03808211156149e757600080fd5b6149f38a838b016140ed565b96506040890135915080821115614a0957600080fd5b614a158a838b0161416c565b95506060890135915080821115614a2b57600080fd5b614a378a838b0161416c565b945061490b60808a016141dd565b60008060408385031215614a5857600080fd5b50508035926020909101359150565b600080600080600060808688031215614a7f57600080fd5b8535614a8a81613df9565b94506020860135614a9a81613df9565b93506040860135925060608601356001600160401b03811115614abc57600080fd5b614ac888828901613e19565b969995985093965092949392505050565b600080600060608486031215614aee57600080fd5b8335614af981613df9565b92506020840135614b0981613df9565b929592945050506040919091013590565b60008060408385031215614b2d57600080fd5b8235614b3881613f0d565b9150602083013561496981613f0d565b600060208284031215614b5a57600080fd5b611d67826141dd565b600080600080600060a08688031215614b7b57600080fd5b8535614b8681613f0d565b94506020860135614b9681613f0d565b9350604086013592506060860135915060808601356001600160401b03811115614bbf57600080fd5b61436b888289016140ed565b60008060008060808587031215614be157600080fd5b8435614bec81613df9565b93506020850135614bfc81613df9565b92506040850135614c0c81613f0d565b9396929550929360600135925050565b600181811c90821680614c3057607f821691505b602082108103614c5057634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b61ffff85168152608060208201526000614c836080830186613ff1565b8281036040840152614c95818661462f565b90508281036060840152614ca9818561462f565b979650505050505050565b61ffff861681526001600160a01b038516602082015260a060408201819052600090614ce290830186613ff1565b84151560608401528281036080840152614cfc8185613ff1565b98975050505050505050565b60008060408385031215614d1b57600080fd5b505080516020909101519092909150565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff841681526040602082015260006126fc604083018486614d7a565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614dff57614dff614dd7565b5060010190565b808202811582820484141761101f5761101f614dd7565b8082018082111561101f5761101f614dd7565b8181038181111561101f5761101f614dd7565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b601f8211156116f957600081815260208120601f850160051c81016020861015614e905750805b601f850160051c820191505b818110156118b057828155600101614e9c565b81516001600160401b03811115614ec857614ec8614084565b614edc81614ed68454614c1c565b84614e69565b602080601f831160018114614f115760008415614ef95750858301515b600019600386901b1c1916600185901b1785556118b0565b600085815260208120601f198616915b82811015614f4057888601518255948401946001909101908401614f21565b5085821015614f5e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082614f8b57634e487b7160e01b600052601260045260246000fd5b500490565b600061ffff808816835280871660208401525084604083015260806060830152614ca9608083018486614d7a565b61ffff86168152608060208201526000614fdc608083018688614d7a565b6001600160401b0394909416604083015250606001529392505050565b6001600160401b0383111561501057615010614084565b6150248361501e8354614c1c565b83614e69565b6000601f84116001811461505857600085156150405750838201355b600019600387901b1c1916600186901b17835561116a565b600083815260209020601f19861690835b828110156150895786850135825560209485019460019092019101615069565b50868210156150a65760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600082601f8301126150c957600080fd5b81516150d4816140c6565b6040516150e1828261409a565b8281528560208487010111156150f657600080fd5b6126fc836020830160208801613fcd565b60006020828403121561511957600080fd5b81516001600160401b0381111561512f57600080fd5b61513b848285016150b8565b949350505050565b61ffff851681526080602082015260006151606080830186613ff1565b6001600160401b03851660408401528281036060840152614ca98185613ff1565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061526b604083018561462f565b82810360208401526126fc818561462f565b600082601f83011261528e57600080fd5b8151602061529b82614149565b6040516152a8828261409a565b83815260059390931b85018201928281019150868411156152c857600080fd5b8286015b848110156141d257805183529183019183016152cc565b600080600080608085870312156152f957600080fd5b845161530481613df9565b60208601519094506001600160401b038082111561532157600080fd5b61532d888389016150b8565b9450604087015191508082111561534357600080fd5b61534f8883890161527d565b9350606087015191508082111561536557600080fd5b506153728782880161527d565b91505092959194509250565b60008251615390818460208701613fcd565b9190910192915050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b61ffff8616815260a06020820152600061543e60a0830187613ff1565b6001600160401b0386166040840152828103606084015261545f8186613ff1565b90508281036080840152614cfc8185613ff1565b6001600160a01b0386811682528516602082015260a06040820181905260009061549f9083018661462f565b828103606084015261545f818661462f565b6000602082840312156154c357600080fd5b8151611d6781613f59565b600060033d11156154e75760046000803e5060005160e01c5b90565b600060443d10156154f85790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561552757505050505090565b828501915081518181111561553f5750505050505090565b843d87010160208285010111156155595750505050505090565b6155686020828601018761409a565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b61ffff8716815260c06020820152600061561960c0830188613ff1565b828103604084015261562b8188613ff1565b6001600160a01b0387811660608601528616608085015283810360a085015290506156568185613ff1565b9998505050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614ca990830184613ff156fe4b41494a55204f524947494e533a20546865204a6f75726e616c73206f662053746f64202d204361737365747465a26469706673582212200a028cf83a3143687e48ade23cdf78587b23725301cc61499fc3fa2c59efb49064736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c0a75e0b440000000000000000000000000000000000000000000000000000000000000000007697066733a2f2f00000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _uri (string): ipfs://
Arg [1] : _endpoint (address): 0x66A71Dcef29A0fFBDBE3c6a460a3B5BC225Cd675
Arg [2] : _maxPage (uint256): 5
Arg [3] : _totalChains (uint256): 5
Arg [4] : _tokenOffset (uint256): 0
Arg [5] : _price (uint256): 16900000000000000
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 000000000000000000000000000000000000000000000000003c0a75e0b44000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [7] : 697066733a2f2f00000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.