Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- ArtefinNFT
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 1000
- EVM Version
- default
- Verified at
- 2024-09-26T15:24:36.768340Z
Contract source code
// SPDX-License-Identifier: GPL
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;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
abstract contract Ownable is Context {
address internal _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
abstract contract MinterRole is Ownable {
mapping (address => bool) public minter_role;
function setMinterRole(address _who, bool _status) public onlyOwner
{
minter_role[_who] = _status;
}
modifier onlyMinter
{
require(minter_role[msg.sender], "Minter role required");
_;
}
}
//https://github.com/willitscale/solidity-util/blob/000a42d4d7c1491cde4381c29d4b775fa7e99aac/lib/Strings.sol#L317-L336
/**
* Strings Library
*
* In summary this is a simple library of string functions which make simple
* string operations less tedious in solidity.
*
* Please be aware these functions can be quite gas heavy so use them only when
* necessary not to clog the blockchain with expensive transactions.
*
* @author James Lockhart <[email protected]>
*/
library Strings {
/**
* Concat (High gas cost)
*
* Appends two strings together and returns a new value
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string which will be the concatenated
* prefix
* @param _value The value to be the concatenated suffix
* @return string The resulting string from combinging the base and value
*/
function concat(string memory _base, string memory _value)
internal
pure
returns (string memory) {
bytes memory _baseBytes = bytes(_base);
bytes memory _valueBytes = bytes(_value);
assert(_valueBytes.length > 0);
string memory _tmpValue = new string(_baseBytes.length +
_valueBytes.length);
bytes memory _newValue = bytes(_tmpValue);
uint i;
uint j;
for (i = 0; i < _baseBytes.length; i++) {
_newValue[j++] = _baseBytes[i];
}
for (i = 0; i < _valueBytes.length; i++) {
_newValue[j++] = _valueBytes[i];
}
return string(_newValue);
}
/**
* Index Of
*
* Locates and returns the position of a character within a string
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string acting as the haystack to be
* searched
* @param _value The needle to search for, at present this is currently
* limited to one character
* @return int The position of the needle starting from 0 and returning -1
* in the case of no matches found
*/
function indexOf(string memory _base, string memory _value)
internal
pure
returns (int) {
return _indexOf(_base, _value, 0);
}
/**
* Index Of
*
* Locates and returns the position of a character within a string starting
* from a defined offset
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string acting as the haystack to be
* searched
* @param _value The needle to search for, at present this is currently
* limited to one character
* @param _offset The starting point to start searching from which can start
* from 0, but must not exceed the length of the string
* @return int The position of the needle starting from 0 and returning -1
* in the case of no matches found
*/
function _indexOf(string memory _base, string memory _value, uint _offset)
internal
pure
returns (int) {
bytes memory _baseBytes = bytes(_base);
bytes memory _valueBytes = bytes(_value);
assert(_valueBytes.length == 1);
for (uint i = _offset; i < _baseBytes.length; i++) {
if (_baseBytes[i] == _valueBytes[0]) {
return int(i);
}
}
return -1;
}
/**
* Length
*
* Returns the length of the specified string
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string to be measured
* @return uint The length of the passed string
*/
function length(string memory _base)
internal
pure
returns (uint) {
bytes memory _baseBytes = bytes(_base);
return _baseBytes.length;
}
/**
* Sub String
*
* Extracts the beginning part of a string based on the desired length
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string that will be used for
* extracting the sub string from
* @param _length The length of the sub string to be extracted from the base
* @return string The extracted sub string
*/
function substring(string memory _base, int _length)
internal
pure
returns (string memory) {
return _substring(_base, _length, 0);
}
/**
* Sub String
*
* Extracts the part of a string based on the desired length and offset. The
* offset and length must not exceed the lenth of the base string.
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string that will be used for
* extracting the sub string from
* @param _length The length of the sub string to be extracted from the base
* @param _offset The starting point to extract the sub string from
* @return string The extracted sub string
*/
function _substring(string memory _base, int _length, int _offset)
internal
pure
returns (string memory) {
bytes memory _baseBytes = bytes(_base);
assert(uint(_offset + _length) <= _baseBytes.length);
string memory _tmp = new string(uint(_length));
bytes memory _tmpBytes = bytes(_tmp);
uint j = 0;
for (uint i = uint(_offset); i < uint(_offset + _length); i++) {
_tmpBytes[j++] = _baseBytes[i];
}
return string(_tmpBytes);
}
function split(string memory _base, string memory _value)
internal
pure
returns (string[] memory splitArr) {
bytes memory _baseBytes = bytes(_base);
uint _offset = 0;
uint _splitsCount = 1;
while (_offset < _baseBytes.length - 1) {
int _limit = _indexOf(_base, _value, _offset);
if (_limit == -1)
break;
else {
_splitsCount++;
_offset = uint(_limit) + 1;
}
}
splitArr = new string[](_splitsCount);
_offset = 0;
_splitsCount = 0;
while (_offset < _baseBytes.length - 1) {
int _limit = _indexOf(_base, _value, _offset);
if (_limit == - 1) {
_limit = int(_baseBytes.length);
}
string memory _tmp = new string(uint(_limit) - _offset);
bytes memory _tmpBytes = bytes(_tmp);
uint j = 0;
for (uint i = _offset; i < uint(_limit); i++) {
_tmpBytes[j++] = _baseBytes[i];
}
_offset = uint(_limit) + 1;
splitArr[_splitsCount++] = string(_tmpBytes);
}
return splitArr;
}
/**
* Compare To
*
* Compares the characters of two strings, to ensure that they have an
* identical footprint
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string base to compare against
* @param _value The string the base is being compared to
* @return bool Simply notates if the two string have an equivalent
*/
function compareTo(string memory _base, string memory _value)
internal
pure
returns (bool) {
bytes memory _baseBytes = bytes(_base);
bytes memory _valueBytes = bytes(_value);
if (_baseBytes.length != _valueBytes.length) {
return false;
}
for (uint i = 0; i < _baseBytes.length; i++) {
if (_baseBytes[i] != _valueBytes[i]) {
return false;
}
}
return true;
}
/**
* Compare To Ignore Case (High gas cost)
*
* Compares the characters of two strings, converting them to the same case
* where applicable to alphabetic characters to distinguish if the values
* match.
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string base to compare against
* @param _value The string the base is being compared to
* @return bool Simply notates if the two string have an equivalent value
* discarding case
*/
function compareToIgnoreCase(string memory _base, string memory _value)
internal
pure
returns (bool) {
bytes memory _baseBytes = bytes(_base);
bytes memory _valueBytes = bytes(_value);
if (_baseBytes.length != _valueBytes.length) {
return false;
}
for (uint i = 0; i < _baseBytes.length; i++) {
if (_baseBytes[i] != _valueBytes[i] &&
_upper(_baseBytes[i]) != _upper(_valueBytes[i])) {
return false;
}
}
return true;
}
/**
* Upper
*
* Converts all the values of a string to their corresponding upper case
* value.
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string base to convert to upper case
* @return string
*/
function upper(string memory _base)
internal
pure
returns (string memory) {
bytes memory _baseBytes = bytes(_base);
for (uint i = 0; i < _baseBytes.length; i++) {
_baseBytes[i] = _upper(_baseBytes[i]);
}
return string(_baseBytes);
}
/**
* Lower
*
* Converts all the values of a string to their corresponding lower case
* value.
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string base to convert to lower case
* @return string
*/
function lower(string memory _base)
internal
pure
returns (string memory) {
bytes memory _baseBytes = bytes(_base);
for (uint i = 0; i < _baseBytes.length; i++) {
_baseBytes[i] = _lower(_baseBytes[i]);
}
return string(_baseBytes);
}
/**
* Upper
*
* Convert an alphabetic character to upper case and return the original
* value when not alphabetic
*
* @param _b1 The byte to be converted to upper case
* @return bytes1 The converted value if the passed value was alphabetic
* and in a lower case otherwise returns the original value
*/
function _upper(bytes1 _b1)
private
pure
returns (bytes1) {
if (_b1 >= 0x61 && _b1 <= 0x7A) {
return bytes1(uint8(_b1) - 32);
}
return _b1;
}
/**
* Lower
*
* Convert an alphabetic character to lower case and return the original
* value when not alphabetic
*
* @param _b1 The byte to be converted to lower case
* @return bytes1 The converted value if the passed value was alphabetic
* and in a upper case otherwise returns the original value
*/
function _lower(bytes1 _b1)
private
pure
returns (bytes1) {
if (_b1 >= 0x41 && _b1 <= 0x5A) {
return bytes1(uint8(_b1) + 32);
}
return _b1;
}
}
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
interface ICallistoNFT {
event NewBid (uint256 indexed tokenID, uint256 indexed bidAmount, bytes data);
event NewPrice (uint256 indexed tokenID, uint256 indexed priceValue, bytes data);
event TokenTrade (uint256 indexed tokenID, address indexed new_owner, address indexed previous_owner, uint256 priceInWEI);
event Transfer (address indexed from, address indexed to, uint256 indexed tokenId);
event TransferData (bytes data);
struct Properties {
// In this example properties of the given NFT are stored
// in a dynamically sized array of strings
// properties can be re-defined for any specific info
// that a particular NFT is intended to store.
/* Properties could look like this:
bytes property1;
bytes property2;
address property3;
*/
string[] properties;
}
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function standard() external view returns (string memory);
function balanceOf(address _who) external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
function transfer(address _to, uint256 _tokenId, bytes calldata _data) external returns (bool);
function silentTransfer(address _to, uint256 _tokenId) external returns (bool);
function priceOf(uint256 _tokenId) external view returns (uint256);
function bidOf(uint256 _tokenId) external view returns (uint256 price, address payable bidder, uint256 timestamp);
function getTokenProperties(uint256 _tokenId) external view returns (Properties memory);
function setBid(uint256 _tokenId, bytes calldata _data) payable external; // bid amount is defined by msg.value
function setPrice(uint256 _tokenId, uint256 _amountInWEI, bytes calldata _data) external;
function withdrawBid(uint256 _tokenId) external returns (bool);
function getUserContent(uint256 _tokenId) external view returns (string memory _content);
function setUserContent(uint256 _tokenId, string calldata _content) external returns (bool);
}
abstract contract NFTReceiver {
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external virtual returns(bytes4);
}
// ExtendedNFT is a version of the CallistoNFT standard token
// that implements a set of function for NFT content management
contract ExtendedNFT is ICallistoNFT, ReentrancyGuard {
using Strings for string;
using Address for address;
event TokenPropertyUpdated(uint tokenID, uint propertyID);
mapping (uint256 => Properties) private _tokenProperties;
mapping (uint32 => Fee) public feeLevels; // level # => (fee receiver, fee percentage)
uint256 public bidLock = 1 days; // Time required for a bid to become withdrawable.
struct Bid {
address payable bidder;
uint256 amountInWEI;
uint256 timestamp;
}
struct Fee {
address payable feeReceiver;
uint256 feePercentage; // Will be divided by 100000 during calculations
// feePercentage of 100 means 0.1% fee
// feePercentage of 2500 means 2.5% fee
}
mapping (uint256 => uint256) private _asks; // tokenID => price of this token (in WEI)
mapping (uint256 => Bid) private _bids; // tokenID => price of this token (in WEI)
mapping (uint256 => uint32) internal _tokenFeeLevels; // tokenID => level ID / 0 by default
uint256 public next_mint_id;
// Token name
string internal _name;
// Token symbol
string internal _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) internal _owners;
// Mapping owner address to token count
mapping(address => uint256) internal _balances;
// Reward is always paid based on BID
modifier checkTrade(uint256 _tokenId, bytes calldata _data)
{
_;
(uint256 _bid, address payable _bidder,) = bidOf(_tokenId);
if(priceOf(_tokenId) > 0 && priceOf(_tokenId) <= _bid)
{
uint256 _reward = _bid - _claimFee(_bid, _tokenId);
emit TokenTrade(_tokenId, _bidder, ownerOf(_tokenId), _reward);
bool sent = payable(ownerOf(_tokenId)).send(_reward);
//bytes calldata _empty;
delete _bids[_tokenId];
delete _asks[_tokenId];
_transfer(ownerOf(_tokenId), _bidder, _tokenId, _data);
}
}
function standard() public view virtual override returns (string memory)
{
return "CallistoNFT";
}
function mint() internal returns (uint256 _mintedId)
{
_safeMint(msg.sender, next_mint_id);
_mintedId = next_mint_id;
next_mint_id++;
_configureNFT(_mintedId);
}
function priceOf(uint256 _tokenId) public view virtual override returns (uint256)
{
address owner = _owners[_tokenId];
require(owner != address(0), "NFT: owner query for nonexistent token");
return _asks[_tokenId];
}
function bidOf(uint256 _tokenId) public view virtual override returns (uint256 price, address payable bidder, uint256 timestamp)
{
address owner = _owners[_tokenId];
require(owner != address(0), "NFT: owner query for nonexistent token");
return (_bids[_tokenId].amountInWEI, _bids[_tokenId].bidder, _bids[_tokenId].timestamp);
}
function getTokenProperties(uint256 _tokenId) public view virtual override returns (Properties memory)
{
return _tokenProperties[_tokenId];
}
function getTokenProperty(uint256 _tokenId, uint256 _propertyId) public view virtual returns (string memory)
{
return _tokenProperties[_tokenId].properties[_propertyId];
}
function getUserContent(uint256 _tokenId) public view virtual override returns (string memory _content)
{
return (_tokenProperties[_tokenId].properties[0]);
}
function setUserContent(uint256 _tokenId, string calldata _content) public virtual override returns (bool success)
{
require(msg.sender == ownerOf(_tokenId), "NFT: only owner can change NFT content");
_tokenProperties[_tokenId].properties[0] = _content;
emit TokenPropertyUpdated(_tokenId, 0) ;
return true;
}
function _addPropertyWithContent(uint256 _tokenId, string calldata _content) internal
{
// Check permission criteria
_tokenProperties[_tokenId].properties.push(_content);
uint newPropertyID = _tokenProperties[_tokenId].properties.length - 1;
emit TokenPropertyUpdated(_tokenId, newPropertyID);
}
function _modifyProperty(uint256 _tokenId, uint256 _propertyId, string calldata _content) internal
{
_tokenProperties[_tokenId].properties[_propertyId] = _content;
emit TokenPropertyUpdated(_tokenId, _propertyId);
}
function _appendProperty(uint256 _tokenId, uint256 _propertyId, string calldata _content) internal
{
_tokenProperties[_tokenId].properties[_propertyId] = _tokenProperties[_tokenId].properties[_propertyId].concat(_content);
emit TokenPropertyUpdated(_tokenId, _propertyId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "NFT: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "NFT: owner query for nonexistent token");
return owner;
}
// Price == 0, "NFT not on sale"
// Price > 0, "NFT on sale"
function setPrice(uint256 _tokenId, uint256 _amountInWEI, bytes calldata _data) checkTrade(_tokenId, _data) public virtual override nonReentrant {
require(ownerOf(_tokenId) == msg.sender, "Setting asks is only allowed for owned NFTs!");
_asks[_tokenId] = _amountInWEI;
emit NewPrice(_tokenId, _amountInWEI, _data);
}
function setBid(uint256 _tokenId, bytes calldata _data) payable checkTrade(_tokenId, _data) public virtual override nonReentrant
{
(uint256 _previousBid, address payable _previousBidder, ) = bidOf(_tokenId);
require(msg.value > _previousBid, "New bid must exceed the existing one");
uint256 _bid;
// Return previous bid if the current one exceeds it.
if(_previousBid != 0)
{
bool sent = _previousBidder.send(_previousBid);
}
// Refund overpaid amount if price is greater than 0
if (priceOf(_tokenId) < msg.value && priceOf(_tokenId) > 0)
{
_bid = priceOf(_tokenId);
}
else
{
_bid = msg.value;
}
_bids[_tokenId].amountInWEI = _bid;
_bids[_tokenId].bidder = payable(msg.sender);
_bids[_tokenId].timestamp = block.timestamp;
emit NewBid(_tokenId, _bid, _data);
// Send back overpaid amount.
// WARNING: Creates possibility for reentrancy.
if (priceOf(_tokenId) < msg.value && priceOf(_tokenId) > 0)
{
bool sent = payable(msg.sender).send(msg.value - priceOf(_tokenId));
}
}
function withdrawBid(uint256 _tokenId) public virtual override nonReentrant returns (bool)
{
(uint256 _bid, address payable _bidder, uint256 _timestamp) = bidOf(_tokenId);
require(msg.sender == _bidder, "Can not withdraw someone elses bid");
require(block.timestamp > _timestamp + bidLock, "Bid is time-locked");
bool sent = _bidder.send(_bid);
delete _bids[_tokenId];
emit NewBid(_tokenId, 0, "0x7769746864726177426964");
return true;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function transfer(address _to, uint256 _tokenId, bytes calldata _data) public override returns (bool)
{
_transfer(msg.sender, _to, _tokenId, _data);
emit TransferData(_data);
return true;
}
function silentTransfer(address _to, uint256 _tokenId) public override returns (bool)
{
require(ExtendedNFT.ownerOf(_tokenId) == msg.sender, "NFT: transfer of token that is not own");
require(_to != address(0), "NFT: transfer to the zero address");
_asks[_tokenId] = 0; // Zero out price on transfer
// When a user transfers the NFT to another user
// it does not automatically mean that the new owner
// would like to sell this NFT at a price
// specified by the previous owner.
// However bids persist regardless of token transfers
// because we assume that the bidder still wants to buy the NFT
// no matter from whom.
_beforeTokenTransfer(msg.sender, _to, _tokenId);
_balances[msg.sender] -= 1;
_balances[_to] += 1;
_owners[_tokenId] = _to;
emit Transfer(msg.sender, _to, _tokenId);
return true;
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _claimFee(uint256 _amountFrom, uint256 _tokenId) internal returns (uint256)
{
uint32 _level = _tokenFeeLevels[_tokenId];
address _feeReceiver = feeLevels[_level].feeReceiver;
uint256 _feePercentage = feeLevels[_level].feePercentage;
uint256 _feeAmount = _amountFrom * _feePercentage / 100000;
bool sent = payable(_feeReceiver).send(_feeAmount);
return _feeAmount;
}
function _safeMint(
address to,
uint256 tokenId
) internal virtual {
_mint(to, tokenId);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "NFT: mint to the zero address");
require(!_exists(tokenId), "NFT: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ExtendedNFT.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId,
bytes calldata data
) internal virtual {
require(ExtendedNFT.ownerOf(tokenId) == from, "NFT: transfer of token that is not own");
require(to != address(0), "NFT: transfer to the zero address");
_asks[tokenId] = 0; // Zero out price on transfer
// When a user transfers the NFT to another user
// it does not automatically mean that the new owner
// would like to sell this NFT at a price
// specified by the previous owner.
// However bids persist regardless of token transfers
// because we assume that the bidder still wants to buy the NFT
// no matter from whom.
_beforeTokenTransfer(from, to, tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
if(to.isContract())
{
NFTReceiver(to).onERC721Received(msg.sender, from, tokenId, data);
}
emit Transfer(from, to, tokenId);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _configureNFT(uint256 _tokenId) internal
{
if(_tokenProperties[_tokenId].properties.length == 0)
{
_tokenProperties[_tokenId].properties.push("");
}
}
}
interface IClassifiedNFT is ICallistoNFT {
function setClassForTokenID(uint256 _tokenID, uint256 _tokenClass) external;
function addNewTokenClass(uint32 _feeLevel, string memory _property) external;
function addTokenClassProperties(uint256 _propertiesCount, uint256 classId) external;
function modifyClassProperty(uint256 _classID, uint256 _propertyID, string memory _content) external;
function getClassProperty(uint256 _classID, uint256 _propertyID) external view returns (string memory);
function addClassProperty(uint256 _classID) external;
function getClassProperties(uint256 _classID) external view returns (string[] memory);
function getClassForTokenID(uint256 _tokenID) external view returns (uint256);
function getClassPropertiesForTokenID(uint256 _tokenID) external view returns (string[] memory);
function getClassPropertyForTokenID(uint256 _tokenID, uint256 _propertyID) external view returns (string memory);
function mintWithClass(uint256 classId) external returns (uint256 _newTokenID);
function appendClassProperty(uint256 _classID, uint256 _propertyID, string memory _content) external;
}
abstract contract ClassifiedNFT is MinterRole, ExtendedNFT, IClassifiedNFT {
using Strings for string;
event ClassPropertyUpdated(uint classID, uint propertyID);
event TokenClassChanged(uint _tokenID, uint _tokenClass);
mapping (uint256 => string[]) public class_properties;
mapping (uint256 => uint32) public class_feeLevel;
mapping (uint256 => uint256) public token_classes;
uint256 public nextClassIndex = 0;
mapping (address => bool) public classAdmins;
modifier onlyExistingClasses(uint256 classId)
{
require(classId < nextClassIndex, "Queried class does not exist");
_;
}
modifier onlyClassAdmin() {
require(classAdmins[_msgSender()], "ClassifiedNFT: caller is not the Class Admin");
_;
}
function classAdmin (address _newClassAdmin, bool _enable) public onlyOwner {
classAdmins[_newClassAdmin] = _enable;
}
function setClassForTokenID(uint256 _tokenID, uint256 _tokenClass) public onlyOwner override
{
token_classes[_tokenID] = _tokenClass;
emit TokenClassChanged(_tokenID, _tokenClass);
}
function addNewTokenClass(uint32 _feeLevel, string memory _property) public onlyClassAdmin override
{
class_properties[nextClassIndex].push(_property);
class_feeLevel[nextClassIndex] = _feeLevel; // Configures who will receive fees from this class of NFTs
// Zero sets fees to default address and percentage.
emit ClassPropertyUpdated(nextClassIndex, 0);
nextClassIndex++;
}
function addTokenClassProperties(uint256 _propertiesCount, uint256 classId) public onlyClassAdmin override
{
for (uint i = 0; i < _propertiesCount; i++)
{
class_properties[classId].push("");
}
}
function modifyClassProperty(uint256 _classID, uint256 _propertyID, string memory _content) public onlyClassAdmin onlyExistingClasses(_classID) override
{
class_properties[_classID][_propertyID] = _content;
emit ClassPropertyUpdated(_classID, _propertyID);
}
function getClassProperty(uint256 _classID, uint256 _propertyID) public view onlyExistingClasses(_classID) override returns (string memory)
{
return class_properties[_classID][_propertyID];
}
function addClassProperty(uint256 _classID) public onlyClassAdmin onlyExistingClasses(_classID) override
{
class_properties[_classID].push("");
}
function addClassPropertyWithContent(uint256 _classID, string memory _content) public onlyClassAdmin onlyExistingClasses(_classID)
{
class_properties[_classID].push(_content);
uint newPropertyID = class_properties[_classID].length - 1;
emit ClassPropertyUpdated(_classID, newPropertyID);
}
function getClassProperties(uint256 _classID) public view onlyExistingClasses(_classID) override returns (string[] memory)
{
return class_properties[_classID];
}
function getClassForTokenID(uint256 _tokenID) public view onlyExistingClasses(token_classes[_tokenID]) override returns (uint256)
{
return token_classes[_tokenID];
}
function getClassPropertiesForTokenID(uint256 _tokenID) public view onlyExistingClasses(token_classes[_tokenID]) override returns (string[] memory)
{
return class_properties[token_classes[_tokenID]];
}
function getClassPropertyForTokenID(uint256 _tokenID, uint256 _propertyID) public view onlyExistingClasses(token_classes[_tokenID]) override returns (string memory)
{
return class_properties[token_classes[_tokenID]][_propertyID];
}
function mintWithClass(uint256 classId) public onlyExistingClasses(classId) onlyMinter override returns (uint256 _newTokenID)
{
//_mint(to, tokenId);
_newTokenID = mint();
token_classes[_newTokenID] = classId;
_tokenFeeLevels[_newTokenID] = class_feeLevel[classId];
}
function appendClassProperty(uint256 _classID, uint256 _propertyID, string memory _content) public onlyClassAdmin onlyExistingClasses(_classID) override
{
class_properties[_classID][_propertyID] = class_properties[_classID][_propertyID].concat(_content);
emit ClassPropertyUpdated(_classID, _propertyID);
}
}
contract ArtefinNFT is ExtendedNFT, ClassifiedNFT {
function initialize(string memory name_, string memory symbol_, uint256 _defaultFee) external {
require(_owner == address(0), "Already initialized");
_owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
bidLock = 1 days;
_name = name_;
_symbol = symbol_;
feeLevels[0].feeReceiver = payable(msg.sender);
feeLevels[0].feePercentage = _defaultFee;
}
function setFeeLevel(uint32 _levelIndex, address _feeReceiver, uint256 _feePercentage) public onlyOwner
{
feeLevels[_levelIndex].feeReceiver = payable(_feeReceiver);
feeLevels[_levelIndex].feePercentage = _feePercentage;
}
function setFeeLevelForToken(uint256 _tokenId, uint32 _feeLevel) public onlyOwner
{
_tokenFeeLevels[_tokenId] = _feeLevel;
}
function modifyClassFeeLevel(uint256 _classId, uint32 _feeLevel) public onlyOwner
{
class_feeLevel[_classId] = _feeLevel;
}
function addPropertyWithContent(uint256 _tokenId, string calldata _content) public /* onlyOwner or Minter */
{
require(owner() == msg.sender || minter_role[msg.sender], "Ownable: caller is not the owner");
_addPropertyWithContent( _tokenId, _content);
}
function modifyProperty(uint256 _tokenId, uint256 _propertyId, string calldata _content) public onlyOwner
{
_modifyProperty(_tokenId, _propertyId, _content);
}
function appendProperty(uint256 _tokenId, uint256 _propertyId, string calldata _content) public onlyOwner
{
_appendProperty(_tokenId, _propertyId, _content);
}
}
Contract ABI
[{"type":"event","name":"ClassPropertyUpdated","inputs":[{"type":"uint256","name":"classID","internalType":"uint256","indexed":false},{"type":"uint256","name":"propertyID","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"NewBid","inputs":[{"type":"uint256","name":"tokenID","internalType":"uint256","indexed":true},{"type":"uint256","name":"bidAmount","internalType":"uint256","indexed":true},{"type":"bytes","name":"data","internalType":"bytes","indexed":false}],"anonymous":false},{"type":"event","name":"NewPrice","inputs":[{"type":"uint256","name":"tokenID","internalType":"uint256","indexed":true},{"type":"uint256","name":"priceValue","internalType":"uint256","indexed":true},{"type":"bytes","name":"data","internalType":"bytes","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TokenClassChanged","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256","indexed":false},{"type":"uint256","name":"_tokenClass","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TokenPropertyUpdated","inputs":[{"type":"uint256","name":"tokenID","internalType":"uint256","indexed":false},{"type":"uint256","name":"propertyID","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TokenTrade","inputs":[{"type":"uint256","name":"tokenID","internalType":"uint256","indexed":true},{"type":"address","name":"new_owner","internalType":"address","indexed":true},{"type":"address","name":"previous_owner","internalType":"address","indexed":true},{"type":"uint256","name":"priceInWEI","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"TransferData","inputs":[{"type":"bytes","name":"data","internalType":"bytes","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addClassProperty","inputs":[{"type":"uint256","name":"_classID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addClassPropertyWithContent","inputs":[{"type":"uint256","name":"_classID","internalType":"uint256"},{"type":"string","name":"_content","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addNewTokenClass","inputs":[{"type":"uint32","name":"_feeLevel","internalType":"uint32"},{"type":"string","name":"_property","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addPropertyWithContent","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"string","name":"_content","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addTokenClassProperties","inputs":[{"type":"uint256","name":"_propertiesCount","internalType":"uint256"},{"type":"uint256","name":"classId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"appendClassProperty","inputs":[{"type":"uint256","name":"_classID","internalType":"uint256"},{"type":"uint256","name":"_propertyID","internalType":"uint256"},{"type":"string","name":"_content","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"appendProperty","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_propertyId","internalType":"uint256"},{"type":"string","name":"_content","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"bidLock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"price","internalType":"uint256"},{"type":"address","name":"bidder","internalType":"address payable"},{"type":"uint256","name":"timestamp","internalType":"uint256"}],"name":"bidOf","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"classAdmin","inputs":[{"type":"address","name":"_newClassAdmin","internalType":"address"},{"type":"bool","name":"_enable","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"classAdmins","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"class_feeLevel","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"class_properties","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"feeReceiver","internalType":"address payable"},{"type":"uint256","name":"feePercentage","internalType":"uint256"}],"name":"feeLevels","inputs":[{"type":"uint32","name":"","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getClassForTokenID","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string[]","name":"","internalType":"string[]"}],"name":"getClassProperties","inputs":[{"type":"uint256","name":"_classID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string[]","name":"","internalType":"string[]"}],"name":"getClassPropertiesForTokenID","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getClassProperty","inputs":[{"type":"uint256","name":"_classID","internalType":"uint256"},{"type":"uint256","name":"_propertyID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getClassPropertyForTokenID","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"},{"type":"uint256","name":"_propertyID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct ICallistoNFT.Properties","components":[{"type":"string[]","name":"properties","internalType":"string[]"}]}],"name":"getTokenProperties","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getTokenProperty","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_propertyId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"_content","internalType":"string"}],"name":"getUserContent","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"},{"type":"uint256","name":"_defaultFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"_newTokenID","internalType":"uint256"}],"name":"mintWithClass","inputs":[{"type":"uint256","name":"classId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"minter_role","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"modifyClassFeeLevel","inputs":[{"type":"uint256","name":"_classId","internalType":"uint256"},{"type":"uint32","name":"_feeLevel","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"modifyClassProperty","inputs":[{"type":"uint256","name":"_classID","internalType":"uint256"},{"type":"uint256","name":"_propertyID","internalType":"uint256"},{"type":"string","name":"_content","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"modifyProperty","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_propertyId","internalType":"uint256"},{"type":"string","name":"_content","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextClassIndex","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"next_mint_id","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"priceOf","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"setBid","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setClassForTokenID","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"},{"type":"uint256","name":"_tokenClass","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeLevel","inputs":[{"type":"uint32","name":"_levelIndex","internalType":"uint32"},{"type":"address","name":"_feeReceiver","internalType":"address"},{"type":"uint256","name":"_feePercentage","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeLevelForToken","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint32","name":"_feeLevel","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMinterRole","inputs":[{"type":"address","name":"_who","internalType":"address"},{"type":"bool","name":"_status","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPrice","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_amountInWEI","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"success","internalType":"bool"}],"name":"setUserContent","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"string","name":"_content","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"silentTransfer","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"standard","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"token_classes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"withdrawBid","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]}]
Contract Creation Code
0x608060405262015180600555600060115534801561001c57600080fd5b506001600255613f8e806100316000396000f3fe60806040526004361061031e5760003560e01c806370a08231116101a5578063b9186d7d116100ec578063cb177b1e11610095578063d75d1e661161006f578063d75d1e66146109a7578063e29fb036146109ef578063e647005914610a05578063f2fde38b14610a2557600080fd5b8063cb177b1e14610937578063d29f165214610957578063d2b327ad1461097757600080fd5b8063be671058116100c6578063be671058146108ca578063c1940f1b146108ea578063c98e0c3c1461091757600080fd5b8063b9186d7d1461086a578063bb0537171461088a578063be45fd62146108aa57600080fd5b80638da5cb5b1161014e57806395d89b411161012857806395d89b41146108155780639de4792e1461082a578063b119490e1461084a57600080fd5b80638da5cb5b146107c15780638e39e18c146107df57806391100695146107ff57600080fd5b806378317f3f1161017f57806378317f3f146107615780637ab56e521461078157806380483a6a146107a157600080fd5b806370a08231146106cf57806373baa651146106ef57806374c29ce31461070257600080fd5b80633e0bb78311610269578063543dc7fa11610212578063648fbe40116101ec578063648fbe401461064c578063649ccc141461066c57806369a13712146106af57600080fd5b8063543dc7fa146105ae5780635a3b7e42146105ce5780636352211e1461061457600080fd5b80634c1720a4116102435780634c1720a4146105315780634edea11114610551578063510910bb1461057e57600080fd5b80633e0bb783146104c45780634774d93f146104e45780634bb2ddd41461050457600080fd5b8063290e008c116102cb5780633add5fa1116102a55780633add5fa1146104645780633c65b3eb146104845780633d8073f1146104a457600080fd5b8063290e008c146104045780632a6d3f44146104245780633054d9cb1461044457600080fd5b80631d734c8f116102fc5780631d734c8f1461039e5780631f38e654146103c257806325498c75146103e457600080fd5b806302ff368a1461032357806306fdde03146103595780630eaaf4c81461036e575b600080fd5b34801561032f57600080fd5b5061034361033e36600461367b565b610a45565b60405161035091906136da565b60405180910390f35b34801561036557600080fd5b50610343610aff565b34801561037a57600080fd5b5061038e61038936600461367b565b610b91565b6040519015158152602001610350565b3480156103aa57600080fd5b506103b460115481565b604051908152602001610350565b3480156103ce57600080fd5b506103e26103dd3660046136f4565b610da8565b005b3480156103f057600080fd5b506103e26103ff3660046137d2565b610e51565b34801561041057600080fd5b506103e261041f366004613869565b610f72565b34801561043057600080fd5b5061038e61043f366004613869565b611005565b34801561045057600080fd5b506103e261045f3660046138b5565b611112565b34801561047057600080fd5b506103e261047f366004613905565b611252565b34801561049057600080fd5b506103b461049f36600461367b565b6112be565b3480156104b057600080fd5b506103e26104bf366004613905565b6113c2565b3480156104d057600080fd5b506103436104df3660046136f4565b611626565b3480156104f057600080fd5b506103e26104ff3660046138b5565b6116df565b34801561051057600080fd5b5061052461051f36600461367b565b61188c565b60405161035091906139ad565b34801561053d57600080fd5b5061034361054c3660046136f4565b6119dc565b34801561055d57600080fd5b5061057161056c36600461367b565b611aec565b60405161035091906139c0565b34801561058a57600080fd5b5061038e6105993660046139fa565b60016020526000908152604090205460ff1681565b3480156105ba57600080fd5b506103b46105c936600461367b565b611be1565b3480156105da57600080fd5b5060408051808201909152600b81527f43616c6c6973746f4e46540000000000000000000000000000000000000000006020820152610343565b34801561062057600080fd5b5061063461062f36600461367b565b611c55565b6040516001600160a01b039091168152602001610350565b34801561065857600080fd5b506103e2610667366004613a15565b611ccf565b34801561067857600080fd5b5061068c61068736600461367b565b611d51565b604080519384526001600160a01b03909216602084015290820152606001610350565b3480156106bb57600080fd5b506103e26106ca366004613a41565b611df8565b3480156106db57600080fd5b506103b46106ea3660046139fa565b611f3b565b6103e26106fd366004613869565b611fd5565b34801561070e57600080fd5b5061074261071d366004613a72565b600460205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610350565b34801561076d57600080fd5b506103e261077c366004613a15565b61230a565b34801561078d57600080fd5b5061034361079c3660046136f4565b61238c565b3480156107ad57600080fd5b506103e26107bc36600461367b565b61244b565b3480156107cd57600080fd5b506000546001600160a01b0316610634565b3480156107eb57600080fd5b506103e26107fa366004613a8d565b612549565b34801561080b57600080fd5b506103b460055481565b34801561082157600080fd5b506103436125de565b34801561083657600080fd5b506103436108453660046136f4565b6125ed565b34801561085657600080fd5b506103e2610865366004613ac9565b61267e565b34801561087657600080fd5b506103b461088536600461367b565b612797565b34801561089657600080fd5b506103e26108a5366004613905565b61281f565b3480156108b657600080fd5b5061038e6108c5366004613b36565b612885565b3480156108d657600080fd5b506103e26108e53660046136f4565b6128d8565b3480156108f657600080fd5b506103b461090536600461367b565b60106020526000908152604090205481565b34801561092357600080fd5b5061038e610932366004613b78565b6129a2565b34801561094357600080fd5b506103e2610952366004613ba2565b612b33565b34801561096357600080fd5b506103e2610972366004613ba2565b612bb8565b34801561098357600080fd5b5061038e6109923660046139fa565b60126020526000908152604090205460ff1681565b3480156109b357600080fd5b506109da6109c236600461367b565b600f6020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610350565b3480156109fb57600080fd5b506103b460095481565b348015610a1157600080fd5b50610524610a2036600461367b565b612c3d565b348015610a3157600080fd5b506103e2610a403660046139fa565b612d66565b6000818152600360205260408120805460609290610a6557610a65613bde565b906000526020600020018054610a7a90613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa690613bf4565b8015610af35780601f10610ac857610100808354040283529160200191610af3565b820191906000526020600020905b815481529060010190602001808311610ad657829003601f168201915b50505050509050919050565b6060600a8054610b0e90613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3a90613bf4565b8015610b875780601f10610b5c57610100808354040283529160200191610b87565b820191906000526020600020905b815481529060010190602001808311610b6a57829003601f168201915b5050505050905090565b60006002805403610be95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002805560008080610bfa85611d51565b91945092509050336001600160a01b03831614610c7f5760405162461bcd60e51b815260206004820152602260248201527f43616e206e6f7420776974686472617720736f6d656f6e6520656c736573206260448201527f69640000000000000000000000000000000000000000000000000000000000006064820152608401610be0565b600554610c8c9082613c3e565b4211610cda5760405162461bcd60e51b815260206004820152601260248201527f4269642069732074696d652d6c6f636b656400000000000000000000000000006044820152606401610be0565b6040516000906001600160a01b0384169085156108fc0290869084818181858888f160008b81526007602052604080822080546001600160a01b0319168155600181018390556002018290555191965094508a93507f223d0d5db4846341da7a5cc902b1a7c597e63b6c73b1c6267dc931d290c7affb9250610d8e915060208082526018908201527f3078373736393734363836343732363137373432363936340000000000000000604082015260600190565b60405180910390a360019450505050506001600255919050565b6000546001600160a01b03163314610e025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b60008281526010602090815260409182902083905581518481529081018390527fa8b2c0f94a578b5a88c9c7d9242237165ea684a64cd32968c7f0dd6edd22dbe0910160405180910390a15050565b3360009081526012602052604090205460ff16610ec55760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b6011546000908152600e6020908152604082208054600181018255908352912001610ef08282613c9f565b50601180546000908152600f6020526040808220805463ffffffff871663ffffffff19909116179055915491517f949a1ec513916b5e46ab2c5681369a4651bba074831b8da896b06a94e8d041b692610f5192908252602082015260400190565b60405180910390a160118054906000610f6983613d5f565b91905055505050565b33610f856000546001600160a01b031690565b6001600160a01b03161480610fa957503360009081526001602052604090205460ff165b610ff55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b611000838383612e48565b505050565b600061101084611c55565b6001600160a01b0316336001600160a01b0316146110965760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f6e6c79206f776e65722063616e206368616e6765204e4654206360448201527f6f6e74656e7400000000000000000000000000000000000000000000000000006064820152608401610be0565b6000848152600360205260408120805485928592916110b7576110b7613bde565b9060005260206000200191826110ce929190613d78565b5060408051858152600060208201527f0fe79316286f6a1e5cf32c3c4ff10c2a66b9cd66da3353db3789c4042ffb44ee910160405180910390a15060019392505050565b3360009081526012602052604090205460ff166111865760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b8260115481106111d85760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152600e602052604090208054839190859081106111fb576111fb613bde565b9060005260206000200190816112119190613c9f565b5060408051858152602081018590527f949a1ec513916b5e46ab2c5681369a4651bba074831b8da896b06a94e8d041b691015b60405180910390a150505050565b6000546001600160a01b031633146112ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6112b884848484612ec6565b50505050565b60008160115481106113125760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b3360009081526001602052604090205460ff166113715760405162461bcd60e51b815260206004820152601460248201527f4d696e74657220726f6c652072657175697265640000000000000000000000006044820152606401610be0565b611379612f8c565b6000818152601060209081526040808320879055958252600f8152858220548383526008909152949020805463ffffffff191663ffffffff909516949094179093555090919050565b83828260028054036114165760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be0565b600280553361142488611c55565b6001600160a01b0316146114a05760405162461bcd60e51b815260206004820152602c60248201527f53657474696e672061736b73206973206f6e6c7920616c6c6f77656420666f7260448201527f206f776e6564204e4654732100000000000000000000000000000000000000006064820152608401610be0565b6000878152600660205260409081902087905551869088907f403cbda48c4d379b57469bea093b63817816d893b467842ee46fd1c3c29c05f8906114e79089908990613e62565b60405180910390a3600160025560008061150085611d51565b5091509150600061151086612797565b11801561152557508161152286612797565b11155b1561161b5760006115368387612fbe565b6115409084613e76565b905061154b86611c55565b6001600160a01b0316826001600160a01b0316877fc9b9afd9684b23c6b22a41016c08e8954ac118220c0a52f00b8774c46580e9a38460405161159091815260200190565b60405180910390a460006115a387611c55565b6001600160a01b03166108fc839081150290604051600060405180830381858888f160008c815260076020908152604080832080546001600160a01b03191681556001810184905560020183905560069091528120559450611618935061160f92508a9150611c559050565b84898989613045565b50505b505050505050505050565b600e602052816000526040600020818154811061164257600080fd5b9060005260206000200160009150915050805461165e90613bf4565b80601f016020809104026020016040519081016040528092919081815260200182805461168a90613bf4565b80156116d75780601f106116ac576101008083540402835291602001916116d7565b820191906000526020600020905b8154815290600101906020018083116116ba57829003601f168201915b505050505081565b3360009081526012602052604090205460ff166117535760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b8260115481106117a55760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152600e60205260409020805461186c918491869081106117cb576117cb613bde565b9060005260206000200180546117e090613bf4565b80601f016020809104026020016040519081016040528092919081815260200182805461180c90613bf4565b80156118595780601f1061182e57610100808354040283529160200191611859565b820191906000526020600020905b81548152906001019060200180831161183c57829003601f168201915b505050505061329290919063ffffffff16565b6000858152600e602052604090208054859081106111fb576111fb613bde565b6000818152601060205260409020546011546060919081106118f05760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000838152601060209081526040808320548352600e825280832080548251818502810185019093528083529193909284015b828210156119cf57838290600052602060002001805461194290613bf4565b80601f016020809104026020016040519081016040528092919081815260200182805461196e90613bf4565b80156119bb5780601f10611990576101008083540402835291602001916119bb565b820191906000526020600020905b81548152906001019060200180831161199e57829003601f168201915b505050505081526020019060010190611923565b5050505091505b50919050565b6060826011548110611a305760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152600e60205260409020805484908110611a5057611a50613bde565b906000526020600020018054611a6590613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9190613bf4565b8015611ade5780601f10611ab357610100808354040283529160200191611ade565b820191906000526020600020905b815481529060010190602001808311611ac157829003601f168201915b505050505091505092915050565b604080516020808201835260608252600084815260038252838120845181548085028201870187529381018481529495909491938593859285015b82821015611bd3578382906000526020600020018054611b4690613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054611b7290613bf4565b8015611bbf5780601f10611b9457610100808354040283529160200191611bbf565b820191906000526020600020905b815481529060010190602001808311611ba257829003601f168201915b505050505081526020019060010190611b27565b505050915250909392505050565b6000818152601060205260408120546011548110611c415760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b505060009081526010602052604090205490565b6000818152600c60205260408120546001600160a01b031680611cc95760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f776e657220717565727920666f72206e6f6e6578697374656e74604482015265103a37b5b2b760d11b6064820152608401610be0565b92915050565b6000546001600160a01b03163314611d295760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b600091825260086020526040909120805463ffffffff191663ffffffff909216919091179055565b6000818152600c6020526040812054819081906001600160a01b031680611dc95760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f776e657220717565727920666f72206e6f6e6578697374656e74604482015265103a37b5b2b760d11b6064820152608401610be0565b5050506000918252506007602052604090206001810154815460029092015490926001600160a01b0390921691565b3360009081526012602052604090205460ff16611e6c5760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b816011548110611ebe5760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000838152600e6020908152604082208054600181018255908352912001611ee68382613c9f565b506000838152600e6020526040812054611f0290600190613e76565b60408051868152602081018390529192507f949a1ec513916b5e46ab2c5681369a4651bba074831b8da896b06a94e8d041b69101611244565b60006001600160a01b038216611fb95760405162461bcd60e51b815260206004820152602760248201527f4e46543a2062616c616e636520717565727920666f7220746865207a65726f2060448201527f61646472657373000000000000000000000000000000000000000000000000006064820152608401610be0565b506001600160a01b03166000908152600d602052604090205490565b82828260028054036120295760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be0565b6002805560008061203988611d51565b50915091508134116120b25760405162461bcd60e51b8152602060048201526024808201527f4e657720626964206d7573742065786365656420746865206578697374696e6760448201527f206f6e65000000000000000000000000000000000000000000000000000000006064820152608401610be0565b600082156120e3576040516000906001600160a01b0384169085156108fc0290869084818181858888f15050505050505b346120ed8a612797565b108015612102575060006121008a612797565b115b156121175761211089612797565b905061211a565b50345b600089815260076020526040908190206001810183905580546001600160a01b03191633178155426002909101555181908a907f223d0d5db4846341da7a5cc902b1a7c597e63b6c73b1c6267dc931d290c7affb9061217c908c908c90613e62565b60405180910390a33461218e8a612797565b1080156121a3575060006121a18a612797565b115b156121da576000336108fc6121b78c612797565b6121c19034613e76565b6040518115909202916000818181858888f15050505050505b50506001600255506000806121ee85611d51565b509150915060006121fe86612797565b11801561221357508161221086612797565b11155b156123005760006122248387612fbe565b61222e9084613e76565b905061223986611c55565b6001600160a01b0316826001600160a01b0316877fc9b9afd9684b23c6b22a41016c08e8954ac118220c0a52f00b8774c46580e9a38460405161227e91815260200190565b60405180910390a4600061229187611c55565b6001600160a01b03166108fc839081150290604051600060405180830381858888f160008c815260076020908152604080832080546001600160a01b031916815560018101849055600201839055600690915281205594506122fd935061160f92508a9150611c559050565b50505b5050505050505050565b6000546001600160a01b031633146123645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6000918252600f6020526040909120805463ffffffff191663ffffffff909216919091179055565b6000828152600360205260409020805460609190839081106123b0576123b0613bde565b9060005260206000200180546123c590613bf4565b80601f01602080910402602001604051908101604052809291908181526020018280546123f190613bf4565b801561243e5780601f106124135761010080835404028352916020019161243e565b820191906000526020600020905b81548152906001019060200180831161242157829003601f168201915b5050505050905092915050565b3360009081526012602052604090205460ff166124bf5760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b8060115481106125115760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000828152600e6020908152604080832080546001810182559084528284208251938401909252928252909101906110009082613c9f565b6000546001600160a01b031633146125a35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b63ffffffff909216600090815260046020526040902080546001600160a01b039092166001600160a01b031990921691909117815560010155565b6060600b8054610b0e90613bf4565b6000828152601060205260409020546011546060919081106126515760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152601060209081526040808320548352600e9091529020805484908110611a5057611a50613bde565b6000546001600160a01b0316156126d75760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610be0565b600080546001600160a01b0319163390811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a362015180600555600a6127298482613c9f565b50600b6127368382613c9f565b506000805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec80546001600160a01b031916331790557f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed555050565b6000818152600c60205260408120546001600160a01b03168061280b5760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f776e657220717565727920666f72206e6f6e6578697374656e74604482015265103a37b5b2b760d11b6064820152608401610be0565b505060009081526006602052604090205490565b6000546001600160a01b031633146128795760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6112b884848484613453565b60006128943386868686613045565b7f3ba9136826ac751de05d770d8d34fa4440ada49a5fb0e9aa1678aece66dad97683836040516128c5929190613e62565b60405180910390a1506001949350505050565b3360009081526012602052604090205460ff1661294c5760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b60005b82811015611000576000828152600e60209081526040808320805460018101825590845282842082519384019092529282529091019061298f9082613c9f565b508061299a81613d5f565b91505061294f565b6000336129ae83611c55565b6001600160a01b031614612a135760405162461bcd60e51b815260206004820152602660248201527f4e46543a207472616e73666572206f6620746f6b656e2074686174206973206e60448201526537ba1037bbb760d11b6064820152608401610be0565b6001600160a01b038316612a735760405162461bcd60e51b815260206004820152602160248201527f4e46543a207472616e7366657220746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610be0565b600082815260066020526040812055336000908152600d60205260408120805460019290612aa2908490613e76565b90915550506001600160a01b0383166000908152600d60205260408120805460019290612ad0908490613c3e565b90915550506000828152600c602052604080822080546001600160a01b0319166001600160a01b0387169081179091559051849233917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a450600192915050565b6000546001600160a01b03163314612b8d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314612c125760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b6060816011548110612c915760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000838152600e6020908152604080832080548251818502810185019093528083529193909284015b828210156119cf578382906000526020600020018054612cd990613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054612d0590613bf4565b8015612d525780601f10612d2757610100808354040283529160200191612d52565b820191906000526020600020905b815481529060010190602001808311612d3557829003601f168201915b505050505081526020019060010190612cba565b6000546001600160a01b03163314612dc05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6001600160a01b038116612e3c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610be0565b612e458161348e565b50565b600083815260036020908152604082208054600181018255908352912001612e71828483613d78565b50600083815260036020526040812054612e8d90600190613e76565b60408051868152602081018390529192507f0fe79316286f6a1e5cf32c3c4ff10c2a66b9cd66da3353db3789c4042ffb44ee9101611244565b612f1f82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508981526003602052604090208054909350889250821090506117cb576117cb613bde565b6000858152600360205260409020805485908110612f3f57612f3f613bde565b906000526020600020019081612f559190613c9f565b5060408051858152602081018590527f0fe79316286f6a1e5cf32c3c4ff10c2a66b9cd66da3353db3789c4042ffb44ee9101611244565b6000612f9a336009546134de565b50600980549081906000612fad83613d5f565b9190505550612fbb816134ec565b90565b60008181526008602090815260408083205463ffffffff168084526004909252822080546001909101546001600160a01b039091169083620186a06130038389613e89565b61300d9190613ea0565b90506000836001600160a01b03166108fc839081150290604051600060405180830381858888f150949b9a5050505050505050505050565b846001600160a01b031661305884611c55565b6001600160a01b0316146130bd5760405162461bcd60e51b815260206004820152602660248201527f4e46543a207472616e73666572206f6620746f6b656e2074686174206973206e60448201526537ba1037bbb760d11b6064820152608401610be0565b6001600160a01b03841661311d5760405162461bcd60e51b815260206004820152602160248201527f4e46543a207472616e7366657220746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610be0565b6000838152600660205260408120556001600160a01b0385166000908152600d60205260408120805460019290613155908490613e76565b90915550506001600160a01b0384166000908152600d60205260408120805460019290613183908490613c3e565b90915550506000838152600c6020526040902080546001600160a01b0319166001600160a01b0386169081179091553b1561324a576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a02906132059033908990889088908890600401613ec2565b6020604051808303816000875af1158015613224573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132489190613f00565b505b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b8051606090839083906132a7576132a7613f42565b6000815183516132b79190613c3e565b67ffffffffffffffff8111156132cf576132cf61372f565b6040519080825280601f01601f1916602001820160405280156132f9576020820181803683370190505b509050806000805b85518210156133a15785828151811061331c5761331c613bde565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016838261334e81613d5f565b93508151811061336057613360613bde565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508161339981613d5f565b925050613301565b600091505b8451821015613446578482815181106133c1576133c1613bde565b01602001517fff000000000000000000000000000000000000000000000000000000000000001683826133f381613d5f565b93508151811061340557613405613bde565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508161343e81613d5f565b9250506133a6565b5090979650505050505050565b60008481526003602052604090208054839183918690811061347757613477613bde565b906000526020600020019182612f55929190613d78565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6134e88282613539565b5050565b6000818152600360205260408120549003612e4557600081815260036020908152604080832080546001810182559084528284208251938401909252928252909101906134e89082613c9f565b6001600160a01b03821661358f5760405162461bcd60e51b815260206004820152601d60248201527f4e46543a206d696e7420746f20746865207a65726f20616464726573730000006044820152606401610be0565b6000818152600c60205260409020546001600160a01b0316156135f45760405162461bcd60e51b815260206004820152601960248201527f4e46543a20746f6b656e20616c7265616479206d696e746564000000000000006044820152606401610be0565b6001600160a01b0382166000908152600d6020526040812080546001929061361d908490613c3e565b90915550506000818152600c602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006020828403121561368d57600080fd5b5035919050565b6000815180845260005b818110156136ba5760208185018101518683018201520161369e565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006136ed6020830184613694565b9392505050565b6000806040838503121561370757600080fd5b50508035926020909101359150565b803563ffffffff8116811461372a57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261375657600080fd5b813567ffffffffffffffff808211156137715761377161372f565b604051601f8301601f19908116603f011681019082821181831017156137995761379961372f565b816040528381528660208588010111156137b257600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156137e557600080fd5b6137ee83613716565b9150602083013567ffffffffffffffff81111561380a57600080fd5b61381685828601613745565b9150509250929050565b60008083601f84011261383257600080fd5b50813567ffffffffffffffff81111561384a57600080fd5b60208301915083602082850101111561386257600080fd5b9250929050565b60008060006040848603121561387e57600080fd5b83359250602084013567ffffffffffffffff81111561389c57600080fd5b6138a886828701613820565b9497909650939450505050565b6000806000606084860312156138ca57600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156138ef57600080fd5b6138fb86828701613745565b9150509250925092565b6000806000806060858703121561391b57600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561394057600080fd5b61394c87828801613820565b95989497509550505050565b600081518084526020808501808196508360051b8101915082860160005b858110156139a057828403895261398e848351613694565b98850198935090840190600101613976565b5091979650505050505050565b6020815260006136ed6020830184613958565b60208152600082516020808401526139db6040840182613958565b949350505050565b80356001600160a01b038116811461372a57600080fd5b600060208284031215613a0c57600080fd5b6136ed826139e3565b60008060408385031215613a2857600080fd5b82359150613a3860208401613716565b90509250929050565b60008060408385031215613a5457600080fd5b82359150602083013567ffffffffffffffff81111561380a57600080fd5b600060208284031215613a8457600080fd5b6136ed82613716565b600080600060608486031215613aa257600080fd5b613aab84613716565b9250613ab9602085016139e3565b9150604084013590509250925092565b600080600060608486031215613ade57600080fd5b833567ffffffffffffffff80821115613af657600080fd5b613b0287838801613745565b94506020860135915080821115613b1857600080fd5b50613b2586828701613745565b925050604084013590509250925092565b60008060008060608587031215613b4c57600080fd5b613b55856139e3565b935060208501359250604085013567ffffffffffffffff81111561394057600080fd5b60008060408385031215613b8b57600080fd5b613b94836139e3565b946020939093013593505050565b60008060408385031215613bb557600080fd5b613bbe836139e3565b915060208301358015158114613bd357600080fd5b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680613c0857607f821691505b6020821081036119d657634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115611cc957611cc9613c28565b601f82111561100057600081815260208120601f850160051c81016020861015613c785750805b601f850160051c820191505b81811015613c9757828155600101613c84565b505050505050565b815167ffffffffffffffff811115613cb957613cb961372f565b613ccd81613cc78454613bf4565b84613c51565b602080601f831160018114613d025760008415613cea5750858301515b600019600386901b1c1916600185901b178555613c97565b600085815260208120601f198616915b82811015613d3157888601518255948401946001909101908401613d12565b5085821015613d4f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060018201613d7157613d71613c28565b5060010190565b67ffffffffffffffff831115613d9057613d9061372f565b613da483613d9e8354613bf4565b83613c51565b6000601f841160018114613dd85760008515613dc05750838201355b600019600387901b1c1916600186901b178355613e32565b600083815260209020601f19861690835b82811015613e095786850135825560209485019460019092019101613de9565b5086821015613e265760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006139db602083018486613e39565b81810381811115611cc957611cc9613c28565b8082028115828204841417611cc957611cc9613c28565b600082613ebd57634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160a01b03808816835280871660208401525084604083015260806060830152613ef5608083018486613e39565b979650505050505050565b600060208284031215613f1257600080fd5b81517fffffffff00000000000000000000000000000000000000000000000000000000811681146136ed57600080fd5b634e487b7160e01b600052600160045260246000fdfea264697066735822122041f3dcc901c8ad7553da27fff6b702274fe0150af07e4f9f32ecfc2bc39b637564736f6c63430008130033
Deployed ByteCode
0x60806040526004361061031e5760003560e01c806370a08231116101a5578063b9186d7d116100ec578063cb177b1e11610095578063d75d1e661161006f578063d75d1e66146109a7578063e29fb036146109ef578063e647005914610a05578063f2fde38b14610a2557600080fd5b8063cb177b1e14610937578063d29f165214610957578063d2b327ad1461097757600080fd5b8063be671058116100c6578063be671058146108ca578063c1940f1b146108ea578063c98e0c3c1461091757600080fd5b8063b9186d7d1461086a578063bb0537171461088a578063be45fd62146108aa57600080fd5b80638da5cb5b1161014e57806395d89b411161012857806395d89b41146108155780639de4792e1461082a578063b119490e1461084a57600080fd5b80638da5cb5b146107c15780638e39e18c146107df57806391100695146107ff57600080fd5b806378317f3f1161017f57806378317f3f146107615780637ab56e521461078157806380483a6a146107a157600080fd5b806370a08231146106cf57806373baa651146106ef57806374c29ce31461070257600080fd5b80633e0bb78311610269578063543dc7fa11610212578063648fbe40116101ec578063648fbe401461064c578063649ccc141461066c57806369a13712146106af57600080fd5b8063543dc7fa146105ae5780635a3b7e42146105ce5780636352211e1461061457600080fd5b80634c1720a4116102435780634c1720a4146105315780634edea11114610551578063510910bb1461057e57600080fd5b80633e0bb783146104c45780634774d93f146104e45780634bb2ddd41461050457600080fd5b8063290e008c116102cb5780633add5fa1116102a55780633add5fa1146104645780633c65b3eb146104845780633d8073f1146104a457600080fd5b8063290e008c146104045780632a6d3f44146104245780633054d9cb1461044457600080fd5b80631d734c8f116102fc5780631d734c8f1461039e5780631f38e654146103c257806325498c75146103e457600080fd5b806302ff368a1461032357806306fdde03146103595780630eaaf4c81461036e575b600080fd5b34801561032f57600080fd5b5061034361033e36600461367b565b610a45565b60405161035091906136da565b60405180910390f35b34801561036557600080fd5b50610343610aff565b34801561037a57600080fd5b5061038e61038936600461367b565b610b91565b6040519015158152602001610350565b3480156103aa57600080fd5b506103b460115481565b604051908152602001610350565b3480156103ce57600080fd5b506103e26103dd3660046136f4565b610da8565b005b3480156103f057600080fd5b506103e26103ff3660046137d2565b610e51565b34801561041057600080fd5b506103e261041f366004613869565b610f72565b34801561043057600080fd5b5061038e61043f366004613869565b611005565b34801561045057600080fd5b506103e261045f3660046138b5565b611112565b34801561047057600080fd5b506103e261047f366004613905565b611252565b34801561049057600080fd5b506103b461049f36600461367b565b6112be565b3480156104b057600080fd5b506103e26104bf366004613905565b6113c2565b3480156104d057600080fd5b506103436104df3660046136f4565b611626565b3480156104f057600080fd5b506103e26104ff3660046138b5565b6116df565b34801561051057600080fd5b5061052461051f36600461367b565b61188c565b60405161035091906139ad565b34801561053d57600080fd5b5061034361054c3660046136f4565b6119dc565b34801561055d57600080fd5b5061057161056c36600461367b565b611aec565b60405161035091906139c0565b34801561058a57600080fd5b5061038e6105993660046139fa565b60016020526000908152604090205460ff1681565b3480156105ba57600080fd5b506103b46105c936600461367b565b611be1565b3480156105da57600080fd5b5060408051808201909152600b81527f43616c6c6973746f4e46540000000000000000000000000000000000000000006020820152610343565b34801561062057600080fd5b5061063461062f36600461367b565b611c55565b6040516001600160a01b039091168152602001610350565b34801561065857600080fd5b506103e2610667366004613a15565b611ccf565b34801561067857600080fd5b5061068c61068736600461367b565b611d51565b604080519384526001600160a01b03909216602084015290820152606001610350565b3480156106bb57600080fd5b506103e26106ca366004613a41565b611df8565b3480156106db57600080fd5b506103b46106ea3660046139fa565b611f3b565b6103e26106fd366004613869565b611fd5565b34801561070e57600080fd5b5061074261071d366004613a72565b600460205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610350565b34801561076d57600080fd5b506103e261077c366004613a15565b61230a565b34801561078d57600080fd5b5061034361079c3660046136f4565b61238c565b3480156107ad57600080fd5b506103e26107bc36600461367b565b61244b565b3480156107cd57600080fd5b506000546001600160a01b0316610634565b3480156107eb57600080fd5b506103e26107fa366004613a8d565b612549565b34801561080b57600080fd5b506103b460055481565b34801561082157600080fd5b506103436125de565b34801561083657600080fd5b506103436108453660046136f4565b6125ed565b34801561085657600080fd5b506103e2610865366004613ac9565b61267e565b34801561087657600080fd5b506103b461088536600461367b565b612797565b34801561089657600080fd5b506103e26108a5366004613905565b61281f565b3480156108b657600080fd5b5061038e6108c5366004613b36565b612885565b3480156108d657600080fd5b506103e26108e53660046136f4565b6128d8565b3480156108f657600080fd5b506103b461090536600461367b565b60106020526000908152604090205481565b34801561092357600080fd5b5061038e610932366004613b78565b6129a2565b34801561094357600080fd5b506103e2610952366004613ba2565b612b33565b34801561096357600080fd5b506103e2610972366004613ba2565b612bb8565b34801561098357600080fd5b5061038e6109923660046139fa565b60126020526000908152604090205460ff1681565b3480156109b357600080fd5b506109da6109c236600461367b565b600f6020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610350565b3480156109fb57600080fd5b506103b460095481565b348015610a1157600080fd5b50610524610a2036600461367b565b612c3d565b348015610a3157600080fd5b506103e2610a403660046139fa565b612d66565b6000818152600360205260408120805460609290610a6557610a65613bde565b906000526020600020018054610a7a90613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa690613bf4565b8015610af35780601f10610ac857610100808354040283529160200191610af3565b820191906000526020600020905b815481529060010190602001808311610ad657829003601f168201915b50505050509050919050565b6060600a8054610b0e90613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3a90613bf4565b8015610b875780601f10610b5c57610100808354040283529160200191610b87565b820191906000526020600020905b815481529060010190602001808311610b6a57829003601f168201915b5050505050905090565b60006002805403610be95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002805560008080610bfa85611d51565b91945092509050336001600160a01b03831614610c7f5760405162461bcd60e51b815260206004820152602260248201527f43616e206e6f7420776974686472617720736f6d656f6e6520656c736573206260448201527f69640000000000000000000000000000000000000000000000000000000000006064820152608401610be0565b600554610c8c9082613c3e565b4211610cda5760405162461bcd60e51b815260206004820152601260248201527f4269642069732074696d652d6c6f636b656400000000000000000000000000006044820152606401610be0565b6040516000906001600160a01b0384169085156108fc0290869084818181858888f160008b81526007602052604080822080546001600160a01b0319168155600181018390556002018290555191965094508a93507f223d0d5db4846341da7a5cc902b1a7c597e63b6c73b1c6267dc931d290c7affb9250610d8e915060208082526018908201527f3078373736393734363836343732363137373432363936340000000000000000604082015260600190565b60405180910390a360019450505050506001600255919050565b6000546001600160a01b03163314610e025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b60008281526010602090815260409182902083905581518481529081018390527fa8b2c0f94a578b5a88c9c7d9242237165ea684a64cd32968c7f0dd6edd22dbe0910160405180910390a15050565b3360009081526012602052604090205460ff16610ec55760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b6011546000908152600e6020908152604082208054600181018255908352912001610ef08282613c9f565b50601180546000908152600f6020526040808220805463ffffffff871663ffffffff19909116179055915491517f949a1ec513916b5e46ab2c5681369a4651bba074831b8da896b06a94e8d041b692610f5192908252602082015260400190565b60405180910390a160118054906000610f6983613d5f565b91905055505050565b33610f856000546001600160a01b031690565b6001600160a01b03161480610fa957503360009081526001602052604090205460ff165b610ff55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b611000838383612e48565b505050565b600061101084611c55565b6001600160a01b0316336001600160a01b0316146110965760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f6e6c79206f776e65722063616e206368616e6765204e4654206360448201527f6f6e74656e7400000000000000000000000000000000000000000000000000006064820152608401610be0565b6000848152600360205260408120805485928592916110b7576110b7613bde565b9060005260206000200191826110ce929190613d78565b5060408051858152600060208201527f0fe79316286f6a1e5cf32c3c4ff10c2a66b9cd66da3353db3789c4042ffb44ee910160405180910390a15060019392505050565b3360009081526012602052604090205460ff166111865760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b8260115481106111d85760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152600e602052604090208054839190859081106111fb576111fb613bde565b9060005260206000200190816112119190613c9f565b5060408051858152602081018590527f949a1ec513916b5e46ab2c5681369a4651bba074831b8da896b06a94e8d041b691015b60405180910390a150505050565b6000546001600160a01b031633146112ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6112b884848484612ec6565b50505050565b60008160115481106113125760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b3360009081526001602052604090205460ff166113715760405162461bcd60e51b815260206004820152601460248201527f4d696e74657220726f6c652072657175697265640000000000000000000000006044820152606401610be0565b611379612f8c565b6000818152601060209081526040808320879055958252600f8152858220548383526008909152949020805463ffffffff191663ffffffff909516949094179093555090919050565b83828260028054036114165760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be0565b600280553361142488611c55565b6001600160a01b0316146114a05760405162461bcd60e51b815260206004820152602c60248201527f53657474696e672061736b73206973206f6e6c7920616c6c6f77656420666f7260448201527f206f776e6564204e4654732100000000000000000000000000000000000000006064820152608401610be0565b6000878152600660205260409081902087905551869088907f403cbda48c4d379b57469bea093b63817816d893b467842ee46fd1c3c29c05f8906114e79089908990613e62565b60405180910390a3600160025560008061150085611d51565b5091509150600061151086612797565b11801561152557508161152286612797565b11155b1561161b5760006115368387612fbe565b6115409084613e76565b905061154b86611c55565b6001600160a01b0316826001600160a01b0316877fc9b9afd9684b23c6b22a41016c08e8954ac118220c0a52f00b8774c46580e9a38460405161159091815260200190565b60405180910390a460006115a387611c55565b6001600160a01b03166108fc839081150290604051600060405180830381858888f160008c815260076020908152604080832080546001600160a01b03191681556001810184905560020183905560069091528120559450611618935061160f92508a9150611c559050565b84898989613045565b50505b505050505050505050565b600e602052816000526040600020818154811061164257600080fd5b9060005260206000200160009150915050805461165e90613bf4565b80601f016020809104026020016040519081016040528092919081815260200182805461168a90613bf4565b80156116d75780601f106116ac576101008083540402835291602001916116d7565b820191906000526020600020905b8154815290600101906020018083116116ba57829003601f168201915b505050505081565b3360009081526012602052604090205460ff166117535760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b8260115481106117a55760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152600e60205260409020805461186c918491869081106117cb576117cb613bde565b9060005260206000200180546117e090613bf4565b80601f016020809104026020016040519081016040528092919081815260200182805461180c90613bf4565b80156118595780601f1061182e57610100808354040283529160200191611859565b820191906000526020600020905b81548152906001019060200180831161183c57829003601f168201915b505050505061329290919063ffffffff16565b6000858152600e602052604090208054859081106111fb576111fb613bde565b6000818152601060205260409020546011546060919081106118f05760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000838152601060209081526040808320548352600e825280832080548251818502810185019093528083529193909284015b828210156119cf57838290600052602060002001805461194290613bf4565b80601f016020809104026020016040519081016040528092919081815260200182805461196e90613bf4565b80156119bb5780601f10611990576101008083540402835291602001916119bb565b820191906000526020600020905b81548152906001019060200180831161199e57829003601f168201915b505050505081526020019060010190611923565b5050505091505b50919050565b6060826011548110611a305760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152600e60205260409020805484908110611a5057611a50613bde565b906000526020600020018054611a6590613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9190613bf4565b8015611ade5780601f10611ab357610100808354040283529160200191611ade565b820191906000526020600020905b815481529060010190602001808311611ac157829003601f168201915b505050505091505092915050565b604080516020808201835260608252600084815260038252838120845181548085028201870187529381018481529495909491938593859285015b82821015611bd3578382906000526020600020018054611b4690613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054611b7290613bf4565b8015611bbf5780601f10611b9457610100808354040283529160200191611bbf565b820191906000526020600020905b815481529060010190602001808311611ba257829003601f168201915b505050505081526020019060010190611b27565b505050915250909392505050565b6000818152601060205260408120546011548110611c415760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b505060009081526010602052604090205490565b6000818152600c60205260408120546001600160a01b031680611cc95760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f776e657220717565727920666f72206e6f6e6578697374656e74604482015265103a37b5b2b760d11b6064820152608401610be0565b92915050565b6000546001600160a01b03163314611d295760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b600091825260086020526040909120805463ffffffff191663ffffffff909216919091179055565b6000818152600c6020526040812054819081906001600160a01b031680611dc95760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f776e657220717565727920666f72206e6f6e6578697374656e74604482015265103a37b5b2b760d11b6064820152608401610be0565b5050506000918252506007602052604090206001810154815460029092015490926001600160a01b0390921691565b3360009081526012602052604090205460ff16611e6c5760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b816011548110611ebe5760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000838152600e6020908152604082208054600181018255908352912001611ee68382613c9f565b506000838152600e6020526040812054611f0290600190613e76565b60408051868152602081018390529192507f949a1ec513916b5e46ab2c5681369a4651bba074831b8da896b06a94e8d041b69101611244565b60006001600160a01b038216611fb95760405162461bcd60e51b815260206004820152602760248201527f4e46543a2062616c616e636520717565727920666f7220746865207a65726f2060448201527f61646472657373000000000000000000000000000000000000000000000000006064820152608401610be0565b506001600160a01b03166000908152600d602052604090205490565b82828260028054036120295760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be0565b6002805560008061203988611d51565b50915091508134116120b25760405162461bcd60e51b8152602060048201526024808201527f4e657720626964206d7573742065786365656420746865206578697374696e6760448201527f206f6e65000000000000000000000000000000000000000000000000000000006064820152608401610be0565b600082156120e3576040516000906001600160a01b0384169085156108fc0290869084818181858888f15050505050505b346120ed8a612797565b108015612102575060006121008a612797565b115b156121175761211089612797565b905061211a565b50345b600089815260076020526040908190206001810183905580546001600160a01b03191633178155426002909101555181908a907f223d0d5db4846341da7a5cc902b1a7c597e63b6c73b1c6267dc931d290c7affb9061217c908c908c90613e62565b60405180910390a33461218e8a612797565b1080156121a3575060006121a18a612797565b115b156121da576000336108fc6121b78c612797565b6121c19034613e76565b6040518115909202916000818181858888f15050505050505b50506001600255506000806121ee85611d51565b509150915060006121fe86612797565b11801561221357508161221086612797565b11155b156123005760006122248387612fbe565b61222e9084613e76565b905061223986611c55565b6001600160a01b0316826001600160a01b0316877fc9b9afd9684b23c6b22a41016c08e8954ac118220c0a52f00b8774c46580e9a38460405161227e91815260200190565b60405180910390a4600061229187611c55565b6001600160a01b03166108fc839081150290604051600060405180830381858888f160008c815260076020908152604080832080546001600160a01b031916815560018101849055600201839055600690915281205594506122fd935061160f92508a9150611c559050565b50505b5050505050505050565b6000546001600160a01b031633146123645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6000918252600f6020526040909120805463ffffffff191663ffffffff909216919091179055565b6000828152600360205260409020805460609190839081106123b0576123b0613bde565b9060005260206000200180546123c590613bf4565b80601f01602080910402602001604051908101604052809291908181526020018280546123f190613bf4565b801561243e5780601f106124135761010080835404028352916020019161243e565b820191906000526020600020905b81548152906001019060200180831161242157829003601f168201915b5050505050905092915050565b3360009081526012602052604090205460ff166124bf5760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b8060115481106125115760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000828152600e6020908152604080832080546001810182559084528284208251938401909252928252909101906110009082613c9f565b6000546001600160a01b031633146125a35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b63ffffffff909216600090815260046020526040902080546001600160a01b039092166001600160a01b031990921691909117815560010155565b6060600b8054610b0e90613bf4565b6000828152601060205260409020546011546060919081106126515760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000848152601060209081526040808320548352600e9091529020805484908110611a5057611a50613bde565b6000546001600160a01b0316156126d75760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610be0565b600080546001600160a01b0319163390811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a362015180600555600a6127298482613c9f565b50600b6127368382613c9f565b506000805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec80546001600160a01b031916331790557f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed555050565b6000818152600c60205260408120546001600160a01b03168061280b5760405162461bcd60e51b815260206004820152602660248201527f4e46543a206f776e657220717565727920666f72206e6f6e6578697374656e74604482015265103a37b5b2b760d11b6064820152608401610be0565b505060009081526006602052604090205490565b6000546001600160a01b031633146128795760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6112b884848484613453565b60006128943386868686613045565b7f3ba9136826ac751de05d770d8d34fa4440ada49a5fb0e9aa1678aece66dad97683836040516128c5929190613e62565b60405180910390a1506001949350505050565b3360009081526012602052604090205460ff1661294c5760405162461bcd60e51b815260206004820152602c60248201527f436c61737369666965644e46543a2063616c6c6572206973206e6f742074686560448201526b1021b630b9b99020b236b4b760a11b6064820152608401610be0565b60005b82811015611000576000828152600e60209081526040808320805460018101825590845282842082519384019092529282529091019061298f9082613c9f565b508061299a81613d5f565b91505061294f565b6000336129ae83611c55565b6001600160a01b031614612a135760405162461bcd60e51b815260206004820152602660248201527f4e46543a207472616e73666572206f6620746f6b656e2074686174206973206e60448201526537ba1037bbb760d11b6064820152608401610be0565b6001600160a01b038316612a735760405162461bcd60e51b815260206004820152602160248201527f4e46543a207472616e7366657220746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610be0565b600082815260066020526040812055336000908152600d60205260408120805460019290612aa2908490613e76565b90915550506001600160a01b0383166000908152600d60205260408120805460019290612ad0908490613c3e565b90915550506000828152600c602052604080822080546001600160a01b0319166001600160a01b0387169081179091559051849233917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a450600192915050565b6000546001600160a01b03163314612b8d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314612c125760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b6060816011548110612c915760405162461bcd60e51b815260206004820152601c60248201527f5175657269656420636c61737320646f6573206e6f74206578697374000000006044820152606401610be0565b6000838152600e6020908152604080832080548251818502810185019093528083529193909284015b828210156119cf578382906000526020600020018054612cd990613bf4565b80601f0160208091040260200160405190810160405280929190818152602001828054612d0590613bf4565b8015612d525780601f10612d2757610100808354040283529160200191612d52565b820191906000526020600020905b815481529060010190602001808311612d3557829003601f168201915b505050505081526020019060010190612cba565b6000546001600160a01b03163314612dc05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be0565b6001600160a01b038116612e3c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610be0565b612e458161348e565b50565b600083815260036020908152604082208054600181018255908352912001612e71828483613d78565b50600083815260036020526040812054612e8d90600190613e76565b60408051868152602081018390529192507f0fe79316286f6a1e5cf32c3c4ff10c2a66b9cd66da3353db3789c4042ffb44ee9101611244565b612f1f82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508981526003602052604090208054909350889250821090506117cb576117cb613bde565b6000858152600360205260409020805485908110612f3f57612f3f613bde565b906000526020600020019081612f559190613c9f565b5060408051858152602081018590527f0fe79316286f6a1e5cf32c3c4ff10c2a66b9cd66da3353db3789c4042ffb44ee9101611244565b6000612f9a336009546134de565b50600980549081906000612fad83613d5f565b9190505550612fbb816134ec565b90565b60008181526008602090815260408083205463ffffffff168084526004909252822080546001909101546001600160a01b039091169083620186a06130038389613e89565b61300d9190613ea0565b90506000836001600160a01b03166108fc839081150290604051600060405180830381858888f150949b9a5050505050505050505050565b846001600160a01b031661305884611c55565b6001600160a01b0316146130bd5760405162461bcd60e51b815260206004820152602660248201527f4e46543a207472616e73666572206f6620746f6b656e2074686174206973206e60448201526537ba1037bbb760d11b6064820152608401610be0565b6001600160a01b03841661311d5760405162461bcd60e51b815260206004820152602160248201527f4e46543a207472616e7366657220746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610be0565b6000838152600660205260408120556001600160a01b0385166000908152600d60205260408120805460019290613155908490613e76565b90915550506001600160a01b0384166000908152600d60205260408120805460019290613183908490613c3e565b90915550506000838152600c6020526040902080546001600160a01b0319166001600160a01b0386169081179091553b1561324a576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a02906132059033908990889088908890600401613ec2565b6020604051808303816000875af1158015613224573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132489190613f00565b505b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b8051606090839083906132a7576132a7613f42565b6000815183516132b79190613c3e565b67ffffffffffffffff8111156132cf576132cf61372f565b6040519080825280601f01601f1916602001820160405280156132f9576020820181803683370190505b509050806000805b85518210156133a15785828151811061331c5761331c613bde565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016838261334e81613d5f565b93508151811061336057613360613bde565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508161339981613d5f565b925050613301565b600091505b8451821015613446578482815181106133c1576133c1613bde565b01602001517fff000000000000000000000000000000000000000000000000000000000000001683826133f381613d5f565b93508151811061340557613405613bde565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508161343e81613d5f565b9250506133a6565b5090979650505050505050565b60008481526003602052604090208054839183918690811061347757613477613bde565b906000526020600020019182612f55929190613d78565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6134e88282613539565b5050565b6000818152600360205260408120549003612e4557600081815260036020908152604080832080546001810182559084528284208251938401909252928252909101906134e89082613c9f565b6001600160a01b03821661358f5760405162461bcd60e51b815260206004820152601d60248201527f4e46543a206d696e7420746f20746865207a65726f20616464726573730000006044820152606401610be0565b6000818152600c60205260409020546001600160a01b0316156135f45760405162461bcd60e51b815260206004820152601960248201527f4e46543a20746f6b656e20616c7265616479206d696e746564000000000000006044820152606401610be0565b6001600160a01b0382166000908152600d6020526040812080546001929061361d908490613c3e565b90915550506000818152600c602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006020828403121561368d57600080fd5b5035919050565b6000815180845260005b818110156136ba5760208185018101518683018201520161369e565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006136ed6020830184613694565b9392505050565b6000806040838503121561370757600080fd5b50508035926020909101359150565b803563ffffffff8116811461372a57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261375657600080fd5b813567ffffffffffffffff808211156137715761377161372f565b604051601f8301601f19908116603f011681019082821181831017156137995761379961372f565b816040528381528660208588010111156137b257600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156137e557600080fd5b6137ee83613716565b9150602083013567ffffffffffffffff81111561380a57600080fd5b61381685828601613745565b9150509250929050565b60008083601f84011261383257600080fd5b50813567ffffffffffffffff81111561384a57600080fd5b60208301915083602082850101111561386257600080fd5b9250929050565b60008060006040848603121561387e57600080fd5b83359250602084013567ffffffffffffffff81111561389c57600080fd5b6138a886828701613820565b9497909650939450505050565b6000806000606084860312156138ca57600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156138ef57600080fd5b6138fb86828701613745565b9150509250925092565b6000806000806060858703121561391b57600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561394057600080fd5b61394c87828801613820565b95989497509550505050565b600081518084526020808501808196508360051b8101915082860160005b858110156139a057828403895261398e848351613694565b98850198935090840190600101613976565b5091979650505050505050565b6020815260006136ed6020830184613958565b60208152600082516020808401526139db6040840182613958565b949350505050565b80356001600160a01b038116811461372a57600080fd5b600060208284031215613a0c57600080fd5b6136ed826139e3565b60008060408385031215613a2857600080fd5b82359150613a3860208401613716565b90509250929050565b60008060408385031215613a5457600080fd5b82359150602083013567ffffffffffffffff81111561380a57600080fd5b600060208284031215613a8457600080fd5b6136ed82613716565b600080600060608486031215613aa257600080fd5b613aab84613716565b9250613ab9602085016139e3565b9150604084013590509250925092565b600080600060608486031215613ade57600080fd5b833567ffffffffffffffff80821115613af657600080fd5b613b0287838801613745565b94506020860135915080821115613b1857600080fd5b50613b2586828701613745565b925050604084013590509250925092565b60008060008060608587031215613b4c57600080fd5b613b55856139e3565b935060208501359250604085013567ffffffffffffffff81111561394057600080fd5b60008060408385031215613b8b57600080fd5b613b94836139e3565b946020939093013593505050565b60008060408385031215613bb557600080fd5b613bbe836139e3565b915060208301358015158114613bd357600080fd5b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680613c0857607f821691505b6020821081036119d657634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115611cc957611cc9613c28565b601f82111561100057600081815260208120601f850160051c81016020861015613c785750805b601f850160051c820191505b81811015613c9757828155600101613c84565b505050505050565b815167ffffffffffffffff811115613cb957613cb961372f565b613ccd81613cc78454613bf4565b84613c51565b602080601f831160018114613d025760008415613cea5750858301515b600019600386901b1c1916600185901b178555613c97565b600085815260208120601f198616915b82811015613d3157888601518255948401946001909101908401613d12565b5085821015613d4f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060018201613d7157613d71613c28565b5060010190565b67ffffffffffffffff831115613d9057613d9061372f565b613da483613d9e8354613bf4565b83613c51565b6000601f841160018114613dd85760008515613dc05750838201355b600019600387901b1c1916600186901b178355613e32565b600083815260209020601f19861690835b82811015613e095786850135825560209485019460019092019101613de9565b5086821015613e265760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006139db602083018486613e39565b81810381811115611cc957611cc9613c28565b8082028115828204841417611cc957611cc9613c28565b600082613ebd57634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160a01b03808816835280871660208401525084604083015260806060830152613ef5608083018486613e39565b979650505050505050565b600060208284031215613f1257600080fd5b81517fffffffff00000000000000000000000000000000000000000000000000000000811681146136ed57600080fd5b634e487b7160e01b600052600160045260246000fdfea264697066735822122041f3dcc901c8ad7553da27fff6b702274fe0150af07e4f9f32ecfc2bc39b637564736f6c63430008130033