ERC-721
NFT
Overview
Max Total Supply
0 WP
Holders
103
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
2 WPLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
LockingLayers
Compiler Version
v0.8.2+commit.661d1103
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "./ILockingLayers.sol"; import "./VRFConsumerBase.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev LockingLayers is an ERC721 contract that contains the logic and source of ownership * for Whole Picture. The core mechanics breakdown as follows: * - Each artwork consists of 4 layers. * - A Layer contain a canvasId. * - Each layer shifts its canvasId after X blocks, unless the layer is locked. * - Layers are revealed over time, and the entire process ends after all layers are revelaed and * all layer shifts have finished. * * Schema is: * - artworkId => owned by address * - canvasIds[NUM_LAYERS] => owned by artwork => NUM_LAYERS = 4 so each artwork ownes 4 canvasIds * * Layer Mappings: * - Mappings from canvasId => canvas are stored offchain in IPFS. Mapping json file can be viewed * - at ipfs://QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD * * IMPORTANT NOTES: * - canvasIds and actionIds are 1 indexed, not 0 indexed. This is because a 0 index signifies that * a layer is not locked, and an actionId of 0 signifies that the action has not happened yet. */ contract LockingLayers is ILockingLayers, ERC721, VRFConsumerBase, Ownable { using SafeMath for uint256; // Total number of artworks to create uint16 constant TOTAL_ARTWORK_SUPPLY = 1200; // The layerIds owned by each artwork uint8 constant NUM_LAYERS = 4; // Actions are shifts per each layer // NOTE: all actions are 1 indexed, not 0 indexed. This is because an action idx of // 0 means that layer does nto exist yet uint8 constant ACTIONS_PER_LAYER = 5; // Defines number blocks required to trigger an action uint16 constant BLOCKS_PER_ACTION = 4444; // Total number of actions for the project uint16 constant MAX_ACTIONS = ACTIONS_PER_LAYER * NUM_LAYERS; // There will be the same number of layerIds because each artwork is guaranteed to have 4 layers uint16 constant NUM_CANVAS_IDS = TOTAL_ARTWORK_SUPPLY; // Number of artworks in each tier uint16[3] totalArtworksInTier = [200, 800, 200]; // remaining artworks in each tier that can be purchased uint16[3] artworksRemainingInTier = [200, 800, 200]; // CID of the mappings from canvasId to canvas! View on ipfs. string constant provinanceRecord = "QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD"; // First artwork will be id of 0 uint16 nextArtworkId = 0; // Records the official uint256 private _startBlock = 0; // True once artwork has begun (once VRF has been received) bool private isArtworkStarted = false; // Block that stores first time of first purchase uint256 public firstPurchaseBlock = 0; // If not all artworks are sold, will trigger start this many blocks after first artwork purchased uint256 public constant AUTOMATIC_START_BLOCK_DELAY = 184000; // Mapping to the artwork tier for each token // artworkId => tier mapping(uint256 => ArtworkTier) public artworkTier; // The constant number of locks for each purchase tier. uint8[4] locksPerTier = [1, 2, 4]; // Remaining locks per artwork -- each lock will decrement value // artworkId => _locksRemaining mapping(uint256 => uint8) _locksRemaining; // A record of locked layers for each token: // artworkId => lockedCanvasId[NUM_LAYERS] // NOTE: a value of 0 signifies that a layer is NOT locked // - Example: // - lockedLayersForToken[100][1] = 10 // - can be read as artworkId 100 has layer 1 (0 indexed) locked with canvasId 10. // - lockedLayerForToken[100][0] = 0 // - can be read as artworkId 100's layer 0 is NOT locked mapping(uint256 => uint16[NUM_LAYERS]) lockedLayersForToken; // A record of if an artwork is locked and at which action it was locked. // canvasId => actionId[NUM_LAYERS] -> ~7 actions per layer so uint8 is good for actionId // canvasIds are reused for each layer to save on storage costs. // - Example: // - lockedLayerHistory[10][1] = 2 // - can be read as canvasId 10 for second layer (0 indexed) was locked on action 2 // - lockedLayerHistory[10][2] = 0 // - can be read as canvasId 10 has NOT BEEN LOCKED for third layer mapping(uint16 => uint8[NUM_LAYERS]) lockedLayerHistory; // Offsets for layerIds for each layer, used when finding base id for next layer // The [0] index is set by Chainlink VRF (https://docs.chain.link/docs/chainlink-vrf-api-reference) // Later indexes are only influenced by participants locking layers, so the artwork is // more connected with the behaviour of the participants. // INVARIANT: Can only change for future UNLOCKED layer, can never be altered for // past layers. Needs to be deterministic for past/current layers. // - Example: // - layerIdStartOffset[1] = 19413 // - can be read as the starting canvasId will be offset by 19413 uint256[NUM_LAYERS] public canvasIdStartOffsets; // CHAINLINK VRF properties -- want to keep locally to test gas spend bytes32 constant keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445; uint256 constant vrfFee = 2000000000000000000; // Store the current URI -- URI may change if domain is updated string baseURI = "https://su3p5zea28.execute-api.us-west-1.amazonaws.com/prod/metadata/"; constructor() ERC721("Whole Picture", "WP") VRFConsumerBase( 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, 0x514910771AF9Ca656af840dff83E8264EcF986CA ) public { } /** * @dev Metadata base uri */ function _baseURI() internal view override returns (string memory) { return baseURI; } /** * @dev Returns the currnet price in wei for an artwork in a given tier. * Pricing is a bonding curve, using 4 quadratic easing sections: * - Enthusiast tier is an ease out curve * - Collector tier is ease in segment until midway point, then ease out * - Strata tier is ease in. */ function currentPrice(ArtworkTier tier) public override view returns (uint256) { if(artworksRemainingInTier[uint256(tier)] == 0) { return 0; } uint256 min; uint256 max; uint256 numerator; uint256 denominator; if(tier == ArtworkTier.ENTHUSIAST) { min = 1 * 1 ether / 10; max = 5 * 1 ether / 10; numerator = totalArtworksInTier[0] - artworksRemainingInTier[0]; denominator = totalArtworksInTier[0]; } else if(tier == ArtworkTier.COLLECTOR) { uint256 collectorMin = 5 * 1 ether / 10; uint256 collectorMax = 25 * 1 ether / 10; uint256 midwayPrice = collectorMin + (collectorMax - collectorMin) / 2; uint256 midwayArtworks = totalArtworksInTier[1] / 2; if(artworksRemainingInTier[1] > midwayArtworks){ // invert so switch min and max min = midwayPrice; max = collectorMin; numerator = midwayArtworks - (totalArtworksInTier[1] - artworksRemainingInTier[1]); denominator = midwayArtworks; } else { min = midwayPrice; max = collectorMax; numerator = midwayArtworks - artworksRemainingInTier[1]; denominator = midwayArtworks; } } else { // Strata tier so return STRATA_TIER price // inverted so switch max and min max = 25 * 1 ether / 10; min = 4 * 1 ether / 1; numerator = artworksRemainingInTier[2] - 1; // inverted so use remaining for numerator denominator = totalArtworksInTier[2] - 1; // minus one so ends on 4 } return easeInQuad(min, max, numerator, denominator); } /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) public override view returns (uint256, uint16) { return (currentPrice(tier), artworksRemainingInTier[uint256(tier)]); } /** * @dev Returns the number of artworks issued. */ function totalArtworks() public override pure returns (uint16) { return TOTAL_ARTWORK_SUPPLY; } /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() public override view returns (uint16) { return artworksRemainingInTier[0] + artworksRemainingInTier[1] + artworksRemainingInTier[2]; } /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() public override view returns (uint256) { if(!hasStarted()) { return 0; } return ((getAction()) * BLOCKS_PER_ACTION + startBlock()) - block.number; } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function canLock(uint256 artworkId) public override view returns (bool) { // check locks return (_locksRemaining[artworkId] > 0); } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function locksRemaining(uint256 artworkId) public view returns (uint8) { // check locks return _locksRemaining[artworkId]; } /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) public override view returns (uint16, uint16, uint16, uint16) { // ensure no ids sent if hasn't started or artwork doesn't exist if(!hasStarted() || !_exists(artworkId)) { return (0, 0, 0, 0); } (uint8 currentLayer, uint8 currentAction) = getCurrentLayerAndAction(); // initialize array, all values start at 0 uint16[NUM_LAYERS] memory canvasIds; // now need to loop through all layers for(uint8 i = 0; i <= currentLayer; i++) { uint8 layerAction; // check if we are on the current (topmost) layer, in which case we use the current action if(i == currentLayer) { layerAction = currentAction; } else { // otherwise we use the final action for previous layer layerAction = ACTIONS_PER_LAYER; } // now get the canvasId for action for target layer canvasIds[i] = getCanvasIdForAction(artworkId, i, layerAction); } return (canvasIds[0], canvasIds[1], canvasIds[2], canvasIds[3]); } /** * @dev Returns the startBlock for the artwork. * There are two conditions for the artwork to start -- either all artworks are sold, * or the automatic trigger started after the first artwork has sold has been reached. */ function startBlock() public view returns (uint256) { return _startBlock; } /** * @dev Check whether the artwork has started. */ function hasStarted() public view returns (bool) { return startBlock() != 0; } /** * @dev Gets the overall action since the start of the process. * NOTE: Actions are 1 indexed! 0 means no actions because has not begun. */ function getAction() public view returns (uint8) { if(!hasStarted()) { return 0; } uint256 elapsedBlocks = block.number.sub(startBlock()); // actions are 1 indexed so need to add 1 uint256 actionsElapsed = elapsedBlocks.div(BLOCKS_PER_ACTION) + 1; uint256 clampedActions = Math.min(actionsElapsed, MAX_ACTIONS); // console.log("ElapsedBlocks: %s", elapsedBlocks); return uint8(clampedActions); } /** * @dev Returns the current layer as well as the current action. * - Returns: * - (layer, actionInLayer) * - If action == 0, then layer is not revealed */ function getCurrentLayerAndAction() public view returns (uint8, uint8) { uint8 totalActions = getAction(); // ensure we return if(totalActions == 0) { return (0, 0); } // need to subtract 1 because actions start at 1 uint8 actionZeroIndexed = totalActions - 1; uint8 currentLayer = (actionZeroIndexed) / ACTIONS_PER_LAYER; uint8 currentActionZeroIndexed = actionZeroIndexed - (currentLayer * ACTIONS_PER_LAYER); // re-add 1 to restore 1 index uint8 currentAction = currentActionZeroIndexed + 1; return (currentLayer, currentAction); } /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) public override payable returns (uint256) { require(artworksRemainingInTier[uint256(tier)] > 0, "No artworks remaining in tier!"); // Validate payment amount uint256 weiRequired = currentPrice(tier); require(msg.value >= weiRequired, "Not enough payment sent!"); uint256 newArtworkId = nextArtworkId; // check if first sale, and if so set first sale block if(newArtworkId == 0) { firstPurchaseBlock = block.number; } // mint new artwork! _safeMint(_msgSender(), newArtworkId); // record tier and the number of locks artworkTier[newArtworkId] = tier; _locksRemaining[newArtworkId] = locksPerTier[uint256(tier)]; // decrement artworks available in tier artworksRemainingInTier[uint256(tier)] -= 1; // incriment artwork to the next artworkId nextArtworkId++; // check if all artworks sold, then trigger startBlock if not already started if(nextArtworkId == TOTAL_ARTWORK_SUPPLY) { if(!hasStarted()) { requestStartArtwork(); } } emit ArtworkPurchased(newArtworkId, uint8(tier)); return newArtworkId; } /** * @dev Request to start the artwork! * - Acheived by requesting a random number from Chainlink VRF. * - Will automatically be requested after the last sale -- or can be requested * manually once sale period has ended. * Requirements: * Can only occur after: * - All works have been sold * - Sale period ended (X blocks past the block of the first purchase) * - Has not already been started * - Enough LINK on contract */ function requestStartArtwork() public returns (bytes32) { require(!hasStarted(), "Artwork has already been started!"); // Require all artworks sold or after sale period has ended require( availableArtworks() == 0 || firstPurchaseBlock > 0 && block.number > firstPurchaseBlock + AUTOMATIC_START_BLOCK_DELAY, "Cannot start the artwork before all works are sold out or until after sale period" ); // Request randomness from VRF return requestRandomness(keyHash, vrfFee, block.number); } /** * @dev Respond to Chainlink VRF * - This will start artwork if not already started */ function fulfillRandomness(bytes32 /*requestId*/, uint256 randomness) internal override { startArtwork(randomness); } /** * @dev Start the artwork! This sets the start seed and start block. * - Can only be called once */ function startArtwork(uint256 randomSeed) internal { // Ensure start block not already set (in case random number requested twice before being fulfilled) require(!hasStarted(), "Artwork has already started, seed cannot be set twice!"); // Set start block and the start seed, which kicks off the artwork experience!!!!! _startBlock = block.number; // The first canvas start is the random Seed! canvasIdStartOffsets[0] = randomSeed % TOTAL_ARTWORK_SUPPLY; } /** * @dev Lock artwork layer. * - Reverts if cannot lock. * - Emits LayerLocked event */ function lockLayer(uint256 artworkId) public override { require(hasStarted(), "Art event has not begun!"); require(_exists(artworkId), "Artwork does not exist!"); // require locking party to be owner require(_msgSender() == ownerOf(artworkId), "Must be artwork owner!"); // require locks remaining require(canLock(artworkId), "No locks remaining!"); // first determine active layer and current action (uint8 currentLayer, uint8 currentAction) = getCurrentLayerAndAction(); // Ensure we are not on action 0, which means cannot lock require(currentAction > 0, "Canvas is not yet revealed!"); // recreate history to determine current canvas uint16 currentCanvasId = getCanvasIdForAction(artworkId, currentLayer, currentAction); // ensure not already locked so user does not waste lock uint8 currLockedValue = lockedLayerHistory[currentCanvasId][currentLayer]; require(currLockedValue == 0, "Layer must not be already locked!"); require(currentCanvasId > 0, "Invalid canvas id of 0!"); // is this needed??? // update locked layer by idx mapping lockedLayersForToken[artworkId][currentLayer] = currentCanvasId; // update canvasId locked layer mapping lockedLayerHistory[currentCanvasId][currentLayer] = currentAction; // Update start canvasId offset for next layer if(currentLayer < NUM_LAYERS - 1) { canvasIdStartOffsets[currentLayer + 1] = (block.number + canvasIdStartOffsets[currentLayer]) % TOTAL_ARTWORK_SUPPLY; } _locksRemaining[artworkId] -= 1; emit LayerLocked(artworkId, currentLayer, currentCanvasId); } /** * @dev Valid canvasIds are always 1 indexed! An index of 0 means canvas is not yet revealed. */ function incrimentCanvasId(uint16 canvasId) internal pure returns (uint16) { return (canvasId % NUM_CANVAS_IDS) + 1; } /** * @dev Gets the corresponding canvasId for an artwork and layer at a given action. * This function calculates the current canvas by starting at first canvas of the current * layer and recreating past actions, which leads to the current valid layer. * - Each artworkID should ALWAYS return a unique canvas ID for the same action state. * - CanvasIds are 1 indexed, so a revealed canvas should NEVER return 0! */ function getCanvasIdForAction(uint256 artworkId, uint8 layer, uint8 action) internal view returns (uint16) { // If we are on 0 action, layer is not revealed no valid canvasId if(action == 0) { return 0; } // If artwork does not exist, return 0 if(!_exists(artworkId)) { return 0; } // If canvas is locked, return the locked canvasId uint16 lockedCanvasId = lockedLayersForToken[artworkId][layer]; if(lockedCanvasId != 0) { return lockedCanvasId; } // first canvasId is 1 INDEXED => the offset + the artwork id + 1 uint16 currCanvasId = uint16(((canvasIdStartOffsets[layer] + artworkId) % (NUM_CANVAS_IDS)) + 1); // We begin at action 1, and then find corresponding canvasId. Then we incriment for each // action while also checking if canvasId has been locked in the past. This will be expensive // when many layers are locked. // this will start on second action, and then work way up to latest final action for(uint8 i = 1; i < action; i++) { // incriment the currentCanvasId currCanvasId = incrimentCanvasId(currCanvasId); // check if this canvas was locked on a previous action uint8 canvasLockedOnAction = lockedLayerHistory[currCanvasId][layer]; // TODO: Prevent infinite loop just in case?? // while canvasId was locked on a previous action, incriment the current canvasId while( canvasLockedOnAction != 0 && canvasLockedOnAction <= i) { // advance canvas step currCanvasId = incrimentCanvasId(currCanvasId); canvasLockedOnAction = lockedLayerHistory[currCanvasId][layer]; } } return currCanvasId; } /** * @dev Ease in quadratic lerp function -- x * x, invert for ease out */ function easeInQuad(uint256 min, uint256 max, uint256 numerator, uint256 denominator) internal pure returns (uint256) { if(min <= max) { // min + (max - min) * x^2 return (max.sub(min)).mul(numerator).mul(numerator).div(denominator).div(denominator).add(min); } // inverted -> max - (max - min) * x^2 return min.sub((min.sub(max)).mul(numerator).mul(numerator).div(denominator).div(denominator)); } /** * @dev Updates the URI in case of domain change or switch to IPFS in the future; */ function setBaseURI(string calldata newURI) public onlyOwner { baseURI = newURI; } /** * @dev Withdrawl funds to owner * - This saves gas vs if each payment was sent to owner */ function withdrawlFunds() public { (bool success, ) = address(0x1Df3260ea86d338404aC49F3D33cec477a46A827).call{value: address(this).balance}(""); require(success, "Transfer failed."); } }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT /** * @dev Interface for locking layer artwork project. Implemented interface will allow for functional website. */ interface ILockingLayers { /** Artwork tier, used for pricing, # layers locked, and gallery benefits */ enum ArtworkTier { ENTHUSIAST, COLLECTOR, STRATA } /** * @dev Emitted when layer successfully locked. */ event LayerLocked(uint256 artworkId, uint8 layer, uint256 canvasId); /** * @dev Emit on purchase to know which artwork tier and original owner */ event ArtworkPurchased(uint256 artworkId, uint8 tier); /** * @dev Returns the current price to buy an artwork in wei. */ function currentPrice(ArtworkTier tier) external view returns (uint256); /** * @dev Returns the number of artworks issued. */ function totalArtworks() external view returns (uint16); /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() external view returns (uint16); /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) external view returns (uint256, uint16); /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) external view returns (uint16, uint16, uint16, uint16); /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() external view returns (uint256); /** * @dev Checks if an artwork can lock the current layer. */ function canLock(uint256 artworkId) external view returns (bool); /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) external payable returns (uint256); /** * @dev Lock artwork layer. * - Reverts if cannot lock. */ function lockLayer(uint256 artworkId) external; }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT /* EDITED FOR COMPATABILITY WITH 0.8.0 COMPILER */ /* Edited on 22/04/2021 by Jasper Degens */ // Trimmed down interface for just VRF functions import "./LinkTokenInterfaceSimplified.sol"; import "./VRFRequestIDBase.sol"; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random Oracle (not his real job) wants to provide randomness * @dev to Vera the verifier in such a way that Vera can be sure he's not * @dev making his output up to suit himself. Reggie provides Vera a public key * @dev to which he knows the secret key. Each time Vera provides a seed to * @dev Reggie, he gives back a value which is computed completely * @dev deterministically from the seed and the secret key. * * @dev Reggie provides a proof by which Vera can verify that the output was * @dev correctly computed once Reggie tells it to her, but without that proof, * @dev the output is indistinguishable to her from a uniform random sample * @dev from the output space. * * @dev The purpose of this contract is to make it easy for unrelated contracts * @dev to talk to Vera the verifier about the work Reggie is doing, to provide * @dev simple access to a verifiable source of randomness. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constuctor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator, _link) public { * @dev <initialization with other arguments goes here> * @dev } * @dev } * * @dev The oracle will have given you an ID for the VRF keypair they have * @dev committed to (let's call it keyHash), and have told you the minimum LINK * @dev price for VRF service. Make sure your contract has sufficient LINK, and * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you * @dev want to generate randomness from. * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomness method. * * @dev The randomness argument to fulfillRandomness is the actual random value * @dev generated from your seed. * * @dev The requestId argument is generated from the keyHash and the seed by * @dev makeRequestId(keyHash, seed). If your contract could have concurrent * @dev requests open, you can use the requestId to track which seed is * @dev associated with which randomness. See VRFRequestIDBase.sol for more * @dev details. (See "SECURITY CONSIDERATIONS" for principles to keep in mind, * @dev if your contract could have multiple requests in flight simultaneously.) * * @dev Colliding `requestId`s are cryptographically impossible as long as seeds * @dev differ. (Which is critical to making unpredictable randomness! See the * @dev next section.) * * ***************************************************************************** * @dev SECURITY CONSIDERATIONS * * @dev A method with the ability to call your fulfillRandomness method directly * @dev could spoof a VRF response with any random value, so it's critical that * @dev it cannot be directly called by anything other than this base contract * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method). * * @dev For your users to trust that your contract's random behavior is free * @dev from malicious interference, it's best if you can write it so that all * @dev behaviors implied by a VRF response are executed *during* your * @dev fulfillRandomness method. If your contract must store the response (or * @dev anything derived from it) and use it later, you must ensure that any * @dev user-significant behavior which depends on that stored value cannot be * @dev manipulated by a subsequent VRF request. * * @dev Similarly, both miners and the VRF oracle itself have some influence * @dev over the order in which VRF responses appear on the blockchain, so if * @dev your contract could have multiple VRF requests in flight simultaneously, * @dev you must ensure that the order in which the VRF responses arrive cannot * @dev be used to manipulate your contract's user-significant behavior. * * @dev Since the ultimate input to the VRF is mixed with the block hash of the * @dev block in which the request is made, user-provided seeds have no impact * @dev on its economic security properties. They are only included for API * @dev compatability with previous versions of this contract. * * @dev Since the block hash of the block which contains the requestRandomness * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful * @dev miner could, in principle, fork the blockchain to evict the block * @dev containing the request, forcing the request to be included in a * @dev different block with a different hash, and therefore a different input * @dev to the VRF. However, such an attack would incur a substantial economic * @dev cost. This cost scales with the number of blocks the VRF oracle waits * @dev until it calls responds to a request. */ abstract contract VRFConsumerBase is VRFRequestIDBase { /** * @notice fulfillRandomness handles the VRF response. Your contract must * @notice implement it. See "SECURITY CONSIDERATIONS" above for important * @notice principles to keep in mind when implementing your fulfillRandomness * @notice method. * * @dev VRFConsumerBase expects its subcontracts to have a method with this * @dev signature, and will call it once it has verified the proof * @dev associated with the randomness. (It is triggered via a call to * @dev rawFulfillRandomness, below.) * * @param requestId The Id initially returned by requestRandomness * @param randomness the VRF output */ function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual; /** * @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 * @param _seed seed mixed into the input of the VRF. * * @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, uint256 _seed) internal returns (bytes32 requestId) { LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, _seed)); // 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, _seed, 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); } LinkTokenInterfaceSimplified immutable internal LINK; address immutable private vrfCoordinator; // Nonces for each VRF key from which randomness has been requested. // // Must stay in sync with VRFCoordinator[_keyHash][this] mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces; /** * @param _vrfCoordinator address of VRFCoordinator contract * @param _link address of LINK token contract * * @dev https://docs.chain.link/docs/link-token-contracts */ constructor(address _vrfCoordinator, address _link) { vrfCoordinator = _vrfCoordinator; LINK = LinkTokenInterfaceSimplified(_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; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @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, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "./extensions/IERC721Enumerable.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping (uint256 => address) private _owners; // Mapping owner address to token count mapping (address => uint256) private _balances; // Mapping from token ID to approved address mapping (uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping (address => mapping (address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } /** * @dev Base URI for computing {tokenURI}. Empty by default, can be overriden * in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || ERC721.isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { // solhint-disable-next-line no-inline-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity ^0.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 () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT interface LinkTokenInterfaceSimplified { function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success); function balanceOf(address owner) external view returns (uint256 balance); }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT contract VRFRequestIDBase { /** * @notice returns the seed which is actually input to the VRF coordinator * * @dev To prevent repetition of VRF output due to repetition of the * @dev user-supplied seed, that seed is combined in a hash with the * @dev user-specific nonce, and the address of the consuming contract. The * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in * @dev the final seed, but the nonce does protect against repetition in * @dev requests which are included in a single block. * * @param _userSeed VRF seed input provided by user * @param _requester Address of the requesting contract * @param _nonce User-specific nonce at the time of the request */ function makeVRFInputSeed(bytes32 _keyHash, uint256 _userSeed, address _requester, uint256 _nonce) internal pure returns (uint256) { return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce))); } /** * @notice Returns the id for this request * @param _keyHash The serviceAgreement ID to be used for this request * @param _vRFInputSeed The seed to be passed directly to the VRF * @return The id for this request * * @dev Note that _vRFInputSeed is not the seed passed by the consuming * @dev contract, but the one generated by makeVRFInputSeed */ function makeRequestId( bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.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) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = alphabet[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"artworkId","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"tier","type":"uint8"}],"name":"ArtworkPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"artworkId","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"layer","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"canvasId","type":"uint256"}],"name":"LayerLocked","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"},{"inputs":[],"name":"AUTOMATIC_START_BLOCK_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"artworkTier","outputs":[{"internalType":"enum ILockingLayers.ArtworkTier","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableArtworks","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blocksUntilNextLayerRevealed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"artworkId","type":"uint256"}],"name":"canLock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"canvasIdStartOffsets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum ILockingLayers.ArtworkTier","name":"tier","type":"uint8"}],"name":"currentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstPurchaseBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAction","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"artworkId","type":"uint256"}],"name":"getCanvasIds","outputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentLayerAndAction","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum ILockingLayers.ArtworkTier","name":"tier","type":"uint8"}],"name":"getTierPurchaseData","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"artworkId","type":"uint256"}],"name":"lockLayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"artworkId","type":"uint256"}],"name":"locksRemaining","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum ILockingLayers.ArtworkTier","name":"tier","type":"uint8"}],"name":"purchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","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":"requestStartArtwork","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalArtworks","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"pure","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":"withdrawlFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61012060405260c860c081815261032060e0526101009190915262000029906008906003620001f1565b506040805160608101825260c880825261032060208301529181019190915262000058906009906003620001f1565b50600a805461ffff191690556000600b819055600c805460ff19169055600d55604080516060810182526001815260026020820152600491810191909152620000a690600f9060036200028e565b50604051806080016040528060458152602001620036ce604591398051620000d79160179160209091019062000314565b50348015620000e557600080fd5b50604080518082018252600d81526c57686f6c65205069637475726560981b602080830191825283518085019094526002845261057560f41b90840152815173f0d54349addcf704f77ae15b96510dea15cb79529373514910771af9ca656af840dff83e8264ecf986ca93929091620001619160009162000314565b5080516200017790600190602084019062000314565b5050506001600160601b0319606092831b811660a052911b1660805260006200019d3390565b600780546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620003e5565b6001830191839082156200027c5791602002820160005b838211156200024a57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030262000208565b80156200027a5782816101000a81549061ffff02191690556002016020816001010492830192600103026200024a565b505b506200028a92915062000391565b5090565b6001830191839082156200027c5791602002820160005b83821115620002e557835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302620002a5565b80156200027a5782816101000a81549060ff0219169055600101602081600001049283019260010302620002e5565b8280546200032290620003a8565b90600052602060002090601f0160209004810192826200034657600085556200027c565b82601f106200036157805160ff19168380011785556200027c565b828001600101855582156200027c579182015b828111156200027c57825182559160200191906001019062000374565b5b808211156200028a576000815560010162000392565b600281046001821680620003bd57607f821691505b60208210811415620003df57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c60a05160601c6132b662000418600039600081816115da0152612218015260006121e901526132b66000f3fe6080604052600436106102255760003560e01c80636352211e11610123578063a22cb465116100ab578063c2d9830c1161006f578063c2d9830c146106ab578063c87b56dd146106dd578063e4a233e1146106fd578063e985e9c514610712578063f2fde38b1461075b57610225565b8063a22cb46514610607578063ad44609714610627578063b1f74d131461063c578063b26e258b1461066b578063b88d4fde1461068b57610225565b806383f4cc7e116100f257806383f4cc7e146105465780638b1a9027146105665780638da5cb5b146105b457806394985ddd146105d257806395d89b41146105f257610225565b80636352211e146104dc57806370a08231146104fc578063715018a61461051c57806381a68a9e1461053157610225565b806326e1aab7116101b157806344691f7e1161017557806344691f7e1461045457806348cd4cb11461046957806355f804b31461047e5780635949bf1b1461049e5780635b2c869d146104b457610225565b806326e1aab7146103e05780633298df76146103f55780634018eece1461040857806342842e0e1461041f578063435f78fb1461043f57610225565b8063095ea7b3116101f8578063095ea7b3146102e75780630e004cbf1461030957806315ddfb991461034b578063196896a51461038357806323b872dd146103c057610225565b80630146375e1461022a57806301ffc9a71461025d57806306fdde031461028d578063081812fc146102af575b600080fd5b34801561023657600080fd5b5061024a610245366004612dc1565b61077b565b6040519081526020015b60405180910390f35b34801561026957600080fd5b5061027d610278366004612cfd565b610792565b6040519015158152602001610254565b34801561029957600080fd5b506102a26107e6565b6040516102549190612eb6565b3480156102bb57600080fd5b506102cf6102ca366004612dc1565b610879565b6040516001600160a01b039091168152602001610254565b3480156102f357600080fd5b50610307610302366004612c97565b610906565b005b34801561031557600080fd5b50610339610324366004612dc1565b60009081526010602052604090205460ff1690565b60405160ff9091168152602001610254565b34801561035757600080fd5b5061036b610366366004612d35565b610a1c565b6040805192835261ffff909116602083015201610254565b34801561038f57600080fd5b506103b361039e366004612dc1565b600e6020526000908152604090205460ff1681565b6040516102549190612e8e565b3480156103cc57600080fd5b506103076103db366004612b51565b610a8b565b3480156103ec57600080fd5b50610339610abc565b61024a610403366004612d35565b610b26565b34801561041457600080fd5b5061024a6202cec081565b34801561042b57600080fd5b5061030761043a366004612b51565b610e39565b34801561044b57600080fd5b5061024a610e54565b34801561046057600080fd5b5061027d610fad565b34801561047557600080fd5b50600b5461024a565b34801561048a57600080fd5b50610307610499366004612d54565b610fbf565b3480156104aa57600080fd5b5061024a600d5481565b3480156104c057600080fd5b506104c9610ff5565b60405161ffff9091168152602001610254565b3480156104e857600080fd5b506102cf6104f7366004612dc1565b611026565b34801561050857600080fd5b5061024a610517366004612b05565b61109d565b34801561052857600080fd5b50610307611124565b34801561053d57600080fd5b50610307611198565b34801561055257600080fd5b5061024a610561366004612d35565b61123a565b34801561057257600080fd5b50610586610581366004612dc1565b6114e1565b6040805161ffff95861681529385166020850152918416918301919091529091166060820152608001610254565b3480156105c057600080fd5b506007546001600160a01b03166102cf565b3480156105de57600080fd5b506103076105ed366004612cdc565b6115cf565b3480156105fe57600080fd5b506102a2611655565b34801561061357600080fd5b50610307610622366004612c61565b611664565b34801561063357600080fd5b5061024a611736565b34801561064857600080fd5b50610651611786565b6040805160ff938416815292909116602083015201610254565b34801561067757600080fd5b50610307610686366004612dc1565b6117fd565b34801561069757600080fd5b506103076106a6366004612b8c565b611c9a565b3480156106b757600080fd5b5061027d6106c6366004612dc1565b60009081526010602052604090205460ff16151590565b3480156106e957600080fd5b506102a26106f8366004612dc1565b611cd2565b34801561070957600080fd5b506104b06104c9565b34801561071e57600080fd5b5061027d61072d366004612b1f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561076757600080fd5b50610307610776366004612b05565b611d9d565b6013816004811061078b57600080fd5b0154905081565b60006001600160e01b031982166380ac58cd60e01b14806107c357506001600160e01b03198216635b5e139f60e01b145b806107de57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b6060600080546107f59061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546108219061314d565b801561086e5780601f106108435761010080835404028352916020019161086e565b820191906000526020600020905b81548152906001019060200180831161085157829003601f168201915b505050505090505b90565b600061088482611e88565b6108ea5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061091182611026565b9050806001600160a01b0316836001600160a01b0316141561097f5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108e1565b336001600160a01b038216148061099b575061099b813361072d565b610a0d5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108e1565b610a178383611ea5565b505050565b600080610a288361123a565b6009846002811115610a4a57634e487b7160e01b600052602160045260246000fd5b60038110610a6857634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1691509150915091565b610a953382611f13565b610ab15760405162461bcd60e51b81526004016108e190612f50565b610a17838383611ffd565b6000610ac6610fad565b610ad257506000610876565b6000610ae7610ae0600b5490565b439061219d565b90506000610af78261115c6121a9565b610b02906001612fbe565b90506000610b1e82610b166004600561309b565b60ff166121b5565b935050505090565b6000806009836002811115610b4b57634e487b7160e01b600052602160045260246000fd5b60038110610b6957634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1661ffff1611610bd45760405162461bcd60e51b815260206004820152601e60248201527f4e6f20617274776f726b732072656d61696e696e6720696e207469657221000060448201526064016108e1565b6000610bdf8361123a565b905080341015610c315760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f756768207061796d656e742073656e7421000000000000000060448201526064016108e1565b600a5461ffff1680610c425743600d555b610c4c33826121cb565b6000818152600e60205260409020805485919060ff19166001836002811115610c8557634e487b7160e01b600052602160045260246000fd5b0217905550600f846002811115610cac57634e487b7160e01b600052602160045260246000fd5b60048110610cca57634e487b7160e01b600052603260045260246000fd5b602080820492909201546000848152601090935260409092208054601f9092166101000a90920460ff1660ff1990911617905560016009856002811115610d2157634e487b7160e01b600052602160045260246000fd5b60038110610d3f57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002028282829054906101000a900461ffff16610d6691906130c4565b82546101009290920a61ffff818102199093169183160217909155600a805490911691506000610d9583613188565b82546101009290920a61ffff818102199093169183160217909155600a546104b0911614159050610dd657610dc8610fad565b610dd657610dd4610e54565b505b7f1ac498e05d7c294d22981303c4ada83b92fe1c47e7db98bd8fc7f83146b3d01981856002811115610e1857634e487b7160e01b600052602160045260246000fd5b6040805192835260ff90911660208301520160405180910390a19392505050565b610a1783838360405180602001604052806000815250611c9a565b6000610e5e610fad565b15610eb55760405162461bcd60e51b815260206004820152602160248201527f417274776f726b2068617320616c7265616479206265656e20737461727465646044820152602160f81b60648201526084016108e1565b610ebd610ff5565b61ffff161580610ee957506000600d54118015610ee957506202cec0600d54610ee69190612fbe565b43115b610f755760405162461bcd60e51b815260206004820152605160248201527f43616e6e6f742073746172742074686520617274776f726b206265666f72652060448201527f616c6c20776f726b732061726520736f6c64206f7574206f7220756e74696c2060648201527018599d195c881cd85b19481c195c9a5bd9607a1b608482015260a4016108e1565b610fa87faa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445671bc16d674ec80000436121e5565b905090565b6000610fb8600b5490565b1515905090565b6007546001600160a01b03163314610fe95760405162461bcd60e51b81526004016108e190612f1b565b610a1760178383612a37565b60095460009061ffff640100000000820481169161101c9162010000820481169116612fa1565b610fa89190612fa1565b6000818152600260205260408120546001600160a01b0316806107de5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108e1565b60006001600160a01b0382166111085760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108e1565b506001600160a01b031660009081526003602052604090205490565b6007546001600160a01b0316331461114e5760405162461bcd60e51b81526004016108e190612f1b565b6007546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600780546001600160a01b0319169055565b604051600090731df3260ea86d338404ac49f3d33cec477a46a8279047908381818185875af1925050503d80600081146111ee576040519150601f19603f3d011682016040523d82523d6000602084013e6111f3565b606091505b50509050806112375760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064016108e1565b50565b6000600982600281111561125e57634e487b7160e01b600052602160045260246000fd5b6003811061127c57634e487b7160e01b600052603260045260246000fd5b601081049190910154600f9091166002026101000a900461ffff166112a3575060006107e1565b6000808080808660028111156112c957634e487b7160e01b600052602160045260246000fd5b141561130f5760095460085467016345785d8a000095506706f05b59d3b2000094506112fc9161ffff90811691166130c4565b60085461ffff91821693501690506114cb565b600186600281111561133157634e487b7160e01b600052602160045260246000fd5b1415611473576706f05b59d3b200006722b1c8c1227a00006000600261135784846130e7565b611361919061301c565b61136b9084612fbe565b60085490915060009061138a9060029062010000900461ffff16612ffb565b60095461ffff9182169250620100009004168110156114135781975083965060096001600381106113cb57634e487b7160e01b600052603260045260246000fd5b6010810491909101546008546113fb92600f166002026101000a90910461ffff90811691620100009004166130c4565b6114099061ffff16826130e7565b955080945061146a565b819750829650600960016003811061143b57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1661ffff168161146491906130e7565b95508094505b505050506114cb565b600954673782dace9d90000094506722b1c8c1227a000093506114a490600190640100000000900461ffff166130c4565b60085461ffff91821693506114c4916001916401000000009004166130c4565b61ffff1690505b6114d784848484612378565b9695505050505050565b6000806000806114ef610fad565b158061150157506114ff85611e88565b155b15611517575060009250829150819050806115c8565b600080611522611786565b9150915061152e612abb565b60005b8360ff168160ff16116115a85760008460ff168260ff161415611555575082611559565b5060055b6115648a83836123d4565b838360ff166004811061158757634e487b7160e01b600052603260045260246000fd5b61ffff909216602092909202015250806115a0816131c5565b915050611531565b508051602082015160408301516060909301519198509650909450925050505b9193509193565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116475760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016108e1565b61165182826125a6565b5050565b6060600180546107f59061314d565b6001600160a01b0382163314156116bd5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108e1565b3360008181526005602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161172a911515815260200190565b60405180910390a35050565b6000611740610fad565b61174c57506000610876565b43611756600b5490565b61115c611761610abc565b60ff1661176e9190613052565b61ffff1661177c9190612fbe565b610fa891906130e7565b6000806000611793610abc565b905060ff81166117aa5760008092509250506117f9565b60006117b76001836130fe565b905060006117c6600583613030565b905060006117d560058361309b565b6117df90846130fe565b905060006117ee826001612fd6565b929650919450505050505b9091565b611805610fad565b6118515760405162461bcd60e51b815260206004820152601860248201527f417274206576656e7420686173206e6f7420626567756e21000000000000000060448201526064016108e1565b61185a81611e88565b6118a65760405162461bcd60e51b815260206004820152601760248201527f417274776f726b20646f6573206e6f742065786973742100000000000000000060448201526064016108e1565b6118af81611026565b6001600160a01b0316336001600160a01b0316146119085760405162461bcd60e51b81526020600482015260166024820152754d75737420626520617274776f726b206f776e65722160501b60448201526064016108e1565b60008181526010602052604090205460ff1661195c5760405162461bcd60e51b81526020600482015260136024820152724e6f206c6f636b732072656d61696e696e672160681b60448201526064016108e1565b600080611967611786565b9150915060008160ff16116119be5760405162461bcd60e51b815260206004820152601b60248201527f43616e766173206973206e6f74207965742072657665616c656421000000000060448201526064016108e1565b60006119cb8484846123d4565b61ffff811660009081526012602052604081209192509060ff851660048110611a0457634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a90041690508015611a745760405162461bcd60e51b815260206004820152602160248201527f4c61796572206d757374206e6f7420626520616c7265616479206c6f636b65646044820152602160f81b60648201526084016108e1565b60008261ffff1611611ac85760405162461bcd60e51b815260206004820152601760248201527f496e76616c69642063616e766173206964206f6620302100000000000000000060448201526064016108e1565b6000858152601160205260409020829060ff861660048110611afa57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002026101000a81548161ffff021916908361ffff16021790555082601260008461ffff1661ffff1681526020019081526020016000208560ff1660048110611b5d57634e487b7160e01b600052603260045260246000fd5b602091828204019190066101000a81548160ff021916908360ff16021790555060016004611b8b91906130fe565b60ff168460ff161015611c06576104b0601360ff861660048110611bbf57634e487b7160e01b600052603260045260246000fd5b0154611bcb9043612fbe565b611bd59190613206565b6013611be2866001612fd6565b60ff1660048110611c0357634e487b7160e01b600052603260045260246000fd5b01555b6000858152601060205260408120805460019290611c2890849060ff166130fe565b92506101000a81548160ff021916908360ff1602179055507f131d620cd77761a61247008d7c4e87ade078eb3224ef3bdb515fc7bb9592144d858584604051611c8b9392919092835260ff91909116602083015261ffff16604082015260600190565b60405180910390a15050505050565b611ca43383611f13565b611cc05760405162461bcd60e51b81526004016108e190612f50565b611ccc848484846125af565b50505050565b6060611cdd82611e88565b611d415760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016108e1565b6000611d4b6125e2565b90506000815111611d6b5760405180602001604052806000815250611d96565b80611d75846125f1565b604051602001611d86929190612e05565b6040516020818303038152906040525b9392505050565b6007546001600160a01b03163314611dc75760405162461bcd60e51b81526004016108e190612f1b565b6001600160a01b038116611e2c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108e1565b6007546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611eda82611026565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611f1e82611e88565b611f7f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108e1565b6000611f8a83611026565b9050806001600160a01b0316846001600160a01b03161480611fc55750836001600160a01b0316611fba84610879565b6001600160a01b0316145b80611ff557506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661201082611026565b6001600160a01b0316146120785760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108e1565b6001600160a01b0382166120da5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108e1565b6120e5600082611ea5565b6001600160a01b038316600090815260036020526040812080546001929061210e9084906130e7565b90915550506001600160a01b038216600090815260036020526040812080546001929061213c908490612fbe565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000611d9682846130e7565b6000611d96828461301c565b60008183106121c45781611d96565b5090919050565b61165182826040518060200160405280600081525061270c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000858786604051602001612254929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161228193929190612e67565b602060405180830381600087803b15801561229b57600080fd5b505af11580156122af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d39190612cc0565b5060008481526006602081815260408084205481518084018a905280830188905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209388905291905261232f906001612fbe565b60008681526006602052604090205561236f8582604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b95945050505050565b60008385116123b4576123ad856123a7846123a181818961239b81818e8a61219d565b9061273f565b906121a9565b9061274b565b9050611ff5565b61236f6123cd836123a181818861239b81818e8e61219d565b869061219d565b600060ff82166123e657506000611d96565b6123ef84611e88565b6123fb57506000611d96565b600084815260116020526040812060ff85166004811061242b57634e487b7160e01b600052603260045260246000fd5b601081049190910154600f9091166002026101000a900461ffff1690508015612455579050611d96565b60006104b086601360ff88166004811061247f57634e487b7160e01b600052603260045260246000fd5b015461248b9190612fbe565b6124959190613206565b6124a0906001612fbe565b905060015b8460ff168160ff16101561259c576124bc82612757565b61ffff811660009081526012602052604081209193509060ff8816600481106124f557634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a90041690505b60ff81161580159061252657508160ff168160ff1611155b156125895761253483612757565b61ffff8116600090815260126020526040902090935060ff88166004811061256c57634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a900416905061250e565b5080612594816131c5565b9150506124a5565b5095945050505050565b61165181612770565b6125ba848484611ffd565b6125c6848484846127fa565b611ccc5760405162461bcd60e51b81526004016108e190612ec9565b6060601780546107f59061314d565b60608161261657506040805180820190915260018152600360fc1b60208201526107e1565b8160005b8115612640578061262a816131aa565b91506126399050600a8361301c565b915061261a565b60008167ffffffffffffffff81111561266957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612693576020820181803683370190505b5090505b8415611ff5576126a86001836130e7565b91506126b5600a86613206565b6126c0906030612fbe565b60f81b8183815181106126e357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612705600a8661301c565b9450612697565b6127168383612904565b61272360008484846127fa565b610a175760405162461bcd60e51b81526004016108e190612ec9565b6000611d96828461307c565b6000611d968284612fbe565b60006127656104b0836131e5565b6107de906001612fa1565b612778610fad565b156127e45760405162461bcd60e51b815260206004820152603660248201527f417274776f726b2068617320616c726561647920737461727465642c20736565604482015275642063616e6e6f74206265207365742074776963652160501b60648201526084016108e1565b43600b556127f46104b082613206565b60135550565b60006001600160a01b0384163b156128fc57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061283e903390899088908890600401612e34565b602060405180830381600087803b15801561285857600080fd5b505af1925050508015612888575060408051601f3d908101601f1916820190925261288591810190612d19565b60015b6128e2573d8080156128b6576040519150601f19603f3d011682016040523d82523d6000602084013e6128bb565b606091505b5080516128da5760405162461bcd60e51b81526004016108e190612ec9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ff5565b506001611ff5565b6001600160a01b03821661295a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108e1565b61296381611e88565b156129b05760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108e1565b6001600160a01b03821660009081526003602052604081208054600192906129d9908490612fbe565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b828054612a439061314d565b90600052602060002090601f016020900481019282612a655760008555612aab565b82601f10612a7e5782800160ff19823516178555612aab565b82800160010185558215612aab579182015b82811115612aab578235825591602001919060010190612a90565b50612ab7929150612ad9565b5090565b60405180608001604052806004906020820280368337509192915050565b5b80821115612ab75760008155600101612ada565b80356001600160a01b03811681146107e157600080fd5b600060208284031215612b16578081fd5b611d9682612aee565b60008060408385031215612b31578081fd5b612b3a83612aee565b9150612b4860208401612aee565b90509250929050565b600080600060608486031215612b65578081fd5b612b6e84612aee565b9250612b7c60208501612aee565b9150604084013590509250925092565b60008060008060808587031215612ba1578081fd5b612baa85612aee565b9350612bb860208601612aee565b925060408501359150606085013567ffffffffffffffff80821115612bdb578283fd5b818701915087601f830112612bee578283fd5b813581811115612c0057612c00613246565b604051601f8201601f19908116603f01168101908382118183101715612c2857612c28613246565b816040528281528a6020848701011115612c40578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060408385031215612c73578182fd5b612c7c83612aee565b91506020830135612c8c8161325c565b809150509250929050565b60008060408385031215612ca9578182fd5b612cb283612aee565b946020939093013593505050565b600060208284031215612cd1578081fd5b8151611d968161325c565b60008060408385031215612cee578182fd5b50508035926020909101359150565b600060208284031215612d0e578081fd5b8135611d968161326a565b600060208284031215612d2a578081fd5b8151611d968161326a565b600060208284031215612d46578081fd5b813560038110611d96578182fd5b60008060208385031215612d66578182fd5b823567ffffffffffffffff80821115612d7d578384fd5b818501915085601f830112612d90578384fd5b813581811115612d9e578485fd5b866020828501011115612daf578485fd5b60209290920196919550909350505050565b600060208284031215612dd2578081fd5b5035919050565b60008151808452612df1816020860160208601613121565b601f01601f19169290920160200192915050565b60008351612e17818460208801613121565b835190830190612e2b818360208801613121565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906114d790830184612dd9565b600060018060a01b03851682528360208301526060604083015261236f6060830184612dd9565b6020810160038310612eb057634e487b7160e01b600052602160045260246000fd5b91905290565b600060208252611d966020830184612dd9565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600061ffff808316818516808303821115612e2b57612e2b61321a565b60008219821115612fd157612fd161321a565b500190565b600060ff821660ff84168060ff03821115612ff357612ff361321a565b019392505050565b600061ffff8084168061301057613010613230565b92169190910492915050565b60008261302b5761302b613230565b500490565b600060ff83168061304357613043613230565b8060ff84160491505092915050565b600061ffff808316818516818304811182151516156130735761307361321a565b02949350505050565b60008160001904831182151516156130965761309661321a565b500290565b600060ff821660ff84168160ff04811182151516156130bc576130bc61321a565b029392505050565b600061ffff838116908316818110156130df576130df61321a565b039392505050565b6000828210156130f9576130f961321a565b500390565b600060ff821660ff8416808210156131185761311861321a565b90039392505050565b60005b8381101561313c578181015183820152602001613124565b83811115611ccc5750506000910152565b60028104600182168061316157607f821691505b6020821081141561318257634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156131a0576131a061321a565b6001019392505050565b60006000198214156131be576131be61321a565b5060010190565b600060ff821660ff8114156131dc576131dc61321a565b60010192915050565b600061ffff808416806131fa576131fa613230565b92169190910692915050565b60008261321557613215613230565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461123757600080fd5b6001600160e01b03198116811461123757600080fdfea2646970667358221220ecac23eaa282f08b3e08b729fa3384afb93311cc18d0c8ed9bf8fa34bcd9648c64736f6c6343000802003368747470733a2f2f73753370357a656132382e657865637574652d6170692e75732d776573742d312e616d617a6f6e6177732e636f6d2f70726f642f6d657461646174612f
Deployed Bytecode
0x6080604052600436106102255760003560e01c80636352211e11610123578063a22cb465116100ab578063c2d9830c1161006f578063c2d9830c146106ab578063c87b56dd146106dd578063e4a233e1146106fd578063e985e9c514610712578063f2fde38b1461075b57610225565b8063a22cb46514610607578063ad44609714610627578063b1f74d131461063c578063b26e258b1461066b578063b88d4fde1461068b57610225565b806383f4cc7e116100f257806383f4cc7e146105465780638b1a9027146105665780638da5cb5b146105b457806394985ddd146105d257806395d89b41146105f257610225565b80636352211e146104dc57806370a08231146104fc578063715018a61461051c57806381a68a9e1461053157610225565b806326e1aab7116101b157806344691f7e1161017557806344691f7e1461045457806348cd4cb11461046957806355f804b31461047e5780635949bf1b1461049e5780635b2c869d146104b457610225565b806326e1aab7146103e05780633298df76146103f55780634018eece1461040857806342842e0e1461041f578063435f78fb1461043f57610225565b8063095ea7b3116101f8578063095ea7b3146102e75780630e004cbf1461030957806315ddfb991461034b578063196896a51461038357806323b872dd146103c057610225565b80630146375e1461022a57806301ffc9a71461025d57806306fdde031461028d578063081812fc146102af575b600080fd5b34801561023657600080fd5b5061024a610245366004612dc1565b61077b565b6040519081526020015b60405180910390f35b34801561026957600080fd5b5061027d610278366004612cfd565b610792565b6040519015158152602001610254565b34801561029957600080fd5b506102a26107e6565b6040516102549190612eb6565b3480156102bb57600080fd5b506102cf6102ca366004612dc1565b610879565b6040516001600160a01b039091168152602001610254565b3480156102f357600080fd5b50610307610302366004612c97565b610906565b005b34801561031557600080fd5b50610339610324366004612dc1565b60009081526010602052604090205460ff1690565b60405160ff9091168152602001610254565b34801561035757600080fd5b5061036b610366366004612d35565b610a1c565b6040805192835261ffff909116602083015201610254565b34801561038f57600080fd5b506103b361039e366004612dc1565b600e6020526000908152604090205460ff1681565b6040516102549190612e8e565b3480156103cc57600080fd5b506103076103db366004612b51565b610a8b565b3480156103ec57600080fd5b50610339610abc565b61024a610403366004612d35565b610b26565b34801561041457600080fd5b5061024a6202cec081565b34801561042b57600080fd5b5061030761043a366004612b51565b610e39565b34801561044b57600080fd5b5061024a610e54565b34801561046057600080fd5b5061027d610fad565b34801561047557600080fd5b50600b5461024a565b34801561048a57600080fd5b50610307610499366004612d54565b610fbf565b3480156104aa57600080fd5b5061024a600d5481565b3480156104c057600080fd5b506104c9610ff5565b60405161ffff9091168152602001610254565b3480156104e857600080fd5b506102cf6104f7366004612dc1565b611026565b34801561050857600080fd5b5061024a610517366004612b05565b61109d565b34801561052857600080fd5b50610307611124565b34801561053d57600080fd5b50610307611198565b34801561055257600080fd5b5061024a610561366004612d35565b61123a565b34801561057257600080fd5b50610586610581366004612dc1565b6114e1565b6040805161ffff95861681529385166020850152918416918301919091529091166060820152608001610254565b3480156105c057600080fd5b506007546001600160a01b03166102cf565b3480156105de57600080fd5b506103076105ed366004612cdc565b6115cf565b3480156105fe57600080fd5b506102a2611655565b34801561061357600080fd5b50610307610622366004612c61565b611664565b34801561063357600080fd5b5061024a611736565b34801561064857600080fd5b50610651611786565b6040805160ff938416815292909116602083015201610254565b34801561067757600080fd5b50610307610686366004612dc1565b6117fd565b34801561069757600080fd5b506103076106a6366004612b8c565b611c9a565b3480156106b757600080fd5b5061027d6106c6366004612dc1565b60009081526010602052604090205460ff16151590565b3480156106e957600080fd5b506102a26106f8366004612dc1565b611cd2565b34801561070957600080fd5b506104b06104c9565b34801561071e57600080fd5b5061027d61072d366004612b1f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561076757600080fd5b50610307610776366004612b05565b611d9d565b6013816004811061078b57600080fd5b0154905081565b60006001600160e01b031982166380ac58cd60e01b14806107c357506001600160e01b03198216635b5e139f60e01b145b806107de57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b6060600080546107f59061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546108219061314d565b801561086e5780601f106108435761010080835404028352916020019161086e565b820191906000526020600020905b81548152906001019060200180831161085157829003601f168201915b505050505090505b90565b600061088482611e88565b6108ea5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061091182611026565b9050806001600160a01b0316836001600160a01b0316141561097f5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108e1565b336001600160a01b038216148061099b575061099b813361072d565b610a0d5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108e1565b610a178383611ea5565b505050565b600080610a288361123a565b6009846002811115610a4a57634e487b7160e01b600052602160045260246000fd5b60038110610a6857634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1691509150915091565b610a953382611f13565b610ab15760405162461bcd60e51b81526004016108e190612f50565b610a17838383611ffd565b6000610ac6610fad565b610ad257506000610876565b6000610ae7610ae0600b5490565b439061219d565b90506000610af78261115c6121a9565b610b02906001612fbe565b90506000610b1e82610b166004600561309b565b60ff166121b5565b935050505090565b6000806009836002811115610b4b57634e487b7160e01b600052602160045260246000fd5b60038110610b6957634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1661ffff1611610bd45760405162461bcd60e51b815260206004820152601e60248201527f4e6f20617274776f726b732072656d61696e696e6720696e207469657221000060448201526064016108e1565b6000610bdf8361123a565b905080341015610c315760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f756768207061796d656e742073656e7421000000000000000060448201526064016108e1565b600a5461ffff1680610c425743600d555b610c4c33826121cb565b6000818152600e60205260409020805485919060ff19166001836002811115610c8557634e487b7160e01b600052602160045260246000fd5b0217905550600f846002811115610cac57634e487b7160e01b600052602160045260246000fd5b60048110610cca57634e487b7160e01b600052603260045260246000fd5b602080820492909201546000848152601090935260409092208054601f9092166101000a90920460ff1660ff1990911617905560016009856002811115610d2157634e487b7160e01b600052602160045260246000fd5b60038110610d3f57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002028282829054906101000a900461ffff16610d6691906130c4565b82546101009290920a61ffff818102199093169183160217909155600a805490911691506000610d9583613188565b82546101009290920a61ffff818102199093169183160217909155600a546104b0911614159050610dd657610dc8610fad565b610dd657610dd4610e54565b505b7f1ac498e05d7c294d22981303c4ada83b92fe1c47e7db98bd8fc7f83146b3d01981856002811115610e1857634e487b7160e01b600052602160045260246000fd5b6040805192835260ff90911660208301520160405180910390a19392505050565b610a1783838360405180602001604052806000815250611c9a565b6000610e5e610fad565b15610eb55760405162461bcd60e51b815260206004820152602160248201527f417274776f726b2068617320616c7265616479206265656e20737461727465646044820152602160f81b60648201526084016108e1565b610ebd610ff5565b61ffff161580610ee957506000600d54118015610ee957506202cec0600d54610ee69190612fbe565b43115b610f755760405162461bcd60e51b815260206004820152605160248201527f43616e6e6f742073746172742074686520617274776f726b206265666f72652060448201527f616c6c20776f726b732061726520736f6c64206f7574206f7220756e74696c2060648201527018599d195c881cd85b19481c195c9a5bd9607a1b608482015260a4016108e1565b610fa87faa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445671bc16d674ec80000436121e5565b905090565b6000610fb8600b5490565b1515905090565b6007546001600160a01b03163314610fe95760405162461bcd60e51b81526004016108e190612f1b565b610a1760178383612a37565b60095460009061ffff640100000000820481169161101c9162010000820481169116612fa1565b610fa89190612fa1565b6000818152600260205260408120546001600160a01b0316806107de5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108e1565b60006001600160a01b0382166111085760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108e1565b506001600160a01b031660009081526003602052604090205490565b6007546001600160a01b0316331461114e5760405162461bcd60e51b81526004016108e190612f1b565b6007546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600780546001600160a01b0319169055565b604051600090731df3260ea86d338404ac49f3d33cec477a46a8279047908381818185875af1925050503d80600081146111ee576040519150601f19603f3d011682016040523d82523d6000602084013e6111f3565b606091505b50509050806112375760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064016108e1565b50565b6000600982600281111561125e57634e487b7160e01b600052602160045260246000fd5b6003811061127c57634e487b7160e01b600052603260045260246000fd5b601081049190910154600f9091166002026101000a900461ffff166112a3575060006107e1565b6000808080808660028111156112c957634e487b7160e01b600052602160045260246000fd5b141561130f5760095460085467016345785d8a000095506706f05b59d3b2000094506112fc9161ffff90811691166130c4565b60085461ffff91821693501690506114cb565b600186600281111561133157634e487b7160e01b600052602160045260246000fd5b1415611473576706f05b59d3b200006722b1c8c1227a00006000600261135784846130e7565b611361919061301c565b61136b9084612fbe565b60085490915060009061138a9060029062010000900461ffff16612ffb565b60095461ffff9182169250620100009004168110156114135781975083965060096001600381106113cb57634e487b7160e01b600052603260045260246000fd5b6010810491909101546008546113fb92600f166002026101000a90910461ffff90811691620100009004166130c4565b6114099061ffff16826130e7565b955080945061146a565b819750829650600960016003811061143b57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1661ffff168161146491906130e7565b95508094505b505050506114cb565b600954673782dace9d90000094506722b1c8c1227a000093506114a490600190640100000000900461ffff166130c4565b60085461ffff91821693506114c4916001916401000000009004166130c4565b61ffff1690505b6114d784848484612378565b9695505050505050565b6000806000806114ef610fad565b158061150157506114ff85611e88565b155b15611517575060009250829150819050806115c8565b600080611522611786565b9150915061152e612abb565b60005b8360ff168160ff16116115a85760008460ff168260ff161415611555575082611559565b5060055b6115648a83836123d4565b838360ff166004811061158757634e487b7160e01b600052603260045260246000fd5b61ffff909216602092909202015250806115a0816131c5565b915050611531565b508051602082015160408301516060909301519198509650909450925050505b9193509193565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795216146116475760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016108e1565b61165182826125a6565b5050565b6060600180546107f59061314d565b6001600160a01b0382163314156116bd5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108e1565b3360008181526005602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161172a911515815260200190565b60405180910390a35050565b6000611740610fad565b61174c57506000610876565b43611756600b5490565b61115c611761610abc565b60ff1661176e9190613052565b61ffff1661177c9190612fbe565b610fa891906130e7565b6000806000611793610abc565b905060ff81166117aa5760008092509250506117f9565b60006117b76001836130fe565b905060006117c6600583613030565b905060006117d560058361309b565b6117df90846130fe565b905060006117ee826001612fd6565b929650919450505050505b9091565b611805610fad565b6118515760405162461bcd60e51b815260206004820152601860248201527f417274206576656e7420686173206e6f7420626567756e21000000000000000060448201526064016108e1565b61185a81611e88565b6118a65760405162461bcd60e51b815260206004820152601760248201527f417274776f726b20646f6573206e6f742065786973742100000000000000000060448201526064016108e1565b6118af81611026565b6001600160a01b0316336001600160a01b0316146119085760405162461bcd60e51b81526020600482015260166024820152754d75737420626520617274776f726b206f776e65722160501b60448201526064016108e1565b60008181526010602052604090205460ff1661195c5760405162461bcd60e51b81526020600482015260136024820152724e6f206c6f636b732072656d61696e696e672160681b60448201526064016108e1565b600080611967611786565b9150915060008160ff16116119be5760405162461bcd60e51b815260206004820152601b60248201527f43616e766173206973206e6f74207965742072657665616c656421000000000060448201526064016108e1565b60006119cb8484846123d4565b61ffff811660009081526012602052604081209192509060ff851660048110611a0457634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a90041690508015611a745760405162461bcd60e51b815260206004820152602160248201527f4c61796572206d757374206e6f7420626520616c7265616479206c6f636b65646044820152602160f81b60648201526084016108e1565b60008261ffff1611611ac85760405162461bcd60e51b815260206004820152601760248201527f496e76616c69642063616e766173206964206f6620302100000000000000000060448201526064016108e1565b6000858152601160205260409020829060ff861660048110611afa57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002026101000a81548161ffff021916908361ffff16021790555082601260008461ffff1661ffff1681526020019081526020016000208560ff1660048110611b5d57634e487b7160e01b600052603260045260246000fd5b602091828204019190066101000a81548160ff021916908360ff16021790555060016004611b8b91906130fe565b60ff168460ff161015611c06576104b0601360ff861660048110611bbf57634e487b7160e01b600052603260045260246000fd5b0154611bcb9043612fbe565b611bd59190613206565b6013611be2866001612fd6565b60ff1660048110611c0357634e487b7160e01b600052603260045260246000fd5b01555b6000858152601060205260408120805460019290611c2890849060ff166130fe565b92506101000a81548160ff021916908360ff1602179055507f131d620cd77761a61247008d7c4e87ade078eb3224ef3bdb515fc7bb9592144d858584604051611c8b9392919092835260ff91909116602083015261ffff16604082015260600190565b60405180910390a15050505050565b611ca43383611f13565b611cc05760405162461bcd60e51b81526004016108e190612f50565b611ccc848484846125af565b50505050565b6060611cdd82611e88565b611d415760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016108e1565b6000611d4b6125e2565b90506000815111611d6b5760405180602001604052806000815250611d96565b80611d75846125f1565b604051602001611d86929190612e05565b6040516020818303038152906040525b9392505050565b6007546001600160a01b03163314611dc75760405162461bcd60e51b81526004016108e190612f1b565b6001600160a01b038116611e2c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108e1565b6007546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611eda82611026565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611f1e82611e88565b611f7f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108e1565b6000611f8a83611026565b9050806001600160a01b0316846001600160a01b03161480611fc55750836001600160a01b0316611fba84610879565b6001600160a01b0316145b80611ff557506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661201082611026565b6001600160a01b0316146120785760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108e1565b6001600160a01b0382166120da5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108e1565b6120e5600082611ea5565b6001600160a01b038316600090815260036020526040812080546001929061210e9084906130e7565b90915550506001600160a01b038216600090815260036020526040812080546001929061213c908490612fbe565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000611d9682846130e7565b6000611d96828461301c565b60008183106121c45781611d96565b5090919050565b61165182826040518060200160405280600081525061270c565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952858786604051602001612254929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161228193929190612e67565b602060405180830381600087803b15801561229b57600080fd5b505af11580156122af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d39190612cc0565b5060008481526006602081815260408084205481518084018a905280830188905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209388905291905261232f906001612fbe565b60008681526006602052604090205561236f8582604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b95945050505050565b60008385116123b4576123ad856123a7846123a181818961239b81818e8a61219d565b9061273f565b906121a9565b9061274b565b9050611ff5565b61236f6123cd836123a181818861239b81818e8e61219d565b869061219d565b600060ff82166123e657506000611d96565b6123ef84611e88565b6123fb57506000611d96565b600084815260116020526040812060ff85166004811061242b57634e487b7160e01b600052603260045260246000fd5b601081049190910154600f9091166002026101000a900461ffff1690508015612455579050611d96565b60006104b086601360ff88166004811061247f57634e487b7160e01b600052603260045260246000fd5b015461248b9190612fbe565b6124959190613206565b6124a0906001612fbe565b905060015b8460ff168160ff16101561259c576124bc82612757565b61ffff811660009081526012602052604081209193509060ff8816600481106124f557634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a90041690505b60ff81161580159061252657508160ff168160ff1611155b156125895761253483612757565b61ffff8116600090815260126020526040902090935060ff88166004811061256c57634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a900416905061250e565b5080612594816131c5565b9150506124a5565b5095945050505050565b61165181612770565b6125ba848484611ffd565b6125c6848484846127fa565b611ccc5760405162461bcd60e51b81526004016108e190612ec9565b6060601780546107f59061314d565b60608161261657506040805180820190915260018152600360fc1b60208201526107e1565b8160005b8115612640578061262a816131aa565b91506126399050600a8361301c565b915061261a565b60008167ffffffffffffffff81111561266957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612693576020820181803683370190505b5090505b8415611ff5576126a86001836130e7565b91506126b5600a86613206565b6126c0906030612fbe565b60f81b8183815181106126e357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612705600a8661301c565b9450612697565b6127168383612904565b61272360008484846127fa565b610a175760405162461bcd60e51b81526004016108e190612ec9565b6000611d96828461307c565b6000611d968284612fbe565b60006127656104b0836131e5565b6107de906001612fa1565b612778610fad565b156127e45760405162461bcd60e51b815260206004820152603660248201527f417274776f726b2068617320616c726561647920737461727465642c20736565604482015275642063616e6e6f74206265207365742074776963652160501b60648201526084016108e1565b43600b556127f46104b082613206565b60135550565b60006001600160a01b0384163b156128fc57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061283e903390899088908890600401612e34565b602060405180830381600087803b15801561285857600080fd5b505af1925050508015612888575060408051601f3d908101601f1916820190925261288591810190612d19565b60015b6128e2573d8080156128b6576040519150601f19603f3d011682016040523d82523d6000602084013e6128bb565b606091505b5080516128da5760405162461bcd60e51b81526004016108e190612ec9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ff5565b506001611ff5565b6001600160a01b03821661295a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108e1565b61296381611e88565b156129b05760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108e1565b6001600160a01b03821660009081526003602052604081208054600192906129d9908490612fbe565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b828054612a439061314d565b90600052602060002090601f016020900481019282612a655760008555612aab565b82601f10612a7e5782800160ff19823516178555612aab565b82800160010185558215612aab579182015b82811115612aab578235825591602001919060010190612a90565b50612ab7929150612ad9565b5090565b60405180608001604052806004906020820280368337509192915050565b5b80821115612ab75760008155600101612ada565b80356001600160a01b03811681146107e157600080fd5b600060208284031215612b16578081fd5b611d9682612aee565b60008060408385031215612b31578081fd5b612b3a83612aee565b9150612b4860208401612aee565b90509250929050565b600080600060608486031215612b65578081fd5b612b6e84612aee565b9250612b7c60208501612aee565b9150604084013590509250925092565b60008060008060808587031215612ba1578081fd5b612baa85612aee565b9350612bb860208601612aee565b925060408501359150606085013567ffffffffffffffff80821115612bdb578283fd5b818701915087601f830112612bee578283fd5b813581811115612c0057612c00613246565b604051601f8201601f19908116603f01168101908382118183101715612c2857612c28613246565b816040528281528a6020848701011115612c40578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060408385031215612c73578182fd5b612c7c83612aee565b91506020830135612c8c8161325c565b809150509250929050565b60008060408385031215612ca9578182fd5b612cb283612aee565b946020939093013593505050565b600060208284031215612cd1578081fd5b8151611d968161325c565b60008060408385031215612cee578182fd5b50508035926020909101359150565b600060208284031215612d0e578081fd5b8135611d968161326a565b600060208284031215612d2a578081fd5b8151611d968161326a565b600060208284031215612d46578081fd5b813560038110611d96578182fd5b60008060208385031215612d66578182fd5b823567ffffffffffffffff80821115612d7d578384fd5b818501915085601f830112612d90578384fd5b813581811115612d9e578485fd5b866020828501011115612daf578485fd5b60209290920196919550909350505050565b600060208284031215612dd2578081fd5b5035919050565b60008151808452612df1816020860160208601613121565b601f01601f19169290920160200192915050565b60008351612e17818460208801613121565b835190830190612e2b818360208801613121565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906114d790830184612dd9565b600060018060a01b03851682528360208301526060604083015261236f6060830184612dd9565b6020810160038310612eb057634e487b7160e01b600052602160045260246000fd5b91905290565b600060208252611d966020830184612dd9565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600061ffff808316818516808303821115612e2b57612e2b61321a565b60008219821115612fd157612fd161321a565b500190565b600060ff821660ff84168060ff03821115612ff357612ff361321a565b019392505050565b600061ffff8084168061301057613010613230565b92169190910492915050565b60008261302b5761302b613230565b500490565b600060ff83168061304357613043613230565b8060ff84160491505092915050565b600061ffff808316818516818304811182151516156130735761307361321a565b02949350505050565b60008160001904831182151516156130965761309661321a565b500290565b600060ff821660ff84168160ff04811182151516156130bc576130bc61321a565b029392505050565b600061ffff838116908316818110156130df576130df61321a565b039392505050565b6000828210156130f9576130f961321a565b500390565b600060ff821660ff8416808210156131185761311861321a565b90039392505050565b60005b8381101561313c578181015183820152602001613124565b83811115611ccc5750506000910152565b60028104600182168061316157607f821691505b6020821081141561318257634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156131a0576131a061321a565b6001019392505050565b60006000198214156131be576131be61321a565b5060010190565b600060ff821660ff8114156131dc576131dc61321a565b60010192915050565b600061ffff808416806131fa576131fa613230565b92169190910692915050565b60008261321557613215613230565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461123757600080fd5b6001600160e01b03198116811461123757600080fdfea2646970667358221220ecac23eaa282f08b3e08b729fa3384afb93311cc18d0c8ed9bf8fa34bcd9648c64736f6c63430008020033
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.