ETH Price: $3,167.03 (+2.79%)

Contract

0x1846fB181a12644dEc6af707b23B39d2D19C1879

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Transfer From1226318712024-07-13 9:21:5937 mins ago1720862519IN
0x1846fB18...2D19C1879
0 ETH0.0000000322550.00059835
Safe Mint1226315112024-07-13 9:09:5949 mins ago1720861799IN
0x1846fB18...2D19C1879
0 ETH0.0000001176890.0005377
Safe Mint1226314902024-07-13 9:09:1749 mins ago1720861757IN
0x1846fB18...2D19C1879
0 ETH0.0000001186460.0005372
Safe Mint1226314772024-07-13 9:08:5150 mins ago1720861731IN
0x1846fB18...2D19C1879
0 ETH0.0000001176380.00054167
Safe Mint1226314582024-07-13 9:08:1351 mins ago1720861693IN
0x1846fB18...2D19C1879
0 ETH0.0000001155240.00054518
Set Approval For...1223813452024-07-07 14:11:075 days ago1720361467IN
0x1846fB18...2D19C1879
0 ETH0.0000014923840.0611153
Set Approval For...1223238642024-07-06 6:15:057 days ago1720246505IN
0x1846fB18...2D19C1879
0 ETH0.0000028520860.0616264
Set Approval For...1221266262024-07-01 16:40:2911 days ago1719852029IN
0x1846fB18...2D19C1879
0 ETH0.0000028190150.06062024
Set Approval For...1221219712024-07-01 14:05:1911 days ago1719842719IN
0x1846fB18...2D19C1879
0 ETH0.0000001596360.00289569
Safe Transfer Fr...1218873892024-06-26 3:45:5517 days ago1719373555IN
0x1846fB18...2D19C1879
0 ETH0.0000051131570.06038814
Update1217745262024-06-23 13:03:4919 days ago1719147829IN
0x1846fB18...2D19C1879
0 ETH0.0000022024040.0611809
Update1217745112024-06-23 13:03:1919 days ago1719147799IN
0x1846fB18...2D19C1879
0 ETH0.0000020573880.0619621
Safe Mint1217728552024-06-23 12:08:0719 days ago1719144487IN
0x1846fB18...2D19C1879
0 ETH0.0000110234610.0613186
Set Approval For...1215915712024-06-19 7:25:1924 days ago1718781919IN
0x1846fB18...2D19C1879
0 ETH0.0000028332190.06108636
Update1211077932024-06-08 2:39:2335 days ago1717814363IN
0x1846fB18...2D19C1879
0 ETH0.0000020710390.06157643
Safe Mint1211077592024-06-08 2:38:1535 days ago1717814295IN
0x1846fB18...2D19C1879
0 ETH0.0000109439840.06070367
Set Approval For...1204441932024-05-23 17:59:2350 days ago1716487163IN
0x1846fB18...2D19C1879
0 ETH0.0000017178150.0692956
Set Approval For...1204438232024-05-23 17:47:0350 days ago1716486423IN
0x1846fB18...2D19C1879
0 ETH0.0000015262240.0614564
Update1203890912024-05-22 11:22:3951 days ago1716376959IN
0x1846fB18...2D19C1879
0 ETH0.0000022169060.06077146
Set Approval For...1199397112024-05-12 1:43:1962 days ago1715478199IN
0x1846fB18...2D19C1879
0 ETH0.0000034585010.07465715
Set Approval For...1198087682024-05-09 0:58:3365 days ago1715216313IN
0x1846fB18...2D19C1879
0 ETH0.0000014891340.0608649
Set Approval For...1197967222024-05-08 18:17:0165 days ago1715192221IN
0x1846fB18...2D19C1879
0 ETH0.0000028653650.0616889
Set Approval For...1194342622024-04-30 8:55:0174 days ago1714467301IN
0x1846fB18...2D19C1879
0 ETH0.0000033502530.0717706
Safe Mint1192084642024-04-25 3:28:2579 days ago1714015705IN
0x1846fB18...2D19C1879
0 ETH0.0000153521860.08528639
Update1191867782024-04-24 15:25:3379 days ago1713972333IN
0x1846fB18...2D19C1879
0 ETH0.0000023054310.06137953
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
1075576342023-07-30 10:47:25348 days ago1690714045
0x1846fB18...2D19C1879
0 ETH
1075576282023-07-30 10:47:13348 days ago1690714033
0x1846fB18...2D19C1879
0 ETH
1075573682023-07-30 10:38:33348 days ago1690713513
0x1846fB18...2D19C1879
0 ETH
1075570932023-07-30 10:29:23348 days ago1690712963
0x1846fB18...2D19C1879
0 ETH
1075568032023-07-30 10:19:43348 days ago1690712383
0x1846fB18...2D19C1879
0 ETH
1075566252023-07-30 10:13:47348 days ago1690712027
0x1846fB18...2D19C1879
0 ETH
1075564122023-07-30 10:06:41348 days ago1690711601
0x1846fB18...2D19C1879
0 ETH
1075564112023-07-30 10:06:39348 days ago1690711599
0x1846fB18...2D19C1879
0 ETH
1075564062023-07-30 10:06:29348 days ago1690711589
0x1846fB18...2D19C1879
0 ETH
1075563762023-07-30 10:05:29348 days ago1690711529
0x1846fB18...2D19C1879
0 ETH
1075563702023-07-30 10:05:17348 days ago1690711517
0x1846fB18...2D19C1879
0 ETH
1075563622023-07-30 10:05:01348 days ago1690711501
0x1846fB18...2D19C1879
0 ETH
1075562892023-07-30 10:02:35348 days ago1690711355
0x1846fB18...2D19C1879
0 ETH
1075562092023-07-30 9:59:55348 days ago1690711195
0x1846fB18...2D19C1879
0 ETH
1075559512023-07-30 9:51:19349 days ago1690710679
0x1846fB18...2D19C1879
0 ETH
1075557462023-07-30 9:44:29349 days ago1690710269
0x1846fB18...2D19C1879
0 ETH
1075557402023-07-30 9:44:17349 days ago1690710257
0x1846fB18...2D19C1879
0 ETH
1075557342023-07-30 9:44:05349 days ago1690710245
0x1846fB18...2D19C1879
0 ETH
1075557272023-07-30 9:43:51349 days ago1690710231
0x1846fB18...2D19C1879
0 ETH
1075557212023-07-30 9:43:39349 days ago1690710219
0x1846fB18...2D19C1879
0 ETH
1075557112023-07-30 9:43:19349 days ago1690710199
0x1846fB18...2D19C1879
0 ETH
1075557032023-07-30 9:43:03349 days ago1690710183
0x1846fB18...2D19C1879
0 ETH
1075556982023-07-30 9:42:53349 days ago1690710173
0x1846fB18...2D19C1879
0 ETH
1075556902023-07-30 9:42:37349 days ago1690710157
0x1846fB18...2D19C1879
0 ETH
1075556822023-07-30 9:42:21349 days ago1690710141
0x1846fB18...2D19C1879
0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Passport

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 18 : Passport.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;

import './Verifier.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Base64.sol';
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/utils/Strings.sol';

contract Passport is ERC721, ERC721Enumerable, Verifier {
  using Counters for Counters.Counter;
  Counters.Counter private _tokenIdCounter;

  mapping(uint256 => uint16) public scores;

  constructor() ERC721('Gitcoin Passport Score', 'GPS') {}

  function safeMint(address to, uint16 score, bytes memory signature) public {
    verifySignature(to, score, signature);

    uint256 tokenId = _tokenIdCounter.current();
    _tokenIdCounter.increment();
    _safeMint(to, tokenId);

    scores[tokenId] = score;
  }

  function update(uint256 tokenId, address to, uint16 score, bytes memory signature) public {
    verifySignature(to, score, signature);

    scores[tokenId] = score;
  }

  function tokenURI(uint256 id) public view override returns (string memory) {
    require(_exists(id), 'ERC721Metadata: URI query for nonexistent token');

    bytes memory dataURI = abi.encodePacked(
      '{',
      '"name": "Gitcoin Passport Score",',
      '"description": "Your on-chain Gitcoin Passport Score.",',
      '"image": "',
      generateSvg(id),
      '"',
      '}'
    );

    return string(abi.encodePacked('data:application/json;base64,', Base64.encode(dataURI)));
  }

  function generateSvg(uint256 tokenId) public view returns (string memory) {
    bytes memory svg = abi.encodePacked(
      '<svg width="512" height="512" style="padding:70px;background-color:#0e0333;" fill="none" xmlns="http://www.w3.org/2000/svg">'
      '<svg x="5" y="300">'
      '<path fill-rule="evenodd" fill="#02e2ac" d="m21 12.6c1 1.4 1.6 3.2 1.6 5 0 1.7-0.6 3.5-1.6 4.9l2.1 1.6c1.4-1.9 2.2-4.2 2.2-6.5 0-2.5-0.8-4.9-2.3-6.9l-1.3 1.1z" />'
      '<path fill-rule="evenodd" fill="#fff" d="m25.3 26.1v5.3c0 0.3-0.3 0.6-0.6 0.6h-10.6c-3.2-0.1-6.4-1.3-8.9-3.4-2.5-2.1-4.3-5-4.9-8.2-0.7-3.2-0.2-6.6 1.3-9.5 1.5-2.9 4-5.2 6.9-6.6l0.1-3.2q-0.1-0.2 0-0.4 0.1-0.2 0.2-0.4 0.1-0.1 0.3-0.2 0.2-0.1 0.4-0.1 0.2 0 0.4 0.1 0.2 0.1 0.3 0.2 0.2 0.2 0.2 0.4 0.1 0.2 0 0.4v2.5q1.3-0.3 2.6-0.5v-2q0-0.2 0.1-0.4 0-0.2 0.2-0.4 0.1-0.1 0.3-0.2 0.2-0.1 0.4-0.1 0.2 0 0.4 0.1 0.1 0.1 0.3 0.2 0.1 0.2 0.2 0.4 0 0.2 0 0.4v2c3.7 0.1 7.1 1.6 9.7 4.3l0.5 0.5c0.3 0.2 0.3 0.6 0 0.8l-3.6 3.4-3.5 3.2c0.5 0.7 0.7 1.5 0.7 2.4-0.1 0.8-0.4 1.7-0.9 2.3l7.3 5.6q0.2 0.2 0.2 0.5zm-2.9 3.3c0.2 0 0.3-0.1 0.3-0.3l0.1-1.9q-0.1-0.1-0.2-0.2l-7-5.4q-0.9 0.3-1.8 0.1-1-0.1-1.7-0.6-0.8-0.5-1.3-1.3-0.5-0.8-0.6-1.7-0.2-0.9 0.1-1.8 0.3-0.9 0.9-1.6 0.6-0.7 1.4-1.1 0.9-0.3 1.8-0.3 0.8 0 1.6 0.3l5.5-5.1c0.2-0.1 0.1-0.3 0-0.4-2-1.6-4.5-2.4-7.1-2.4-1.4 0-2.7 0.2-4 0.7l-0.1 4.8q0.1 0.2 0 0.4 0 0.1-0.2 0.3-0.1 0.1-0.3 0.2-0.2 0.1-0.4 0.1-0.2 0-0.4-0.1-0.2-0.1-0.3-0.2-0.1-0.2-0.2-0.4 0-0.2 0-0.4v-3.9c-2.3 1.3-4 3.4-5 5.8-1 2.4-1.2 5-0.6 7.6 0.7 2.5 2.2 4.7 4.2 6.3 2.1 1.6 4.6 2.5 7.2 2.5zm-6.8-13.1c-0.3-0.3-0.8-0.5-1.2-0.5q-0.5 0-0.9 0.3-0.4 0.3-0.6 0.8-0.2 0.4-0.2 0.9 0.1 0.5 0.5 0.9c0.2 0.2 0.6 0.4 0.9 0.4q0.4 0.2 0.9 0 0.5-0.2 0.8-0.7 0.3-0.4 0.3-0.9c0-0.5-0.2-0.9-0.5-1.2z" />'
      '</svg>'
      '<svg x="80" y="300">'
      '<path fill="#6f3ff5" d="m8.5 22.4c-1.2-2.1-1.2-4.6-0.2-6.6l-4.8-2.8q-0.2-0.1-0.4-0.2-0.1 0.6-0.1 1.1v11.1c0 3.9 3.2 7 7 7 3.7 0 6.8-2.9 7-6.6-3.2 1.2-6.8 0-8.5-3z" />'
      '<path fill="#fc0" d="m10 7c2.5 0 4.6 1.2 5.8 3.1l4.8-2.8q0.2-0.1 0.4-0.2-0.4-0.3-0.9-0.6l-9.6-5.6c-3.4-1.9-7.6-0.7-9.6 2.6-1.8 3.2-0.8 7.3 2.2 9.3 0.6-3.3 3.5-5.8 6.9-5.8z" />'
      '<path fill="#8c65f7" d="m8.3 15.8c0.6-1.2 1.5-2.2 2.7-2.9l4.8-2.8c-1.2-1.9-3.4-3.1-5.8-3.1-3.4 0-6.3 2.5-6.9 5.8q0.2 0.1 0.4 0.2l4.8 2.8z" />'
      '<path fill="#02e2ac" d="m30.2 9.9c-1.9-3.2-5.9-4.4-9.2-2.8 2.6 2.2 3.3 5.9 1.6 8.9-1.2 2.1-3.3 3.3-5.6 3.5v5.5q0 0.2 0 0.4 0.5-0.2 1-0.5l9.6-5.5c3.3-1.9 4.5-6.2 2.6-9.5z" />'
      '<path fill="#5bf1cd" d="m17 19.5c-1.3 0.1-2.7-0.2-3.9-0.9l-4.8-2.8c-1 2-1 4.5 0.2 6.6 1.7 3 5.3 4.2 8.5 3q0-0.2 0-0.4v-5.5z" />'
      '<path fill="#ffdb4c" d="m15.8 10.1c0.8 1.1 1.2 2.4 1.2 3.8v5.6c2.3-0.2 4.4-1.4 5.6-3.5 1.7-3 1-6.7-1.6-8.9q-0.2 0.1-0.4 0.2l-4.8 2.8z" />'
      '<path fill="#fff" d="m15.8 10.1l-4.8 2.8c-1.2 0.7-2.1 1.7-2.7 2.9l4.8 2.8c1.2 0.7 2.6 1 3.9 0.9v-5.6c0-1.4-0.4-2.7-1.2-3.8z" />'
      '<path fill-rule="evenodd" fill="#fff" d="m41.9 21.6h-2.9v-11.3h4.6q1 0 1.7 0.3 0.6 0.2 1.2 0.7 1.1 1 1.1 2.8 0 0.8-0.3 1.5-0.2 0.7-0.7 1.2-0.9 1-2.9 1h-1.8zm1-6q0.8 0 1.2-0.4 0.4-0.3 0.4-1 0-1.5-1.6-1.5h-1v2.9z" />'
      '<path fill-rule="evenodd" fill="#fff" d="m52.2 19.6l-0.8 2h-3.1l4.3-11.3h3.2l4.2 11.3h-3.1l-0.7-2zm2-5.8l-1.2 3.6h2.4z" />'
      '<path fill="#fff" d="m68.4 13.3q-0.9-0.8-1.9-0.8-0.5 0-0.9 0.3-0.3 0.3-0.3 0.7 0 0.3 0.2 0.5 0.1 0.1 0.2 0.2 0.1 0.1 0.3 0.2 0.2 0 0.5 0.1 0.3 0.1 0.8 0.2 1.5 0.5 2.1 1.2 0.6 0.7 0.6 2 0 1.9-1.1 2.9-0.6 0.5-1.5 0.8-0.8 0.3-1.8 0.3-1 0-2-0.3-0.9-0.4-1.9-1l1.3-2.3q0.7 0.5 1.3 0.8 0.6 0.3 1.3 0.3 0.6 0 1-0.3 0.4-0.3 0.4-0.8 0-0.5-0.4-0.7-0.3-0.3-1.4-0.6-0.9-0.3-1.3-0.5-0.5-0.2-0.8-0.4-0.9-0.7-0.9-2.2 0-0.9 0.3-1.6 0.3-0.7 0.8-1.2 0.5-0.5 1.2-0.7 0.7-0.3 1.5-0.3 0.9 0 1.8 0.2 0.9 0.2 1.8 0.7z" />'
      '<path fill="#fff" d="m78.8 13.3q-0.9-0.8-1.9-0.8-0.5 0-0.9 0.3-0.3 0.3-0.3 0.7 0 0.3 0.2 0.5 0.1 0.1 0.2 0.2 0.1 0.1 0.3 0.2 0.2 0 0.5 0.1 0.3 0.1 0.8 0.2 1.5 0.5 2.1 1.2 0.7 0.7 0.7 2-0.1 1.9-1.2 2.9-0.6 0.5-1.4 0.8-0.9 0.3-1.9 0.3-1 0-2-0.3-0.9-0.4-1.9-1l1.3-2.3q0.7 0.5 1.3 0.8 0.6 0.3 1.3 0.3 0.6 0 1-0.3 0.4-0.3 0.4-0.8 0-0.5-0.4-0.7-0.3-0.3-1.4-0.6-0.9-0.3-1.3-0.5-0.5-0.2-0.8-0.4-0.9-0.7-0.9-2.2 0-0.9 0.3-1.6 0.3-0.7 0.8-1.2 0.5-0.5 1.2-0.7 0.7-0.3 1.5-0.3 0.9 0 1.8 0.2 0.9 0.2 1.8 0.7z" />'
      '<path fill-rule="evenodd" fill="#fff" d="m86.1 21.6h-3v-11.3h4.7q1 0 1.6 0.3 0.7 0.2 1.2 0.7 1.1 1 1.1 2.8 0 0.8-0.2 1.5-0.3 0.7-0.7 1.2-0.9 1-2.9 1h-1.8zm0.9-6q0.9 0 1.3-0.4 0.3-0.3 0.3-1 0-1.5-1.6-1.5h-0.9v2.9z" />'
      '<path fill-rule="evenodd" fill="#fff" d="m99.9 10q2.8 0 4.6 1.9 0.8 0.8 1.2 1.9 0.4 1 0.4 2.2 0 1.3-0.5 2.5-0.6 1.2-1.6 2.1-1.7 1.4-4.2 1.4-1.3 0-2.4-0.5-1.2-0.4-2-1.2-0.8-0.8-1.3-2-0.4-1.1-0.4-2.4 0-1.3 0.5-2.4 0.6-1.2 1.6-2.1 0.8-0.7 1.8-1 1.1-0.4 2.3-0.4zm0 2.8q-0.7 0-1.2 0.3-0.6 0.2-1.1 0.7-0.4 0.4-0.6 1-0.3 0.5-0.3 1.2 0 0.6 0.3 1.2 0.2 0.6 0.6 1 0.5 0.5 1 0.7 0.6 0.3 1.3 0.3 0.6 0 1.2-0.3 0.6-0.2 1-0.7 0.5-0.4 0.7-1 0.3-0.5 0.3-1.2 0-0.7-0.3-1.2-0.2-0.6-0.7-1-0.4-0.5-1-0.7-0.6-0.3-1.2-0.3z" />'
      '<path fill-rule="evenodd" fill="#fff" d="m118.2 21.6h-3.7l-2.8-4.3v4.3h-2.9v-11.3h4.6q0.9 0 1.6 0.3 0.6 0.2 1.1 0.7 0.5 0.5 0.7 1.2 0.3 0.6 0.3 1.3 0 0.8-0.3 1.4-0.2 0.7-0.7 1.1-0.3 0.3-0.6 0.4-0.4 0.2-0.9 0.3zm-5.9-6.2q0.9 0 1.3-0.3 0.2-0.2 0.4-0.5 0.1-0.3 0.1-0.6 0-0.3-0.1-0.6-0.2-0.3-0.4-0.5-0.4-0.3-1.3-0.3h-0.5v2.8z" />'
      '<path fill="#fff" d="m124.5 21.6h-2.9v-8.8h-2.4v-2.5h7.7v2.5h-2.4z" />'
      '</svg>'
      '<text x="50" y="324" font-size="1.4em" fill="white">|</text>'
      '<text x="5" y="12" font-size="1em" fill="#A7A2B6">GITCOIN</text>'
      '<text x="0" y="80" font-size="4em" fill="white">Passport</text>'
      '<text x="5" y="130" font-size="2em" fill="white">Score</text>'
      '<text x="50%" y="220" font-size="6em" fill="white" text-anchor="middle">',
      Strings.toString(scores[tokenId]),
      '</text>'
      '</svg>'
    );

    return string(abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(svg)));
  }

  function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize) internal override(ERC721, ERC721Enumerable) {
    scores[tokenId] = 0;
    super._beforeTokenTransfer(from, to, tokenId, batchSize);
  }

  function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
    return super.supportsInterface(interfaceId);
  }
}

File 2 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 18 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        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) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId, 1);

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @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 from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-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. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}

File 4 of 18 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);

        if (batchSize > 1) {
            // Will only trigger during construction. Batch transferring (minting) is not available afterwards.
            revert("ERC721Enumerable: consecutive transfers not supported");
        }

        uint256 tokenId = firstTokenId;

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 5 of 18 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 6 of 18 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 7 of 18 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 8 of 18 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 9 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 10 of 18 : Base64.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides a set of functions to operate with Base64 strings.
 *
 * _Available since v4.5._
 */
library Base64 {
    /**
     * @dev Base64 Encoding/Decoding Table
     */
    string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /**
     * @dev Converts a `bytes` to its Bytes64 `string` representation.
     */
    function encode(bytes memory data) internal pure returns (string memory) {
        /**
         * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
         */
        if (data.length == 0) return "";

        // Loads the table into memory
        string memory table = _TABLE;

        // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
        // and split into 4 numbers of 6 bits.
        // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
        // - `data.length + 2`  -> Round up
        // - `/ 3`              -> Number of 3-bytes chunks
        // - `4 *`              -> 4 characters for each chunk
        string memory result = new string(4 * ((data.length + 2) / 3));

        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the lookup table (skip the first "length" byte)
            let tablePtr := add(table, 1)

            // Prepare result pointer, jump over length
            let resultPtr := add(result, 32)

            // Run over the input, 3 bytes at a time
            for {
                let dataPtr := data
                let endPtr := add(data, mload(data))
            } lt(dataPtr, endPtr) {

            } {
                // Advance 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // To write each character, shift the 3 bytes (18 bits) chunk
                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
                // and apply logical AND with 0x3F which is the number of
                // the previous character in the ASCII table prior to the Base64 Table
                // The result is then added to the table to get the character to write,
                // and finally write it in the result pointer but with a left shift
                // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits

                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance
            }

            // When data `bytes` is not exactly 3 bytes long
            // it is padded with `=` characters at the end
            switch mod(mload(data), 3)
            case 1 {
                mstore8(sub(resultPtr, 1), 0x3d)
                mstore8(sub(resultPtr, 2), 0x3d)
            }
            case 2 {
                mstore8(sub(resultPtr, 1), 0x3d)
            }
        }

        return result;
    }
}

File 11 of 18 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 12 of 18 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 13 of 18 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 14 of 18 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 15 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 16 of 18 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 17 of 18 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 18 of 18 : Verifier.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import '@openzeppelin/contracts/access/Ownable.sol';

contract Verifier is Ownable {
  using ECDSA for bytes32;

  function createMessage(address account, uint16 score) public view returns (bytes32) {
    return keccak256(abi.encode(account, score, owner()));
  }

  function verifySignature(address account, uint16 score, bytes memory signature) public view returns (bool) {
    bytes32 message = createMessage(account, score).toEthSignedMessageHash();

    require(message.recover(signature) == address(owner()), '!INVALID_SIGNATURE!');

    return true;
  }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"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":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":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint16","name":"score","type":"uint16"}],"name":"createMessage","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"generateSvg","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint16","name":"score","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"scores","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint16","name":"score","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint16","name":"score","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"verifySignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506040518060400160405280601681526020017f476974636f696e2050617373706f72742053636f7265000000000000000000008152506040518060400160405280600381526020016247505360e81b8152508160009081620000759190620001a2565b506001620000848282620001a2565b505050620000a16200009b620000a760201b60201c565b620000ab565b6200026e565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012857607f821691505b6020821081036200014957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019d57600081815260208120601f850160051c81016020861015620001785750805b601f850160051c820191505b81811015620001995782815560010162000184565b5050505b505050565b81516001600160401b03811115620001be57620001be620000fd565b620001d681620001cf845462000113565b846200014f565b602080601f8311600181146200020e5760008415620001f55750858301515b600019600386901b1c1916600185901b17855562000199565b600085815260208120601f198616915b828110156200023f578886015182559484019460019091019084016200021e565b50858210156200025e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613d87806200027e6000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c8063715018a6116100de578063bc921dc211610097578063e4dc92da11610071578063e4dc92da14610343578063e985e9c514610356578063ea3da94014610392578063f2fde38b146103a557600080fd5b8063bc921dc21461030a578063c1941d3d1461031d578063c87b56dd1461033057600080fd5b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102c957806396279150146102d1578063a22cb465146102e4578063b88d4fde146102f757600080fd5b80632ee691a3116101305780632ee691a31461021a5780632f745c591461025157806342842e0e146102645780634f6ccce7146102775780636352211e1461028a57806370a082311461029d57600080fd5b806301ffc9a71461017857806306fdde03146101a0578063081812fc146101b5578063095ea7b3146101e057806318160ddd146101f557806323b872dd14610207575b600080fd5b61018b610186366004611bc6565b6103b8565b60405190151581526020015b60405180910390f35b6101a86103c9565b6040516101979190611c3a565b6101c86101c3366004611c4d565b61045b565b6040516001600160a01b039091168152602001610197565b6101f36101ee366004611c82565b610482565b005b6008545b604051908152602001610197565b6101f3610215366004611cac565b61059c565b61023e610228366004611c4d565b600c6020526000908152604090205461ffff1681565b60405161ffff9091168152602001610197565b6101f961025f366004611c82565b6105cd565b6101f3610272366004611cac565b610663565b6101f9610285366004611c4d565b61067e565b6101c8610298366004611c4d565b610711565b6101f96102ab366004611ce8565b610771565b6101f36107f7565b600a546001600160a01b03166101c8565b6101a861080b565b6101f96102df366004611d15565b61081a565b6101f36102f2366004611d48565b610878565b6101f3610305366004611e27565b610887565b6101a8610318366004611c4d565b6108bf565b6101f361032b366004611e8f565b610930565b6101a861033e366004611c4d565b610963565b6101f3610351366004611edf565b610a27565b61018b610364366004611f3d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61018b6103a0366004611edf565b610a7f565b6101f36103b3366004611ce8565b610b60565b60006103c382610bd9565b92915050565b6060600080546103d890611f67565b80601f016020809104026020016040519081016040528092919081815260200182805461040490611f67565b80156104515780601f1061042657610100808354040283529160200191610451565b820191906000526020600020905b81548152906001019060200180831161043457829003601f168201915b5050505050905090565b600061046682610bfe565b506000908152600460205260409020546001600160a01b031690565b600061048d82610711565b9050806001600160a01b0316836001600160a01b0316036104ff5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061051b575061051b8133610364565b61058d5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016104f6565b6105978383610c5d565b505050565b6105a63382610ccb565b6105c25760405162461bcd60e51b81526004016104f690611fa1565b610597838383610d4a565b60006105d883610771565b821061063a5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016104f6565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61059783838360405180602001604052806000815250610887565b600061068960085490565b82106106ec5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016104f6565b600882815481106106ff576106ff611fee565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806103c35760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016104f6565b60006001600160a01b0382166107db5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016104f6565b506001600160a01b031660009081526003602052604090205490565b6107ff610ebb565b6108096000610f15565b565b6060600180546103d890611f67565b60008282610830600a546001600160a01b031690565b604080516001600160a01b03948516602082015261ffff9093169083015291909116606082015260800160405160208183030381529060405280519060200120905092915050565b610883338383610f67565b5050565b6108913383610ccb565b6108ad5760405162461bcd60e51b81526004016104f690611fa1565b6108b984848484611035565b50505050565b6000818152600c6020526040812054606091906108df9061ffff16611068565b6040516020016108ef9190612020565b6040516020818303038152906040529050610909816110fb565b6040516020016109199190613a27565b604051602081830303815290604052915050919050565b61093b838383610a7f565b50506000928352600c6020526040909220805461ffff191661ffff9093169290921790915550565b6000818152600260205260409020546060906001600160a01b03166109e25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016104f6565b60006109ed836108bf565b6040516020016109fd9190613a6c565b6040516020818303038152906040529050610a17816110fb565b6040516020016109199190613b3a565b610a32838383610a7f565b506000610a3e600b5490565b9050610a4e600b80546001019055565b610a58848261124e565b6000908152600c60205260409020805461ffff191661ffff93909316929092179091555050565b600080610ae2610a8f868661081a565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050610af6600a546001600160a01b031690565b6001600160a01b0316610b098285611268565b6001600160a01b031614610b555760405162461bcd60e51b815260206004820152601360248201527221494e56414c49445f5349474e41545552452160681b60448201526064016104f6565b506001949350505050565b610b68610ebb565b6001600160a01b038116610bcd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f6565b610bd681610f15565b50565b60006001600160e01b0319821663780e9d6360e01b14806103c357506103c38261128c565b6000818152600260205260409020546001600160a01b0316610bd65760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016104f6565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610c9282610711565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610cd783610711565b9050806001600160a01b0316846001600160a01b03161480610d1e57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610d425750836001600160a01b0316610d378461045b565b6001600160a01b0316145b949350505050565b826001600160a01b0316610d5d82610711565b6001600160a01b031614610d835760405162461bcd60e51b81526004016104f690613b7f565b6001600160a01b038216610de55760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016104f6565b610df283838360016112dc565b826001600160a01b0316610e0582610711565b6001600160a01b031614610e2b5760405162461bcd60e51b81526004016104f690613b7f565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a546001600160a01b031633146108095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f6565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603610fc85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016104f6565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611040848484610d4a565b61104c848484846112ff565b6108b95760405162461bcd60e51b81526004016104f690613bc4565b60606000611075836113f5565b600101905060008167ffffffffffffffff81111561109557611095611d84565b6040519080825280601f01601f1916602001820160405280156110bf576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846110c957509392505050565b6060815160000361111a57505060408051602081019091526000815290565b6000604051806060016040528060408152602001613d1260409139905060006003845160026111499190613c2c565b6111539190613c3f565b61115e906004613c61565b67ffffffffffffffff81111561117657611176611d84565b6040519080825280601f01601f1916602001820160405280156111a0576020820181803683370190505b509050600182016020820185865187015b8082101561120c576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f81168501518453506001830192506111b1565b5050600386510660018114611228576002811461123b57611243565b603d6001830353603d6002830353611243565b603d60018303535b509195945050505050565b6108838282604051806020016040528060008152506114cd565b60008060006112778585611500565b9150915061128481611545565b509392505050565b60006001600160e01b031982166380ac58cd60e01b14806112bd57506001600160e01b03198216635b5e139f60e01b145b806103c357506301ffc9a760e01b6001600160e01b03198316146103c3565b6000828152600c60205260409020805461ffff191690556108b98484848461168f565b60006001600160a01b0384163b15610b5557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611343903390899088908890600401613c78565b6020604051808303816000875af192505050801561137e575060408051601f3d908101601f1916820190925261137b91810190613cb5565b60015b6113db573d8080156113ac576040519150601f19603f3d011682016040523d82523d6000602084013e6113b1565b606091505b5080516000036113d35760405162461bcd60e51b81526004016104f690613bc4565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610d42565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106114345772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611460576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061147e57662386f26fc10000830492506010015b6305f5e1008310611496576305f5e100830492506008015b61271083106114aa57612710830492506004015b606483106114bc576064830492506002015b600a83106103c35760010192915050565b6114d783836117c3565b6114e460008484846112ff565b6105975760405162461bcd60e51b81526004016104f690613bc4565b60008082516041036115365760208301516040840151606085015160001a61152a8782858561195c565b9450945050505061153e565b506000905060025b9250929050565b600081600481111561155957611559613cd2565b036115615750565b600181600481111561157557611575613cd2565b036115c25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016104f6565b60028160048111156115d6576115d6613cd2565b036116235760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016104f6565b600381600481111561163757611637613cd2565b03610bd65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016104f6565b60018111156116fe5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b60648201526084016104f6565b816001600160a01b03851661175a5761175581600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61177d565b836001600160a01b0316856001600160a01b03161461177d5761177d8582611a20565b6001600160a01b0384166117995761179481611abd565b6117bc565b846001600160a01b0316846001600160a01b0316146117bc576117bc8482611b6c565b5050505050565b6001600160a01b0382166118195760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016104f6565b6000818152600260205260409020546001600160a01b03161561187e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016104f6565b61188c6000838360016112dc565b6000818152600260205260409020546001600160a01b0316156118f15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016104f6565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156119935750600090506003611a17565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156119e7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611a1057600060019250925050611a17565b9150600090505b94509492505050565b60006001611a2d84610771565b611a379190613ce8565b600083815260076020526040902054909150808214611a8a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611acf90600190613ce8565b60008381526009602052604081205460088054939450909284908110611af757611af7611fee565b906000526020600020015490508060088381548110611b1857611b18611fee565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611b5057611b50613cfb565b6001900381819060005260206000200160009055905550505050565b6000611b7783610771565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160e01b031981168114610bd657600080fd5b600060208284031215611bd857600080fd5b8135611be381611bb0565b9392505050565b60005b83811015611c05578181015183820152602001611bed565b50506000910152565b60008151808452611c26816020860160208601611bea565b601f01601f19169290920160200192915050565b602081526000611be36020830184611c0e565b600060208284031215611c5f57600080fd5b5035919050565b80356001600160a01b0381168114611c7d57600080fd5b919050565b60008060408385031215611c9557600080fd5b611c9e83611c66565b946020939093013593505050565b600080600060608486031215611cc157600080fd5b611cca84611c66565b9250611cd860208501611c66565b9150604084013590509250925092565b600060208284031215611cfa57600080fd5b611be382611c66565b803561ffff81168114611c7d57600080fd5b60008060408385031215611d2857600080fd5b611d3183611c66565b9150611d3f60208401611d03565b90509250929050565b60008060408385031215611d5b57600080fd5b611d6483611c66565b915060208301358015158114611d7957600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611dab57600080fd5b813567ffffffffffffffff80821115611dc657611dc6611d84565b604051601f8301601f19908116603f01168101908282118183101715611dee57611dee611d84565b81604052838152866020858801011115611e0757600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060808587031215611e3d57600080fd5b611e4685611c66565b9350611e5460208601611c66565b925060408501359150606085013567ffffffffffffffff811115611e7757600080fd5b611e8387828801611d9a565b91505092959194509250565b60008060008060808587031215611ea557600080fd5b84359350611eb560208601611c66565b9250611ec360408601611d03565b9150606085013567ffffffffffffffff811115611e7757600080fd5b600080600060608486031215611ef457600080fd5b611efd84611c66565b9250611f0b60208501611d03565b9150604084013567ffffffffffffffff811115611f2757600080fd5b611f3386828701611d9a565b9150509250925092565b60008060408385031215611f5057600080fd5b611f5983611c66565b9150611d3f60208401611c66565b600181811c90821680611f7b57607f821691505b602082108103611f9b57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60008151612016818560208601611bea565b9290920192915050565b7f3c7376672077696474683d2235313222206865696768743d223531322220737481527f796c653d2270616464696e673a373070783b6261636b67726f756e642d636f6c60208201527f6f723a233065303333333b222066696c6c3d226e6f6e652220786d6c6e733d2260408201527f687474703a2f2f7777772e77332e6f72672f323030302f737667223e3c73766760608201527f20783d22352220793d22333030223e3c706174682066696c6c2d72756c653d2260808201527f6576656e6f6464222066696c6c3d22233032653261632220643d226d3231203160a08201527f322e36633120312e3420312e3620332e3220312e362035203020312e372d302e60c08201527f3620332e352d312e3620342e396c322e3120312e3663312e342d312e3920322e60e08201527f322d342e3220322e322d362e3520302d322e352d302e382d342e392d322e332d6101008201527f362e396c2d312e3320312e317a22202f3e3c706174682066696c6c2d72756c656101208201527f3d226576656e6f6464222066696c6c3d22236666662220643d226d32352e33206101408201527f32362e3176352e33633020302e332d302e3320302e362d302e3620302e36682d6101608201527f31302e36632d332e322d302e312d362e342d312e332d382e392d332e342d322e6101808201527f352d322e312d342e332d352d342e392d382e322d302e372d332e322d302e322d6101a08201527f362e3620312e332d392e3520312e352d322e3920342d352e3220362e392d362e6101c08201527f366c302e312d332e32712d302e312d302e3220302d302e3420302e312d302e326101e08201527f20302e322d302e3420302e312d302e3120302e332d302e3220302e322d302e316102008201527f20302e342d302e3120302e32203020302e3420302e3120302e3220302e3120306102208201527f2e3320302e3220302e3220302e3220302e3220302e3420302e3120302e3220306102408201527f20302e3476322e3571312e332d302e3320322e362d302e35762d3271302d302e6102608201527f3220302e312d302e3420302d302e3220302e322d302e3420302e312d302e31206102808201527f302e332d302e3220302e322d302e3120302e342d302e3120302e32203020302e6102a08201527f3420302e3120302e3120302e3120302e3320302e3220302e3120302e3220302e6102c08201527f3220302e34203020302e32203020302e34763263332e3720302e3120372e31206102e08201527f312e3620392e3720342e336c302e3520302e3563302e3320302e3220302e33206103008201527f302e36203020302e386c2d332e3620332e342d332e3520332e3263302e3520306103208201527f2e3720302e3720312e3520302e3720322e342d302e3120302e382d302e3420316103408201527f2e372d302e3920322e336c372e3320352e3671302e3220302e3220302e3220306103608201527f2e357a6d2d322e3920332e3363302e32203020302e332d302e3120302e332d306103808201527f2e336c302e312d312e39712d302e312d302e312d302e322d302e326c2d372d356103a08201527f2e34712d302e3920302e332d312e3820302e312d312d302e312d312e372d302e6103c08201527f362d302e382d302e352d312e332d312e332d302e352d302e382d302e362d312e6103e08201527f372d302e322d302e3920302e312d312e3820302e332d302e3920302e392d312e6104008201527f3620302e362d302e3720312e342d312e3120302e392d302e3320312e382d302e6104208201527f3320302e38203020312e3620302e336c352e352d352e3163302e322d302e31206104408201527f302e312d302e3320302d302e342d322d312e362d342e352d322e342d372e312d6104608201527f322e342d312e3420302d322e3720302e322d3420302e376c2d302e3120342e386104808201527f71302e3120302e32203020302e34203020302e312d302e3220302e332d302e316104a08201527f20302e312d302e3320302e322d302e3220302e312d302e3420302e312d302e326104c08201527f20302d302e342d302e312d302e322d302e312d302e332d302e322d302e312d306104e08201527f2e322d302e322d302e3420302d302e3220302d302e34762d332e39632d322e336105008201527f20312e332d3420332e342d3520352e382d3120322e342d312e3220352d302e366105208201527f20372e3620302e3720322e3520322e3220342e3720342e3220362e3320322e316105408201527f20312e3620342e3620322e3520372e3220322e357a6d2d362e382d31332e31636105608201527f2d302e332d302e332d302e382d302e352d312e322d302e35712d302e3520302d6105808201527f302e3920302e332d302e3420302e332d302e3620302e382d302e3220302e342d6105a08201527f302e3220302e3920302e3120302e3520302e3520302e3963302e3220302e32206105c08201527f302e3620302e3420302e3920302e3471302e3420302e3220302e39203020302e6105e08201527f352d302e3220302e382d302e3720302e332d302e3420302e332d302e3963302d6106008201527f302e352d302e322d302e392d302e352d312e327a22202f3e3c2f7376673e3c736106208201527f766720783d2238302220793d22333030223e3c706174682066696c6c3d2223366106408201527f66336666352220643d226d382e352032322e34632d312e322d322e312d312e326106608201527f2d342e362d302e322d362e366c2d342e382d322e38712d302e322d302e312d306106808201527f2e342d302e322d302e3120302e362d302e3120312e317631312e31633020332e6106a08201527f3920332e3220372037203720332e37203020362e382d322e3920372d362e362d6106c08201527f332e3220312e322d362e3820302d382e352d337a22202f3e3c706174682066696106e08201527f6c6c3d22236663302220643d226d3130203763322e35203020342e3620312e326107008201527f20352e3820332e316c342e382d322e3871302e322d302e3120302e342d302e326107208201527f2d302e342d302e332d302e392d302e366c2d392e362d352e36632d332e342d316107408201527f2e392d372e362d302e372d392e3620322e362d312e3820332e322d302e3820376107608201527f2e3320322e3220392e3320302e362d332e3320332e352d352e3820362e392d356107808201527f2e387a22202f3e3c706174682066696c6c3d22233863363566372220643d226d6107a08201527f382e332031352e3863302e362d312e3220312e352d322e3220322e372d322e396107c08201527f6c342e382d322e38632d312e322d312e392d332e342d332e312d352e382d332e6107e08201527f312d332e3420302d362e3320322e352d362e3920352e3871302e3220302e31206108008201527f302e3420302e326c342e3820322e387a22202f3e3c706174682066696c6c3d226108208201527f233032653261632220643d226d33302e3220392e39632d312e392d332e322d356108408201527f2e392d342e342d392e322d322e3820322e3620322e3220332e3320352e3920316108608201527f2e3620382e392d312e3220322e312d332e3320332e332d352e3620332e3576356108808201527f2e35713020302e32203020302e3420302e352d302e3220312d302e356c392e366108a08201527f2d352e3563332e332d312e3920342e352d362e3220322e362d392e357a22202f6108c08201527f3e3c706174682066696c6c3d22233562663163642220643d226d31372031392e6108e08201527f35632d312e3320302e312d322e372d302e322d332e392d302e396c2d342e382d6109008201527f322e38632d3120322d3120342e3520302e3220362e3620312e37203320352e336109208201527f20342e3220382e35203371302d302e3220302d302e34762d352e357a22202f3e6109408201527f3c706174682066696c6c3d22236666646234632220643d226d31352e382031306109608201527f2e3163302e3820312e3120312e3220322e3420312e3220332e3876352e3663326109808201527f2e332d302e3220342e342d312e3420352e362d332e3520312e372d3320312d366109a08201527f2e372d312e362d382e39712d302e3220302e312d302e3420302e326c2d342e386109c08201527f20322e387a22202f3e3c706174682066696c6c3d22236666662220643d226d316109e08201527f352e382031302e316c2d342e3820322e38632d312e3220302e372d322e312031610a008201527f2e372d322e3720322e396c342e3820322e3863312e3220302e3720322e362031610a208201527f20332e3920302e39762d352e3663302d312e342d302e342d322e372d312e322d610a408201527f332e387a22202f3e3c706174682066696c6c2d72756c653d226576656e6f6464610a608201527f222066696c6c3d22236666662220643d226d34312e392032312e36682d322e39610a808201527f762d31312e3368342e367131203020312e3720302e3320302e3620302e322031610aa08201527f2e3220302e3720312e31203120312e3120322e38203020302e382d302e332031610ac08201527f2e352d302e3220302e372d302e3720312e322d302e3920312d322e392031682d610ae08201527f312e387a6d312d3671302e38203020312e322d302e3420302e342d302e332030610b008201527f2e342d3120302d312e352d312e362d312e35682d3176322e397a22202f3e3c70610b208201527f6174682066696c6c2d72756c653d226576656e6f6464222066696c6c3d222366610b408201527f66662220643d226d35322e322031392e366c2d302e382032682d332e316c342e610b608201527f332d31312e3368332e326c342e322031312e33682d332e316c2d302e372d327a610b808201527f6d322d352e386c2d312e3220332e3668322e347a22202f3e3c70617468206669610ba08201527f6c6c3d22236666662220643d226d36382e342031332e33712d302e392d302e38610bc08201527f2d312e392d302e382d302e3520302d302e3920302e332d302e3320302e332d30610be08201527f2e3320302e37203020302e3320302e3220302e3520302e3120302e3120302e32610c008201527f20302e3220302e3120302e3120302e3320302e3220302e32203020302e352030610c208201527f2e3120302e3320302e3120302e3820302e3220312e3520302e3520322e312031610c408201527f2e3220302e3620302e3720302e362032203020312e392d312e3120322e392d30610c608201527f2e3620302e352d312e3520302e382d302e3820302e332d312e3820302e332d31610c808201527f20302d322d302e332d302e392d302e342d312e392d316c312e332d322e337130610ca08201527f2e3720302e3520312e3320302e3820302e3620302e3320312e3320302e332030610cc08201527f2e36203020312d302e3320302e342d302e3320302e342d302e3820302d302e35610ce08201527f2d302e342d302e372d302e332d302e332d312e342d302e362d302e392d302e33610d008201527f2d312e332d302e352d302e352d302e322d302e382d302e342d302e392d302e37610d208201527f2d302e392d322e3220302d302e3920302e332d312e3620302e332d302e372030610d408201527f2e382d312e3220302e352d302e3520312e322d302e3720302e372d302e332031610d608201527f2e352d302e3320302e39203020312e3820302e3220302e3920302e3220312e38610d808201527f20302e377a22202f3e3c706174682066696c6c3d22236666662220643d226d37610da08201527f382e382031332e33712d302e392d302e382d312e392d302e382d302e3520302d610dc08201527f302e3920302e332d302e3320302e332d302e3320302e37203020302e3320302e610de08201527f3220302e3520302e3120302e3120302e3220302e3220302e3120302e3120302e610e008201527f3320302e3220302e32203020302e3520302e3120302e3320302e3120302e3820610e208201527f302e3220312e3520302e3520322e3120312e3220302e3720302e3720302e3720610e408201527f322d302e3120312e392d312e3220322e392d302e3620302e352d312e3420302e610e608201527f382d302e3920302e332d312e3920302e332d3120302d322d302e332d302e392d610e808201527f302e342d312e392d316c312e332d322e3371302e3720302e3520312e3320302e610ea08201527f3820302e3620302e3320312e3320302e3320302e36203020312d302e3320302e610ec08201527f342d302e3320302e342d302e3820302d302e352d302e342d302e372d302e332d610ee08201527f302e332d312e342d302e362d302e392d302e332d312e332d302e352d302e352d610f008201527f302e322d302e382d302e342d302e392d302e372d302e392d322e3220302d302e610f208201527f3920302e332d312e3620302e332d302e3720302e382d312e3220302e352d302e610f408201527f3520312e322d302e3720302e372d302e3320312e352d302e3320302e39203020610f608201527f312e3820302e3220302e3920302e3220312e3820302e377a22202f3e3c706174610f808201527f682066696c6c2d72756c653d226576656e6f6464222066696c6c3d2223666666610fa08201527f2220643d226d38362e312032312e36682d33762d31312e3368342e3771312030610fc08201527f20312e3620302e3320302e3720302e3220312e3220302e3720312e3120312031610fe08201527f2e3120322e38203020302e382d302e3220312e352d302e3320302e372d302e376110008201527f20312e322d302e3920312d322e392031682d312e387a6d302e392d3671302e396110208201527f203020312e332d302e3420302e332d302e3320302e332d3120302d312e352d316110408201527f2e362d312e35682d302e3976322e397a22202f3e3c706174682066696c6c2d726110608201527f756c653d226576656e6f6464222066696c6c3d22236666662220643d226d39396110808201527f2e3920313071322e38203020342e3620312e3920302e3820302e3820312e32206110a08201527f312e3920302e34203120302e3420322e32203020312e332d302e3520322e352d6110c08201527f302e3620312e322d312e3620322e312d312e3720312e342d342e3220312e342d6110e08201527f312e3320302d322e342d302e352d312e322d302e342d322d312e322d302e382d6111008201527f302e382d312e332d322d302e342d312e312d302e342d322e3420302d312e33206111208201527f302e352d322e3420302e362d312e3220312e362d322e3120302e382d302e37206111408201527f312e382d3120312e312d302e3420322e332d302e347a6d3020322e38712d302e6111608201527f3720302d312e3220302e332d302e3620302e322d312e3120302e372d302e34206111808201527f302e342d302e3620312d302e3320302e352d302e3320312e32203020302e36206111a08201527f302e3320312e3220302e3220302e3620302e36203120302e3520302e352031206111c08201527f302e3720302e3620302e3320312e3320302e3320302e36203020312e322d302e6111e08201527f3320302e362d302e3220312d302e3720302e352d302e3420302e372d3120302e6112008201527f332d302e3520302e332d312e3220302d302e372d302e332d312e322d302e322d6112208201527f302e362d302e372d312d302e342d302e352d312d302e372d302e362d302e332d6112408201527f312e322d302e337a22202f3e3c706174682066696c6c2d72756c653d226576656112608201527f6e6f6464222066696c6c3d22236666662220643d226d3131382e322032312e366112808201527f682d332e376c2d322e382d342e3376342e33682d322e39762d31312e3368342e6112a08201527f3671302e39203020312e3620302e3320302e3620302e3220312e3120302e37206112c08201527f302e3520302e3520302e3720312e3220302e3320302e3620302e3320312e33206112e08201527f3020302e382d302e3320312e342d302e3220302e372d302e3720312e312d302e6113008201527f3320302e332d302e3620302e342d302e3420302e322d302e3920302e337a6d2d6113208201527f352e392d362e3271302e39203020312e332d302e3320302e322d302e3220302e6113408201527f342d302e3520302e312d302e3320302e312d302e3620302d302e332d302e312d6113608201527f302e362d302e322d302e332d302e342d302e352d302e342d302e332d312e332d6113808201527f302e33682d302e3576322e387a22202f3e3c706174682066696c6c3d222366666113a08201527f662220643d226d3132342e352032312e36682d322e39762d382e38682d322e346113c08201527f762d322e3568372e3776322e35682d322e347a22202f3e3c2f7376673e3c74656113e08201527f787420783d2235302220793d223332342220666f6e742d73697a653d22312e346114008201527f656d222066696c6c3d227768697465223e7c3c2f746578743e3c7465787420786114208201527f3d22352220793d2231322220666f6e742d73697a653d2231656d222066696c6c6114408201527f3d2223413741324236223e474954434f494e3c2f746578743e3c7465787420786114608201527f3d22302220793d2238302220666f6e742d73697a653d2234656d222066696c6c6114808201527f3d227768697465223e50617373706f72743c2f746578743e3c7465787420783d6114a08201527f22352220793d223133302220666f6e742d73697a653d2232656d222066696c6c6114c08201527f3d227768697465223e53636f72653c2f746578743e3c7465787420783d2235306114e08201527f252220793d223232302220666f6e742d73697a653d2236656d222066696c6c3d6115008201527f2277686974652220746578742d616e63686f723d226d6964646c65223e0000006115208201526000611be3613a0e61153d840185612004565b6c1e17ba32bc3a1f1e17b9bb339f60991b8152600d0190565b7f646174613a696d6167652f7376672b786d6c3b6261736536342c000000000000815260008251613a5f81601a850160208701611bea565b91909101601a0192915050565b607b60f81b81527f226e616d65223a2022476974636f696e2050617373706f72742053636f7265226001820152600b60fa1b60218201527f226465736372697074696f6e223a2022596f7572206f6e2d636861696e20476960228201527f74636f696e2050617373706f72742053636f72652e222c0000000000000000006042820152691134b6b0b3b2911d101160b11b60598201528151600090613b18816063850160208701611bea565b601160f91b6063939091019283015250607d60f81b6064820152606501919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251613b7281601d850160208701611bea565b91909101601d0192915050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156103c3576103c3613c16565b600082613c5c57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103c3576103c3613c16565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613cab90830184611c0e565b9695505050505050565b600060208284031215613cc757600080fd5b8151611be381611bb0565b634e487b7160e01b600052602160045260246000fd5b818103818111156103c3576103c3613c16565b634e487b7160e01b600052603160045260246000fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122015ba07bead0cb2c725135cc1eefbdd4ba97cc2c8da2da9cacdf274185de8c39964736f6c63430008120033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063715018a6116100de578063bc921dc211610097578063e4dc92da11610071578063e4dc92da14610343578063e985e9c514610356578063ea3da94014610392578063f2fde38b146103a557600080fd5b8063bc921dc21461030a578063c1941d3d1461031d578063c87b56dd1461033057600080fd5b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102c957806396279150146102d1578063a22cb465146102e4578063b88d4fde146102f757600080fd5b80632ee691a3116101305780632ee691a31461021a5780632f745c591461025157806342842e0e146102645780634f6ccce7146102775780636352211e1461028a57806370a082311461029d57600080fd5b806301ffc9a71461017857806306fdde03146101a0578063081812fc146101b5578063095ea7b3146101e057806318160ddd146101f557806323b872dd14610207575b600080fd5b61018b610186366004611bc6565b6103b8565b60405190151581526020015b60405180910390f35b6101a86103c9565b6040516101979190611c3a565b6101c86101c3366004611c4d565b61045b565b6040516001600160a01b039091168152602001610197565b6101f36101ee366004611c82565b610482565b005b6008545b604051908152602001610197565b6101f3610215366004611cac565b61059c565b61023e610228366004611c4d565b600c6020526000908152604090205461ffff1681565b60405161ffff9091168152602001610197565b6101f961025f366004611c82565b6105cd565b6101f3610272366004611cac565b610663565b6101f9610285366004611c4d565b61067e565b6101c8610298366004611c4d565b610711565b6101f96102ab366004611ce8565b610771565b6101f36107f7565b600a546001600160a01b03166101c8565b6101a861080b565b6101f96102df366004611d15565b61081a565b6101f36102f2366004611d48565b610878565b6101f3610305366004611e27565b610887565b6101a8610318366004611c4d565b6108bf565b6101f361032b366004611e8f565b610930565b6101a861033e366004611c4d565b610963565b6101f3610351366004611edf565b610a27565b61018b610364366004611f3d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61018b6103a0366004611edf565b610a7f565b6101f36103b3366004611ce8565b610b60565b60006103c382610bd9565b92915050565b6060600080546103d890611f67565b80601f016020809104026020016040519081016040528092919081815260200182805461040490611f67565b80156104515780601f1061042657610100808354040283529160200191610451565b820191906000526020600020905b81548152906001019060200180831161043457829003601f168201915b5050505050905090565b600061046682610bfe565b506000908152600460205260409020546001600160a01b031690565b600061048d82610711565b9050806001600160a01b0316836001600160a01b0316036104ff5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061051b575061051b8133610364565b61058d5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016104f6565b6105978383610c5d565b505050565b6105a63382610ccb565b6105c25760405162461bcd60e51b81526004016104f690611fa1565b610597838383610d4a565b60006105d883610771565b821061063a5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016104f6565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61059783838360405180602001604052806000815250610887565b600061068960085490565b82106106ec5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016104f6565b600882815481106106ff576106ff611fee565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806103c35760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016104f6565b60006001600160a01b0382166107db5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016104f6565b506001600160a01b031660009081526003602052604090205490565b6107ff610ebb565b6108096000610f15565b565b6060600180546103d890611f67565b60008282610830600a546001600160a01b031690565b604080516001600160a01b03948516602082015261ffff9093169083015291909116606082015260800160405160208183030381529060405280519060200120905092915050565b610883338383610f67565b5050565b6108913383610ccb565b6108ad5760405162461bcd60e51b81526004016104f690611fa1565b6108b984848484611035565b50505050565b6000818152600c6020526040812054606091906108df9061ffff16611068565b6040516020016108ef9190612020565b6040516020818303038152906040529050610909816110fb565b6040516020016109199190613a27565b604051602081830303815290604052915050919050565b61093b838383610a7f565b50506000928352600c6020526040909220805461ffff191661ffff9093169290921790915550565b6000818152600260205260409020546060906001600160a01b03166109e25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016104f6565b60006109ed836108bf565b6040516020016109fd9190613a6c565b6040516020818303038152906040529050610a17816110fb565b6040516020016109199190613b3a565b610a32838383610a7f565b506000610a3e600b5490565b9050610a4e600b80546001019055565b610a58848261124e565b6000908152600c60205260409020805461ffff191661ffff93909316929092179091555050565b600080610ae2610a8f868661081a565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050610af6600a546001600160a01b031690565b6001600160a01b0316610b098285611268565b6001600160a01b031614610b555760405162461bcd60e51b815260206004820152601360248201527221494e56414c49445f5349474e41545552452160681b60448201526064016104f6565b506001949350505050565b610b68610ebb565b6001600160a01b038116610bcd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f6565b610bd681610f15565b50565b60006001600160e01b0319821663780e9d6360e01b14806103c357506103c38261128c565b6000818152600260205260409020546001600160a01b0316610bd65760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016104f6565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610c9282610711565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610cd783610711565b9050806001600160a01b0316846001600160a01b03161480610d1e57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610d425750836001600160a01b0316610d378461045b565b6001600160a01b0316145b949350505050565b826001600160a01b0316610d5d82610711565b6001600160a01b031614610d835760405162461bcd60e51b81526004016104f690613b7f565b6001600160a01b038216610de55760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016104f6565b610df283838360016112dc565b826001600160a01b0316610e0582610711565b6001600160a01b031614610e2b5760405162461bcd60e51b81526004016104f690613b7f565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a546001600160a01b031633146108095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f6565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603610fc85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016104f6565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611040848484610d4a565b61104c848484846112ff565b6108b95760405162461bcd60e51b81526004016104f690613bc4565b60606000611075836113f5565b600101905060008167ffffffffffffffff81111561109557611095611d84565b6040519080825280601f01601f1916602001820160405280156110bf576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846110c957509392505050565b6060815160000361111a57505060408051602081019091526000815290565b6000604051806060016040528060408152602001613d1260409139905060006003845160026111499190613c2c565b6111539190613c3f565b61115e906004613c61565b67ffffffffffffffff81111561117657611176611d84565b6040519080825280601f01601f1916602001820160405280156111a0576020820181803683370190505b509050600182016020820185865187015b8082101561120c576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f81168501518453506001830192506111b1565b5050600386510660018114611228576002811461123b57611243565b603d6001830353603d6002830353611243565b603d60018303535b509195945050505050565b6108838282604051806020016040528060008152506114cd565b60008060006112778585611500565b9150915061128481611545565b509392505050565b60006001600160e01b031982166380ac58cd60e01b14806112bd57506001600160e01b03198216635b5e139f60e01b145b806103c357506301ffc9a760e01b6001600160e01b03198316146103c3565b6000828152600c60205260409020805461ffff191690556108b98484848461168f565b60006001600160a01b0384163b15610b5557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611343903390899088908890600401613c78565b6020604051808303816000875af192505050801561137e575060408051601f3d908101601f1916820190925261137b91810190613cb5565b60015b6113db573d8080156113ac576040519150601f19603f3d011682016040523d82523d6000602084013e6113b1565b606091505b5080516000036113d35760405162461bcd60e51b81526004016104f690613bc4565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610d42565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106114345772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611460576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061147e57662386f26fc10000830492506010015b6305f5e1008310611496576305f5e100830492506008015b61271083106114aa57612710830492506004015b606483106114bc576064830492506002015b600a83106103c35760010192915050565b6114d783836117c3565b6114e460008484846112ff565b6105975760405162461bcd60e51b81526004016104f690613bc4565b60008082516041036115365760208301516040840151606085015160001a61152a8782858561195c565b9450945050505061153e565b506000905060025b9250929050565b600081600481111561155957611559613cd2565b036115615750565b600181600481111561157557611575613cd2565b036115c25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016104f6565b60028160048111156115d6576115d6613cd2565b036116235760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016104f6565b600381600481111561163757611637613cd2565b03610bd65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016104f6565b60018111156116fe5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b60648201526084016104f6565b816001600160a01b03851661175a5761175581600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61177d565b836001600160a01b0316856001600160a01b03161461177d5761177d8582611a20565b6001600160a01b0384166117995761179481611abd565b6117bc565b846001600160a01b0316846001600160a01b0316146117bc576117bc8482611b6c565b5050505050565b6001600160a01b0382166118195760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016104f6565b6000818152600260205260409020546001600160a01b03161561187e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016104f6565b61188c6000838360016112dc565b6000818152600260205260409020546001600160a01b0316156118f15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016104f6565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156119935750600090506003611a17565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156119e7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611a1057600060019250925050611a17565b9150600090505b94509492505050565b60006001611a2d84610771565b611a379190613ce8565b600083815260076020526040902054909150808214611a8a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611acf90600190613ce8565b60008381526009602052604081205460088054939450909284908110611af757611af7611fee565b906000526020600020015490508060088381548110611b1857611b18611fee565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611b5057611b50613cfb565b6001900381819060005260206000200160009055905550505050565b6000611b7783610771565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160e01b031981168114610bd657600080fd5b600060208284031215611bd857600080fd5b8135611be381611bb0565b9392505050565b60005b83811015611c05578181015183820152602001611bed565b50506000910152565b60008151808452611c26816020860160208601611bea565b601f01601f19169290920160200192915050565b602081526000611be36020830184611c0e565b600060208284031215611c5f57600080fd5b5035919050565b80356001600160a01b0381168114611c7d57600080fd5b919050565b60008060408385031215611c9557600080fd5b611c9e83611c66565b946020939093013593505050565b600080600060608486031215611cc157600080fd5b611cca84611c66565b9250611cd860208501611c66565b9150604084013590509250925092565b600060208284031215611cfa57600080fd5b611be382611c66565b803561ffff81168114611c7d57600080fd5b60008060408385031215611d2857600080fd5b611d3183611c66565b9150611d3f60208401611d03565b90509250929050565b60008060408385031215611d5b57600080fd5b611d6483611c66565b915060208301358015158114611d7957600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611dab57600080fd5b813567ffffffffffffffff80821115611dc657611dc6611d84565b604051601f8301601f19908116603f01168101908282118183101715611dee57611dee611d84565b81604052838152866020858801011115611e0757600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060808587031215611e3d57600080fd5b611e4685611c66565b9350611e5460208601611c66565b925060408501359150606085013567ffffffffffffffff811115611e7757600080fd5b611e8387828801611d9a565b91505092959194509250565b60008060008060808587031215611ea557600080fd5b84359350611eb560208601611c66565b9250611ec360408601611d03565b9150606085013567ffffffffffffffff811115611e7757600080fd5b600080600060608486031215611ef457600080fd5b611efd84611c66565b9250611f0b60208501611d03565b9150604084013567ffffffffffffffff811115611f2757600080fd5b611f3386828701611d9a565b9150509250925092565b60008060408385031215611f5057600080fd5b611f5983611c66565b9150611d3f60208401611c66565b600181811c90821680611f7b57607f821691505b602082108103611f9b57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60008151612016818560208601611bea565b9290920192915050565b7f3c7376672077696474683d2235313222206865696768743d223531322220737481527f796c653d2270616464696e673a373070783b6261636b67726f756e642d636f6c60208201527f6f723a233065303333333b222066696c6c3d226e6f6e652220786d6c6e733d2260408201527f687474703a2f2f7777772e77332e6f72672f323030302f737667223e3c73766760608201527f20783d22352220793d22333030223e3c706174682066696c6c2d72756c653d2260808201527f6576656e6f6464222066696c6c3d22233032653261632220643d226d3231203160a08201527f322e36633120312e3420312e3620332e3220312e362035203020312e372d302e60c08201527f3620332e352d312e3620342e396c322e3120312e3663312e342d312e3920322e60e08201527f322d342e3220322e322d362e3520302d322e352d302e382d342e392d322e332d6101008201527f362e396c2d312e3320312e317a22202f3e3c706174682066696c6c2d72756c656101208201527f3d226576656e6f6464222066696c6c3d22236666662220643d226d32352e33206101408201527f32362e3176352e33633020302e332d302e3320302e362d302e3620302e36682d6101608201527f31302e36632d332e322d302e312d362e342d312e332d382e392d332e342d322e6101808201527f352d322e312d342e332d352d342e392d382e322d302e372d332e322d302e322d6101a08201527f362e3620312e332d392e3520312e352d322e3920342d352e3220362e392d362e6101c08201527f366c302e312d332e32712d302e312d302e3220302d302e3420302e312d302e326101e08201527f20302e322d302e3420302e312d302e3120302e332d302e3220302e322d302e316102008201527f20302e342d302e3120302e32203020302e3420302e3120302e3220302e3120306102208201527f2e3320302e3220302e3220302e3220302e3220302e3420302e3120302e3220306102408201527f20302e3476322e3571312e332d302e3320322e362d302e35762d3271302d302e6102608201527f3220302e312d302e3420302d302e3220302e322d302e3420302e312d302e31206102808201527f302e332d302e3220302e322d302e3120302e342d302e3120302e32203020302e6102a08201527f3420302e3120302e3120302e3120302e3320302e3220302e3120302e3220302e6102c08201527f3220302e34203020302e32203020302e34763263332e3720302e3120372e31206102e08201527f312e3620392e3720342e336c302e3520302e3563302e3320302e3220302e33206103008201527f302e36203020302e386c2d332e3620332e342d332e3520332e3263302e3520306103208201527f2e3720302e3720312e3520302e3720322e342d302e3120302e382d302e3420316103408201527f2e372d302e3920322e336c372e3320352e3671302e3220302e3220302e3220306103608201527f2e357a6d2d322e3920332e3363302e32203020302e332d302e3120302e332d306103808201527f2e336c302e312d312e39712d302e312d302e312d302e322d302e326c2d372d356103a08201527f2e34712d302e3920302e332d312e3820302e312d312d302e312d312e372d302e6103c08201527f362d302e382d302e352d312e332d312e332d302e352d302e382d302e362d312e6103e08201527f372d302e322d302e3920302e312d312e3820302e332d302e3920302e392d312e6104008201527f3620302e362d302e3720312e342d312e3120302e392d302e3320312e382d302e6104208201527f3320302e38203020312e3620302e336c352e352d352e3163302e322d302e31206104408201527f302e312d302e3320302d302e342d322d312e362d342e352d322e342d372e312d6104608201527f322e342d312e3420302d322e3720302e322d3420302e376c2d302e3120342e386104808201527f71302e3120302e32203020302e34203020302e312d302e3220302e332d302e316104a08201527f20302e312d302e3320302e322d302e3220302e312d302e3420302e312d302e326104c08201527f20302d302e342d302e312d302e322d302e312d302e332d302e322d302e312d306104e08201527f2e322d302e322d302e3420302d302e3220302d302e34762d332e39632d322e336105008201527f20312e332d3420332e342d3520352e382d3120322e342d312e3220352d302e366105208201527f20372e3620302e3720322e3520322e3220342e3720342e3220362e3320322e316105408201527f20312e3620342e3620322e3520372e3220322e357a6d2d362e382d31332e31636105608201527f2d302e332d302e332d302e382d302e352d312e322d302e35712d302e3520302d6105808201527f302e3920302e332d302e3420302e332d302e3620302e382d302e3220302e342d6105a08201527f302e3220302e3920302e3120302e3520302e3520302e3963302e3220302e32206105c08201527f302e3620302e3420302e3920302e3471302e3420302e3220302e39203020302e6105e08201527f352d302e3220302e382d302e3720302e332d302e3420302e332d302e3963302d6106008201527f302e352d302e322d302e392d302e352d312e327a22202f3e3c2f7376673e3c736106208201527f766720783d2238302220793d22333030223e3c706174682066696c6c3d2223366106408201527f66336666352220643d226d382e352032322e34632d312e322d322e312d312e326106608201527f2d342e362d302e322d362e366c2d342e382d322e38712d302e322d302e312d306106808201527f2e342d302e322d302e3120302e362d302e3120312e317631312e31633020332e6106a08201527f3920332e3220372037203720332e37203020362e382d322e3920372d362e362d6106c08201527f332e3220312e322d362e3820302d382e352d337a22202f3e3c706174682066696106e08201527f6c6c3d22236663302220643d226d3130203763322e35203020342e3620312e326107008201527f20352e3820332e316c342e382d322e3871302e322d302e3120302e342d302e326107208201527f2d302e342d302e332d302e392d302e366c2d392e362d352e36632d332e342d316107408201527f2e392d372e362d302e372d392e3620322e362d312e3820332e322d302e3820376107608201527f2e3320322e3220392e3320302e362d332e3320332e352d352e3820362e392d356107808201527f2e387a22202f3e3c706174682066696c6c3d22233863363566372220643d226d6107a08201527f382e332031352e3863302e362d312e3220312e352d322e3220322e372d322e396107c08201527f6c342e382d322e38632d312e322d312e392d332e342d332e312d352e382d332e6107e08201527f312d332e3420302d362e3320322e352d362e3920352e3871302e3220302e31206108008201527f302e3420302e326c342e3820322e387a22202f3e3c706174682066696c6c3d226108208201527f233032653261632220643d226d33302e3220392e39632d312e392d332e322d356108408201527f2e392d342e342d392e322d322e3820322e3620322e3220332e3320352e3920316108608201527f2e3620382e392d312e3220322e312d332e3320332e332d352e3620332e3576356108808201527f2e35713020302e32203020302e3420302e352d302e3220312d302e356c392e366108a08201527f2d352e3563332e332d312e3920342e352d362e3220322e362d392e357a22202f6108c08201527f3e3c706174682066696c6c3d22233562663163642220643d226d31372031392e6108e08201527f35632d312e3320302e312d322e372d302e322d332e392d302e396c2d342e382d6109008201527f322e38632d3120322d3120342e3520302e3220362e3620312e37203320352e336109208201527f20342e3220382e35203371302d302e3220302d302e34762d352e357a22202f3e6109408201527f3c706174682066696c6c3d22236666646234632220643d226d31352e382031306109608201527f2e3163302e3820312e3120312e3220322e3420312e3220332e3876352e3663326109808201527f2e332d302e3220342e342d312e3420352e362d332e3520312e372d3320312d366109a08201527f2e372d312e362d382e39712d302e3220302e312d302e3420302e326c2d342e386109c08201527f20322e387a22202f3e3c706174682066696c6c3d22236666662220643d226d316109e08201527f352e382031302e316c2d342e3820322e38632d312e3220302e372d322e312031610a008201527f2e372d322e3720322e396c342e3820322e3863312e3220302e3720322e362031610a208201527f20332e3920302e39762d352e3663302d312e342d302e342d322e372d312e322d610a408201527f332e387a22202f3e3c706174682066696c6c2d72756c653d226576656e6f6464610a608201527f222066696c6c3d22236666662220643d226d34312e392032312e36682d322e39610a808201527f762d31312e3368342e367131203020312e3720302e3320302e3620302e322031610aa08201527f2e3220302e3720312e31203120312e3120322e38203020302e382d302e332031610ac08201527f2e352d302e3220302e372d302e3720312e322d302e3920312d322e392031682d610ae08201527f312e387a6d312d3671302e38203020312e322d302e3420302e342d302e332030610b008201527f2e342d3120302d312e352d312e362d312e35682d3176322e397a22202f3e3c70610b208201527f6174682066696c6c2d72756c653d226576656e6f6464222066696c6c3d222366610b408201527f66662220643d226d35322e322031392e366c2d302e382032682d332e316c342e610b608201527f332d31312e3368332e326c342e322031312e33682d332e316c2d302e372d327a610b808201527f6d322d352e386c2d312e3220332e3668322e347a22202f3e3c70617468206669610ba08201527f6c6c3d22236666662220643d226d36382e342031332e33712d302e392d302e38610bc08201527f2d312e392d302e382d302e3520302d302e3920302e332d302e3320302e332d30610be08201527f2e3320302e37203020302e3320302e3220302e3520302e3120302e3120302e32610c008201527f20302e3220302e3120302e3120302e3320302e3220302e32203020302e352030610c208201527f2e3120302e3320302e3120302e3820302e3220312e3520302e3520322e312031610c408201527f2e3220302e3620302e3720302e362032203020312e392d312e3120322e392d30610c608201527f2e3620302e352d312e3520302e382d302e3820302e332d312e3820302e332d31610c808201527f20302d322d302e332d302e392d302e342d312e392d316c312e332d322e337130610ca08201527f2e3720302e3520312e3320302e3820302e3620302e3320312e3320302e332030610cc08201527f2e36203020312d302e3320302e342d302e3320302e342d302e3820302d302e35610ce08201527f2d302e342d302e372d302e332d302e332d312e342d302e362d302e392d302e33610d008201527f2d312e332d302e352d302e352d302e322d302e382d302e342d302e392d302e37610d208201527f2d302e392d322e3220302d302e3920302e332d312e3620302e332d302e372030610d408201527f2e382d312e3220302e352d302e3520312e322d302e3720302e372d302e332031610d608201527f2e352d302e3320302e39203020312e3820302e3220302e3920302e3220312e38610d808201527f20302e377a22202f3e3c706174682066696c6c3d22236666662220643d226d37610da08201527f382e382031332e33712d302e392d302e382d312e392d302e382d302e3520302d610dc08201527f302e3920302e332d302e3320302e332d302e3320302e37203020302e3320302e610de08201527f3220302e3520302e3120302e3120302e3220302e3220302e3120302e3120302e610e008201527f3320302e3220302e32203020302e3520302e3120302e3320302e3120302e3820610e208201527f302e3220312e3520302e3520322e3120312e3220302e3720302e3720302e3720610e408201527f322d302e3120312e392d312e3220322e392d302e3620302e352d312e3420302e610e608201527f382d302e3920302e332d312e3920302e332d3120302d322d302e332d302e392d610e808201527f302e342d312e392d316c312e332d322e3371302e3720302e3520312e3320302e610ea08201527f3820302e3620302e3320312e3320302e3320302e36203020312d302e3320302e610ec08201527f342d302e3320302e342d302e3820302d302e352d302e342d302e372d302e332d610ee08201527f302e332d312e342d302e362d302e392d302e332d312e332d302e352d302e352d610f008201527f302e322d302e382d302e342d302e392d302e372d302e392d322e3220302d302e610f208201527f3920302e332d312e3620302e332d302e3720302e382d312e3220302e352d302e610f408201527f3520312e322d302e3720302e372d302e3320312e352d302e3320302e39203020610f608201527f312e3820302e3220302e3920302e3220312e3820302e377a22202f3e3c706174610f808201527f682066696c6c2d72756c653d226576656e6f6464222066696c6c3d2223666666610fa08201527f2220643d226d38362e312032312e36682d33762d31312e3368342e3771312030610fc08201527f20312e3620302e3320302e3720302e3220312e3220302e3720312e3120312031610fe08201527f2e3120322e38203020302e382d302e3220312e352d302e3320302e372d302e376110008201527f20312e322d302e3920312d322e392031682d312e387a6d302e392d3671302e396110208201527f203020312e332d302e3420302e332d302e3320302e332d3120302d312e352d316110408201527f2e362d312e35682d302e3976322e397a22202f3e3c706174682066696c6c2d726110608201527f756c653d226576656e6f6464222066696c6c3d22236666662220643d226d39396110808201527f2e3920313071322e38203020342e3620312e3920302e3820302e3820312e32206110a08201527f312e3920302e34203120302e3420322e32203020312e332d302e3520322e352d6110c08201527f302e3620312e322d312e3620322e312d312e3720312e342d342e3220312e342d6110e08201527f312e3320302d322e342d302e352d312e322d302e342d322d312e322d302e382d6111008201527f302e382d312e332d322d302e342d312e312d302e342d322e3420302d312e33206111208201527f302e352d322e3420302e362d312e3220312e362d322e3120302e382d302e37206111408201527f312e382d3120312e312d302e3420322e332d302e347a6d3020322e38712d302e6111608201527f3720302d312e3220302e332d302e3620302e322d312e3120302e372d302e34206111808201527f302e342d302e3620312d302e3320302e352d302e3320312e32203020302e36206111a08201527f302e3320312e3220302e3220302e3620302e36203120302e3520302e352031206111c08201527f302e3720302e3620302e3320312e3320302e3320302e36203020312e322d302e6111e08201527f3320302e362d302e3220312d302e3720302e352d302e3420302e372d3120302e6112008201527f332d302e3520302e332d312e3220302d302e372d302e332d312e322d302e322d6112208201527f302e362d302e372d312d302e342d302e352d312d302e372d302e362d302e332d6112408201527f312e322d302e337a22202f3e3c706174682066696c6c2d72756c653d226576656112608201527f6e6f6464222066696c6c3d22236666662220643d226d3131382e322032312e366112808201527f682d332e376c2d322e382d342e3376342e33682d322e39762d31312e3368342e6112a08201527f3671302e39203020312e3620302e3320302e3620302e3220312e3120302e37206112c08201527f302e3520302e3520302e3720312e3220302e3320302e3620302e3320312e33206112e08201527f3020302e382d302e3320312e342d302e3220302e372d302e3720312e312d302e6113008201527f3320302e332d302e3620302e342d302e3420302e322d302e3920302e337a6d2d6113208201527f352e392d362e3271302e39203020312e332d302e3320302e322d302e3220302e6113408201527f342d302e3520302e312d302e3320302e312d302e3620302d302e332d302e312d6113608201527f302e362d302e322d302e332d302e342d302e352d302e342d302e332d312e332d6113808201527f302e33682d302e3576322e387a22202f3e3c706174682066696c6c3d222366666113a08201527f662220643d226d3132342e352032312e36682d322e39762d382e38682d322e346113c08201527f762d322e3568372e3776322e35682d322e347a22202f3e3c2f7376673e3c74656113e08201527f787420783d2235302220793d223332342220666f6e742d73697a653d22312e346114008201527f656d222066696c6c3d227768697465223e7c3c2f746578743e3c7465787420786114208201527f3d22352220793d2231322220666f6e742d73697a653d2231656d222066696c6c6114408201527f3d2223413741324236223e474954434f494e3c2f746578743e3c7465787420786114608201527f3d22302220793d2238302220666f6e742d73697a653d2234656d222066696c6c6114808201527f3d227768697465223e50617373706f72743c2f746578743e3c7465787420783d6114a08201527f22352220793d223133302220666f6e742d73697a653d2232656d222066696c6c6114c08201527f3d227768697465223e53636f72653c2f746578743e3c7465787420783d2235306114e08201527f252220793d223232302220666f6e742d73697a653d2236656d222066696c6c3d6115008201527f2277686974652220746578742d616e63686f723d226d6964646c65223e0000006115208201526000611be3613a0e61153d840185612004565b6c1e17ba32bc3a1f1e17b9bb339f60991b8152600d0190565b7f646174613a696d6167652f7376672b786d6c3b6261736536342c000000000000815260008251613a5f81601a850160208701611bea565b91909101601a0192915050565b607b60f81b81527f226e616d65223a2022476974636f696e2050617373706f72742053636f7265226001820152600b60fa1b60218201527f226465736372697074696f6e223a2022596f7572206f6e2d636861696e20476960228201527f74636f696e2050617373706f72742053636f72652e222c0000000000000000006042820152691134b6b0b3b2911d101160b11b60598201528151600090613b18816063850160208701611bea565b601160f91b6063939091019283015250607d60f81b6064820152606501919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251613b7281601d850160208701611bea565b91909101601d0192915050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156103c3576103c3613c16565b600082613c5c57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103c3576103c3613c16565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613cab90830184611c0e565b9695505050505050565b600060208284031215613cc757600080fd5b8151611be381611bb0565b634e487b7160e01b600052602160045260246000fd5b818103818111156103c3576103c3613c16565b634e487b7160e01b600052603160045260246000fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122015ba07bead0cb2c725135cc1eefbdd4ba97cc2c8da2da9cacdf274185de8c39964736f6c63430008120033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.