Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 23 from a total of 23 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 23764173 | 125 days ago | IN | 0 ETH | 0.00000695 | ||||
| Burn For ERC20 | 13613684 | 1582 days ago | IN | 0 ETH | 0.00861487 | ||||
| Safe Transfer Fr... | 12138398 | 1811 days ago | IN | 0 ETH | 0.01425066 | ||||
| Safe Transfer Fr... | 12137547 | 1811 days ago | IN | 0 ETH | 0.00967602 | ||||
| Safe Transfer Fr... | 12137533 | 1811 days ago | IN | 0 ETH | 0.01176573 | ||||
| Rename With ERC2... | 12137293 | 1811 days ago | IN | 0 ETH | 0.01313561 | ||||
| Rename With ERC2... | 12137206 | 1811 days ago | IN | 0 ETH | 0.0130876 | ||||
| Mint From ERC20 | 12132353 | 1812 days ago | IN | 0 ETH | 0.01580075 | ||||
| Rename With ERC2... | 12132286 | 1812 days ago | IN | 0 ETH | 0.0092474 | ||||
| Mint From ERC20 | 12132269 | 1812 days ago | IN | 0 ETH | 0.01885584 | ||||
| Mint From ERC20 | 12130830 | 1812 days ago | IN | 0 ETH | 0.01755639 | ||||
| Mint From ERC20 | 12130830 | 1812 days ago | IN | 0 ETH | 0.01755639 | ||||
| Mint From ERC20 | 12130830 | 1812 days ago | IN | 0 ETH | 0.01890639 | ||||
| Mint From ERC20 | 12128785 | 1813 days ago | IN | 0 ETH | 0.03237341 | ||||
| Mint From Eth | 12127572 | 1813 days ago | IN | 1.1 ETH | 0.0144627 | ||||
| Mint From ERC20 | 12127236 | 1813 days ago | IN | 0 ETH | 0.01743309 | ||||
| Rename With ERC2... | 12126205 | 1813 days ago | IN | 0 ETH | 0.00847272 | ||||
| Mint From ERC20 | 12126179 | 1813 days ago | IN | 0 ETH | 0.0204578 | ||||
| Upsert New Erc20... | 12125954 | 1813 days ago | IN | 0 ETH | 0.02637032 | ||||
| Upsert New Erc20... | 12125939 | 1813 days ago | IN | 0 ETH | 0.02693691 | ||||
| Upsert New Erc20... | 12125923 | 1813 days ago | IN | 0 ETH | 0.026837 | ||||
| Upsert New Erc20... | 12125908 | 1813 days ago | IN | 0 ETH | 0.0217614 | ||||
| Upsert New Erc20... | 12125889 | 1813 days ago | IN | 0 ETH | 0.02278279 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 12127572 | 1813 days ago | 0.1 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
CryptoJerseys
Compiler Version
v0.6.7+commit.b8d736ae
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity >=0.6.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "./CustomMintRenameWithERC20.sol";
import "./CustomMintRenameWithEth.sol";
pragma experimental ABIEncoderV2;
contract CryptoJerseys is CustomMintRenameWithEth, CustomMintRenameWithERC20 {
constructor(string memory baseURI) public ERC721("CryptoJerseys", "CJA") {
// MINT the 0th eth J to the owner
_safeMint(owner(), uint256(0));
_rename(uint256(0), "Vitalik");
_setBaseURI(baseURI);
}
}pragma solidity >=0.6.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./CustomMintRename.sol";
import "./CostUtils.sol";
import "./TokenMetadata.sol";
pragma experimental ABIEncoderV2;
abstract contract CustomMintRenameWithERC20 is CustomMintRename {
using CostUtils for uint256;
struct SupportedTokenData {
address erc20ContractAddress;
uint32 decimals;
uint256 renameFee;
}
SupportedTokenData[] private supportedErc20Contracts;
function upsertNewErc20Token(
address erc20ContractAddress,
uint32 decimals,
uint256 renameFee,
string memory nameOf0thJ
) public {
require(owner() == _msgSender(), "Must be owner");
for (uint256 i = 0; i < supportedErc20Contracts.length; i++) {
if (
supportedErc20Contracts[i].erc20ContractAddress ==
erc20ContractAddress
) {
supportedErc20Contracts[i].decimals = decimals;
supportedErc20Contracts[i].renameFee = renameFee;
return;
}
}
SupportedTokenData memory std =
SupportedTokenData({
erc20ContractAddress: erc20ContractAddress,
decimals: decimals,
renameFee: renameFee
});
supportedErc20Contracts.push(std);
// MINT the 0th J to the owner when we push a new supported contract
uint256 tokenID = _getTokenId(erc20ContractAddress, 0);
_safeMint(owner(), tokenID);
_rename(tokenID, nameOf0thJ);
}
function mintFromERC20(address erc20ContractAddress, uint32 jNumber)
public
{
address minter = _msgSender();
// check erc20 address is in allow list
uint256 tokenID = _getTokenId(erc20ContractAddress, jNumber);
address thisContractAddress = address(this);
require(jNumber < 100 && jNumber > 0, "Invalid jnumber");
require(!_exists(tokenID), "Already minted");
uint256 decimals = _getDecimalsForContractAddress(erc20ContractAddress);
// Get Total Cost
uint256 cost = CostUtils.getMintCost(jNumber, decimals);
// Transfer total cost from minter to our contract
_safeTransferFrom(
erc20ContractAddress,
minter,
thisContractAddress,
cost
);
// Sweep fee from contract to owner
uint256 fee = CostUtils.getMintFee(jNumber, decimals);
_safeTransfer(erc20ContractAddress, owner(), fee);
_safeMint(minter, tokenID);
}
function renameWithERC20(
address erc20ContractAddress,
uint32 jNumber,
string memory newName
) public {
uint256 tokenID = _getTokenId(erc20ContractAddress, jNumber);
address ownerOfNft = ownerOf(tokenID);
require(_exists(tokenID), "Not minted");
require(ownerOfNft == _msgSender(), "Must be owner");
require(
validateName(newName),
"Invalid name. Must be 1-10 ASCII chars."
);
require(nameAvailable(newName), "Name already taken sorry");
_allocateAndSweepRenameFee(tokenID, erc20ContractAddress, ownerOfNft);
_rename(tokenID, newName);
}
function getTokensForERC20(address erc20ContractAddress)
external
view
returns (TokenMetadata[100] memory)
{
TokenMetadata[100] memory tokens;
for (uint32 jNumber = 0; jNumber < 100; jNumber++) {
uint256 tokenId = _getTokenId(erc20ContractAddress, jNumber);
if (_exists(tokenId)) {
TokenMetadata memory tmd =
TokenMetadata({
exists: true,
tokenId: tokenId,
jNumber: jNumber,
erc20ContractAddress: erc20ContractAddress,
claimableRenameFees: getRenameFeesAvailableToClaimERC20(
erc20ContractAddress,
jNumber
),
hasFreeRename: freeRenameAvailable(tokenId),
name: nameOf(tokenId),
ownerAddress: ownerOf(tokenId)
});
tokens[jNumber] = tmd;
} else {
TokenMetadata memory tmd =
TokenMetadata({
exists: false,
tokenId: tokenId,
jNumber: jNumber,
erc20ContractAddress: erc20ContractAddress,
claimableRenameFees: getRenameFeesAvailableToClaimERC20(
erc20ContractAddress,
jNumber
),
hasFreeRename: freeRenameAvailable(tokenId),
name: "",
ownerAddress: address(0)
});
tokens[jNumber] = tmd;
}
}
return tokens;
}
function _allocateAndSweepRenameFee(
uint256 tokenID,
address erc20ContractAddress,
address ownerOfNft
) private {
if (freeRenameAvailable(tokenID)) {
return;
}
// Transfer total cost from minter to our contract
uint256 costOfRename =
_getRenameFeeForContractAddress(erc20ContractAddress);
_safeTransferFrom(
erc20ContractAddress,
ownerOfNft,
address(this),
costOfRename
);
// We increase the J Type Epoch counter
// When fees are claimed in the future it is calculated
// from the difference of J_TYPE_EPOCH-lastClaimedEpoch.
// E.g 3-1=2 implies the nft is elligible for a percentage of 2*fees
J_TYPE_EPOCH[erc20ContractAddress] += 1;
// We pay out the flat 10% fee on the cost of renames
// E.g 0.1 * 10%
uint256 feeCollectorFeeAmount = (costOfRename * 10) / 100;
uint256 allocatableFee = costOfRename - feeCollectorFeeAmount;
uint256 remainderOfAllocation = allocatableFee % _totalShares;
uint256 feePlusRemainder =
feeCollectorFeeAmount + remainderOfAllocation;
_safeTransfer(erc20ContractAddress, owner(), feePlusRemainder);
}
function burnForERC20(address erc20ContractAddress, uint32 jNumber) public {
uint256 tokenID = _getTokenId(erc20ContractAddress, jNumber);
require(_exists(tokenID), "Not minted");
require(ownerOf(tokenID) == _msgSender(), "Must be owner.");
// Give the owner back their stake
_safeTransfer(
erc20ContractAddress,
ownerOf(tokenID),
CostUtils.getBurnValue(
jNumber,
_getDecimalsForContractAddress(erc20ContractAddress)
)
);
// Free up old name
_rename(tokenID, "");
_burn(tokenID);
}
function claimRenameFeesERC20(address erc20ContractAddress, uint32 jNumber)
public
{
uint256 tokenID = _getTokenId(erc20ContractAddress, jNumber);
require(_exists(tokenID), "Not minted");
address owner = ownerOf(tokenID);
require(owner == _msgSender(), "Must be owner.");
uint256 ownerFeeAmount =
_getRenameFeesAvailableToClaimERC20(erc20ContractAddress, jNumber);
if (ownerFeeAmount == 0) {
return;
}
// Move the last claimed epoch to the current nft type epoch
J_LAST_CLAIMED_EPOCH[tokenID] = J_TYPE_EPOCH[erc20ContractAddress];
// Transfer the funds to the owner
_safeTransfer(erc20ContractAddress, owner, ownerFeeAmount);
}
function hasUsedFreeRenameERC20(
address erc20ContractAddress,
uint32 jNumber
) public view returns (bool) {
uint256 tokenID = _getTokenId(erc20ContractAddress, jNumber);
return !freeRenameAvailable(tokenID);
}
function getRenameFeesAvailableToClaimERC20(
address erc20ContractAddress,
uint32 jNumber
) public view returns (uint256) {
return
_getRenameFeesAvailableToClaimERC20(erc20ContractAddress, jNumber);
}
function _getRenameFeesAvailableToClaimERC20(
address erc20ContractAddress,
uint32 jNumber
) private view returns (uint256) {
uint256 tokenID = _getTokenId(erc20ContractAddress, jNumber);
uint256 jEpoch = J_TYPE_EPOCH[erc20ContractAddress];
uint256 lastClaimed = J_LAST_CLAIMED_EPOCH[tokenID];
if (jEpoch <= lastClaimed) {
return 0;
}
uint256 feeMultiplier = jEpoch - lastClaimed;
// E.g 99/4950 * 1 * 0.1 * 90% (flat 10% was paid to contract owner)
uint256 costOfRename =
_getRenameFeeForContractAddress(erc20ContractAddress);
// 10% is paid to contract owner, so 90% remains for the nft holders
uint256 adjustedCostOfRename = (costOfRename * 90) / 100;
uint256 remainderAfterAllocation = adjustedCostOfRename % _totalShares;
uint256 evenlyDivisibleAllocation =
adjustedCostOfRename - remainderAfterAllocation;
uint256 ownerFeeAmount =
((((uint256(jNumber) * PRECISION_MULTIPLIER)) *
feeMultiplier *
evenlyDivisibleAllocation) / PRECISION_MULTIPLIER) /
_totalShares;
return ownerFeeAmount;
}
function getSupportedErc20Contracts()
external
view
returns (SupportedTokenData[] memory)
{
return supportedErc20Contracts;
}
function _getRenameFeeForContractAddress(address erc20TokenAddress)
private
view
returns (uint256)
{
for (uint256 i = 0; i < supportedErc20Contracts.length; i++) {
if (
supportedErc20Contracts[i].erc20ContractAddress ==
erc20TokenAddress
) {
return supportedErc20Contracts[i].renameFee;
}
}
revert("Token not supported");
}
function _getDecimalsForContractAddress(address erc20TokenAddress)
private
view
returns (uint256)
{
for (uint256 i = 0; i < supportedErc20Contracts.length; i++) {
if (
supportedErc20Contracts[i].erc20ContractAddress ==
erc20TokenAddress
) {
return supportedErc20Contracts[i].decimals;
}
}
revert("Token not supported");
}
function _getTokenId(address erc20ContractAddress, uint32 jNumber)
internal
pure
returns (uint256)
{
return
uint256(keccak256(abi.encodePacked(erc20ContractAddress, jNumber)));
}
// Some tokens on Mainnet are problematic in that some may not throw if the transfer fails
// but return `false` and some might not return `true` as a value in the case of success
function _safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) =
token.call(
abi.encodeWithSelector(
IERC20.transferFrom.selector,
from,
to,
value
)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"Failed to transferFrom"
);
}
function _safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) =
token.call(
abi.encodeWithSelector(IERC20.transfer.selector, to, value)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"Failed to transfer"
);
}
}pragma solidity >=0.6.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "./CustomMintRename.sol";
import "./CostUtils.sol";
import "./TokenMetadata.sol";
pragma experimental ABIEncoderV2;
abstract contract CustomMintRenameWithEth is CustomMintRename {
uint256 private ETH_RENAME_FEE = 10**17; // 0.1
using CostUtils for uint256;
address internal constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
function updateRenameFeeEth(uint256 renameFeeInWei) public {
require(owner() == _msgSender(), "Must be owner");
ETH_RENAME_FEE = renameFeeInWei;
}
function mintFromEth(uint256 jNumber) public payable {
address minter = _msgSender();
require(jNumber < 100 && jNumber > 0, "Invalid jnumber");
require(!_exists(jNumber), "Already minted");
uint256 cost = CostUtils.getMintCost(jNumber, 18);
uint256 weiSent = msg.value;
// Check the contract exact amount to mint
require(weiSent == cost, "Incorrect eth sent for jNumber");
// Sweep fee to owner
uint256 fee = CostUtils.getMintFee(jNumber, 18);
payable(owner()).transfer(fee);
_safeMint(minter, jNumber);
}
function renameWithEth(uint32 jNumber, string memory newName)
public
payable
{
uint256 tokenID = jNumber;
address ownerOfNft = ownerOf(tokenID);
require(_exists(tokenID), "Not minted");
require(ownerOfNft == _msgSender(), "Must be owner");
require(
validateName(newName),
"Invalid name. Must be 1-10 ASCII chars."
);
require(nameAvailable(newName), "Name already taken sorry");
uint256 weiSent = msg.value;
_allocateAndSweepRenameFee(tokenID, weiSent);
_rename(tokenID, newName);
}
function _allocateAndSweepRenameFee(uint256 tokenID, uint256 weiSent)
private
{
if (freeRenameAvailable(tokenID)) {
if (weiSent != 0) {
// Send them back their ETH
_msgSender().transfer(weiSent);
}
return;
}
J_TYPE_EPOCH[ETH_ADDRESS] += 1;
// Flat 10% rename fee paid to the contract owner
uint256 feeCollectorFeeAmount = (ETH_RENAME_FEE * 10) / 100;
uint256 allocatableFee = ETH_RENAME_FEE - feeCollectorFeeAmount;
uint256 remainderOfAllocation = allocatableFee % _totalShares;
uint256 feePlusRemainder =
feeCollectorFeeAmount + remainderOfAllocation;
payable(owner()).transfer(feePlusRemainder);
}
function burnForEth(uint32 jNumber) public {
uint256 tokenID = jNumber;
require(_exists(tokenID), "Not minted");
require(ownerOf(tokenID) == _msgSender(), "Must be owner.");
address payable tokenOwner = payable(ownerOf(tokenID));
// Give the owner back their stake
tokenOwner.transfer(CostUtils.getBurnValue(jNumber, 18));
// Free up old name
_rename(tokenID, "");
_burn(tokenID);
}
function claimRenameFeesEth(uint32 jNumber) public {
require(ownerOf(uint256(jNumber)) == _msgSender(), "Must be owner.");
address payable tokenOwner = payable(_msgSender());
uint256 ownerFeeAmount = _getRenameFeesAvailableToClaimEth(jNumber);
if (ownerFeeAmount == 0) {
return;
}
// Move the last claimed epoch to the current j type epoch
J_LAST_CLAIMED_EPOCH[uint256(jNumber)] = J_TYPE_EPOCH[ETH_ADDRESS];
tokenOwner.transfer(ownerFeeAmount);
}
function hasUsedFreeRenameEth(uint32 jNumber) public view returns (bool) {
return !freeRenameAvailable(jNumber);
}
function getRenameFeesAvailableToClaimEth(uint32 jNumber)
public
view
returns (uint256)
{
return _getRenameFeesAvailableToClaimEth(jNumber);
}
function getTokensForEth()
external
view
returns (TokenMetadata[100] memory)
{
TokenMetadata[100] memory tokens;
for (uint32 jNumber = 0; jNumber < 100; jNumber++) {
uint256 tokenId = jNumber;
if (_exists(tokenId)) {
TokenMetadata memory tmd =
TokenMetadata({
exists: true,
tokenId: tokenId,
jNumber: jNumber,
erc20ContractAddress: address(0),
claimableRenameFees: getRenameFeesAvailableToClaimEth(
jNumber
),
hasFreeRename: freeRenameAvailable(tokenId),
name: nameOf(tokenId),
ownerAddress: ownerOf(tokenId)
});
tokens[jNumber] = tmd;
} else {
TokenMetadata memory tmd =
TokenMetadata({
exists: false,
tokenId: tokenId,
jNumber: jNumber,
erc20ContractAddress: address(0),
claimableRenameFees: getRenameFeesAvailableToClaimEth(
jNumber
),
hasFreeRename: freeRenameAvailable(tokenId),
name: "",
ownerAddress: address(0)
});
tokens[jNumber] = tmd;
}
}
return tokens;
}
function _getRenameFeesAvailableToClaimEth(uint32 jNumber)
internal
view
returns (uint256)
{
uint256 tokenID = jNumber;
uint256 jEpoch = J_TYPE_EPOCH[ETH_ADDRESS];
uint256 lastClaimed = J_LAST_CLAIMED_EPOCH[tokenID];
if (jEpoch <= lastClaimed) {
return 0;
}
uint256 feeMultiplier = jEpoch - lastClaimed;
// E.g 99/4950 * 1 * 0.1 * 90% (flat 10% was paid to contract owner)
// 10% is paid to contract owner, so 90% remains for the nft holders
uint256 adjustedCostOfRename = (ETH_RENAME_FEE * 90) / 100;
uint256 remainderAfterAllocation = adjustedCostOfRename % _totalShares;
uint256 evenlyDivisibleAllocation =
adjustedCostOfRename - remainderAfterAllocation;
uint256 ownerFeeAmount =
((((uint256(jNumber) * PRECISION_MULTIPLIER)) *
feeMultiplier *
evenlyDivisibleAllocation) / PRECISION_MULTIPLIER) /
_totalShares;
return ownerFeeAmount;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
}pragma solidity >=0.6.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
pragma experimental ABIEncoderV2;
abstract contract CustomMintRename is Ownable, ERC721 {
event Rename(uint256 indexed tokenID);
mapping(uint256 => string) private tokenNames;
mapping(uint256 => bool) private usedFreeRename;
mapping(string => bool) private nameDictionary;
// For each J type we have an epoch, incrememnted with every paid rename
// Token Address => totalEpoch
mapping(address => uint256) internal J_TYPE_EPOCH;
// For J ID we have a last claimed epoch, incrememnted with fee claim
// A j can claim a fee when J_TYPE_EPOCH-J_LAST_CLAIMED_EPOCH > 0
// TokenID => lastClaimedEpoch
mapping(uint256 => uint256) internal J_LAST_CLAIMED_EPOCH;
uint256 internal constant PRECISION_MULTIPLIER = 1e18;
// sum of ‘n’ natural numbers to 99.
// 99*(100)/2 = 4950
//
uint256 _totalShares = 4950;
function exists(uint256 tokenId) public view returns (bool) {
return _exists(tokenId);
}
function nameOf(uint256 tokenId) public view returns (string memory) {
return tokenNames[tokenId];
}
function freeRenameAvailable(uint256 tokenId) public view returns (bool) {
return !usedFreeRename[tokenId];
}
function nameAvailable(string memory newName) public view returns (bool) {
return !nameDictionary[toLower(newName)];
}
function _rename(uint256 tokenID, string memory newName) internal {
// Free up old name
string storage oldName = tokenNames[tokenID];
nameDictionary[toLower(oldName)] = false;
// Add the name to the unique dictionary
nameDictionary[toLower(newName)] = true;
// Set the new name
tokenNames[tokenID] = newName;
// Used the free rename - can set everytime no state change
usedFreeRename[tokenID] = true;
emit Rename(tokenID);
}
/**
* @dev Check if the name string is valid (Alphanumeric and spaces without leading or trailing space)
*/
function validateName(string memory str) public pure returns (bool) {
uint256 MAX_LENTH = 10;
bytes memory b = bytes(str);
if (b.length < 1) return false;
if (b.length > MAX_LENTH) return false; // Cannot be longer than 25 characters
if (b[0] == 0x20) return false; // Leading space
if (b[b.length - 1] == 0x20) return false; // Trailing space
bytes1 lastChar = b[0];
for (uint256 i; i < b.length; i++) {
bytes1 char = b[i];
if (char == 0x20 && lastChar == 0x20) return false; // Cannot contain continous spaces
if (
!(char >= 0x30 && char <= 0x39) && //9-0
!(char >= 0x41 && char <= 0x5A) && //A-Z
!(char >= 0x61 && char <= 0x7A) && //a-z
!(char == 0x20) //space
) return false;
lastChar = char;
}
return true;
}
/**
* @dev Converts the string to lowercase
*/
function toLower(string memory str) public pure returns (string memory) {
bytes memory bStr = bytes(str);
bytes memory bLower = new bytes(bStr.length);
for (uint256 i = 0; i < bStr.length; i++) {
// Uppercase character
if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) {
bLower[i] = bytes1(uint8(bStr[i]) + 32);
} else {
bLower[i] = bStr[i];
}
}
return string(bLower);
}
}pragma solidity >=0.6.0 <0.9.0;
//SPDX-License-Identifier: MIT
library CostUtils {
function getMintCost(uint256 jNumber, uint256 decimals)
internal
pure
returns (uint256)
{
require(jNumber >= 0);
require(jNumber < 100);
return (((jNumber * 110)) * (uint256(10)**decimals)) / 100;
}
function getMintFee(uint256 jNumber, uint256 decimals)
internal
pure
returns (uint256)
{
uint256 cost = getMintCost(jNumber, decimals);
return cost / 11;
}
function getBurnValue(uint256 jNumber, uint256 decimals)
internal
pure
returns (uint256)
{
require(jNumber >= 0);
require(jNumber < 100);
return jNumber * (uint256(10)**decimals);
}
}pragma solidity >=0.6.0 <0.9.0;
//SPDX-License-Identifier: MIT
struct TokenMetadata {
bool exists;
uint256 tokenId;
address erc20ContractAddress;
uint256 jNumber;
uint256 claimableRenameFees;
bool hasFreeRename;
string name;
address ownerAddress;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "../../GSN/Context.sol";
import "./IERC721.sol";
import "./IERC721Metadata.sol";
import "./IERC721Enumerable.sol";
import "./IERC721Receiver.sol";
import "../../introspection/ERC165.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
import "../../utils/EnumerableSet.sol";
import "../../utils/EnumerableMap.sol";
import "../../utils/Strings.sol";
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using SafeMath for uint256;
using Address for address;
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableMap for EnumerableMap.UintToAddressMap;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from holder address to their (enumerable) set of owned tokens
mapping (address => EnumerableSet.UintSet) private _holderTokens;
// Enumerable mapping from token ids to their owners
EnumerableMap.UintToAddressMap private _tokenOwners;
// 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;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Optional mapping for token URIs
mapping (uint256 => string) private _tokenURIs;
// Base URI
string private _baseURI;
/*
* bytes4(keccak256('balanceOf(address)')) == 0x70a08231
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
* bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
* bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
*
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
* 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
/*
* bytes4(keccak256('name()')) == 0x06fdde03
* bytes4(keccak256('symbol()')) == 0x95d89b41
* bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
*
* => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
*/
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/*
* bytes4(keccak256('totalSupply()')) == 0x18160ddd
* bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
* bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
*
* => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
*/
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _holderTokens[owner].length();
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
// If there is no base URI, return the token URI.
if (bytes(_baseURI).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(_baseURI, _tokenURI));
}
// If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
return string(abi.encodePacked(_baseURI, tokenId.toString()));
}
/**
* @dev Returns the base URI set via {_setBaseURI}. This will be
* automatically added as a prefix in {tokenURI} to each token's URI, or
* to the token ID if no specific URI is set for that token ID.
*/
function baseURI() public view returns (string memory) {
return _baseURI;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
return _holderTokens[owner].at(index);
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
// _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
return _tokenOwners.length();
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
(uint256 tokenId, ) = _tokenOwners.at(index);
return tokenId;
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = 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 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 {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view 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 returns (bool) {
return _tokenOwners.contains(tokenId);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
d*
* - `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);
_holderTokens[to].add(tokenId);
_tokenOwners.set(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 = ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
// Clear metadata (if any)
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
_holderTokens[owner].remove(tokenId);
_tokenOwners.remove(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(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);
_holderTokens[from].remove(tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(from, to, tokenId);
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
/**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI},
* or to the token ID if {tokenURI} is empty.
*/
function _setBaseURI(string memory baseURI_) internal virtual {
_baseURI = baseURI_;
}
/**
* @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()) {
return true;
}
bytes memory returndata = to.functionCall(abi.encodeWithSelector(
IERC721Receiver(to).onERC721Received.selector,
_msgSender(),
from,
tokenId,
_data
), "ERC721: transfer to non ERC721Receiver implementer");
bytes4 retval = abi.decode(returndata, (bytes4));
return (retval == _ERC721_RECEIVED);
}
function _approve(address to, uint256 tokenId) private {
_tokenApprovals[tokenId] = to;
emit Approval(ownerOf(tokenId), to, tokenId);
}
/**
* @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 { }
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "../GSN/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
import "../../introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, 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
pragma solidity ^0.6.2;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @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
pragma solidity ^0.6.2;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @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
pragma solidity ^0.6.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
external returns (bytes4);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () internal {
// Derived contracts need only register support for their own interfaces,
// we register support for ERC165 itself here
_registerInterface(_INTERFACE_ID_ERC165);
}
/**
* @dev See {IERC165-supportsInterface}.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
return _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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 sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @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) {
// 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 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts 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 mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @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");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(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");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
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
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Library for managing an enumerable variant of Solidity's
* https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
* type.
*
* Maps have the following properties:
*
* - Entries are added, removed, and checked for existence in constant time
* (O(1)).
* - Entries are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableMap for EnumerableMap.UintToAddressMap;
*
* // Declare a set state variable
* EnumerableMap.UintToAddressMap private myMap;
* }
* ```
*
* As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
* supported.
*/
library EnumerableMap {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Map type with
// bytes32 keys and values.
// The Map implementation uses private functions, and user-facing
// implementations (such as Uint256ToAddressMap) are just wrappers around
// the underlying Map.
// This means that we can only create new EnumerableMaps for types that fit
// in bytes32.
struct MapEntry {
bytes32 _key;
bytes32 _value;
}
struct Map {
// Storage of map keys and values
MapEntry[] _entries;
// Position of the entry defined by a key in the `entries` array, plus 1
// because index 0 means a key is not in the map.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) { // Equivalent to !contains(map, key)
map._entries.push(MapEntry({ _key: key, _value: value }));
// The entry is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
map._indexes[key] = map._entries.length;
return true;
} else {
map._entries[keyIndex - 1]._value = value;
return false;
}
}
/**
* @dev Removes a key-value pair from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function _remove(Map storage map, bytes32 key) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex != 0) { // Equivalent to contains(map, key)
// To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
// in the array, and then remove the last entry (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = keyIndex - 1;
uint256 lastIndex = map._entries.length - 1;
// When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
MapEntry storage lastEntry = map._entries[lastIndex];
// Move the last entry to the index where the entry to delete is
map._entries[toDeleteIndex] = lastEntry;
// Update the index for the moved entry
map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved entry was stored
map._entries.pop();
// Delete the index for the deleted slot
delete map._indexes[key];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function _contains(Map storage map, bytes32 key) private view returns (bool) {
return map._indexes[key] != 0;
}
/**
* @dev Returns the number of key-value pairs in the map. O(1).
*/
function _length(Map storage map) private view returns (uint256) {
return map._entries.length;
}
/**
* @dev Returns the key-value pair stored at position `index` in the map. O(1).
*
* Note that there are no guarantees on the ordering of entries inside the
* array, and it may change when more entries are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
require(map._entries.length > index, "EnumerableMap: index out of bounds");
MapEntry storage entry = map._entries[index];
return (entry._key, entry._value);
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function _get(Map storage map, bytes32 key) private view returns (bytes32) {
return _get(map, key, "EnumerableMap: nonexistent key");
}
/**
* @dev Same as {_get}, with a custom error message when `key` is not in the map.
*/
function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
return map._entries[keyIndex - 1]._value; // All indexes are 1-based
}
// UintToAddressMap
struct UintToAddressMap {
Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
return _set(map._inner, bytes32(key), bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
return _remove(map._inner, bytes32(key));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
return _contains(map._inner, bytes32(key));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(UintToAddressMap storage map) internal view returns (uint256) {
return _length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the set. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = _at(map._inner, index);
return (uint256(key), address(uint256(value)));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint256(_get(map._inner, bytes32(key))));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*/
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
return address(uint256(_get(map._inner, bytes32(key), errorMessage)));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev String operations.
*/
library Strings {
/**
* @dev Converts a `uint256` to its ASCII `string` 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);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = byte(uint8(48 + temp % 10));
temp /= 10;
}
return string(buffer);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"Rename","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"},{"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":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"burnForERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"burnForEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"claimRenameFeesERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"claimRenameFeesEth","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"freeRenameAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"getRenameFeesAvailableToClaimERC20","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"getRenameFeesAvailableToClaimEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSupportedErc20Contracts","outputs":[{"components":[{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"decimals","type":"uint32"},{"internalType":"uint256","name":"renameFee","type":"uint256"}],"internalType":"struct CustomMintRenameWithERC20.SupportedTokenData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20ContractAddress","type":"address"}],"name":"getTokensForERC20","outputs":[{"components":[{"internalType":"bool","name":"exists","type":"bool"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint256","name":"jNumber","type":"uint256"},{"internalType":"uint256","name":"claimableRenameFees","type":"uint256"},{"internalType":"bool","name":"hasFreeRename","type":"bool"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"ownerAddress","type":"address"}],"internalType":"struct TokenMetadata[100]","name":"","type":"tuple[100]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokensForEth","outputs":[{"components":[{"internalType":"bool","name":"exists","type":"bool"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint256","name":"jNumber","type":"uint256"},{"internalType":"uint256","name":"claimableRenameFees","type":"uint256"},{"internalType":"bool","name":"hasFreeRename","type":"bool"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"ownerAddress","type":"address"}],"internalType":"struct TokenMetadata[100]","name":"","type":"tuple[100]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"hasUsedFreeRenameERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"hasUsedFreeRenameEth","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"jNumber","type":"uint32"}],"name":"mintFromERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"jNumber","type":"uint256"}],"name":"mintFromEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newName","type":"string"}],"name":"nameAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"nameOf","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"jNumber","type":"uint32"},{"internalType":"string","name":"newName","type":"string"}],"name":"renameWithERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"jNumber","type":"uint32"},{"internalType":"string","name":"newName","type":"string"}],"name":"renameWithEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"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":"string","name":"str","type":"string"}],"name":"toLower","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"renameFeeInWei","type":"uint256"}],"name":"updateRenameFeeEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc20ContractAddress","type":"address"},{"internalType":"uint32","name":"decimals","type":"uint32"},{"internalType":"uint256","name":"renameFee","type":"uint256"},{"internalType":"string","name":"nameOf0thJ","type":"string"}],"name":"upsertNewErc20Token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"validateName","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}]Contract Creation Code
608060405261135660105567016345785d8a00006011553480156200002357600080fd5b506040516200508838038062005088833981016040819052620000469162000b12565b6040518060400160405280600d81526020016c43727970746f4a65727365797360981b81525060405180604001604052806003815260200162434a4160e81b81525060006200009a620001f460201b60201c565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620000ff6301ffc9a760e01b6001600160e01b03620001f916565b81516200011490600790602085019062000a46565b5080516200012a90600890602084019062000a46565b50620001466380ac58cd60e01b6001600160e01b03620001f916565b62000161635b5e139f60e01b6001600160e01b03620001f916565b6200017c63780e9d6360e01b6001600160e01b03620001f916565b50620001a79050620001966001600160e01b036200025716565b60006001600160e01b036200026616565b620001d9600060405180604001604052806007815260200166566974616c696b60c81b8152506200028c60201b60201c565b620001ed816001600160e01b036200041d16565b5062000da9565b335b90565b6001600160e01b031980821614156200022f5760405162461bcd60e51b8152600401620002269062000c9c565b60405180910390fd5b6001600160e01b0319166000908152600160208190526040909120805460ff19169091179055565b6000546001600160a01b031690565b620002888282604051806020016040528060008152506200043260201b60201c565b5050565b6000828152600b602090815260408083208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152909392600d926200034392918691908301828280156200032e5780601f1062000302576101008083540402835291602001916200032e565b820191906000526020600020905b8154815290600101906020018083116200031057829003601f168201915b50506001600160e01b03620004831692505050565b60405162000352919062000be2565b908152604051908190036020019020805491151560ff199092169190911790556001600d6200038a846001600160e01b036200048316565b60405162000399919062000be2565b9081526040805160209281900383019020805460ff1916931515939093179092556000858152600b8252919091208351620003d79285019062000a46565b506000838152600c6020526040808220805460ff191660011790555184917f52b0f09d5e06ee21b8d1a082ab8512eb231e91e32675ba31757e2b4affc805b191a2505050565b80516200028890600a90602084019062000a46565b6200044783836001600160e01b03620005b916565b6200045f60008484846001600160e01b03620006b916565b6200047e5760405162461bcd60e51b8152600401620002269062000c4a565b505050565b606080829050606081516001600160401b0381118015620004a357600080fd5b506040519080825280601f01601f191660200182016040528015620004cf576020820181803683370190505b50905060005b8251811015620005b1576041838281518110620004ee57fe5b016020015160f81c108015906200051a5750605a8382815181106200050f57fe5b016020015160f81c11155b156200056b578281815181106200052d57fe5b602001015160f81c60f81b60f81c60200160f81b8282815181106200054e57fe5b60200101906001600160f81b031916908160001a905350620005a8565b8281815181106200057857fe5b602001015160f81c60f81b8282815181106200059057fe5b60200101906001600160f81b031916908160001a9053505b600101620004d5565b509392505050565b6001600160a01b038216620005e25760405162461bcd60e51b8152600401620002269062000d0a565b620005f6816001600160e01b03620007c716565b15620006165760405162461bcd60e51b8152600401620002269062000cd3565b6200062d600083836001600160e01b036200047e16565b6001600160a01b03821660009081526002602090815260409091206200065e91839062002bae620007ea821b17901c565b506200067c818360036200080860201b62002bba179092919060201c565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000620006da846001600160a01b03166200082960201b620030f71760201c565b620006e857506001620007bf565b60606200078d630a85bd0160e11b620007096001600160e01b03620001f416565b88878760405160240162000721949392919062000c00565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050506040518060600160405280603281526020016200505660329139876001600160a01b03166200082f60201b620030fd179092919060201c565b9050600081806020019051810190620007a7919062000ae8565b6001600160e01b031916630a85bd0160e11b14925050505b949350505050565b6000620007e48260036200084960201b62002b921790919060201c565b92915050565b60006200080183836001600160e01b036200086016565b9392505050565b6000620007bf84846001600160a01b0385166001600160e01b03620008b816565b3b151590565b6060620007bf84846000856001600160e01b036200095316565b60006200080183836001600160e01b0362000a2e16565b60006200087783836001600160e01b0362000a2e16565b620008af57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007e4565b506000620007e4565b6000828152600184016020526040812054806200091f57505060408051808201825283815260208082018481528654600181810189556000898152848120955160029093029095019182559151908201558654868452818801909252929091205562000801565b828560000160018303815481106200093357fe5b906000526020600020906002020160010181905550600091505062000801565b606062000969856001600160e01b036200082916565b620009885760405162461bcd60e51b8152600401620002269062000d3f565b60006060866001600160a01b03168587604051620009a7919062000be2565b60006040518083038185875af1925050503d8060008114620009e6576040519150601f19603f3d011682016040523d82523d6000602084013e620009eb565b606091505b5091509150811562000a01579150620007bf9050565b80511562000a125780518082602001fd5b8360405162461bcd60e51b815260040162000226919062000c35565b60009081526001919091016020526040902054151590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000a8957805160ff191683800117855562000ab9565b8280016001018555821562000ab9579182015b8281111562000ab957825182559160200191906001019062000a9c565b5062000ac792915062000acb565b5090565b620001f691905b8082111562000ac7576000815560010162000ad2565b60006020828403121562000afa578081fd5b81516001600160e01b03198116811462000801578182fd5b60006020828403121562000b24578081fd5b81516001600160401b038082111562000b3b578283fd5b81840185601f82011262000b4d578384fd5b805192508183111562000b5e578384fd5b604051601f8401601f19168101602001838111828210171562000b7f578586fd5b60405283815281840160200187101562000b97578485fd5b62000baa84602083016020850162000d76565b9695505050505050565b6000815180845262000bce81602086016020860162000d76565b601f01601f19169290920160200192915050565b6000825162000bf681846020870162000d76565b9190910192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009062000baa9083018462000bb4565b60006020825262000801602083018462000bb4565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604082015260600190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60005b8381101562000d9357818101518382015260200162000d79565b8381111562000da3576000848401525b50505050565b61429d8062000db96000396000f3fe60806040526004361061025c5760003560e01c8063715018a611610144578063b64bf7d7116100b6578063e0c622691161007a578063e0c62269146106f3578063e985e9c514610713578063ef48770e14610733578063f2fde38b14610748578063f69857b014610768578063f7e41aad146107885761025c565b8063b64bf7d714610653578063b88d4fde14610673578063c7c14e8014610693578063c87b56dd146106b3578063ded578a4146106d35761025c565b806393b6539a1161010857806393b6539a146105ab5780639416b423146105cb57806395d89b41146105eb5780639ecfae54146106005780639ffdb65a14610613578063a22cb465146106335761025c565b8063715018a6146105145780637d0f7ed51461052957806382bbdbec146105565780638a4aac55146105765780638da5cb5b146105965761025c565b806342842e0e116101dd5780635cf5d07e116101a15780635cf5d07e1461046c5780635e30865e1461048c5780636352211e1461049f57806365573a8f146104bf5780636c0360eb146104df57806370a08231146104f45761025c565b806342842e0e146103cc578063474af593146103ec5780634f558e791461040c5780634f6ccce71461042c5780635007eec11461044c5761025c565b806318160ddd1161022457806318160ddd1461032857806318a0ed751461034a57806323b872dd1461036a5780632f745c591461038a578063305918fd146103aa5761025c565b806301ffc9a714610261578063051a26641461029757806306fdde03146102c4578063081812fc146102d9578063095ea7b314610306575b600080fd5b34801561026d57600080fd5b5061028161027c3660046136e3565b6107a8565b60405161028e9190613a94565b60405180910390f35b3480156102a357600080fd5b506102b76102b236600461374e565b6107cb565b60405161028e9190613a9f565b3480156102d057600080fd5b506102b761086c565b3480156102e557600080fd5b506102f96102f436600461374e565b610903565b60405161028e91906138db565b34801561031257600080fd5b506103266103213660046135e4565b61094f565b005b34801561033457600080fd5b5061033d6109e7565b60405161028e919061418c565b34801561035657600080fd5b5061028161036536600461360e565b6109f8565b34801561037657600080fd5b50610326610385366004613505565b610a1b565b34801561039657600080fd5b5061033d6103a53660046135e4565b610a53565b3480156103b657600080fd5b506103bf610a82565b60405161028e9190613969565b3480156103d857600080fd5b506103266103e7366004613505565b610b0c565b3480156103f857600080fd5b50610281610407366004613766565b610b27565b34801561041857600080fd5b5061028161042736600461374e565b610b3f565b34801561043857600080fd5b5061033d61044736600461374e565b610b4a565b34801561045857600080fd5b5061033d61046736600461360e565b610b66565b34801561047857600080fd5b5061033d610487366004613766565b610b72565b61032661049a36600461374e565b610b7d565b3480156104ab57600080fd5b506102f96104ba36600461374e565b610c6b565b3480156104cb57600080fd5b506103266104da36600461360e565b610c99565b3480156104eb57600080fd5b506102b7610d79565b34801561050057600080fd5b5061033d61050f3660046134b6565b610dda565b34801561052057600080fd5b50610326610e23565b34801561053557600080fd5b506105496105443660046134b6565b610ea2565b60405161028e91906139d1565b34801561056257600080fd5b5061028161057136600461371b565b61101f565b34801561058257600080fd5b50610326610591366004613697565b611054565b3480156105a257600080fd5b506102f9611240565b3480156105b757600080fd5b506103266105c6366004613639565b61124f565b3480156105d757600080fd5b506102b76105e636600461371b565b611326565b3480156105f757600080fd5b506102b7611448565b61032661060e366004613782565b6114a9565b34801561061f57600080fd5b5061028161062e36600461371b565b611579565b34801561063f57600080fd5b5061032661064e3660046135ad565b61176b565b34801561065f57600080fd5b5061032661066e36600461374e565b611839565b34801561067f57600080fd5b5061032661068e366004613545565b61187d565b34801561069f57600080fd5b506103266106ae366004613766565b6118b6565b3480156106bf57600080fd5b506102b76106ce36600461374e565b611993565b3480156106df57600080fd5b506103266106ee36600461360e565b611add565b3480156106ff57600080fd5b5061032661070e36600461360e565b611ba7565b34801561071f57600080fd5b5061028161072e3660046134d1565b611c66565b34801561073f57600080fd5b50610549611c94565b34801561075457600080fd5b506103266107633660046134b6565b611e09565b34801561077457600080fd5b5061028161078336600461374e565b611ebf565b34801561079457600080fd5b506103266107a3366004613766565b611ed5565b6001600160e01b0319811660009081526001602052604090205460ff165b919050565b6000818152600b602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156108605780601f1061083557610100808354040283529160200191610860565b820191906000526020600020905b81548152906001019060200180831161084357829003601f168201915b50505050509050919050565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108f85780601f106108cd576101008083540402835291602001916108f8565b820191906000526020600020905b8154815290600101906020018083116108db57829003601f168201915b505050505090505b90565b600061090e82611fb7565b6109335760405162461bcd60e51b815260040161092a90613edb565b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061095a82610c6b565b9050806001600160a01b0316836001600160a01b0316141561098e5760405162461bcd60e51b815260040161092a90614021565b806001600160a01b03166109a0611fca565b6001600160a01b031614806109bc57506109bc8161072e611fca565b6109d85760405162461bcd60e51b815260040161092a90613ce9565b6109e28383611fce565b505050565b60006109f3600361203c565b905090565b600080610a058484612047565b9050610a1081611ebf565b159150505b92915050565b610a2c610a26611fca565b8261207b565b610a485760405162461bcd60e51b815260040161092a90614062565b6109e2838383612100565b6001600160a01b0382166000908152600260205260408120610a7b908363ffffffff61222016565b9392505050565b60606012805480602002602001604051908101604052809291908181526020016000905b82821015610b03576000848152602090819020604080516060810182526002860290920180546001600160a01b0381168452600160a01b900463ffffffff1683850152600190810154918301919091529083529092019101610aa6565b50505050905090565b6109e28383836040518060200160405280600081525061187d565b6000610b388263ffffffff16611ebf565b1592915050565b6000610a1582611fb7565b600080610b5e60038463ffffffff61222c16565b509392505050565b6000610a7b8383612248565b6000610a1582612309565b6000610b87611fca565b9050606482108015610b995750600082115b610bb55760405162461bcd60e51b815260040161092a90613eb2565b610bbe82611fb7565b15610bdb5760405162461bcd60e51b815260040161092a90613af4565b6000610be88360126123c0565b905034808214610c0a5760405162461bcd60e51b815260040161092a906140b3565b6000610c178560126123e9565b9050610c21611240565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610c59573d6000803e3d6000fd5b50610c648486612402565b5050505050565b6000610a158260405180606001604052806029815260200161423f602991396003919063ffffffff61241c16565b6000610ca3611fca565b90506000610cb18484612047565b905030606463ffffffff8516108015610cd0575060008463ffffffff16115b610cec5760405162461bcd60e51b815260040161092a90613eb2565b610cf582611fb7565b15610d125760405162461bcd60e51b815260040161092a90613af4565b6000610d1d86612429565b90506000610d318663ffffffff16836123c0565b9050610d3f878685846124c3565b6000610d518763ffffffff16846123e9565b9050610d6588610d5f611240565b836125b4565b610d6f8686612402565b5050505050505050565b600a8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108f85780601f106108cd576101008083540402835291602001916108f8565b60006001600160a01b038216610e025760405162461bcd60e51b815260040161092a90613d72565b6001600160a01b0382166000908152600260205260409020610a159061203c565b610e2b611fca565b6000546001600160a01b03908116911614610e585760405162461bcd60e51b815260040161092a90613f27565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610eaa6132a4565b610eb26132a4565b60005b60648163ffffffff161015611018576000610ed08583612047565b9050610edb81611fb7565b15610f7f57610ee86132d2565b604051806101000160405280600115158152602001838152602001876001600160a01b031681526020018463ffffffff168152602001610f288886610b66565b8152602001610f3684611ebf565b15158152602001610f46846107cb565b8152602001610f5484610c6b565b6001600160a01b031690529050808463ffffffff851660648110610f7457fe5b60200201525061100f565b610f876132d2565b604051806101000160405280600015158152602001838152602001876001600160a01b031681526020018463ffffffff168152602001610fc78886610b66565b8152602001610fd584611ebf565b1515815260408051602081810183526000808352908401919091529101529050808463ffffffff85166064811061100857fe5b6020020152505b50600101610eb5565b5092915050565b6000600d61102c83611326565b604051611039919061383e565b9081526040519081900360200190205460ff16159050919050565b61105c611fca565b6001600160a01b031661106d611240565b6001600160a01b0316146110935760405162461bcd60e51b815260040161092a90613dbc565b60005b60125481101561114557846001600160a01b0316601282815481106110b757fe5b60009182526020909120600290910201546001600160a01b0316141561113d5783601282815481106110e557fe5b906000526020600020906002020160000160146101000a81548163ffffffff021916908363ffffffff160217905550826012828154811061112257fe5b9060005260206000209060020201600101819055505061123a565b600101611096565b5061114e613315565b50604080516060810182526001600160a01b03808716825263ffffffff80871660208401908152938301868152601280546001810182556000918252855160029091027fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444810180549851909516600160a01b0263ffffffff60a01b19929096166001600160a01b0319909816979097171693909317909155517fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3445909301929092559061121a8682612047565b905061122d611227611240565b82612402565b61123781846126a3565b50505b50505050565b6000546001600160a01b031690565b600061125b8484612047565b9050600061126882610c6b565b905061127382611fb7565b61128f5760405162461bcd60e51b815260040161092a90614168565b611297611fca565b6001600160a01b0316816001600160a01b0316146112c75760405162461bcd60e51b815260040161092a90613dbc565b6112d083611579565b6112ec5760405162461bcd60e51b815260040161092a906140ea565b6112f58361101f565b6113115760405162461bcd60e51b815260040161092a90613cb2565b61131c828683612813565b610c6482846126a3565b6060808290506060815167ffffffffffffffff8111801561134657600080fd5b506040519080825280601f01601f191660200182016040528015611371576020820181803683370190505b50905060005b8251811015610b5e57604183828151811061138e57fe5b016020015160f81c108015906113b85750605a8382815181106113ad57fe5b016020015160f81c11155b15611405578281815181106113c957fe5b602001015160f81c60f81b60f81c60200160f81b8282815181106113e957fe5b60200101906001600160f81b031916908160001a905350611440565b82818151811061141157fe5b602001015160f81c60f81b82828151811061142857fe5b60200101906001600160f81b031916908160001a9053505b600101611377565b60088054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108f85780601f106108cd576101008083540402835291602001916108f8565b63ffffffff821660006114bb82610c6b565b90506114c682611fb7565b6114e25760405162461bcd60e51b815260040161092a90614168565b6114ea611fca565b6001600160a01b0316816001600160a01b03161461151a5760405162461bcd60e51b815260040161092a90613dbc565b61152383611579565b61153f5760405162461bcd60e51b815260040161092a906140ea565b6115488361101f565b6115645760405162461bcd60e51b815260040161092a90613cb2565b3461156f8382612887565b610c6483856126a3565b8051600090600a90839060011115611596576000925050506107c6565b81815111156115aa576000925050506107c6565b806000815181106115b757fe5b6020910101516001600160f81b031916600160fd1b14156115dd576000925050506107c6565b806001825103815181106115ed57fe5b6020910101516001600160f81b031916600160fd1b1415611613576000925050506107c6565b60008160008151811061162257fe5b01602001516001600160f81b031916905060005b825181101561175f57600083828151811061164d57fe5b01602001516001600160f81b0319169050600160fd1b8114801561167e5750600160fd1b6001600160f81b03198416145b15611691576000955050505050506107c6565b600360fc1b6001600160f81b03198216108015906116bd5750603960f81b6001600160f81b0319821611155b1580156116f35750604160f81b6001600160f81b03198216108015906116f15750602d60f91b6001600160f81b0319821611155b155b80156117285750606160f81b6001600160f81b03198216108015906117265750603d60f91b6001600160f81b0319821611155b155b80156117425750600160fd1b6001600160f81b0319821614155b15611755576000955050505050506107c6565b9150600101611636565b50600195945050505050565b611773611fca565b6001600160a01b0316826001600160a01b031614156117a45760405162461bcd60e51b815260040161092a90613c2f565b80600660006117b1611fca565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556117f5611fca565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161182d9190613a94565b60405180910390a35050565b611841611fca565b6001600160a01b0316611852611240565b6001600160a01b0316146118785760405162461bcd60e51b815260040161092a90613dbc565b601155565b61188e611888611fca565b8361207b565b6118aa5760405162461bcd60e51b815260040161092a90614062565b61123a84848484612994565b6118be611fca565b6001600160a01b03166118d68263ffffffff16610c6b565b6001600160a01b0316146118fc5760405162461bcd60e51b815260040161092a90613e55565b6000611906611fca565b9050600061191383612309565b905080611921575050611990565b7fe22fd0f090172bedb2987ffc9081056dcd23245cc377e9bafe94a3c3293defad5463ffffffff84166000908152600f60205260408082209290925590516001600160a01b0384169183156108fc02918491818181858888f1935050505015801561123a573d6000803e3d6000fd5b50565b606061199e82611fb7565b6119ba5760405162461bcd60e51b815260040161092a90613fd2565b60008281526009602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015611a4f5780601f10611a2457610100808354040283529160200191611a4f565b820191906000526020600020905b815481529060010190602001808311611a3257829003601f168201915b5050600a5493945050505060026000196101006001841615020190911604611a785790506107c6565b805115611aaa57600a81604051602001611a9392919061385a565b6040516020818303038152906040529150506107c6565b600a611ab5846129c7565b604051602001611ac692919061385a565b604051602081830303815290604052915050919050565b6000611ae98383612047565b9050611af481611fb7565b611b105760405162461bcd60e51b815260040161092a90614168565b6000611b1b82610c6b565b9050611b25611fca565b6001600160a01b0316816001600160a01b031614611b555760405162461bcd60e51b815260040161092a90613e55565b6000611b618585612248565b905080611b7057505050611ba3565b6001600160a01b0385166000908152600e6020908152604080832054868452600f90925290912055610c648583836125b4565b5050565b6000611bb38383612047565b9050611bbe81611fb7565b611bda5760405162461bcd60e51b815260040161092a90614168565b611be2611fca565b6001600160a01b0316611bf482610c6b565b6001600160a01b031614611c1a5760405162461bcd60e51b815260040161092a90613e55565b611c4483611c2783610c6b565b611c3f8563ffffffff16611c3a88612429565b612aa2565b6125b4565b611c5d81604051806020016040528060008152506126a3565b6109e281612ab9565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b611c9c6132a4565b611ca46132a4565b60005b60648163ffffffff161015611e035763ffffffff8116611cc681611fb7565b15611d6a57611cd36132d2565b60405180610100016040528060011515815260200183815260200160006001600160a01b031681526020018463ffffffff168152602001611d1385610b72565b8152602001611d2184611ebf565b15158152602001611d31846107cb565b8152602001611d3f84610c6b565b6001600160a01b031690529050808463ffffffff851660648110611d5f57fe5b602002015250611dfa565b611d726132d2565b60405180610100016040528060001515815260200183815260200160006001600160a01b031681526020018463ffffffff168152602001611db285610b72565b8152602001611dc084611ebf565b1515815260408051602081810183526000808352908401919091529101529050808463ffffffff851660648110611df357fe5b6020020152505b50600101611ca7565b50905090565b611e11611fca565b6000546001600160a01b03908116911614611e3e5760405162461bcd60e51b815260040161092a90613f27565b6001600160a01b038116611e645760405162461bcd60e51b815260040161092a90613b6e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000908152600c602052604090205460ff161590565b63ffffffff8116611ee581611fb7565b611f015760405162461bcd60e51b815260040161092a90614168565b611f09611fca565b6001600160a01b0316611f1b82610c6b565b6001600160a01b031614611f415760405162461bcd60e51b815260040161092a90613e55565b6000611f4c82610c6b565b9050806001600160a01b03166108fc611f6c8563ffffffff166012612aa2565b6040518115909202916000818181858888f19350505050158015611f94573d6000803e3d6000fd5b50611fae82604051806020016040528060008152506126a3565b6109e282612ab9565b6000610a1560038363ffffffff612b9216565b3390565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061200382610c6b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000610a1582612b9e565b6000828260405160200161205c92919061380f565b60408051601f1981840301815291905280516020909101209392505050565b600061208682611fb7565b6120a25760405162461bcd60e51b815260040161092a90613c66565b60006120ad83610c6b565b9050806001600160a01b0316846001600160a01b031614806120e85750836001600160a01b03166120dd84610903565b6001600160a01b0316145b806120f857506120f88185611c66565b949350505050565b826001600160a01b031661211382610c6b565b6001600160a01b0316146121395760405162461bcd60e51b815260040161092a90613f89565b6001600160a01b03821661215f5760405162461bcd60e51b815260040161092a90613beb565b61216a8383836109e2565b612175600082611fce565b6001600160a01b038316600090815260026020526040902061219d908263ffffffff612ba216565b506001600160a01b03821660009081526002602052604090206121c6908263ffffffff612bae16565b506121d96003828463ffffffff612bba16565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000610a7b8383612bd0565b600080808061223b8686612c15565b9097909650945050505050565b6000806122558484612047565b6001600160a01b0385166000908152600e6020908152604080832054848452600f90925290912054919250908082116122945760009350505050610a15565b80820360006122a288612c71565b905060006064605a8302049050600060105482816122bc57fe5b069050600081830390506000601054670de0b6b3a76400008388670de0b6b3a76400008f63ffffffff16020202816122f057fe5b04816122f857fe5b049c9b505050505050505050505050565b7fe22fd0f090172bedb2987ffc9081056dcd23245cc377e9bafe94a3c3293defad5463ffffffff82166000818152600f602052604081205490929080821161235757600093505050506107c6565b601154601054828403916064605a9091020490600090828161237557fe5b069050600081830390506000601054670de0b6b3a76400008387670de0b6b3a76400008e63ffffffff16020202816123a957fe5b04816123b157fe5b049a9950505050505050505050565b6000606483106123cf57600080fd5b606482600a0a84606e0202816123e157fe5b049392505050565b6000806123f684846123c0565b600b9004949350505050565b611ba3828260405180602001604052806000815250612ce5565b60006120f8848484612d18565b6000805b6012548110156124aa57826001600160a01b03166012828154811061244e57fe5b60009182526020909120600290910201546001600160a01b031614156124a2576012818154811061247b57fe5b6000918252602090912060029091020154600160a01b900463ffffffff1691506107c69050565b60010161242d565b5060405162461bcd60e51b815260040161092a90613f5c565b60006060856001600160a01b03166323b872dd60e01b8686866040516024016124ee9392919061392c565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161252c919061383e565b6000604051808303816000865af19150503d8060008114612569576040519150601f19603f3d011682016040523d82523d6000602084013e61256e565b606091505b509150915081801561259857508051158061259857508080602001905181019061259891906136c7565b6112375760405162461bcd60e51b815260040161092a90613de3565b60006060846001600160a01b031663a9059cbb60e01b85856040516024016125dd929190613950565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161261b919061383e565b6000604051808303816000865af19150503d8060008114612658576040519150601f19603f3d011682016040523d82523d6000602084013e61265d565b606091505b509150915081801561268757508051158061268757508080602001905181019061268791906136c7565b610c645760405162461bcd60e51b815260040161092a90613d46565b6000828152600b602090815260408083208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152909392600d9261274a92918691908301828280156127405780601f1061271557610100808354040283529160200191612740565b820191906000526020600020905b81548152906001019060200180831161272357829003601f168201915b5050505050611326565b604051612757919061383e565b908152604051908190036020019020805491151560ff199092169190911790556001600d61278484611326565b604051612791919061383e565b9081526040805160209281900383019020805460ff1916931515939093179092556000858152600b82529190912083516127cd92850190613335565b506000838152600c6020526040808220805460ff191660011790555184917f52b0f09d5e06ee21b8d1a082ab8512eb231e91e32675ba31757e2b4affc805b191a2505050565b61281c83611ebf565b15612826576109e2565b600061283183612c71565b905061283f838330846124c3565b6001600160a01b0383166000908152600e60205260408120805460010190556010546064600a8402049182840391828161287557fe5b069050828101610d6f87610d5f611240565b61289082611ebf565b156128e25780156128dd576128a3611fca565b6001600160a01b03166108fc829081150290604051600060405180830381858888f193505050501580156128db573d6000803e3d6000fd5b505b611ba3565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6000908152600e6020527fe22fd0f090172bedb2987ffc9081056dcd23245cc377e9bafe94a3c3293defad805460010190556011546010546064600a83020492918390039190828161294557fe5b069050828101612953611240565b6001600160a01b03166108fc829081150290604051600060405180830381858888f1935050505015801561298b573d6000803e3d6000fd5b50505050505050565b61299f848484612100565b6129ab84848484612d77565b61123a5760405162461bcd60e51b815260040161092a90613b1c565b6060816129ec57506040805180820190915260018152600360fc1b60208201526107c6565b8160005b8115612a0457600101600a820491506129f0565b60608167ffffffffffffffff81118015612a1d57600080fd5b506040519080825280601f01601f191660200182016040528015612a48576020820181803683370190505b50859350905060001982015b8315612a9957600a840660300160f81b82828060019003935081518110612a7757fe5b60200101906001600160f81b031916908160001a905350600a84049350612a54565b50949350505050565b600060648310612ab157600080fd5b50600a0a0290565b6000612ac482610c6b565b9050612ad2816000846109e2565b612add600083611fce565b6000828152600960205260409020546002600019610100600184161502019091160415612b1b576000828152600960205260408120612b1b916133b3565b6001600160a01b0381166000908152600260205260409020612b43908363ffffffff612ba216565b50612b5560038363ffffffff612e5c16565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000610a7b8383612e68565b5490565b6000610a7b8383612e80565b6000610a7b8383612f46565b60006120f884846001600160a01b038516612f90565b81546000908210612bf35760405162461bcd60e51b815260040161092a90613ab2565b826000018281548110612c0257fe5b9060005260206000200154905092915050565b815460009081908310612c3a5760405162461bcd60e51b815260040161092a90613e13565b6000846000018481548110612c4b57fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b6000805b6012548110156124aa57826001600160a01b031660128281548110612c9657fe5b60009182526020909120600290910201546001600160a01b03161415612cdd5760128181548110612cc357fe5b9060005260206000209060020201600101549150506107c6565b600101612c75565b612cef8383613027565b612cfc6000848484612d77565b6109e25760405162461bcd60e51b815260040161092a90613b1c565b60008281526001840160205260408120548281612d485760405162461bcd60e51b815260040161092a9190613a9f565b50846000016001820381548110612d5b57fe5b9060005260206000209060020201600101549150509392505050565b6000612d8b846001600160a01b03166130f7565b612d97575060016120f8565b6060612e25630a85bd0160e11b612dac611fca565b888787604051602401612dc294939291906138ef565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505060405180606001604052806032815260200161420d603291396001600160a01b038816919063ffffffff6130fd16565b9050600081806020019051810190612e3d91906136ff565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b6000610a7b838361310c565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015612f3c5783546000198083019190810190600090879083908110612eb357fe5b9060005260206000200154905080876000018481548110612ed057fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612f0057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610a15565b6000915050610a15565b6000612f528383612e68565b612f8857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a15565b506000610a15565b600082815260018401602052604081205480612ff5575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055610a7b565b8285600001600183038154811061300857fe5b9060005260206000209060020201600101819055506000915050610a7b565b6001600160a01b03821661304d5760405162461bcd60e51b815260040161092a90613e7d565b61305681611fb7565b156130735760405162461bcd60e51b815260040161092a90613bb4565b61307f600083836109e2565b6001600160a01b03821660009081526002602052604090206130a7908263ffffffff612bae16565b506130ba6003828463ffffffff612bba16565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b60606120f884846000856131e0565b60008181526001830160205260408120548015612f3c578354600019808301919081019060009087908390811061313f57fe5b906000526020600020906002020190508087600001848154811061315f57fe5b60009182526020808320845460029093020191825560019384015491840191909155835482528983019052604090209084019055865487908061319e57fe5b6000828152602080822060026000199094019384020182815560019081018390559290935588815289820190925260408220919091559450610a159350505050565b60606131eb856130f7565b6132075760405162461bcd60e51b815260040161092a90614131565b60006060866001600160a01b03168587604051613224919061383e565b60006040518083038185875af1925050503d8060008114613261576040519150601f19603f3d011682016040523d82523d6000602084013e613266565b606091505b5091509150811561327a5791506120f89050565b80511561328a5780518082602001fd5b8360405162461bcd60e51b815260040161092a9190613a9f565b60405180610c8001604052806064905b6132bc6132d2565b8152602001906001900390816132b45790505090565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c082015260e081019190915290565b604080516060810182526000808252602082018190529181019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061337657805160ff19168380011785556133a3565b828001600101855582156133a3579182015b828111156133a3578251825591602001919060010190613388565b506133af9291506133f3565b5090565b50805460018160011615610100020316600290046000825580601f106133d95750611990565b601f01602090049060005260206000209081019061199091905b61090091905b808211156133af57600081556001016133f9565b80356001600160a01b0381168114610a1557600080fd5b600082601f830112613434578081fd5b813567ffffffffffffffff8082111561344b578283fd5b604051601f8301601f19168101602001828111828210171561346b578485fd5b60405282815292508284830160200186101561348657600080fd5b8260208601602083013760006020848301015250505092915050565b803563ffffffff81168114610a1557600080fd5b6000602082840312156134c7578081fd5b610a7b838361340d565b600080604083850312156134e3578081fd5b6134ed848461340d565b91506134fc846020850161340d565b90509250929050565b600080600060608486031215613519578081fd5b8335613524816141c1565b92506020840135613534816141c1565b929592945050506040919091013590565b6000806000806080858703121561355a578081fd5b613564868661340d565b9350613573866020870161340d565b925060408501359150606085013567ffffffffffffffff811115613595578182fd5b6135a187828801613424565b91505092959194509250565b600080604083850312156135bf578182fd5b6135c9848461340d565b915060208301356135d9816141d6565b809150509250929050565b600080604083850312156135f6578182fd5b613600848461340d565b946020939093013593505050565b60008060408385031215613620578182fd5b61362a848461340d565b91506134fc84602085016134a2565b60008060006060848603121561364d578283fd5b613657858561340d565b925061366685602086016134a2565b9150604084013567ffffffffffffffff811115613681578182fd5b61368d86828701613424565b9150509250925092565b600080600080608085870312156136ac578384fd5b84356136b7816141c1565b93506020850135613573816141fa565b6000602082840312156136d8578081fd5b8151610a7b816141d6565b6000602082840312156136f4578081fd5b8135610a7b816141e4565b600060208284031215613710578081fd5b8151610a7b816141e4565b60006020828403121561372c578081fd5b813567ffffffffffffffff811115613742578182fd5b6120f884828501613424565b60006020828403121561375f578081fd5b5035919050565b600060208284031215613777578081fd5b8135610a7b816141fa565b60008060408385031215613794578182fd5b823561379f816141fa565b9150602083013567ffffffffffffffff8111156137ba578182fd5b6137c685828601613424565b9150509250929050565b6001600160a01b03169052565b15159052565b600081518084526137fb816020860160208601614195565b601f01601f19169290920160200192915050565b60609290921b6bffffffffffffffffffffffff1916825260e01b6001600160e01b031916601482015260180190565b60008251613850818460208701614195565b9190910192915050565b60008084546001808216600081146138795760018114613890576138bf565b60ff198316865260028304607f16860193506138bf565b600283048886526020808720875b838110156138b75781548a82015290850190820161389e565b505050860193505b50505083516138d2818360208801614195565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613922908301846137e3565b9695505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b602080825282518282018190526000919060409081850190868401855b828110156139c457815180516001600160a01b031685528681015163ffffffff16878601528501518585015260609093019290850190600101613986565b5091979650505050505050565b6020808252600090610ca0830183820185845b6064811015613a8857601f1987850301835281516101008151151586528682015187870152604080830151613a1b828901826137d0565b5050606082810151908701526080808301519087015260a080830151613a43828901826137dd565b505060c0808301518282890152613a5c838901826137e3565b91505060e0915081830151613a73838901826137d0565b509550505091840191908401906001016139e4565b50919695505050505050565b901515815260200190565b600060208252610a7b60208301846137e3565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252600e908201526d105b1c9958591e481b5a5b9d195960921b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526018908201527f4e616d6520616c72656164792074616b656e20736f7272790000000000000000604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252601290820152712330b4b632b2103a37903a3930b739b332b960711b604082015260600190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b6020808252600d908201526c26bab9ba1031329037bbb732b960991b604082015260600190565b6020808252601690820152754661696c656420746f207472616e7366657246726f6d60501b604082015260600190565b60208082526022908201527f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252600e908201526d26bab9ba1031329037bbb732b91760911b604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252600f908201526e24b73b30b634b21035373ab6b132b960891b604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260139082015272151bdad95b881b9bdd081cdd5c1c1bdc9d1959606a1b604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601e908201527f496e636f7272656374206574682073656e7420666f72206a4e756d6265720000604082015260600190565b60208082526027908201527f496e76616c6964206e616d652e204d75737420626520312d31302041534349496040820152661031b430b9399760c91b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252600a9082015269139bdd081b5a5b9d195960b21b604082015260600190565b90815260200190565b60005b838110156141b0578181015183820152602001614198565b8381111561123a5750506000910152565b6001600160a01b038116811461199057600080fd5b801515811461199057600080fd5b6001600160e01b03198116811461199057600080fd5b63ffffffff8116811461199057600080fdfe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea2646970667358221220781c816dc11f13d8a89ab8fb49aa170fbdbe0abd923016936cd0d81b906532d264736f6c634300060700334552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465720000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f63727970746f6a6572736579732e696f2f6d657461646174612f000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061025c5760003560e01c8063715018a611610144578063b64bf7d7116100b6578063e0c622691161007a578063e0c62269146106f3578063e985e9c514610713578063ef48770e14610733578063f2fde38b14610748578063f69857b014610768578063f7e41aad146107885761025c565b8063b64bf7d714610653578063b88d4fde14610673578063c7c14e8014610693578063c87b56dd146106b3578063ded578a4146106d35761025c565b806393b6539a1161010857806393b6539a146105ab5780639416b423146105cb57806395d89b41146105eb5780639ecfae54146106005780639ffdb65a14610613578063a22cb465146106335761025c565b8063715018a6146105145780637d0f7ed51461052957806382bbdbec146105565780638a4aac55146105765780638da5cb5b146105965761025c565b806342842e0e116101dd5780635cf5d07e116101a15780635cf5d07e1461046c5780635e30865e1461048c5780636352211e1461049f57806365573a8f146104bf5780636c0360eb146104df57806370a08231146104f45761025c565b806342842e0e146103cc578063474af593146103ec5780634f558e791461040c5780634f6ccce71461042c5780635007eec11461044c5761025c565b806318160ddd1161022457806318160ddd1461032857806318a0ed751461034a57806323b872dd1461036a5780632f745c591461038a578063305918fd146103aa5761025c565b806301ffc9a714610261578063051a26641461029757806306fdde03146102c4578063081812fc146102d9578063095ea7b314610306575b600080fd5b34801561026d57600080fd5b5061028161027c3660046136e3565b6107a8565b60405161028e9190613a94565b60405180910390f35b3480156102a357600080fd5b506102b76102b236600461374e565b6107cb565b60405161028e9190613a9f565b3480156102d057600080fd5b506102b761086c565b3480156102e557600080fd5b506102f96102f436600461374e565b610903565b60405161028e91906138db565b34801561031257600080fd5b506103266103213660046135e4565b61094f565b005b34801561033457600080fd5b5061033d6109e7565b60405161028e919061418c565b34801561035657600080fd5b5061028161036536600461360e565b6109f8565b34801561037657600080fd5b50610326610385366004613505565b610a1b565b34801561039657600080fd5b5061033d6103a53660046135e4565b610a53565b3480156103b657600080fd5b506103bf610a82565b60405161028e9190613969565b3480156103d857600080fd5b506103266103e7366004613505565b610b0c565b3480156103f857600080fd5b50610281610407366004613766565b610b27565b34801561041857600080fd5b5061028161042736600461374e565b610b3f565b34801561043857600080fd5b5061033d61044736600461374e565b610b4a565b34801561045857600080fd5b5061033d61046736600461360e565b610b66565b34801561047857600080fd5b5061033d610487366004613766565b610b72565b61032661049a36600461374e565b610b7d565b3480156104ab57600080fd5b506102f96104ba36600461374e565b610c6b565b3480156104cb57600080fd5b506103266104da36600461360e565b610c99565b3480156104eb57600080fd5b506102b7610d79565b34801561050057600080fd5b5061033d61050f3660046134b6565b610dda565b34801561052057600080fd5b50610326610e23565b34801561053557600080fd5b506105496105443660046134b6565b610ea2565b60405161028e91906139d1565b34801561056257600080fd5b5061028161057136600461371b565b61101f565b34801561058257600080fd5b50610326610591366004613697565b611054565b3480156105a257600080fd5b506102f9611240565b3480156105b757600080fd5b506103266105c6366004613639565b61124f565b3480156105d757600080fd5b506102b76105e636600461371b565b611326565b3480156105f757600080fd5b506102b7611448565b61032661060e366004613782565b6114a9565b34801561061f57600080fd5b5061028161062e36600461371b565b611579565b34801561063f57600080fd5b5061032661064e3660046135ad565b61176b565b34801561065f57600080fd5b5061032661066e36600461374e565b611839565b34801561067f57600080fd5b5061032661068e366004613545565b61187d565b34801561069f57600080fd5b506103266106ae366004613766565b6118b6565b3480156106bf57600080fd5b506102b76106ce36600461374e565b611993565b3480156106df57600080fd5b506103266106ee36600461360e565b611add565b3480156106ff57600080fd5b5061032661070e36600461360e565b611ba7565b34801561071f57600080fd5b5061028161072e3660046134d1565b611c66565b34801561073f57600080fd5b50610549611c94565b34801561075457600080fd5b506103266107633660046134b6565b611e09565b34801561077457600080fd5b5061028161078336600461374e565b611ebf565b34801561079457600080fd5b506103266107a3366004613766565b611ed5565b6001600160e01b0319811660009081526001602052604090205460ff165b919050565b6000818152600b602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156108605780601f1061083557610100808354040283529160200191610860565b820191906000526020600020905b81548152906001019060200180831161084357829003601f168201915b50505050509050919050565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108f85780601f106108cd576101008083540402835291602001916108f8565b820191906000526020600020905b8154815290600101906020018083116108db57829003601f168201915b505050505090505b90565b600061090e82611fb7565b6109335760405162461bcd60e51b815260040161092a90613edb565b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061095a82610c6b565b9050806001600160a01b0316836001600160a01b0316141561098e5760405162461bcd60e51b815260040161092a90614021565b806001600160a01b03166109a0611fca565b6001600160a01b031614806109bc57506109bc8161072e611fca565b6109d85760405162461bcd60e51b815260040161092a90613ce9565b6109e28383611fce565b505050565b60006109f3600361203c565b905090565b600080610a058484612047565b9050610a1081611ebf565b159150505b92915050565b610a2c610a26611fca565b8261207b565b610a485760405162461bcd60e51b815260040161092a90614062565b6109e2838383612100565b6001600160a01b0382166000908152600260205260408120610a7b908363ffffffff61222016565b9392505050565b60606012805480602002602001604051908101604052809291908181526020016000905b82821015610b03576000848152602090819020604080516060810182526002860290920180546001600160a01b0381168452600160a01b900463ffffffff1683850152600190810154918301919091529083529092019101610aa6565b50505050905090565b6109e28383836040518060200160405280600081525061187d565b6000610b388263ffffffff16611ebf565b1592915050565b6000610a1582611fb7565b600080610b5e60038463ffffffff61222c16565b509392505050565b6000610a7b8383612248565b6000610a1582612309565b6000610b87611fca565b9050606482108015610b995750600082115b610bb55760405162461bcd60e51b815260040161092a90613eb2565b610bbe82611fb7565b15610bdb5760405162461bcd60e51b815260040161092a90613af4565b6000610be88360126123c0565b905034808214610c0a5760405162461bcd60e51b815260040161092a906140b3565b6000610c178560126123e9565b9050610c21611240565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610c59573d6000803e3d6000fd5b50610c648486612402565b5050505050565b6000610a158260405180606001604052806029815260200161423f602991396003919063ffffffff61241c16565b6000610ca3611fca565b90506000610cb18484612047565b905030606463ffffffff8516108015610cd0575060008463ffffffff16115b610cec5760405162461bcd60e51b815260040161092a90613eb2565b610cf582611fb7565b15610d125760405162461bcd60e51b815260040161092a90613af4565b6000610d1d86612429565b90506000610d318663ffffffff16836123c0565b9050610d3f878685846124c3565b6000610d518763ffffffff16846123e9565b9050610d6588610d5f611240565b836125b4565b610d6f8686612402565b5050505050505050565b600a8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108f85780601f106108cd576101008083540402835291602001916108f8565b60006001600160a01b038216610e025760405162461bcd60e51b815260040161092a90613d72565b6001600160a01b0382166000908152600260205260409020610a159061203c565b610e2b611fca565b6000546001600160a01b03908116911614610e585760405162461bcd60e51b815260040161092a90613f27565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610eaa6132a4565b610eb26132a4565b60005b60648163ffffffff161015611018576000610ed08583612047565b9050610edb81611fb7565b15610f7f57610ee86132d2565b604051806101000160405280600115158152602001838152602001876001600160a01b031681526020018463ffffffff168152602001610f288886610b66565b8152602001610f3684611ebf565b15158152602001610f46846107cb565b8152602001610f5484610c6b565b6001600160a01b031690529050808463ffffffff851660648110610f7457fe5b60200201525061100f565b610f876132d2565b604051806101000160405280600015158152602001838152602001876001600160a01b031681526020018463ffffffff168152602001610fc78886610b66565b8152602001610fd584611ebf565b1515815260408051602081810183526000808352908401919091529101529050808463ffffffff85166064811061100857fe5b6020020152505b50600101610eb5565b5092915050565b6000600d61102c83611326565b604051611039919061383e565b9081526040519081900360200190205460ff16159050919050565b61105c611fca565b6001600160a01b031661106d611240565b6001600160a01b0316146110935760405162461bcd60e51b815260040161092a90613dbc565b60005b60125481101561114557846001600160a01b0316601282815481106110b757fe5b60009182526020909120600290910201546001600160a01b0316141561113d5783601282815481106110e557fe5b906000526020600020906002020160000160146101000a81548163ffffffff021916908363ffffffff160217905550826012828154811061112257fe5b9060005260206000209060020201600101819055505061123a565b600101611096565b5061114e613315565b50604080516060810182526001600160a01b03808716825263ffffffff80871660208401908152938301868152601280546001810182556000918252855160029091027fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444810180549851909516600160a01b0263ffffffff60a01b19929096166001600160a01b0319909816979097171693909317909155517fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3445909301929092559061121a8682612047565b905061122d611227611240565b82612402565b61123781846126a3565b50505b50505050565b6000546001600160a01b031690565b600061125b8484612047565b9050600061126882610c6b565b905061127382611fb7565b61128f5760405162461bcd60e51b815260040161092a90614168565b611297611fca565b6001600160a01b0316816001600160a01b0316146112c75760405162461bcd60e51b815260040161092a90613dbc565b6112d083611579565b6112ec5760405162461bcd60e51b815260040161092a906140ea565b6112f58361101f565b6113115760405162461bcd60e51b815260040161092a90613cb2565b61131c828683612813565b610c6482846126a3565b6060808290506060815167ffffffffffffffff8111801561134657600080fd5b506040519080825280601f01601f191660200182016040528015611371576020820181803683370190505b50905060005b8251811015610b5e57604183828151811061138e57fe5b016020015160f81c108015906113b85750605a8382815181106113ad57fe5b016020015160f81c11155b15611405578281815181106113c957fe5b602001015160f81c60f81b60f81c60200160f81b8282815181106113e957fe5b60200101906001600160f81b031916908160001a905350611440565b82818151811061141157fe5b602001015160f81c60f81b82828151811061142857fe5b60200101906001600160f81b031916908160001a9053505b600101611377565b60088054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108f85780601f106108cd576101008083540402835291602001916108f8565b63ffffffff821660006114bb82610c6b565b90506114c682611fb7565b6114e25760405162461bcd60e51b815260040161092a90614168565b6114ea611fca565b6001600160a01b0316816001600160a01b03161461151a5760405162461bcd60e51b815260040161092a90613dbc565b61152383611579565b61153f5760405162461bcd60e51b815260040161092a906140ea565b6115488361101f565b6115645760405162461bcd60e51b815260040161092a90613cb2565b3461156f8382612887565b610c6483856126a3565b8051600090600a90839060011115611596576000925050506107c6565b81815111156115aa576000925050506107c6565b806000815181106115b757fe5b6020910101516001600160f81b031916600160fd1b14156115dd576000925050506107c6565b806001825103815181106115ed57fe5b6020910101516001600160f81b031916600160fd1b1415611613576000925050506107c6565b60008160008151811061162257fe5b01602001516001600160f81b031916905060005b825181101561175f57600083828151811061164d57fe5b01602001516001600160f81b0319169050600160fd1b8114801561167e5750600160fd1b6001600160f81b03198416145b15611691576000955050505050506107c6565b600360fc1b6001600160f81b03198216108015906116bd5750603960f81b6001600160f81b0319821611155b1580156116f35750604160f81b6001600160f81b03198216108015906116f15750602d60f91b6001600160f81b0319821611155b155b80156117285750606160f81b6001600160f81b03198216108015906117265750603d60f91b6001600160f81b0319821611155b155b80156117425750600160fd1b6001600160f81b0319821614155b15611755576000955050505050506107c6565b9150600101611636565b50600195945050505050565b611773611fca565b6001600160a01b0316826001600160a01b031614156117a45760405162461bcd60e51b815260040161092a90613c2f565b80600660006117b1611fca565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556117f5611fca565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161182d9190613a94565b60405180910390a35050565b611841611fca565b6001600160a01b0316611852611240565b6001600160a01b0316146118785760405162461bcd60e51b815260040161092a90613dbc565b601155565b61188e611888611fca565b8361207b565b6118aa5760405162461bcd60e51b815260040161092a90614062565b61123a84848484612994565b6118be611fca565b6001600160a01b03166118d68263ffffffff16610c6b565b6001600160a01b0316146118fc5760405162461bcd60e51b815260040161092a90613e55565b6000611906611fca565b9050600061191383612309565b905080611921575050611990565b7fe22fd0f090172bedb2987ffc9081056dcd23245cc377e9bafe94a3c3293defad5463ffffffff84166000908152600f60205260408082209290925590516001600160a01b0384169183156108fc02918491818181858888f1935050505015801561123a573d6000803e3d6000fd5b50565b606061199e82611fb7565b6119ba5760405162461bcd60e51b815260040161092a90613fd2565b60008281526009602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015611a4f5780601f10611a2457610100808354040283529160200191611a4f565b820191906000526020600020905b815481529060010190602001808311611a3257829003601f168201915b5050600a5493945050505060026000196101006001841615020190911604611a785790506107c6565b805115611aaa57600a81604051602001611a9392919061385a565b6040516020818303038152906040529150506107c6565b600a611ab5846129c7565b604051602001611ac692919061385a565b604051602081830303815290604052915050919050565b6000611ae98383612047565b9050611af481611fb7565b611b105760405162461bcd60e51b815260040161092a90614168565b6000611b1b82610c6b565b9050611b25611fca565b6001600160a01b0316816001600160a01b031614611b555760405162461bcd60e51b815260040161092a90613e55565b6000611b618585612248565b905080611b7057505050611ba3565b6001600160a01b0385166000908152600e6020908152604080832054868452600f90925290912055610c648583836125b4565b5050565b6000611bb38383612047565b9050611bbe81611fb7565b611bda5760405162461bcd60e51b815260040161092a90614168565b611be2611fca565b6001600160a01b0316611bf482610c6b565b6001600160a01b031614611c1a5760405162461bcd60e51b815260040161092a90613e55565b611c4483611c2783610c6b565b611c3f8563ffffffff16611c3a88612429565b612aa2565b6125b4565b611c5d81604051806020016040528060008152506126a3565b6109e281612ab9565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b611c9c6132a4565b611ca46132a4565b60005b60648163ffffffff161015611e035763ffffffff8116611cc681611fb7565b15611d6a57611cd36132d2565b60405180610100016040528060011515815260200183815260200160006001600160a01b031681526020018463ffffffff168152602001611d1385610b72565b8152602001611d2184611ebf565b15158152602001611d31846107cb565b8152602001611d3f84610c6b565b6001600160a01b031690529050808463ffffffff851660648110611d5f57fe5b602002015250611dfa565b611d726132d2565b60405180610100016040528060001515815260200183815260200160006001600160a01b031681526020018463ffffffff168152602001611db285610b72565b8152602001611dc084611ebf565b1515815260408051602081810183526000808352908401919091529101529050808463ffffffff851660648110611df357fe5b6020020152505b50600101611ca7565b50905090565b611e11611fca565b6000546001600160a01b03908116911614611e3e5760405162461bcd60e51b815260040161092a90613f27565b6001600160a01b038116611e645760405162461bcd60e51b815260040161092a90613b6e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000908152600c602052604090205460ff161590565b63ffffffff8116611ee581611fb7565b611f015760405162461bcd60e51b815260040161092a90614168565b611f09611fca565b6001600160a01b0316611f1b82610c6b565b6001600160a01b031614611f415760405162461bcd60e51b815260040161092a90613e55565b6000611f4c82610c6b565b9050806001600160a01b03166108fc611f6c8563ffffffff166012612aa2565b6040518115909202916000818181858888f19350505050158015611f94573d6000803e3d6000fd5b50611fae82604051806020016040528060008152506126a3565b6109e282612ab9565b6000610a1560038363ffffffff612b9216565b3390565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061200382610c6b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000610a1582612b9e565b6000828260405160200161205c92919061380f565b60408051601f1981840301815291905280516020909101209392505050565b600061208682611fb7565b6120a25760405162461bcd60e51b815260040161092a90613c66565b60006120ad83610c6b565b9050806001600160a01b0316846001600160a01b031614806120e85750836001600160a01b03166120dd84610903565b6001600160a01b0316145b806120f857506120f88185611c66565b949350505050565b826001600160a01b031661211382610c6b565b6001600160a01b0316146121395760405162461bcd60e51b815260040161092a90613f89565b6001600160a01b03821661215f5760405162461bcd60e51b815260040161092a90613beb565b61216a8383836109e2565b612175600082611fce565b6001600160a01b038316600090815260026020526040902061219d908263ffffffff612ba216565b506001600160a01b03821660009081526002602052604090206121c6908263ffffffff612bae16565b506121d96003828463ffffffff612bba16565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000610a7b8383612bd0565b600080808061223b8686612c15565b9097909650945050505050565b6000806122558484612047565b6001600160a01b0385166000908152600e6020908152604080832054848452600f90925290912054919250908082116122945760009350505050610a15565b80820360006122a288612c71565b905060006064605a8302049050600060105482816122bc57fe5b069050600081830390506000601054670de0b6b3a76400008388670de0b6b3a76400008f63ffffffff16020202816122f057fe5b04816122f857fe5b049c9b505050505050505050505050565b7fe22fd0f090172bedb2987ffc9081056dcd23245cc377e9bafe94a3c3293defad5463ffffffff82166000818152600f602052604081205490929080821161235757600093505050506107c6565b601154601054828403916064605a9091020490600090828161237557fe5b069050600081830390506000601054670de0b6b3a76400008387670de0b6b3a76400008e63ffffffff16020202816123a957fe5b04816123b157fe5b049a9950505050505050505050565b6000606483106123cf57600080fd5b606482600a0a84606e0202816123e157fe5b049392505050565b6000806123f684846123c0565b600b9004949350505050565b611ba3828260405180602001604052806000815250612ce5565b60006120f8848484612d18565b6000805b6012548110156124aa57826001600160a01b03166012828154811061244e57fe5b60009182526020909120600290910201546001600160a01b031614156124a2576012818154811061247b57fe5b6000918252602090912060029091020154600160a01b900463ffffffff1691506107c69050565b60010161242d565b5060405162461bcd60e51b815260040161092a90613f5c565b60006060856001600160a01b03166323b872dd60e01b8686866040516024016124ee9392919061392c565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161252c919061383e565b6000604051808303816000865af19150503d8060008114612569576040519150601f19603f3d011682016040523d82523d6000602084013e61256e565b606091505b509150915081801561259857508051158061259857508080602001905181019061259891906136c7565b6112375760405162461bcd60e51b815260040161092a90613de3565b60006060846001600160a01b031663a9059cbb60e01b85856040516024016125dd929190613950565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161261b919061383e565b6000604051808303816000865af19150503d8060008114612658576040519150601f19603f3d011682016040523d82523d6000602084013e61265d565b606091505b509150915081801561268757508051158061268757508080602001905181019061268791906136c7565b610c645760405162461bcd60e51b815260040161092a90613d46565b6000828152600b602090815260408083208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152909392600d9261274a92918691908301828280156127405780601f1061271557610100808354040283529160200191612740565b820191906000526020600020905b81548152906001019060200180831161272357829003601f168201915b5050505050611326565b604051612757919061383e565b908152604051908190036020019020805491151560ff199092169190911790556001600d61278484611326565b604051612791919061383e565b9081526040805160209281900383019020805460ff1916931515939093179092556000858152600b82529190912083516127cd92850190613335565b506000838152600c6020526040808220805460ff191660011790555184917f52b0f09d5e06ee21b8d1a082ab8512eb231e91e32675ba31757e2b4affc805b191a2505050565b61281c83611ebf565b15612826576109e2565b600061283183612c71565b905061283f838330846124c3565b6001600160a01b0383166000908152600e60205260408120805460010190556010546064600a8402049182840391828161287557fe5b069050828101610d6f87610d5f611240565b61289082611ebf565b156128e25780156128dd576128a3611fca565b6001600160a01b03166108fc829081150290604051600060405180830381858888f193505050501580156128db573d6000803e3d6000fd5b505b611ba3565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6000908152600e6020527fe22fd0f090172bedb2987ffc9081056dcd23245cc377e9bafe94a3c3293defad805460010190556011546010546064600a83020492918390039190828161294557fe5b069050828101612953611240565b6001600160a01b03166108fc829081150290604051600060405180830381858888f1935050505015801561298b573d6000803e3d6000fd5b50505050505050565b61299f848484612100565b6129ab84848484612d77565b61123a5760405162461bcd60e51b815260040161092a90613b1c565b6060816129ec57506040805180820190915260018152600360fc1b60208201526107c6565b8160005b8115612a0457600101600a820491506129f0565b60608167ffffffffffffffff81118015612a1d57600080fd5b506040519080825280601f01601f191660200182016040528015612a48576020820181803683370190505b50859350905060001982015b8315612a9957600a840660300160f81b82828060019003935081518110612a7757fe5b60200101906001600160f81b031916908160001a905350600a84049350612a54565b50949350505050565b600060648310612ab157600080fd5b50600a0a0290565b6000612ac482610c6b565b9050612ad2816000846109e2565b612add600083611fce565b6000828152600960205260409020546002600019610100600184161502019091160415612b1b576000828152600960205260408120612b1b916133b3565b6001600160a01b0381166000908152600260205260409020612b43908363ffffffff612ba216565b50612b5560038363ffffffff612e5c16565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000610a7b8383612e68565b5490565b6000610a7b8383612e80565b6000610a7b8383612f46565b60006120f884846001600160a01b038516612f90565b81546000908210612bf35760405162461bcd60e51b815260040161092a90613ab2565b826000018281548110612c0257fe5b9060005260206000200154905092915050565b815460009081908310612c3a5760405162461bcd60e51b815260040161092a90613e13565b6000846000018481548110612c4b57fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b6000805b6012548110156124aa57826001600160a01b031660128281548110612c9657fe5b60009182526020909120600290910201546001600160a01b03161415612cdd5760128181548110612cc357fe5b9060005260206000209060020201600101549150506107c6565b600101612c75565b612cef8383613027565b612cfc6000848484612d77565b6109e25760405162461bcd60e51b815260040161092a90613b1c565b60008281526001840160205260408120548281612d485760405162461bcd60e51b815260040161092a9190613a9f565b50846000016001820381548110612d5b57fe5b9060005260206000209060020201600101549150509392505050565b6000612d8b846001600160a01b03166130f7565b612d97575060016120f8565b6060612e25630a85bd0160e11b612dac611fca565b888787604051602401612dc294939291906138ef565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505060405180606001604052806032815260200161420d603291396001600160a01b038816919063ffffffff6130fd16565b9050600081806020019051810190612e3d91906136ff565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b6000610a7b838361310c565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015612f3c5783546000198083019190810190600090879083908110612eb357fe5b9060005260206000200154905080876000018481548110612ed057fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612f0057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610a15565b6000915050610a15565b6000612f528383612e68565b612f8857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a15565b506000610a15565b600082815260018401602052604081205480612ff5575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055610a7b565b8285600001600183038154811061300857fe5b9060005260206000209060020201600101819055506000915050610a7b565b6001600160a01b03821661304d5760405162461bcd60e51b815260040161092a90613e7d565b61305681611fb7565b156130735760405162461bcd60e51b815260040161092a90613bb4565b61307f600083836109e2565b6001600160a01b03821660009081526002602052604090206130a7908263ffffffff612bae16565b506130ba6003828463ffffffff612bba16565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b60606120f884846000856131e0565b60008181526001830160205260408120548015612f3c578354600019808301919081019060009087908390811061313f57fe5b906000526020600020906002020190508087600001848154811061315f57fe5b60009182526020808320845460029093020191825560019384015491840191909155835482528983019052604090209084019055865487908061319e57fe5b6000828152602080822060026000199094019384020182815560019081018390559290935588815289820190925260408220919091559450610a159350505050565b60606131eb856130f7565b6132075760405162461bcd60e51b815260040161092a90614131565b60006060866001600160a01b03168587604051613224919061383e565b60006040518083038185875af1925050503d8060008114613261576040519150601f19603f3d011682016040523d82523d6000602084013e613266565b606091505b5091509150811561327a5791506120f89050565b80511561328a5780518082602001fd5b8360405162461bcd60e51b815260040161092a9190613a9f565b60405180610c8001604052806064905b6132bc6132d2565b8152602001906001900390816132b45790505090565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c082015260e081019190915290565b604080516060810182526000808252602082018190529181019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061337657805160ff19168380011785556133a3565b828001600101855582156133a3579182015b828111156133a3578251825591602001919060010190613388565b506133af9291506133f3565b5090565b50805460018160011615610100020316600290046000825580601f106133d95750611990565b601f01602090049060005260206000209081019061199091905b61090091905b808211156133af57600081556001016133f9565b80356001600160a01b0381168114610a1557600080fd5b600082601f830112613434578081fd5b813567ffffffffffffffff8082111561344b578283fd5b604051601f8301601f19168101602001828111828210171561346b578485fd5b60405282815292508284830160200186101561348657600080fd5b8260208601602083013760006020848301015250505092915050565b803563ffffffff81168114610a1557600080fd5b6000602082840312156134c7578081fd5b610a7b838361340d565b600080604083850312156134e3578081fd5b6134ed848461340d565b91506134fc846020850161340d565b90509250929050565b600080600060608486031215613519578081fd5b8335613524816141c1565b92506020840135613534816141c1565b929592945050506040919091013590565b6000806000806080858703121561355a578081fd5b613564868661340d565b9350613573866020870161340d565b925060408501359150606085013567ffffffffffffffff811115613595578182fd5b6135a187828801613424565b91505092959194509250565b600080604083850312156135bf578182fd5b6135c9848461340d565b915060208301356135d9816141d6565b809150509250929050565b600080604083850312156135f6578182fd5b613600848461340d565b946020939093013593505050565b60008060408385031215613620578182fd5b61362a848461340d565b91506134fc84602085016134a2565b60008060006060848603121561364d578283fd5b613657858561340d565b925061366685602086016134a2565b9150604084013567ffffffffffffffff811115613681578182fd5b61368d86828701613424565b9150509250925092565b600080600080608085870312156136ac578384fd5b84356136b7816141c1565b93506020850135613573816141fa565b6000602082840312156136d8578081fd5b8151610a7b816141d6565b6000602082840312156136f4578081fd5b8135610a7b816141e4565b600060208284031215613710578081fd5b8151610a7b816141e4565b60006020828403121561372c578081fd5b813567ffffffffffffffff811115613742578182fd5b6120f884828501613424565b60006020828403121561375f578081fd5b5035919050565b600060208284031215613777578081fd5b8135610a7b816141fa565b60008060408385031215613794578182fd5b823561379f816141fa565b9150602083013567ffffffffffffffff8111156137ba578182fd5b6137c685828601613424565b9150509250929050565b6001600160a01b03169052565b15159052565b600081518084526137fb816020860160208601614195565b601f01601f19169290920160200192915050565b60609290921b6bffffffffffffffffffffffff1916825260e01b6001600160e01b031916601482015260180190565b60008251613850818460208701614195565b9190910192915050565b60008084546001808216600081146138795760018114613890576138bf565b60ff198316865260028304607f16860193506138bf565b600283048886526020808720875b838110156138b75781548a82015290850190820161389e565b505050860193505b50505083516138d2818360208801614195565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613922908301846137e3565b9695505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b602080825282518282018190526000919060409081850190868401855b828110156139c457815180516001600160a01b031685528681015163ffffffff16878601528501518585015260609093019290850190600101613986565b5091979650505050505050565b6020808252600090610ca0830183820185845b6064811015613a8857601f1987850301835281516101008151151586528682015187870152604080830151613a1b828901826137d0565b5050606082810151908701526080808301519087015260a080830151613a43828901826137dd565b505060c0808301518282890152613a5c838901826137e3565b91505060e0915081830151613a73838901826137d0565b509550505091840191908401906001016139e4565b50919695505050505050565b901515815260200190565b600060208252610a7b60208301846137e3565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252600e908201526d105b1c9958591e481b5a5b9d195960921b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526018908201527f4e616d6520616c72656164792074616b656e20736f7272790000000000000000604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252601290820152712330b4b632b2103a37903a3930b739b332b960711b604082015260600190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b6020808252600d908201526c26bab9ba1031329037bbb732b960991b604082015260600190565b6020808252601690820152754661696c656420746f207472616e7366657246726f6d60501b604082015260600190565b60208082526022908201527f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252600e908201526d26bab9ba1031329037bbb732b91760911b604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252600f908201526e24b73b30b634b21035373ab6b132b960891b604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260139082015272151bdad95b881b9bdd081cdd5c1c1bdc9d1959606a1b604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601e908201527f496e636f7272656374206574682073656e7420666f72206a4e756d6265720000604082015260600190565b60208082526027908201527f496e76616c6964206e616d652e204d75737420626520312d31302041534349496040820152661031b430b9399760c91b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252600a9082015269139bdd081b5a5b9d195960b21b604082015260600190565b90815260200190565b60005b838110156141b0578181015183820152602001614198565b8381111561123a5750506000910152565b6001600160a01b038116811461199057600080fd5b801515811461199057600080fd5b6001600160e01b03198116811461199057600080fd5b63ffffffff8116811461199057600080fdfe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea2646970667358221220781c816dc11f13d8a89ab8fb49aa170fbdbe0abd923016936cd0d81b906532d264736f6c63430006070033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f63727970746f6a6572736579732e696f2f6d657461646174612f000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : baseURI (string): https://cryptojerseys.io/metadata/
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000022
Arg [2] : 68747470733a2f2f63727970746f6a6572736579732e696f2f6d657461646174
Arg [3] : 612f000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$2,119.48
Net Worth in ETH
1.002428
Token Allocations
ETH
99.73%
UNI
0.19%
RENDOGE
0.07%
Others
0.01%
Multichain Portfolio | 33 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.