Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 4 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer* | 17708113 | 957 days ago | Contract Creation | 0 ETH | |||
| Transfer* | 17708106 | 957 days ago | Contract Creation | 0 ETH | |||
| 0x60c06040 | 17700067 | 958 days ago | Contract Creation | 0 ETH | |||
| Transfer* | 17662862 | 963 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OmniseaDropsRepository
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./OmniseaONFT721Psi.sol";
import "../interfaces/IOmniseaDropsRepository.sol";
import { CreateParams } from "../structs/erc721/ERC721Structs.sol";
contract OmniseaDropsRepository is IOmniseaDropsRepository {
address public dropsFactory;
address public dropsManager;
address public owner;
mapping(address => address[]) public userCollections;
mapping(address => bool) public collections;
constructor () {
owner = msg.sender;
}
function create(
CreateParams calldata _params,
address _creator
) external override {
require(msg.sender == dropsFactory);
OmniseaONFT721Psi collection = new OmniseaONFT721Psi(_params, _creator, dropsManager);
userCollections[_creator].push(address(collection));
collections[address(collection)] = true;
}
function getAllByUser(address user) external view returns (address[] memory) {
return userCollections[user];
}
function setFactory(address factory) external {
require(msg.sender == owner);
dropsFactory = factory;
}
function setManager(address factory) external {
require(msg.sender == owner);
dropsManager = factory;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "../interfaces/IOmniseaONFT721Psi.sol";
import "../interfaces/IOmniseaDropsScheduler.sol";
import "../interfaces/IERC2981Royalties.sol";
import "../onft/ONFT721Core.sol";
import {CreateParams, Phase} from "../structs/erc721/ERC721Structs.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../ERC721Psi/ERC721Psi.sol";
contract OmniseaONFT721Psi is ONFT721Core, IOmniseaONFT721Psi, ERC721Psi {
using Strings for uint256;
IOmniseaDropsScheduler private immutable _scheduler = IOmniseaDropsScheduler(0x6ef0871ed810f323eA516A77B0988353b667dfa4);
// Basic
uint24 public maxSupply;
string public collectionURI;
address public dropsManager;
bool public isZeroIndexed;
string public tokensURI;
uint256 endTime;
constructor(
CreateParams memory params,
address _owner,
address _dropsManagerAddress
) ERC721Psi(params.name, params.symbol) ONFT721Core(250000, address(0x66A71Dcef29A0fFBDBE3c6a460a3B5BC225Cd675)) {
dropsManager = _dropsManagerAddress;
tokensURI = params.tokensURI;
maxSupply = params.maxSupply;
collectionURI = params.uri;
isZeroIndexed = params.isZeroIndexed;
endTime = params.endTime;
_setNextTokenId(isZeroIndexed ? 0 : 1);
owner = _owner;
royaltyAmount = params.royaltyAmount;
}
function contractURI() public view returns (string memory) {
return string(abi.encodePacked("ipfs://", collectionURI));
}
function tokenURI(uint256 tokenId) public view returns (string memory) {
if (maxSupply == 0 || bytes(tokensURI).length == 0) {
return contractURI();
}
return string(abi.encodePacked("ipfs://", tokensURI, "/", tokenId.toString(), ".json"));
}
function mint(address _minter, uint24 _quantity, bytes32[] memory _merkleProof, uint8 _phaseId) external override nonReentrant {
require(msg.sender == dropsManager);
require(isAllowed(_minter, _quantity, _merkleProof, _phaseId), "!isAllowed");
_scheduler.increasePhaseMintedCount(_minter, _phaseId, _quantity);
_mint(_minter, _quantity);
}
function mintPrice(uint8 _phaseId) public view override returns (uint256) {
return _scheduler.mintPrice(_phaseId);
}
function getOwner() external view override returns (address) {
return owner;
}
function isAllowed(address _account, uint24 _quantity, bytes32[] memory _merkleProof, uint8 _phaseId) internal view returns (bool) {
require(block.timestamp < endTime);
uint256 _newTotalMinted = totalMinted() + _quantity;
if (maxSupply > 0) require(maxSupply >= _newTotalMinted);
return _scheduler.isAllowed(_account, _quantity, _merkleProof, _phaseId);
}
function setPhase(
uint8 _phaseId,
uint256 _from,
uint256 _to,
bytes32 _merkleRoot,
uint24 _maxPerAddress,
uint256 _price
) external onlyOwner {
_scheduler.setPhase(_phaseId, _from, _to, _merkleRoot, _maxPerAddress, _price);
}
function setTokensURI(string memory _uri) external onlyOwner {
require(block.timestamp < endTime);
tokensURI = _uri;
}
function preMintToTeam(uint256 _quantity) external onlyOwner {
require(block.timestamp < endTime);
if (maxSupply > 0) require(maxSupply >= totalMinted() + _quantity);
_safeMint(owner, _quantity);
}
function setTrustedRemoteAndLimits(
uint16 _remoteChainId,
bytes calldata _remoteAddress,
uint256 _dstChainIdToTransferGas,
uint256 _dstChainIdToBatchLimit
) external onlyOwner {
require(_dstChainIdToTransferGas > 0 && _dstChainIdToBatchLimit > 0);
dstChainIdToTransferGas[_remoteChainId] = _dstChainIdToTransferGas;
dstChainIdToBatchLimit[_remoteChainId] = _dstChainIdToBatchLimit;
trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));
emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);
}
function _startTokenId() internal view override returns (uint256) {
return isZeroIndexed ? 0 : 1;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Psi, ONFT721Core) returns (bool) {
return interfaceId == type(IOmniseaONFT721Psi).interfaceId || super.supportsInterface(interfaceId);
}
function _debitFrom(address _from, uint16, bytes memory, uint _tokenId) internal virtual override {
require(ownerOf(_tokenId) == _from);
require(_isApprovedOrOwner(_from, _tokenId));
transferFrom(_from, address(this), _tokenId);
}
function _creditTo(uint16, address _toAddress, uint _tokenId) internal virtual override {
require(_exists(_tokenId) && ownerOf(_tokenId) == address(this));
transferFrom(address(this), _toAddress, _tokenId);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import {CreateParams} from "../structs/erc721/ERC721Structs.sol";
interface IOmniseaDropsRepository {
function create(CreateParams calldata params, address creator) external;
function collections(address collection) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
struct CreateParams {
string name;
string symbol;
string uri;
string tokensURI;
uint24 maxSupply;
bool isZeroIndexed;
uint24 royaltyAmount;
uint256 endTime;
}
struct MintParams {
address collection;
uint24 quantity;
bytes32[] merkleProof;
uint8 phaseId;
}
struct OmnichainMintParams {
address collection;
uint24 quantity;
uint256 paid;
uint8 phaseId;
address minter;
}
struct Phase {
uint256 from;
uint256 to;
uint24 maxPerAddress;
uint256 price;
bytes32 merkleRoot;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IOmniseaONFT721Psi {
function mint(address minter, uint24 quantity, bytes32[] memory _merkleProof, uint8 _phaseId) external;
function mintPrice(uint8 _phaseId) external view returns (uint256);
function getOwner() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import {Phase} from "../structs/erc721/ERC721Structs.sol";
interface IOmniseaDropsScheduler {
function isAllowed(address _account, uint24 _quantity, bytes32[] memory _merkleProof, uint8 _phaseId) external view returns (bool);
function setPhase(
uint8 _phaseId,
uint256 _from,
uint256 _to,
bytes32 _merkleRoot,
uint24 _maxPerAddress,
uint256 _price
) external;
function increasePhaseMintedCount(address _account,uint8 _phaseId, uint24 _quantity) external;
function mintPrice(uint8 _phaseId) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC2981Royalties {
function royaltyInfo(uint256 _tokenId, uint256 _value) external view returns (address _receiver, uint256 _royaltyAmount);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IONFT721Core.sol";
import "../lzApp/NonblockingLzApp.sol";
import "../interfaces/IERC2981Royalties.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
abstract contract ONFT721Core is NonblockingLzApp, ERC165, ReentrancyGuard, IONFT721Core, IERC2981Royalties {
uint16 public constant FUNCTION_TYPE_SEND = 1;
uint private constant BP_DENOMINATOR = 10000;
uint16 public feeBp;
address internal revenueManager;
uint24 public royaltyAmount;
struct StoredCredit {
uint16 srcChainId;
address toAddress;
uint256 index;
bool creditsRemain;
}
uint256 public minGasToTransferAndStore; // min amount of gas required to transfer, and also store the payload
mapping(uint16 => uint256) public dstChainIdToBatchLimit;
mapping(uint16 => uint256) public dstChainIdToTransferGas; // per transfer amount of gas required to mint/transfer on the dst
mapping(bytes32 => StoredCredit) public storedCredits;
constructor(uint256 _minGasToTransferAndStore, address _lzEndpoint) NonblockingLzApp(_lzEndpoint) {
require(_minGasToTransferAndStore > 0);
minGasToTransferAndStore = _minGasToTransferAndStore;
revenueManager = address(0x61104fBe07ecc735D8d84422c7f045f8d29DBf15);
feeBp = 1000;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IERC2981Royalties).interfaceId
|| interfaceId == type(IONFT721Core).interfaceId
|| super.supportsInterface(interfaceId);
}
function estimateSendFee(uint16 _dstChainId, bytes memory _toAddress, uint _tokenId, bool _useZro, bytes memory _adapterParams) public view virtual override returns (uint nativeFee, uint zroFee) {
return estimateSendBatchFee(_dstChainId, _toAddress, _toSingletonArray(_tokenId), _useZro, _adapterParams);
}
function estimateSendBatchFee(uint16 _dstChainId, bytes memory _toAddress, uint[] memory _tokenIds, bool _useZro, bytes memory _adapterParams) public view virtual override returns (uint nativeFee, uint zroFee) {
bytes memory payload = abi.encode(_toAddress, _tokenIds);
(nativeFee, zroFee) = lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);
uint fee = nativeFee * feeBp / BP_DENOMINATOR;
nativeFee += fee;
}
function sendFrom(address _from, uint16 _dstChainId, bytes memory _toAddress, uint _tokenId, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) public payable virtual override {
_send(_from, _dstChainId, _toAddress, _toSingletonArray(_tokenId), _refundAddress, _zroPaymentAddress, _adapterParams);
}
function sendBatchFrom(address _from, uint16 _dstChainId, bytes memory _toAddress, uint[] memory _tokenIds, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) public payable virtual override {
_send(_from, _dstChainId, _toAddress, _tokenIds, _refundAddress, _zroPaymentAddress, _adapterParams);
}
function _send(address _from, uint16 _dstChainId, bytes memory _toAddress, uint[] memory _tokenIds, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) internal virtual {
require(_tokenIds.length > 0, "tokenIds[] is empty");
require(_tokenIds.length <= dstChainIdToBatchLimit[_dstChainId], "batch size exceeds dst batch limit");
for (uint i = 0; i < _tokenIds.length; i++) {
_debitFrom(_from, _dstChainId, _toAddress, _tokenIds[i]);
}
bytes memory payload = abi.encode(_toAddress, _tokenIds);
_checkGasLimit(_dstChainId, FUNCTION_TYPE_SEND, _adapterParams, dstChainIdToTransferGas[_dstChainId] * _tokenIds.length);
(uint nativeFee) = _payONFTFee(msg.value);
_lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams, nativeFee);
emit SendToChain(_dstChainId, _from, _toAddress, _tokenIds);
}
function _nonblockingLzReceive(
uint16 _srcChainId,
bytes memory _srcAddress,
uint64, /*_nonce*/
bytes memory _payload
) internal virtual override {
(bytes memory toAddressBytes, uint[] memory tokenIds) = abi.decode(_payload, (bytes, uint[]));
address toAddress;
assembly {
toAddress := mload(add(toAddressBytes, 20))
}
uint nextIndex = _creditTill(_srcChainId, toAddress, 0, tokenIds);
if (nextIndex < tokenIds.length) {
// not enough gas to complete transfers, store to be cleared in another tx
bytes32 hashedPayload = keccak256(_payload);
storedCredits[hashedPayload] = StoredCredit(_srcChainId, toAddress, nextIndex, true);
emit CreditStored(hashedPayload, _payload);
}
emit ReceiveFromChain(_srcChainId, _srcAddress, toAddress, tokenIds);
}
// Public function for anyone to clear and deliver the remaining batch sent tokenIds
function clearCredits(bytes memory _payload) external virtual nonReentrant {
bytes32 hashedPayload = keccak256(_payload);
require(storedCredits[hashedPayload].creditsRemain);
(,uint[] memory tokenIds) = abi.decode(_payload, (bytes, uint[]));
uint nextIndex = _creditTill(storedCredits[hashedPayload].srcChainId, storedCredits[hashedPayload].toAddress, storedCredits[hashedPayload].index, tokenIds);
require(nextIndex > storedCredits[hashedPayload].index);
if (nextIndex == tokenIds.length) {
// cleared the credits, delete the element
delete storedCredits[hashedPayload];
emit CreditCleared(hashedPayload);
} else {
// store the next index to mint
storedCredits[hashedPayload] = StoredCredit(storedCredits[hashedPayload].srcChainId, storedCredits[hashedPayload].toAddress, nextIndex, true);
}
}
// When a srcChain has the ability to transfer more chainIds in a single tx than the dst can do.
// Needs the ability to iterate and stop if the minGasToTransferAndStore is not met
function _creditTill(uint16 _srcChainId, address _toAddress, uint _startIndex, uint[] memory _tokenIds) internal returns (uint256){
uint i = _startIndex;
while (i < _tokenIds.length) {
// if not enough gas to process, store this index for next loop
if (gasleft() < minGasToTransferAndStore) break;
_creditTo(_srcChainId, _toAddress, _tokenIds[i]);
i++;
}
// indicates the next index to send of tokenIds,
// if i == tokenIds.length, we are finished
return i;
}
function setMinGasToTransferAndStore(uint256 _minGasToTransferAndStore) external onlyOwner {
require(_minGasToTransferAndStore > 0);
minGasToTransferAndStore = _minGasToTransferAndStore;
}
// ensures enough gas in adapter params to handle batch transfer gas amounts on the dst
function setDstChainIdToTransferGas(uint16 _dstChainId, uint256 _dstChainIdToTransferGas) external onlyOwner {
require(_dstChainIdToTransferGas > 0);
dstChainIdToTransferGas[_dstChainId] = _dstChainIdToTransferGas;
}
// limit on src the amount of tokens to batch send
function setDstChainIdToBatchLimit(uint16 _dstChainId, uint256 _dstChainIdToBatchLimit) external onlyOwner {
require(_dstChainIdToBatchLimit > 0);
dstChainIdToBatchLimit[_dstChainId] = _dstChainIdToBatchLimit;
}
function setRevenueManager(address _manager) external {
require(msg.sender == revenueManager);
revenueManager = _manager;
}
function setFeeBp(uint16 _feeBp) public virtual {
require(msg.sender == revenueManager);
require(_feeBp <= BP_DENOMINATOR);
feeBp = _feeBp;
}
function _payONFTFee(uint _nativeFee) internal virtual returns (uint amount) {
uint fee = _nativeFee * feeBp / BP_DENOMINATOR;
amount = _nativeFee - fee;
if (fee > 0) {
(bool p,) = payable(revenueManager).call{value : (fee)}("");
require(p, "!fee");
}
}
function royaltyInfo(uint256, uint256 value) external view returns (address _receiver, uint256 _royaltyAmount) {
_receiver = owner;
_royaltyAmount = (value * royaltyAmount) / 10000;
}
function setRoyaltyAmount(uint24 _amount) external onlyOwner {
royaltyAmount = _amount;
}
function transferOwnership(address _owner) external onlyOwner {
owner = _owner;
}
function _debitFrom(address _from, uint16 _dstChainId, bytes memory _toAddress, uint _tokenId) internal virtual;
function _creditTo(uint16 _srcChainId, address _toAddress, uint _tokenId) 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: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
}// SPDX-License-Identifier: MIT
/**
______ _____ _____ ______ ___ __ _ _ _
| ____| __ \ / ____|____ |__ \/_ | || || |
| |__ | |__) | | / / ) || | \| |/ |
| __| | _ /| | / / / / | |\_ _/
| |____| | \ \| |____ / / / /_ | | | |
|______|_| \_\\_____|/_/ |____||_| |_|
- github: https://github.com/estarriolvetch/ERC721Psi
- npm: https://www.npmjs.com/package/erc721psi
*/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./solidity-bits/BitMaps.sol";
contract ERC721Psi is ERC165, IERC721 {
using Strings for uint256;
using BitMaps for BitMaps.BitMap;
BitMaps.BitMap private _batchHead;
string private _name;
string private _symbol;
mapping(uint256 => address) internal _owners;
uint256 private _currentIndex;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
function _setNextTokenId(uint256 _index) internal virtual {
require(_currentIndex == 0);
_currentIndex = _index;
}
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
function totalMinted() public view virtual returns (uint256) {
return _currentIndex - _startTokenId();
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner)
public
view
virtual
override
returns (uint)
{
require(owner != address(0), "ERC721Psi: balance query for the zero address");
uint count;
for( uint i = _startTokenId(); i < _nextTokenId(); ++i ){
if(_exists(i)){
if( owner == ownerOf(i)){
++count;
}
}
}
return count;
}
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
(address owner, ) = _ownerAndBatchHeadOf(tokenId);
return owner;
}
function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){
require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token");
tokenIdBatchHead = _getBatchHead(tokenId);
owner = _owners[tokenIdBatchHead];
}
function name() public view virtual returns (string memory) {
return _name;
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721Psi: approval to current owner");
require(
msg.sender == owner || isApprovedForAll(owner, msg.sender),
"ERC721Psi: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721Psi: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(operator != msg.sender, "ERC721Psi: approve to caller");
_operatorApprovals[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721Psi: transfer caller is not owner nor approved"
);
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721Psi: transfer caller is not owner nor approved"
);
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, 1,_data),
"ERC721Psi: transfer to non ERC721Receiver implementer"
);
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return tokenId < _nextTokenId() && _startTokenId() <= tokenId;
}
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(
_exists(tokenId),
"ERC721Psi: operator query for nonexistent token"
);
address owner = ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, "");
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
uint256 nextTokenId = _nextTokenId();
_mint(to, quantity);
require(
_checkOnERC721Received(address(0), to, nextTokenId, quantity, _data),
"ERC721Psi: transfer to non ERC721Receiver implementer"
);
}
function _mint(
address to,
uint256 quantity
) internal virtual {
uint256 nextTokenId = _nextTokenId();
require(quantity > 0, "ERC721Psi: quantity must be greater 0");
require(to != address(0), "ERC721Psi: mint to the zero address");
_beforeTokenTransfers(address(0), to, nextTokenId, quantity);
_currentIndex += quantity;
_owners[nextTokenId] = to;
_batchHead.set(nextTokenId);
uint256 toMasked;
uint256 end = nextTokenId + quantity;
assembly {
toMasked := and(to, _BITMASK_ADDRESS)
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
0,
toMasked,
nextTokenId
)
for {
let tokenId := add(nextTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
_afterTokenTransfers(address(0), to, nextTokenId, quantity);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
(address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId);
require(
owner == from,
"ERC721Psi: transfer of token that is not own"
);
require(to != address(0), "ERC721Psi: transfer to the zero address");
_beforeTokenTransfers(from, to, tokenId, 1);
_approve(address(0), tokenId);
uint256 subsequentTokenId = tokenId + 1;
if(!_batchHead.get(subsequentTokenId) &&
subsequentTokenId < _nextTokenId()
) {
_owners[subsequentTokenId] = from;
_batchHead.set(subsequentTokenId);
}
_owners[tokenId] = to;
if(tokenId != tokenIdBatchHead) {
_batchHead.set(tokenId);
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ownerOf(tokenId), to, tokenId);
}
function _checkOnERC721Received(
address from,
address to,
uint256 startTokenId,
uint256 quantity,
bytes memory _data
) private returns (bool r) {
if (isContract(to)) {
r = true;
for(uint256 tokenId = startTokenId; tokenId < startTokenId + quantity; tokenId++){
try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data) returns (bytes4 retval) {
r = r && retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721Psi: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
return r;
} else {
return true;
}
}
function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) {
tokenIdBatchHead = _batchHead.scanForward(tokenId);
}
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function totalSupply() public virtual view returns (uint256) {
return totalMinted();
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @dev Interface of the ONFT Core standard
*/
interface IONFT721Core is IERC165 {
/**
* @dev Emitted when `_tokenIds[]` are moved from the `_sender` to (`_dstChainId`, `_toAddress`)
* `_nonce` is the outbound nonce from
*/
event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes indexed _toAddress, uint[] _tokenIds);
event ReceiveFromChain(uint16 indexed _srcChainId, bytes indexed _srcAddress, address indexed _toAddress, uint[] _tokenIds);
/**
* @dev Emitted when `_payload` was received from lz, but not enough gas to deliver all tokenIds
*/
event CreditStored(bytes32 _hashedPayload, bytes _payload);
/**
* @dev Emitted when `_hashedPayload` has been completely delivered
*/
event CreditCleared(bytes32 _hashedPayload);
event CallONFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, address indexed _receiver);
/**
* @dev send token `_tokenId` to (`_dstChainId`, `_toAddress`) from `_from`
* `_toAddress` can be any size depending on the `dstChainId`.
* `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)
* `_adapterParams` is a flexible bytes array to indicate messaging adapter services
*/
function sendFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint _tokenId, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;
/**
* @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)
* _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
* _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, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee);
/**
* @dev send tokens `_tokenIds[]` to (`_dstChainId`, `_toAddress`) from `_from`
* `_toAddress` can be any size depending on the `dstChainId`.
* `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)
* `_adapterParams` is a flexible bytes array to indicate messaging adapter services
*/
function sendBatchFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint[] calldata _tokenIds, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;
/**
* @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)
* _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
* _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, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./LzApp.sol";
import "../util/ExcessivelySafeCall.sol";
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);
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));
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 {
require(msg.sender == address(this), "NonblockingLzApp: caller must be LzApp");
_nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
}
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 {
bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];
require(payloadHash != bytes32(0), "NonblockingLzApp: no stored message");
require(keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload");
failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);
_nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);
}
}// 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 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../interfaces/ILayerZeroReceiver.sol";
import "../interfaces/ILayerZeroUserApplicationConfig.sol";
import "../interfaces/ILayerZeroEndpoint.sol";
import "../util/BytesLib.sol";
abstract contract LzApp is ILayerZeroReceiver, ILayerZeroUserApplicationConfig {
uint constant public DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;
ILayerZeroEndpoint public immutable lzEndpoint;
mapping(uint16 => bytes) public trustedRemoteLookup;
mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;
address public owner;
event SetTrustedRemote(uint16 _remoteChainId, bytes _path);
event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);
event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);
modifier onlyOwner {
require(msg.sender == owner, "LzApp: caller is not the owner");
_;
}
constructor(address _endpoint) {
lzEndpoint = ILayerZeroEndpoint(_endpoint);
owner = msg.sender;
}
function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual override {
require(msg.sender == address(lzEndpoint), "LzApp: invalid endpoint caller");
bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];
require(_srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote), "LzApp: invalid source sending contract");
_blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
}
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");
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 getConfig(uint16 _version, uint16 _chainId, address, uint _configType) external view returns (bytes memory) {
return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);
}
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);
}
function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {
trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));
emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);
}
function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {
require(_minGas > 0);
minDstGasLookup[_dstChainId][_packetType] = _minGas;
emit SetMinDstGas(_dstChainId, _packetType, _minGas);
}
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 OR Apache-2.0
pragma solidity >=0.7.6;
library ExcessivelySafeCall {
uint256 constant LOW_28_MASK =
0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
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);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface ILayerZeroReceiver {
function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface ILayerZeroUserApplicationConfig {
function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;
function setSendVersion(uint16 _version) external;
function setReceiveVersion(uint16 _version) external;
function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
import "./ILayerZeroUserApplicationConfig.sol";
interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {
function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;
function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external;
function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);
function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);
function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);
function getChainId() external view returns (uint16);
function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;
function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);
function getSendLibraryAddress(address _userApplication) external view returns (address);
function getReceiveLibraryAddress(address _userApplication) external view returns (address);
function isSendingPayload() external view returns (bool);
function isReceivingPayload() external view returns (bool);
function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);
function getSendVersion(address _userApplication) external view returns (uint16);
function getReceiveVersion(address _userApplication) external view returns (uint16);
}// SPDX-License-Identifier: Unlicense
/*
* @title Solidity Bytes Arrays Utils
* @author Gonçalo Sá <goncalo.sa@consensys.net>
*
* @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 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 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 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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
/**
_____ ___ ___ __ ____ _ __
/ ___/____ / (_)___/ (_) /___ __ / __ )(_) /______
\__ \/ __ \/ / / __ / / __/ / / / / __ / / __/ ___/
___/ / /_/ / / / /_/ / / /_/ /_/ / / /_/ / / /_(__ )
/____/\____/_/_/\__,_/_/\__/\__, / /_____/_/\__/____/
/____/
- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits
*/
pragma solidity ^0.8.0;
import "./BitScan.sol";
library BitMaps {
using BitScan for uint256;
uint256 private constant MASK_INDEX_ZERO = (1 << 255);
uint256 private constant MASK_FULL = type(uint256).max;
struct BitMap {
mapping(uint256 => uint256) _data;
}
function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
uint256 bucket = index >> 8;
uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
return bitmap._data[bucket] & mask != 0;
}
function set(BitMap storage bitmap, uint256 index) internal {
uint256 bucket = index >> 8;
uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
bitmap._data[bucket] |= mask;
}
function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
uint256 bucket = index >> 8;
// index within the bucket
uint256 bucketIndex = (index & 0xff);
// load a bitboard from the bitmap.
uint256 bb = bitmap._data[bucket];
// offset the bitboard to scan from `bucketIndex`.
bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
if(bb > 0) {
unchecked {
setBitIndex = (bucket << 8) | (bucketIndex - bb.bitScanForward256());
}
} else {
while(true) {
require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
unchecked {
bucket--;
}
// No offset. Always scan from the least significiant bit now.
bb = bitmap._data[bucket];
if(bb > 0) {
unchecked {
setBitIndex = (bucket << 8) | (255 - bb.bitScanForward256());
break;
}
}
}
}
}
}// SPDX-License-Identifier: MIT
/**
_____ ___ ___ __ ____ _ __
/ ___/____ / (_)___/ (_) /___ __ / __ )(_) /______
\__ \/ __ \/ / / __ / / __/ / / / / __ / / __/ ___/
___/ / /_/ / / / /_/ / / /_/ /_/ / / /_/ / / /_(__ )
/____/\____/_/_/\__,_/_/\__/\__, / /_____/_/\__/____/
/____/
- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits
*/
pragma solidity ^0.8.0;
library BitScan {
uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";
/**
@dev Isolate the least significant set bit.
*/
function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
require(bb > 0);
unchecked {
return bb & (0 - bb);
}
}
/**
@dev Isolate the most significant set bit.
*/
function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
require(bb > 0);
unchecked {
bb |= bb >> 128;
bb |= bb >> 64;
bb |= bb >> 32;
bb |= bb >> 16;
bb |= bb >> 8;
bb |= bb >> 4;
bb |= bb >> 2;
bb |= bb >> 1;
return (bb >> 1) + 1;
}
}
/**
@dev Find the index of the lest significant set bit. (trailing zero count)
*/
function bitScanForward256(uint256 bb) pure internal returns (uint8) {
unchecked {
return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
}
}
/**
@dev Find the index of the most significant set bit.
*/
function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
unchecked {
return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
}
}
function log2(uint256 bb) pure internal returns (uint8) {
unchecked {
return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
}
}
}{
"optimizer": {
"enabled": true,
"runs": 1
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collections","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"string","name":"tokensURI","type":"string"},{"internalType":"uint24","name":"maxSupply","type":"uint24"},{"internalType":"bool","name":"isZeroIndexed","type":"bool"},{"internalType":"uint24","name":"royaltyAmount","type":"uint24"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"internalType":"struct CreateParams","name":"_params","type":"tuple"},{"internalType":"address","name":"_creator","type":"address"}],"name":"create","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dropsFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dropsManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getAllByUser","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"}],"name":"setFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userCollections","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50600280546001600160a01b03191633179055615dcc806100326000396000f3fe60806040523480156200001157600080fd5b50600436106200008e5760003560e01c8063428a6171146200009357806343add2e614620000c75780635945f1c614620000fe5780635996c9c614620001125780635bb4780814620001385780638da5cb5b1462000151578063d0ebdbe71462000165578063d72822bb146200017c578063db2c21601462000190575b600080fd5b620000aa620000a4366004620003b7565b620001a7565b6040516001600160a01b0390911681526020015b60405180910390f35b620000ed620000d8366004620003f1565b60046020526000908152604090205460ff1681565b6040519015158152602001620000be565b600054620000aa906001600160a01b031681565b6200012962000123366004620003f1565b620001e0565b604051620000be919062000416565b6200014f62000149366004620003f1565b62000258565b005b600254620000aa906001600160a01b031681565b6200014f62000176366004620003f1565b62000292565b600154620000aa906001600160a01b031681565b6200014f620001a136600462000465565b620002cc565b60036020528160005260406000208181548110620001c457600080fd5b6000918252602090912001546001600160a01b03169150829050565b6001600160a01b0381166000908152600360209081526040918290208054835181840281018401909452808452606093928301828280156200024c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116200022d575b50505050509050919050565b6002546001600160a01b031633146200027057600080fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163314620002aa57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314620002e457600080fd5b600154604051600091849184916001600160a01b03169062000306906200038c565b62000314939291906200055a565b604051809103906000f08015801562000331573d6000803e3d6000fd5b506001600160a01b0392831660009081526003602090815260408083208054600180820183559185528385200180546001600160a01b031916959097169485179096559282526004905220805460ff19169092179091555050565b61570b806200068c83390190565b80356001600160a01b0381168114620003b257600080fd5b919050565b60008060408385031215620003cb57600080fd5b620003d6836200039a565b946020939093013593505050565b6001600160a01b03169052565b6000602082840312156200040457600080fd5b6200040f826200039a565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015620004595783516001600160a01b03168352928401929184019160010162000432565b50909695505050505050565b600080604083850312156200047957600080fd5b82356001600160401b038111156200049057600080fd5b83016101008186031215620004a457600080fd5b9150620004b4602084016200039a565b90509250929050565b6000808335601e19843603018112620004d557600080fd5b83016020810192503590506001600160401b03811115620004f557600080fd5b8036038313156200050557600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b803562ffffff81168114620003b257600080fd5b80358015158114620003b257600080fd5b6060815260006200056c8586620004bd565b61010080606086015262000586610160860183856200050c565b9250620005976020890189620004bd565b9250605f1980878603016080880152620005b38585846200050c565b9450620005c460408b018b620004bd565b94509150808786030160a0880152620005df8585846200050c565b9450620005f060608b018b620004bd565b94509150808786030160c0880152506200060c8484836200050c565b9350506200061d6080890162000535565b62ffffff811660e087015291506200063860a0890162000549565b151590850152506200064d60c0870162000535565b62ffffff1661012084015260e08601356101408401529050620006746020830185620003e4565b620006836040830184620003e4565b94935050505056fe60c0604052736ef0871ed810f323ea516a77b0988353b667dfa460a0523480156200002957600080fd5b506040516200570b3803806200570b8339810160408190526200004c91620003ef565b825160208401517366a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756080819052600280546001600160a01b0319163317905560016004556203d0909050600655600580546001600160b01b0319167561104fbe07ecc735d8d84422c7f045f8d29dbf1503e81790558151620000ca90600b906020850190620001fd565b508051620000e090600c906020840190620001fd565b5050601380546001600160a01b0319166001600160a01b03841617905550606083015180516200011991601491602090910190620001fd565b5060808301516011805462ffffff191662ffffff909216919091179055604083015180516200015191601291602090910190620001fd565b5060a08301516013805460ff60a01b1916600160a01b9215158302179081905560e08501516015556200019c9160ff9104166200019057600162000193565b60005b60ff16620001ea565b50600280546001600160a01b039092166001600160a01b031990921691909117905560c001516005805462ffffff909216600160b01b0262ffffff60b01b1990921691909117905562000580565b600e5415620001f857600080fd5b600e55565b8280546200020b9062000543565b90600052602060002090601f0160209004810192826200022f57600085556200027a565b82601f106200024a57805160ff19168380011785556200027a565b828001600101855582156200027a579182015b828111156200027a5782518255916020019190600101906200025d565b50620002889291506200028c565b5090565b5b808211156200028857600081556001016200028d565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715620002df57620002df620002a3565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620003105762000310620002a3565b604052919050565b600082601f8301126200032a57600080fd5b81516001600160401b03811115620003465762000346620002a3565b60206200035c601f8301601f19168201620002e5565b82815285828487010111156200037157600080fd5b60005b838110156200039157858101830151828201840152820162000374565b83811115620003a35760008385840101525b5095945050505050565b805162ffffff81168114620003c157600080fd5b919050565b80518015158114620003c157600080fd5b80516001600160a01b0381168114620003c157600080fd5b6000806000606084860312156200040557600080fd5b83516001600160401b03808211156200041d57600080fd5b9085019061010082880312156200043357600080fd5b6200043d620002b9565b8251828111156200044d57600080fd5b6200045b8982860162000318565b8252506020830151828111156200047157600080fd5b6200047f8982860162000318565b6020830152506040830151828111156200049857600080fd5b620004a68982860162000318565b604083015250606083015182811115620004bf57600080fd5b620004cd8982860162000318565b606083015250620004e160808401620003ad565b6080820152620004f460a08401620003c6565b60a08201526200050760c08401620003ad565b60c082015260e083015160e08201528095505050506200052a60208501620003d7565b91506200053a60408501620003d7565b90509250925092565b600181811c908216806200055857607f821691505b602082108114156200057a57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a051615118620005f3600039600081816118a401528181611f9701528181612390015261306201526000818161098001528181610bf001528181610f160152818161119e0152818161147a01528181611e6a01528181612469015281816125b3015261371301526151186000f3fe6080604052600436106102dd5760003560e01c80621d3567146102e257806301ffc9a71461030457806306fdde031461033957806307e0db171461035b578063081812fc1461037b578063095ea7b3146103b35780630b4cad4c146103d357806310ddb137146103f357806318160ddd1461041357806322a3ecf91461043657806323b872dd146104b95780632a205e3d146104d95780632a55205a1461050e5780632dd0066e1461054d5780632e4a33cb146105625780633d8b38f61461058257806342842e0e146105a257806342d65a8d146105c257806346a43816146105e257806348288190146106025780634ac3f4ff14610618578063519056361461064557806352a284a2146106585780635b8c41e6146106785780636352211e146106c757806366ad5c8a146106e75780636da7870b1461070757806370a08231146107275780637533d788146107475780637c6e551d146107675780638147ef371461079e578063893d20e8146107be5780638cfd8f5c146107dc5780638da5cb5b146108145780638ffa1f2a1461083457806395d89b41146108545780639ea5d6b114610869578063a22cb46514610889578063a2309ff8146108a9578063a5097ebf146108be578063a6c3d165146108d3578063a7e0d43d146108f3578063ab3ffb9314610913578063af3fb21c14610926578063b19ab2451461094e578063b353aaa71461096e578063b88d4fde146109a2578063c4461834146109c2578063c4ed6f58146109d8578063c87b56dd146109f3578063cbed8b9c14610a13578063d112fe3314610a33578063d12473a514610a53578063d1deba1f14610a73578063d5abeb0114610a86578063d72822bb14610aa2578063df2a5b3b14610ac2578063e8a3d48514610ae2578063e9038e1f14610af7578063e985e9c514610b17578063efc585ad14610b37578063f235364114610b58578063f2fde38b14610b78578063f5ecbdbc14610b98578063fa25f9b614610bb8575b600080fd5b3480156102ee57600080fd5b506103026102fd366004613c20565b610be5565b005b34801561031057600080fd5b5061032461031f366004613cc9565b610e16565b60405190151581526020015b60405180910390f35b34801561034557600080fd5b5061034e610e41565b6040516103309190613d45565b34801561036757600080fd5b50610302610376366004613d58565b610ed3565b34801561038757600080fd5b5061039b610396366004613d73565b610f7e565b6040516001600160a01b039091168152602001610330565b3480156103bf57600080fd5b506103026103ce366004613dac565b611009565b3480156103df57600080fd5b506103026103ee366004613d73565b61111f565b3480156103ff57600080fd5b5061030261040e366004613d58565b61115b565b34801561041f57600080fd5b506104286111d5565b604051908152602001610330565b34801561044257600080fd5b5061048a610451366004613d73565b60096020526000908152604090208054600182015460029092015461ffff821692620100009092046001600160a01b0316919060ff1684565b6040805161ffff90951685526001600160a01b0390931660208501529183015215156060820152608001610330565b3480156104c557600080fd5b506103026104d4366004613dd8565b6111e4565b3480156104e557600080fd5b506104f96104f4366004613ef2565b611215565b60408051928352602083019190915201610330565b34801561051a57600080fd5b5061052e610529366004613f84565b61123b565b604080516001600160a01b039093168352602083019190915201610330565b34801561055957600080fd5b5061034e61127d565b34801561056e57600080fd5b5061030261057d366004613fa6565b61130b565b34801561058e57600080fd5b5061032461059d366004613fc3565b611352565b3480156105ae57600080fd5b506103026105bd366004613dd8565b61141e565b3480156105ce57600080fd5b506103026105dd366004613fc3565b611439565b3480156105ee57600080fd5b506103026105fd366004614015565b6114e1565b34801561060e57600080fd5b5061042860065481565b34801561062457600080fd5b50610428610633366004613d58565b60076020526000908152604090205481565b610302610653366004614079565b6115be565b34801561066457600080fd5b50610302610673366004614145565b6115d5565b34801561068457600080fd5b50610428610693366004614160565b6003602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156106d357600080fd5b5061039b6106e2366004613d73565b611623565b3480156106f357600080fd5b50610302610702366004613c20565b611637565b34801561071357600080fd5b50610302610722366004613d73565b611713565b34801561073357600080fd5b50610428610742366004613fa6565b611797565b34801561075357600080fd5b5061034e610762366004613d58565b611870565b34801561077357600080fd5b5060055461078a90600160b01b900462ffffff1681565b60405162ffffff9091168152602001610330565b3480156107aa57600080fd5b506104286107b93660046141ce565b611889565b3480156107ca57600080fd5b506002546001600160a01b031661039b565b3480156107e857600080fd5b506104286107f73660046141e9565b600160209081526000928352604080842090915290825290205481565b34801561082057600080fd5b5060025461039b906001600160a01b031681565b34801561084057600080fd5b5061030261084f366004614213565b611926565b34801561086057600080fd5b5061034e611b03565b34801561087557600080fd5b50610302610884366004614247565b611b12565b34801561089557600080fd5b506103026108a4366004614263565b611b60565b3480156108b557600080fd5b50610428611c24565b3480156108ca57600080fd5b5061034e611c3b565b3480156108df57600080fd5b506103026108ee366004613fc3565b611c48565b3480156108ff57600080fd5b5061030261090e366004613d58565b611ce9565b610302610921366004614325565b611d31565b34801561093257600080fd5b5061093b600181565b60405161ffff9091168152602001610330565b34801561095a57600080fd5b506103026109693660046143da565b611d40565b34801561097a57600080fd5b5061039b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156109ae57600080fd5b506103026109bd366004614422565b611d8f565b3480156109ce57600080fd5b5061042861271081565b3480156109e457600080fd5b5060055461093b9061ffff1681565b3480156109ff57600080fd5b5061034e610a0e366004613d73565b611dc7565b348015610a1f57600080fd5b50610302610a2e36600461448d565b611e29565b348015610a3f57600080fd5b50610302610a4e3660046144fb565b611ee0565b348015610a5f57600080fd5b50610302610a6e366004614247565b612002565b610302610a81366004613c20565b612050565b348015610a9257600080fd5b5060115461078a9062ffffff1681565b348015610aae57600080fd5b5060135461039b906001600160a01b031681565b348015610ace57600080fd5b50610302610add3660046145c1565b612266565b348015610aee57600080fd5b5061034e6122ff565b348015610b0357600080fd5b50610302610b123660046145fd565b612327565b348015610b2357600080fd5b50610324610b32366004614655565b6123fc565b348015610b4357600080fd5b5060135461032490600160a01b900460ff1681565b348015610b6457600080fd5b506104f9610b73366004614683565b61242a565b348015610b8457600080fd5b50610302610b93366004613fa6565b612536565b348015610ba457600080fd5b5061034e610bb3366004614700565b612582565b348015610bc457600080fd5b50610428610bd3366004613d58565b60086020526000908152604090205481565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c625760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff861660009081526020819052604081208054610c809061474d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cac9061474d565b8015610cf95780601f10610cce57610100808354040283529160200191610cf9565b820191906000526020600020905b815481529060010190602001808311610cdc57829003601f168201915b50505050509050805186869050148015610d14575060008151115b8015610d3c575080516020820120604051610d329088908890614782565b6040518091039020145b610d975760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610c59565b610e0d8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061264292505050565b50505050505050565b60006001600160e01b0319821663365a0c7b60e21b1480610e3b5750610e3b826126bb565b92915050565b6060600b8054610e509061474d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e7c9061474d565b8015610ec95780601f10610e9e57610100808354040283529160200191610ec9565b820191906000526020600020905b815481529060010190602001808311610eac57829003601f168201915b5050505050905090565b6002546001600160a01b03163314610efd5760405162461bcd60e51b8152600401610c5990614792565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906307e0db17906024015b600060405180830381600087803b158015610f6357600080fd5b505af1158015610f77573d6000803e3d6000fd5b5050505050565b6000610f89826126e0565b610fed5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c59565b506000908152600f60205260409020546001600160a01b031690565b600061101482611623565b9050806001600160a01b0316836001600160a01b031614156110845760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610c59565b336001600160a01b03821614806110a057506110a081336123fc565b6111105760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527a081bdddb995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b602a1b6064820152608401610c59565b61111a8383612705565b505050565b6002546001600160a01b031633146111495760405162461bcd60e51b8152600401610c5990614792565b6000811161115657600080fd5b600655565b6002546001600160a01b031633146111855760405162461bcd60e51b8152600401610c5990614792565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906310ddb13790602401610f49565b60006111df611c24565b905090565b6111ee3382612773565b61120a5760405162461bcd60e51b8152600401610c59906147c9565b61111a838383612840565b60008061122d878761122688612a18565b878761242a565b915091509550959350505050565b6002546005546001600160a01b03909116906000906127109061126a90600160b01b900462ffffff1685614833565b6112749190614868565b90509250929050565b6014805461128a9061474d565b80601f01602080910402602001604051908101604052809291908181526020018280546112b69061474d565b80156113035780601f106112d857610100808354040283529160200191611303565b820191906000526020600020905b8154815290600101906020018083116112e657829003601f168201915b505050505081565b6005546201000090046001600160a01b0316331461132857600080fd5b600580546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b61ffff8316600090815260208190526040812080548291906113739061474d565b80601f016020809104026020016040519081016040528092919081815260200182805461139f9061474d565b80156113ec5780601f106113c1576101008083540402835291602001916113ec565b820191906000526020600020905b8154815290600101906020018083116113cf57829003601f168201915b505050505090508383604051611403929190614782565b60405180910390208180519060200120149150509392505050565b61111a83838360405180602001604052806000815250611d8f565b6002546001600160a01b031633146114635760405162461bcd60e51b8152600401610c5990614792565b6040516342d65a8d60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342d65a8d906114b3908690869086906004016148a5565b600060405180830381600087803b1580156114cd57600080fd5b505af1158015610e0d573d6000803e3d6000fd5b6002546001600160a01b0316331461150b5760405162461bcd60e51b8152600401610c5990614792565b60008211801561151b5750600081115b61152457600080fd5b61ffff851660009081526008602090815260408083208590556007825291829020839055905161155a91869186913091016148c3565b60408051601f1981840301815291815261ffff871660009081526020818152919020825161158d93919290910190613b11565b50600080516020614fa38339815191528585856040516115af939291906148a5565b60405180910390a15050505050565b610e0d8787876115cd88612a18565b878787612a63565b6002546001600160a01b031633146115ff5760405162461bcd60e51b8152600401610c5990614792565b6005805462ffffff909216600160b01b0262ffffff60b01b19909216919091179055565b60008061162f83612c39565b509392505050565b3330146116955760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610c59565b61170b8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f890181900481028201810190925287815289935091508790879081908401838280828437600092019190915250612cd092505050565b505050505050565b6002546001600160a01b0316331461173d5760405162461bcd60e51b8152600401610c5990614792565b601554421061174b57600080fd5b60115462ffffff161561177e5780611761611c24565b61176b91906148e4565b60115462ffffff16101561177e57600080fd5b600254611794906001600160a01b031682612e39565b50565b60006001600160a01b0382166118055760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610c59565b600080611810612e53565b90505b600e5481101561186957611826816126e0565b156118595761183481611623565b6001600160a01b0316846001600160a01b0316141561185957611856826148fc565b91505b611862816148fc565b9050611813565b5092915050565b6000602081905290815260409020805461128a9061474d565b604051638147ef3760e01b815260ff821660048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638147ef379060240160206040518083038186803b1580156118ee57600080fd5b505afa158015611902573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3b9190614917565b600260045414156119495760405162461bcd60e51b8152600401610c5990614930565b6002600481905581516020808401919091206000818152600990925260409091209091015460ff1661197a57600080fd5b60008280602001905181019061199091906149ac565b600084815260096020526040812080546001909101549294509092506119cc9161ffff8216916201000090046001600160a01b03169085612e79565b60008481526009602052604090206001015490915081116119ec57600080fd5b8151811415611a645760008381526009602052604080822080546001600160b01b031916815560018101929092556002909101805460ff19169055517fd7be02b8dd0d27bd0517a9cb4d7469ce27df4313821ae5ec1ff69acc594ba23390611a579085815260200190565b60405180910390a1611af8565b60408051608081018252600085815260096020818152848320805461ffff80821687526001600160a01b03620100008084048216868a019081529989018b8152600160608b01818152998f90529790965297519851169096026001600160b01b03199091169690951695909517939093178455915191830191909155516002909101805491151560ff199092169190911790555b505060016004555050565b6060600c8054610e509061474d565b6002546001600160a01b03163314611b3c5760405162461bcd60e51b8152600401610c5990614792565b60008111611b4957600080fd5b61ffff909116600090815260076020526040902055565b6001600160a01b038216331415611bb85760405162461bcd60e51b815260206004820152601c60248201527b22a9219b9918a839b49d1030b8383937bb32903a379031b0b63632b960211b6044820152606401610c59565b3360008181526010602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000611c2e612e53565b600e546111df9190614a66565b6012805461128a9061474d565b6002546001600160a01b03163314611c725760405162461bcd60e51b8152600401610c5990614792565b818130604051602001611c87939291906148c3565b60408051601f1981840301815291815261ffff8516600090815260208181529190208251611cba93919290910190613b11565b50600080516020614fa3833981519152838383604051611cdc939291906148a5565b60405180910390a1505050565b6005546201000090046001600160a01b03163314611d0657600080fd5b6127108161ffff161115611d1957600080fd5b6005805461ffff191661ffff92909216919091179055565b610e0d87878787878787612a63565b6002546001600160a01b03163314611d6a5760405162461bcd60e51b8152600401610c5990614792565b6015544210611d7857600080fd5b8051611d8b906014906020840190613b11565b5050565b611d993383612773565b611db55760405162461bcd60e51b8152600401610c59906147c9565b611dc184848484612ecb565b50505050565b60115460609062ffffff161580611dea575060148054611de69061474d565b1590505b15611df757610e3b6122ff565b6014611e0283612f00565b604051602001611e13929190614b17565b6040516020818303038152906040529050919050565b6002546001600160a01b03163314611e535760405162461bcd60e51b8152600401610c5990614792565b6040516332fb62e760e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cbed8b9c90611ea79088908890889088908890600401614b6b565b600060405180830381600087803b158015611ec157600080fd5b505af1158015611ed5573d6000803e3d6000fd5b505050505050505050565b60026004541415611f035760405162461bcd60e51b8152600401610c5990614930565b60026004556013546001600160a01b03163314611f1f57600080fd5b611f2b84848484612ffd565b611f645760405162461bcd60e51b815260206004820152600a602482015269085a5cd05b1b1bddd95960b21b6044820152606401610c59565b60405163b124e2f760e01b81526001600160a01b03858116600483015260ff8316602483015262ffffff851660448301527f0000000000000000000000000000000000000000000000000000000000000000169063b124e2f790606401600060405180830381600087803b158015611fdb57600080fd5b505af1158015611fef573d6000803e3d6000fd5b50505050611af8848462ffffff166130f7565b6002546001600160a01b0316331461202c5760405162461bcd60e51b8152600401610c5990614792565b6000811161203957600080fd5b61ffff909116600090815260086020526040902055565b61ffff861660009081526003602052604080822090516120739088908890614782565b90815260408051602092819003830190206001600160401b038716600090815292529020549050806120f35760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610c59565b808383604051612104929190614782565b6040518091039020146121635760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610c59565b61ffff871660009081526003602052604080822090516121869089908990614782565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f8801829004820283018201905286825261221e918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250612cd092505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051612255959493929190614ba4565b60405180910390a150505050505050565b6002546001600160a01b031633146122905760405162461bcd60e51b8152600401610c5990614792565b6000811161229d57600080fd5b61ffff83811660008181526001602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001611cdc565b606060126040516020016123139190614bdf565b604051602081830303815290604052905090565b6002546001600160a01b031633146123515760405162461bcd60e51b8152600401610c5990614792565b60405163e9038e1f60e01b815260ff8716600482015260248101869052604481018590526064810184905262ffffff8316608482015260a481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9038e1f9060c401600060405180830381600087803b1580156123dc57600080fd5b505af11580156123f0573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205460ff1690565b60008060008686604051602001612442929190614c36565b60408051601f198184030181529082905263040a7bb160e41b825291506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340a7bb10906124a6908b90309086908b908b90600401614c5b565b604080518083038186803b1580156124bd57600080fd5b505afa1580156124d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f59190614caf565b6005549194509250600090612710906125129061ffff1686614833565b61251c9190614868565b905061252881856148e4565b935050509550959350505050565b6002546001600160a01b031633146125605760405162461bcd60e51b8152600401610c5990614792565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5ecbdbc9060840160006040518083038186803b1580156125fd57600080fd5b505afa158015612611573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126399190810190614cd3565b95945050505050565b6000806126a55a60966366ad5c8a60e01b8989898960405160240161266a9493929190614d07565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190613270565b915091508161170b5761170b86868686856132fa565b60006001600160e01b031982166380ac58cd60e01b1480610e3b5750610e3b82613388565b60006126eb600e5490565b82108015610e3b5750816126fd612e53565b111592915050565b6000818152600f6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061273a82611623565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061277e826126e0565b6127e25760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c59565b60006127ed83611623565b9050806001600160a01b0316846001600160a01b031614806128285750836001600160a01b031661281d84610f7e565b6001600160a01b0316145b80612838575061283881856123fc565b949350505050565b60008061284c83612c39565b91509150846001600160a01b0316826001600160a01b0316146128c65760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610c59565b6001600160a01b03841661292c5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610c59565b612937600084612705565b60006129448460016148e4565b600881901c6000908152600a6020526040902054909150600160ff1b60ff83161c161580156129745750600e5481105b156129ab576000818152600d6020526040902080546001600160a01b0319166001600160a01b0388161790556129ab600a826133d8565b6000848152600d6020526040902080546001600160a01b0319166001600160a01b0387161790558184146129e4576129e4600a856133d8565b83856001600160a01b0316876001600160a01b0316600080516020614fc383398151915260405160405180910390a461170b565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612a5257612a52614d45565b602090810291909101015292915050565b6000845111612aaa5760405162461bcd60e51b8152602060048201526013602482015272746f6b656e4964735b5d20697320656d70747960681b6044820152606401610c59565b61ffff861660009081526007602052604090205484511115612b195760405162461bcd60e51b815260206004820152602260248201527f62617463682073697a65206578636565647320647374206261746368206c696d6044820152611a5d60f21b6064820152608401610c59565b60005b8451811015612b5c57612b4a888888888581518110612b3d57612b3d614d45565b6020026020010151613404565b80612b54816148fc565b915050612b1c565b5060008585604051602001612b72929190614c36565b6040516020818303038152906040529050612bb7876001848851600860008d61ffff1661ffff16815260200190815260200160002054612bb29190614833565b613448565b6000612bc234613522565b9050612bd28883878787866135f4565b86604051612be09190614d5b565b6040518091039020896001600160a01b03168961ffff167fe1b87c47fdeb4f9cbadbca9df3af7aba453bb6e501075d0440d88125b711522a89604051612c269190614d77565b60405180910390a4505050505050505050565b600080612c45836126e0565b612ca65760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c59565b612caf8361378f565b6000818152600d60205260409020546001600160a01b031694909350915050565b60008082806020019051810190612ce791906149ac565b601482015191935091506000612cff88838386612e79565b90508251811015612dd35784516020808701919091206040805160808101825261ffff808d1682526001600160a01b0380881683870190815283850188815260016060860181815260008981526009909a529887902095518654935190941662010000026001600160b01b03199093169390941692909217178355519082015592516002909301805493151560ff199094169390931790925590517f10e0b70d256bccc84b7027506978bd8b68984a870788b93b479def144c839ad790612dc99083908990614d8a565b60405180910390a1505b816001600160a01b031687604051612deb9190614d5b565b60405180910390208961ffff167f5b821db8a46f8ecbe1941ba2f51cfeea9643268b56631f70d45e2a745d99026586604051612e279190614d77565b60405180910390a45050505050505050565b611d8b82826040518060200160405280600081525061379c565b601354600090600160a01b900460ff16612e6e576001612e71565b60005b60ff16905090565b6000825b8251811015612639576006545a1015612e9557612639565b612eb98686858481518110612eac57612eac614d45565b60200260200101516137c1565b80612ec3816148fc565b915050612e7d565b612ed6848484612840565b612ee48484846001856137fa565b611dc15760405162461bcd60e51b8152600401610c5990614da3565b606081612f245750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612f4e5780612f38816148fc565b9150612f479050600a83614868565b9150612f28565b6000816001600160401b03811115612f6857612f68613e19565b6040519080825280601f01601f191660200182016040528015612f92576020820181803683370190505b5090505b841561283857612fa7600183614a66565b9150612fb4600a86614df8565b612fbf9060306148e4565b60f81b818381518110612fd457612fd4614d45565b60200101906001600160f81b031916908160001a905350612ff6600a86614868565b9450612f96565b6000601554421061300d57600080fd5b60008462ffffff1661301d611c24565b61302791906148e4565b60115490915062ffffff161561304b5760115462ffffff1681111561304b57600080fd5b60405163d7ec901960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d7ec90199061309d908990899089908990600401614e0c565b60206040518083038186803b1580156130b557600080fd5b505afa1580156130c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130ed9190614e7c565b9695505050505050565b6000613102600e5490565b9050600082116131625760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610c59565b6001600160a01b0383166131c45760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c59565b81600e60008282546131d691906148e4565b90915550506000818152600d6020526040902080546001600160a01b0319166001600160a01b03851617905561320d600a826133d8565b60008061321a84846148e4565b90506001600160a01b038516915082826000600080516020614fc3833981519152600080a4600183015b81811461326a5780836000600080516020614fc3833981519152600080a4600101613244565b50610f77565b6000606060008060008661ffff166001600160401b0381111561329557613295613e19565b6040519080825280601f01601f1916602001820160405280156132bf576020820181803683370190505b50905060008087516020890160008d8df191503d9250868311156132e1578692505b828152826000602083013e909890975095505050505050565b8180519060200120600360008761ffff1661ffff1681526020019081526020016000208560405161332b9190614d5b565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906115af9087908790879087908790614e99565b60006001600160e01b0319821663152a902d60e11b14806133b957506001600160e01b031982166322bac5d960e01b145b80610e3b57506301ffc9a760e01b6001600160e01b0319831614610e3b565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b836001600160a01b031661341782611623565b6001600160a01b03161461342a57600080fd5b6134348482612773565b61343d57600080fd5b611dc18430836111e4565b60006134538361393c565b61ffff8087166000908152600160209081526040808320938916835292905290812054919250906134859084906148e4565b9050600081116134d45760405162461bcd60e51b815260206004820152601a602482015279131e905c1c0e881b5a5b91d85cd31a5b5a5d081b9bdd081cd95d60321b6044820152606401610c59565b8082101561170b5760405162461bcd60e51b815260206004820152601b60248201527a4c7a4170703a20676173206c696d697420697320746f6f206c6f7760281b6044820152606401610c59565b60055460009081906127109061353c9061ffff1685614833565b6135469190614868565b90506135528184614a66565b915080156135ee576005546040516000916201000090046001600160a01b03169083908381818185875af1925050503d80600081146135ad576040519150601f19603f3d011682016040523d82523d6000602084013e6135b2565b606091505b50509050806135ec5760405162461bcd60e51b8152600401610c59906020808252600490820152632166656560e01b604082015260600190565b505b50919050565b61ffff8616600090815260208190526040812080546136129061474d565b80601f016020809104026020016040519081016040528092919081815260200182805461363e9061474d565b801561368b5780601f106136605761010080835404028352916020019161368b565b820191906000526020600020905b81548152906001019060200180831161366e57829003601f168201915b505050505090508051600014156136fd5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b6064820152608401610c59565b60405162c5803160e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c5803100908490613754908b9086908c908c908c908c90600401614eeb565b6000604051808303818588803b15801561376d57600080fd5b505af1158015613781573d6000803e3d6000fd5b505050505050505050505050565b6000610e3b600a83613997565b60006137a7600e5490565b90506137b384846130f7565b612ee46000858386866137fa565b6137ca816126e0565b80156137e65750306137db82611623565b6001600160a01b0316145b6137ef57600080fd5b61111a3083836111e4565b60006001600160a01b0385163b1561393057506001835b61381b84866148e4565b81101561392a57604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906138549033908b9086908990600401614f52565b602060405180830381600087803b15801561386e57600080fd5b505af192505050801561389e575060408051601f3d908101601f1916820190925261389b91810190614f85565b60015b6138f8573d8080156138cc576040519150601f19603f3d011682016040523d82523d6000602084013e6138d1565b606091505b5080516138f05760405162461bcd60e51b8152600401610c5990614da3565b805181602001fd5b82801561391557506001600160e01b03198116630a85bd0160e11b145b92505080613922816148fc565b915050613811565b50612639565b50600195945050505050565b600060228251101561398f5760405162461bcd60e51b815260206004820152601c60248201527b4c7a4170703a20696e76616c69642061646170746572506172616d7360201b6044820152606401610c59565b506022015190565b600881901c60008181526020849052604081205490919060ff808516919082181c80156139d9576139c781613a8f565b60ff168203600884901b179350613a86565b60008311613a465760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610c59565b506000199091016000818152602086905260409020549091908015613a8157613a6e81613a8f565b60ff0360ff16600884901b179350613a86565b6139d9565b50505092915050565b60006040518061012001604052806101008152602001614fe3610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff613ad885613af9565b02901c81518110613aeb57613aeb614d45565b016020015160f81c92915050565b6000808211613b0757600080fd5b5060008190031690565b828054613b1d9061474d565b90600052602060002090601f016020900481019282613b3f5760008555613b85565b82601f10613b5857805160ff1916838001178555613b85565b82800160010185558215613b85579182015b82811115613b85578251825591602001919060010190613b6a565b50613b91929150613b95565b5090565b5b80821115613b915760008155600101613b96565b803561ffff81168114613bbc57600080fd5b919050565b60008083601f840112613bd357600080fd5b5081356001600160401b03811115613bea57600080fd5b602083019150836020828501011115613c0257600080fd5b9250929050565b80356001600160401b0381168114613bbc57600080fd5b60008060008060008060808789031215613c3957600080fd5b613c4287613baa565b955060208701356001600160401b0380821115613c5e57600080fd5b613c6a8a838b01613bc1565b9097509550859150613c7e60408a01613c09565b94506060890135915080821115613c9457600080fd5b50613ca189828a01613bc1565b979a9699509497509295939492505050565b6001600160e01b03198116811461179457600080fd5b600060208284031215613cdb57600080fd5b8135613ce681613cb3565b9392505050565b60005b83811015613d08578181015183820152602001613cf0565b83811115611dc15750506000910152565b60008151808452613d31816020860160208601613ced565b601f01601f19169290920160200192915050565b602081526000613ce66020830184613d19565b600060208284031215613d6a57600080fd5b613ce682613baa565b600060208284031215613d8557600080fd5b5035919050565b6001600160a01b038116811461179457600080fd5b8035613bbc81613d8c565b60008060408385031215613dbf57600080fd5b8235613dca81613d8c565b946020939093013593505050565b600080600060608486031215613ded57600080fd5b8335613df881613d8c565b92506020840135613e0881613d8c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613e5757613e57613e19565b604052919050565b60006001600160401b03821115613e7857613e78613e19565b50601f01601f191660200190565b6000613e99613e9484613e5f565b613e2f565b9050828152838383011115613ead57600080fd5b828260208301376000602084830101529392505050565b600082601f830112613ed557600080fd5b613ce683833560208501613e86565b801515811461179457600080fd5b600080600080600060a08688031215613f0a57600080fd5b613f1386613baa565b945060208601356001600160401b0380821115613f2f57600080fd5b613f3b89838a01613ec4565b95506040880135945060608801359150613f5482613ee4565b90925060808701359080821115613f6a57600080fd5b50613f7788828901613ec4565b9150509295509295909350565b60008060408385031215613f9757600080fd5b50508035926020909101359150565b600060208284031215613fb857600080fd5b8135613ce681613d8c565b600080600060408486031215613fd857600080fd5b613fe184613baa565b925060208401356001600160401b03811115613ffc57600080fd5b61400886828701613bc1565b9497909650939450505050565b60008060008060006080868803121561402d57600080fd5b61403686613baa565b945060208601356001600160401b0381111561405157600080fd5b61405d88828901613bc1565b9699909850959660408101359660609091013595509350505050565b600080600080600080600060e0888a03121561409457600080fd5b873561409f81613d8c565b96506140ad60208901613baa565b955060408801356001600160401b03808211156140c957600080fd5b6140d58b838c01613ec4565b965060608a0135955060808a013591506140ee82613d8c565b90935060a08901359061410082613d8c565b90925060c0890135908082111561411657600080fd5b506141238a828b01613ec4565b91505092959891949750929550565b803562ffffff81168114613bbc57600080fd5b60006020828403121561415757600080fd5b613ce682614132565b60008060006060848603121561417557600080fd5b61417e84613baa565b925060208401356001600160401b0381111561419957600080fd5b6141a586828701613ec4565b9250506141b460408501613c09565b90509250925092565b803560ff81168114613bbc57600080fd5b6000602082840312156141e057600080fd5b613ce6826141bd565b600080604083850312156141fc57600080fd5b61420583613baa565b915061127460208401613baa565b60006020828403121561422557600080fd5b81356001600160401b0381111561423b57600080fd5b61283884828501613ec4565b6000806040838503121561425a57600080fd5b613dca83613baa565b6000806040838503121561427657600080fd5b823561428181613d8c565b9150602083013561429181613ee4565b809150509250929050565b60006001600160401b038211156142b5576142b5613e19565b5060051b60200190565b600082601f8301126142d057600080fd5b813560206142e0613e948361429c565b82815260059290921b840181019181810190868411156142ff57600080fd5b8286015b8481101561431a5780358352918301918301614303565b509695505050505050565b600080600080600080600060e0888a03121561434057600080fd5b873561434b81613d8c565b965061435960208901613baa565b955060408801356001600160401b038082111561437557600080fd5b6143818b838c01613ec4565b965060608a013591508082111561439757600080fd5b6143a38b838c016142bf565b955060808a013591506143b582613d8c565b8194506143c460a08b01613da1565b935060c08a013591508082111561411657600080fd5b6000602082840312156143ec57600080fd5b81356001600160401b0381111561440257600080fd5b8201601f8101841361441357600080fd5b61283884823560208401613e86565b6000806000806080858703121561443857600080fd5b843561444381613d8c565b9350602085013561445381613d8c565b92506040850135915060608501356001600160401b0381111561447557600080fd5b61448187828801613ec4565b91505092959194509250565b6000806000806000608086880312156144a557600080fd5b6144ae86613baa565b94506144bc60208701613baa565b93506040860135925060608601356001600160401b038111156144de57600080fd5b6144ea88828901613bc1565b969995985093965092949392505050565b6000806000806080858703121561451157600080fd5b843561451c81613d8c565b9350602061452b868201614132565b935060408601356001600160401b0381111561454657600080fd5b8601601f8101881361455757600080fd5b8035614565613e948261429c565b81815260059190911b8201830190838101908a83111561458457600080fd5b928401925b828410156145a257833582529284019290840190614589565b80965050505050506145b6606086016141bd565b905092959194509250565b6000806000606084860312156145d657600080fd5b6145df84613baa565b92506145ed60208501613baa565b9150604084013590509250925092565b60008060008060008060c0878903121561461657600080fd5b61461f876141bd565b955060208701359450604087013593506060870135925061464260808801614132565b915060a087013590509295509295509295565b6000806040838503121561466857600080fd5b823561467381613d8c565b9150602083013561429181613d8c565b600080600080600060a0868803121561469b57600080fd5b6146a486613baa565b945060208601356001600160401b03808211156146c057600080fd5b6146cc89838a01613ec4565b955060408801359150808211156146e257600080fd5b6146ee89838a016142bf565b945060608801359150613f5482613ee4565b6000806000806080858703121561471657600080fd5b61471f85613baa565b935061472d60208601613baa565b9250604085013561473d81613d8c565b9396929550929360600135925050565b600181811c9082168061476157607f821691505b602082108114156135ee57634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b6020808252601e908201527f4c7a4170703a2063616c6c6572206973206e6f7420746865206f776e65720000604082015260600190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561484d5761484d61481d565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261487757614877614852565b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8416815260406020820152600061263960408301848661487c565b8284823760609190911b6001600160601b0319169101908152601401919050565b600082198211156148f7576148f761481d565b500190565b60006000198214156149105761491061481d565b5060010190565b60006020828403121561492957600080fd5b5051919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600082601f83011261497857600080fd5b8151614986613e9482613e5f565b81815284602083860101111561499b57600080fd5b612838826020830160208701613ced565b600080604083850312156149bf57600080fd5b82516001600160401b03808211156149d657600080fd5b6149e286838701614967565b93506020915081850151818111156149f957600080fd5b85019050601f81018613614a0c57600080fd5b8051614a1a613e948261429c565b81815260059190911b82018301908381019088831115614a3957600080fd5b928401925b82841015614a5757835182529284019290840190614a3e565b80955050505050509250929050565b600082821015614a7857614a7861481d565b500390565b8054600090600181811c9080831680614a9757607f831692505b6020808410821415614ab957634e487b7160e01b600052602260045260246000fd5b818015614acd5760018114614ade57614b0b565b60ff19861689528489019650614b0b565b60008881526020902060005b86811015614b035781548b820152908501908301614aea565b505084890196505b50505050505092915050565b66697066733a2f2f60c81b81526000614b336007830185614a7d565b602f60f81b81528351614b4d816001840160208801613ced565b64173539b7b760d91b60019290910191820152600601949350505050565b600061ffff808816835280871660208401525084604083015260806060830152614b9960808301848661487c565b979650505050505050565b61ffff86168152608060208201526000614bc260808301868861487c565b6001600160401b0394909416604083015250606001529392505050565b66697066733a2f2f60c81b81526000613ce66007830184614a7d565b600081518084526020808501945080840160005b83811015614c2b57815187529582019590820190600101614c0f565b509495945050505050565b604081526000614c496040830185613d19565b82810360208401526126398185614bfb565b61ffff861681526001600160a01b038516602082015260a060408201819052600090614c8990830186613d19565b84151560608401528281036080840152614ca38185613d19565b98975050505050505050565b60008060408385031215614cc257600080fd5b505080516020909101519092909150565b600060208284031215614ce557600080fd5b81516001600160401b03811115614cfb57600080fd5b61283884828501614967565b61ffff85168152608060208201526000614d246080830186613d19565b6001600160401b03851660408401528281036060840152614b998185613d19565b634e487b7160e01b600052603260045260246000fd5b60008251614d6d818460208701613ced565b9190910192915050565b602081526000613ce66020830184614bfb565b8281526040602082015260006128386040830184613d19565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b600082614e0757614e07614852565b500690565b6001600160a01b038516815262ffffff841660208083019190915260806040830181905284519083018190526000918581019160a0850190845b81811015614e6257845183529383019391830191600101614e46565b505080935050505060ff8316606083015295945050505050565b600060208284031215614e8e57600080fd5b8151613ce681613ee4565b61ffff8616815260a060208201526000614eb660a0830187613d19565b6001600160401b03861660408401528281036060840152614ed78186613d19565b90508281036080840152614ca38185613d19565b61ffff8716815260c060208201526000614f0860c0830188613d19565b8281036040840152614f1a8188613d19565b6001600160a01b0387811660608601528616608085015283810360a08501529050614f458185613d19565b9998505050505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130ed90830184613d19565b600060208284031215614f9757600080fd5b8151613ce681613cb356fe8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ceddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220f400644bde4194f887ecd8e5adcec733a147ba7b9a0e911b5590b06308c6d40864736f6c63430008090033a2646970667358221220302e9a6b874fa305ab5f78791fcad0873054f2f587536dd3269097da07fddf9164736f6c63430008090033
Deployed Bytecode
0x60806040523480156200001157600080fd5b50600436106200008e5760003560e01c8063428a6171146200009357806343add2e614620000c75780635945f1c614620000fe5780635996c9c614620001125780635bb4780814620001385780638da5cb5b1462000151578063d0ebdbe71462000165578063d72822bb146200017c578063db2c21601462000190575b600080fd5b620000aa620000a4366004620003b7565b620001a7565b6040516001600160a01b0390911681526020015b60405180910390f35b620000ed620000d8366004620003f1565b60046020526000908152604090205460ff1681565b6040519015158152602001620000be565b600054620000aa906001600160a01b031681565b6200012962000123366004620003f1565b620001e0565b604051620000be919062000416565b6200014f62000149366004620003f1565b62000258565b005b600254620000aa906001600160a01b031681565b6200014f62000176366004620003f1565b62000292565b600154620000aa906001600160a01b031681565b6200014f620001a136600462000465565b620002cc565b60036020528160005260406000208181548110620001c457600080fd5b6000918252602090912001546001600160a01b03169150829050565b6001600160a01b0381166000908152600360209081526040918290208054835181840281018401909452808452606093928301828280156200024c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116200022d575b50505050509050919050565b6002546001600160a01b031633146200027057600080fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163314620002aa57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314620002e457600080fd5b600154604051600091849184916001600160a01b03169062000306906200038c565b62000314939291906200055a565b604051809103906000f08015801562000331573d6000803e3d6000fd5b506001600160a01b0392831660009081526003602090815260408083208054600180820183559185528385200180546001600160a01b031916959097169485179096559282526004905220805460ff19169092179091555050565b61570b806200068c83390190565b80356001600160a01b0381168114620003b257600080fd5b919050565b60008060408385031215620003cb57600080fd5b620003d6836200039a565b946020939093013593505050565b6001600160a01b03169052565b6000602082840312156200040457600080fd5b6200040f826200039a565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015620004595783516001600160a01b03168352928401929184019160010162000432565b50909695505050505050565b600080604083850312156200047957600080fd5b82356001600160401b038111156200049057600080fd5b83016101008186031215620004a457600080fd5b9150620004b4602084016200039a565b90509250929050565b6000808335601e19843603018112620004d557600080fd5b83016020810192503590506001600160401b03811115620004f557600080fd5b8036038313156200050557600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b803562ffffff81168114620003b257600080fd5b80358015158114620003b257600080fd5b6060815260006200056c8586620004bd565b61010080606086015262000586610160860183856200050c565b9250620005976020890189620004bd565b9250605f1980878603016080880152620005b38585846200050c565b9450620005c460408b018b620004bd565b94509150808786030160a0880152620005df8585846200050c565b9450620005f060608b018b620004bd565b94509150808786030160c0880152506200060c8484836200050c565b9350506200061d6080890162000535565b62ffffff811660e087015291506200063860a0890162000549565b151590850152506200064d60c0870162000535565b62ffffff1661012084015260e08601356101408401529050620006746020830185620003e4565b620006836040830184620003e4565b94935050505056fe60c0604052736ef0871ed810f323ea516a77b0988353b667dfa460a0523480156200002957600080fd5b506040516200570b3803806200570b8339810160408190526200004c91620003ef565b825160208401517366a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756080819052600280546001600160a01b0319163317905560016004556203d0909050600655600580546001600160b01b0319167561104fbe07ecc735d8d84422c7f045f8d29dbf1503e81790558151620000ca90600b906020850190620001fd565b508051620000e090600c906020840190620001fd565b5050601380546001600160a01b0319166001600160a01b03841617905550606083015180516200011991601491602090910190620001fd565b5060808301516011805462ffffff191662ffffff909216919091179055604083015180516200015191601291602090910190620001fd565b5060a08301516013805460ff60a01b1916600160a01b9215158302179081905560e08501516015556200019c9160ff9104166200019057600162000193565b60005b60ff16620001ea565b50600280546001600160a01b039092166001600160a01b031990921691909117905560c001516005805462ffffff909216600160b01b0262ffffff60b01b1990921691909117905562000580565b600e5415620001f857600080fd5b600e55565b8280546200020b9062000543565b90600052602060002090601f0160209004810192826200022f57600085556200027a565b82601f106200024a57805160ff19168380011785556200027a565b828001600101855582156200027a579182015b828111156200027a5782518255916020019190600101906200025d565b50620002889291506200028c565b5090565b5b808211156200028857600081556001016200028d565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715620002df57620002df620002a3565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620003105762000310620002a3565b604052919050565b600082601f8301126200032a57600080fd5b81516001600160401b03811115620003465762000346620002a3565b60206200035c601f8301601f19168201620002e5565b82815285828487010111156200037157600080fd5b60005b838110156200039157858101830151828201840152820162000374565b83811115620003a35760008385840101525b5095945050505050565b805162ffffff81168114620003c157600080fd5b919050565b80518015158114620003c157600080fd5b80516001600160a01b0381168114620003c157600080fd5b6000806000606084860312156200040557600080fd5b83516001600160401b03808211156200041d57600080fd5b9085019061010082880312156200043357600080fd5b6200043d620002b9565b8251828111156200044d57600080fd5b6200045b8982860162000318565b8252506020830151828111156200047157600080fd5b6200047f8982860162000318565b6020830152506040830151828111156200049857600080fd5b620004a68982860162000318565b604083015250606083015182811115620004bf57600080fd5b620004cd8982860162000318565b606083015250620004e160808401620003ad565b6080820152620004f460a08401620003c6565b60a08201526200050760c08401620003ad565b60c082015260e083015160e08201528095505050506200052a60208501620003d7565b91506200053a60408501620003d7565b90509250925092565b600181811c908216806200055857607f821691505b602082108114156200057a57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a051615118620005f3600039600081816118a401528181611f9701528181612390015261306201526000818161098001528181610bf001528181610f160152818161119e0152818161147a01528181611e6a01528181612469015281816125b3015261371301526151186000f3fe6080604052600436106102dd5760003560e01c80621d3567146102e257806301ffc9a71461030457806306fdde031461033957806307e0db171461035b578063081812fc1461037b578063095ea7b3146103b35780630b4cad4c146103d357806310ddb137146103f357806318160ddd1461041357806322a3ecf91461043657806323b872dd146104b95780632a205e3d146104d95780632a55205a1461050e5780632dd0066e1461054d5780632e4a33cb146105625780633d8b38f61461058257806342842e0e146105a257806342d65a8d146105c257806346a43816146105e257806348288190146106025780634ac3f4ff14610618578063519056361461064557806352a284a2146106585780635b8c41e6146106785780636352211e146106c757806366ad5c8a146106e75780636da7870b1461070757806370a08231146107275780637533d788146107475780637c6e551d146107675780638147ef371461079e578063893d20e8146107be5780638cfd8f5c146107dc5780638da5cb5b146108145780638ffa1f2a1461083457806395d89b41146108545780639ea5d6b114610869578063a22cb46514610889578063a2309ff8146108a9578063a5097ebf146108be578063a6c3d165146108d3578063a7e0d43d146108f3578063ab3ffb9314610913578063af3fb21c14610926578063b19ab2451461094e578063b353aaa71461096e578063b88d4fde146109a2578063c4461834146109c2578063c4ed6f58146109d8578063c87b56dd146109f3578063cbed8b9c14610a13578063d112fe3314610a33578063d12473a514610a53578063d1deba1f14610a73578063d5abeb0114610a86578063d72822bb14610aa2578063df2a5b3b14610ac2578063e8a3d48514610ae2578063e9038e1f14610af7578063e985e9c514610b17578063efc585ad14610b37578063f235364114610b58578063f2fde38b14610b78578063f5ecbdbc14610b98578063fa25f9b614610bb8575b600080fd5b3480156102ee57600080fd5b506103026102fd366004613c20565b610be5565b005b34801561031057600080fd5b5061032461031f366004613cc9565b610e16565b60405190151581526020015b60405180910390f35b34801561034557600080fd5b5061034e610e41565b6040516103309190613d45565b34801561036757600080fd5b50610302610376366004613d58565b610ed3565b34801561038757600080fd5b5061039b610396366004613d73565b610f7e565b6040516001600160a01b039091168152602001610330565b3480156103bf57600080fd5b506103026103ce366004613dac565b611009565b3480156103df57600080fd5b506103026103ee366004613d73565b61111f565b3480156103ff57600080fd5b5061030261040e366004613d58565b61115b565b34801561041f57600080fd5b506104286111d5565b604051908152602001610330565b34801561044257600080fd5b5061048a610451366004613d73565b60096020526000908152604090208054600182015460029092015461ffff821692620100009092046001600160a01b0316919060ff1684565b6040805161ffff90951685526001600160a01b0390931660208501529183015215156060820152608001610330565b3480156104c557600080fd5b506103026104d4366004613dd8565b6111e4565b3480156104e557600080fd5b506104f96104f4366004613ef2565b611215565b60408051928352602083019190915201610330565b34801561051a57600080fd5b5061052e610529366004613f84565b61123b565b604080516001600160a01b039093168352602083019190915201610330565b34801561055957600080fd5b5061034e61127d565b34801561056e57600080fd5b5061030261057d366004613fa6565b61130b565b34801561058e57600080fd5b5061032461059d366004613fc3565b611352565b3480156105ae57600080fd5b506103026105bd366004613dd8565b61141e565b3480156105ce57600080fd5b506103026105dd366004613fc3565b611439565b3480156105ee57600080fd5b506103026105fd366004614015565b6114e1565b34801561060e57600080fd5b5061042860065481565b34801561062457600080fd5b50610428610633366004613d58565b60076020526000908152604090205481565b610302610653366004614079565b6115be565b34801561066457600080fd5b50610302610673366004614145565b6115d5565b34801561068457600080fd5b50610428610693366004614160565b6003602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156106d357600080fd5b5061039b6106e2366004613d73565b611623565b3480156106f357600080fd5b50610302610702366004613c20565b611637565b34801561071357600080fd5b50610302610722366004613d73565b611713565b34801561073357600080fd5b50610428610742366004613fa6565b611797565b34801561075357600080fd5b5061034e610762366004613d58565b611870565b34801561077357600080fd5b5060055461078a90600160b01b900462ffffff1681565b60405162ffffff9091168152602001610330565b3480156107aa57600080fd5b506104286107b93660046141ce565b611889565b3480156107ca57600080fd5b506002546001600160a01b031661039b565b3480156107e857600080fd5b506104286107f73660046141e9565b600160209081526000928352604080842090915290825290205481565b34801561082057600080fd5b5060025461039b906001600160a01b031681565b34801561084057600080fd5b5061030261084f366004614213565b611926565b34801561086057600080fd5b5061034e611b03565b34801561087557600080fd5b50610302610884366004614247565b611b12565b34801561089557600080fd5b506103026108a4366004614263565b611b60565b3480156108b557600080fd5b50610428611c24565b3480156108ca57600080fd5b5061034e611c3b565b3480156108df57600080fd5b506103026108ee366004613fc3565b611c48565b3480156108ff57600080fd5b5061030261090e366004613d58565b611ce9565b610302610921366004614325565b611d31565b34801561093257600080fd5b5061093b600181565b60405161ffff9091168152602001610330565b34801561095a57600080fd5b506103026109693660046143da565b611d40565b34801561097a57600080fd5b5061039b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156109ae57600080fd5b506103026109bd366004614422565b611d8f565b3480156109ce57600080fd5b5061042861271081565b3480156109e457600080fd5b5060055461093b9061ffff1681565b3480156109ff57600080fd5b5061034e610a0e366004613d73565b611dc7565b348015610a1f57600080fd5b50610302610a2e36600461448d565b611e29565b348015610a3f57600080fd5b50610302610a4e3660046144fb565b611ee0565b348015610a5f57600080fd5b50610302610a6e366004614247565b612002565b610302610a81366004613c20565b612050565b348015610a9257600080fd5b5060115461078a9062ffffff1681565b348015610aae57600080fd5b5060135461039b906001600160a01b031681565b348015610ace57600080fd5b50610302610add3660046145c1565b612266565b348015610aee57600080fd5b5061034e6122ff565b348015610b0357600080fd5b50610302610b123660046145fd565b612327565b348015610b2357600080fd5b50610324610b32366004614655565b6123fc565b348015610b4357600080fd5b5060135461032490600160a01b900460ff1681565b348015610b6457600080fd5b506104f9610b73366004614683565b61242a565b348015610b8457600080fd5b50610302610b93366004613fa6565b612536565b348015610ba457600080fd5b5061034e610bb3366004614700565b612582565b348015610bc457600080fd5b50610428610bd3366004613d58565b60086020526000908152604090205481565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c625760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff861660009081526020819052604081208054610c809061474d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cac9061474d565b8015610cf95780601f10610cce57610100808354040283529160200191610cf9565b820191906000526020600020905b815481529060010190602001808311610cdc57829003601f168201915b50505050509050805186869050148015610d14575060008151115b8015610d3c575080516020820120604051610d329088908890614782565b6040518091039020145b610d975760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610c59565b610e0d8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061264292505050565b50505050505050565b60006001600160e01b0319821663365a0c7b60e21b1480610e3b5750610e3b826126bb565b92915050565b6060600b8054610e509061474d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e7c9061474d565b8015610ec95780601f10610e9e57610100808354040283529160200191610ec9565b820191906000526020600020905b815481529060010190602001808311610eac57829003601f168201915b5050505050905090565b6002546001600160a01b03163314610efd5760405162461bcd60e51b8152600401610c5990614792565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906307e0db17906024015b600060405180830381600087803b158015610f6357600080fd5b505af1158015610f77573d6000803e3d6000fd5b5050505050565b6000610f89826126e0565b610fed5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c59565b506000908152600f60205260409020546001600160a01b031690565b600061101482611623565b9050806001600160a01b0316836001600160a01b031614156110845760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610c59565b336001600160a01b03821614806110a057506110a081336123fc565b6111105760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527a081bdddb995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b602a1b6064820152608401610c59565b61111a8383612705565b505050565b6002546001600160a01b031633146111495760405162461bcd60e51b8152600401610c5990614792565b6000811161115657600080fd5b600655565b6002546001600160a01b031633146111855760405162461bcd60e51b8152600401610c5990614792565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906310ddb13790602401610f49565b60006111df611c24565b905090565b6111ee3382612773565b61120a5760405162461bcd60e51b8152600401610c59906147c9565b61111a838383612840565b60008061122d878761122688612a18565b878761242a565b915091509550959350505050565b6002546005546001600160a01b03909116906000906127109061126a90600160b01b900462ffffff1685614833565b6112749190614868565b90509250929050565b6014805461128a9061474d565b80601f01602080910402602001604051908101604052809291908181526020018280546112b69061474d565b80156113035780601f106112d857610100808354040283529160200191611303565b820191906000526020600020905b8154815290600101906020018083116112e657829003601f168201915b505050505081565b6005546201000090046001600160a01b0316331461132857600080fd5b600580546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b61ffff8316600090815260208190526040812080548291906113739061474d565b80601f016020809104026020016040519081016040528092919081815260200182805461139f9061474d565b80156113ec5780601f106113c1576101008083540402835291602001916113ec565b820191906000526020600020905b8154815290600101906020018083116113cf57829003601f168201915b505050505090508383604051611403929190614782565b60405180910390208180519060200120149150509392505050565b61111a83838360405180602001604052806000815250611d8f565b6002546001600160a01b031633146114635760405162461bcd60e51b8152600401610c5990614792565b6040516342d65a8d60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342d65a8d906114b3908690869086906004016148a5565b600060405180830381600087803b1580156114cd57600080fd5b505af1158015610e0d573d6000803e3d6000fd5b6002546001600160a01b0316331461150b5760405162461bcd60e51b8152600401610c5990614792565b60008211801561151b5750600081115b61152457600080fd5b61ffff851660009081526008602090815260408083208590556007825291829020839055905161155a91869186913091016148c3565b60408051601f1981840301815291815261ffff871660009081526020818152919020825161158d93919290910190613b11565b50600080516020614fa38339815191528585856040516115af939291906148a5565b60405180910390a15050505050565b610e0d8787876115cd88612a18565b878787612a63565b6002546001600160a01b031633146115ff5760405162461bcd60e51b8152600401610c5990614792565b6005805462ffffff909216600160b01b0262ffffff60b01b19909216919091179055565b60008061162f83612c39565b509392505050565b3330146116955760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610c59565b61170b8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f890181900481028201810190925287815289935091508790879081908401838280828437600092019190915250612cd092505050565b505050505050565b6002546001600160a01b0316331461173d5760405162461bcd60e51b8152600401610c5990614792565b601554421061174b57600080fd5b60115462ffffff161561177e5780611761611c24565b61176b91906148e4565b60115462ffffff16101561177e57600080fd5b600254611794906001600160a01b031682612e39565b50565b60006001600160a01b0382166118055760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610c59565b600080611810612e53565b90505b600e5481101561186957611826816126e0565b156118595761183481611623565b6001600160a01b0316846001600160a01b0316141561185957611856826148fc565b91505b611862816148fc565b9050611813565b5092915050565b6000602081905290815260409020805461128a9061474d565b604051638147ef3760e01b815260ff821660048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638147ef379060240160206040518083038186803b1580156118ee57600080fd5b505afa158015611902573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3b9190614917565b600260045414156119495760405162461bcd60e51b8152600401610c5990614930565b6002600481905581516020808401919091206000818152600990925260409091209091015460ff1661197a57600080fd5b60008280602001905181019061199091906149ac565b600084815260096020526040812080546001909101549294509092506119cc9161ffff8216916201000090046001600160a01b03169085612e79565b60008481526009602052604090206001015490915081116119ec57600080fd5b8151811415611a645760008381526009602052604080822080546001600160b01b031916815560018101929092556002909101805460ff19169055517fd7be02b8dd0d27bd0517a9cb4d7469ce27df4313821ae5ec1ff69acc594ba23390611a579085815260200190565b60405180910390a1611af8565b60408051608081018252600085815260096020818152848320805461ffff80821687526001600160a01b03620100008084048216868a019081529989018b8152600160608b01818152998f90529790965297519851169096026001600160b01b03199091169690951695909517939093178455915191830191909155516002909101805491151560ff199092169190911790555b505060016004555050565b6060600c8054610e509061474d565b6002546001600160a01b03163314611b3c5760405162461bcd60e51b8152600401610c5990614792565b60008111611b4957600080fd5b61ffff909116600090815260076020526040902055565b6001600160a01b038216331415611bb85760405162461bcd60e51b815260206004820152601c60248201527b22a9219b9918a839b49d1030b8383937bb32903a379031b0b63632b960211b6044820152606401610c59565b3360008181526010602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000611c2e612e53565b600e546111df9190614a66565b6012805461128a9061474d565b6002546001600160a01b03163314611c725760405162461bcd60e51b8152600401610c5990614792565b818130604051602001611c87939291906148c3565b60408051601f1981840301815291815261ffff8516600090815260208181529190208251611cba93919290910190613b11565b50600080516020614fa3833981519152838383604051611cdc939291906148a5565b60405180910390a1505050565b6005546201000090046001600160a01b03163314611d0657600080fd5b6127108161ffff161115611d1957600080fd5b6005805461ffff191661ffff92909216919091179055565b610e0d87878787878787612a63565b6002546001600160a01b03163314611d6a5760405162461bcd60e51b8152600401610c5990614792565b6015544210611d7857600080fd5b8051611d8b906014906020840190613b11565b5050565b611d993383612773565b611db55760405162461bcd60e51b8152600401610c59906147c9565b611dc184848484612ecb565b50505050565b60115460609062ffffff161580611dea575060148054611de69061474d565b1590505b15611df757610e3b6122ff565b6014611e0283612f00565b604051602001611e13929190614b17565b6040516020818303038152906040529050919050565b6002546001600160a01b03163314611e535760405162461bcd60e51b8152600401610c5990614792565b6040516332fb62e760e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cbed8b9c90611ea79088908890889088908890600401614b6b565b600060405180830381600087803b158015611ec157600080fd5b505af1158015611ed5573d6000803e3d6000fd5b505050505050505050565b60026004541415611f035760405162461bcd60e51b8152600401610c5990614930565b60026004556013546001600160a01b03163314611f1f57600080fd5b611f2b84848484612ffd565b611f645760405162461bcd60e51b815260206004820152600a602482015269085a5cd05b1b1bddd95960b21b6044820152606401610c59565b60405163b124e2f760e01b81526001600160a01b03858116600483015260ff8316602483015262ffffff851660448301527f0000000000000000000000000000000000000000000000000000000000000000169063b124e2f790606401600060405180830381600087803b158015611fdb57600080fd5b505af1158015611fef573d6000803e3d6000fd5b50505050611af8848462ffffff166130f7565b6002546001600160a01b0316331461202c5760405162461bcd60e51b8152600401610c5990614792565b6000811161203957600080fd5b61ffff909116600090815260086020526040902055565b61ffff861660009081526003602052604080822090516120739088908890614782565b90815260408051602092819003830190206001600160401b038716600090815292529020549050806120f35760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610c59565b808383604051612104929190614782565b6040518091039020146121635760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610c59565b61ffff871660009081526003602052604080822090516121869089908990614782565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f8801829004820283018201905286825261221e918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250612cd092505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051612255959493929190614ba4565b60405180910390a150505050505050565b6002546001600160a01b031633146122905760405162461bcd60e51b8152600401610c5990614792565b6000811161229d57600080fd5b61ffff83811660008181526001602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001611cdc565b606060126040516020016123139190614bdf565b604051602081830303815290604052905090565b6002546001600160a01b031633146123515760405162461bcd60e51b8152600401610c5990614792565b60405163e9038e1f60e01b815260ff8716600482015260248101869052604481018590526064810184905262ffffff8316608482015260a481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9038e1f9060c401600060405180830381600087803b1580156123dc57600080fd5b505af11580156123f0573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205460ff1690565b60008060008686604051602001612442929190614c36565b60408051601f198184030181529082905263040a7bb160e41b825291506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340a7bb10906124a6908b90309086908b908b90600401614c5b565b604080518083038186803b1580156124bd57600080fd5b505afa1580156124d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f59190614caf565b6005549194509250600090612710906125129061ffff1686614833565b61251c9190614868565b905061252881856148e4565b935050509550959350505050565b6002546001600160a01b031633146125605760405162461bcd60e51b8152600401610c5990614792565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5ecbdbc9060840160006040518083038186803b1580156125fd57600080fd5b505afa158015612611573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126399190810190614cd3565b95945050505050565b6000806126a55a60966366ad5c8a60e01b8989898960405160240161266a9493929190614d07565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190613270565b915091508161170b5761170b86868686856132fa565b60006001600160e01b031982166380ac58cd60e01b1480610e3b5750610e3b82613388565b60006126eb600e5490565b82108015610e3b5750816126fd612e53565b111592915050565b6000818152600f6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061273a82611623565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061277e826126e0565b6127e25760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c59565b60006127ed83611623565b9050806001600160a01b0316846001600160a01b031614806128285750836001600160a01b031661281d84610f7e565b6001600160a01b0316145b80612838575061283881856123fc565b949350505050565b60008061284c83612c39565b91509150846001600160a01b0316826001600160a01b0316146128c65760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610c59565b6001600160a01b03841661292c5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610c59565b612937600084612705565b60006129448460016148e4565b600881901c6000908152600a6020526040902054909150600160ff1b60ff83161c161580156129745750600e5481105b156129ab576000818152600d6020526040902080546001600160a01b0319166001600160a01b0388161790556129ab600a826133d8565b6000848152600d6020526040902080546001600160a01b0319166001600160a01b0387161790558184146129e4576129e4600a856133d8565b83856001600160a01b0316876001600160a01b0316600080516020614fc383398151915260405160405180910390a461170b565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612a5257612a52614d45565b602090810291909101015292915050565b6000845111612aaa5760405162461bcd60e51b8152602060048201526013602482015272746f6b656e4964735b5d20697320656d70747960681b6044820152606401610c59565b61ffff861660009081526007602052604090205484511115612b195760405162461bcd60e51b815260206004820152602260248201527f62617463682073697a65206578636565647320647374206261746368206c696d6044820152611a5d60f21b6064820152608401610c59565b60005b8451811015612b5c57612b4a888888888581518110612b3d57612b3d614d45565b6020026020010151613404565b80612b54816148fc565b915050612b1c565b5060008585604051602001612b72929190614c36565b6040516020818303038152906040529050612bb7876001848851600860008d61ffff1661ffff16815260200190815260200160002054612bb29190614833565b613448565b6000612bc234613522565b9050612bd28883878787866135f4565b86604051612be09190614d5b565b6040518091039020896001600160a01b03168961ffff167fe1b87c47fdeb4f9cbadbca9df3af7aba453bb6e501075d0440d88125b711522a89604051612c269190614d77565b60405180910390a4505050505050505050565b600080612c45836126e0565b612ca65760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c59565b612caf8361378f565b6000818152600d60205260409020546001600160a01b031694909350915050565b60008082806020019051810190612ce791906149ac565b601482015191935091506000612cff88838386612e79565b90508251811015612dd35784516020808701919091206040805160808101825261ffff808d1682526001600160a01b0380881683870190815283850188815260016060860181815260008981526009909a529887902095518654935190941662010000026001600160b01b03199093169390941692909217178355519082015592516002909301805493151560ff199094169390931790925590517f10e0b70d256bccc84b7027506978bd8b68984a870788b93b479def144c839ad790612dc99083908990614d8a565b60405180910390a1505b816001600160a01b031687604051612deb9190614d5b565b60405180910390208961ffff167f5b821db8a46f8ecbe1941ba2f51cfeea9643268b56631f70d45e2a745d99026586604051612e279190614d77565b60405180910390a45050505050505050565b611d8b82826040518060200160405280600081525061379c565b601354600090600160a01b900460ff16612e6e576001612e71565b60005b60ff16905090565b6000825b8251811015612639576006545a1015612e9557612639565b612eb98686858481518110612eac57612eac614d45565b60200260200101516137c1565b80612ec3816148fc565b915050612e7d565b612ed6848484612840565b612ee48484846001856137fa565b611dc15760405162461bcd60e51b8152600401610c5990614da3565b606081612f245750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612f4e5780612f38816148fc565b9150612f479050600a83614868565b9150612f28565b6000816001600160401b03811115612f6857612f68613e19565b6040519080825280601f01601f191660200182016040528015612f92576020820181803683370190505b5090505b841561283857612fa7600183614a66565b9150612fb4600a86614df8565b612fbf9060306148e4565b60f81b818381518110612fd457612fd4614d45565b60200101906001600160f81b031916908160001a905350612ff6600a86614868565b9450612f96565b6000601554421061300d57600080fd5b60008462ffffff1661301d611c24565b61302791906148e4565b60115490915062ffffff161561304b5760115462ffffff1681111561304b57600080fd5b60405163d7ec901960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d7ec90199061309d908990899089908990600401614e0c565b60206040518083038186803b1580156130b557600080fd5b505afa1580156130c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130ed9190614e7c565b9695505050505050565b6000613102600e5490565b9050600082116131625760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610c59565b6001600160a01b0383166131c45760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c59565b81600e60008282546131d691906148e4565b90915550506000818152600d6020526040902080546001600160a01b0319166001600160a01b03851617905561320d600a826133d8565b60008061321a84846148e4565b90506001600160a01b038516915082826000600080516020614fc3833981519152600080a4600183015b81811461326a5780836000600080516020614fc3833981519152600080a4600101613244565b50610f77565b6000606060008060008661ffff166001600160401b0381111561329557613295613e19565b6040519080825280601f01601f1916602001820160405280156132bf576020820181803683370190505b50905060008087516020890160008d8df191503d9250868311156132e1578692505b828152826000602083013e909890975095505050505050565b8180519060200120600360008761ffff1661ffff1681526020019081526020016000208560405161332b9190614d5b565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906115af9087908790879087908790614e99565b60006001600160e01b0319821663152a902d60e11b14806133b957506001600160e01b031982166322bac5d960e01b145b80610e3b57506301ffc9a760e01b6001600160e01b0319831614610e3b565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b836001600160a01b031661341782611623565b6001600160a01b03161461342a57600080fd5b6134348482612773565b61343d57600080fd5b611dc18430836111e4565b60006134538361393c565b61ffff8087166000908152600160209081526040808320938916835292905290812054919250906134859084906148e4565b9050600081116134d45760405162461bcd60e51b815260206004820152601a602482015279131e905c1c0e881b5a5b91d85cd31a5b5a5d081b9bdd081cd95d60321b6044820152606401610c59565b8082101561170b5760405162461bcd60e51b815260206004820152601b60248201527a4c7a4170703a20676173206c696d697420697320746f6f206c6f7760281b6044820152606401610c59565b60055460009081906127109061353c9061ffff1685614833565b6135469190614868565b90506135528184614a66565b915080156135ee576005546040516000916201000090046001600160a01b03169083908381818185875af1925050503d80600081146135ad576040519150601f19603f3d011682016040523d82523d6000602084013e6135b2565b606091505b50509050806135ec5760405162461bcd60e51b8152600401610c59906020808252600490820152632166656560e01b604082015260600190565b505b50919050565b61ffff8616600090815260208190526040812080546136129061474d565b80601f016020809104026020016040519081016040528092919081815260200182805461363e9061474d565b801561368b5780601f106136605761010080835404028352916020019161368b565b820191906000526020600020905b81548152906001019060200180831161366e57829003601f168201915b505050505090508051600014156136fd5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b6064820152608401610c59565b60405162c5803160e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c5803100908490613754908b9086908c908c908c908c90600401614eeb565b6000604051808303818588803b15801561376d57600080fd5b505af1158015613781573d6000803e3d6000fd5b505050505050505050505050565b6000610e3b600a83613997565b60006137a7600e5490565b90506137b384846130f7565b612ee46000858386866137fa565b6137ca816126e0565b80156137e65750306137db82611623565b6001600160a01b0316145b6137ef57600080fd5b61111a3083836111e4565b60006001600160a01b0385163b1561393057506001835b61381b84866148e4565b81101561392a57604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906138549033908b9086908990600401614f52565b602060405180830381600087803b15801561386e57600080fd5b505af192505050801561389e575060408051601f3d908101601f1916820190925261389b91810190614f85565b60015b6138f8573d8080156138cc576040519150601f19603f3d011682016040523d82523d6000602084013e6138d1565b606091505b5080516138f05760405162461bcd60e51b8152600401610c5990614da3565b805181602001fd5b82801561391557506001600160e01b03198116630a85bd0160e11b145b92505080613922816148fc565b915050613811565b50612639565b50600195945050505050565b600060228251101561398f5760405162461bcd60e51b815260206004820152601c60248201527b4c7a4170703a20696e76616c69642061646170746572506172616d7360201b6044820152606401610c59565b506022015190565b600881901c60008181526020849052604081205490919060ff808516919082181c80156139d9576139c781613a8f565b60ff168203600884901b179350613a86565b60008311613a465760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610c59565b506000199091016000818152602086905260409020549091908015613a8157613a6e81613a8f565b60ff0360ff16600884901b179350613a86565b6139d9565b50505092915050565b60006040518061012001604052806101008152602001614fe3610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff613ad885613af9565b02901c81518110613aeb57613aeb614d45565b016020015160f81c92915050565b6000808211613b0757600080fd5b5060008190031690565b828054613b1d9061474d565b90600052602060002090601f016020900481019282613b3f5760008555613b85565b82601f10613b5857805160ff1916838001178555613b85565b82800160010185558215613b85579182015b82811115613b85578251825591602001919060010190613b6a565b50613b91929150613b95565b5090565b5b80821115613b915760008155600101613b96565b803561ffff81168114613bbc57600080fd5b919050565b60008083601f840112613bd357600080fd5b5081356001600160401b03811115613bea57600080fd5b602083019150836020828501011115613c0257600080fd5b9250929050565b80356001600160401b0381168114613bbc57600080fd5b60008060008060008060808789031215613c3957600080fd5b613c4287613baa565b955060208701356001600160401b0380821115613c5e57600080fd5b613c6a8a838b01613bc1565b9097509550859150613c7e60408a01613c09565b94506060890135915080821115613c9457600080fd5b50613ca189828a01613bc1565b979a9699509497509295939492505050565b6001600160e01b03198116811461179457600080fd5b600060208284031215613cdb57600080fd5b8135613ce681613cb3565b9392505050565b60005b83811015613d08578181015183820152602001613cf0565b83811115611dc15750506000910152565b60008151808452613d31816020860160208601613ced565b601f01601f19169290920160200192915050565b602081526000613ce66020830184613d19565b600060208284031215613d6a57600080fd5b613ce682613baa565b600060208284031215613d8557600080fd5b5035919050565b6001600160a01b038116811461179457600080fd5b8035613bbc81613d8c565b60008060408385031215613dbf57600080fd5b8235613dca81613d8c565b946020939093013593505050565b600080600060608486031215613ded57600080fd5b8335613df881613d8c565b92506020840135613e0881613d8c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613e5757613e57613e19565b604052919050565b60006001600160401b03821115613e7857613e78613e19565b50601f01601f191660200190565b6000613e99613e9484613e5f565b613e2f565b9050828152838383011115613ead57600080fd5b828260208301376000602084830101529392505050565b600082601f830112613ed557600080fd5b613ce683833560208501613e86565b801515811461179457600080fd5b600080600080600060a08688031215613f0a57600080fd5b613f1386613baa565b945060208601356001600160401b0380821115613f2f57600080fd5b613f3b89838a01613ec4565b95506040880135945060608801359150613f5482613ee4565b90925060808701359080821115613f6a57600080fd5b50613f7788828901613ec4565b9150509295509295909350565b60008060408385031215613f9757600080fd5b50508035926020909101359150565b600060208284031215613fb857600080fd5b8135613ce681613d8c565b600080600060408486031215613fd857600080fd5b613fe184613baa565b925060208401356001600160401b03811115613ffc57600080fd5b61400886828701613bc1565b9497909650939450505050565b60008060008060006080868803121561402d57600080fd5b61403686613baa565b945060208601356001600160401b0381111561405157600080fd5b61405d88828901613bc1565b9699909850959660408101359660609091013595509350505050565b600080600080600080600060e0888a03121561409457600080fd5b873561409f81613d8c565b96506140ad60208901613baa565b955060408801356001600160401b03808211156140c957600080fd5b6140d58b838c01613ec4565b965060608a0135955060808a013591506140ee82613d8c565b90935060a08901359061410082613d8c565b90925060c0890135908082111561411657600080fd5b506141238a828b01613ec4565b91505092959891949750929550565b803562ffffff81168114613bbc57600080fd5b60006020828403121561415757600080fd5b613ce682614132565b60008060006060848603121561417557600080fd5b61417e84613baa565b925060208401356001600160401b0381111561419957600080fd5b6141a586828701613ec4565b9250506141b460408501613c09565b90509250925092565b803560ff81168114613bbc57600080fd5b6000602082840312156141e057600080fd5b613ce6826141bd565b600080604083850312156141fc57600080fd5b61420583613baa565b915061127460208401613baa565b60006020828403121561422557600080fd5b81356001600160401b0381111561423b57600080fd5b61283884828501613ec4565b6000806040838503121561425a57600080fd5b613dca83613baa565b6000806040838503121561427657600080fd5b823561428181613d8c565b9150602083013561429181613ee4565b809150509250929050565b60006001600160401b038211156142b5576142b5613e19565b5060051b60200190565b600082601f8301126142d057600080fd5b813560206142e0613e948361429c565b82815260059290921b840181019181810190868411156142ff57600080fd5b8286015b8481101561431a5780358352918301918301614303565b509695505050505050565b600080600080600080600060e0888a03121561434057600080fd5b873561434b81613d8c565b965061435960208901613baa565b955060408801356001600160401b038082111561437557600080fd5b6143818b838c01613ec4565b965060608a013591508082111561439757600080fd5b6143a38b838c016142bf565b955060808a013591506143b582613d8c565b8194506143c460a08b01613da1565b935060c08a013591508082111561411657600080fd5b6000602082840312156143ec57600080fd5b81356001600160401b0381111561440257600080fd5b8201601f8101841361441357600080fd5b61283884823560208401613e86565b6000806000806080858703121561443857600080fd5b843561444381613d8c565b9350602085013561445381613d8c565b92506040850135915060608501356001600160401b0381111561447557600080fd5b61448187828801613ec4565b91505092959194509250565b6000806000806000608086880312156144a557600080fd5b6144ae86613baa565b94506144bc60208701613baa565b93506040860135925060608601356001600160401b038111156144de57600080fd5b6144ea88828901613bc1565b969995985093965092949392505050565b6000806000806080858703121561451157600080fd5b843561451c81613d8c565b9350602061452b868201614132565b935060408601356001600160401b0381111561454657600080fd5b8601601f8101881361455757600080fd5b8035614565613e948261429c565b81815260059190911b8201830190838101908a83111561458457600080fd5b928401925b828410156145a257833582529284019290840190614589565b80965050505050506145b6606086016141bd565b905092959194509250565b6000806000606084860312156145d657600080fd5b6145df84613baa565b92506145ed60208501613baa565b9150604084013590509250925092565b60008060008060008060c0878903121561461657600080fd5b61461f876141bd565b955060208701359450604087013593506060870135925061464260808801614132565b915060a087013590509295509295509295565b6000806040838503121561466857600080fd5b823561467381613d8c565b9150602083013561429181613d8c565b600080600080600060a0868803121561469b57600080fd5b6146a486613baa565b945060208601356001600160401b03808211156146c057600080fd5b6146cc89838a01613ec4565b955060408801359150808211156146e257600080fd5b6146ee89838a016142bf565b945060608801359150613f5482613ee4565b6000806000806080858703121561471657600080fd5b61471f85613baa565b935061472d60208601613baa565b9250604085013561473d81613d8c565b9396929550929360600135925050565b600181811c9082168061476157607f821691505b602082108114156135ee57634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b6020808252601e908201527f4c7a4170703a2063616c6c6572206973206e6f7420746865206f776e65720000604082015260600190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561484d5761484d61481d565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261487757614877614852565b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8416815260406020820152600061263960408301848661487c565b8284823760609190911b6001600160601b0319169101908152601401919050565b600082198211156148f7576148f761481d565b500190565b60006000198214156149105761491061481d565b5060010190565b60006020828403121561492957600080fd5b5051919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600082601f83011261497857600080fd5b8151614986613e9482613e5f565b81815284602083860101111561499b57600080fd5b612838826020830160208701613ced565b600080604083850312156149bf57600080fd5b82516001600160401b03808211156149d657600080fd5b6149e286838701614967565b93506020915081850151818111156149f957600080fd5b85019050601f81018613614a0c57600080fd5b8051614a1a613e948261429c565b81815260059190911b82018301908381019088831115614a3957600080fd5b928401925b82841015614a5757835182529284019290840190614a3e565b80955050505050509250929050565b600082821015614a7857614a7861481d565b500390565b8054600090600181811c9080831680614a9757607f831692505b6020808410821415614ab957634e487b7160e01b600052602260045260246000fd5b818015614acd5760018114614ade57614b0b565b60ff19861689528489019650614b0b565b60008881526020902060005b86811015614b035781548b820152908501908301614aea565b505084890196505b50505050505092915050565b66697066733a2f2f60c81b81526000614b336007830185614a7d565b602f60f81b81528351614b4d816001840160208801613ced565b64173539b7b760d91b60019290910191820152600601949350505050565b600061ffff808816835280871660208401525084604083015260806060830152614b9960808301848661487c565b979650505050505050565b61ffff86168152608060208201526000614bc260808301868861487c565b6001600160401b0394909416604083015250606001529392505050565b66697066733a2f2f60c81b81526000613ce66007830184614a7d565b600081518084526020808501945080840160005b83811015614c2b57815187529582019590820190600101614c0f565b509495945050505050565b604081526000614c496040830185613d19565b82810360208401526126398185614bfb565b61ffff861681526001600160a01b038516602082015260a060408201819052600090614c8990830186613d19565b84151560608401528281036080840152614ca38185613d19565b98975050505050505050565b60008060408385031215614cc257600080fd5b505080516020909101519092909150565b600060208284031215614ce557600080fd5b81516001600160401b03811115614cfb57600080fd5b61283884828501614967565b61ffff85168152608060208201526000614d246080830186613d19565b6001600160401b03851660408401528281036060840152614b998185613d19565b634e487b7160e01b600052603260045260246000fd5b60008251614d6d818460208701613ced565b9190910192915050565b602081526000613ce66020830184614bfb565b8281526040602082015260006128386040830184613d19565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b600082614e0757614e07614852565b500690565b6001600160a01b038516815262ffffff841660208083019190915260806040830181905284519083018190526000918581019160a0850190845b81811015614e6257845183529383019391830191600101614e46565b505080935050505060ff8316606083015295945050505050565b600060208284031215614e8e57600080fd5b8151613ce681613ee4565b61ffff8616815260a060208201526000614eb660a0830187613d19565b6001600160401b03861660408401528281036060840152614ed78186613d19565b90508281036080840152614ca38185613d19565b61ffff8716815260c060208201526000614f0860c0830188613d19565b8281036040840152614f1a8188613d19565b6001600160a01b0387811660608601528616608085015283810360a08501529050614f458185613d19565b9998505050505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130ed90830184613d19565b600060208284031215614f9757600080fd5b8151613ce681613cb356fe8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ceddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220f400644bde4194f887ecd8e5adcec733a147ba7b9a0e911b5590b06308c6d40864736f6c63430008090033a2646970667358221220302e9a6b874fa305ab5f78791fcad0873054f2f587536dd3269097da07fddf9164736f6c63430008090033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.