Source Code
Overview
MNT Balance
0 MNT
More Info
ContractCreator
Multichain Info
N/A
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | Amount | ||
|---|---|---|---|---|---|---|
| 33417538 | 13 days ago | Contract Creation | 0 MNT |
Loading...
Loading
Contract Name:
Fiat24Account
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "./libraries/DigitsOfUint.sol";
contract Fiat24Account is ERC721EnumerableUpgradeable, ERC721PausableUpgradeable, AccessControlUpgradeable {
using DigitsOfUint for uint256;
using SafeERC20Upgradeable for IERC20Upgradeable;
bytes32 public constant OPERATOR_ADMIN_ROLE = keccak256("OPERATOR_ADMIN_ROLE");
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
bytes32 public constant LIMITUPDATER_ROLE = keccak256("LIMITUPDATER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant CLIENTSTATUSCHANGE_ROLE = keccak256("CLIENTSTATUSCHANGE_ROLE");
bytes32 public constant PAUSE_ROLE = keccak256("PAUSE_ROLE");
bytes32 public constant UNPAUSE_ROLE = keccak256("UNPAUSE_ROLE");
bytes32 public constant CASH_OPERATOR_ROLE = keccak256("CASH_OPERATOR_ROLE");
uint256 public constant DEFAULT_MERCHANT_RATE = 55;
enum Status {
Na,
SoftBlocked,
Tourist,
Blocked,
Closed,
Live
}
struct WalletProvider {
string walletProvider;
bool isAvailable;
}
uint8 public constant MERCHANTDIGIT = 8;
uint8 public constant INTERNALDIGIT = 9;
struct Limit {
uint256 usedLimit;
uint256 clientLimit;
uint256 startLimitDate;
}
uint256 public constant LIMITLIVEDEFAULT = 100000;
uint256 public limitTourist;
uint256 public constant THIRTYDAYS = 2592000;
mapping(address => uint256) public historicOwnership;
mapping(uint256 => string) public nickNames;
mapping(uint256 => bool) public isMerchant;
mapping(uint256 => uint256) public merchantRate;
mapping(uint256 => Status) public status;
mapping(uint256 => Limit) public limit;
uint8 public minDigitForSale; //maxDigitForMint
uint8 public maxDigitForSale;
mapping(uint256 => uint256) public walletProvider;
mapping(uint256 => WalletProvider) public walletProviderMap;
mapping(uint256 => string) public nftAvatar;
mapping(uint256 => uint256) public oldTokenId;
string private _baseTokenURI;
/// @notice ETH gas fee required to collect a third-party mint, in wei
uint256 public mintFee;
/// @notice Fee recipient address for third-party mint collections
address public feeReceiver;
function initialize(address admin) public initializer {
__Context_init_unchained();
__ERC721_init_unchained("UR Account", "UR");
__AccessControl_init_unchained();
_baseTokenURI = "https://nft.ur.app/metadata%3Ftokenid%3D?";
minDigitForSale = 10;
maxDigitForSale = 11;
limitTourist = 100000;
_setupRole(DEFAULT_ADMIN_ROLE, admin);
_setupRole(OPERATOR_ADMIN_ROLE, admin);
_setupRole(OPERATOR_ROLE, admin);
}
function mint(address _to, uint256 _tokenId) public {
require(hasRole(OPERATOR_ROLE, msg.sender) || hasRole(MINTER_ROLE, msg.sender), "Not an operator/minter");
require(_mintAllowed(_to, _tokenId), "mint not allowed");
_mint(_to, _tokenId);
status[_tokenId] = Status.Tourist;
initilizeTouristLimit(_tokenId);
nickNames[_tokenId] = string(abi.encodePacked("Account ", StringsUpgradeable.toString(_tokenId)));
}
function mintByClient(uint256 _tokenId) external {
revert("This function is disabled");
_mintByClient(_tokenId);
}
function _mintByClient(uint256 _tokenId) internal {
revert("This function is disabled");
require(!_tokenId.hasFirstDigit(INTERNALDIGIT), "9xx cannot be mint by client");
require(_tokenId.numDigits() <= maxDigitForSale, "Number of digits of accountId > max. digits");
require(_mintAllowed(_msgSender(), _tokenId), "Not allowed. The address has/had another NFT.");
_mint(_msgSender(), _tokenId);
status[_tokenId] = Status.Tourist;
initilizeTouristLimit(_tokenId);
nickNames[_tokenId] = string(abi.encodePacked("Account ", StringsUpgradeable.toString(_tokenId)));
}
// Allow the wallet provider (i.e. the account with the specified conditions) to
// mint a new Fiat24 account (in the form of an NFT) for another address
function mintByWallet(address to, uint256 _tokenId) external payable {
revert("This function is disabled");
require(this.balanceOf(_msgSender()) > 0, "Minting address has no account");
uint256 minterTokenId = this.tokenOfOwnerByIndex(_msgSender(), 0);
require(minterTokenId.hasFirstDigit(MERCHANTDIGIT) && (minterTokenId >= 8 && minterTokenId <= 8999), "Incorrect account id for wallet");
require(walletProviderMap[minterTokenId].isAvailable, "Account not wallet provider");
require(_tokenId.numDigits() >= minDigitForSale, "mintByWallet only for minDigitForSale digits tokens");
require(_tokenId.numDigits() <= maxDigitForSale, "Number of digits of accountId > max. digits");
require(!_tokenId.hasFirstDigit(INTERNALDIGIT), "9xx cannot be mint by client");
require(!_tokenId.hasFirstDigit(MERCHANTDIGIT), "Merchant account cannot be minted by wallet");
require(_mintAllowed(to, _tokenId), "Not allowed. The target address has an account or once had another account.");
walletProvider[_tokenId] = minterTokenId;
status[_tokenId] = Status.Tourist;
require(msg.value >= mintFee, "Insufficient mint fee");
_mint(to, _tokenId);
payable(feeReceiver).transfer(msg.value);
}
/// @notice Allow CASH_OPERATOR_ROLE to mint a new Fiat24 account on behalf of a wallet provider
/// @param to The address to receive the minted account NFT
/// @param _tokenId The token ID to mint
/// @param walletProviderTokenId The wallet provider's token ID (must be a valid wallet provider)
function mintByOperator(address to, uint256 _tokenId, uint256 walletProviderTokenId) external {
require(hasRole(CASH_OPERATOR_ROLE, msg.sender), "Not a cash operator");
require(walletProviderTokenId.hasFirstDigit(MERCHANTDIGIT) && (walletProviderTokenId >= 8000000 && walletProviderTokenId <= 8999999), "Incorrect wallet provider id");
require(walletProviderMap[walletProviderTokenId].isAvailable, "Not a valid wallet provider");
require(_tokenId.numDigits() >= minDigitForSale, "Token digits < min digits for sale");
require(_tokenId.numDigits() <= maxDigitForSale, "Token digits > max digits for sale");
require(!_tokenId.hasFirstDigit(INTERNALDIGIT), "9xx cannot be minted");
require(!_tokenId.hasFirstDigit(MERCHANTDIGIT), "Merchant account cannot be minted");
require(_mintAllowed(to, _tokenId), "Target address not allowed to mint");
walletProvider[_tokenId] = walletProviderTokenId;
status[_tokenId] = Status.Tourist;
initilizeTouristLimit(_tokenId);
_mint(to, _tokenId);
}
function burn(uint256 tokenId) public {
require(hasRole(OPERATOR_ROLE, msg.sender), "Not an operator");
delete limit[tokenId];
_burn(tokenId);
}
function transferFrom(address from, address to, uint256 tokenId) public virtual override(ERC721Upgradeable, IERC721Upgradeable) {
super.transferFrom(from, to, tokenId);
if (status[tokenId] != Status.Tourist) {
historicOwnership[to] = tokenId;
}
}
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override(ERC721Upgradeable, IERC721Upgradeable) {
if (status[tokenId] != Status.Tourist) {
historicOwnership[to] = tokenId;
}
super.safeTransferFrom(from, to, tokenId);
}
function exists(uint256 tokenId) public view returns (bool) {
return _exists(tokenId);
}
function removeHistoricOwnership(address owner) external {
require(hasRole(OPERATOR_ROLE, msg.sender), "Not an operator");
delete historicOwnership[owner];
}
function changeClientStatus(uint256 tokenId, Status _status) external {
require(hasRole(OPERATOR_ROLE, msg.sender) || hasRole(CLIENTSTATUSCHANGE_ROLE, msg.sender), "Not an operator/clientstatuschange");
if (_status == Status.Live && status[tokenId] == Status.Tourist) {
historicOwnership[this.ownerOf(tokenId)] = tokenId;
initializeLiveLimit(tokenId);
}
status[tokenId] = _status;
}
function close(uint256 tokenId) external {
require(_msgSender() == this.ownerOf(tokenId), "Not account owner");
require(status[tokenId] == Status.Live, "Not live client");
status[tokenId] = Status.Closed;
}
function setMinDigitForSale(uint8 minDigit) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an admin operator");
minDigitForSale = minDigit;
}
function setMaxDigitForSale(uint8 maxDigit) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an admin operator");
maxDigitForSale = maxDigit;
}
function setMerchantRate(uint256 tokenId, uint256 _merchantRate) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an admin operator");
merchantRate[tokenId] = _merchantRate;
}
function initilizeTouristLimit(uint256 tokenId) private {
Limit storage limit_ = limit[tokenId];
limit_.usedLimit = 0;
limit_.startLimitDate = block.timestamp;
}
function initializeLiveLimit(uint256 tokenId) private {
Limit storage limit_ = limit[tokenId];
limit_.usedLimit = 0;
limit_.clientLimit = LIMITLIVEDEFAULT;
limit_.startLimitDate = block.timestamp;
}
function setClientLimit(uint256 tokenId, uint256 clientLimit) external {
require(hasRole(CLIENTSTATUSCHANGE_ROLE, msg.sender) || hasRole(OPERATOR_ROLE, msg.sender), "Not an operator");
require(_exists(tokenId), "Token does not exist");
require(status[tokenId] != Status.Tourist && status[tokenId] != Status.Na, "Not in correct status for limit control");
Limit storage limit_ = limit[tokenId];
limit_.clientLimit = clientLimit;
}
function resetUsedLimit(uint256 tokenId) external {
require(hasRole(OPERATOR_ROLE, msg.sender), "Not an operator");
require(_exists(tokenId), "Token does not exist");
Limit storage limit_ = limit[tokenId];
limit_.usedLimit = 0;
}
function setTouristLimit(uint256 newLimitTourist) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an admin operator");
limitTourist = newLimitTourist;
}
function checkLimit(uint256 tokenId, uint256 amount) external view returns (bool) {
if (_exists(tokenId)) {
if (tokenId >= 9100 && tokenId <= 9299) {
return true;
}
Limit storage limit_ = limit[tokenId];
uint256 lastLimitPeriodEnd = limit_.startLimitDate + THIRTYDAYS;
if (status[tokenId] == Status.Tourist) {
return (lastLimitPeriodEnd < block.timestamp && amount <= limitTourist)
|| (lastLimitPeriodEnd >= block.timestamp && (limit_.usedLimit + amount) <= limitTourist);
} else {
return (lastLimitPeriodEnd < block.timestamp && amount <= limit_.clientLimit)
|| (lastLimitPeriodEnd >= block.timestamp && (limit_.usedLimit + amount) <= limit_.clientLimit);
}
} else {
return false;
}
}
function updateLimit(uint256 tokenId, uint256 amount) external {
require(hasRole(LIMITUPDATER_ROLE, msg.sender), "Not a limit-updater");
if (tokenId >= 9100 && tokenId <= 9299) {
return;
}
if (status[tokenId] == Status.Live || status[tokenId] == Status.Tourist) {
Limit storage limit_ = limit[tokenId];
uint256 lastLimitPeriodEnd = limit_.startLimitDate + THIRTYDAYS;
if (lastLimitPeriodEnd < block.timestamp) {
limit_.startLimitDate = block.timestamp;
limit_.usedLimit = amount;
} else {
limit_.usedLimit += amount;
}
}
}
function setNickname(uint256 tokenId, string memory nickname) public {
require(_msgSender() == this.ownerOf(tokenId), "Not account owner");
nickNames[tokenId] = nickname;
}
function addWalletProvider(uint256 number, string memory name) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an operator admin");
walletProviderMap[number].walletProvider = name;
walletProviderMap[number].isAvailable = true;
}
function removeWalletProvider(uint256 number) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an operator admin");
delete walletProviderMap[number];
}
function setNftAvatar(string memory url) external {
require(this.balanceOf(_msgSender()) > 0, "Address has no account");
uint256 tokenId = this.tokenOfOwnerByIndex(_msgSender(), 0);
nftAvatar[tokenId] = url;
}
function setBaseURI(string calldata newBaseURI) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an admin operator");
_baseTokenURI = newBaseURI;
}
function setMintFee(uint256 _mintFee) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an admin operator");
mintFee = _mintFee;
}
function setFeeReceiver(address _feeReceiver) external {
require(hasRole(OPERATOR_ADMIN_ROLE, msg.sender), "Not an admin operator");
require(_feeReceiver != address(0), "Zero address");
feeReceiver = _feeReceiver;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
string memory uriStatusParam = _uriStatusParam();
string memory uriWalletParam = _uriWalletParam();
return bytes(baseURI).length > 0
? string(
abi.encodePacked(
baseURI,
StringsUpgradeable.toString(tokenId),
uriStatusParam,
StringsUpgradeable.toString(uint256(status[tokenId])),
uriWalletParam,
StringsUpgradeable.toString(walletProvider[tokenId])
)
)
: "";
}
function _baseURI() internal view virtual override returns (string memory) {
return _baseTokenURI;
}
function _uriStatusParam() internal pure returns (string memory) {
return "&status=";
}
function _uriWalletParam() internal pure returns (string memory) {
return "&wallet=";
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AccessControlUpgradeable, ERC721Upgradeable, ERC721EnumerableUpgradeable)
returns (bool)
{
return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId
|| super.supportsInterface(interfaceId);
}
function pause() public {
require(hasRole(PAUSE_ROLE, msg.sender), "Not a pauser");
_pause();
}
function unpause() public {
require(hasRole(UNPAUSE_ROLE, msg.sender), "Not an unpauser");
_unpause();
}
function _mintAllowed(address to, uint256 tokenId) internal view returns (bool) {
return (this.balanceOf(to) < 1 && (historicOwnership[to] == 0 || historicOwnership[to] == tokenId));
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
virtual
override(ERC721EnumerableUpgradeable, ERC721PausableUpgradeable)
{
require(!paused(), "Account transfers suspended");
if (AddressUpgradeable.isContract(to) && (from != address(0))) {
require(this.status(tokenId) == Status.Tourist, "Not allowed to transfer account");
} else {
if ((from != address(0) && to != address(0))) {
if (_exists(9106)) {
require(
(balanceOf(to) < 1 && (historicOwnership[to] == 0 || historicOwnership[to] == tokenId))
|| (tokenOfOwnerByIndex(to, 0) == 9106 && this.status(tokenId) == Status.Closed),
"Not allowed. The target address has an account or once had another account."
);
require(
(this.status(tokenId) == Status.Live || this.status(tokenId) == Status.Tourist)
|| (balanceOf(to) > 0 && tokenOfOwnerByIndex(to, 0) == 9106 && this.status(tokenId) == Status.Closed),
"Transfer not allowed in this status"
);
} else {
require(
balanceOf(to) < 1 && (historicOwnership[to] == 0 || historicOwnership[to] == tokenId),
"Not allowed. The target address has an account or once had another account."
);
require(this.status(tokenId) == Status.Live || this.status(tokenId) == Status.Tourist, "Transfer not allowed in this status");
}
}
}
super._beforeTokenTransfer(from, to, tokenId);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
function __ERC721Enumerable_init() internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
__ERC721Enumerable_init_unchained();
}
function __ERC721Enumerable_init_unchained() internal onlyInitializing {
}
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) {
return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721Upgradeable.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
uint256[46] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Pausable.sol)
pragma solidity ^0.8.0;
import "../ERC721Upgradeable.sol";
import "../../../security/PausableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev ERC721 token with pausable token transfers, minting and burning.
*
* Useful for scenarios such as preventing trades until the end of an evaluation
* period, or having an emergency switch for freezing all token transfers in the
* event of a large bug.
*/
abstract contract ERC721PausableUpgradeable is Initializable, ERC721Upgradeable, PausableUpgradeable {
function __ERC721Pausable_init() internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
__Pausable_init_unchained();
__ERC721Pausable_init_unchained();
}
function __ERC721Pausable_init_unchained() internal onlyInitializing {
}
/**
* @dev See {ERC721-_beforeTokenTransfer}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
require(!paused(), "ERC721Pausable: token transfer while paused");
}
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20Upgradeable {
using AddressUpgradeable for address;
function safeTransfer(
IERC20Upgradeable token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20Upgradeable token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
__AccessControl_init_unchained();
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
library DigitsOfUint {
using SafeMathUpgradeable for uint256;
function numDigits(uint256 _number) internal pure returns (uint256) {
uint256 number = _number;
uint256 digits = 0;
while (number != 0) {
number = number.div(10);
digits = digits.add(1);
}
return digits;
}
function hasFirstDigit(uint256 _accountId, uint256 _firstDigit) internal pure returns (bool) {
uint256 number = _accountId;
while (number >= 10) {
number = number.div(10);
}
return number == _firstDigit;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
using AddressUpgradeable for address;
using StringsUpgradeable for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
__ERC721_init_unchained(name_, symbol_);
}
function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC721Upgradeable).interfaceId ||
interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721Upgradeable.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721Upgradeable.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721Upgradeable.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
uint256[44] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)
pragma solidity ^0.8.0;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
* initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() initializer {}
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
// contract may have been reentered.
require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} modifier, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
function _isConstructor() private view returns (bool) {
return !AddressUpgradeable.isContract(address(this));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Context_init_unchained();
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
__Context_init_unchained();
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
__ERC165_init_unchained();
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMathUpgradeable {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721Upgradeable is IERC165Upgradeable {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721ReceiverUpgradeable {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"@uniswap/v3-core/=lib/v3-core/",
"@uniswap/v3-periphery/=lib/v3-periphery/",
"@uniswap/swap-router-contracts/=lib/swap-router-contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/",
"openzeppelin-4.7.3/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable-4.7.3/",
"@safe-contracts/contracts/=lib/mantle-cdk/lib/safe-contracts/contracts/",
"forge-std/=lib/forge-std/src/",
"mantle-cdk/=lib/mantle-cdk/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
"@layerzerolabs/=node_modules/@layerzerolabs/",
"@createx-forge/=lib/mantle-cdk/lib/createx-forge/",
"@solady/=lib/mantle-cdk/lib/solady/src/",
"createx-forge/=lib/mantle-cdk/lib/createx-forge/",
"ds-test/=lib/mantle-cdk/lib/surl/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/mantle-cdk/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"halmos-cheatcodes/=lib/mantle-cdk/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"openzeppelin-foundry-upgrades/=lib/mantle-cdk/lib/openzeppelin-foundry-upgrades/src/",
"safe-contracts/=lib/mantle-cdk/lib/safe-contracts/",
"solady/=lib/mantle-cdk/lib/solady/src/",
"solidity-stringutils/=lib/mantle-cdk/lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
"surl/=lib/mantle-cdk/lib/surl/",
"swap-router-contracts/=lib/swap-router-contracts/contracts/",
"v3-core/=lib/v3-core/",
"v3-periphery/=lib/v3-periphery/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 1
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false
}Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"CASH_OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CLIENTSTATUSCHANGE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_MERCHANT_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INTERNALDIGIT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIMITLIVEDEFAULT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIMITUPDATER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MERCHANTDIGIT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"THIRTYDAYS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNPAUSE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"name":"addWalletProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum Fiat24Account.Status","name":"_status","type":"uint8"}],"name":"changeClientStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"checkLimit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"close","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"historicOwnership","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isMerchant","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"limit","outputs":[{"internalType":"uint256","name":"usedLimit","type":"uint256"},{"internalType":"uint256","name":"clientLimit","type":"uint256"},{"internalType":"uint256","name":"startLimitDate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitTourist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDigitForSale","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"merchantRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDigitForSale","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintByClient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"walletProviderTokenId","type":"uint256"}],"name":"mintByOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintByWallet","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftAvatar","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nickNames","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oldTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"removeHistoricOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"number","type":"uint256"}],"name":"removeWalletProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetUsedLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"clientLimit","type":"uint256"}],"name":"setClientLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeReceiver","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"maxDigit","type":"uint8"}],"name":"setMaxDigitForSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"_merchantRate","type":"uint256"}],"name":"setMerchantRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"minDigit","type":"uint8"}],"name":"setMinDigitForSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintFee","type":"uint256"}],"name":"setMintFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"url","type":"string"}],"name":"setNftAvatar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"nickname","type":"string"}],"name":"setNickname","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLimitTourist","type":"uint256"}],"name":"setTouristLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"status","outputs":[{"internalType":"enum Fiat24Account.Status","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"updateLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"walletProvider","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"walletProviderMap","outputs":[{"internalType":"string","name":"walletProvider","type":"string"},{"internalType":"bool","name":"isAvailable","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50614f2a806100206000396000f3fe60806040526004361061036d5760003560e01c8063013e53d11461037257806301ffc9a7146103a7578063023b62a2146103d75780630264e7e9146103f957806306fdde0314610427578063081812fc14610449578063095ea7b314610476578063099d2ec8146104965780630aebeb4e146104ad5780630e8477f8146104cd57806310480e13146104ed5780631278e2d21461050057806313966db51461052757806318160ddd1461053e57806321d39e5a1461055357806323b872dd14610573578063243bcfcb14610593578063248a9ca3146105eb57806324a933eb1461060b5780632856784b146106205780632ac35485146106405780632af04790146106605780632f2ff15d1461068e5780632f745c59146106ae578063309756fb146106ce57806336568abe146106f0578063389ed267146107105780633ea3ab8e146107325780633f4ba83a1461075257806340c10f191461076757806342842e0e1461078757806342966c68146107a757806342d21ef7146107c75780634bedccf4146108055780634f558e79146108255780634f6ccce71461084557806353012e5c1461086557806355f804b31461088757806356ecb92b146108a7578063592b2051146108be5780635c975abb146108d95780636352211e146108f157806368800cd3146109115780636917574a1461093f5780636a46a1b714610956578063701eec931461097657806370a08231146109a757806370def791146109c75780637115fb42146109e75780637220b19914610a0757806380f669df14610a2257806383561e8414610a425780638456cb5914610a625780638ae80b5814610a7757806391d1485414610a9757806395d89b4114610ab75780639630571914610acc5780639ffa6e9714610afa578063a217fddf14610b28578063a22cb46514610b3d578063b3f0067414610b5d578063b88d4fde14610b7e578063b9464c9314610b9e578063c1cccc7014610bb3578063c36eeea814610bd3578063c4d66de814610bf3578063c7b4b68914610c13578063c81472b414610c33578063c87b56dd14610c53578063d539139314610c73578063d547741f14610c95578063d92af1b714610cb5578063dac500e314610cd5578063e985e9c514610cf7578063e9d2b1b314610d17578063eddd0d9c14610d39578063efdcd97414610d59578063f5b541a614610d79575b600080fd5b34801561037e57600080fd5b50610394600080516020614dcc83398151915281565b6040519081526020015b60405180910390f35b3480156103b357600080fd5b506103c76103c2366004614161565b610d9b565b604051901515815260200161039e565b3480156103e357600080fd5b506103f76103f2366004614229565b610de1565b005b34801561040557600080fd5b5061041961041436600461425d565b610f1d565b60405161039e9291906142c6565b34801561043357600080fd5b5061043c610fc5565b60405161039e91906142ea565b34801561045557600080fd5b5061046961046436600461425d565b611057565b60405161039e91906142fd565b34801561048257600080fd5b506103f7610491366004614326565b6110df565b3480156104a257600080fd5b50610394620186a081565b3480156104b957600080fd5b506103f76104c836600461425d565b6111ea565b3480156104d957600080fd5b506103f76104e8366004614352565b6112fb565b6103f76104fb366004614326565b61134a565b34801561050c57600080fd5b50610515600981565b60405160ff909116815260200161039e565b34801561053357600080fd5b5061039461016c5481565b34801561054a57600080fd5b50609954610394565b34801561055f57600080fd5b506103f761056e36600461436f565b611394565b34801561057f57600080fd5b506103f761058e3660046143b5565b611404565b34801561059f57600080fd5b506105d06105ae36600461425d565b6101656020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161039e565b3480156105f757600080fd5b5061039461060636600461425d565b611459565b34801561061757600080fd5b50610394603781565b34801561062c57600080fd5b506103f761063b3660046143f6565b61146f565b34801561064c57600080fd5b506103f761065b3660046143f6565b6114ba565b34801561066c57600080fd5b5061039461067b366004614352565b6101606020526000908152604090205481565b34801561069a57600080fd5b506103f76106a9366004614419565b61150b565b3480156106ba57600080fd5b506103946106c9366004614326565b611528565b3480156106da57600080fd5b50610394600080516020614e9583398151915281565b3480156106fc57600080fd5b506103f761070b366004614419565b6115be565b34801561071c57600080fd5b50610394600080516020614ed583398151915281565b34801561073e57600080fd5b506101665461051590610100900460ff1681565b34801561075e57600080fd5b506103f761163c565b34801561077357600080fd5b506103f7610782366004614326565b61169c565b34801561079357600080fd5b506103f76107a23660046143b5565b6117cd565b3480156107b357600080fd5b506103f76107c236600461425d565b611820565b3480156107d357600080fd5b506107f86107e236600461425d565b6101646020526000908152604090205460ff1681565b60405161039e919061445f565b34801561081157600080fd5b506103f7610820366004614487565b61187d565b34801561083157600080fd5b506103c761084036600461425d565b6119aa565b34801561085157600080fd5b5061039461086036600461425d565b6119b5565b34801561087157600080fd5b50610394600080516020614eb583398151915281565b34801561089357600080fd5b506103f76108a23660046144a9565b611a48565b3480156108b357600080fd5b5061039462278d0081565b3480156108ca57600080fd5b506103f76104fb36600461425d565b3480156108e557600080fd5b5060c95460ff166103c7565b3480156108fd57600080fd5b5061046961090c36600461425d565b611a8a565b34801561091d57600080fd5b5061039461092c36600461425d565b6101676020526000908152604090205481565b34801561094b57600080fd5b5061039461015f5481565b34801561096257600080fd5b506103f761097136600461425d565b611b01565b34801561098257600080fd5b506103c761099136600461425d565b6101626020526000908152604090205460ff1681565b3480156109b357600080fd5b506103946109c2366004614352565b611b5e565b3480156109d357600080fd5b506103f76109e2366004614527565b611be5565b3480156109f357600080fd5b506103f7610a02366004614487565b611d9b565b348015610a1357600080fd5b50610166546105159060ff1681565b348015610a2e57600080fd5b5061043c610a3d36600461425d565b611de2565b348015610a4e57600080fd5b506103f7610a5d36600461425d565b611e7d565b348015610a6e57600080fd5b506103f7611ee8565b348015610a8357600080fd5b506103f7610a9236600461454c565b611f43565b348015610aa357600080fd5b506103c7610ab2366004614419565b612294565b348015610ac357600080fd5b5061043c6122c0565b348015610ad857600080fd5b50610394610ae736600461425d565b61016a6020526000908152604090205481565b348015610b0657600080fd5b50610394610b1536600461425d565b6101636020526000908152604090205481565b348015610b3457600080fd5b50610394600081565b348015610b4957600080fd5b506103f7610b58366004614581565b6122cf565b348015610b6957600080fd5b5061016d54610469906001600160a01b031681565b348015610b8a57600080fd5b506103f7610b993660046145b4565b6122da565b348015610baa57600080fd5b50610515600881565b348015610bbf57600080fd5b5061043c610bce36600461425d565b61230c565b348015610bdf57600080fd5b506103c7610bee366004614487565b612326565b348015610bff57600080fd5b506103f7610c0e366004614352565b612427565b348015610c1f57600080fd5b506103f7610c2e36600461425d565b6125b1565b348015610c3f57600080fd5b506103f7610c4e366004614487565b6125eb565b348015610c5f57600080fd5b5061043c610c6e36600461425d565b61272a565b348015610c7f57600080fd5b50610394600080516020614e3583398151915281565b348015610ca157600080fd5b506103f7610cb0366004614419565b612897565b348015610cc157600080fd5b506103f7610cd036600461436f565b6128b4565b348015610ce157600080fd5b50610394600080516020614e5583398151915281565b348015610d0357600080fd5b506103c7610d12366004614633565b61295d565b348015610d2357600080fd5b50610394600080516020614dac83398151915281565b348015610d4557600080fd5b506103f7610d5436600461425d565b61298b565b348015610d6557600080fd5b506103f7610d74366004614352565b6129c5565b348015610d8557600080fd5b50610394600080516020614e1583398151915281565b60006001600160e01b031982166380ac58cd60e01b1480610dcc57506001600160e01b03198216635b5e139f60e01b145b80610ddb5750610ddb82612a61565b92915050565b6040516370a0823160e01b815260009030906370a0823190610e079033906004016142fd565b602060405180830381865afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e489190614661565b11610e935760405162461bcd60e51b81526020600482015260166024820152751059191c995cdcc81a185cc81b9bc81858d8dbdd5b9d60521b60448201526064015b60405180910390fd5b604051632f745c5960e01b8152336004820152600060248201819052903090632f745c5990604401602060405180830381865afa158015610ed8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efc9190614661565b600081815261016960205260409020909150610f188382614717565b505050565b61016860205260009081526040902080548190610f399061467a565b80601f0160208091040260200160405190810160405280929190818152602001828054610f659061467a565b8015610fb25780601f10610f8757610100808354040283529160200191610fb2565b820191906000526020600020905b815481529060010190602001808311610f9557829003601f168201915b5050506001909301549192505060ff1682565b606060658054610fd49061467a565b80601f01602080910402602001604051908101604052809291908181526020018280546110009061467a565b801561104d5780601f106110225761010080835404028352916020019161104d565b820191906000526020600020905b81548152906001019060200180831161103057829003601f168201915b5050505050905090565b600061106282612a86565b6110c35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e8a565b506000908152606960205260409020546001600160a01b031690565b60006110ea82611a8a565b9050806001600160a01b0316836001600160a01b0316036111575760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e8a565b336001600160a01b03821614806111735750611173813361295d565b6111e05760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610e8a565b610f188383612aa3565b6040516331a9108f60e11b8152600481018290523090636352211e90602401602060405180830381865afa158015611226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124a91906147d0565b6001600160a01b0316336001600160a01b03161461127a5760405162461bcd60e51b8152600401610e8a906147ed565b60056000828152610164602052604090205460ff1660058111156112a0576112a0614449565b146112df5760405162461bcd60e51b815260206004820152600f60248201526e139bdd081b1a5d994818db1a595b9d608a1b6044820152606401610e8a565b600090815261016460205260409020805460ff19166004179055565b611313600080516020614e1583398151915233612294565b61132f5760405162461bcd60e51b8152600401610e8a90614818565b6001600160a01b031660009081526101606020526040812055565b60405162461bcd60e51b8152602060048201526019602482015278151a1a5cc8199d5b98dd1a5bdb881a5cc8191a5cd8589b1959603a1b6044820152606401610e8a565b50505050565b6113ac600080516020614e5583398151915233612294565b6113c85760405162461bcd60e51b8152600401610e8a906148b2565b6000828152610168602052604090206113e18282614717565b50506000908152610168602052604090206001908101805460ff19169091179055565b61140f838383612d49565b60026000828152610164602052604090205460ff16600581111561143557611435614449565b14610f18576001600160a01b03919091166000908152610160602052604090205550565b600090815261012d602052604090206001015490565b611487600080516020614e5583398151915233612294565b6114a35760405162461bcd60e51b8152600401610e8a906148e1565b610166805460ff191660ff92909216919091179055565b6114d2600080516020614e5583398151915233612294565b6114ee5760405162461bcd60e51b8152600401610e8a906148e1565b610166805460ff9092166101000261ff0019909216919091179055565b61151482611459565b61151e8133612d7a565b610f188383612dde565b600061153383611b5e565b82106115955760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e8a565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b6001600160a01b038116331461162e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e8a565b6116388282612e65565b5050565b611654600080516020614e9583398151915233612294565b6116925760405162461bcd60e51b815260206004820152600f60248201526e2737ba1030b7103ab73830bab9b2b960891b6044820152606401610e8a565b61169a612ecd565b565b6116b4600080516020614e1583398151915233612294565b806116d257506116d2600080516020614e3583398151915233612294565b6117175760405162461bcd60e51b81526020600482015260166024820152752737ba1030b71037b832b930ba37b917b6b4b73a32b960511b6044820152606401610e8a565b6117218282612b69565b6117605760405162461bcd60e51b815260206004820152601060248201526f1b5a5b9d081b9bdd08185b1b1bddd95960821b6044820152606401610e8a565b61176a8282612c1d565b600081815261016460205260409020805460ff1916600217905561178d81612f5a565b61179681612f75565b6040516020016117a69190614910565b60408051601f1981840301815291815260008381526101616020522090610f189082614717565b60026000828152610164602052604090205460ff1660058111156117f3576117f3614449565b14611815576001600160a01b0382166000908152610160602052604090208190555b610f1883838361307d565b611838600080516020614e1583398151915233612294565b6118545760405162461bcd60e51b8152600401610e8a90614818565b600081815261016560205260408120818155600181018290556002015561187a81613098565b50565b611895600080516020614dcc83398151915233612294565b6118d75760405162461bcd60e51b81526020600482015260136024820152722737ba1030903634b6b4ba16bab83230ba32b960691b6044820152606401610e8a565b61238c82101580156118eb57506124538211155b156118f4575050565b60056000838152610164602052604090205460ff16600581111561191a5761191a614449565b1480611949575060026000838152610164602052604090205460ff16600581111561194757611947614449565b145b156116385760008281526101656020526040812060028101549091906119739062278d0090614956565b90504281101561198b5742600283015582825561138e565b8282600001600082825461199f9190614956565b909155505050505050565b6000610ddb82612a86565b60006119c060995490565b8210611a235760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e8a565b60998281548110611a3657611a36614969565b90600052602060002001549050919050565b611a60600080516020614e5583398151915233612294565b611a7c5760405162461bcd60e51b8152600401610e8a906148e1565b61016b610f1882848361497f565b6000818152606760205260408120546001600160a01b031680610ddb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610e8a565b611b19600080516020614e5583398151915233612294565b611b355760405162461bcd60e51b8152600401610e8a906148b2565b60008181526101686020526040812090611b4f82826140fd565b50600101805460ff1916905550565b60006001600160a01b038216611bc95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610e8a565b506001600160a01b031660009081526068602052604090205490565b611bfd600080516020614e1583398151915233612294565b80611c1b5750611c1b600080516020614dac83398151915233612294565b611c725760405162461bcd60e51b815260206004820152602260248201527f4e6f7420616e206f70657261746f722f636c69656e747374617475736368616e604482015261676560f01b6064820152608401610e8a565b6005816005811115611c8657611c86614449565b148015611cb6575060026000838152610164602052604090205460ff166005811115611cb457611cb4614449565b145b15611d66576040516331a9108f60e11b8152600481018390528290610160906000903090636352211e90602401602060405180830381865afa158015611d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2491906147d0565b6001600160a01b03168152602081019190915260400160002055611d6682600090815261016560205260408120908155620186a0600182015542600290910155565b600082815261016460205260409020805482919060ff19166001836005811115611d9257611d92614449565b02179055505050565b611db3600080516020614e5583398151915233612294565b611dcf5760405162461bcd60e51b8152600401610e8a906148e1565b6000918252610163602052604090912055565b6101696020526000908152604090208054611dfc9061467a565b80601f0160208091040260200160405190810160405280929190818152602001828054611e289061467a565b8015611e755780601f10611e4a57610100808354040283529160200191611e75565b820191906000526020600020905b815481529060010190602001808311611e5857829003601f168201915b505050505081565b611e95600080516020614e1583398151915233612294565b611eb15760405162461bcd60e51b8152600401610e8a90614818565b611eba81612a86565b611ed65760405162461bcd60e51b8152600401610e8a90614a39565b60009081526101656020526040812055565b611f00600080516020614ed583398151915233612294565b611f3b5760405162461bcd60e51b815260206004820152600c60248201526b2737ba1030903830bab9b2b960a11b6044820152606401610e8a565b61169a61312d565b611f5b600080516020614eb583398151915233612294565b611f9d5760405162461bcd60e51b81526020600482015260136024820152722737ba10309031b0b9b41037b832b930ba37b960691b6044820152606401610e8a565b611fa8816008612b11565b8015611fc55750627a12008110158015611fc557506289543f8111155b6120105760405162461bcd60e51b815260206004820152601c60248201527b125b98dbdc9c9958dd081dd85b1b195d081c1c9bdd9a59195c881a5960221b6044820152606401610e8a565b6000818152610168602052604090206001015460ff166120705760405162461bcd60e51b815260206004820152601b60248201527a2737ba1030903b30b634b2103bb0b63632ba10383937bb34b232b960291b6044820152606401610e8a565b6101665460ff1661208083612b38565b10156120d95760405162461bcd60e51b815260206004820152602260248201527f546f6b656e20646967697473203c206d696e2064696769747320666f722073616044820152616c6560f01b6064820152608401610e8a565b61016654610100900460ff166120ee83612b38565b11156121475760405162461bcd60e51b815260206004820152602260248201527f546f6b656e20646967697473203e206d61782064696769747320666f722073616044820152616c6560f01b6064820152608401610e8a565b612152826009612b11565b156121965760405162461bcd60e51b81526020600482015260146024820152730e5e1e0818d85b9b9bdd081899481b5a5b9d195960621b6044820152606401610e8a565b6121a1826008612b11565b156121f85760405162461bcd60e51b815260206004820152602160248201527f4d65726368616e74206163636f756e742063616e6e6f74206265206d696e74656044820152601960fa1b6064820152608401610e8a565b6122028383612b69565b6122595760405162461bcd60e51b815260206004820152602260248201527f5461726765742061646472657373206e6f7420616c6c6f77656420746f206d696044820152611b9d60f21b6064820152608401610e8a565b6000828152610167602090815260408083208490556101649091529020805460ff1916600217905561228a82612f5a565b610f188383612c1d565b600091825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060668054610fd49061467a565b6116383383836131a8565b6122e43383613272565b6123005760405162461bcd60e51b8152600401610e8a90614a67565b61138e84848484613334565b6101616020526000908152604090208054611dfc9061467a565b600061233183612a86565b1561241f5761238c831015801561234a57506124538311155b1561235757506001610ddb565b600083815261016560205260408120600281015490919061237c9062278d0090614956565b905060026000868152610164602052604090205460ff1660058111156123a4576123a4614449565b036123e95742811080156123bb575061015f548411155b806123e057504281101580156123e0575061015f5482546123dd908690614956565b11155b92505050610ddb565b42811080156123fc575081600101548411155b806123e057504281101580156123e05750600182015482546123dd908690614956565b506000610ddb565b600054610100900460ff166124425760005460ff1615612446565b303b155b6124a95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e8a565b600054610100900460ff161580156124cb576000805461ffff19166101011790555b6124d3613367565b6125196040518060400160405280600a8152602001691554881058d8dbdd5b9d60b21b815250604051806040016040528060028152602001612aa960f11b81525061338e565b612521613367565b604051806060016040528060298152602001614dec6029913961016b906125489082614717565b50610166805461ffff1916610b0a179055620186a061015f5561256c6000836133ce565b612584600080516020614e55833981519152836133ce565b61259c600080516020614e15833981519152836133ce565b8015611638576000805461ff00191690555050565b6125c9600080516020614e5583398151915233612294565b6125e55760405162461bcd60e51b8152600401610e8a906148e1565b61015f55565b612603600080516020614dac83398151915233612294565b806126215750612621600080516020614e1583398151915233612294565b61263d5760405162461bcd60e51b8152600401610e8a90614818565b61264682612a86565b6126625760405162461bcd60e51b8152600401610e8a90614a39565b60026000838152610164602052604090205460ff16600581111561268857612688614449565b141580156126b857506000828152610164602052604081205460ff1660058111156126b5576126b5614449565b14155b6127145760405162461bcd60e51b815260206004820152602760248201527f4e6f7420696e20636f72726563742073746174757320666f72206c696d69742060448201526618dbdb9d1c9bdb60ca1b6064820152608401610e8a565b6000918252610165602052604090912060010155565b606061273582612a86565b6127995760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610e8a565b60006127a36133d8565b905060006127cc604080518082019091526008815267267374617475733d60c01b602082015290565b905060006127f56040805180820190915260088152672677616c6c65743d60c01b602082015290565b90506000835111612815576040518060200160405280600081525061288e565b8261281f86612f75565b60008781526101646020526040902054849061284e9060ff16600581111561284957612849614449565b612f75565b60008981526101676020526040902054859061286990612f75565b60405160200161287e96959493929190614ab8565b6040516020818303038152906040525b95945050505050565b6128a082611459565b6128aa8133612d7a565b610f188383612e65565b6040516331a9108f60e11b8152600481018390523090636352211e90602401602060405180830381865afa1580156128f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061291491906147d0565b6001600160a01b0316336001600160a01b0316146129445760405162461bcd60e51b8152600401610e8a906147ed565b600082815261016160205260409020610f188282614717565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6129a3600080516020614e5583398151915233612294565b6129bf5760405162461bcd60e51b8152600401610e8a906148e1565b61016c55565b6129dd600080516020614e5583398151915233612294565b6129f95760405162461bcd60e51b8152600401610e8a906148e1565b6001600160a01b038116612a3e5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610e8a565b61016d80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b03198216637965db0b60e01b1480610ddb5750610ddb826133e8565b6000908152606760205260409020546001600160a01b0316151590565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ad882611a8a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000825b600a8110612b2f57612b2881600a61340d565b9050612b15565b90911492915050565b600081815b8115612b6257612b4e82600a61340d565b9150612b5b816001613419565b9050612b3d565b9392505050565b6040516370a0823160e01b815260009060019030906370a0823190612b929087906004016142fd565b602060405180830381865afa158015612baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd39190614661565b108015612b6257506001600160a01b038316600090815261016060205260409020541580612b625750506001600160a01b0391909116600090815261016060205260409020541490565b6001600160a01b038216612c735760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e8a565b612c7c81612a86565b15612cc85760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610e8a565b612cd460008383613425565b6001600160a01b0382166000908152606860205260408120805460019290612cfd908490614956565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051839290600080516020614e75833981519152908290a45050565b612d533382613272565b612d6f5760405162461bcd60e51b8152600401610e8a90614a67565b610f188383836139be565b612d848282612294565b61163857612d9c816001600160a01b03166014613b57565b612da7836020613b57565b604051602001612db8929190614b37565b60408051601f198184030181529082905262461bcd60e51b8252610e8a916004016142ea565b612de88282612294565b61163857600082815261012d602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612e213390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612e6f8282612294565b1561163857600082815261012d602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60c95460ff16612f165760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610e8a565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051612f5091906142fd565b60405180910390a1565b60009081526101656020526040812090815542600290910155565b606081600003612f9c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612fc65780612fb081614ba6565b9150612fbf9050600a83614bd5565b9150612fa0565b6000816001600160401b03811115612fe057612fe061417e565b6040519080825280601f01601f19166020018201604052801561300a576020820181803683370190505b5090505b84156130755761301f600183614be9565b915061302c600a86614bfc565b613037906030614956565b60f81b81838151811061304c5761304c614969565b60200101906001600160f81b031916908160001a90535061306e600a86614bd5565b945061300e565b949350505050565b610f18838383604051806020016040528060008152506122da565b60006130a382611a8a565b90506130b181600084613425565b6130bc600083612aa3565b6001600160a01b03811660009081526068602052604081208054600192906130e5908490614be9565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b03841690600080516020614e75833981519152908390a45050565b60c95460ff16156131735760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610e8a565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f433390565b816001600160a01b0316836001600160a01b0316036132055760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610e8a565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600061327d82612a86565b6132de5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e8a565b60006132e983611a8a565b9050806001600160a01b0316846001600160a01b031614806133245750836001600160a01b031661331984611057565b6001600160a01b0316145b806130755750613075818561295d565b61333f8484846139be565b61334b84848484613cf2565b61138e5760405162461bcd60e51b8152600401610e8a90614c10565b600054610100900460ff1661169a5760405162461bcd60e51b8152600401610e8a90614c62565b600054610100900460ff166133b55760405162461bcd60e51b8152600401610e8a90614c62565b60656133c18382614717565b506066610f188282614717565b6116388282612dde565b606061016b8054610fd49061467a565b60006001600160e01b0319821663780e9d6360e01b1480610ddb5750610ddb82613df3565b6000612b628284614bd5565b6000612b628284614956565b60c95460ff16156134765760405162461bcd60e51b815260206004820152601b60248201527a1058d8dbdd5b9d081d1c985b9cd9995c9cc81cdd5cdc195b991959602a1b6044820152606401610e8a565b813b1515801561348e57506001600160a01b03831615155b156135585760026040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156134d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134f59190614cad565b600581111561350657613506614449565b146135535760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420616c6c6f77656420746f207472616e73666572206163636f756e74006044820152606401610e8a565b6139b3565b6001600160a01b0383161580159061357857506001600160a01b03821615155b156139b357613588612392612a86565b1561383b57600161359883611b5e565b1080156135de57506001600160a01b0382166000908152610160602052604090205415806135de57506001600160a01b0382166000908152610160602052604090205481145b8061366f57506135ef826000611528565b61239214801561366f575060046040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa158015613638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365c9190614cad565b600581111561366d5761366d614449565b145b61368b5760405162461bcd60e51b8152600401610e8a90614841565b60056040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156136c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ed9190614cad565b60058111156136fe576136fe614449565b148061377a575060026040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa158015613743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137679190614cad565b600581111561377857613778614449565b145b8061381f5750600061378b83611b5e565b1180156137a3575061379e826000611528565b612392145b801561381f575060046040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156137e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061380c9190614cad565b600581111561381d5761381d614449565b145b6135535760405162461bcd60e51b8152600401610e8a90614cca565b600161384683611b5e565b10801561388c57506001600160a01b03821660009081526101606020526040902054158061388c57506001600160a01b0382166000908152610160602052604090205481145b6138a85760405162461bcd60e51b8152600401610e8a90614841565b60056040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156138e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061390a9190614cad565b600581111561391b5761391b614449565b1480613997575060026040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa158015613960573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139849190614cad565b600581111561399557613995614449565b145b6139b35760405162461bcd60e51b8152600401610e8a90614cca565b610f18838383613e43565b826001600160a01b03166139d182611a8a565b6001600160a01b031614613a395760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610e8a565b6001600160a01b038216613a9b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e8a565b613aa6838383613425565b613ab1600082612aa3565b6001600160a01b0383166000908152606860205260408120805460019290613ada908490614be9565b90915550506001600160a01b0382166000908152606860205260408120805460019290613b08908490614956565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b038681169182179092559151849391871691600080516020614e7583398151915291a4505050565b60606000613b66836002614d0d565b613b71906002614956565b6001600160401b03811115613b8857613b8861417e565b6040519080825280601f01601f191660200182016040528015613bb2576020820181803683370190505b509050600360fc1b81600081518110613bcd57613bcd614969565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bfc57613bfc614969565b60200101906001600160f81b031916908160001a9053506000613c20846002614d0d565b613c2b906001614956565b90505b6001811115613ca3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c5f57613c5f614969565b1a60f81b828281518110613c7557613c75614969565b60200101906001600160f81b031916908160001a90535060049490941c93613c9c81614d24565b9050613c2e565b508315612b625760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e8a565b60006001600160a01b0384163b15613de857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613d36903390899088908890600401614d3b565b6020604051808303816000875af1925050508015613d71575060408051601f3d908101601f19168201909252613d6e91810190614d78565b60015b613dce573d808015613d9f576040519150601f19603f3d011682016040523d82523d6000602084013e613da4565b606091505b508051600003613dc65760405162461bcd60e51b8152600401610e8a90614c10565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613075565b506001949350505050565b60006001600160e01b031982166380ac58cd60e01b1480613e2457506001600160e01b03198216635b5e139f60e01b145b80610ddb57506301ffc9a760e01b6001600160e01b0319831614610ddb565b613e4e838383613eb5565b60c95460ff1615610f185760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610e8a565b6001600160a01b038316613f1057613f0b81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b613f33565b816001600160a01b0316836001600160a01b031614613f3357613f338382613f6d565b6001600160a01b038216613f4a57610f188161400a565b826001600160a01b0316826001600160a01b031614610f1857610f1882826140b9565b60006001613f7a84611b5e565b613f849190614be9565b600083815260986020526040902054909150808214613fd7576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b60995460009061401c90600190614be9565b6000838152609a60205260408120546099805493945090928490811061404457614044614969565b90600052602060002001549050806099838154811061406557614065614969565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061409d5761409d614d95565b6001900381819060005260206000200160009055905550505050565b60006140c483611b5e565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b5080546141099061467a565b6000825580601f10614119575050565b601f01602090049060005260206000209081019061187a91905b808211156141475760008155600101614133565b5090565b6001600160e01b03198116811461187a57600080fd5b60006020828403121561417357600080fd5b8135612b628161414b565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b03808411156141ae576141ae61417e565b604051601f8501601f19908116603f011681019082821181831017156141d6576141d661417e565b816040528093508581528686860111156141ef57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261421a57600080fd5b612b6283833560208501614194565b60006020828403121561423b57600080fd5b81356001600160401b0381111561425157600080fd5b61307584828501614209565b60006020828403121561426f57600080fd5b5035919050565b60005b83811015614291578181015183820152602001614279565b50506000910152565b600081518084526142b2816020860160208601614276565b601f01601f19169290920160200192915050565b6040815260006142d9604083018561429a565b905082151560208301529392505050565b602081526000612b62602083018461429a565b6001600160a01b0391909116815260200190565b6001600160a01b038116811461187a57600080fd5b6000806040838503121561433957600080fd5b823561434481614311565b946020939093013593505050565b60006020828403121561436457600080fd5b8135612b6281614311565b6000806040838503121561438257600080fd5b8235915060208301356001600160401b0381111561439f57600080fd5b6143ab85828601614209565b9150509250929050565b6000806000606084860312156143ca57600080fd5b83356143d581614311565b925060208401356143e581614311565b929592945050506040919091013590565b60006020828403121561440857600080fd5b813560ff81168114612b6257600080fd5b6000806040838503121561442c57600080fd5b82359150602083013561443e81614311565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b602081016006831061448157634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561449a57600080fd5b50508035926020909101359150565b600080602083850312156144bc57600080fd5b82356001600160401b03808211156144d357600080fd5b818501915085601f8301126144e757600080fd5b8135818111156144f657600080fd5b86602082850101111561450857600080fd5b60209290920196919550909350505050565b6006811061187a57600080fd5b6000806040838503121561453a57600080fd5b82359150602083013561443e8161451a565b60008060006060848603121561456157600080fd5b833561456c81614311565b95602085013595506040909401359392505050565b6000806040838503121561459457600080fd5b823561459f81614311565b91506020830135801515811461443e57600080fd5b600080600080608085870312156145ca57600080fd5b84356145d581614311565b935060208501356145e581614311565b92506040850135915060608501356001600160401b0381111561460757600080fd5b8501601f8101871361461857600080fd5b61462787823560208401614194565b91505092959194509250565b6000806040838503121561464657600080fd5b823561465181614311565b9150602083013561443e81614311565b60006020828403121561467357600080fd5b5051919050565b600181811c9082168061468e57607f821691505b6020821081036146ae57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610f1857600081815260208120601f850160051c810160208610156146db5750805b601f850160051c820191505b818110156146fa578281556001016146e7565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b038111156147305761473061417e565b6147448161473e845461467a565b846146b4565b602080601f83116001811461477357600084156147615750858301515b61476b8582614702565b8655506146fa565b600085815260208120601f198616915b828110156147a257888601518255948401946001909101908401614783565b50858210156147c05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156147e257600080fd5b8151612b6281614311565b6020808252601190820152702737ba1030b1b1b7bab73a1037bbb732b960791b604082015260600190565b6020808252600f908201526e2737ba1030b71037b832b930ba37b960891b604082015260600190565b6020808252604b908201527f4e6f7420616c6c6f7765642e205468652074617267657420616464726573732060408201527f68617320616e206163636f756e74206f72206f6e63652068616420616e6f746860608201526a32b91030b1b1b7bab73a1760a91b608082015260a00190565b6020808252601590820152742737ba1030b71037b832b930ba37b91030b236b4b760591b604082015260600190565b6020808252601590820152742737ba1030b71030b236b4b71037b832b930ba37b960591b604082015260600190565b67020b1b1b7bab73a160c51b815260008251614933816008850160208701614276565b9190910160080192915050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ddb57610ddb614940565b634e487b7160e01b600052603260045260246000fd5b6001600160401b038311156149965761499661417e565b6149aa836149a4835461467a565b836146b4565b6000601f8411600181146149d857600085156149c65750838201355b6149d08682614702565b845550614a32565b600083815260209020601f19861690835b82811015614a0957868501358255602094850194600190920191016149e9565b5086821015614a265760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600087516020614acb8285838d01614276565b885191840191614ade8184848d01614276565b8851920191614af08184848c01614276565b8751920191614b028184848b01614276565b8651920191614b148184848a01614276565b8551920191614b268184848901614276565b919091019998505050505050505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351614b69816017850160208801614276565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614b9a816028840160208801614276565b01602801949350505050565b600060018201614bb857614bb8614940565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082614be457614be4614bbf565b500490565b81810381811115610ddb57610ddb614940565b600082614c0b57614c0b614bbf565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060208284031215614cbf57600080fd5b8151612b628161451a565b60208082526023908201527f5472616e73666572206e6f7420616c6c6f77656420696e20746869732073746160408201526274757360e81b606082015260800190565b8082028115828204841417610ddb57610ddb614940565b600081614d3357614d33614940565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d6e9083018461429a565b9695505050505050565b600060208284031215614d8a57600080fd5b8151612b628161414b565b634e487b7160e01b600052603160045260246000fdfef2a163c55699a912c8908f55eafbd268811e90fb1b12c3601e6cc1cabd48a525ebb9a89f0ec4a68c7ff3381441395232db5fb2a2ec04968228ce2332afd4a5d968747470733a2f2f6e66742e75722e6170702f6d65746164617461253346746f6b656e69642533443f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9299f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a76ae24524824acbc21b351dd3e380dcc53874f0487c5ec4424767562c1192eeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef265b220c5a8891efdd9e1b1b7fa72f257bd5169f8d87e319cf3dad6ff52b94ae4fde3dfe3090fae85f62f8d63bf4c5b6a33f0bc579a46c4e5af6407837a11171139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46da2646970667358221220e16e797c839c3ad30e7701076602451a9408628e4e673a890cc150afd82b9ad664736f6c63430008140033
Deployed Bytecode
0x60806040526004361061036d5760003560e01c8063013e53d11461037257806301ffc9a7146103a7578063023b62a2146103d75780630264e7e9146103f957806306fdde0314610427578063081812fc14610449578063095ea7b314610476578063099d2ec8146104965780630aebeb4e146104ad5780630e8477f8146104cd57806310480e13146104ed5780631278e2d21461050057806313966db51461052757806318160ddd1461053e57806321d39e5a1461055357806323b872dd14610573578063243bcfcb14610593578063248a9ca3146105eb57806324a933eb1461060b5780632856784b146106205780632ac35485146106405780632af04790146106605780632f2ff15d1461068e5780632f745c59146106ae578063309756fb146106ce57806336568abe146106f0578063389ed267146107105780633ea3ab8e146107325780633f4ba83a1461075257806340c10f191461076757806342842e0e1461078757806342966c68146107a757806342d21ef7146107c75780634bedccf4146108055780634f558e79146108255780634f6ccce71461084557806353012e5c1461086557806355f804b31461088757806356ecb92b146108a7578063592b2051146108be5780635c975abb146108d95780636352211e146108f157806368800cd3146109115780636917574a1461093f5780636a46a1b714610956578063701eec931461097657806370a08231146109a757806370def791146109c75780637115fb42146109e75780637220b19914610a0757806380f669df14610a2257806383561e8414610a425780638456cb5914610a625780638ae80b5814610a7757806391d1485414610a9757806395d89b4114610ab75780639630571914610acc5780639ffa6e9714610afa578063a217fddf14610b28578063a22cb46514610b3d578063b3f0067414610b5d578063b88d4fde14610b7e578063b9464c9314610b9e578063c1cccc7014610bb3578063c36eeea814610bd3578063c4d66de814610bf3578063c7b4b68914610c13578063c81472b414610c33578063c87b56dd14610c53578063d539139314610c73578063d547741f14610c95578063d92af1b714610cb5578063dac500e314610cd5578063e985e9c514610cf7578063e9d2b1b314610d17578063eddd0d9c14610d39578063efdcd97414610d59578063f5b541a614610d79575b600080fd5b34801561037e57600080fd5b50610394600080516020614dcc83398151915281565b6040519081526020015b60405180910390f35b3480156103b357600080fd5b506103c76103c2366004614161565b610d9b565b604051901515815260200161039e565b3480156103e357600080fd5b506103f76103f2366004614229565b610de1565b005b34801561040557600080fd5b5061041961041436600461425d565b610f1d565b60405161039e9291906142c6565b34801561043357600080fd5b5061043c610fc5565b60405161039e91906142ea565b34801561045557600080fd5b5061046961046436600461425d565b611057565b60405161039e91906142fd565b34801561048257600080fd5b506103f7610491366004614326565b6110df565b3480156104a257600080fd5b50610394620186a081565b3480156104b957600080fd5b506103f76104c836600461425d565b6111ea565b3480156104d957600080fd5b506103f76104e8366004614352565b6112fb565b6103f76104fb366004614326565b61134a565b34801561050c57600080fd5b50610515600981565b60405160ff909116815260200161039e565b34801561053357600080fd5b5061039461016c5481565b34801561054a57600080fd5b50609954610394565b34801561055f57600080fd5b506103f761056e36600461436f565b611394565b34801561057f57600080fd5b506103f761058e3660046143b5565b611404565b34801561059f57600080fd5b506105d06105ae36600461425d565b6101656020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161039e565b3480156105f757600080fd5b5061039461060636600461425d565b611459565b34801561061757600080fd5b50610394603781565b34801561062c57600080fd5b506103f761063b3660046143f6565b61146f565b34801561064c57600080fd5b506103f761065b3660046143f6565b6114ba565b34801561066c57600080fd5b5061039461067b366004614352565b6101606020526000908152604090205481565b34801561069a57600080fd5b506103f76106a9366004614419565b61150b565b3480156106ba57600080fd5b506103946106c9366004614326565b611528565b3480156106da57600080fd5b50610394600080516020614e9583398151915281565b3480156106fc57600080fd5b506103f761070b366004614419565b6115be565b34801561071c57600080fd5b50610394600080516020614ed583398151915281565b34801561073e57600080fd5b506101665461051590610100900460ff1681565b34801561075e57600080fd5b506103f761163c565b34801561077357600080fd5b506103f7610782366004614326565b61169c565b34801561079357600080fd5b506103f76107a23660046143b5565b6117cd565b3480156107b357600080fd5b506103f76107c236600461425d565b611820565b3480156107d357600080fd5b506107f86107e236600461425d565b6101646020526000908152604090205460ff1681565b60405161039e919061445f565b34801561081157600080fd5b506103f7610820366004614487565b61187d565b34801561083157600080fd5b506103c761084036600461425d565b6119aa565b34801561085157600080fd5b5061039461086036600461425d565b6119b5565b34801561087157600080fd5b50610394600080516020614eb583398151915281565b34801561089357600080fd5b506103f76108a23660046144a9565b611a48565b3480156108b357600080fd5b5061039462278d0081565b3480156108ca57600080fd5b506103f76104fb36600461425d565b3480156108e557600080fd5b5060c95460ff166103c7565b3480156108fd57600080fd5b5061046961090c36600461425d565b611a8a565b34801561091d57600080fd5b5061039461092c36600461425d565b6101676020526000908152604090205481565b34801561094b57600080fd5b5061039461015f5481565b34801561096257600080fd5b506103f761097136600461425d565b611b01565b34801561098257600080fd5b506103c761099136600461425d565b6101626020526000908152604090205460ff1681565b3480156109b357600080fd5b506103946109c2366004614352565b611b5e565b3480156109d357600080fd5b506103f76109e2366004614527565b611be5565b3480156109f357600080fd5b506103f7610a02366004614487565b611d9b565b348015610a1357600080fd5b50610166546105159060ff1681565b348015610a2e57600080fd5b5061043c610a3d36600461425d565b611de2565b348015610a4e57600080fd5b506103f7610a5d36600461425d565b611e7d565b348015610a6e57600080fd5b506103f7611ee8565b348015610a8357600080fd5b506103f7610a9236600461454c565b611f43565b348015610aa357600080fd5b506103c7610ab2366004614419565b612294565b348015610ac357600080fd5b5061043c6122c0565b348015610ad857600080fd5b50610394610ae736600461425d565b61016a6020526000908152604090205481565b348015610b0657600080fd5b50610394610b1536600461425d565b6101636020526000908152604090205481565b348015610b3457600080fd5b50610394600081565b348015610b4957600080fd5b506103f7610b58366004614581565b6122cf565b348015610b6957600080fd5b5061016d54610469906001600160a01b031681565b348015610b8a57600080fd5b506103f7610b993660046145b4565b6122da565b348015610baa57600080fd5b50610515600881565b348015610bbf57600080fd5b5061043c610bce36600461425d565b61230c565b348015610bdf57600080fd5b506103c7610bee366004614487565b612326565b348015610bff57600080fd5b506103f7610c0e366004614352565b612427565b348015610c1f57600080fd5b506103f7610c2e36600461425d565b6125b1565b348015610c3f57600080fd5b506103f7610c4e366004614487565b6125eb565b348015610c5f57600080fd5b5061043c610c6e36600461425d565b61272a565b348015610c7f57600080fd5b50610394600080516020614e3583398151915281565b348015610ca157600080fd5b506103f7610cb0366004614419565b612897565b348015610cc157600080fd5b506103f7610cd036600461436f565b6128b4565b348015610ce157600080fd5b50610394600080516020614e5583398151915281565b348015610d0357600080fd5b506103c7610d12366004614633565b61295d565b348015610d2357600080fd5b50610394600080516020614dac83398151915281565b348015610d4557600080fd5b506103f7610d5436600461425d565b61298b565b348015610d6557600080fd5b506103f7610d74366004614352565b6129c5565b348015610d8557600080fd5b50610394600080516020614e1583398151915281565b60006001600160e01b031982166380ac58cd60e01b1480610dcc57506001600160e01b03198216635b5e139f60e01b145b80610ddb5750610ddb82612a61565b92915050565b6040516370a0823160e01b815260009030906370a0823190610e079033906004016142fd565b602060405180830381865afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e489190614661565b11610e935760405162461bcd60e51b81526020600482015260166024820152751059191c995cdcc81a185cc81b9bc81858d8dbdd5b9d60521b60448201526064015b60405180910390fd5b604051632f745c5960e01b8152336004820152600060248201819052903090632f745c5990604401602060405180830381865afa158015610ed8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efc9190614661565b600081815261016960205260409020909150610f188382614717565b505050565b61016860205260009081526040902080548190610f399061467a565b80601f0160208091040260200160405190810160405280929190818152602001828054610f659061467a565b8015610fb25780601f10610f8757610100808354040283529160200191610fb2565b820191906000526020600020905b815481529060010190602001808311610f9557829003601f168201915b5050506001909301549192505060ff1682565b606060658054610fd49061467a565b80601f01602080910402602001604051908101604052809291908181526020018280546110009061467a565b801561104d5780601f106110225761010080835404028352916020019161104d565b820191906000526020600020905b81548152906001019060200180831161103057829003601f168201915b5050505050905090565b600061106282612a86565b6110c35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e8a565b506000908152606960205260409020546001600160a01b031690565b60006110ea82611a8a565b9050806001600160a01b0316836001600160a01b0316036111575760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e8a565b336001600160a01b03821614806111735750611173813361295d565b6111e05760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610e8a565b610f188383612aa3565b6040516331a9108f60e11b8152600481018290523090636352211e90602401602060405180830381865afa158015611226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124a91906147d0565b6001600160a01b0316336001600160a01b03161461127a5760405162461bcd60e51b8152600401610e8a906147ed565b60056000828152610164602052604090205460ff1660058111156112a0576112a0614449565b146112df5760405162461bcd60e51b815260206004820152600f60248201526e139bdd081b1a5d994818db1a595b9d608a1b6044820152606401610e8a565b600090815261016460205260409020805460ff19166004179055565b611313600080516020614e1583398151915233612294565b61132f5760405162461bcd60e51b8152600401610e8a90614818565b6001600160a01b031660009081526101606020526040812055565b60405162461bcd60e51b8152602060048201526019602482015278151a1a5cc8199d5b98dd1a5bdb881a5cc8191a5cd8589b1959603a1b6044820152606401610e8a565b50505050565b6113ac600080516020614e5583398151915233612294565b6113c85760405162461bcd60e51b8152600401610e8a906148b2565b6000828152610168602052604090206113e18282614717565b50506000908152610168602052604090206001908101805460ff19169091179055565b61140f838383612d49565b60026000828152610164602052604090205460ff16600581111561143557611435614449565b14610f18576001600160a01b03919091166000908152610160602052604090205550565b600090815261012d602052604090206001015490565b611487600080516020614e5583398151915233612294565b6114a35760405162461bcd60e51b8152600401610e8a906148e1565b610166805460ff191660ff92909216919091179055565b6114d2600080516020614e5583398151915233612294565b6114ee5760405162461bcd60e51b8152600401610e8a906148e1565b610166805460ff9092166101000261ff0019909216919091179055565b61151482611459565b61151e8133612d7a565b610f188383612dde565b600061153383611b5e565b82106115955760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e8a565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b6001600160a01b038116331461162e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e8a565b6116388282612e65565b5050565b611654600080516020614e9583398151915233612294565b6116925760405162461bcd60e51b815260206004820152600f60248201526e2737ba1030b7103ab73830bab9b2b960891b6044820152606401610e8a565b61169a612ecd565b565b6116b4600080516020614e1583398151915233612294565b806116d257506116d2600080516020614e3583398151915233612294565b6117175760405162461bcd60e51b81526020600482015260166024820152752737ba1030b71037b832b930ba37b917b6b4b73a32b960511b6044820152606401610e8a565b6117218282612b69565b6117605760405162461bcd60e51b815260206004820152601060248201526f1b5a5b9d081b9bdd08185b1b1bddd95960821b6044820152606401610e8a565b61176a8282612c1d565b600081815261016460205260409020805460ff1916600217905561178d81612f5a565b61179681612f75565b6040516020016117a69190614910565b60408051601f1981840301815291815260008381526101616020522090610f189082614717565b60026000828152610164602052604090205460ff1660058111156117f3576117f3614449565b14611815576001600160a01b0382166000908152610160602052604090208190555b610f1883838361307d565b611838600080516020614e1583398151915233612294565b6118545760405162461bcd60e51b8152600401610e8a90614818565b600081815261016560205260408120818155600181018290556002015561187a81613098565b50565b611895600080516020614dcc83398151915233612294565b6118d75760405162461bcd60e51b81526020600482015260136024820152722737ba1030903634b6b4ba16bab83230ba32b960691b6044820152606401610e8a565b61238c82101580156118eb57506124538211155b156118f4575050565b60056000838152610164602052604090205460ff16600581111561191a5761191a614449565b1480611949575060026000838152610164602052604090205460ff16600581111561194757611947614449565b145b156116385760008281526101656020526040812060028101549091906119739062278d0090614956565b90504281101561198b5742600283015582825561138e565b8282600001600082825461199f9190614956565b909155505050505050565b6000610ddb82612a86565b60006119c060995490565b8210611a235760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e8a565b60998281548110611a3657611a36614969565b90600052602060002001549050919050565b611a60600080516020614e5583398151915233612294565b611a7c5760405162461bcd60e51b8152600401610e8a906148e1565b61016b610f1882848361497f565b6000818152606760205260408120546001600160a01b031680610ddb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610e8a565b611b19600080516020614e5583398151915233612294565b611b355760405162461bcd60e51b8152600401610e8a906148b2565b60008181526101686020526040812090611b4f82826140fd565b50600101805460ff1916905550565b60006001600160a01b038216611bc95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610e8a565b506001600160a01b031660009081526068602052604090205490565b611bfd600080516020614e1583398151915233612294565b80611c1b5750611c1b600080516020614dac83398151915233612294565b611c725760405162461bcd60e51b815260206004820152602260248201527f4e6f7420616e206f70657261746f722f636c69656e747374617475736368616e604482015261676560f01b6064820152608401610e8a565b6005816005811115611c8657611c86614449565b148015611cb6575060026000838152610164602052604090205460ff166005811115611cb457611cb4614449565b145b15611d66576040516331a9108f60e11b8152600481018390528290610160906000903090636352211e90602401602060405180830381865afa158015611d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2491906147d0565b6001600160a01b03168152602081019190915260400160002055611d6682600090815261016560205260408120908155620186a0600182015542600290910155565b600082815261016460205260409020805482919060ff19166001836005811115611d9257611d92614449565b02179055505050565b611db3600080516020614e5583398151915233612294565b611dcf5760405162461bcd60e51b8152600401610e8a906148e1565b6000918252610163602052604090912055565b6101696020526000908152604090208054611dfc9061467a565b80601f0160208091040260200160405190810160405280929190818152602001828054611e289061467a565b8015611e755780601f10611e4a57610100808354040283529160200191611e75565b820191906000526020600020905b815481529060010190602001808311611e5857829003601f168201915b505050505081565b611e95600080516020614e1583398151915233612294565b611eb15760405162461bcd60e51b8152600401610e8a90614818565b611eba81612a86565b611ed65760405162461bcd60e51b8152600401610e8a90614a39565b60009081526101656020526040812055565b611f00600080516020614ed583398151915233612294565b611f3b5760405162461bcd60e51b815260206004820152600c60248201526b2737ba1030903830bab9b2b960a11b6044820152606401610e8a565b61169a61312d565b611f5b600080516020614eb583398151915233612294565b611f9d5760405162461bcd60e51b81526020600482015260136024820152722737ba10309031b0b9b41037b832b930ba37b960691b6044820152606401610e8a565b611fa8816008612b11565b8015611fc55750627a12008110158015611fc557506289543f8111155b6120105760405162461bcd60e51b815260206004820152601c60248201527b125b98dbdc9c9958dd081dd85b1b195d081c1c9bdd9a59195c881a5960221b6044820152606401610e8a565b6000818152610168602052604090206001015460ff166120705760405162461bcd60e51b815260206004820152601b60248201527a2737ba1030903b30b634b2103bb0b63632ba10383937bb34b232b960291b6044820152606401610e8a565b6101665460ff1661208083612b38565b10156120d95760405162461bcd60e51b815260206004820152602260248201527f546f6b656e20646967697473203c206d696e2064696769747320666f722073616044820152616c6560f01b6064820152608401610e8a565b61016654610100900460ff166120ee83612b38565b11156121475760405162461bcd60e51b815260206004820152602260248201527f546f6b656e20646967697473203e206d61782064696769747320666f722073616044820152616c6560f01b6064820152608401610e8a565b612152826009612b11565b156121965760405162461bcd60e51b81526020600482015260146024820152730e5e1e0818d85b9b9bdd081899481b5a5b9d195960621b6044820152606401610e8a565b6121a1826008612b11565b156121f85760405162461bcd60e51b815260206004820152602160248201527f4d65726368616e74206163636f756e742063616e6e6f74206265206d696e74656044820152601960fa1b6064820152608401610e8a565b6122028383612b69565b6122595760405162461bcd60e51b815260206004820152602260248201527f5461726765742061646472657373206e6f7420616c6c6f77656420746f206d696044820152611b9d60f21b6064820152608401610e8a565b6000828152610167602090815260408083208490556101649091529020805460ff1916600217905561228a82612f5a565b610f188383612c1d565b600091825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060668054610fd49061467a565b6116383383836131a8565b6122e43383613272565b6123005760405162461bcd60e51b8152600401610e8a90614a67565b61138e84848484613334565b6101616020526000908152604090208054611dfc9061467a565b600061233183612a86565b1561241f5761238c831015801561234a57506124538311155b1561235757506001610ddb565b600083815261016560205260408120600281015490919061237c9062278d0090614956565b905060026000868152610164602052604090205460ff1660058111156123a4576123a4614449565b036123e95742811080156123bb575061015f548411155b806123e057504281101580156123e0575061015f5482546123dd908690614956565b11155b92505050610ddb565b42811080156123fc575081600101548411155b806123e057504281101580156123e05750600182015482546123dd908690614956565b506000610ddb565b600054610100900460ff166124425760005460ff1615612446565b303b155b6124a95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e8a565b600054610100900460ff161580156124cb576000805461ffff19166101011790555b6124d3613367565b6125196040518060400160405280600a8152602001691554881058d8dbdd5b9d60b21b815250604051806040016040528060028152602001612aa960f11b81525061338e565b612521613367565b604051806060016040528060298152602001614dec6029913961016b906125489082614717565b50610166805461ffff1916610b0a179055620186a061015f5561256c6000836133ce565b612584600080516020614e55833981519152836133ce565b61259c600080516020614e15833981519152836133ce565b8015611638576000805461ff00191690555050565b6125c9600080516020614e5583398151915233612294565b6125e55760405162461bcd60e51b8152600401610e8a906148e1565b61015f55565b612603600080516020614dac83398151915233612294565b806126215750612621600080516020614e1583398151915233612294565b61263d5760405162461bcd60e51b8152600401610e8a90614818565b61264682612a86565b6126625760405162461bcd60e51b8152600401610e8a90614a39565b60026000838152610164602052604090205460ff16600581111561268857612688614449565b141580156126b857506000828152610164602052604081205460ff1660058111156126b5576126b5614449565b14155b6127145760405162461bcd60e51b815260206004820152602760248201527f4e6f7420696e20636f72726563742073746174757320666f72206c696d69742060448201526618dbdb9d1c9bdb60ca1b6064820152608401610e8a565b6000918252610165602052604090912060010155565b606061273582612a86565b6127995760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610e8a565b60006127a36133d8565b905060006127cc604080518082019091526008815267267374617475733d60c01b602082015290565b905060006127f56040805180820190915260088152672677616c6c65743d60c01b602082015290565b90506000835111612815576040518060200160405280600081525061288e565b8261281f86612f75565b60008781526101646020526040902054849061284e9060ff16600581111561284957612849614449565b612f75565b60008981526101676020526040902054859061286990612f75565b60405160200161287e96959493929190614ab8565b6040516020818303038152906040525b95945050505050565b6128a082611459565b6128aa8133612d7a565b610f188383612e65565b6040516331a9108f60e11b8152600481018390523090636352211e90602401602060405180830381865afa1580156128f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061291491906147d0565b6001600160a01b0316336001600160a01b0316146129445760405162461bcd60e51b8152600401610e8a906147ed565b600082815261016160205260409020610f188282614717565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6129a3600080516020614e5583398151915233612294565b6129bf5760405162461bcd60e51b8152600401610e8a906148e1565b61016c55565b6129dd600080516020614e5583398151915233612294565b6129f95760405162461bcd60e51b8152600401610e8a906148e1565b6001600160a01b038116612a3e5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610e8a565b61016d80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b03198216637965db0b60e01b1480610ddb5750610ddb826133e8565b6000908152606760205260409020546001600160a01b0316151590565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ad882611a8a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000825b600a8110612b2f57612b2881600a61340d565b9050612b15565b90911492915050565b600081815b8115612b6257612b4e82600a61340d565b9150612b5b816001613419565b9050612b3d565b9392505050565b6040516370a0823160e01b815260009060019030906370a0823190612b929087906004016142fd565b602060405180830381865afa158015612baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd39190614661565b108015612b6257506001600160a01b038316600090815261016060205260409020541580612b625750506001600160a01b0391909116600090815261016060205260409020541490565b6001600160a01b038216612c735760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e8a565b612c7c81612a86565b15612cc85760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610e8a565b612cd460008383613425565b6001600160a01b0382166000908152606860205260408120805460019290612cfd908490614956565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051839290600080516020614e75833981519152908290a45050565b612d533382613272565b612d6f5760405162461bcd60e51b8152600401610e8a90614a67565b610f188383836139be565b612d848282612294565b61163857612d9c816001600160a01b03166014613b57565b612da7836020613b57565b604051602001612db8929190614b37565b60408051601f198184030181529082905262461bcd60e51b8252610e8a916004016142ea565b612de88282612294565b61163857600082815261012d602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612e213390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612e6f8282612294565b1561163857600082815261012d602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60c95460ff16612f165760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610e8a565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051612f5091906142fd565b60405180910390a1565b60009081526101656020526040812090815542600290910155565b606081600003612f9c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612fc65780612fb081614ba6565b9150612fbf9050600a83614bd5565b9150612fa0565b6000816001600160401b03811115612fe057612fe061417e565b6040519080825280601f01601f19166020018201604052801561300a576020820181803683370190505b5090505b84156130755761301f600183614be9565b915061302c600a86614bfc565b613037906030614956565b60f81b81838151811061304c5761304c614969565b60200101906001600160f81b031916908160001a90535061306e600a86614bd5565b945061300e565b949350505050565b610f18838383604051806020016040528060008152506122da565b60006130a382611a8a565b90506130b181600084613425565b6130bc600083612aa3565b6001600160a01b03811660009081526068602052604081208054600192906130e5908490614be9565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b03841690600080516020614e75833981519152908390a45050565b60c95460ff16156131735760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610e8a565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f433390565b816001600160a01b0316836001600160a01b0316036132055760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610e8a565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600061327d82612a86565b6132de5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e8a565b60006132e983611a8a565b9050806001600160a01b0316846001600160a01b031614806133245750836001600160a01b031661331984611057565b6001600160a01b0316145b806130755750613075818561295d565b61333f8484846139be565b61334b84848484613cf2565b61138e5760405162461bcd60e51b8152600401610e8a90614c10565b600054610100900460ff1661169a5760405162461bcd60e51b8152600401610e8a90614c62565b600054610100900460ff166133b55760405162461bcd60e51b8152600401610e8a90614c62565b60656133c18382614717565b506066610f188282614717565b6116388282612dde565b606061016b8054610fd49061467a565b60006001600160e01b0319821663780e9d6360e01b1480610ddb5750610ddb82613df3565b6000612b628284614bd5565b6000612b628284614956565b60c95460ff16156134765760405162461bcd60e51b815260206004820152601b60248201527a1058d8dbdd5b9d081d1c985b9cd9995c9cc81cdd5cdc195b991959602a1b6044820152606401610e8a565b813b1515801561348e57506001600160a01b03831615155b156135585760026040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156134d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134f59190614cad565b600581111561350657613506614449565b146135535760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420616c6c6f77656420746f207472616e73666572206163636f756e74006044820152606401610e8a565b6139b3565b6001600160a01b0383161580159061357857506001600160a01b03821615155b156139b357613588612392612a86565b1561383b57600161359883611b5e565b1080156135de57506001600160a01b0382166000908152610160602052604090205415806135de57506001600160a01b0382166000908152610160602052604090205481145b8061366f57506135ef826000611528565b61239214801561366f575060046040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa158015613638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365c9190614cad565b600581111561366d5761366d614449565b145b61368b5760405162461bcd60e51b8152600401610e8a90614841565b60056040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156136c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ed9190614cad565b60058111156136fe576136fe614449565b148061377a575060026040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa158015613743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137679190614cad565b600581111561377857613778614449565b145b8061381f5750600061378b83611b5e565b1180156137a3575061379e826000611528565b612392145b801561381f575060046040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156137e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061380c9190614cad565b600581111561381d5761381d614449565b145b6135535760405162461bcd60e51b8152600401610e8a90614cca565b600161384683611b5e565b10801561388c57506001600160a01b03821660009081526101606020526040902054158061388c57506001600160a01b0382166000908152610160602052604090205481145b6138a85760405162461bcd60e51b8152600401610e8a90614841565b60056040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa1580156138e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061390a9190614cad565b600581111561391b5761391b614449565b1480613997575060026040516342d21ef760e01b81526004810183905230906342d21ef790602401602060405180830381865afa158015613960573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139849190614cad565b600581111561399557613995614449565b145b6139b35760405162461bcd60e51b8152600401610e8a90614cca565b610f18838383613e43565b826001600160a01b03166139d182611a8a565b6001600160a01b031614613a395760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610e8a565b6001600160a01b038216613a9b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e8a565b613aa6838383613425565b613ab1600082612aa3565b6001600160a01b0383166000908152606860205260408120805460019290613ada908490614be9565b90915550506001600160a01b0382166000908152606860205260408120805460019290613b08908490614956565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b038681169182179092559151849391871691600080516020614e7583398151915291a4505050565b60606000613b66836002614d0d565b613b71906002614956565b6001600160401b03811115613b8857613b8861417e565b6040519080825280601f01601f191660200182016040528015613bb2576020820181803683370190505b509050600360fc1b81600081518110613bcd57613bcd614969565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bfc57613bfc614969565b60200101906001600160f81b031916908160001a9053506000613c20846002614d0d565b613c2b906001614956565b90505b6001811115613ca3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c5f57613c5f614969565b1a60f81b828281518110613c7557613c75614969565b60200101906001600160f81b031916908160001a90535060049490941c93613c9c81614d24565b9050613c2e565b508315612b625760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e8a565b60006001600160a01b0384163b15613de857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613d36903390899088908890600401614d3b565b6020604051808303816000875af1925050508015613d71575060408051601f3d908101601f19168201909252613d6e91810190614d78565b60015b613dce573d808015613d9f576040519150601f19603f3d011682016040523d82523d6000602084013e613da4565b606091505b508051600003613dc65760405162461bcd60e51b8152600401610e8a90614c10565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613075565b506001949350505050565b60006001600160e01b031982166380ac58cd60e01b1480613e2457506001600160e01b03198216635b5e139f60e01b145b80610ddb57506301ffc9a760e01b6001600160e01b0319831614610ddb565b613e4e838383613eb5565b60c95460ff1615610f185760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610e8a565b6001600160a01b038316613f1057613f0b81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b613f33565b816001600160a01b0316836001600160a01b031614613f3357613f338382613f6d565b6001600160a01b038216613f4a57610f188161400a565b826001600160a01b0316826001600160a01b031614610f1857610f1882826140b9565b60006001613f7a84611b5e565b613f849190614be9565b600083815260986020526040902054909150808214613fd7576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b60995460009061401c90600190614be9565b6000838152609a60205260408120546099805493945090928490811061404457614044614969565b90600052602060002001549050806099838154811061406557614065614969565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061409d5761409d614d95565b6001900381819060005260206000200160009055905550505050565b60006140c483611b5e565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b5080546141099061467a565b6000825580601f10614119575050565b601f01602090049060005260206000209081019061187a91905b808211156141475760008155600101614133565b5090565b6001600160e01b03198116811461187a57600080fd5b60006020828403121561417357600080fd5b8135612b628161414b565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b03808411156141ae576141ae61417e565b604051601f8501601f19908116603f011681019082821181831017156141d6576141d661417e565b816040528093508581528686860111156141ef57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261421a57600080fd5b612b6283833560208501614194565b60006020828403121561423b57600080fd5b81356001600160401b0381111561425157600080fd5b61307584828501614209565b60006020828403121561426f57600080fd5b5035919050565b60005b83811015614291578181015183820152602001614279565b50506000910152565b600081518084526142b2816020860160208601614276565b601f01601f19169290920160200192915050565b6040815260006142d9604083018561429a565b905082151560208301529392505050565b602081526000612b62602083018461429a565b6001600160a01b0391909116815260200190565b6001600160a01b038116811461187a57600080fd5b6000806040838503121561433957600080fd5b823561434481614311565b946020939093013593505050565b60006020828403121561436457600080fd5b8135612b6281614311565b6000806040838503121561438257600080fd5b8235915060208301356001600160401b0381111561439f57600080fd5b6143ab85828601614209565b9150509250929050565b6000806000606084860312156143ca57600080fd5b83356143d581614311565b925060208401356143e581614311565b929592945050506040919091013590565b60006020828403121561440857600080fd5b813560ff81168114612b6257600080fd5b6000806040838503121561442c57600080fd5b82359150602083013561443e81614311565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b602081016006831061448157634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561449a57600080fd5b50508035926020909101359150565b600080602083850312156144bc57600080fd5b82356001600160401b03808211156144d357600080fd5b818501915085601f8301126144e757600080fd5b8135818111156144f657600080fd5b86602082850101111561450857600080fd5b60209290920196919550909350505050565b6006811061187a57600080fd5b6000806040838503121561453a57600080fd5b82359150602083013561443e8161451a565b60008060006060848603121561456157600080fd5b833561456c81614311565b95602085013595506040909401359392505050565b6000806040838503121561459457600080fd5b823561459f81614311565b91506020830135801515811461443e57600080fd5b600080600080608085870312156145ca57600080fd5b84356145d581614311565b935060208501356145e581614311565b92506040850135915060608501356001600160401b0381111561460757600080fd5b8501601f8101871361461857600080fd5b61462787823560208401614194565b91505092959194509250565b6000806040838503121561464657600080fd5b823561465181614311565b9150602083013561443e81614311565b60006020828403121561467357600080fd5b5051919050565b600181811c9082168061468e57607f821691505b6020821081036146ae57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610f1857600081815260208120601f850160051c810160208610156146db5750805b601f850160051c820191505b818110156146fa578281556001016146e7565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b038111156147305761473061417e565b6147448161473e845461467a565b846146b4565b602080601f83116001811461477357600084156147615750858301515b61476b8582614702565b8655506146fa565b600085815260208120601f198616915b828110156147a257888601518255948401946001909101908401614783565b50858210156147c05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156147e257600080fd5b8151612b6281614311565b6020808252601190820152702737ba1030b1b1b7bab73a1037bbb732b960791b604082015260600190565b6020808252600f908201526e2737ba1030b71037b832b930ba37b960891b604082015260600190565b6020808252604b908201527f4e6f7420616c6c6f7765642e205468652074617267657420616464726573732060408201527f68617320616e206163636f756e74206f72206f6e63652068616420616e6f746860608201526a32b91030b1b1b7bab73a1760a91b608082015260a00190565b6020808252601590820152742737ba1030b71037b832b930ba37b91030b236b4b760591b604082015260600190565b6020808252601590820152742737ba1030b71030b236b4b71037b832b930ba37b960591b604082015260600190565b67020b1b1b7bab73a160c51b815260008251614933816008850160208701614276565b9190910160080192915050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ddb57610ddb614940565b634e487b7160e01b600052603260045260246000fd5b6001600160401b038311156149965761499661417e565b6149aa836149a4835461467a565b836146b4565b6000601f8411600181146149d857600085156149c65750838201355b6149d08682614702565b845550614a32565b600083815260209020601f19861690835b82811015614a0957868501358255602094850194600190920191016149e9565b5086821015614a265760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600087516020614acb8285838d01614276565b885191840191614ade8184848d01614276565b8851920191614af08184848c01614276565b8751920191614b028184848b01614276565b8651920191614b148184848a01614276565b8551920191614b268184848901614276565b919091019998505050505050505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351614b69816017850160208801614276565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614b9a816028840160208801614276565b01602801949350505050565b600060018201614bb857614bb8614940565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082614be457614be4614bbf565b500490565b81810381811115610ddb57610ddb614940565b600082614c0b57614c0b614bbf565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060208284031215614cbf57600080fd5b8151612b628161451a565b60208082526023908201527f5472616e73666572206e6f7420616c6c6f77656420696e20746869732073746160408201526274757360e81b606082015260800190565b8082028115828204841417610ddb57610ddb614940565b600081614d3357614d33614940565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d6e9083018461429a565b9695505050505050565b600060208284031215614d8a57600080fd5b8151612b628161414b565b634e487b7160e01b600052603160045260246000fdfef2a163c55699a912c8908f55eafbd268811e90fb1b12c3601e6cc1cabd48a525ebb9a89f0ec4a68c7ff3381441395232db5fb2a2ec04968228ce2332afd4a5d968747470733a2f2f6e66742e75722e6170702f6d65746164617461253346746f6b656e69642533443f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9299f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a76ae24524824acbc21b351dd3e380dcc53874f0487c5ec4424767562c1192eeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef265b220c5a8891efdd9e1b1b7fa72f257bd5169f8d87e319cf3dad6ff52b94ae4fde3dfe3090fae85f62f8d63bf4c5b6a33f0bc579a46c4e5af6407837a11171139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46da2646970667358221220e16e797c839c3ad30e7701076602451a9408628e4e673a890cc150afd82b9ad664736f6c63430008140033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.