Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 310 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 19686804 | 646 days ago | IN | 0 ETH | 0.00029474 | ||||
| Safe Transfer Fr... | 18304856 | 840 days ago | IN | 0 ETH | 0.0005725 | ||||
| Transfer From | 17073549 | 1013 days ago | IN | 0 ETH | 0.00360624 | ||||
| Set Approval For... | 16471029 | 1097 days ago | IN | 0 ETH | 0.00067332 | ||||
| Set Approval For... | 16471028 | 1097 days ago | IN | 0 ETH | 0.00061444 | ||||
| Set Approval For... | 16352919 | 1114 days ago | IN | 0 ETH | 0.00038126 | ||||
| Set Approval For... | 16287705 | 1123 days ago | IN | 0 ETH | 0.00060385 | ||||
| Set Approval For... | 15845758 | 1185 days ago | IN | 0 ETH | 0.00044757 | ||||
| Set Approval For... | 15462940 | 1240 days ago | IN | 0 ETH | 0.00061133 | ||||
| Safe Transfer Fr... | 15358053 | 1257 days ago | IN | 0 ETH | 0.000878 | ||||
| Set Approval For... | 15313424 | 1264 days ago | IN | 0 ETH | 0.00064676 | ||||
| Set Approval For... | 15208024 | 1280 days ago | IN | 0 ETH | 0.00039814 | ||||
| Set Approval For... | 14938411 | 1325 days ago | IN | 0 ETH | 0.00235863 | ||||
| Set Approval For... | 14470710 | 1399 days ago | IN | 0 ETH | 0.00561464 | ||||
| Set Approval For... | 14248027 | 1434 days ago | IN | 0 ETH | 0.00246255 | ||||
| Set Approval For... | 14214042 | 1439 days ago | IN | 0 ETH | 0.00527279 | ||||
| Set Approval For... | 14163730 | 1447 days ago | IN | 0 ETH | 0.00372253 | ||||
| Set Approval For... | 13986160 | 1474 days ago | IN | 0 ETH | 0.01244897 | ||||
| Set Approval For... | 13981998 | 1475 days ago | IN | 0 ETH | 0.0077103 | ||||
| Transfer From | 13981983 | 1475 days ago | IN | 0 ETH | 0.01234007 | ||||
| Set Approval For... | 13981970 | 1475 days ago | IN | 0 ETH | 0.00787187 | ||||
| Transfer From | 13981959 | 1475 days ago | IN | 0 ETH | 0.01495454 | ||||
| Set Approval For... | 13981951 | 1475 days ago | IN | 0 ETH | 0.00646131 | ||||
| Transfer From | 13981936 | 1475 days ago | IN | 0 ETH | 0.01516893 | ||||
| Set Approval For... | 13981809 | 1475 days ago | IN | 0 ETH | 0.00964655 |
Latest 15 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 13179644 | 1601 days ago | 0.001 ETH | ||||
| - | 13152015 | 1605 days ago | 0.03 ETH | ||||
| - | 13151970 | 1605 days ago | 0.015 ETH | ||||
| - | 13151464 | 1605 days ago | 0.05 ETH | ||||
| - | 13151187 | 1605 days ago | 0.1 ETH | ||||
| - | 13151173 | 1605 days ago | 0.1 ETH | ||||
| - | 13150964 | 1605 days ago | 0.03 ETH | ||||
| - | 13150964 | 1605 days ago | 0.03 ETH | ||||
| - | 13150933 | 1605 days ago | 0.03 ETH | ||||
| - | 13148983 | 1605 days ago | 0.02 ETH | ||||
| - | 13147444 | 1605 days ago | 0.03 ETH | ||||
| - | 13147263 | 1606 days ago | 0.01 ETH | ||||
| - | 13145471 | 1606 days ago | 0.01 ETH | ||||
| - | 13145145 | 1606 days ago | 0.001 ETH | ||||
| - | 13144808 | 1606 days ago | 0.001 ETH |
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
LootAvatars
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "./ERC721Pausable.sol";
interface LootInterface {
function ownerOf(uint256 tokenId) external view returns (address owner);
}
contract LootAvatars is VRFConsumerBase, ReentrancyGuard, ERC721Enumerable, Ownable, ERC721Burnable, ERC721Pausable {
using SafeMath for uint256;
using Counters for Counters.Counter;
//Loot Contract
address public lootAddress = 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7;
LootInterface lootContract = LootInterface(lootAddress);
Counters.Counter private _tokenNumTracker;
uint256 public constant MAX_ELEMENTS = 8000;
uint256 public constant LAST_WINNER_OF_TOKEN_NUM = 7000;
uint256 public constant ELEMENTS_PER_TIER = 1000;
uint256 public constant MAX_BY_MINT = 20;
uint256 public constant START_PRICE = 0 ether;
uint256 public constant PRICE_CHANGE_PER_TIER = 0.05 ether; // price not change
uint256 public constant BLOCKS_PER_MONTH = 199384; // assume each block is 13s, 1 month = 3600 * 24 * 30 / 13
address public devAddress;
string public baseTokenURI;
bytes32 public immutable baseURIProof;
uint256 public jackpot;
uint256 public jackpotRemaining;
address public phase1Winner;
bool public phase1JackpotClaimed = false;
uint256 public phase2StartBlockNumber;
uint256 public phase2EndBlockNumber;
uint256 public phase2WinnerTokenID;
bool public phase2Revealed = false;
bool public phase2JackpotClaimed = false;
bytes32 internal chainlinkKeyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445;
bytes32 internal chainlinkRequestID;
uint256 private chainlinkFee = 2e18;
event CreateAvatar(uint256 indexed id);
event WinPhase1(address addr);
event WinPhase2(uint256 tokenID);
event ClaimPhase1Jackpot(address addr);
event ClaimPhase2Jackpot(address addr);
event Reveal();
event RevealPhase2();
struct State {
uint256 maxElements;
uint256 maxByMint;
uint256 startPrice;
uint256 elementsPerTier;
uint256 jackpot;
uint256 jackpotRemaining;
uint256 phase1Jackpot;
uint256 phase2Jackpot;
address phase1Winner;
uint256 phase2EndBlockNumber;
uint256 phase2WinnerTokenID;
bool phase2Revealed;
uint8 currentPhase;
uint256 currentTier;
uint256 currentPrice;
uint256 totalSupply;
bool paused;
}
/**
* @dev base token URI will be replaced after reveal
*
* @param baseURI set placeholder base token URI before revealing
* @param dev dev address
* @param proof final base token URI to reveal
*/
constructor(
string memory baseURI,
address dev,
bytes32 proof
)
VRFConsumerBase(
0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, // VRF Coordinator
0x514910771AF9Ca656af840dff83E8264EcF986CA // LINK Token
)
ERC721("LootAvatars", "LAV")
{
require(dev != address(0), "Zero address");
baseTokenURI = baseURI;
devAddress = dev;
baseURIProof = proof;
}
// ******* modifiers *********
modifier saleIsOpen {
require(_totalSupply() < MAX_ELEMENTS, "Sale end");
if (_msgSender() != owner()) {
require(!paused(), "Pausable: paused");
}
_;
}
modifier saleIsEnd {
require(_totalSupply() >= MAX_ELEMENTS, "Sale not end");
_;
}
modifier onlyPhase1Winner {
require(phase1Winner != address(0), "Zero address");
require(_msgSender() == phase1Winner, "Not phase 1 winner");
_;
}
modifier onlyPhase2Winner(uint256 tokenID) {
require(_msgSender() != address(0), "Zero address");
require(ownerOf(tokenID) == _msgSender(), "Not phase 2 winner");
_;
}
modifier onlyPhase2 {
require(phase2EndBlockNumber > 0, "Phase 2 not start");
_;
}
modifier onlyPhase2AllowReveal {
require(phase2EndBlockNumber > 0, "Phase 2 not start");
require(block.number >= phase2EndBlockNumber, "Phase 2 not end");
_;
}
modifier onlyPhase2Revealed {
require(phase2Revealed, "Phase 2 not end");
_;
}
// ********* public view functions **********
/**
* @notice total number of tokens minted
*/
function totalMint() public view returns (uint256) {
return _totalSupply();
}
/**
* @notice current tier, start from 1 to 10
*/
function tier() public view returns (uint256) {
return _ceil(totalMint()).div(ELEMENTS_PER_TIER);
}
/**
* @notice get tier price of a specified tier
*
* @param tierN tier index, start from 1 to 10
*/
function tierPrice(uint256 tierN) public pure returns (uint256) {
require(tierN >= 1, "Out of tier range");
require(tierN <= MAX_ELEMENTS.div(ELEMENTS_PER_TIER), "Out of tier range");
return START_PRICE.add(PRICE_CHANGE_PER_TIER.mul(tierN.sub(1)));
}
/**
* @notice get the total price if you want to buy a number of avatars now
*
* @param count the number of avatars you want to buy
*/
function price(uint256 count) public view returns (uint256) {
uint256 _totalMint = totalMint();
require(count <= MAX_BY_MINT, "Max count");
require(_totalMint + count <= MAX_ELEMENTS, "Max limit");
uint256 _ceilCount = _ceil(_totalMint);
uint256 _currentTier = _ceilCount.div(ELEMENTS_PER_TIER);
// calculate count = a + b, a in current tier, b in next tier
uint256 _currentTierElements = _ceilCount.sub(_totalMint);
if (count <= _currentTierElements) {
return tierPrice(_currentTier).mul(count);
}
uint256 _price0 = tierPrice(_currentTier).mul(_currentTierElements);
uint256 _nextTierElements = count.sub(_currentTierElements);
uint256 _price1 = tierPrice(_currentTier.add(1)).mul(_nextTierElements);
return _price0.add(_price1);
}
/**
* @notice get all token IDs of CryptoAvatars of a address
*
* @param owner owner address
*/
function walletOfOwner(address owner) external view returns (uint256[] memory) {
uint256 tokenCount = balanceOf(owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(owner, i);
}
return tokensId;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
return super.supportsInterface(interfaceId);
}
/**
* @notice get current state
*/
function state() public view returns (State memory) {
uint256 currentTier = tier();
State memory _state = State({
maxElements: MAX_ELEMENTS,
maxByMint: MAX_BY_MINT,
startPrice: START_PRICE,
elementsPerTier: ELEMENTS_PER_TIER,
jackpot: jackpot,
jackpotRemaining: jackpotRemaining,
phase1Jackpot: jackpot.div(2),
phase2Jackpot: jackpot.div(2),
phase1Winner: phase1Winner,
phase2EndBlockNumber: phase2EndBlockNumber,
phase2WinnerTokenID: phase2WinnerTokenID,
phase2Revealed: phase2Revealed,
currentPhase: phase2EndBlockNumber == 0 ? 1 : 2,
currentTier: currentTier,
currentPrice: tierPrice(currentTier),
totalSupply: _totalSupply(),
paused: paused()
});
return _state;
}
// ********* public functions **********
/**
* @notice mint avatars with loot
*
* @notice extra eth sent will be refunded
*
* @param tokenId loot token id
*/
function mintWithLoot(uint256 tokenId) public payable nonReentrant saleIsOpen {
require(tokenId > 0 && tokenId < 8001, "Token ID invalid");
require(lootContract.ownerOf(tokenId) == _msgSender(), "Not the owner of this loot");
require(!_exists(tokenId), "This token has already been minted");
uint256 requiredPrice = price(1);
require(msg.value >= requiredPrice, "Value below price");
uint256 refund = msg.value.sub(requiredPrice);
if (requiredPrice > 0) {
_transfer(devAddress, requiredPrice.mul(90).div(100));
}
_mintOne(_msgSender(), tokenId);
if (requiredPrice > 0) {
jackpot = jackpot.add(requiredPrice.mul(10).div(100));
jackpotRemaining = jackpot;
}
if (refund > 0) {
_transfer(_msgSender(), refund);
}
}
/**
* @notice mint with multiple loots
*/
function multiMintWithLoots(uint[] memory tokenIds) public payable nonReentrant saleIsOpen {
for (uint256 i = 0; i < tokenIds.length; i++) {
require(tokenIds[i] > 0 && tokenIds[i] < 8001, "Token ID invalid");
require(lootContract.ownerOf(tokenIds[i]) == _msgSender(), "Not the owner of this loot");
require(!_exists(tokenIds[i]), "This token has already been minted");
}
uint256 requiredPrice = price(tokenIds.length);
require(msg.value >= requiredPrice, "Value below price");
uint256 refund = msg.value.sub(requiredPrice);
if (requiredPrice > 0) {
_transfer(devAddress, requiredPrice.mul(90).div(100));
}
for (uint256 i = 0; i < tokenIds.length; i++) {
_mintOne(_msgSender(), tokenIds[i]);
}
if (requiredPrice > 0) {
jackpot = jackpot.add(requiredPrice.mul(10).div(100));
jackpotRemaining = jackpot;
}
if (refund > 0) {
_transfer(_msgSender(), refund);
}
}
// ********* public onwer functions **********
/**
* @notice set dev address
*/
function setDev(address dev) public onlyOwner {
require(dev != address(0), "Zero address");
devAddress = dev;
}
/**
* @notice reveal the metadata of avatars
*
* @notice the baseURI should be equal to the proof when creating contract
* @notice metadata is immutable from the beginning of the contract
*/
function reveal(string memory baseURI) public onlyOwner {
bytes32 proof = keccak256(abi.encodePacked(baseURI));
require(baseURIProof == proof, "Invalid proof");
baseTokenURI = baseURI;
emit Reveal();
}
/**
* @notice pause or unpause the contract
*/
function pause(bool val) public onlyOwner {
if (val == true) {
_pause();
return;
}
_unpause();
}
/**
* @notice reveal the winner token ID of phase 2
*
* @notice Chainlink VRF is used to generate the random token ID
*
* @dev make sure to transfer LINK to the contract before revealing
* @dev check chainlinkRequestID in callback
*/
function revealPhase2() public onlyOwner onlyPhase2AllowReveal {
require(!phase2Revealed, "Phase 2 revealed");
chainlinkRequestID = getRandomNumber();
}
/**
* @notice Call incase failed to generate random token ID from chainlink
*
* @notice community should check if owner use chainlink to reveal phase 2 jackpot,
* @notice it's better to add timelock to this action.
*
* @notice if we failed to generate random from chainlink, owner should generate random token id
* @notice in another contract under the governance of community, then manually update the winner token id
*/
function forceRevealPhase2(uint256 tokenID) public onlyOwner onlyPhase2AllowReveal {
require(!phase2Revealed, "Phase 2 revealed");
require(tokenID < MAX_ELEMENTS, "Token id out of range");
require(_exists(tokenID), "Token ID not exists");
phase2Revealed = true;
phase2WinnerTokenID = tokenID;
emit WinPhase2(tokenID);
}
/**
* @notice Call incase current ipfs gateway broken
*
* @notice community should check if owner call reveal method first,
* @notice it's better to add timelock to this action.
*
* @notice IPFS CID should be unchanged
*/
function forceSetBaseTokenURI(string memory baseURI) public onlyOwner {
baseTokenURI = baseURI;
}
/**
* @notice withdraw the balance except jackpotRemaining
*/
function withdraw() public onlyOwner {
uint256 amount = address(this).balance.sub(jackpotRemaining);
require(amount > 0, "Nothing to withdraw");
_transfer(devAddress, amount);
}
/**
* @notice Requests randomness
*
* @dev manually call this method to check Chainlink works well
*/
function getRandomNumber() public virtual onlyOwner returns (bytes32 requestId) {
require(LINK.balanceOf(address(this)) >= chainlinkFee, "Not enough LINK");
return requestRandomness(chainlinkKeyHash, chainlinkFee);
}
/**
* @notice set fee paid for Chainlink VRF
*/
function setChainlinkFee(uint256 fee) public onlyOwner {
chainlinkFee = fee;
}
// ********* public winner functions **********
/**
* @notice claim phase 1 jackpot by phase 1 winner
*/
function claimPhase1Jackpot() public whenNotPaused onlyPhase1Winner {
require(!phase1JackpotClaimed, "Phase 1 jackpot claimed");
require(jackpot > 0, "No jackpot");
uint256 phase1Jackpot = jackpot.mul(50).div(100);
require(phase1Jackpot > 0, "No phase 1 jackpot");
require(jackpotRemaining >= phase1Jackpot, "Not enough jackpot");
phase1JackpotClaimed = true;
jackpotRemaining = jackpot.sub(phase1Jackpot);
_transfer(_msgSender(), phase1Jackpot); // phase 1 winner get 50% of jackpot
emit ClaimPhase1Jackpot(_msgSender());
}
/**
* @notice claim phase 2 jackpot by phase 2 winner
*/
function claimPhase2Jackpot() public
whenNotPaused
onlyPhase2
onlyPhase2Revealed
onlyPhase2Winner(phase2WinnerTokenID)
{
require(!phase2JackpotClaimed, "Phase 2 jackpot claimed");
require(jackpot > 0, "No jackpot");
uint256 phase2Jackpot = jackpot.mul(50).div(100);
require(phase2Jackpot > 0, "No phase 2 jackpot");
require(jackpotRemaining >= phase2Jackpot, "Not enough jackpot");
phase2JackpotClaimed = true;
jackpotRemaining = jackpot.sub(phase2Jackpot);
_transfer(_msgSender(), phase2Jackpot); // phase 2 winner get 50% of jackpot
emit ClaimPhase2Jackpot(_msgSender());
}
// ****** internal functions ******
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override(ERC721, ERC721Enumerable, ERC721Pausable) {
super._beforeTokenTransfer(from, to, tokenId);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseTokenURI;
}
function _totalSupply() internal virtual view returns (uint) {
return _tokenNumTracker.current();
}
function _priceChangePerTier() internal virtual pure returns (uint256) {
return PRICE_CHANGE_PER_TIER;
}
/**
* @notice Callback function used by VRF Coordinator
*
* @dev check requestId, callback is in a sperate transaction
* @dev do not revert in this method, chainlink will not retry to callback if reverted
* @dev to prevent chainlink from controling the contract, only allow the first callback to change state
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
if (requestId != chainlinkRequestID) {
return;
}
if (phase2Revealed) {
return;
}
if (phase2EndBlockNumber == 0 || block.number < phase2EndBlockNumber) {
return;
}
phase2Revealed = true;
phase2WinnerTokenID = randomness.mod(MAX_ELEMENTS).add(1);
require(_exists(phase2WinnerTokenID), "Token ID not exists");
emit WinPhase2(phase2WinnerTokenID);
}
// ******* private functions ********
function _mintOne(address _to, uint256 _tokenId) private {
_tokenNumTracker.increment();
_safeMint(_to, _tokenId);
emit CreateAvatar(_tokenId);
if (_totalSupply() == LAST_WINNER_OF_TOKEN_NUM) {
phase2StartBlockNumber = block.number;
phase2EndBlockNumber = phase2StartBlockNumber.add(BLOCKS_PER_MONTH);
phase1Winner = _msgSender();
emit WinPhase1(phase1Winner);
}
}
function _transfer(address _address, uint256 _amount) private {
(bool success, ) = _address.call{value: _amount}("");
require(success, "Transfer failed.");
}
/**
* @dev return current ceil count for current supply
*
* @dev total supply = 0, ceil = 1000
* @dev total supply = 1, ceil = 1000
* @dev total supply = 999, ceil = 1000
* @dev total supply = 1000, ceil = 2000
* @dev total supply = 9999, ceil = 10000
* @dev total supply = 10000, ceil = 10000
*/
function _ceil(uint256 totalSupply) internal pure returns (uint256) {
if (totalSupply == MAX_ELEMENTS) {
return MAX_ELEMENTS;
}
return totalSupply.div(ELEMENTS_PER_TIER).add(1).mul(ELEMENTS_PER_TIER);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
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 virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "../../../utils/Context.sol";
/**
* @title ERC721 Burnable Token
* @dev ERC721 Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721Burnable is Context, ERC721 {
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
_burn(tokenId);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev 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 {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/LinkTokenInterface.sol";
import "./VRFRequestIDBase.sol";
/** ****************************************************************************
* @notice Interface for contracts using VRF randomness
* *****************************************************************************
* @dev PURPOSE
*
* @dev Reggie the Random Oracle (not his real job) wants to provide randomness
* @dev to Vera the verifier in such a way that Vera can be sure he's not
* @dev making his output up to suit himself. Reggie provides Vera a public key
* @dev to which he knows the secret key. Each time Vera provides a seed to
* @dev Reggie, he gives back a value which is computed completely
* @dev deterministically from the seed and the secret key.
*
* @dev Reggie provides a proof by which Vera can verify that the output was
* @dev correctly computed once Reggie tells it to her, but without that proof,
* @dev the output is indistinguishable to her from a uniform random sample
* @dev from the output space.
*
* @dev The purpose of this contract is to make it easy for unrelated contracts
* @dev to talk to Vera the verifier about the work Reggie is doing, to provide
* @dev simple access to a verifiable source of randomness.
* *****************************************************************************
* @dev USAGE
*
* @dev Calling contracts must inherit from VRFConsumerBase, and can
* @dev initialize VRFConsumerBase's attributes in their constructor as
* @dev shown:
*
* @dev contract VRFConsumer {
* @dev constuctor(<other arguments>, address _vrfCoordinator, address _link)
* @dev VRFConsumerBase(_vrfCoordinator, _link) public {
* @dev <initialization with other arguments goes here>
* @dev }
* @dev }
*
* @dev The oracle will have given you an ID for the VRF keypair they have
* @dev committed to (let's call it keyHash), and have told you the minimum LINK
* @dev price for VRF service. Make sure your contract has sufficient LINK, and
* @dev call requestRandomness(keyHash, fee, seed), where seed is the input you
* @dev want to generate randomness from.
*
* @dev Once the VRFCoordinator has received and validated the oracle's response
* @dev to your request, it will call your contract's fulfillRandomness method.
*
* @dev The randomness argument to fulfillRandomness is the actual random value
* @dev generated from your seed.
*
* @dev The requestId argument is generated from the keyHash and the seed by
* @dev makeRequestId(keyHash, seed). If your contract could have concurrent
* @dev requests open, you can use the requestId to track which seed is
* @dev associated with which randomness. See VRFRequestIDBase.sol for more
* @dev details. (See "SECURITY CONSIDERATIONS" for principles to keep in mind,
* @dev if your contract could have multiple requests in flight simultaneously.)
*
* @dev Colliding `requestId`s are cryptographically impossible as long as seeds
* @dev differ. (Which is critical to making unpredictable randomness! See the
* @dev next section.)
*
* *****************************************************************************
* @dev SECURITY CONSIDERATIONS
*
* @dev A method with the ability to call your fulfillRandomness method directly
* @dev could spoof a VRF response with any random value, so it's critical that
* @dev it cannot be directly called by anything other than this base contract
* @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
*
* @dev For your users to trust that your contract's random behavior is free
* @dev from malicious interference, it's best if you can write it so that all
* @dev behaviors implied by a VRF response are executed *during* your
* @dev fulfillRandomness method. If your contract must store the response (or
* @dev anything derived from it) and use it later, you must ensure that any
* @dev user-significant behavior which depends on that stored value cannot be
* @dev manipulated by a subsequent VRF request.
*
* @dev Similarly, both miners and the VRF oracle itself have some influence
* @dev over the order in which VRF responses appear on the blockchain, so if
* @dev your contract could have multiple VRF requests in flight simultaneously,
* @dev you must ensure that the order in which the VRF responses arrive cannot
* @dev be used to manipulate your contract's user-significant behavior.
*
* @dev Since the ultimate input to the VRF is mixed with the block hash of the
* @dev block in which the request is made, user-provided seeds have no impact
* @dev on its economic security properties. They are only included for API
* @dev compatability with previous versions of this contract.
*
* @dev Since the block hash of the block which contains the requestRandomness
* @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
* @dev miner could, in principle, fork the blockchain to evict the block
* @dev containing the request, forcing the request to be included in a
* @dev different block with a different hash, and therefore a different input
* @dev to the VRF. However, such an attack would incur a substantial economic
* @dev cost. This cost scales with the number of blocks the VRF oracle waits
* @dev until it calls responds to a request.
*/
abstract contract VRFConsumerBase is VRFRequestIDBase {
/**
* @notice fulfillRandomness handles the VRF response. Your contract must
* @notice implement it. See "SECURITY CONSIDERATIONS" above for important
* @notice principles to keep in mind when implementing your fulfillRandomness
* @notice method.
*
* @dev VRFConsumerBase expects its subcontracts to have a method with this
* @dev signature, and will call it once it has verified the proof
* @dev associated with the randomness. (It is triggered via a call to
* @dev rawFulfillRandomness, below.)
*
* @param requestId The Id initially returned by requestRandomness
* @param randomness the VRF output
*/
function fulfillRandomness(
bytes32 requestId,
uint256 randomness
)
internal
virtual;
/**
* @dev In order to keep backwards compatibility we have kept the user
* seed field around. We remove the use of it because given that the blockhash
* enters later, it overrides whatever randomness the used seed provides.
* Given that it adds no security, and can easily lead to misunderstandings,
* we have removed it from usage and can now provide a simpler API.
*/
uint256 constant private USER_SEED_PLACEHOLDER = 0;
/**
* @notice requestRandomness initiates a request for VRF output given _seed
*
* @dev The fulfillRandomness method receives the output, once it's provided
* @dev by the Oracle, and verified by the vrfCoordinator.
*
* @dev The _keyHash must already be registered with the VRFCoordinator, and
* @dev the _fee must exceed the fee specified during registration of the
* @dev _keyHash.
*
* @dev The _seed parameter is vestigial, and is kept only for API
* @dev compatibility with older versions. It can't *hurt* to mix in some of
* @dev your own randomness, here, but it's not necessary because the VRF
* @dev oracle will mix the hash of the block containing your request into the
* @dev VRF seed it ultimately uses.
*
* @param _keyHash ID of public key against which randomness is generated
* @param _fee The amount of LINK to send with the request
*
* @return requestId unique ID for this request
*
* @dev The returned requestId can be used to distinguish responses to
* @dev concurrent requests. It is passed as the first argument to
* @dev fulfillRandomness.
*/
function requestRandomness(
bytes32 _keyHash,
uint256 _fee
)
internal
returns (
bytes32 requestId
)
{
LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
// This is the seed passed to VRFCoordinator. The oracle will mix this with
// the hash of the block containing this request to obtain the seed/input
// which is finally passed to the VRF cryptographic machinery.
uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
// nonces[_keyHash] must stay in sync with
// VRFCoordinator.nonces[_keyHash][this], which was incremented by the above
// successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest).
// This provides protection against the user repeating their input seed,
// which would result in a predictable/duplicate output, if multiple such
// requests appeared in the same block.
nonces[_keyHash] = nonces[_keyHash] + 1;
return makeRequestId(_keyHash, vRFSeed);
}
LinkTokenInterface immutable internal LINK;
address immutable private vrfCoordinator;
// Nonces for each VRF key from which randomness has been requested.
//
// Must stay in sync with VRFCoordinator[_keyHash][this]
mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces;
/**
* @param _vrfCoordinator address of VRFCoordinator contract
* @param _link address of LINK token contract
*
* @dev https://docs.chain.link/docs/link-token-contracts
*/
constructor(
address _vrfCoordinator,
address _link
) {
vrfCoordinator = _vrfCoordinator;
LINK = LinkTokenInterface(_link);
}
// rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
// proof. rawFulfillRandomness then calls fulfillRandomness, after validating
// the origin of the call
function rawFulfillRandomness(
bytes32 requestId,
uint256 randomness
)
external
{
require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
fulfillRandomness(requestId, randomness);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @dev ERC721 token with pausable token transfers, minting and burning.
*
* Useful for scenarios such as preventing trades until the end of an evaluation
* period, or having an emergency switch for freezing all token transfers in the
* event of a large bug.
*/
abstract contract ERC721Pausable is ERC721, Ownable, Pausable {
/**
* @dev See {ERC721-_beforeTokenTransfer}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (_msgSender() != owner()) {
require(!paused(), "ERC721Pausable: token transfer while paused");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, 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.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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.8.0;
/**
* @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 on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../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.8.0;
interface LinkTokenInterface {
function allowance(
address owner,
address spender
)
external
view
returns (
uint256 remaining
);
function approve(
address spender,
uint256 value
)
external
returns (
bool success
);
function balanceOf(
address owner
)
external
view
returns (
uint256 balance
);
function decimals()
external
view
returns (
uint8 decimalPlaces
);
function decreaseApproval(
address spender,
uint256 addedValue
)
external
returns (
bool success
);
function increaseApproval(
address spender,
uint256 subtractedValue
) external;
function name()
external
view
returns (
string memory tokenName
);
function symbol()
external
view
returns (
string memory tokenSymbol
);
function totalSupply()
external
view
returns (
uint256 totalTokensIssued
);
function transfer(
address to,
uint256 value
)
external
returns (
bool success
);
function transferAndCall(
address to,
uint256 value,
bytes calldata data
)
external
returns (
bool success
);
function transferFrom(
address from,
address to,
uint256 value
)
external
returns (
bool success
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract VRFRequestIDBase {
/**
* @notice returns the seed which is actually input to the VRF coordinator
*
* @dev To prevent repetition of VRF output due to repetition of the
* @dev user-supplied seed, that seed is combined in a hash with the
* @dev user-specific nonce, and the address of the consuming contract. The
* @dev risk of repetition is mostly mitigated by inclusion of a blockhash in
* @dev the final seed, but the nonce does protect against repetition in
* @dev requests which are included in a single block.
*
* @param _userSeed VRF seed input provided by user
* @param _requester Address of the requesting contract
* @param _nonce User-specific nonce at the time of the request
*/
function makeVRFInputSeed(
bytes32 _keyHash,
uint256 _userSeed,
address _requester,
uint256 _nonce
)
internal
pure
returns (
uint256
)
{
return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
}
/**
* @notice Returns the id for this request
* @param _keyHash The serviceAgreement ID to be used for this request
* @param _vRFInputSeed The seed to be passed directly to the VRF
* @return The id for this request
*
* @dev Note that _vRFInputSeed is not the seed passed by the consuming
* @dev contract, but the one generated by makeVRFInputSeed
*/
function makeRequestId(
bytes32 _keyHash,
uint256 _vRFInputSeed
)
internal
pure
returns (
bytes32
)
{
return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}{
"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"},{"internalType":"address","name":"dev","type":"address"},{"internalType":"bytes32","name":"proof","type":"bytes32"}],"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":false,"internalType":"address","name":"addr","type":"address"}],"name":"ClaimPhase1Jackpot","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"}],"name":"ClaimPhase2Jackpot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"CreateAvatar","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[],"name":"Reveal","type":"event"},{"anonymous":false,"inputs":[],"name":"RevealPhase2","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"}],"name":"WinPhase1","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"WinPhase2","type":"event"},{"inputs":[],"name":"BLOCKS_PER_MONTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ELEMENTS_PER_TIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LAST_WINNER_OF_TOKEN_NUM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BY_MINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ELEMENTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_CHANGE_PER_TIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURIProof","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimPhase1Jackpot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimPhase2Jackpot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"forceRevealPhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"forceSetBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRandomNumber","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"jackpot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"jackpotRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lootAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintWithLoot","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"multiMintWithLoots","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","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":"bool","name":"val","type":"bool"}],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase1JackpotClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase1Winner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase2EndBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase2JackpotClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase2Revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase2StartBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase2WinnerTokenID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealPhase2","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":"uint256","name":"fee","type":"uint256"}],"name":"setChainlinkFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dev","type":"address"}],"name":"setDev","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"components":[{"internalType":"uint256","name":"maxElements","type":"uint256"},{"internalType":"uint256","name":"maxByMint","type":"uint256"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"elementsPerTier","type":"uint256"},{"internalType":"uint256","name":"jackpot","type":"uint256"},{"internalType":"uint256","name":"jackpotRemaining","type":"uint256"},{"internalType":"uint256","name":"phase1Jackpot","type":"uint256"},{"internalType":"uint256","name":"phase2Jackpot","type":"uint256"},{"internalType":"address","name":"phase1Winner","type":"address"},{"internalType":"uint256","name":"phase2EndBlockNumber","type":"uint256"},{"internalType":"uint256","name":"phase2WinnerTokenID","type":"uint256"},{"internalType":"bool","name":"phase2Revealed","type":"bool"},{"internalType":"uint8","name":"currentPhase","type":"uint8"},{"internalType":"uint256","name":"currentTier","type":"uint256"},{"internalType":"uint256","name":"currentPrice","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct LootAvatars.State","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierN","type":"uint256"}],"name":"tierPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"totalMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e0604052600d805473ff9c1b15b16263c61d017ee9f65c50e4ae0113d76001600160a01b03199182168117909255600e805490911690911790556014805460ff60a01b191690556018805461ffff191690557faa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445601955671bc16d674ec80000601b553480156200008f57600080fd5b506040516200492738038062004927833981016040819052620000b29162000330565b604080518082018252600b81526a4c6f6f744176617461727360a81b6020808301918252835180850190945260038452622620ab60e91b908401527ff0d54349addcf704f77ae15b96510dea15cb795200000000000000000000000060a0527f514910771af9ca656af840dff83e8264ecf986ca0000000000000000000000006080526001805581519192916200014c916002916200026d565b508051620001629060039060208401906200026d565b5050506200017f620001796200021760201b60201c565b6200021b565b600c805460ff60a01b191690556001600160a01b038216620001d65760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b604482015260640160405180910390fd5b8251620001eb9060119060208601906200026d565b50601080546001600160a01b0319166001600160a01b03939093169290921790915560c0525062000477565b3390565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200027b9062000424565b90600052602060002090601f0160209004810192826200029f5760008555620002ea565b82601f10620002ba57805160ff1916838001178555620002ea565b82800160010185558215620002ea579182015b82811115620002ea578251825591602001919060010190620002cd565b50620002f8929150620002fc565b5090565b5b80821115620002f85760008155600101620002fd565b80516001600160a01b03811681146200032b57600080fd5b919050565b60008060006060848603121562000345578283fd5b83516001600160401b03808211156200035c578485fd5b818601915086601f83011262000370578485fd5b81518181111562000385576200038562000461565b604051601f8201601f19908116603f01168101908382118183101715620003b057620003b062000461565b81604052828152602093508984848701011115620003cc578788fd5b8791505b82821015620003ef5784820184015181830185015290830190620003d0565b828211156200040057878484830101525b96506200041291505086820162000313565b93505050604084015190509250925092565b600181811c908216806200043957607f821691505b602082108114156200045b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c60c051614465620004c26000396000818161048a015261153b015260008181611ed401526133510152600081816125c1015261332201526144656000f3fe6080604052600436106103a25760003560e01c806357d64288116101e757806394985ddd1161010d578063c87b56dd116100a0578063df5d85e31161006f578063df5d85e314610a25578063e985e9c514610a46578063f2fde38b14610a8f578063fd12c96814610aaf57600080fd5b8063c87b56dd146109bb578063d477f05f146109db578063d547cfb7146109fb578063dbdff2c114610a1057600080fd5b8063a3da17aa116100dc578063a3da17aa14610942578063b88d4fde14610962578063c19d93fb14610982578063c409084a146109a457600080fd5b806394985ddd146108cd57806395d89b41146108ed578063a22cb46514610902578063a284673f1461092257600080fd5b80637cd9cd1511610185578063898ffd5811610154578063898ffd58146108695780638ad5de281461087f5780638da5cb5b1461089457806392ff8eb2146108b257600080fd5b80637cd9cd151461080b57806380372e061461081e578063826d33791461083357806387c6783f1461085357600080fd5b80636352211e116101c15780636352211e146107a05780636b31ee01146107c057806370a08231146107d6578063715018a6146107f657600080fd5b806357d642881461074d57806359a7715a1461076c5780635c975abb1461078157600080fd5b80632f745c59116102cc5780633f7fc3951161026a5780634a09a53c116102395780634a09a53c146106e25780634c261247146106f75780634f6ccce71461071757806351814d2b1461073757600080fd5b80633f7fc3951461065f57806342842e0e1461067557806342966c6814610695578063438b6300146106b557600080fd5b80633609ac8f116102a65780633609ac8f146105f55780633ad10ef61461060a5780633ccfd60b1461062a5780633dbcbe881461063f57600080fd5b80632f745c591461059f578063326f9d60146105bf5780633502a716146105df57600080fd5b80630eca1d891161034457806323592c3c1161031357806323592c3c1461053457806323b872dd1461054957806326a49e37146105695780632afe76a11461058957600080fd5b80630eca1d89146104da57806312b64079146104f057806316f4d0221461050a57806318160ddd1461051f57600080fd5b8063081812fc11610380578063081812fc14610420578063095ea7b3146104585780630a032700146104785780630e439326146104ba57600080fd5b806301ffc9a7146103a757806302329a29146103dc57806306fdde03146103fe575b600080fd5b3480156103b357600080fd5b506103c76103c2366004613e18565b610ac2565b60405190151581526020015b60405180910390f35b3480156103e857600080fd5b506103fc6103f7366004613dbf565b610ad3565b005b34801561040a57600080fd5b50610413610b24565b6040516103d39190613fe4565b34801561042c57600080fd5b5061044061043b366004613e96565b610bb6565b6040516001600160a01b0390911681526020016103d3565b34801561046457600080fd5b506103fc610473366004613cec565b610c3e565b34801561048457600080fd5b506104ac7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016103d3565b3480156104c657600080fd5b50600d54610440906001600160a01b031681565b3480156104e657600080fd5b506104ac60165481565b3480156104fc57600080fd5b506018546103c79060ff1681565b34801561051657600080fd5b506104ac610d54565b34801561052b57600080fd5b50600a546104ac565b34801561054057600080fd5b506103fc610d77565b34801561055557600080fd5b506103fc610564366004613c02565b610e38565b34801561057557600080fd5b506104ac610584366004613e96565b610e6a565b34801561059557600080fd5b506104ac60135481565b3480156105ab57600080fd5b506104ac6105ba366004613cec565b610f96565b3480156105cb57600080fd5b506103fc6105da366004613e50565b61102c565b3480156105eb57600080fd5b506104ac611f4081565b34801561060157600080fd5b506104ac600081565b34801561061657600080fd5b50601054610440906001600160a01b031681565b34801561063657600080fd5b506103fc61106d565b34801561064b57600080fd5b50601454610440906001600160a01b031681565b34801561066b57600080fd5b506104ac611b5881565b34801561068157600080fd5b506103fc610690366004613c02565b61110c565b3480156106a157600080fd5b506103fc6106b0366004613e96565b611127565b3480156106c157600080fd5b506106d56106d0366004613b92565b61119e565b6040516103d39190613fa0565b3480156106ee57600080fd5b506103fc61125c565b34801561070357600080fd5b506103fc610712366004613e50565b6114e3565b34801561072357600080fd5b506104ac610732366004613e96565b6115d8565b34801561074357600080fd5b506104ac60175481565b34801561075957600080fd5b506018546103c790610100900460ff1681565b34801561077857600080fd5b506104ac611679565b34801561078d57600080fd5b50600c54600160a01b900460ff166103c7565b3480156107ac57600080fd5b506104406107bb366004613e96565b611683565b3480156107cc57600080fd5b506104ac60125481565b3480156107e257600080fd5b506104ac6107f1366004613b92565b6116fa565b34801561080257600080fd5b506103fc611781565b6103fc610819366004613d17565b6117b7565b34801561082a57600080fd5b506103fc611bb9565b34801561083f57600080fd5b506104ac61084e366004613e96565b611e0a565b34801561085f57600080fd5b506104ac60155481565b34801561087557600080fd5b506104ac6103e881565b34801561088b57600080fd5b506104ac601481565b3480156108a057600080fd5b50600c546001600160a01b0316610440565b3480156108be57600080fd5b506104ac66b1a2bc2ec5000081565b3480156108d957600080fd5b506103fc6108e8366004613df7565b611ec9565b3480156108f957600080fd5b50610413611f4b565b34801561090e57600080fd5b506103fc61091d366004613cbf565b611f5a565b34801561092e57600080fd5b506103fc61093d366004613e96565b61201f565b34801561094e57600080fd5b506103fc61095d366004613e96565b61204e565b34801561096e57600080fd5b506103fc61097d366004613c42565b6121da565b34801561098e57600080fd5b50610997612212565b6040516103d391906141b5565b3480156109b057600080fd5b506104ac62030ad881565b3480156109c757600080fd5b506104136109d6366004613e96565b6123b1565b3480156109e757600080fd5b506103fc6109f6366004613b92565b61247c565b348015610a0757600080fd5b506104136124ee565b348015610a1c57600080fd5b506104ac61257c565b348015610a3157600080fd5b506014546103c790600160a01b900460ff1681565b348015610a5257600080fd5b506103c7610a61366004613bca565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a9b57600080fd5b506103fc610aaa366004613b92565b612691565b6103fc610abd366004613e96565b612729565b6000610acd826129f6565b92915050565b600c546001600160a01b03163314610b065760405162461bcd60e51b8152600401610afd90614104565b60405180910390fd5b60018115151415610b1c57610b19612a1b565b50565b610b19612a9d565b606060028054610b339061434a565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5f9061434a565b8015610bac5780601f10610b8157610100808354040283529160200191610bac565b820191906000526020600020905b815481529060010190602001808311610b8f57829003601f168201915b5050505050905090565b6000610bc182612b21565b610c225760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610afd565b506000908152600660205260409020546001600160a01b031690565b6000610c4982611683565b9050806001600160a01b0316836001600160a01b03161415610cb75760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610afd565b336001600160a01b0382161480610cd35750610cd38133610a61565b610d455760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610afd565b610d4f8383612b3e565b505050565b6000610d726103e8610d6c610d67611679565b612bac565b90612bdc565b905090565b600c546001600160a01b03163314610da15760405162461bcd60e51b8152600401610afd90614104565b600060165411610dc35760405162461bcd60e51b8152600401610afd90614139565b601654431015610de55760405162461bcd60e51b8152600401610afd906140db565b60185460ff1615610e2b5760405162461bcd60e51b815260206004820152601060248201526f141a185cd9480c881c995d99585b195960821b6044820152606401610afd565b610e3361257c565b601a55565b610e43335b82612be8565b610e5f5760405162461bcd60e51b8152600401610afd90614164565b610d4f838383612cd2565b600080610e75611679565b90506014831115610eb45760405162461bcd60e51b815260206004820152600960248201526813585e0818dbdd5b9d60ba1b6044820152606401610afd565b611f40610ec184836142bc565b1115610efb5760405162461bcd60e51b815260206004820152600960248201526813585e081b1a5b5a5d60ba1b6044820152606401610afd565b6000610f0682612bac565b90506000610f16826103e8612bdc565b90506000610f248385612e7d565b9050808611610f4a57610f4086610f3a84611e0a565b90612e89565b9695505050505050565b6000610f5982610f3a85611e0a565b90506000610f678884612e7d565b90506000610f7d82610f3a61084e886001612e95565b9050610f898382612e95565b9998505050505050505050565b6000610fa1836116fa565b82106110035760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610afd565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b600c546001600160a01b031633146110565760405162461bcd60e51b8152600401610afd90614104565b8051611069906011906020840190613aa1565b5050565b600c546001600160a01b031633146110975760405162461bcd60e51b8152600401610afd90614104565b60006110ae60135447612e7d90919063ffffffff16565b9050600081116110f65760405162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20776974686472617760681b6044820152606401610afd565b601054610b19906001600160a01b031682612ea1565b610d4f838383604051806020016040528060008152506121da565b61113033610e3d565b6111955760405162461bcd60e51b815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201526f1b995c881b9bdc88185c1c1c9bdd995960821b6064820152608401610afd565b610b1981612f37565b606060006111ab836116fa565b905060008167ffffffffffffffff8111156111d657634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156111ff578160200160208202803683370190505b50905060005b82811015611254576112178582610f96565b82828151811061123757634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061124c81614385565b915050611205565b509392505050565b600c54600160a01b900460ff16156112865760405162461bcd60e51b8152600401610afd9061406f565b6000601654116112a85760405162461bcd60e51b8152600401610afd90614139565b60185460ff166112ca5760405162461bcd60e51b8152600401610afd906140db565b601754336112ea5760405162461bcd60e51b8152600401610afd90614049565b336112f482611683565b6001600160a01b03161461133f5760405162461bcd60e51b81526020600482015260126024820152712737ba10383430b9b29019103bb4b73732b960711b6044820152606401610afd565b601854610100900460ff16156113975760405162461bcd60e51b815260206004820152601760248201527f50686173652032206a61636b706f7420636c61696d65640000000000000000006044820152606401610afd565b6000601254116113d65760405162461bcd60e51b815260206004820152600a602482015269139bc81a9858dadc1bdd60b21b6044820152606401610afd565b60006113f36064610d6c6032601254612e8990919063ffffffff16565b90506000811161143a5760405162461bcd60e51b8152602060048201526012602482015271139bc81c1a185cd9480c881a9858dadc1bdd60721b6044820152606401610afd565b8060135410156114815760405162461bcd60e51b8152602060048201526012602482015271139bdd08195b9bdd59da081a9858dadc1bdd60721b6044820152606401610afd565b6018805461ff00191661010017905560125461149d9082612e7d565b6013556114ab335b82612ea1565b6040513381527f28ed9ce03503bc4013bd8f26286ea0d779a29ccc8318a3d8935d4f932c07174b906020015b60405180910390a15050565b600c546001600160a01b0316331461150d5760405162461bcd60e51b8152600401610afd90614104565b6000816040516020016115209190613ef2565b604051602081830303815290604052805190602001209050807f0000000000000000000000000000000000000000000000000000000000000000146115975760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610afd565b81516115aa906011906020850190613aa1565b506040517f66b9f0d2f5af4125e8098bf5f1efc517ed46a70d8638734d186af310e2f8bc7590600090a15050565b60006115e3600a5490565b82106116465760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610afd565b600a828154811061166757634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000610d72612fde565b6000818152600460205260408120546001600160a01b031680610acd5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610afd565b60006001600160a01b0382166117655760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610afd565b506001600160a01b031660009081526005602052604090205490565b600c546001600160a01b031633146117ab5760405162461bcd60e51b8152600401610afd90614104565b6117b56000612fe9565b565b6002600154141561180a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afd565b6002600155611f4061181a612fde565b106118525760405162461bcd60e51b815260206004820152600860248201526714d85b1948195b9960c21b6044820152606401610afd565b600c546001600160a01b0316331461188e57600c54600160a01b900460ff161561188e5760405162461bcd60e51b8152600401610afd9061406f565b60005b8151811015611a9a5760008282815181106118bc57634e487b7160e01b600052603260045260246000fd5b60200260200101511180156118f95750611f418282815181106118ef57634e487b7160e01b600052603260045260246000fd5b6020026020010151105b6119385760405162461bcd60e51b815260206004820152601060248201526f151bdad95b881251081a5b9d985b1a5960821b6044820152606401610afd565b600e54825133916001600160a01b031690636352211e9085908590811061196f57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161199591815260200190565b60206040518083038186803b1580156119ad57600080fd5b505afa1580156119c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e59190613bae565b6001600160a01b031614611a3b5760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420746865206f776e6572206f662074686973206c6f6f740000000000006044820152606401610afd565b611a6b828281518110611a5e57634e487b7160e01b600052603260045260246000fd5b6020026020010151612b21565b15611a885760405162461bcd60e51b8152600401610afd90614099565b80611a9281614385565b915050611891565b506000611aa78251610e6a565b905080341015611aed5760405162461bcd60e51b815260206004820152601160248201527056616c75652062656c6f7720707269636560781b6044820152606401610afd565b6000611af93483612e7d565b90508115611b2657601054611b26906001600160a01b0316611b216064610d6c86605a612e89565b612ea1565b60005b8351811015611b7557611b6333858381518110611b5657634e487b7160e01b600052603260045260246000fd5b602002602001015161303b565b80611b6d81614385565b915050611b29565b508115611ba157611b98611b8f6064610d6c85600a612e89565b60125490612e95565b60128190556013555b8015611bb057611bb0336114a5565b50506001805550565b600c54600160a01b900460ff1615611be35760405162461bcd60e51b8152600401610afd9061406f565b6014546001600160a01b0316611c0b5760405162461bcd60e51b8152600401610afd90614049565b6014546001600160a01b0316336001600160a01b031614611c635760405162461bcd60e51b81526020600482015260126024820152712737ba10383430b9b29018903bb4b73732b960711b6044820152606401610afd565b601454600160a01b900460ff1615611cbd5760405162461bcd60e51b815260206004820152601760248201527f50686173652031206a61636b706f7420636c61696d65640000000000000000006044820152606401610afd565b600060125411611cfc5760405162461bcd60e51b815260206004820152600a602482015269139bc81a9858dadc1bdd60b21b6044820152606401610afd565b6000611d196064610d6c6032601254612e8990919063ffffffff16565b905060008111611d605760405162461bcd60e51b8152602060048201526012602482015271139bc81c1a185cd9480c481a9858dadc1bdd60721b6044820152606401610afd565b806013541015611da75760405162461bcd60e51b8152602060048201526012602482015271139bdd08195b9bdd59da081a9858dadc1bdd60721b6044820152606401610afd565b6014805460ff60a01b1916600160a01b179055601254611dc79082612e7d565b601355611dd3336114a5565b6040513381527f06f935d2d2a54d22e79e87581f623937bc3a224d413147f6bda873618b51c5be906020015b60405180910390a150565b60006001821015611e515760405162461bcd60e51b81526020600482015260116024820152704f7574206f6620746965722072616e676560781b6044820152606401610afd565b611e5f611f406103e8612bdc565b821115611ea25760405162461bcd60e51b81526020600482015260116024820152704f7574206f6620746965722072616e676560781b6044820152606401610afd565b610acd611ec1611eb3846001612e7d565b66b1a2bc2ec5000090612e89565b600090612e95565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611f415760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610afd565b61106982826130ea565b606060038054610b339061434a565b6001600160a01b038216331415611fb35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610afd565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600c546001600160a01b031633146120495760405162461bcd60e51b8152600401610afd90614104565b601b55565b600c546001600160a01b031633146120785760405162461bcd60e51b8152600401610afd90614104565b60006016541161209a5760405162461bcd60e51b8152600401610afd90614139565b6016544310156120bc5760405162461bcd60e51b8152600401610afd906140db565b60185460ff16156121025760405162461bcd60e51b815260206004820152601060248201526f141a185cd9480c881c995d99585b195960821b6044820152606401610afd565b611f40811061214b5760405162461bcd60e51b8152602060048201526015602482015274546f6b656e206964206f7574206f662072616e676560581b6044820152606401610afd565b61215481612b21565b6121965760405162461bcd60e51b8152602060048201526013602482015272546f6b656e204944206e6f742065786973747360681b6044820152606401610afd565b6018805460ff1916600117905560178190556040517f463bd68ccfd01ef4adcac23ddf662b021817a533ad93e24c56bef90204e1402a90611dff9083815260200190565b6121e43383612be8565b6122005760405162461bcd60e51b8152600401610afd90614164565b61220c848484846131c2565b50505050565b6122a9604051806102200160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016000815260200160008152602001600015158152602001600060ff1681526020016000815260200160008152602001600081526020016000151581525090565b60006122b3610d54565b90506000604051806102200160405280611f40815260200160148152602001600081526020016103e88152602001601254815260200160135481526020016123076002601254612bdc90919063ffffffff16565b81526020016123226002601254612bdc90919063ffffffff16565b81526014546001600160a01b0316602082015260165460408201819052601754606083015260185460ff161515608083015260a09091019015612366576002612369565b60015b60ff16815260200183815260200161238084611e0a565b815260200161238d612fde565b81526020016123a6600c5460ff600160a01b9091041690565b151590529392505050565b60606123bc82612b21565b6124205760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610afd565b600061242a6131f5565b9050600081511161244a5760405180602001604052806000815250612475565b8061245484613204565b604051602001612465929190613f0e565b6040516020818303038152906040525b9392505050565b600c546001600160a01b031633146124a65760405162461bcd60e51b8152600401610afd90614104565b6001600160a01b0381166124cc5760405162461bcd60e51b8152600401610afd90614049565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b601180546124fb9061434a565b80601f01602080910402602001604051908101604052809291908181526020018280546125279061434a565b80156125745780601f1061254957610100808354040283529160200191612574565b820191906000526020600020905b81548152906001019060200180831161255757829003601f168201915b505050505081565b600c546000906001600160a01b031633146125a95760405162461bcd60e51b8152600401610afd90614104565b601b546040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561260b57600080fd5b505afa15801561261f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126439190613eae565b10156126835760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420656e6f756768204c494e4b60881b6044820152606401610afd565b610d72601954601b5461331e565b600c546001600160a01b031633146126bb5760405162461bcd60e51b8152600401610afd90614104565b6001600160a01b0381166127205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610afd565b610b1981612fe9565b6002600154141561277c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afd565b6002600155611f4061278c612fde565b106127c45760405162461bcd60e51b815260206004820152600860248201526714d85b1948195b9960c21b6044820152606401610afd565b600c546001600160a01b0316331461280057600c54600160a01b900460ff16156128005760405162461bcd60e51b8152600401610afd9061406f565b6000811180156128115750611f4181105b6128505760405162461bcd60e51b815260206004820152601060248201526f151bdad95b881251081a5b9d985b1a5960821b6044820152606401610afd565b33600e546040516331a9108f60e11b8152600481018490526001600160a01b039283169290911690636352211e9060240160206040518083038186803b15801561289957600080fd5b505afa1580156128ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d19190613bae565b6001600160a01b0316146129275760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420746865206f776e6572206f662074686973206c6f6f740000000000006044820152606401610afd565b61293081612b21565b1561294d5760405162461bcd60e51b8152600401610afd90614099565b60006129596001610e6a565b90508034101561299f5760405162461bcd60e51b815260206004820152601160248201527056616c75652062656c6f7720707269636560781b6044820152606401610afd565b60006129ab3483612e7d565b905081156129d3576010546129d3906001600160a01b0316611b216064610d6c86605a612e89565b6129dd338461303b565b8115611ba157611b98611b8f6064610d6c85600a612e89565b60006001600160e01b0319821663780e9d6360e01b1480610acd5750610acd826134a4565b600c54600160a01b900460ff1615612a455760405162461bcd60e51b8152600401610afd9061406f565b600c805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612a803390565b6040516001600160a01b03909116815260200160405180910390a1565b600c54600160a01b900460ff16612aed5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610afd565b600c805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612a80565b6000908152600460205260409020546001600160a01b0316151590565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612b7382611683565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611f40821415612bc15750611f40919050565b610acd6103e8610f3a6001612bd68684612bdc565b90612e95565b600061247582846142d4565b6000612bf382612b21565b612c545760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610afd565b6000612c5f83611683565b9050806001600160a01b0316846001600160a01b03161480612c9a5750836001600160a01b0316612c8f84610bb6565b6001600160a01b0316145b80612cca57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612ce582611683565b6001600160a01b031614612d4d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610afd565b6001600160a01b038216612daf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610afd565b612dba8383836134f4565b612dc5600082612b3e565b6001600160a01b0383166000908152600560205260408120805460019290612dee908490614307565b90915550506001600160a01b0382166000908152600560205260408120805460019290612e1c9084906142bc565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006124758284614307565b600061247582846142e8565b600061247582846142bc565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612eee576040519150601f19603f3d011682016040523d82523d6000602084013e612ef3565b606091505b5050905080610d4f5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610afd565b6000612f4282611683565b9050612f50816000846134f4565b612f5b600083612b3e565b6001600160a01b0381166000908152600560205260408120805460019290612f84908490614307565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000610d72600f5490565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b613049600f80546001019055565b61305382826134ff565b60405181907f8653f1bbeeba5331990bffb2cb4b8a17cad3377dc14dc6a1db1b7e279085381190600090a2611b58613089612fde565b1415611069574360158190556130a29062030ad8612e95565b601655601480546001600160a01b031916339081179091556040519081527f01e473c9fc5bf2d038009ef5bdf7f56d2a8d1fe8bcb1a26c4af389f85671ff3d906020016114d7565b601a5482146130f7575050565b60185460ff1615613106575050565b6016541580613116575060165443105b1561311f575050565b6018805460ff1916600190811790915561313f90612bd683611f40613519565b601781905561314d90612b21565b61318f5760405162461bcd60e51b8152602060048201526013602482015272546f6b656e204944206e6f742065786973747360681b6044820152606401610afd565b7f463bd68ccfd01ef4adcac23ddf662b021817a533ad93e24c56bef90204e1402a6017546040516114d791815260200190565b6131cd848484612cd2565b6131d984848484613525565b61220c5760405162461bcd60e51b8152600401610afd90613ff7565b606060118054610b339061434a565b6060816132285750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613252578061323c81614385565b915061324b9050600a836142d4565b915061322c565b60008167ffffffffffffffff81111561327b57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156132a5576020820181803683370190505b5090505b8415612cca576132ba600183614307565b91506132c7600a866143a0565b6132d29060306142bc565b60f81b8183815181106132f557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350613317600a866142d4565b94506132a9565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f00000000000000000000000000000000000000000000000000000000000000008486600060405160200161338e929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016133bb93929190613f70565b602060405180830381600087803b1580156133d557600080fd5b505af11580156133e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061340d9190613ddb565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120868452929091526134679060016142bc565b6000858152602081815260409182902092909255805180830187905280820184905281518082038301815260609091019091528051910120612cca565b60006001600160e01b031982166380ac58cd60e01b14806134d557506001600160e01b03198216635b5e139f60e01b145b80610acd57506301ffc9a760e01b6001600160e01b0319831614610acd565b610d4f838383613632565b6110698282604051806020016040528060008152506136bd565b600061247582846143a0565b60006001600160a01b0384163b1561362757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613569903390899088908890600401613f3d565b602060405180830381600087803b15801561358357600080fd5b505af19250505080156135b3575060408051601f3d908101601f191682019092526135b091810190613e34565b60015b61360d573d8080156135e1576040519150601f19603f3d011682016040523d82523d6000602084013e6135e6565b606091505b5080516136055760405162461bcd60e51b8152600401610afd90613ff7565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612cca565b506001949350505050565b61363d8383836136f0565b600c546001600160a01b03163314610d4f57600c54600160a01b900460ff1615610d4f5760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610afd565b6136c783836137a8565b6136d46000848484613525565b610d4f5760405162461bcd60e51b8152600401610afd90613ff7565b6001600160a01b03831661374b5761374681600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b61376e565b816001600160a01b0316836001600160a01b03161461376e5761376e83826138e7565b6001600160a01b03821661378557610d4f81613984565b826001600160a01b0316826001600160a01b031614610d4f57610d4f8282613a5d565b6001600160a01b0382166137fe5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610afd565b61380781612b21565b156138545760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610afd565b613860600083836134f4565b6001600160a01b03821660009081526005602052604081208054600192906138899084906142bc565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600060016138f4846116fa565b6138fe9190614307565b600083815260096020526040902054909150808214613951576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a5460009061399690600190614307565b6000838152600b6020526040812054600a80549394509092849081106139cc57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600a83815481106139fb57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a805480613a4157634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000613a68836116fa565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b828054613aad9061434a565b90600052602060002090601f016020900481019282613acf5760008555613b15565b82601f10613ae857805160ff1916838001178555613b15565b82800160010185558215613b15579182015b82811115613b15578251825591602001919060010190613afa565b50613b21929150613b25565b5090565b5b80821115613b215760008155600101613b26565b600067ffffffffffffffff831115613b5457613b546143e0565b613b67601f8401601f191660200161428b565b9050828152838383011115613b7b57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613ba3578081fd5b8135612475816143f6565b600060208284031215613bbf578081fd5b8151612475816143f6565b60008060408385031215613bdc578081fd5b8235613be7816143f6565b91506020830135613bf7816143f6565b809150509250929050565b600080600060608486031215613c16578081fd5b8335613c21816143f6565b92506020840135613c31816143f6565b929592945050506040919091013590565b60008060008060808587031215613c57578081fd5b8435613c62816143f6565b93506020850135613c72816143f6565b925060408501359150606085013567ffffffffffffffff811115613c94578182fd5b8501601f81018713613ca4578182fd5b613cb387823560208401613b3a565b91505092959194509250565b60008060408385031215613cd1578182fd5b8235613cdc816143f6565b91506020830135613bf78161440b565b60008060408385031215613cfe578182fd5b8235613d09816143f6565b946020939093013593505050565b60006020808385031215613d29578182fd5b823567ffffffffffffffff80821115613d40578384fd5b818501915085601f830112613d53578384fd5b813581811115613d6557613d656143e0565b8060051b9150613d7684830161428b565b8181528481019084860184860187018a1015613d90578788fd5b8795505b83861015613db2578035835260019590950194918601918601613d94565b5098975050505050505050565b600060208284031215613dd0578081fd5b81356124758161440b565b600060208284031215613dec578081fd5b81516124758161440b565b60008060408385031215613e09578182fd5b50508035926020909101359150565b600060208284031215613e29578081fd5b813561247581614419565b600060208284031215613e45578081fd5b815161247581614419565b600060208284031215613e61578081fd5b813567ffffffffffffffff811115613e77578182fd5b8201601f81018413613e87578182fd5b612cca84823560208401613b3a565b600060208284031215613ea7578081fd5b5035919050565b600060208284031215613ebf578081fd5b5051919050565b60008151808452613ede81602086016020860161431e565b601f01601f19169290920160200192915050565b60008251613f0481846020870161431e565b9190910192915050565b60008351613f2081846020880161431e565b835190830190613f3481836020880161431e565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610f4090830184613ec6565b60018060a01b0384168152826020820152606060408201526000613f976060830184613ec6565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015613fd857835183529284019291840191600101613fbc565b50909695505050505050565b6020815260006124756020830184613ec6565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252600c908201526b5a65726f206164647265737360a01b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526022908201527f5468697320746f6b656e2068617320616c7265616479206265656e206d696e74604082015261195960f21b606082015260800190565b6020808252600f908201526e141a185cd9480c881b9bdd08195b99608a1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260119082015270141a185cd9480c881b9bdd081cdd185c9d607a1b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600061022082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151614223828501826001600160a01b03169052565b505061012083810151908301526101408084015190830152610160808401511515908301526101808084015160ff16908301526101a080840151908301526101c080840151908301526101e08084015190830152610200928301511515929091019190915290565b604051601f8201601f1916810167ffffffffffffffff811182821017156142b4576142b46143e0565b604052919050565b600082198211156142cf576142cf6143b4565b500190565b6000826142e3576142e36143ca565b500490565b6000816000190483118215151615614302576143026143b4565b500290565b600082821015614319576143196143b4565b500390565b60005b83811015614339578181015183820152602001614321565b8381111561220c5750506000910152565b600181811c9082168061435e57607f821691505b6020821081141561437f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614399576143996143b4565b5060010190565b6000826143af576143af6143ca565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b1957600080fd5b8015158114610b1957600080fd5b6001600160e01b031981168114610b1957600080fdfea2646970667358221220c551ace3ab7bc3161242a88b3c70a8813a2bda6153a0286c302264cc49d15dd364736f6c634300080400330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000db73cf8b384347423dfa4f0010c6e17d2f54d8437eb5267d0fb3bd0fd1c72056716a9cbbbde0483e75a788cef017eb3a815d10e90000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103a25760003560e01c806357d64288116101e757806394985ddd1161010d578063c87b56dd116100a0578063df5d85e31161006f578063df5d85e314610a25578063e985e9c514610a46578063f2fde38b14610a8f578063fd12c96814610aaf57600080fd5b8063c87b56dd146109bb578063d477f05f146109db578063d547cfb7146109fb578063dbdff2c114610a1057600080fd5b8063a3da17aa116100dc578063a3da17aa14610942578063b88d4fde14610962578063c19d93fb14610982578063c409084a146109a457600080fd5b806394985ddd146108cd57806395d89b41146108ed578063a22cb46514610902578063a284673f1461092257600080fd5b80637cd9cd1511610185578063898ffd5811610154578063898ffd58146108695780638ad5de281461087f5780638da5cb5b1461089457806392ff8eb2146108b257600080fd5b80637cd9cd151461080b57806380372e061461081e578063826d33791461083357806387c6783f1461085357600080fd5b80636352211e116101c15780636352211e146107a05780636b31ee01146107c057806370a08231146107d6578063715018a6146107f657600080fd5b806357d642881461074d57806359a7715a1461076c5780635c975abb1461078157600080fd5b80632f745c59116102cc5780633f7fc3951161026a5780634a09a53c116102395780634a09a53c146106e25780634c261247146106f75780634f6ccce71461071757806351814d2b1461073757600080fd5b80633f7fc3951461065f57806342842e0e1461067557806342966c6814610695578063438b6300146106b557600080fd5b80633609ac8f116102a65780633609ac8f146105f55780633ad10ef61461060a5780633ccfd60b1461062a5780633dbcbe881461063f57600080fd5b80632f745c591461059f578063326f9d60146105bf5780633502a716146105df57600080fd5b80630eca1d891161034457806323592c3c1161031357806323592c3c1461053457806323b872dd1461054957806326a49e37146105695780632afe76a11461058957600080fd5b80630eca1d89146104da57806312b64079146104f057806316f4d0221461050a57806318160ddd1461051f57600080fd5b8063081812fc11610380578063081812fc14610420578063095ea7b3146104585780630a032700146104785780630e439326146104ba57600080fd5b806301ffc9a7146103a757806302329a29146103dc57806306fdde03146103fe575b600080fd5b3480156103b357600080fd5b506103c76103c2366004613e18565b610ac2565b60405190151581526020015b60405180910390f35b3480156103e857600080fd5b506103fc6103f7366004613dbf565b610ad3565b005b34801561040a57600080fd5b50610413610b24565b6040516103d39190613fe4565b34801561042c57600080fd5b5061044061043b366004613e96565b610bb6565b6040516001600160a01b0390911681526020016103d3565b34801561046457600080fd5b506103fc610473366004613cec565b610c3e565b34801561048457600080fd5b506104ac7f7eb5267d0fb3bd0fd1c72056716a9cbbbde0483e75a788cef017eb3a815d10e981565b6040519081526020016103d3565b3480156104c657600080fd5b50600d54610440906001600160a01b031681565b3480156104e657600080fd5b506104ac60165481565b3480156104fc57600080fd5b506018546103c79060ff1681565b34801561051657600080fd5b506104ac610d54565b34801561052b57600080fd5b50600a546104ac565b34801561054057600080fd5b506103fc610d77565b34801561055557600080fd5b506103fc610564366004613c02565b610e38565b34801561057557600080fd5b506104ac610584366004613e96565b610e6a565b34801561059557600080fd5b506104ac60135481565b3480156105ab57600080fd5b506104ac6105ba366004613cec565b610f96565b3480156105cb57600080fd5b506103fc6105da366004613e50565b61102c565b3480156105eb57600080fd5b506104ac611f4081565b34801561060157600080fd5b506104ac600081565b34801561061657600080fd5b50601054610440906001600160a01b031681565b34801561063657600080fd5b506103fc61106d565b34801561064b57600080fd5b50601454610440906001600160a01b031681565b34801561066b57600080fd5b506104ac611b5881565b34801561068157600080fd5b506103fc610690366004613c02565b61110c565b3480156106a157600080fd5b506103fc6106b0366004613e96565b611127565b3480156106c157600080fd5b506106d56106d0366004613b92565b61119e565b6040516103d39190613fa0565b3480156106ee57600080fd5b506103fc61125c565b34801561070357600080fd5b506103fc610712366004613e50565b6114e3565b34801561072357600080fd5b506104ac610732366004613e96565b6115d8565b34801561074357600080fd5b506104ac60175481565b34801561075957600080fd5b506018546103c790610100900460ff1681565b34801561077857600080fd5b506104ac611679565b34801561078d57600080fd5b50600c54600160a01b900460ff166103c7565b3480156107ac57600080fd5b506104406107bb366004613e96565b611683565b3480156107cc57600080fd5b506104ac60125481565b3480156107e257600080fd5b506104ac6107f1366004613b92565b6116fa565b34801561080257600080fd5b506103fc611781565b6103fc610819366004613d17565b6117b7565b34801561082a57600080fd5b506103fc611bb9565b34801561083f57600080fd5b506104ac61084e366004613e96565b611e0a565b34801561085f57600080fd5b506104ac60155481565b34801561087557600080fd5b506104ac6103e881565b34801561088b57600080fd5b506104ac601481565b3480156108a057600080fd5b50600c546001600160a01b0316610440565b3480156108be57600080fd5b506104ac66b1a2bc2ec5000081565b3480156108d957600080fd5b506103fc6108e8366004613df7565b611ec9565b3480156108f957600080fd5b50610413611f4b565b34801561090e57600080fd5b506103fc61091d366004613cbf565b611f5a565b34801561092e57600080fd5b506103fc61093d366004613e96565b61201f565b34801561094e57600080fd5b506103fc61095d366004613e96565b61204e565b34801561096e57600080fd5b506103fc61097d366004613c42565b6121da565b34801561098e57600080fd5b50610997612212565b6040516103d391906141b5565b3480156109b057600080fd5b506104ac62030ad881565b3480156109c757600080fd5b506104136109d6366004613e96565b6123b1565b3480156109e757600080fd5b506103fc6109f6366004613b92565b61247c565b348015610a0757600080fd5b506104136124ee565b348015610a1c57600080fd5b506104ac61257c565b348015610a3157600080fd5b506014546103c790600160a01b900460ff1681565b348015610a5257600080fd5b506103c7610a61366004613bca565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a9b57600080fd5b506103fc610aaa366004613b92565b612691565b6103fc610abd366004613e96565b612729565b6000610acd826129f6565b92915050565b600c546001600160a01b03163314610b065760405162461bcd60e51b8152600401610afd90614104565b60405180910390fd5b60018115151415610b1c57610b19612a1b565b50565b610b19612a9d565b606060028054610b339061434a565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5f9061434a565b8015610bac5780601f10610b8157610100808354040283529160200191610bac565b820191906000526020600020905b815481529060010190602001808311610b8f57829003601f168201915b5050505050905090565b6000610bc182612b21565b610c225760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610afd565b506000908152600660205260409020546001600160a01b031690565b6000610c4982611683565b9050806001600160a01b0316836001600160a01b03161415610cb75760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610afd565b336001600160a01b0382161480610cd35750610cd38133610a61565b610d455760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610afd565b610d4f8383612b3e565b505050565b6000610d726103e8610d6c610d67611679565b612bac565b90612bdc565b905090565b600c546001600160a01b03163314610da15760405162461bcd60e51b8152600401610afd90614104565b600060165411610dc35760405162461bcd60e51b8152600401610afd90614139565b601654431015610de55760405162461bcd60e51b8152600401610afd906140db565b60185460ff1615610e2b5760405162461bcd60e51b815260206004820152601060248201526f141a185cd9480c881c995d99585b195960821b6044820152606401610afd565b610e3361257c565b601a55565b610e43335b82612be8565b610e5f5760405162461bcd60e51b8152600401610afd90614164565b610d4f838383612cd2565b600080610e75611679565b90506014831115610eb45760405162461bcd60e51b815260206004820152600960248201526813585e0818dbdd5b9d60ba1b6044820152606401610afd565b611f40610ec184836142bc565b1115610efb5760405162461bcd60e51b815260206004820152600960248201526813585e081b1a5b5a5d60ba1b6044820152606401610afd565b6000610f0682612bac565b90506000610f16826103e8612bdc565b90506000610f248385612e7d565b9050808611610f4a57610f4086610f3a84611e0a565b90612e89565b9695505050505050565b6000610f5982610f3a85611e0a565b90506000610f678884612e7d565b90506000610f7d82610f3a61084e886001612e95565b9050610f898382612e95565b9998505050505050505050565b6000610fa1836116fa565b82106110035760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610afd565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b600c546001600160a01b031633146110565760405162461bcd60e51b8152600401610afd90614104565b8051611069906011906020840190613aa1565b5050565b600c546001600160a01b031633146110975760405162461bcd60e51b8152600401610afd90614104565b60006110ae60135447612e7d90919063ffffffff16565b9050600081116110f65760405162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20776974686472617760681b6044820152606401610afd565b601054610b19906001600160a01b031682612ea1565b610d4f838383604051806020016040528060008152506121da565b61113033610e3d565b6111955760405162461bcd60e51b815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201526f1b995c881b9bdc88185c1c1c9bdd995960821b6064820152608401610afd565b610b1981612f37565b606060006111ab836116fa565b905060008167ffffffffffffffff8111156111d657634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156111ff578160200160208202803683370190505b50905060005b82811015611254576112178582610f96565b82828151811061123757634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061124c81614385565b915050611205565b509392505050565b600c54600160a01b900460ff16156112865760405162461bcd60e51b8152600401610afd9061406f565b6000601654116112a85760405162461bcd60e51b8152600401610afd90614139565b60185460ff166112ca5760405162461bcd60e51b8152600401610afd906140db565b601754336112ea5760405162461bcd60e51b8152600401610afd90614049565b336112f482611683565b6001600160a01b03161461133f5760405162461bcd60e51b81526020600482015260126024820152712737ba10383430b9b29019103bb4b73732b960711b6044820152606401610afd565b601854610100900460ff16156113975760405162461bcd60e51b815260206004820152601760248201527f50686173652032206a61636b706f7420636c61696d65640000000000000000006044820152606401610afd565b6000601254116113d65760405162461bcd60e51b815260206004820152600a602482015269139bc81a9858dadc1bdd60b21b6044820152606401610afd565b60006113f36064610d6c6032601254612e8990919063ffffffff16565b90506000811161143a5760405162461bcd60e51b8152602060048201526012602482015271139bc81c1a185cd9480c881a9858dadc1bdd60721b6044820152606401610afd565b8060135410156114815760405162461bcd60e51b8152602060048201526012602482015271139bdd08195b9bdd59da081a9858dadc1bdd60721b6044820152606401610afd565b6018805461ff00191661010017905560125461149d9082612e7d565b6013556114ab335b82612ea1565b6040513381527f28ed9ce03503bc4013bd8f26286ea0d779a29ccc8318a3d8935d4f932c07174b906020015b60405180910390a15050565b600c546001600160a01b0316331461150d5760405162461bcd60e51b8152600401610afd90614104565b6000816040516020016115209190613ef2565b604051602081830303815290604052805190602001209050807f7eb5267d0fb3bd0fd1c72056716a9cbbbde0483e75a788cef017eb3a815d10e9146115975760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610afd565b81516115aa906011906020850190613aa1565b506040517f66b9f0d2f5af4125e8098bf5f1efc517ed46a70d8638734d186af310e2f8bc7590600090a15050565b60006115e3600a5490565b82106116465760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610afd565b600a828154811061166757634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000610d72612fde565b6000818152600460205260408120546001600160a01b031680610acd5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610afd565b60006001600160a01b0382166117655760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610afd565b506001600160a01b031660009081526005602052604090205490565b600c546001600160a01b031633146117ab5760405162461bcd60e51b8152600401610afd90614104565b6117b56000612fe9565b565b6002600154141561180a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afd565b6002600155611f4061181a612fde565b106118525760405162461bcd60e51b815260206004820152600860248201526714d85b1948195b9960c21b6044820152606401610afd565b600c546001600160a01b0316331461188e57600c54600160a01b900460ff161561188e5760405162461bcd60e51b8152600401610afd9061406f565b60005b8151811015611a9a5760008282815181106118bc57634e487b7160e01b600052603260045260246000fd5b60200260200101511180156118f95750611f418282815181106118ef57634e487b7160e01b600052603260045260246000fd5b6020026020010151105b6119385760405162461bcd60e51b815260206004820152601060248201526f151bdad95b881251081a5b9d985b1a5960821b6044820152606401610afd565b600e54825133916001600160a01b031690636352211e9085908590811061196f57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161199591815260200190565b60206040518083038186803b1580156119ad57600080fd5b505afa1580156119c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e59190613bae565b6001600160a01b031614611a3b5760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420746865206f776e6572206f662074686973206c6f6f740000000000006044820152606401610afd565b611a6b828281518110611a5e57634e487b7160e01b600052603260045260246000fd5b6020026020010151612b21565b15611a885760405162461bcd60e51b8152600401610afd90614099565b80611a9281614385565b915050611891565b506000611aa78251610e6a565b905080341015611aed5760405162461bcd60e51b815260206004820152601160248201527056616c75652062656c6f7720707269636560781b6044820152606401610afd565b6000611af93483612e7d565b90508115611b2657601054611b26906001600160a01b0316611b216064610d6c86605a612e89565b612ea1565b60005b8351811015611b7557611b6333858381518110611b5657634e487b7160e01b600052603260045260246000fd5b602002602001015161303b565b80611b6d81614385565b915050611b29565b508115611ba157611b98611b8f6064610d6c85600a612e89565b60125490612e95565b60128190556013555b8015611bb057611bb0336114a5565b50506001805550565b600c54600160a01b900460ff1615611be35760405162461bcd60e51b8152600401610afd9061406f565b6014546001600160a01b0316611c0b5760405162461bcd60e51b8152600401610afd90614049565b6014546001600160a01b0316336001600160a01b031614611c635760405162461bcd60e51b81526020600482015260126024820152712737ba10383430b9b29018903bb4b73732b960711b6044820152606401610afd565b601454600160a01b900460ff1615611cbd5760405162461bcd60e51b815260206004820152601760248201527f50686173652031206a61636b706f7420636c61696d65640000000000000000006044820152606401610afd565b600060125411611cfc5760405162461bcd60e51b815260206004820152600a602482015269139bc81a9858dadc1bdd60b21b6044820152606401610afd565b6000611d196064610d6c6032601254612e8990919063ffffffff16565b905060008111611d605760405162461bcd60e51b8152602060048201526012602482015271139bc81c1a185cd9480c481a9858dadc1bdd60721b6044820152606401610afd565b806013541015611da75760405162461bcd60e51b8152602060048201526012602482015271139bdd08195b9bdd59da081a9858dadc1bdd60721b6044820152606401610afd565b6014805460ff60a01b1916600160a01b179055601254611dc79082612e7d565b601355611dd3336114a5565b6040513381527f06f935d2d2a54d22e79e87581f623937bc3a224d413147f6bda873618b51c5be906020015b60405180910390a150565b60006001821015611e515760405162461bcd60e51b81526020600482015260116024820152704f7574206f6620746965722072616e676560781b6044820152606401610afd565b611e5f611f406103e8612bdc565b821115611ea25760405162461bcd60e51b81526020600482015260116024820152704f7574206f6620746965722072616e676560781b6044820152606401610afd565b610acd611ec1611eb3846001612e7d565b66b1a2bc2ec5000090612e89565b600090612e95565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79521614611f415760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610afd565b61106982826130ea565b606060038054610b339061434a565b6001600160a01b038216331415611fb35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610afd565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600c546001600160a01b031633146120495760405162461bcd60e51b8152600401610afd90614104565b601b55565b600c546001600160a01b031633146120785760405162461bcd60e51b8152600401610afd90614104565b60006016541161209a5760405162461bcd60e51b8152600401610afd90614139565b6016544310156120bc5760405162461bcd60e51b8152600401610afd906140db565b60185460ff16156121025760405162461bcd60e51b815260206004820152601060248201526f141a185cd9480c881c995d99585b195960821b6044820152606401610afd565b611f40811061214b5760405162461bcd60e51b8152602060048201526015602482015274546f6b656e206964206f7574206f662072616e676560581b6044820152606401610afd565b61215481612b21565b6121965760405162461bcd60e51b8152602060048201526013602482015272546f6b656e204944206e6f742065786973747360681b6044820152606401610afd565b6018805460ff1916600117905560178190556040517f463bd68ccfd01ef4adcac23ddf662b021817a533ad93e24c56bef90204e1402a90611dff9083815260200190565b6121e43383612be8565b6122005760405162461bcd60e51b8152600401610afd90614164565b61220c848484846131c2565b50505050565b6122a9604051806102200160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016000815260200160008152602001600015158152602001600060ff1681526020016000815260200160008152602001600081526020016000151581525090565b60006122b3610d54565b90506000604051806102200160405280611f40815260200160148152602001600081526020016103e88152602001601254815260200160135481526020016123076002601254612bdc90919063ffffffff16565b81526020016123226002601254612bdc90919063ffffffff16565b81526014546001600160a01b0316602082015260165460408201819052601754606083015260185460ff161515608083015260a09091019015612366576002612369565b60015b60ff16815260200183815260200161238084611e0a565b815260200161238d612fde565b81526020016123a6600c5460ff600160a01b9091041690565b151590529392505050565b60606123bc82612b21565b6124205760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610afd565b600061242a6131f5565b9050600081511161244a5760405180602001604052806000815250612475565b8061245484613204565b604051602001612465929190613f0e565b6040516020818303038152906040525b9392505050565b600c546001600160a01b031633146124a65760405162461bcd60e51b8152600401610afd90614104565b6001600160a01b0381166124cc5760405162461bcd60e51b8152600401610afd90614049565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b601180546124fb9061434a565b80601f01602080910402602001604051908101604052809291908181526020018280546125279061434a565b80156125745780601f1061254957610100808354040283529160200191612574565b820191906000526020600020905b81548152906001019060200180831161255757829003601f168201915b505050505081565b600c546000906001600160a01b031633146125a95760405162461bcd60e51b8152600401610afd90614104565b601b546040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a082319060240160206040518083038186803b15801561260b57600080fd5b505afa15801561261f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126439190613eae565b10156126835760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420656e6f756768204c494e4b60881b6044820152606401610afd565b610d72601954601b5461331e565b600c546001600160a01b031633146126bb5760405162461bcd60e51b8152600401610afd90614104565b6001600160a01b0381166127205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610afd565b610b1981612fe9565b6002600154141561277c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afd565b6002600155611f4061278c612fde565b106127c45760405162461bcd60e51b815260206004820152600860248201526714d85b1948195b9960c21b6044820152606401610afd565b600c546001600160a01b0316331461280057600c54600160a01b900460ff16156128005760405162461bcd60e51b8152600401610afd9061406f565b6000811180156128115750611f4181105b6128505760405162461bcd60e51b815260206004820152601060248201526f151bdad95b881251081a5b9d985b1a5960821b6044820152606401610afd565b33600e546040516331a9108f60e11b8152600481018490526001600160a01b039283169290911690636352211e9060240160206040518083038186803b15801561289957600080fd5b505afa1580156128ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d19190613bae565b6001600160a01b0316146129275760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420746865206f776e6572206f662074686973206c6f6f740000000000006044820152606401610afd565b61293081612b21565b1561294d5760405162461bcd60e51b8152600401610afd90614099565b60006129596001610e6a565b90508034101561299f5760405162461bcd60e51b815260206004820152601160248201527056616c75652062656c6f7720707269636560781b6044820152606401610afd565b60006129ab3483612e7d565b905081156129d3576010546129d3906001600160a01b0316611b216064610d6c86605a612e89565b6129dd338461303b565b8115611ba157611b98611b8f6064610d6c85600a612e89565b60006001600160e01b0319821663780e9d6360e01b1480610acd5750610acd826134a4565b600c54600160a01b900460ff1615612a455760405162461bcd60e51b8152600401610afd9061406f565b600c805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612a803390565b6040516001600160a01b03909116815260200160405180910390a1565b600c54600160a01b900460ff16612aed5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610afd565b600c805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612a80565b6000908152600460205260409020546001600160a01b0316151590565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612b7382611683565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611f40821415612bc15750611f40919050565b610acd6103e8610f3a6001612bd68684612bdc565b90612e95565b600061247582846142d4565b6000612bf382612b21565b612c545760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610afd565b6000612c5f83611683565b9050806001600160a01b0316846001600160a01b03161480612c9a5750836001600160a01b0316612c8f84610bb6565b6001600160a01b0316145b80612cca57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612ce582611683565b6001600160a01b031614612d4d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610afd565b6001600160a01b038216612daf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610afd565b612dba8383836134f4565b612dc5600082612b3e565b6001600160a01b0383166000908152600560205260408120805460019290612dee908490614307565b90915550506001600160a01b0382166000908152600560205260408120805460019290612e1c9084906142bc565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006124758284614307565b600061247582846142e8565b600061247582846142bc565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612eee576040519150601f19603f3d011682016040523d82523d6000602084013e612ef3565b606091505b5050905080610d4f5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610afd565b6000612f4282611683565b9050612f50816000846134f4565b612f5b600083612b3e565b6001600160a01b0381166000908152600560205260408120805460019290612f84908490614307565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000610d72600f5490565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b613049600f80546001019055565b61305382826134ff565b60405181907f8653f1bbeeba5331990bffb2cb4b8a17cad3377dc14dc6a1db1b7e279085381190600090a2611b58613089612fde565b1415611069574360158190556130a29062030ad8612e95565b601655601480546001600160a01b031916339081179091556040519081527f01e473c9fc5bf2d038009ef5bdf7f56d2a8d1fe8bcb1a26c4af389f85671ff3d906020016114d7565b601a5482146130f7575050565b60185460ff1615613106575050565b6016541580613116575060165443105b1561311f575050565b6018805460ff1916600190811790915561313f90612bd683611f40613519565b601781905561314d90612b21565b61318f5760405162461bcd60e51b8152602060048201526013602482015272546f6b656e204944206e6f742065786973747360681b6044820152606401610afd565b7f463bd68ccfd01ef4adcac23ddf662b021817a533ad93e24c56bef90204e1402a6017546040516114d791815260200190565b6131cd848484612cd2565b6131d984848484613525565b61220c5760405162461bcd60e51b8152600401610afd90613ff7565b606060118054610b339061434a565b6060816132285750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613252578061323c81614385565b915061324b9050600a836142d4565b915061322c565b60008167ffffffffffffffff81111561327b57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156132a5576020820181803683370190505b5090505b8415612cca576132ba600183614307565b91506132c7600a866143a0565b6132d29060306142bc565b60f81b8183815181106132f557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350613317600a866142d4565b94506132a9565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79528486600060405160200161338e929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016133bb93929190613f70565b602060405180830381600087803b1580156133d557600080fd5b505af11580156133e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061340d9190613ddb565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120868452929091526134679060016142bc565b6000858152602081815260409182902092909255805180830187905280820184905281518082038301815260609091019091528051910120612cca565b60006001600160e01b031982166380ac58cd60e01b14806134d557506001600160e01b03198216635b5e139f60e01b145b80610acd57506301ffc9a760e01b6001600160e01b0319831614610acd565b610d4f838383613632565b6110698282604051806020016040528060008152506136bd565b600061247582846143a0565b60006001600160a01b0384163b1561362757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613569903390899088908890600401613f3d565b602060405180830381600087803b15801561358357600080fd5b505af19250505080156135b3575060408051601f3d908101601f191682019092526135b091810190613e34565b60015b61360d573d8080156135e1576040519150601f19603f3d011682016040523d82523d6000602084013e6135e6565b606091505b5080516136055760405162461bcd60e51b8152600401610afd90613ff7565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612cca565b506001949350505050565b61363d8383836136f0565b600c546001600160a01b03163314610d4f57600c54600160a01b900460ff1615610d4f5760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610afd565b6136c783836137a8565b6136d46000848484613525565b610d4f5760405162461bcd60e51b8152600401610afd90613ff7565b6001600160a01b03831661374b5761374681600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b61376e565b816001600160a01b0316836001600160a01b03161461376e5761376e83826138e7565b6001600160a01b03821661378557610d4f81613984565b826001600160a01b0316826001600160a01b031614610d4f57610d4f8282613a5d565b6001600160a01b0382166137fe5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610afd565b61380781612b21565b156138545760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610afd565b613860600083836134f4565b6001600160a01b03821660009081526005602052604081208054600192906138899084906142bc565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600060016138f4846116fa565b6138fe9190614307565b600083815260096020526040902054909150808214613951576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a5460009061399690600190614307565b6000838152600b6020526040812054600a80549394509092849081106139cc57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600a83815481106139fb57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a805480613a4157634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000613a68836116fa565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b828054613aad9061434a565b90600052602060002090601f016020900481019282613acf5760008555613b15565b82601f10613ae857805160ff1916838001178555613b15565b82800160010185558215613b15579182015b82811115613b15578251825591602001919060010190613afa565b50613b21929150613b25565b5090565b5b80821115613b215760008155600101613b26565b600067ffffffffffffffff831115613b5457613b546143e0565b613b67601f8401601f191660200161428b565b9050828152838383011115613b7b57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613ba3578081fd5b8135612475816143f6565b600060208284031215613bbf578081fd5b8151612475816143f6565b60008060408385031215613bdc578081fd5b8235613be7816143f6565b91506020830135613bf7816143f6565b809150509250929050565b600080600060608486031215613c16578081fd5b8335613c21816143f6565b92506020840135613c31816143f6565b929592945050506040919091013590565b60008060008060808587031215613c57578081fd5b8435613c62816143f6565b93506020850135613c72816143f6565b925060408501359150606085013567ffffffffffffffff811115613c94578182fd5b8501601f81018713613ca4578182fd5b613cb387823560208401613b3a565b91505092959194509250565b60008060408385031215613cd1578182fd5b8235613cdc816143f6565b91506020830135613bf78161440b565b60008060408385031215613cfe578182fd5b8235613d09816143f6565b946020939093013593505050565b60006020808385031215613d29578182fd5b823567ffffffffffffffff80821115613d40578384fd5b818501915085601f830112613d53578384fd5b813581811115613d6557613d656143e0565b8060051b9150613d7684830161428b565b8181528481019084860184860187018a1015613d90578788fd5b8795505b83861015613db2578035835260019590950194918601918601613d94565b5098975050505050505050565b600060208284031215613dd0578081fd5b81356124758161440b565b600060208284031215613dec578081fd5b81516124758161440b565b60008060408385031215613e09578182fd5b50508035926020909101359150565b600060208284031215613e29578081fd5b813561247581614419565b600060208284031215613e45578081fd5b815161247581614419565b600060208284031215613e61578081fd5b813567ffffffffffffffff811115613e77578182fd5b8201601f81018413613e87578182fd5b612cca84823560208401613b3a565b600060208284031215613ea7578081fd5b5035919050565b600060208284031215613ebf578081fd5b5051919050565b60008151808452613ede81602086016020860161431e565b601f01601f19169290920160200192915050565b60008251613f0481846020870161431e565b9190910192915050565b60008351613f2081846020880161431e565b835190830190613f3481836020880161431e565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610f4090830184613ec6565b60018060a01b0384168152826020820152606060408201526000613f976060830184613ec6565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015613fd857835183529284019291840191600101613fbc565b50909695505050505050565b6020815260006124756020830184613ec6565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252600c908201526b5a65726f206164647265737360a01b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526022908201527f5468697320746f6b656e2068617320616c7265616479206265656e206d696e74604082015261195960f21b606082015260800190565b6020808252600f908201526e141a185cd9480c881b9bdd08195b99608a1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260119082015270141a185cd9480c881b9bdd081cdd185c9d607a1b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600061022082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151614223828501826001600160a01b03169052565b505061012083810151908301526101408084015190830152610160808401511515908301526101808084015160ff16908301526101a080840151908301526101c080840151908301526101e08084015190830152610200928301511515929091019190915290565b604051601f8201601f1916810167ffffffffffffffff811182821017156142b4576142b46143e0565b604052919050565b600082198211156142cf576142cf6143b4565b500190565b6000826142e3576142e36143ca565b500490565b6000816000190483118215151615614302576143026143b4565b500290565b600082821015614319576143196143b4565b500390565b60005b83811015614339578181015183820152602001614321565b8381111561220c5750506000910152565b600181811c9082168061435e57607f821691505b6020821081141561437f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614399576143996143b4565b5060010190565b6000826143af576143af6143ca565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b1957600080fd5b8015158114610b1957600080fd5b6001600160e01b031981168114610b1957600080fdfea2646970667358221220c551ace3ab7bc3161242a88b3c70a8813a2bda6153a0286c302264cc49d15dd364736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000db73cf8b384347423dfa4f0010c6e17d2f54d8437eb5267d0fb3bd0fd1c72056716a9cbbbde0483e75a788cef017eb3a815d10e90000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : baseURI (string):
Arg [1] : dev (address): 0xDb73Cf8b384347423dFA4f0010c6E17D2f54d843
Arg [2] : proof (bytes32): 0x7eb5267d0fb3bd0fd1c72056716a9cbbbde0483e75a788cef017eb3a815d10e9
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 000000000000000000000000db73cf8b384347423dfa4f0010c6e17d2f54d843
Arg [2] : 7eb5267d0fb3bd0fd1c72056716a9cbbbde0483e75a788cef017eb3a815d10e9
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.