ERC-721
Source Code
Overview
Max Total Supply
10,040 DEGN
Holders
1,075
Transfers
-
0
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
| # | Exchange | Pair | Price | 24H Volume | % Volume |
|---|
Contract Name:
PFP
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 15000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./VRFConsumerBase.sol";
import "./ERC721A.sol";
import "./EPSInterface/IEPSDelegationRegister.sol";
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
contract PFP is ERC721A, Ownable, VRFConsumerBase {
using Strings for uint256;
uint256 public constant MAX_TOKENS = 20000;
string public constant BASE_EXTENSION = ".json";
string public _baseURIextended;
address public _passAddress;
bool public revealed = false;
string public notRevealedUri = "";
uint256 public randStartPos;
bytes32 public immutable vrfKeyHash;
bytes32 public request_id;
IEPSDelegationRegister public immutable EPS;
bytes32 public snapshotMerkleRoot;
bool public claimIsActive = false;
mapping (address => uint256) public _claimedAmount;
error ClaimExceedsAllowance(uint128 claim, uint128 allowance);
error InvalidProof();
event WebaversePFPMint(uint256 amountMinted);
event CollectionRevealed(uint256 randomStartPosition);
constructor(
address passAddress_,
address epsAddress_,
address _ChainlinkVRFCoordinator,
address _ChainlinkLINKToken,
bytes32 _ChainlinkKeyHash
) ERC721A("Degens of The Street", "DEGN") VRFConsumerBase(_ChainlinkVRFCoordinator, _ChainlinkLINKToken) {
_passAddress = passAddress_;
vrfKeyHash = _ChainlinkKeyHash;
EPS = IEPSDelegationRegister(epsAddress_);
}
function setBaseURI(string memory baseURI_) external onlyOwner() {
require(!revealed, "Collection revealed, cannot set URI");
_baseURIextended = baseURI_;
}
function _baseURI() internal view virtual override returns (string memory) {
return _baseURIextended;
}
function setPassContract(address passAddress_) external onlyOwner {
_passAddress = passAddress_;
}
function getPassContract() external view returns (address) {
return _passAddress;
}
function reveal() external onlyOwner {
if(!revealed) {
getRandomNumber();
}
}
function setNotRevealedURI(string memory _notRevealedURI) external onlyOwner {
notRevealedUri = _notRevealedURI;
}
function setMerkleRoot(bytes32 merkleRoot) public onlyOwner returns (bytes32) {
snapshotMerkleRoot = merkleRoot;
return snapshotMerkleRoot;
}
function flipClaimState() external onlyOwner {
claimIsActive = !claimIsActive;
}
/**
* Returns the tokenURI
* Random starting positions can only be set before the token's metadata is revealed.
*
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory)
{
if(revealed == false) {
return notRevealedUri;
}
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, ((tokenId+randStartPos) % MAX_TOKENS).toString(), BASE_EXTENSION))
: "";
}
function claimTokens(bytes32[] calldata merkleProof, uint256 numberOfTokens, uint256 allowance ) external {
require(claimIsActive, "Claim is not active yet!");
require(totalSupply() + numberOfTokens <= MAX_TOKENS, "Claim would exceed max supply of tokens!");
address[] memory coldWallets = EPS.getAddresses(msg.sender, _passAddress, 1, true, true);
for (uint256 i = 0; i < coldWallets.length; i++) {
address coldWallet = coldWallets[i];
string memory coldWallet_str = Strings.toHexString(uint256(uint160(coldWallet)), 20);
string memory claiming_str = string(abi.encodePacked(coldWallet_str, '_', allowance.toString()));
if (MerkleProof.verify(merkleProof, snapshotMerkleRoot, keccak256(bytes(claiming_str)))) {
if(_claimedAmount[coldWallet] + numberOfTokens <= allowance ) {
_claimedAmount[coldWallet] += numberOfTokens;
_safeMint(msg.sender, numberOfTokens);
emit WebaversePFPMint(numberOfTokens);
// Function exit 1: success
return;
} else {
// Function exit 2: claim exceeds allowance
revert ClaimExceedsAllowance(uint128(numberOfTokens), uint128(allowance - _claimedAmount[coldWallet]));
}
}
}
// Function exit 3: no matching proof
revert InvalidProof();
}
function mintTokens(uint256 numberOfTokens) external onlyOwner {
require(!claimIsActive, "Claim is not finished yet!");
require(totalSupply() + numberOfTokens <= MAX_TOKENS, "Claim would exceed max supply of tokens!");
_safeMint(msg.sender, numberOfTokens);
}
function getClaimedAmount(address coldWallet) external view returns (uint256) {
return _claimedAmount[coldWallet];
}
function withdraw() external onlyOwner {
uint256 balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
function getRandomNumber() internal returns (bytes32 requestId) {
uint256 fee = 2 * 10 ** 18;
require( LINK.balanceOf(address(this)) >= fee, "Please send Link token to the contract");
return requestRandomness(vrfKeyHash, fee);
}
// this is callback, it will be called by the vrf coordinator
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
request_id = requestId;
if(randStartPos==0) {
randStartPos = randomness % MAX_TOKENS;
revealed = true;
emit CollectionRevealed(randStartPos);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./VRF/LinkTokenInterface.sol";
import "./VRF/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 constructor(<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 private constant 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 internal immutable LINK;
address private immutable vrfCoordinator;
// Nonces for each VRF key from which randomness has been requested.
//
// Must stay in sync with VRFCoordinator[_keyHash][this]
mapping(bytes32 => uint256) /* keyHash */ /* 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;
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;
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
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error UnableDetermineTokenOwner();
error UnableGetTokenOwnerByIndex();
error URIQueryForNonexistentToken();
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Does not support burning tokens to address(0).
*
* Assumes that an owner cannot have more than the 2**128 - 1 (max value of uint128) of supply
*/
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 internal currentIndex;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
mapping(uint256 => TokenOwnership) internal _ownerships;
// Mapping owner address to address data
mapping(address => AddressData) private _addressData;
// 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;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return currentIndex;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
if (index >= totalSupply()) revert TokenIndexOutOfBounds();
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
* It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds();
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx;
address currOwnershipAddr;
// Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
unchecked {
for (uint256 i; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
}
revert UnableGetTokenOwnerByIndex();
}
/**
* @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 ||
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
if (owner == address(0)) revert MintedQueryForZeroAddress();
return uint256(_addressData[owner].numberMinted);
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
if (!_exists(tokenId)) revert OwnerQueryForNonexistentToken();
unchecked {
for (uint256 curr = tokenId; curr >= 0; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
}
revert UnableDetermineTokenOwner();
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return ownershipOf(tokenId).addr;
}
/**
* @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) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
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 override {
address owner = ERC721A.ownerOf(tokenId);
if (to == owner) revert ApprovalToCurrentOwner();
if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) revert ApprovalCallerNotOwnerNorApproved();
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
if (operator == _msgSender()) revert ApproveToCaller();
_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 {
_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 override {
_transfer(from, to, tokenId);
if (!_checkOnERC721Received(from, to, tokenId, _data)) revert TransferToNonERC721ReceiverImplementer();
}
/**
* @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`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, '');
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
_mint(to, quantity, _data, true);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _mint(
address to,
uint256 quantity,
bytes memory _data,
bool safe
) internal {
uint256 startTokenId = currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
// updatedIndex overflows if currentIndex + quantity > 1.56e77 (2**256) - 1
unchecked {
_addressData[to].balance += uint128(quantity);
_addressData[to].numberMinted += uint128(quantity);
_ownerships[startTokenId].addr = to;
_ownerships[startTokenId].startTimestamp = uint64(block.timestamp);
uint256 updatedIndex = startTokenId;
for (uint256 i; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
if (safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
updatedIndex++;
}
currentIndex = updatedIndex;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* 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
) private {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwnership.addr, _msgSender()));
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
unchecked {
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId].addr = to;
_ownerships[tokenId].startTimestamp = uint64(block.timestamp);
// If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
uint256 nextTokenId = tokenId + 1;
if (_ownerships[nextTokenId].addr == address(0)) {
if (_exists(nextTokenId)) {
_ownerships[nextTokenId].addr = prevOwnership.addr;
_ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, 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(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) revert TransferToNonERC721ReceiverImplementer();
else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* 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`.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
* minting.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}// SPDX-License-Identifier: MIT
// EPS Contracts v2.0.0
// www.eternalproxy.com
/**
@dev IOAT - Interface
*/
pragma solidity ^0.8.15;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @dev OAT interface
*/
interface IOAT is IERC20 {
/**
*
* @dev emitToken
*
*/
function emitToken(address receiver_, uint256 amount_) external;
/**
*
* @dev addEmitter
*
*/
function addEmitter(address emitter_) external;
/**
*
* @dev removeEmitter
*
*/
function removeEmitter(address emitter_) external;
/**
*
* @dev setTreasury
*
*/
function setTreasury(address treasury_) external;
}// SPDX-License-Identifier: MIT
// EPS Contracts v2.0.0
// www.eternalproxy.com
/**
@dev IERCOmnReceiver - Interface
*/
pragma solidity ^0.8.15;
interface IERCOmnReceiver {
function onTokenTransfer(
address sender,
uint256 value,
bytes memory data
) external payable;
}// SPDX-License-Identifier: CC0-1.0
// EPS Contracts v2.0.0
// www.eternalproxy.com
/**
@dev EPS Delegation Register - Interface
*/
pragma solidity ^0.8.15;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "./IOAT.sol";
import "./IERCOmnReceiver.sol";
/**
*
* @dev Implementation of the EPS proxy register interface.
*
*/
interface IEPSDelegationRegister {
// ======================================================
// ENUMS and STRUCTS
// ======================================================
// Scope of a delegation: global, collection or token
enum DelegationScope {
global,
collection,
token
}
// Time limit of a delegation: eternal or time limited
enum DelegationTimeLimit {
eternal,
limited
}
// The Class of a delegation: primary, secondary or rental
enum DelegationClass {
primary,
secondary,
rental
}
// The status of a delegation:
enum DelegationStatus {
live,
pending
}
// Data output format for a report (used to output both hot and cold
// delegation details)
struct DelegationReport {
address hot;
address cold;
DelegationScope scope;
DelegationClass class;
DelegationTimeLimit timeLimit;
address collection;
uint256 tokenId;
uint40 startDate;
uint40 endDate;
bool validByDate;
bool validBilaterally;
bool validTokenOwnership;
bool[25] usageTypes;
address key;
uint96 controlInteger;
bytes data;
DelegationStatus status;
}
// Delegation record
struct DelegationRecord {
address hot;
uint96 controlInteger;
address cold;
uint40 startDate;
uint40 endDate;
DelegationStatus status;
}
// If a delegation is for a collection, or has additional data, it will need to read the delegation metadata
struct DelegationMetadata {
address collection;
uint256 tokenId;
bytes data;
}
// Details of a hot wallet lock
struct LockDetails {
uint40 lockStart;
uint40 lockEnd;
}
// Validity dates when checking a delegation
struct ValidityDates {
uint40 start;
uint40 end;
}
// Delegation struct to hold details of a new delegation
struct Delegation {
address hot;
address cold;
address[] targetAddresses;
uint256 tokenId;
bool tokenDelegation;
uint8[] usageTypes;
uint40 startDate;
uint40 endDate;
uint16 providerCode;
DelegationClass delegationClass;
uint96 subDelegateKey;
bytes data;
DelegationStatus status;
}
// Addresses associated with a delegation check
struct DelegationCheckAddresses {
address hot;
address cold;
address targetCollection;
}
// Classes associated with a delegation check
struct DelegationCheckClasses {
bool secondary;
bool rental;
bool token;
}
// Migrated record data
struct MigratedRecord {
address hot;
address cold;
}
// ======================================================
// CUSTOM ERRORS
// ======================================================
error UsageTypeAlreadyDelegated(uint256 usageType);
error CannotDeleteValidDelegation();
error CannotDelegatedATokenYouDontOwn();
error IncorrectAdminLevel(uint256 requiredLevel);
error OnlyParticipantOrAuthorisedSubDelegate();
error HotAddressIsLockedAndCannotBeDelegatedTo();
error InvalidDelegation();
error ToMuchETHForPendingPayments(uint256 sent, uint256 required);
error UnknownAmount();
error InvalidERC20Payment();
error IncorrectProxyRegisterFee();
error UnrecognisedEPSAPIAmount();
error CannotRevokeAllForRegisterAdminHierarchy();
// ======================================================
// EVENTS
// ======================================================
event DelegationMade(
address indexed hot,
address indexed cold,
address targetAddress,
uint256 tokenId,
bool tokenDelegation,
uint8[] usageTypes,
uint40 startDate,
uint40 endDate,
uint16 providerCode,
DelegationClass delegationClass,
uint96 subDelegateKey,
bytes data,
DelegationStatus status
);
event DelegationRevoked(address hot, address cold, address delegationKey);
event DelegationPaid(address delegationKey);
event AllDelegationsRevokedForHot(address hot);
event AllDelegationsRevokedForCold(address cold);
event Transfer(address indexed from, address indexed to, uint256 value);
/**
*
*
* @dev getDelegationRecord
*
*
*/
function getDelegationRecord(address delegationKey_)
external
view
returns (DelegationRecord memory);
/**
*
*
* @dev isValidDelegation
*
*
*/
function isValidDelegation(
address hot_,
address cold_,
address collection_,
uint256 usageType_,
bool includeSecondary_,
bool includeRental_
) external view returns (bool isValid_);
/**
*
*
* @dev getAddresses - Get all currently valid addresses for a hot address.
* - Pass in address(0) to return records that are for ALL collections
* - Pass in a collection address to get records for just that collection
* - Usage type must be supplied. Only records that match usage type will be returned
*
*
*/
function getAddresses(
address hot_,
address collection_,
uint256 usageType_,
bool includeSecondary_,
bool includeRental_
) external view returns (address[] memory addresses_);
/**
*
*
* @dev beneficiaryBalanceOf: Returns the beneficiary balance
*
*
*/
function beneficiaryBalanceOf(
address queryAddress_,
address contractAddress_,
uint256 usageType_,
bool erc1155_,
uint256 id_,
bool includeSecondary_,
bool includeRental_
) external view returns (uint256 balance_);
/**
*
*
* @dev beneficiaryOf
*
*
*/
function beneficiaryOf(
address collection_,
uint256 tokenId_,
uint256 usageType_,
bool includeSecondary_,
bool includeRental_
)
external
view
returns (
address primaryBeneficiary_,
address[] memory secondaryBeneficiaries_
);
/**
*
*
* @dev delegationFromColdExists - check a cold delegation exists
*
*
*/
function delegationFromColdExists(address cold_, address delegationKey_)
external
view
returns (bool);
/**
*
*
* @dev delegationFromHotExists - check a hot delegation exists
*
*
*/
function delegationFromHotExists(address hot_, address delegationKey_)
external
view
returns (bool);
/**
*
*
* @dev getAllForHot - Get all delegations at a hot address, formatted nicely
*
*
*/
function getAllForHot(address hot_)
external
view
returns (DelegationReport[] memory);
/**
*
*
* @dev getAllForCold - Get all delegations at a cold address, formatted nicely
*
*
*/
function getAllForCold(address cold_)
external
view
returns (DelegationReport[] memory);
/**
*
*
* @dev makeDelegation - A direct call to setup a new proxy record
*
*
*/
function makeDelegation(
address hot_,
address cold_,
address[] memory targetAddresses_,
uint256 tokenId_,
bool tokenDelegation_,
uint8[] memory usageTypes_,
uint40 startDate_,
uint40 endDate_,
uint16 providerCode_,
DelegationClass delegationClass_, //0 = primary, 1 = secondary, 2 = rental
uint96 subDelegateKey_,
bytes memory data_
) external payable;
/**
*
*
* @dev getDelegationKey - get the link hash to the delegation metadata
*
*
*/
function getDelegationKey(
address hot_,
address cold_,
address targetAddress_,
uint256 tokenId_,
bool tokenDelegation_,
uint96 controlInteger_,
uint40 startDate_,
uint40 endDate_
) external pure returns (address);
/**
*
*
* @dev getHotAddressLockDetails
*
*
*/
function getHotAddressLockDetails(address hot_)
external
view
returns (LockDetails memory, address[] memory);
/**
*
*
* @dev lockAddressUntilDate
*
*
*/
function lockAddressUntilDate(uint40 unlockDate_) external;
/**
*
*
* @dev lockAddress
*
*
*/
function lockAddress() external;
/**
*
*
* @dev unlockAddress
*
*
*/
function unlockAddress() external;
/**
*
*
* @dev addLockBypassAddress
*
*
*/
function addLockBypassAddress(address bypassAddress_) external;
/**
*
*
* @dev removeLockBypassAddress
*
*
*/
function removeLockBypassAddress(address bypassAddress_) external;
/**
*
*
* @dev revokeRecord: Revoking a single record with Key
*
*
*/
function revokeRecord(address delegationKey_, uint96 subDelegateKey_)
external;
/**
*
*
* @dev revokeGlobalAll
*
*
*/
function revokeRecordOfGlobalScopeForAllUsages(address participant2_)
external;
/**
*
*
* @dev revokeAllForCold: Cold calls and revokes ALL
*
*
*/
function revokeAllForCold(address cold_, uint96 subDelegateKey_) external;
/**
*
*
* @dev revokeAllForHot: Hot calls and revokes ALL
*
*
*/
function revokeAllForHot() external;
/**
*
*
* @dev deleteExpired: ANYONE can delete expired records
*
*
*/
function deleteExpired(address delegationKey_) external;
/**
*
*
* @dev setRegisterFee: set the fee for accepting a registration:
*
*
*/
function setRegisterFees(
uint256 registerFee_,
address erc20_,
uint256 erc20Fee_
) external;
/**
*
*
* @dev setRewardTokenAndRate
*
*
*/
function setRewardTokenAndRate(address rewardToken_, uint88 rewardRate_)
external;
/**
*
*
* @dev lockRewardRate
*
*
*/
function lockRewardRate() external;
/**
*
*
* @dev setLegacyOff
*
*
*/
function setLegacyOff() external;
/**
*
*
* @dev setENSName (used to set reverse record so interactions with this contract are easy to
* identify)
*
*
*/
function setENSName(string memory ensName_) external;
/**
*
*
* @dev setENSReverseRegistrar
*
*
*/
function setENSReverseRegistrar(address ensReverseRegistrar_) external;
/**
*
*
* @dev setTreasuryAddress: set the treasury address:
*
*
*/
function setTreasuryAddress(address treasuryAddress_) external;
/**
*
*
* @dev setDecimalsAndBalance
*
*
*/
function setDecimalsAndBalance(uint8 decimals_, uint256 balance_) external;
/**
*
*
* @dev withdrawETH: withdraw eth to the treasury:
*
*
*/
function withdrawETH(uint256 amount_) external returns (bool success_);
/**
*
*
* @dev withdrawERC20: Allow any ERC20s to be withdrawn Note, this is provided to enable the
* withdrawal of payments using valid ERC20s. Assets sent here in error are retrieved with
* rescueERC20
*
*
*/
function withdrawERC20(IERC20 token_, uint256 amount_) external;
/**
*
*
* @dev isLevelAdmin
*
*
*/
function isLevelAdmin(
address receivedAddress_,
uint256 level_,
uint96 key_
) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
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
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
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);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
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() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}{
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 15000
},
"evmVersion": "london",
"libraries": {},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"passAddress_","type":"address"},{"internalType":"address","name":"epsAddress_","type":"address"},{"internalType":"address","name":"_ChainlinkVRFCoordinator","type":"address"},{"internalType":"address","name":"_ChainlinkLINKToken","type":"address"},{"internalType":"bytes32","name":"_ChainlinkKeyHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[{"internalType":"uint128","name":"claim","type":"uint128"},{"internalType":"uint128","name":"allowance","type":"uint128"}],"name":"ClaimExceedsAllowance","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"UnableDetermineTokenOwner","type":"error"},{"inputs":[],"name":"UnableGetTokenOwnerByIndex","type":"error"},{"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":"uint256","name":"randomStartPosition","type":"uint256"}],"name":"CollectionRevealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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":"uint256","name":"amountMinted","type":"uint256"}],"name":"WebaversePFPMint","type":"event"},{"inputs":[],"name":"BASE_EXTENSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EPS","outputs":[{"internalType":"contract IEPSDelegationRegister","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_baseURIextended","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_claimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_passAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"claimIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"numberOfTokens","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipClaimState","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":[{"internalType":"address","name":"coldWallet","type":"address"}],"name":"getClaimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPassContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfTokens","type":"uint256"}],"name":"mintTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"notRevealedUri","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":[],"name":"randStartPos","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":[],"name":"request_id","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_notRevealedURI","type":"string"}],"name":"setNotRevealedURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"passAddress_","type":"address"}],"name":"setPassContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snapshotMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vrfKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
600a805460ff60a01b191690556101206040526000610100908152600b906200002990826200022b565b50600f805460ff191690553480156200004157600080fd5b506040516200376b3803806200376b833981016040819052620000649162000314565b82826040518060400160405280601481526020017f446567656e73206f662054686520537472656574000000000000000000000000815250604051806040016040528060048152602001632222a3a760e11b8152508160019081620000ca91906200022b565b506002620000d982826200022b565b505050620000f6620000f06200013060201b60201c565b62000134565b6001600160a01b0391821660a0528116608052600a80546001600160a01b0319169682169690961790955560c05250501660e0526200037b565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001b157607f821691505b602082108103620001d257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200022657600081815260208120601f850160051c81016020861015620002015750805b601f850160051c820191505b8181101562000222578281556001016200020d565b5050505b505050565b81516001600160401b0381111562000247576200024762000186565b6200025f816200025884546200019c565b84620001d8565b602080601f8311600181146200029757600084156200027e5750858301515b600019600386901b1c1916600185901b17855562000222565b600085815260208120601f198616915b82811015620002c857888601518255948401946001909101908401620002a7565b5085821015620002e75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80516001600160a01b03811681146200030f57600080fd5b919050565b600080600080600060a086880312156200032d57600080fd5b6200033886620002f7565b94506200034860208701620002f7565b93506200035860408701620002f7565b92506200036860608701620002f7565b9150608086015190509295509295909350565b60805160a05160c05160e05161339a620003d1600039600081816105f30152611075015260008181610326015261231f015260008181610e5e01526126d201526000818161220c0152612696015261339a6000f3fe608060405234801561001057600080fd5b50600436106102f45760003560e01c80636d60e6c111610191578063a22cb465116100e3578063c9ca02fb11610097578063f2c4ce1e11610071578063f2c4ce1e146106c0578063f2fde38b146106d3578063f47c84c5146106e657600080fd5b8063c9ca02fb14610628578063df3fdf001461063b578063e985e9c51461067757600080fd5b8063b88d4fde116100c8578063b88d4fde146105db578063bbcaf1c9146105ee578063c87b56dd1461061557600080fd5b8063a22cb465146105c0578063a475b5dd146105d357600080fd5b80638da5cb5b1161014557806395d89b411161011f57806395d89b41146105925780639658bb311461059a57806397304ced146105ad57600080fd5b80638da5cb5b1461052b5780638df40be81461054957806394985ddd1461057f57600080fd5b8063715018a611610176578063715018a6146105075780637cb647591461050f578063899ff9371461052257600080fd5b80636d60e6c1146104ec57806370a08231146104f457600080fd5b80633b4059a21161024a57806351830227116101fe5780635829df43116101d85780635829df43146104b25780636149fb58146104bb5780636352211e146104d957600080fd5b8063518302271461046d5780635303f68c1461049257806355f804b31461049f57600080fd5b806342842e0e1161022f57806342842e0e1461043e5780634b916b6f146104515780634f6ccce71461045a57600080fd5b80633b4059a2146104165780633ccfd60b1461043657600080fd5b80630928fc22116102ac57806318160ddd1161028657806318160ddd146103e857806323b872dd146103f05780632f745c591461040357600080fd5b80630928fc22146103ab578063095ea7b3146103b357806316dd5379146103c857600080fd5b806306fdde03116102dd57806306fdde0314610356578063081812fc1461036b578063081c8c44146103a357600080fd5b806301ffc9a7146102f9578063041d443e14610321575b600080fd5b61030c610307366004612a65565b6106ef565b60405190151581526020015b60405180910390f35b6103487f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610318565b61035e610820565b6040516103189190612af8565b61037e610379366004612b0b565b6108b2565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610318565b61035e61091e565b61035e6109ac565b6103c66103c1366004612b46565b6109b9565b005b6103486103d6366004612b72565b60106020526000908152604090205481565b600054610348565b6103c66103fe366004612b8f565b610a9f565b610348610411366004612b46565b610aaa565b600a5461037e9073ffffffffffffffffffffffffffffffffffffffff1681565b6103c6610bef565b6103c661044c366004612b8f565b610c2a565b610348600c5481565b610348610468366004612b0b565b610c45565b600a5461030c9074010000000000000000000000000000000000000000900460ff1681565b600f5461030c9060ff1681565b6103c66104ad366004612cc4565b610c85565b610348600d5481565b600a5473ffffffffffffffffffffffffffffffffffffffff1661037e565b61037e6104e7366004612b0b565b610d49565b6103c6610d5b565b610348610502366004612b72565b610d95565b6103c6610e1f565b61034861051d366004612b0b565b610e33565b610348600e5481565b60075473ffffffffffffffffffffffffffffffffffffffff1661037e565b610348610557366004612b72565b73ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b6103c661058d366004612d0d565b610e46565b61035e610eef565b6103c66105a8366004612d2f565b610efe565b6103c66105bb366004612b0b565b61136e565b6103c66105ce366004612dbf565b611495565b6103c661157b565b6103c66105e9366004612df8565b6115ad565b61037e7f000000000000000000000000000000000000000000000000000000000000000081565b61035e610623366004612b0b565b6115fa565b6103c6610636366004612b72565b611763565b61035e6040518060400160405280600581526020017f2e6a736f6e00000000000000000000000000000000000000000000000000000081525081565b61030c610685366004612e78565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260066020908152604080832093909416825291909152205460ff1690565b6103c66106ce366004612cc4565b6117b2565b6103c66106e1366004612b72565b6117c6565b610348614e2081565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061078257507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806107ce57507fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061081a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60606001805461082f90612ea6565b80601f016020809104026020016040519081016040528092919081815260200182805461085b90612ea6565b80156108a85780601f1061087d576101008083540402835291602001916108a8565b820191906000526020600020905b81548152906001019060200180831161088b57829003601f168201915b5050505050905090565b60006108bf826000541190565b6108f5576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060009081526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600b805461092b90612ea6565b80601f016020809104026020016040519081016040528092919081815260200182805461095790612ea6565b80156109a45780601f10610979576101008083540402835291602001916109a4565b820191906000526020600020905b81548152906001019060200180831161098757829003601f168201915b505050505081565b6009805461092b90612ea6565b60006109c482610d49565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a2b576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff821614801590610a585750610a568133610685565b155b15610a8f576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a9a83838361187a565b505050565b610a9a8383836118fb565b6000610ab583610d95565b8210610aed576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080549080805b83811015610bbc5760008181526003602090815260409182902082518084019093525473ffffffffffffffffffffffffffffffffffffffff81168084527401000000000000000000000000000000000000000090910467ffffffffffffffff169183019190915215610b6657805192505b8773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610bb357868403610bac5750935061081a92505050565b6001909301925b50600101610af5565b506040517f7339954700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bf7611c5b565b6040514790339082156108fc029083906000818181858888f19350505050158015610c26573d6000803e3d6000fd5b5050565b610a9a838383604051806020016040528060008152506115ad565b600080548210610c81576040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5090565b610c8d611c5b565b600a5474010000000000000000000000000000000000000000900460ff1615610d3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f436f6c6c656374696f6e2072657665616c65642c2063616e6e6f74207365742060448201527f555249000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6009610c268282612f47565b6000610d5482611cdc565b5192915050565b610d63611c5b565b600f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00811660ff90911615179055565b600073ffffffffffffffffffffffffffffffffffffffff8216610de4576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152600460205260409020546fffffffffffffffffffffffffffffffff1690565b610e27611c5b565b610e316000611da8565b565b6000610e3d611c5b565b50600e81905590565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610ee5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610d34565b610c268282611e1f565b60606002805461082f90612ea6565b600f5460ff16610f6a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f436c61696d206973206e6f7420616374697665207965742100000000000000006044820152606401610d34565b614e2082610f7760005490565b610f819190613054565b111561100f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f436c61696d20776f756c6420657863656564206d617820737570706c79206f6660448201527f20746f6b656e73210000000000000000000000000000000000000000000000006064820152608401610d34565b600a546040517f54559dbb00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91821660248201526001604482018190526064820181905260848201526000917f000000000000000000000000000000000000000000000000000000000000000016906354559dbb9060a401600060405180830381865afa1580156110bc573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611102919081019061306c565b905060005b81518110156113355760008282815181106111245761112461311e565b6020026020010151905060006111518273ffffffffffffffffffffffffffffffffffffffff166014611ebc565b905060008161115f876120ff565b60405160200161117092919061314d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815260208b810280850182019093528b84529093506111e092918c918c91829185019084908082843760009201919091525050600e5485516020870120909250905061219f565b1561131f5773ffffffffffffffffffffffffffffffffffffffff83166000908152601060205260409020548690611218908990613054565b1161129f5773ffffffffffffffffffffffffffffffffffffffff831660009081526010602052604081208054899290611252908490613054565b90915550611262905033886121b5565b6040518781527fb5a0e2dbba167fac1fa6fe594cccee74709d9dbfc520941f645e4ce33d5cd8b79060200160405180910390a15050505050611368565b73ffffffffffffffffffffffffffffffffffffffff831660009081526010602052604090205487906112d190886131a5565b6040517f172bdf7c0000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff928316600482015291166024820152604401610d34565b505050808061132d906131bc565b915050611107565b506040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b611376611c5b565b600f5460ff16156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f436c61696d206973206e6f742066696e697368656420796574210000000000006044820152606401610d34565b614e20816113f060005490565b6113fa9190613054565b1115611488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f436c61696d20776f756c6420657863656564206d617820737570706c79206f6660448201527f20746f6b656e73210000000000000000000000000000000000000000000000006064820152608401610d34565b61149233826121b5565b50565b3373ffffffffffffffffffffffffffffffffffffffff8316036114e4576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600081815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611583611c5b565b600a5474010000000000000000000000000000000000000000900460ff16610e31576114926121cf565b6115b88484846118fb565b6115c48484848461234a565b611368576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a5460609074010000000000000000000000000000000000000000900460ff1615156000036116b657600b805461163190612ea6565b80601f016020809104026020016040519081016040528092919081815260200182805461165d90612ea6565b80156116aa5780601f1061167f576101008083540402835291602001916116aa565b820191906000526020600020905b81548152906001019060200180831161168d57829003601f168201915b50505050509050919050565b60006116c06124e8565b905060008151116116e0576040518060200160405280600081525061175c565b80611704614e20600c54866116f59190613054565b6116ff91906131d6565b6120ff565b6040518060400160405280600581526020017f2e6a736f6e00000000000000000000000000000000000000000000000000000081525060405160200161174c93929190613211565b6040516020818303038152906040525b9392505050565b61176b611c5b565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6117ba611c5b565b600b610c268282612f47565b6117ce611c5b565b73ffffffffffffffffffffffffffffffffffffffff8116611871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d34565b61149281611da8565b60008281526005602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061190682611cdc565b805190915060009073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061196457503361194c846108b2565b73ffffffffffffffffffffffffffffffffffffffff16145b80611976575081516119769033610685565b9050806119af576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1614611a18576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416611a65576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a75600084846000015161187a565b73ffffffffffffffffffffffffffffffffffffffff858116600090815260046020908152604080832080547fffffffffffffffffffffffffffffffff000000000000000000000000000000008082166fffffffffffffffffffffffffffffffff928316600019018316179092558986168086528386208054938416938316600190810190931693909317909255888552600390935281842080547fffffffff0000000000000000000000000000000000000000000000000000000016909117740100000000000000000000000000000000000000004267ffffffffffffffff1602179055908601808352912054909116611bf757611b74816000541190565b15611bf7578251600082815260036020908152604090912080549186015167ffffffffffffffff1674010000000000000000000000000000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff909316929092171790555b50828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60075473ffffffffffffffffffffffffffffffffffffffff163314610e31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d34565b6040805180820190915260008082526020820152611cfb826000541190565b611d31576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815b60008181526003602090815260409182902082518084019093525473ffffffffffffffffffffffffffffffffffffffff81168084527401000000000000000000000000000000000000000090910467ffffffffffffffff169183019190915215611d9e579392505050565b5060001901611d33565b6007805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600d829055600c54600003610c2657611e3a614e20826131d6565b600c819055600a80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556040517f90450ce961c1daea0ff7ca76366931176872db909a8ece3e16742a6227aa0c5591611eb09190815260200190565b60405180910390a15050565b60606000611ecb836002613254565b611ed6906002613054565b67ffffffffffffffff811115611eee57611eee612bd0565b6040519080825280601f01601f191660200182016040528015611f18576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611f4f57611f4f61311e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611fb257611fb261311e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000611fee846002613254565b611ff9906001613054565b90505b6001811115612096577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061203a5761203a61311e565b1a60f81b8282815181106120505761205061311e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361208f81613273565b9050611ffc565b50831561175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d34565b6060600061210c836124f7565b600101905060008167ffffffffffffffff81111561212c5761212c612bd0565b6040519080825280601f01601f191660200182016040528015612156576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461216057509392505050565b6000826121ac85846125d9565b14949350505050565b610c26828260405180602001604052806000815250612685565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090671bc16d674ec800009081907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015612268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228c919061328a565b101561231a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f506c656173652073656e64204c696e6b20746f6b656e20746f2074686520636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610d34565b6123447f000000000000000000000000000000000000000000000000000000000000000082612692565b91505090565b600073ffffffffffffffffffffffffffffffffffffffff84163b156124dc576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906123c19033908990889088906004016132a3565b6020604051808303816000875af192505050801561241a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612417918101906132ec565b60015b612491573d808015612448576040519150601f19603f3d011682016040523d82523d6000602084013e61244d565b606091505b508051600003612489576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a02000000000000000000000000000000000000000000000000000000001490506124e0565b5060015b949350505050565b60606009805461082f90612ea6565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612540577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061256c576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061258a57662386f26fc10000830492506010015b6305f5e10083106125a2576305f5e100830492506008015b61271083106125b657612710830492506004015b606483106125c8576064830492506002015b600a831061081a5760010192915050565b600081815b845181101561267d5760008582815181106125fb576125fb61311e565b6020026020010151905080831161263d57604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061266a565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612675816131bc565b9150506125de565b509392505050565b610a9a838383600161281b565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634000aea07f00000000000000000000000000000000000000000000000000000000000000008486600060405160200161270f929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161273c93929190613309565b6020604051808303816000875af115801561275b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061277f9190613347565b50600083815260086020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120938790529190526127db906001613054565b6000858152600860205260409020556124e08482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b60005473ffffffffffffffffffffffffffffffffffffffff851661286b576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836000036128a5576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516600081815260046020908152604080832080547001000000000000000000000000000000007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082166fffffffffffffffffffffffffffffffff9283168c01831690811782900483168c01909216021790558483526003909152812080547fffffffff0000000000000000000000000000000000000000000000000000000016909217740100000000000000000000000000000000000000004267ffffffffffffffff16021790915581905b85811015612a2e57604051829073ffffffffffffffffffffffffffffffffffffffff8916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48380156129eb57506129e9600088848861234a565b155b15612a22576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019182019101612987565b50600055611c54565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461149257600080fd5b600060208284031215612a7757600080fd5b813561175c81612a37565b60005b83811015612a9d578181015183820152602001612a85565b838111156113685750506000910152565b60008151808452612ac6816020860160208601612a82565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061175c6020830184612aae565b600060208284031215612b1d57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461149257600080fd5b60008060408385031215612b5957600080fd5b8235612b6481612b24565b946020939093013593505050565b600060208284031215612b8457600080fd5b813561175c81612b24565b600080600060608486031215612ba457600080fd5b8335612baf81612b24565b92506020840135612bbf81612b24565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612c4657612c46612bd0565b604052919050565b600067ffffffffffffffff831115612c6857612c68612bd0565b612c9960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601612bff565b9050828152838383011115612cad57600080fd5b828260208301376000602084830101529392505050565b600060208284031215612cd657600080fd5b813567ffffffffffffffff811115612ced57600080fd5b8201601f81018413612cfe57600080fd5b6124e084823560208401612c4e565b60008060408385031215612d2057600080fd5b50508035926020909101359150565b60008060008060608587031215612d4557600080fd5b843567ffffffffffffffff80821115612d5d57600080fd5b818701915087601f830112612d7157600080fd5b813581811115612d8057600080fd5b8860208260051b8501011115612d9557600080fd5b6020928301999098509187013596604001359550909350505050565b801515811461149257600080fd5b60008060408385031215612dd257600080fd5b8235612ddd81612b24565b91506020830135612ded81612db1565b809150509250929050565b60008060008060808587031215612e0e57600080fd5b8435612e1981612b24565b93506020850135612e2981612b24565b925060408501359150606085013567ffffffffffffffff811115612e4c57600080fd5b8501601f81018713612e5d57600080fd5b612e6c87823560208401612c4e565b91505092959194509250565b60008060408385031215612e8b57600080fd5b8235612e9681612b24565b91506020830135612ded81612b24565b600181811c90821680612eba57607f821691505b602082108103612ef3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f821115610a9a57600081815260208120601f850160051c81016020861015612f205750805b601f850160051c820191505b81811015612f3f57828155600101612f2c565b505050505050565b815167ffffffffffffffff811115612f6157612f61612bd0565b612f7581612f6f8454612ea6565b84612ef9565b602080601f831160018114612faa5760008415612f925750858301515b600019600386901b1c1916600185901b178555612f3f565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015612ff757888601518255948401946001909101908401612fd8565b50858210156130155787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561306757613067613025565b500190565b6000602080838503121561307f57600080fd5b825167ffffffffffffffff8082111561309757600080fd5b818501915085601f8301126130ab57600080fd5b8151818111156130bd576130bd612bd0565b8060051b91506130ce848301612bff565b81815291830184019184810190888411156130e857600080fd5b938501935b83851015613112578451925061310283612b24565b82825293850193908501906130ed565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000835161315f818460208801612a82565b7f5f000000000000000000000000000000000000000000000000000000000000009083019081528351613199816001840160208801612a82565b01600101949350505050565b6000828210156131b7576131b7613025565b500390565b600060001982036131cf576131cf613025565b5060010190565b60008261320c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60008451613223818460208901612a82565b845190830190613237818360208901612a82565b845191019061324a818360208801612a82565b0195945050505050565b600081600019048311821515161561326e5761326e613025565b500290565b60008161328257613282613025565b506000190190565b60006020828403121561329c57600080fd5b5051919050565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526132e26080830184612aae565b9695505050505050565b6000602082840312156132fe57600080fd5b815161175c81612a37565b73ffffffffffffffffffffffffffffffffffffffff8416815282602082015260606040820152600061333e6060830184612aae565b95945050505050565b60006020828403121561335957600080fd5b815161175c81612db156fea2646970667358221220065d3c65970a8ebfe437f5c5a413fc9f16f1597587d3840b96695655a58d382764736f6c634300080f0033000000000000000000000000543d43f390b7d681513045e8a85707438c463d80000000000000000000000000888888888888660f286a7c06cfa3407d09af44b2000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102f45760003560e01c80636d60e6c111610191578063a22cb465116100e3578063c9ca02fb11610097578063f2c4ce1e11610071578063f2c4ce1e146106c0578063f2fde38b146106d3578063f47c84c5146106e657600080fd5b8063c9ca02fb14610628578063df3fdf001461063b578063e985e9c51461067757600080fd5b8063b88d4fde116100c8578063b88d4fde146105db578063bbcaf1c9146105ee578063c87b56dd1461061557600080fd5b8063a22cb465146105c0578063a475b5dd146105d357600080fd5b80638da5cb5b1161014557806395d89b411161011f57806395d89b41146105925780639658bb311461059a57806397304ced146105ad57600080fd5b80638da5cb5b1461052b5780638df40be81461054957806394985ddd1461057f57600080fd5b8063715018a611610176578063715018a6146105075780637cb647591461050f578063899ff9371461052257600080fd5b80636d60e6c1146104ec57806370a08231146104f457600080fd5b80633b4059a21161024a57806351830227116101fe5780635829df43116101d85780635829df43146104b25780636149fb58146104bb5780636352211e146104d957600080fd5b8063518302271461046d5780635303f68c1461049257806355f804b31461049f57600080fd5b806342842e0e1161022f57806342842e0e1461043e5780634b916b6f146104515780634f6ccce71461045a57600080fd5b80633b4059a2146104165780633ccfd60b1461043657600080fd5b80630928fc22116102ac57806318160ddd1161028657806318160ddd146103e857806323b872dd146103f05780632f745c591461040357600080fd5b80630928fc22146103ab578063095ea7b3146103b357806316dd5379146103c857600080fd5b806306fdde03116102dd57806306fdde0314610356578063081812fc1461036b578063081c8c44146103a357600080fd5b806301ffc9a7146102f9578063041d443e14610321575b600080fd5b61030c610307366004612a65565b6106ef565b60405190151581526020015b60405180910390f35b6103487faa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af44581565b604051908152602001610318565b61035e610820565b6040516103189190612af8565b61037e610379366004612b0b565b6108b2565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610318565b61035e61091e565b61035e6109ac565b6103c66103c1366004612b46565b6109b9565b005b6103486103d6366004612b72565b60106020526000908152604090205481565b600054610348565b6103c66103fe366004612b8f565b610a9f565b610348610411366004612b46565b610aaa565b600a5461037e9073ffffffffffffffffffffffffffffffffffffffff1681565b6103c6610bef565b6103c661044c366004612b8f565b610c2a565b610348600c5481565b610348610468366004612b0b565b610c45565b600a5461030c9074010000000000000000000000000000000000000000900460ff1681565b600f5461030c9060ff1681565b6103c66104ad366004612cc4565b610c85565b610348600d5481565b600a5473ffffffffffffffffffffffffffffffffffffffff1661037e565b61037e6104e7366004612b0b565b610d49565b6103c6610d5b565b610348610502366004612b72565b610d95565b6103c6610e1f565b61034861051d366004612b0b565b610e33565b610348600e5481565b60075473ffffffffffffffffffffffffffffffffffffffff1661037e565b610348610557366004612b72565b73ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b6103c661058d366004612d0d565b610e46565b61035e610eef565b6103c66105a8366004612d2f565b610efe565b6103c66105bb366004612b0b565b61136e565b6103c66105ce366004612dbf565b611495565b6103c661157b565b6103c66105e9366004612df8565b6115ad565b61037e7f000000000000000000000000888888888888660f286a7c06cfa3407d09af44b281565b61035e610623366004612b0b565b6115fa565b6103c6610636366004612b72565b611763565b61035e6040518060400160405280600581526020017f2e6a736f6e00000000000000000000000000000000000000000000000000000081525081565b61030c610685366004612e78565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260066020908152604080832093909416825291909152205460ff1690565b6103c66106ce366004612cc4565b6117b2565b6103c66106e1366004612b72565b6117c6565b610348614e2081565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061078257507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806107ce57507fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061081a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60606001805461082f90612ea6565b80601f016020809104026020016040519081016040528092919081815260200182805461085b90612ea6565b80156108a85780601f1061087d576101008083540402835291602001916108a8565b820191906000526020600020905b81548152906001019060200180831161088b57829003601f168201915b5050505050905090565b60006108bf826000541190565b6108f5576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060009081526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600b805461092b90612ea6565b80601f016020809104026020016040519081016040528092919081815260200182805461095790612ea6565b80156109a45780601f10610979576101008083540402835291602001916109a4565b820191906000526020600020905b81548152906001019060200180831161098757829003601f168201915b505050505081565b6009805461092b90612ea6565b60006109c482610d49565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a2b576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff821614801590610a585750610a568133610685565b155b15610a8f576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a9a83838361187a565b505050565b610a9a8383836118fb565b6000610ab583610d95565b8210610aed576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080549080805b83811015610bbc5760008181526003602090815260409182902082518084019093525473ffffffffffffffffffffffffffffffffffffffff81168084527401000000000000000000000000000000000000000090910467ffffffffffffffff169183019190915215610b6657805192505b8773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610bb357868403610bac5750935061081a92505050565b6001909301925b50600101610af5565b506040517f7339954700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bf7611c5b565b6040514790339082156108fc029083906000818181858888f19350505050158015610c26573d6000803e3d6000fd5b5050565b610a9a838383604051806020016040528060008152506115ad565b600080548210610c81576040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5090565b610c8d611c5b565b600a5474010000000000000000000000000000000000000000900460ff1615610d3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f436f6c6c656374696f6e2072657665616c65642c2063616e6e6f74207365742060448201527f555249000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6009610c268282612f47565b6000610d5482611cdc565b5192915050565b610d63611c5b565b600f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00811660ff90911615179055565b600073ffffffffffffffffffffffffffffffffffffffff8216610de4576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152600460205260409020546fffffffffffffffffffffffffffffffff1690565b610e27611c5b565b610e316000611da8565b565b6000610e3d611c5b565b50600e81905590565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79521614610ee5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610d34565b610c268282611e1f565b60606002805461082f90612ea6565b600f5460ff16610f6a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f436c61696d206973206e6f7420616374697665207965742100000000000000006044820152606401610d34565b614e2082610f7760005490565b610f819190613054565b111561100f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f436c61696d20776f756c6420657863656564206d617820737570706c79206f6660448201527f20746f6b656e73210000000000000000000000000000000000000000000000006064820152608401610d34565b600a546040517f54559dbb00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91821660248201526001604482018190526064820181905260848201526000917f000000000000000000000000888888888888660f286a7c06cfa3407d09af44b216906354559dbb9060a401600060405180830381865afa1580156110bc573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611102919081019061306c565b905060005b81518110156113355760008282815181106111245761112461311e565b6020026020010151905060006111518273ffffffffffffffffffffffffffffffffffffffff166014611ebc565b905060008161115f876120ff565b60405160200161117092919061314d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815260208b810280850182019093528b84529093506111e092918c918c91829185019084908082843760009201919091525050600e5485516020870120909250905061219f565b1561131f5773ffffffffffffffffffffffffffffffffffffffff83166000908152601060205260409020548690611218908990613054565b1161129f5773ffffffffffffffffffffffffffffffffffffffff831660009081526010602052604081208054899290611252908490613054565b90915550611262905033886121b5565b6040518781527fb5a0e2dbba167fac1fa6fe594cccee74709d9dbfc520941f645e4ce33d5cd8b79060200160405180910390a15050505050611368565b73ffffffffffffffffffffffffffffffffffffffff831660009081526010602052604090205487906112d190886131a5565b6040517f172bdf7c0000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff928316600482015291166024820152604401610d34565b505050808061132d906131bc565b915050611107565b506040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b611376611c5b565b600f5460ff16156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f436c61696d206973206e6f742066696e697368656420796574210000000000006044820152606401610d34565b614e20816113f060005490565b6113fa9190613054565b1115611488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f436c61696d20776f756c6420657863656564206d617820737570706c79206f6660448201527f20746f6b656e73210000000000000000000000000000000000000000000000006064820152608401610d34565b61149233826121b5565b50565b3373ffffffffffffffffffffffffffffffffffffffff8316036114e4576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600081815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611583611c5b565b600a5474010000000000000000000000000000000000000000900460ff16610e31576114926121cf565b6115b88484846118fb565b6115c48484848461234a565b611368576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a5460609074010000000000000000000000000000000000000000900460ff1615156000036116b657600b805461163190612ea6565b80601f016020809104026020016040519081016040528092919081815260200182805461165d90612ea6565b80156116aa5780601f1061167f576101008083540402835291602001916116aa565b820191906000526020600020905b81548152906001019060200180831161168d57829003601f168201915b50505050509050919050565b60006116c06124e8565b905060008151116116e0576040518060200160405280600081525061175c565b80611704614e20600c54866116f59190613054565b6116ff91906131d6565b6120ff565b6040518060400160405280600581526020017f2e6a736f6e00000000000000000000000000000000000000000000000000000081525060405160200161174c93929190613211565b6040516020818303038152906040525b9392505050565b61176b611c5b565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6117ba611c5b565b600b610c268282612f47565b6117ce611c5b565b73ffffffffffffffffffffffffffffffffffffffff8116611871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d34565b61149281611da8565b60008281526005602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061190682611cdc565b805190915060009073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061196457503361194c846108b2565b73ffffffffffffffffffffffffffffffffffffffff16145b80611976575081516119769033610685565b9050806119af576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1614611a18576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416611a65576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a75600084846000015161187a565b73ffffffffffffffffffffffffffffffffffffffff858116600090815260046020908152604080832080547fffffffffffffffffffffffffffffffff000000000000000000000000000000008082166fffffffffffffffffffffffffffffffff928316600019018316179092558986168086528386208054938416938316600190810190931693909317909255888552600390935281842080547fffffffff0000000000000000000000000000000000000000000000000000000016909117740100000000000000000000000000000000000000004267ffffffffffffffff1602179055908601808352912054909116611bf757611b74816000541190565b15611bf7578251600082815260036020908152604090912080549186015167ffffffffffffffff1674010000000000000000000000000000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff909316929092171790555b50828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60075473ffffffffffffffffffffffffffffffffffffffff163314610e31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d34565b6040805180820190915260008082526020820152611cfb826000541190565b611d31576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815b60008181526003602090815260409182902082518084019093525473ffffffffffffffffffffffffffffffffffffffff81168084527401000000000000000000000000000000000000000090910467ffffffffffffffff169183019190915215611d9e579392505050565b5060001901611d33565b6007805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600d829055600c54600003610c2657611e3a614e20826131d6565b600c819055600a80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556040517f90450ce961c1daea0ff7ca76366931176872db909a8ece3e16742a6227aa0c5591611eb09190815260200190565b60405180910390a15050565b60606000611ecb836002613254565b611ed6906002613054565b67ffffffffffffffff811115611eee57611eee612bd0565b6040519080825280601f01601f191660200182016040528015611f18576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611f4f57611f4f61311e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611fb257611fb261311e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000611fee846002613254565b611ff9906001613054565b90505b6001811115612096577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061203a5761203a61311e565b1a60f81b8282815181106120505761205061311e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361208f81613273565b9050611ffc565b50831561175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d34565b6060600061210c836124f7565b600101905060008167ffffffffffffffff81111561212c5761212c612bd0565b6040519080825280601f01601f191660200182016040528015612156576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461216057509392505050565b6000826121ac85846125d9565b14949350505050565b610c26828260405180602001604052806000815250612685565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090671bc16d674ec800009081907f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015612268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228c919061328a565b101561231a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f506c656173652073656e64204c696e6b20746f6b656e20746f2074686520636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610d34565b6123447faa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af44582612692565b91505090565b600073ffffffffffffffffffffffffffffffffffffffff84163b156124dc576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906123c19033908990889088906004016132a3565b6020604051808303816000875af192505050801561241a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612417918101906132ec565b60015b612491573d808015612448576040519150601f19603f3d011682016040523d82523d6000602084013e61244d565b606091505b508051600003612489576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a02000000000000000000000000000000000000000000000000000000001490506124e0565b5060015b949350505050565b60606009805461082f90612ea6565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612540577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061256c576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061258a57662386f26fc10000830492506010015b6305f5e10083106125a2576305f5e100830492506008015b61271083106125b657612710830492506004015b606483106125c8576064830492506002015b600a831061081a5760010192915050565b600081815b845181101561267d5760008582815181106125fb576125fb61311e565b6020026020010151905080831161263d57604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061266a565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612675816131bc565b9150506125de565b509392505050565b610a9a838383600161281b565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79528486600060405160200161270f929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161273c93929190613309565b6020604051808303816000875af115801561275b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061277f9190613347565b50600083815260086020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120938790529190526127db906001613054565b6000858152600860205260409020556124e08482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b60005473ffffffffffffffffffffffffffffffffffffffff851661286b576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836000036128a5576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516600081815260046020908152604080832080547001000000000000000000000000000000007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082166fffffffffffffffffffffffffffffffff9283168c01831690811782900483168c01909216021790558483526003909152812080547fffffffff0000000000000000000000000000000000000000000000000000000016909217740100000000000000000000000000000000000000004267ffffffffffffffff16021790915581905b85811015612a2e57604051829073ffffffffffffffffffffffffffffffffffffffff8916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48380156129eb57506129e9600088848861234a565b155b15612a22576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019182019101612987565b50600055611c54565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461149257600080fd5b600060208284031215612a7757600080fd5b813561175c81612a37565b60005b83811015612a9d578181015183820152602001612a85565b838111156113685750506000910152565b60008151808452612ac6816020860160208601612a82565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061175c6020830184612aae565b600060208284031215612b1d57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461149257600080fd5b60008060408385031215612b5957600080fd5b8235612b6481612b24565b946020939093013593505050565b600060208284031215612b8457600080fd5b813561175c81612b24565b600080600060608486031215612ba457600080fd5b8335612baf81612b24565b92506020840135612bbf81612b24565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612c4657612c46612bd0565b604052919050565b600067ffffffffffffffff831115612c6857612c68612bd0565b612c9960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601612bff565b9050828152838383011115612cad57600080fd5b828260208301376000602084830101529392505050565b600060208284031215612cd657600080fd5b813567ffffffffffffffff811115612ced57600080fd5b8201601f81018413612cfe57600080fd5b6124e084823560208401612c4e565b60008060408385031215612d2057600080fd5b50508035926020909101359150565b60008060008060608587031215612d4557600080fd5b843567ffffffffffffffff80821115612d5d57600080fd5b818701915087601f830112612d7157600080fd5b813581811115612d8057600080fd5b8860208260051b8501011115612d9557600080fd5b6020928301999098509187013596604001359550909350505050565b801515811461149257600080fd5b60008060408385031215612dd257600080fd5b8235612ddd81612b24565b91506020830135612ded81612db1565b809150509250929050565b60008060008060808587031215612e0e57600080fd5b8435612e1981612b24565b93506020850135612e2981612b24565b925060408501359150606085013567ffffffffffffffff811115612e4c57600080fd5b8501601f81018713612e5d57600080fd5b612e6c87823560208401612c4e565b91505092959194509250565b60008060408385031215612e8b57600080fd5b8235612e9681612b24565b91506020830135612ded81612b24565b600181811c90821680612eba57607f821691505b602082108103612ef3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f821115610a9a57600081815260208120601f850160051c81016020861015612f205750805b601f850160051c820191505b81811015612f3f57828155600101612f2c565b505050505050565b815167ffffffffffffffff811115612f6157612f61612bd0565b612f7581612f6f8454612ea6565b84612ef9565b602080601f831160018114612faa5760008415612f925750858301515b600019600386901b1c1916600185901b178555612f3f565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015612ff757888601518255948401946001909101908401612fd8565b50858210156130155787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561306757613067613025565b500190565b6000602080838503121561307f57600080fd5b825167ffffffffffffffff8082111561309757600080fd5b818501915085601f8301126130ab57600080fd5b8151818111156130bd576130bd612bd0565b8060051b91506130ce848301612bff565b81815291830184019184810190888411156130e857600080fd5b938501935b83851015613112578451925061310283612b24565b82825293850193908501906130ed565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000835161315f818460208801612a82565b7f5f000000000000000000000000000000000000000000000000000000000000009083019081528351613199816001840160208801612a82565b01600101949350505050565b6000828210156131b7576131b7613025565b500390565b600060001982036131cf576131cf613025565b5060010190565b60008261320c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60008451613223818460208901612a82565b845190830190613237818360208901612a82565b845191019061324a818360208801612a82565b0195945050505050565b600081600019048311821515161561326e5761326e613025565b500290565b60008161328257613282613025565b506000190190565b60006020828403121561329c57600080fd5b5051919050565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526132e26080830184612aae565b9695505050505050565b6000602082840312156132fe57600080fd5b815161175c81612a37565b73ffffffffffffffffffffffffffffffffffffffff8416815282602082015260606040820152600061333e6060830184612aae565b95945050505050565b60006020828403121561335957600080fd5b815161175c81612db156fea2646970667358221220065d3c65970a8ebfe437f5c5a413fc9f16f1597587d3840b96695655a58d382764736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000543d43f390b7d681513045e8a85707438c463d80000000000000000000000000888888888888660f286a7c06cfa3407d09af44b2000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
-----Decoded View---------------
Arg [0] : passAddress_ (address): 0x543D43F390b7d681513045e8a85707438c463d80
Arg [1] : epsAddress_ (address): 0x888888888888660F286A7C06cfa3407d09af44B2
Arg [2] : _ChainlinkVRFCoordinator (address): 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
Arg [3] : _ChainlinkLINKToken (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [4] : _ChainlinkKeyHash (bytes32): 0xaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000543d43f390b7d681513045e8a85707438c463d80
Arg [1] : 000000000000000000000000888888888888660f286a7c06cfa3407d09af44b2
Arg [2] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [3] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [4] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.