Contract 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da048 2

 

Contract Overview

Balance:
0 MATIC

MATIC Value:
$0.00

Token:
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x2393fa643c3e0be17f3de5948b6087239d331fdec96b7956b7ff6f4c0778dca8Set Approval For...381298582023-01-16 0:19:54142 days 16 hrs ago0x41f8cbe579a822cfda5362bf20bca86622480044 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.002099585671 45.198064097
0x7388a923961883030f122c80056d88e1047d6d15b8b2fc9fab81b018fe654d1dSet Approval For...362251742022-11-29 19:44:43189 days 20 hrs ago0xe51cd0968035f4ea6bfa1c6e5ed99037bff7caac IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.001772168839 38.149717763
0x510eed12b744e31beaccdcd1dacc3aa0094c314245f4aece13745471f251b6ccSafe Transfer Fr...339213902022-10-04 13:15:23246 days 3 hrs ago0xb3c6e053bfa6d9daef7434abd191b3e9422cfd32 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.002605350001 30.000000018
0x54519ebaedf0d37f8bbd4b727864d47244502130fbb9617747d7338da4a6d9dbSeparate One285670802022-05-20 23:53:33382 days 16 hrs ago0x46d73bd70abde53da9d0e0a24ec3c9c585f15d3f IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.00014077113 1.00000093
0xff32b4f15b3b23a935cb0e25af13d9a940c2a86feb853262f295884937b108e6Separate One285670782022-05-20 23:53:25382 days 16 hrs ago0x46d73bd70abde53da9d0e0a24ec3c9c585f15d3f IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.000153083112 1.000000736
0x16b0262c326a3170839e8b2ea47be5a5e7e3e5f593ea6a0abbbd027e7f9f5ec1Claim269271682022-04-09 11:17:28424 days 5 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072342930
0xbd1a099b9d27e69789fcfb1359c07ce79535746a0c38f6171502679ada7e428fClaim269271682022-04-09 11:17:28424 days 5 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072342930
0xa0473b4142a6c5cf4fc7309171c5736abc444f27b5848787b9b96b8a22c628ddClaim269271682022-04-09 11:17:28424 days 5 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072342930
0x032d53c470256dff986d7a6b5c21271f4e1ce269257611b403c08e4d8d6d0735Claim269271682022-04-09 11:17:28424 days 5 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072342930
0xb36c9e7c0e4e255974a14666b617866134f6242d7d793316a67a599f81744ba6Claim269271682022-04-09 11:17:28424 days 5 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072360930
0x48e40a7902ba59409b951e29e7c1906c65c2af9c8900f08606faa948797d1066Claim269271682022-04-09 11:17:28424 days 5 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072342930
0x81afe4ad15dcaf26e77db766b2bacc15212ef2ffee902bafabdad7f50213780eClaim269271682022-04-09 11:17:28424 days 5 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072342930
0x911b6ec2a65c56ce715fa4db53e39918a5eb43814f2283a5a0e8b3a510f62c9cClaim256756242022-03-07 6:22:47457 days 10 hrs ago0xa4548eeb43f4e2b2c0bfed958f38c80db8d02ef0 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.008341585 35
0xb162065244a5874a73ee9dc81badabc664ea2ecd8f1e9216076670497198ab14Claim255652302022-03-04 8:59:38460 days 7 hrs ago0xb3c6e053bfa6d9daef7434abd191b3e9422cfd32 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.006963014075 29.20837647
0x6c4b250f7bc68434a2fd00279eae8d1a34f8adc192cea46a0a1814e5a5b2ac62Combine255630472022-03-04 7:41:13460 days 8 hrs ago0xf78c3e7b62c1fb5c82bb83e88b636819d0f202c5 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.00725654231
0x8ca8a15012a6a0e95f80b225321185380735aa399b1a9751685a2acc9d1834f4Safe Transfer Fr...255592782022-03-04 5:26:44460 days 11 hrs ago0xcf2db35e55eaf48e83987a89868846bf7d71ef62 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.00271532131
0xfc9c4fed7586b792fbd89f84f35b69eff6c71ae0d62a0629a2cab4f60916b604Combine255591232022-03-04 5:21:26460 days 11 hrs ago0xcf2db35e55eaf48e83987a89868846bf7d71ef62 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.007111046599 30.379999999
0xdc42f060ea71c60054cf4fc1005345566aea977b7a49bbf279e1f5626799ff38Combine255557522022-03-04 3:19:56460 days 13 hrs ago0x52be3580601524652978648e872d0aa448afc928 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.007514200109 32.100717311
0xcff1bc661e1a384230df0ed16e1ab4fa5956feebbe57bda57ab19084e53206baCombine255544452022-03-04 2:30:10460 days 13 hrs ago0x8f570e5003b70a88d44c8e7dc94021f93a524ff9 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.00773277232 33.320000001
0x3873d3566083b9d2c326f63d0884bd356c7749ed82ff4567711c183a2e30d98dSeparate One255362482022-03-03 15:15:49461 days 1 hr ago0x439ae60bcdaa65905a96dad9bcd47ea5b0936b05 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.005235613922 34.201145278
0x3ccc9e4fc885877632c26237924b34d89acc3ce3ee1bf0afc19d6b8fb9b990daSafe Transfer Fr...255353682022-03-03 14:41:12461 days 1 hr ago0x08a8cc4261663e09500f501701874db8c748fbcc IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.00295072643 30.380084125
0xdcf8ebe493b61a1ea714ca49c20c4fe1687cc4f6ad4ecbfed1e9db3058dd52c4Safe Transfer Fr...255353572022-03-03 14:40:28461 days 1 hr ago0x08a8cc4261663e09500f501701874db8c748fbcc IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480 MATIC0.003143500871 31.457973035
0x9b9b2767a1fd9e807d20d1298bfe60776a67c3a75535b1b9923df23dd9265a7dClaim252340062022-02-22 16:21:05470 days 6 mins ago0x6726d84fb3415384257848f6a64d84467ac63691 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.007247971207 30.409834599
0xe58a5df1c1ae88933be7eb895fdb54eb0d146dad421267bbc3f5381c3a8066ceClaim247436172022-02-09 17:28:45482 days 22 hrs ago0xd5154470c0cd160ebf070b083d1befbdd12ac7c3 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.0072342930
0xb17ede38c8721e24b302c46d5713a7ae3f1084ffe09cc1f6ad305d94edf5eb11Claim246375782022-02-07 1:23:00485 days 15 hrs ago0x2c9e81d79cf5690bf05752815a97f63fae9819e6 IN  0x28fe1ab4e3811fbf59a2f02df0aed4518f2da04810 MATIC0.000238331005 1.000000024
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x16b0262c326a3170839e8b2ea47be5a5e7e3e5f593ea6a0abbbd027e7f9f5ec1269271682022-04-09 11:17:28424 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xbd1a099b9d27e69789fcfb1359c07ce79535746a0c38f6171502679ada7e428f269271682022-04-09 11:17:28424 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xa0473b4142a6c5cf4fc7309171c5736abc444f27b5848787b9b96b8a22c628dd269271682022-04-09 11:17:28424 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x032d53c470256dff986d7a6b5c21271f4e1ce269257611b403c08e4d8d6d0735269271682022-04-09 11:17:28424 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xb36c9e7c0e4e255974a14666b617866134f6242d7d793316a67a599f81744ba6269271682022-04-09 11:17:28424 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x48e40a7902ba59409b951e29e7c1906c65c2af9c8900f08606faa948797d1066269271682022-04-09 11:17:28424 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x81afe4ad15dcaf26e77db766b2bacc15212ef2ffee902bafabdad7f50213780e269271682022-04-09 11:17:28424 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x911b6ec2a65c56ce715fa4db53e39918a5eb43814f2283a5a0e8b3a510f62c9c256756242022-03-07 6:22:47457 days 10 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xb162065244a5874a73ee9dc81badabc664ea2ecd8f1e9216076670497198ab14255652302022-03-04 8:59:38460 days 7 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x9b9b2767a1fd9e807d20d1298bfe60776a67c3a75535b1b9923df23dd9265a7d252340062022-02-22 16:21:05470 days 6 mins ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xe58a5df1c1ae88933be7eb895fdb54eb0d146dad421267bbc3f5381c3a8066ce247436172022-02-09 17:28:45482 days 22 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xb17ede38c8721e24b302c46d5713a7ae3f1084ffe09cc1f6ad305d94edf5eb11246375782022-02-07 1:23:00485 days 15 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xf34597f88f5105626d7d791c0858dc86723479b08c3f1e42c3fb14971be2afc3229893652021-12-26 15:24:02528 days 1 hr ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xd39613a5bdd0864bf30d80e582fd2aca492983939e1b9533719f17c9b6895a31228038672021-12-21 21:36:49532 days 18 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xf275839bc7dda86b3fd10ec9a617a011b559e71be7ca9143684821075eb2b1dd228025582021-12-21 20:51:38532 days 19 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x29dce2979d383a2b635ddedb0a30130a40a9b387573bfeb8b728a0629b652d08226283362021-12-17 10:41:11537 days 5 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x2d33176d51466fd6c65373d260731c8193d1fba938e13200893e929ef924d75a226277942021-12-17 10:22:30537 days 6 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x42399a07d2ff80b0385590e56ced800564659900baf6f5da0f7306c3195ee1c4226106402021-12-17 0:09:52537 days 16 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xd644e9e6e03034c0e868f07e10e5e003ddee18d96f083e14a01350d8e0a6a111226032922021-12-16 19:45:26537 days 20 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xa989d21bbc0ad98ea744577739e0a39d9c7d8ae38e79f14bd2f6cf7d84bc3b99225925852021-12-16 13:07:03538 days 3 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x9762610ada108e077e7bca2425da04e7826de9a3ef5443cc8fa1fb8a78d52008225731792021-12-16 1:25:55538 days 15 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x3b301c72a97ab55af24bdcdddb5da911977bb87ff3cfb18b10a9464def110176225310202021-12-14 23:31:50539 days 16 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0x61e671e655e6c2f63e335799c82afcaae85a9f1fdf0e15c22c027b19100e896d225063542021-12-14 8:05:34540 days 8 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xfec091a1878dcd8e884884d1e63154f595fddce820119758bdbb6403e7a6bef5224966902021-12-14 2:20:26540 days 14 hrs ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
0xd42a7b713d96d2679ccf72bd59136d7cb126e112b4f65d20f5ed866b3b464662224792892021-12-13 15:02:14541 days 1 hr ago 0x28fe1ab4e3811fbf59a2f02df0aed4518f2da0480x99f120c4ba7d3621e26429cba45a6f52b23dfd1f10 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Metacore

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 20 runs

Other Settings:
default evmVersion
File 1 of 21 : Metacore.sol
/**
 *Submitted for verification at Etherscan.io on 2021-09-14
 *
 *@author ty, tyler, muniz
*/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "openzeppelin-solidity/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/security/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/utils/Strings.sol";
import "openzeppelin-solidity/contracts/utils/Address.sol";
import "./ERC3664/extensions/ERC3664CrossSynthetic.sol";
import "./Synthetic/ISynthetic721.sol";
import "./utils/Base64.sol";

interface ICustomMetadata {
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

interface ICoreRegistry {
    function verifyIdentity(address token, uint256 tokenId) external view returns (bool);
}

contract Metacore is ERC3664CrossSynthetic, ERC721Enumerable, ReentrancyGuard, Ownable {
    using Strings for uint256;

    uint256 private constant METANAME = 1;

    address payable public treasury = payable(0x99F120C4BA7d3621e26429Cba45A6F52b23DFd1F);

    uint256 private _totalSupply = 8000;

    uint256 private _curTokenId;

    address private _customURI;

    address private _registry;

    mapping(address => bool) private _authNFTs;

    constructor() ERC3664CrossSynthetic() ERC721("Metacore V2", "MTC") Ownable() {
        _authNFTs[address(0xdB35a85748E3fE59D1CC3d039d03dDEeab8875e1)] = true;
        _mint(METANAME, "Metaname", "Metaname", "");
    }

    function getNextTokenID() public view returns (uint256) {
        return _curTokenId + 1;
    }

    function increaseIssue(uint256 supply) public onlyOwner {
        _totalSupply = supply;
    }

    function setCustomMetadata(address uri) public onlyOwner {
        _customURI = uri;
    }

    function setCoreRegistry(address registry) public onlyOwner {
        _registry = registry;
    }

    function setAuthNFTs(address nft, bool enable) public onlyOwner {
        _authNFTs[nft] = enable;
    }

    function claim(string memory name) public payable nonReentrant {
        require(bytes(name).length > 0, "Metacore: invalid name length");
        require(getNextTokenID() <= _totalSupply, "Metacore: reached the maximum number of claim");

        uint256 amount = msg.value;
        require(amount >= 10 * 10 ** 18, "Payed too low value");
        Address.sendValue(treasury, 10 * 10 ** 18);

        _curTokenId += 1;
        _safeMint(_msgSender(), _curTokenId);
        attach(_curTokenId, METANAME, 1, bytes(name), true);
    }

    function combine(
        uint256 tokenId,
        address subToken,
        uint256 subId
    ) public {
        require(ownerOf(tokenId) == _msgSender(), "Metacore: caller is not token owner");
        if (_registry != address(0)) {
            require(ICoreRegistry(_registry).verifyIdentity(subToken, subId), "Metacore: unregister token address;");
        } else {
            require(_authNFTs[subToken], "Metacore: invalid nft address");
        }

        ISynthetic721 sContract = ISynthetic721(subToken);
        require(sContract.getApproved(subId) == address(this),
            "Metacore: caller is not sub token owner nor approved");

        sContract.transferFrom(_msgSender(), address(this), subId);
        synthesizedTokens[tokenId].push(SynthesizedToken(subToken, msg.sender, subId));
    }

    function separate(uint256 tokenId) public {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "Metacore: caller is not token owner nor approved");

        SynthesizedToken[] storage subs = synthesizedTokens[tokenId];
        require(subs.length > 0, "Metacore: not synthesized token");
        for (uint256 i = 0; i < subs.length; i++) {
            ISynthetic721(subs[i].token).transferFrom(address(this), subs[i].owner, subs[i].id);
        }
        delete synthesizedTokens[tokenId];
    }

    function separateOne(uint256 tokenId, uint256 subId) public {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "Metacore: caller is not token owner nor approved");

        uint256 idx = findByValue(synthesizedTokens[tokenId], subId);
        SynthesizedToken storage token = synthesizedTokens[tokenId][idx];
        ISynthetic721(token.token).transferFrom(address(this), token.owner, token.id);
        removeAtIndex(synthesizedTokens[tokenId], idx);
    }

    function tokenURI(uint256 tokenId) override public view returns (string memory) {
        if (_customURI != address(0)) {
            return ICustomMetadata(_customURI).tokenURI(tokenId);
        }
        return coreTokenURI(tokenId);
    }

    function coreTokenURI(uint256 tokenId) public view returns (string memory) {
        string[4] memory parts;
        parts[0] = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" /><text x="10" y="20" class="base">';

        parts[1] = string(abi.encodePacked('Metacore #', tokenId.toString(), '</text><text x="10" y="40" class="base">'));

        parts[2] = string(textOf(tokenId, METANAME));

        parts[3] = '</text></svg>';

        string memory output = string(abi.encodePacked(parts[0], parts[1], parts[2], parts[3]));
        string memory attributes = getAttributes(tokenId);

        if (synthesizedTokens[tokenId].length > 0) {
            attributes = string(abi.encodePacked(attributes, ',{"trait_type":"SYNTHETIC","value":"true"}'));
        }

        string memory json = Base64.encode(bytes(string(abi.encodePacked('{"name": "Metacore #', tokenId.toString(), '", "description": "MetaCore is an identity system which can make all metaverse citizens join into different metaverses by using same MetaCore Identity. The first modular NFT with MetaCore at its core, with arbitrary attributes addition and removal, freely combine and divide each components. Already adapted to multiple metaverse blockchain games. FUTURE IS COMMING", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(output)), '","attributes":[', attributes, ']}'))));
        output = string(abi.encodePacked('data:application/json;base64,', json));
        return output;
    }

    function getAttributes(uint256 tokenId) public view returns (string memory) {
        bytes memory data = "";
        uint256 id = primaryAttributeOf(tokenId);
        if (id > 0) {
            data = abi.encodePacked('{"trait_type":"', symbol(id), '","value":"', textOf(tokenId, id), '"}');
        }
        uint256[] memory attrs = attributesOf(tokenId);
        for (uint256 i = 0; i < attrs.length; i++) {
            if (data.length > 0) {
                data = abi.encodePacked(data, ',');
            }
            data = abi.encodePacked(data, '{"trait_type":"', symbol(attrs[i]), '","value":"', textOf(tokenId, attrs[i]), '"}');
        }
        SynthesizedToken[] storage tokens = synthesizedTokens[tokenId];
        for (uint256 i = 0; i < tokens.length; i++) {
            data = abi.encodePacked(data, ',', concatAttribute(ISynthetic721(tokens[i].token).coreName(), tokens[i].id.toString()));
        }
        return string(data);
    }

    function concatAttribute(string memory key, string memory value) internal pure returns (bytes memory)  {
        return abi.encodePacked('{"trait_type":"', key, '","value":"', value, '"}');
    }

    function findByValue(SynthesizedToken[] storage values, uint256 value) internal view returns (uint256) {
        uint256 i = 0;
        while (values[i].id != value) {
            i++;
        }
        return i;
    }

    function removeAtIndex(SynthesizedToken[] storage values, uint256 index) internal {
        uint256 max = values.length;
        if (index >= max) return;

        if (index == max - 1) {
            values.pop();
            return;
        }

        for (uint256 i = index; i < max - 1; i++) {
            values[i] = values[i + 1];
        }
        values.pop();
    }

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

File 2 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 3 of 21 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 4 of 21 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

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

File 5 of 21 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 6 of 21 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 21 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 8 of 21 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 9 of 21 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

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

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

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

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

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

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

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

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

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

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

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

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

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

File 10 of 21 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 11 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

File 12 of 21 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

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

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

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 13 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 14 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 15 of 21 : Base64.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
    bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /// @notice Encodes some bytes to the base64 representation
    function encode(bytes memory data) internal pure returns (string memory) {
        uint256 len = data.length;
        if (len == 0) return "";

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((len + 2) / 3);

        // Add some extra buffer at the end
        bytes memory result = new bytes(encodedLen + 32);

        bytes memory table = TABLE;

        assembly {
            let tablePtr := add(table, 1)
            let resultPtr := add(result, 32)

            for {
                let i := 0
            } lt(i, len) {

            } {
                i := add(i, 3)
                let input := and(mload(add(data, i)), 0xffffff)

                let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))
                out := shl(224, out)

                mstore(resultPtr, out)

                resultPtr := add(resultPtr, 4)
            }

            switch mod(len, 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }

            mstore(result, encodedLen)
        }

        return string(result);
    }
}

File 16 of 21 : ISynthetic721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol";
import "./ISynthetic.sol";

/**
 * @dev Interface of the NFT(ERC721) Synthetic.
 */
interface ISynthetic721 is ISynthetic, IERC721 {

}

File 17 of 21 : ISynthetic.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the NFT Synthetic.
 */
interface ISynthetic {

    function coreName() external view returns (string memory);

    function tokenTexts(uint256 tokenId) external view returns (string memory);

    function tokenAttributes(uint256 tokenId) external view returns (string memory);
}

File 18 of 21 : IERC3664Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC3664.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC3664 standard.
 */
interface IERC3664Metadata is IERC3664 {
    /**
     * @dev Returns the name of the attribute.
     */
    function name(uint256 attrId) external view returns (string memory);

    /**
     * @dev Returns the symbol of the attribute.
     */
    function symbol(uint256 attrId) external view returns (string memory);

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

File 19 of 21 : ERC3664CrossSynthetic.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC3664.sol";

/**
 * @dev Implementation of the {ERC3664CrossSynthetic} interface.
 */
abstract contract ERC3664CrossSynthetic is ERC3664 {
    struct SynthesizedToken {
        address token;
        address owner;
        uint256 id;
    }

    // mainToken => SynthesizedToken
    mapping(uint256 => SynthesizedToken[]) public synthesizedTokens;

    constructor () ERC3664() {}

    function getSynthesizedTokens(uint256 tokenId) public view returns (SynthesizedToken[] memory) {
        return synthesizedTokens[tokenId];
    }

    function tokenAttributes(uint256 tokenId) public view returns (string memory) {
        bytes memory data = "";
        uint256 id = primaryAttributeOf(tokenId);
        if (id > 0) {
            data = abi.encodePacked('{"trait_type":"', symbol(id), '","value":"', textOf(tokenId, id), '"}');
        }
        uint256[] memory attrs = attributesOf(tokenId);
        for (uint256 i = 0; i < attrs.length; i++) {
            if (data.length > 0) {
                data = abi.encodePacked(data, ',');
            }
            data = abi.encodePacked(data, '{"trait_type":"', symbol(attrs[i]), '","value":"', textOf(tokenId, attrs[i]), '"}');
        }
        data = abi.encodePacked(data, getSubAttributes(tokenId));

        return string(data);
    }

    function getSubAttributes(uint256 tokenId) public view returns (bytes memory) {
        bytes memory data = "";
        SynthesizedToken[] storage sTokens = synthesizedTokens[tokenId];
        for (uint256 i = 0; i < sTokens.length; i++) {
            if (data.length > 0) {
                data = abi.encodePacked(data, ',');
            }
            data = abi.encodePacked(data, tokenAttributes(sTokens[i].id));
        }
        return data;
    }
}

File 20 of 21 : IERC3664.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "openzeppelin-solidity/contracts/utils/introspection/IERC165.sol";

interface IERC3664 is IERC165 {
    /**
     * @dev Emitted when new attribute type `attrId` are minted.
     */
    event NewAttribute(
        address indexed operator,
        uint256 indexed attrId,
        string name,
        string symbol,
        string uri
    );

    /**
     * @dev Equivalent to multiple {NewAttribute} events.
     */
    event NewAttributeBatch(
        address indexed operator,
        uint256[] indexed attrIds,
        string[] names,
        string[] symbols,
        string[] uris
    );

    /**
     * @dev Emitted when `value` of attribute type `attrId` are attached to "to"
     * or removed from `from` by `operator`.
     */
    event TransferSingle(
        address indexed operator,
        uint256 from,
        uint256 to,
        uint256 indexed attrId,
        uint256 value
    );

    /**
     * @dev Equivalent to multiple {TransferSingle} events.
     */
    event TransferBatch(
        address indexed operator,
        uint256 from,
        uint256 to,
        uint256[] indexed attrIds,
        uint256[] values
    );

    /**
    * @dev Returns primary attribute type of owned by `tokenId`.
    */
    function primaryAttributeOf(uint256 tokenId) external view returns (uint256);

    /**
     * @dev Returns all attribute types of owned by `tokenId`.
     */
    function attributesOf(uint256 tokenId) external view returns (uint256[] memory);

    /**
     * @dev Returns the attribute type `attrId` value owned by `tokenId`.
     */
    function balanceOf(uint256 tokenId, uint256 attrId) external view returns (uint256);

    /**
     * @dev Returns the batch of attribute type `attrIds` values owned by `tokenId`.
     */
    function balanceOfBatch(uint256 tokenId, uint256[] calldata attrIds)
    external
    view
    returns (uint256[] memory);

    function textOf(uint256 tokenId, uint256 attrId) external view returns (bytes memory);

    /**
     * @dev Attaches `amount` value of attribute type `attrId` to `tokenId`.
     */
    function attach(uint256 tokenId, uint256 attrId, uint256 amount, bytes memory text, bool isPrimary) external;

    /**
     * @dev [Batched] version of {attach}.
     */
    function batchAttach(
        uint256 tokenId,
        uint256[] calldata attrIds,
        uint256[] calldata amounts,
        bytes[] calldata texts
    ) external;
}

File 21 of 21 : ERC3664.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "openzeppelin-solidity/contracts/utils/Context.sol";
import "openzeppelin-solidity/contracts/utils/Strings.sol";
import "openzeppelin-solidity/contracts/utils/introspection/ERC165.sol";
import "./IERC3664.sol";
import "./extensions/IERC3664Metadata.sol";

contract ERC3664 is Context, ERC165, IERC3664, IERC3664Metadata {
    using Strings for uint256;

    struct AttrMetadata {
        string name;
        string symbol;
        string uri;
        bool exist;
    }

    // attrId => metadata
    mapping(uint256 => AttrMetadata) public _attrMetadatas;
    // attrId => tokenId => amount
    mapping(uint256 => mapping(uint256 => uint256)) public _balances;
    // attrId => tokenId => text
    mapping(uint256 => mapping(uint256 => bytes)) public _texts;
    // tokenId => primaryId
    mapping(uint256 => uint256) public primaryAttrs;
    // tokenId => secondaryIds
    mapping(uint256 => uint256[]) public secondaryAttrs;

    constructor () {}

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

    /**
     * @dev See {IERC3664Metadata-name}.
     */
    function name(uint256 attrId) public view virtual override returns (string memory) {
        require(_attrExists(attrId), "ERC3664: name query for nonexistent attribute");

        return _attrMetadatas[attrId].name;
    }

    /**
     * @dev See {IERC3664Metadata-symbol}.
     */
    function symbol(uint256 attrId) public view virtual override returns (string memory) {
        require(_attrExists(attrId), "ERC3664: symbol query for nonexistent attribute");

        return _attrMetadatas[attrId].symbol;
    }

    /**
     * @dev See {IERC721Metadata-attrURI}.
     */
    function attrURI(uint256 attrId) public view virtual override returns (string memory) {
        require(_attrExists(attrId), "ERC3664: URI query for nonexistent attribute");

        string memory uri = _attrMetadatas[attrId].uri;
        if (bytes(uri).length > 0) {
            return string(abi.encodePacked(uri, attrId.toString()));
        } else {
            string memory baseURI = _baseAttrURI();
            return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, attrId.toString())) : "";
        }
    }

    function primaryAttributeOf(uint256 tokenId) public view virtual override returns (uint256) {
        return primaryAttrs[tokenId];
    }

    /**
     * @dev See {IERC3664-attributesOf}.
     */
    function attributesOf(uint256 tokenId) public view virtual override returns (uint256[] memory) {
        return secondaryAttrs[tokenId];
    }

    /**
     * @dev See {IERC3664-balanceOf}.
     */
    function balanceOf(uint256 tokenId, uint256 attrId) public view virtual override returns (uint256) {
        return _balances[attrId][tokenId];
    }

    /**
     * @dev See {IERC3664-balanceOfBatch}.
     */
    function balanceOfBatch(uint256 tokenId, uint256[] calldata attrIds)
    public
    view
    virtual
    override
    returns (uint256[] memory) {
        uint256[] memory batchBalances = new uint256[](attrIds.length);

        for (uint256 i = 0; i < attrIds.length; ++i) {
            batchBalances[i] = balanceOf(tokenId, attrIds[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC3664-textOf}.
     */
    function textOf(uint256 tokenId, uint256 attrId) public view virtual override returns (bytes memory) {
        return _texts[attrId][tokenId];
    }

    /**
     * @dev See {IERC3664-attach}.
     */
    function attach(
        uint256 tokenId,
        uint256 attrId,
        uint256 amount,
        bytes memory text,
        bool isPrimary
    ) public virtual override {
        require(_attrExists(attrId), "ERC3664: attach for nonexistent attribute");

        address operator = _msgSender();

        _beforeAttrTransfer(operator, 0, tokenId, _asSingletonArray(attrId), _asSingletonArray(amount), "");

        if (_balances[attrId][tokenId] == 0) {
            if (isPrimary) {
                primaryAttrs[tokenId] = attrId;
            } else {
                secondaryAttrs[tokenId].push(attrId);
            }
        }

        if (text.length > 0) {
            _texts[attrId][tokenId] = text;
        }

        _balances[attrId][tokenId] += amount;

        emit TransferSingle(operator, 0, tokenId, attrId, amount);
    }

    /**
     * @dev See {IERC3664-batchAttach}.
     */
    function batchAttach(
        uint256 tokenId,
        uint256[] calldata attrIds,
        uint256[] calldata amounts,
        bytes[] calldata texts
    ) public virtual override {
        address operator = _msgSender();

        _beforeAttrTransfer(operator, 0, tokenId, attrIds, amounts, "");

        for (uint256 i = 0; i < attrIds.length; i++) {
            require(_attrExists(attrIds[i]), "ERC3664: batchAttach for nonexistent attribute");

            if (_balances[attrIds[i]][tokenId] == 0) {
                secondaryAttrs[tokenId].push(attrIds[i]);
            }

            if (texts[i].length > 0) {
                _texts[attrIds[i]][tokenId] = texts[i];
            }

            _balances[attrIds[i]][tokenId] += amounts[i];
        }

        emit TransferBatch(operator, 0, tokenId, attrIds, amounts);
    }

    /**
     * @dev Mint new attribute type with metadata.
     *
     * Emits a {NewAttribute} event.
     */
    function _mint(
        uint256 attrId,
        string memory _name,
        string memory _symbol,
        string memory _uri
    ) internal virtual {
        require(!_attrExists(attrId), "ERC3664: attribute already exists");

        address operator = _msgSender();

        AttrMetadata memory data = AttrMetadata(_name, _symbol, _uri, true);
        _attrMetadatas[attrId] = data;

        emit NewAttribute(operator, attrId, _name, _symbol, _uri);
    }

    /**
     * @dev [Batched] version of {_mint}.
     */
    function _mintBatch(
        uint256[] memory attrIds,
        string[] memory names,
        string[] memory symbols,
        string[] memory uris
    ) internal virtual {
        require(attrIds.length == names.length, "ERC3664: attrIds and names length mismatch");
        require(names.length == symbols.length, "ERC3664: names and symbols length mismatch");
        require(symbols.length == uris.length, "ERC3664: symbols and uris length mismatch");

        address operator = _msgSender();

        for (uint256 i = 0; i < attrIds.length; i++) {
            require(!_attrExists(attrIds[i]), "ERC3664: attribute already exists");

            AttrMetadata memory data = AttrMetadata(names[i], symbols[i], uris[i], true);
            _attrMetadatas[attrIds[i]] = data;
        }

        emit NewAttributeBatch(operator, attrIds, names, symbols, uris);
    }

    /**
     * @dev Destroys `amount` values of attribute type `attrId` from `tokenId`
     */
    function _burn(
        uint256 tokenId,
        uint256 attrId,
        uint256 amount
    ) internal virtual {
        address operator = _msgSender();

        _beforeAttrTransfer(operator, tokenId, 0, _asSingletonArray(attrId), _asSingletonArray(amount), "");

        uint256 tokenBalance = _balances[attrId][tokenId];
        require(tokenBalance >= amount, "ERC3664: insufficient balance for transfer");
    unchecked {
        _balances[attrId][tokenId] = tokenBalance - amount;
    }

        emit TransferSingle(operator, tokenId, 0, attrId, amount);
    }

    /**
     * @dev [Batched] version of {_burn}.
     */
    function _burnBatch(
        uint256 tokenId,
        uint256[] memory attrIds,
        uint256[] memory amounts
    ) internal virtual {
        require(attrIds.length == amounts.length, "ERC3664: attrIds and amounts length mismatch");

        address operator = _msgSender();

        _beforeAttrTransfer(operator, tokenId, 0, attrIds, amounts, "");

        for (uint256 i = 0; i < attrIds.length; i++) {
            uint256 tokenBalance = _balances[attrIds[i]][tokenId];
            require(tokenBalance >= amounts[i], "ERC3664: insufficient balance for transfer");
        unchecked {
            _balances[attrIds[i]][tokenId] = tokenBalance - amounts[i];
        }
        }

        emit TransferBatch(operator, tokenId, 0, attrIds, amounts);
    }

    /**
     * @dev Hook that is called before any attribute transfer. This includes attaching
     * and removing, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * attaches, the length of the `attrIds` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `attrIds` and `amounts` pair):
     */
    function _beforeAttrTransfer(
        address operator,
        uint256 from,
        uint256 to,
        uint256[] memory attrIds,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

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

    /**
     * @dev Returns whether `attrId` exists.
     *
     * Attribute start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _attrExists(uint256 attrId) internal view returns (bool) {
        return _attrMetadatas[attrId].exist;
    }

    function _hasAttr(uint256 tokenId, uint256 attrId) internal view returns (bool) {
        return _balances[attrId][tokenId] > 0;
    }

    function _asSingletonArray(uint256 element) internal pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }

    function _removeByValue(uint256[] storage values, uint value) internal {
        uint i = 0;
        while (values[i] != value) {
            i++;
        }
        delete values[i];
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 20
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

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":"operator","type":"address"},{"indexed":true,"internalType":"uint256","name":"attrId","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"NewAttribute","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"uint256[]","name":"attrIds","type":"uint256[]"},{"indexed":false,"internalType":"string[]","name":"names","type":"string[]"},{"indexed":false,"internalType":"string[]","name":"symbols","type":"string[]"},{"indexed":false,"internalType":"string[]","name":"uris","type":"string[]"}],"name":"NewAttributeBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"from","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"to","type":"uint256"},{"indexed":true,"internalType":"uint256[]","name":"attrIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"from","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"to","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"attrId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_attrMetadatas","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"bool","name":"exist","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_texts","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"attrId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"text","type":"bytes"},{"internalType":"bool","name":"isPrimary","type":"bool"}],"name":"attach","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"attrId","type":"uint256"}],"name":"attrURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"attributesOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"attrId","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"attrIds","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"attrIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes[]","name":"texts","type":"bytes[]"}],"name":"batchAttach","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"subToken","type":"address"},{"internalType":"uint256","name":"subId","type":"uint256"}],"name":"combine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"coreTokenURI","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":"uint256","name":"tokenId","type":"uint256"}],"name":"getAttributes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextTokenID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSubAttributes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSynthesizedTokens","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"internalType":"struct ERC3664CrossSynthetic.SynthesizedToken[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"name":"increaseIssue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"attrId","type":"uint256"}],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"primaryAttributeOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"primaryAttrs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"secondaryAttrs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"separate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"subId","type":"uint256"}],"name":"separateOne","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"bool","name":"enable","type":"bool"}],"name":"setAuthNFTs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"}],"name":"setCoreRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"uri","type":"address"}],"name":"setCustomMetadata","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":[{"internalType":"uint256","name":"attrId","type":"uint256"}],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"synthesizedTokens","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"attrId","type":"uint256"}],"name":"textOf","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenAttributes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6080604052601280546001600160a01b0319167399f120c4ba7d3621e26429cba45a6f52b23dfd1f179055611f406013553480156200003d57600080fd5b50604080518082018252600b81526a26b2ba30b1b7b932902b1960a91b6020808301918252835180850190945260038452624d544360e81b9084015281519192916200008c9160069162000305565b508051620000a290600790602084019062000305565b5050600160105550620000b53362000151565b73db35a85748e3fe59d1cc3d039d03ddeeab8875e16000908152601760209081527fc726955f2c44ddcfc43be8a1b92356b55fa556fdbafcdcd307f38c0bcacaea45805460ff191660019081179091556040805180820182526008808252674d6574616e616d6560c01b828601819052835180850185529182528186015282519485019092529383526200014b939192620001a3565b62000481565b601180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008481526020819052604090206003015460ff1615620002145760405162461bcd60e51b815260206004820152602160248201527f455243333636343a2061747472696275746520616c72656164792065786973746044820152607360f81b606482015260840160405180910390fd5b604080516080810182528481526020808201859052818301849052600160608301526000878152808252929092208151805133948493926200025d928492919091019062000305565b50602082810151805162000278926001850192019062000305565b50604082015180516200029691600284019160209091019062000305565b50606091909101516003909101805460ff191691151591909117905560405186906001600160a01b038416907f0f95c7b6e09a6cd1ff57e6238b940fa674ce6ce983d94900b6a8a6393929be3f90620002f590899089908990620003fb565b60405180910390a3505050505050565b828054620003139062000444565b90600052602060002090601f01602090048101928262000337576000855562000382565b82601f106200035257805160ff191683800117855562000382565b8280016001018555821562000382579182015b828111156200038257825182559160200191906001019062000365565b506200039092915062000394565b5090565b5b8082111562000390576000815560010162000395565b6000815180845260005b81811015620003d357602081850181015186830182015201620003b5565b81811115620003e6576000602083870101525b50601f01601f19169290920160200192915050565b606081526000620004106060830186620003ab565b8281036020840152620004248186620003ab565b905082810360408401526200043a8185620003ab565b9695505050505050565b600181811c908216806200045957607f821691505b602082108114156200047b57634e487b7160e01b600052602260045260246000fd5b50919050565b614dff80620004916000396000f3fe6080604052600436106102485760003560e01c80635d126110116101355780635d126110146105cf57806361d027b3146105ef5780636352211e1461060f57806370a082311461062f578063715018a61461064f5780637307d4bc14610664578063877936231461068457806387e21d42146106bc5780638da5cb5b146106e95780638df5a792146106fe578063936ca9e61461072b57806395d89b411461074b57806398e6d67a146107605780639a046ac5146107805780639bc5ae54146107a0578063a22cb465146107c0578063a7f78949146107e0578063b888fd0e14610800578063b88d4fde14610820578063c87b56dd14610840578063e985e9c514610860578063ea69963314610880578063f2824b53146108a0578063f2fde38b146108c0578063f3fe12c9146108e057600080fd5b8062ad800c1461024d57806301ffc9a71461028357806306fdde03146102b3578063081812fc146102c857806309363c4414610300578063095ea7b31461032d5780630ccaa34f1461034f5780630e7f78941461037e578063119724d71461039e57806313f11cfc146103be57806318160ddd146103de57806323b872dd146103fd57806326e1ce641461041d578063277370711461044a5780632f745c591461046a57806342842e0e1461048a5780634378a6e3146104aa57806345e74373146104ca5780634a198119146104ea5780634e41a1fb146104ff5780634f6ccce71461051f5780635245110d1461053f57806352b6f06f1461056f5780635883a0201461058f5780635c98dcd8146105af575b600080fd5b34801561025957600080fd5b5061026d610268366004614000565b6108f3565b60405161027a9190614882565b60405180910390f35b34801561028f57600080fd5b506102a361029e366004613f08565b610a03565b604051901515815260200161027a565b3480156102bf57600080fd5b5061026d610a14565b3480156102d457600080fd5b506102e86102e3366004614000565b610aa6565b6040516001600160a01b03909116815260200161027a565b34801561030c57600080fd5b5061032061031b366004614000565b610b2e565b60405161027a919061483e565b34801561033957600080fd5b5061034d610348366004613ebf565b610b8f565b005b34801561035b57600080fd5b5061036f61036a36600461412e565b610ca0565b60405161027a93929190614782565b34801561038a57600080fd5b5061034d61039936600461412e565b610ced565b3480156103aa57600080fd5b5061034d6103b9366004613d72565b610df0565b3480156103ca57600080fd5b5061034d6103d9366004613d72565b610e41565b3480156103ea57600080fd5b50600e545b60405190815260200161027a565b34801561040957600080fd5b5061034d610418366004613de5565b610e92565b34801561042957600080fd5b5061043d610438366004614000565b610ec4565b60405161027a91906147d9565b34801561045657600080fd5b506103ef61046536600461412e565b610f5e565b34801561047657600080fd5b506103ef610485366004613ebf565b610f8f565b34801561049657600080fd5b5061034d6104a5366004613de5565b611025565b3480156104b657600080fd5b5061026d6104c5366004614000565b611040565b3480156104d657600080fd5b5061034d6104e536600461408b565b611284565b3480156104f657600080fd5b506103ef6115a3565b34801561050b57600080fd5b5061026d61051a366004614000565b6115b9565b34801561052b57600080fd5b506103ef61053a366004614000565b611644565b34801561054b57600080fd5b5061055f61055a366004614000565b6116d7565b60405161027a94939291906148e1565b34801561057b57600080fd5b5061034d61058a366004613e91565b61189a565b34801561059b57600080fd5b5061034d6105aa366004614019565b6118f4565b3480156105bb57600080fd5b5061026d6105ca366004614000565b611c8c565b3480156105db57600080fd5b506103206105ea366004614040565b611dfd565b3480156105fb57600080fd5b506012546102e8906001600160a01b031681565b34801561061b57600080fd5b506102e861062a366004614000565b611ea8565b34801561063b57600080fd5b506103ef61064a366004613d72565b611f1f565b34801561065b57600080fd5b5061034d611fa6565b34801561067057600080fd5b5061034d61067f366004614000565b611fe1565b34801561069057600080fd5b506103ef61069f36600461412e565b600160209081526000928352604080842090915290825290205481565b3480156106c857600080fd5b506103ef6106d7366004614000565b60009081526003602052604090205490565b3480156106f557600080fd5b506102e8612181565b34801561070a57600080fd5b506103ef610719366004614000565b60036020526000908152604090205481565b34801561073757600080fd5b5061034d610746366004614150565b612190565b34801561075757600080fd5b5061026d612338565b34801561076c57600080fd5b5061026d61077b366004614000565b612347565b34801561078c57600080fd5b5061026d61079b36600461412e565b612404565b3480156107ac57600080fd5b5061026d6107bb366004614000565b6124b2565b3480156107cc57600080fd5b5061034d6107db366004613e91565b612666565b3480156107ec57600080fd5b5061034d6107fb366004614000565b612727565b34801561080c57600080fd5b5061026d61081b36600461412e565b61275b565b34801561082c57600080fd5b5061034d61083b366004613e26565b612800565b34801561084c57600080fd5b5061026d61085b366004614000565b612831565b34801561086c57600080fd5b506102a361087b366004613dac565b6128ce565b34801561088c57600080fd5b506103ef61089b36600461412e565b6128fc565b3480156108ac57600080fd5b5061026d6108bb366004614000565b612918565b3480156108cc57600080fd5b5061034d6108db366004613d72565b612a4e565b61034d6108ee366004613f42565b612aee565b60606108fe82612caf565b6109655760405162461bcd60e51b815260206004820152602d60248201527f455243333636343a206e616d6520717565727920666f72206e6f6e657869737460448201526c656e742061747472696275746560981b60648201526084015b60405180910390fd5b6000828152602081905260409020805461097e90614b81565b80601f01602080910402602001604051908101604052809291908181526020018280546109aa90614b81565b80156109f75780601f106109cc576101008083540402835291602001916109f7565b820191906000526020600020905b8154815290600101906020018083116109da57829003601f168201915b50505050509050919050565b6000610a0e82612cc7565b92915050565b606060068054610a2390614b81565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4f90614b81565b8015610a9c5780601f10610a7157610100808354040283529160200191610a9c565b820191906000526020600020905b815481529060010190602001808311610a7f57829003601f168201915b5050505050905090565b6000610ab182612cec565b610b125760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161095c565b506000908152600a60205260409020546001600160a01b031690565b6000818152600460209081526040918290208054835181840281018401909452808452606093928301828280156109f757602002820191906000526020600020905b815481526020019060010190808311610b705750505050509050919050565b6000610b9a82611ea8565b9050806001600160a01b0316836001600160a01b03161415610c085760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161095c565b336001600160a01b0382161480610c245750610c2481336128ce565b610c915760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b606482015260840161095c565b610c9b8383612d09565b505050565b60056020528160005260406000208181548110610cbc57600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b0391821694509116915083565b610cf8335b83612d77565b610d145760405162461bcd60e51b815260040161095c906149b5565b6000828152600560205260408120610d2c9083612e39565b60008481526005602052604081208054929350909183908110610d5157610d51614c27565b600091825260209091206003909102018054600182015460028301546040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd93610da0933093911691600401614782565b600060405180830381600087803b158015610dba57600080fd5b505af1158015610dce573d6000803e3d6000fd5b5050506000858152600560205260409020610dea915083612e80565b50505050565b33610df9612181565b6001600160a01b031614610e1f5760405162461bcd60e51b815260040161095c90614980565b601580546001600160a01b0319166001600160a01b0392909216919091179055565b33610e4a612181565b6001600160a01b031614610e705760405162461bcd60e51b815260040161095c90614980565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b610e9d335b82612d77565b610eb95760405162461bcd60e51b815260040161095c90614a05565b610c9b838383612faa565b606060056000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610f53576000848152602090819020604080516060810182526003860290920180546001600160a01b03908116845260018083015490911684860152600290910154918301919091529083529092019101610ef9565b505050509050919050565b60046020528160005260406000208181548110610f7a57600080fd5b90600052602060002001600091509150505481565b6000610f9a83611f1f565b8210610ffc5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161095c565b506001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b610c9b83838360405180602001604052806000815250612800565b6040805160208082018352600080835284815260039091529182205460609250801561109c5761106f816115b9565b6110798583612404565b60405160200161108a929190614662565b60405160208183030381529060405291505b60006110a785610b2e565b905060005b815181101561115b578351156110df57836040516020016110cd9190614261565b60405160208183030381529060405293505b836111028383815181106110f5576110f5614c27565b60200260200101516115b9565b6111258885858151811061111857611118614c27565b6020026020010151612404565b604051602001611137939291906142c2565b6040516020818303038152906040529350808061115390614bb6565b9150506110ac565b506000858152600560205260408120905b8154811015611279578461124483838154811061118b5761118b614c27565b6000918252602082206003909102015460408051630f0a2cdd60e11b815290516001600160a01b0390921692631e1459ba92600480840193829003018186803b1580156111d757600080fd5b505afa1580156111eb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112139190810190613f8a565b61123f85858154811061122857611228614c27565b906000526020600020906003020160020154613155565b613252565b604051602001611255929190614286565b6040516020818303038152906040529450808061127190614bb6565b91505061116c565b509295945050505050565b60003390506113088160008a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201829052506040805160208101909152908152925061327e915050565b60005b868110156115385761133488888381811061132857611328614c27565b90506020020135612caf565b6113975760405162461bcd60e51b815260206004820152602e60248201527f455243333636343a20626174636841747461636820666f72206e6f6e6578697360448201526d74656e742061747472696275746560901b606482015260840161095c565b600160008989848181106113ad576113ad614c27565b90506020020135815260200190815260200160002060008a8152602001908152602001600020546000141561141f5760008981526004602052604090208888838181106113fc576113fc614c27565b835460018101855560009485526020948590209190940292909201359190920155505b600084848381811061143357611433614c27565b90506020028101906114459190614a56565b905011156114bc5783838281811061145f5761145f614c27565b90506020028101906114719190614a56565b600260008b8b8681811061148757611487614c27565b90506020020135815260200190815260200160002060008c815260200190815260200160002091906114ba929190613b41565b505b8585828181106114ce576114ce614c27565b90506020020135600160008a8a858181106114eb576114eb614c27565b90506020020135815260200190815260200160002060008b815260200190815260200160002060008282546115209190614af3565b9091555081905061153081614bb6565b91505061130b565b508686604051611549929190614206565b6040518091039020816001600160a01b03167fbfb4d8e5891aebe97980c97616b6b0af2006a58ccabe6e1b7e3da24d0906a85660008b89896040516115919493929190614895565b60405180910390a35050505050505050565b600060145460016115b49190614af3565b905090565b60606115c482612caf565b6116285760405162461bcd60e51b815260206004820152602f60248201527f455243333636343a2073796d626f6c20717565727920666f72206e6f6e65786960448201526e7374656e742061747472696275746560881b606482015260840161095c565b6000828152602081905260409020600101805461097e90614b81565b600061164f600e5490565b82106116b25760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161095c565b600e82815481106116c5576116c5614c27565b90600052602060002001549050919050565b6000602081905290815260409020805481906116f290614b81565b80601f016020809104026020016040519081016040528092919081815260200182805461171e90614b81565b801561176b5780601f106117405761010080835404028352916020019161176b565b820191906000526020600020905b81548152906001019060200180831161174e57829003601f168201915b50505050509080600101805461178090614b81565b80601f01602080910402602001604051908101604052809291908181526020018280546117ac90614b81565b80156117f95780601f106117ce576101008083540402835291602001916117f9565b820191906000526020600020905b8154815290600101906020018083116117dc57829003601f168201915b50505050509080600201805461180e90614b81565b80601f016020809104026020016040519081016040528092919081815260200182805461183a90614b81565b80156118875780601f1061185c57610100808354040283529160200191611887565b820191906000526020600020905b81548152906001019060200180831161186a57829003601f168201915b5050506003909301549192505060ff1684565b336118a3612181565b6001600160a01b0316146118c95760405162461bcd60e51b815260040161095c90614980565b6001600160a01b03919091166000908152601760205260409020805460ff1916911515919091179055565b336118fe84611ea8565b6001600160a01b0316146119605760405162461bcd60e51b815260206004820152602360248201527f4d657461636f72653a2063616c6c6572206973206e6f7420746f6b656e206f776044820152623732b960e91b606482015260840161095c565b6016546001600160a01b031615611a525760165460405163aef7412f60e01b81526001600160a01b038481166004830152602482018490529091169063aef7412f9060440160206040518083038186803b1580156119bd57600080fd5b505afa1580156119d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f59190613eeb565b611a4d5760405162461bcd60e51b815260206004820152602360248201527f4d657461636f72653a20756e726567697374657220746f6b656e20616464726560448201526273733b60e81b606482015260840161095c565b611aba565b6001600160a01b03821660009081526017602052604090205460ff16611aba5760405162461bcd60e51b815260206004820152601d60248201527f4d657461636f72653a20696e76616c6964206e66742061646472657373000000604482015260640161095c565b60405163020604bf60e21b815260048101829052829030906001600160a01b0383169063081812fc9060240160206040518083038186803b158015611afe57600080fd5b505afa158015611b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b369190613d8f565b6001600160a01b031614611ba95760405162461bcd60e51b815260206004820152603460248201527f4d657461636f72653a2063616c6c6572206973206e6f742073756220746f6b656044820152731b881bdddb995c881b9bdc88185c1c1c9bdd995960621b606482015260840161095c565b6040516323b872dd60e01b81526001600160a01b038216906323b872dd90611bd990339030908790600401614782565b600060405180830381600087803b158015611bf357600080fd5b505af1158015611c07573d6000803e3d6000fd5b5050506000948552505060056020908152604080852081516060810183526001600160a01b03958616815233818501908152928101948552815460018181018455928852939096209551600390930290950180549285166001600160a01b03199384161781559051948101805495909416949091169390931790915551600290910155565b6060611c96613bc5565b60405180610120016040528060fd8152602001614c8d60fd91398152611cbb83613155565b604051602001611ccb91906146d3565b60408051808303601f190181529190526020820152611ceb836001612404565b604082810191825280518082018252600d81526c1e17ba32bc3a1f1e17b9bb339f60991b6020808301919091526060850182905284518186015194519351600095611d3c9592949093909101614348565b60405160208183030381529060405290506000611d5885611040565b60008681526005602052604090205490915015611d925780604051602001611d80919061439f565b60405160208183030381529060405290505b6000611dd0611da087613155565b611da985613286565b84604051602001611dbc939291906143f3565b604051602081830303815290604052613286565b905080604051602001611de3919061473d565b60408051601f198184030181529190529695505050505050565b60606000826001600160401b03811115611e1957611e19614c3d565b604051908082528060200260200182016040528015611e42578160200160208202803683370190505b50905060005b83811015611e9f57611e7286868684818110611e6657611e66614c27565b905060200201356128fc565b828281518110611e8457611e84614c27565b6020908102919091010152611e9881614bb6565b9050611e48565b50949350505050565b6000818152600860205260408120546001600160a01b031680610a0e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161095c565b60006001600160a01b038216611f8a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161095c565b506001600160a01b031660009081526009602052604090205490565b33611faf612181565b6001600160a01b031614611fd55760405162461bcd60e51b815260040161095c90614980565b611fdf60006133eb565b565b611fea33610e97565b6120065760405162461bcd60e51b815260040161095c906149b5565b600081815260056020526040902080546120625760405162461bcd60e51b815260206004820152601f60248201527f4d657461636f72653a206e6f742073796e74686573697a656420746f6b656e00604482015260640161095c565b60005b81548110156121655781818154811061208057612080614c27565b600091825260209091206003909102015482546001600160a01b03909116906323b872dd9030908590859081106120b9576120b9614c27565b906000526020600020906003020160010160009054906101000a90046001600160a01b03168585815481106120f0576120f0614c27565b9060005260206000209060030201600201546040518463ffffffff1660e01b815260040161212093929190614782565b600060405180830381600087803b15801561213a57600080fd5b505af115801561214e573d6000803e3d6000fd5b50505050808061215d90614bb6565b915050612065565b50600082815260056020526040812061217d91613bec565b5050565b6011546001600160a01b031690565b61219984612caf565b6121f75760405162461bcd60e51b815260206004820152602960248201527f455243333636343a2061747461636820666f72206e6f6e6578697374656e742060448201526861747472696275746560b81b606482015260840161095c565b33612227816000886122088961343d565b6122118961343d565b5050604080516020810190915260009052505050565b6000858152600160209081526040808320898452909152902054612283578115612261576000868152600360205260409020859055612283565b6000868152600460209081526040822080546001810182559083529120018590555b8251156122b3576000858152600260209081526040808320898452825290912084516122b192860190613c0d565b505b6000858152600160209081526040808320898452909152812080548692906122dc908490614af3565b909155505060408051600081526020810188905290810185905285906001600160a01b038316907f73b5fbfbf0177b0de2ffe9fd0ae9887dd73d0d865db7ab5ff3c4a6b9bb8db1e39060600160405180910390a3505050505050565b606060078054610a2390614b81565b6040805160208082018352600080835284815260059091529182206060925b81548110156123fb5782511561239957826040516020016123879190614261565b60405160208183030381529060405292505b826123c68383815481106123af576123af614c27565b906000526020600020906003020160020154612918565b6040516020016123d7929190614232565b604051602081830303815290604052925080806123f390614bb6565b915050612366565b50909392505050565b6000818152600260209081526040808320858452909152902080546060919061242c90614b81565b80601f016020809104026020016040519081016040528092919081815260200182805461245890614b81565b80156124a55780601f1061247a576101008083540402835291602001916124a5565b820191906000526020600020905b81548152906001019060200180831161248857829003601f168201915b5050505050905092915050565b60606124bd82612caf565b61251e5760405162461bcd60e51b815260206004820152602c60248201527f455243333636343a2055524920717565727920666f72206e6f6e65786973746560448201526b6e742061747472696275746560a01b606482015260840161095c565b6000828152602081905260408120600201805461253a90614b81565b80601f016020809104026020016040519081016040528092919081815260200182805461256690614b81565b80156125b35780601f10612588576101008083540402835291602001916125b3565b820191906000526020600020905b81548152906001019060200180831161259657829003601f168201915b505050505090506000815111156125f657806125ce84613155565b6040516020016125df929190614232565b604051602081830303815290604052915050919050565b600061260d60408051602081019091526000815290565b9050600081511161262d5760405180602001604052806000815250612658565b8061263785613155565b604051602001612648929190614232565b6040516020818303038152906040525b949350505050565b50919050565b6001600160a01b0382163314156126bb5760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b604482015260640161095c565b336000818152600b602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b33612730612181565b6001600160a01b0316146127565760405162461bcd60e51b815260040161095c90614980565b601355565b60026020908152600092835260408084209091529082529020805461277f90614b81565b80601f01602080910402602001604051908101604052809291908181526020018280546127ab90614b81565b80156127f85780601f106127cd576101008083540402835291602001916127f8565b820191906000526020600020905b8154815290600101906020018083116127db57829003601f168201915b505050505081565b61280933610cf2565b6128255760405162461bcd60e51b815260040161095c90614a05565b610dea84848484613488565b6015546060906001600160a01b0316156128c55760155460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd9060240160006040518083038186803b15801561288957600080fd5b505afa15801561289d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a0e9190810190613f8a565b610a0e82611c8c565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205460ff1690565b6000908152600160209081526040808320938352929052205490565b6040805160208082018352600080835284815260039091529182205460609250801561297457612947816115b9565b6129518583612404565b604051602001612962929190614662565b60405160208183030381529060405291505b600061297f85610b2e565b905060005b8151811015612a19578351156129b757836040516020016129a59190614261565b60405160208183030381529060405293505b836129cd8383815181106110f5576110f5614c27565b6129e38885858151811061111857611118614c27565b6040516020016129f5939291906142c2565b60405160208183030381529060405293508080612a1190614bb6565b915050612984565b5082612a2486612347565b604051602001612a35929190614232565b60408051601f1981840301815291905295945050505050565b33612a57612181565b6001600160a01b031614612a7d5760405162461bcd60e51b815260040161095c90614980565b6001600160a01b038116612ae25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161095c565b612aeb816133eb565b50565b60026010541415612b415760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161095c565b60026010558051612b945760405162461bcd60e51b815260206004820152601d60248201527f4d657461636f72653a20696e76616c6964206e616d65206c656e677468000000604482015260640161095c565b601354612b9f6115a3565b1115612c035760405162461bcd60e51b815260206004820152602d60248201527f4d657461636f72653a207265616368656420746865206d6178696d756d206e7560448201526c6d626572206f6620636c61696d60981b606482015260840161095c565b34678ac7230489e80000811015612c525760405162461bcd60e51b8152602060048201526013602482015272506179656420746f6f206c6f772076616c756560681b604482015260640161095c565b601254612c70906001600160a01b0316678ac7230489e800006134bb565b600160146000828254612c839190614af3565b90915550612c959050336014546135d1565b612ca6601454600180856001612190565b50506001601055565b60009081526020819052604090206003015460ff1690565b60006001600160e01b0319821663780e9d6360e01b1480610a0e5750610a0e826135eb565b6000908152600860205260409020546001600160a01b0316151590565b6000818152600a6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612d3e82611ea8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612d8282612cec565b612de35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161095c565b6000612dee83611ea8565b9050806001600160a01b0316846001600160a01b03161480612e295750836001600160a01b0316612e1e84610aa6565b6001600160a01b0316145b80612658575061265881856128ce565b6000805b82848281548110612e5057612e50614c27565b90600052602060002090600302016002015414612e795780612e7181614bb6565b915050612e3d565b9392505050565b8154808210612e8e57505050565b612e99600182614b3e565b821415612eeb5782805480612eb057612eb0614c11565b60008281526020812060036000199093019283020180546001600160a01b031990811682556001820180549091169055600201559055505050565b815b612ef8600183614b3e565b811015612f995783612f0b826001614af3565b81548110612f1b57612f1b614c27565b9060005260206000209060030201848281548110612f3b57612f3b614c27565b60009182526020909120825460039092020180546001600160a01b039283166001600160a01b031991821617825560018085015490830180549190941691161790915560029182015491015580612f9181614bb6565b915050612eed565b5082805480612eb057612eb0614c11565b826001600160a01b0316612fbd82611ea8565b6001600160a01b0316146130255760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161095c565b6001600160a01b0382166130875760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161095c565b61309283838361362b565b61309d600082612d09565b6001600160a01b03831660009081526009602052604081208054600192906130c6908490614b3e565b90915550506001600160a01b03821660009081526009602052604081208054600192906130f4908490614af3565b909155505060008181526008602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6060816131795750506040805180820190915260018152600360fc1b602082015290565b8160005b81156131a3578061318d81614bb6565b915061319c9050600a83614b0b565b915061317d565b6000816001600160401b038111156131bd576131bd614c3d565b6040519080825280601f01601f1916602001820160405280156131e7576020820181803683370190505b5090505b8415612658576131fc600183614b3e565b9150613209600a86614bd1565b613214906030614af3565b60f81b81838151811061322957613229614c27565b60200101906001600160f81b031916908160001a90535061324b600a86614b0b565b94506131eb565b60608282604051602001613267929190614662565b604051602081830303815290604052905092915050565b505050505050565b8051606090806132a6575050604080516020810190915260008152919050565b600060036132b5836002614af3565b6132bf9190614b0b565b6132ca906004614b1f565b905060006132d9826020614af3565b6001600160401b038111156132f0576132f0614c3d565b6040519080825280601f01601f19166020018201604052801561331a576020820181803683370190505b5090506000604051806060016040528060408152602001614d8a604091399050600181016020830160005b868110156133a6576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101613345565b5060038606600181146133c057600281146133d1576133dd565b613d3d60f01b6001198301526133dd565b603d60f81b6000198301525b505050918152949350505050565b601180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061347757613477614c27565b602090810291909101015292915050565b613493848484612faa565b61349f848484846136e3565b610dea5760405162461bcd60e51b815260040161095c9061492e565b8047101561350b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161095c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613558576040519150601f19603f3d011682016040523d82523d6000602084013e61355d565b606091505b5050905080610c9b5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b606482015260840161095c565b61217d8282604051806020016040528060008152506137f0565b60006001600160e01b031982166380ac58cd60e01b148061361c57506001600160e01b03198216635b5e139f60e01b145b80610a0e5750610a0e82613823565b6001600160a01b0383166136865761368181600e80546000838152600f60205260408120829055600182018355919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0155565b6136a9565b816001600160a01b0316836001600160a01b0316146136a9576136a98382613873565b6001600160a01b0382166136c057610c9b81613910565b826001600160a01b0316826001600160a01b031614610c9b57610c9b82826139bf565b60006001600160a01b0384163b156137e557604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906137279033908990889088906004016147a6565b602060405180830381600087803b15801561374157600080fd5b505af1925050508015613771575060408051601f3d908101601f1916820190925261376e91810190613f25565b60015b6137cb573d80801561379f576040519150601f19603f3d011682016040523d82523d6000602084013e6137a4565b606091505b5080516137c35760405162461bcd60e51b815260040161095c9061492e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612658565b506001949350505050565b6137fa8383613a03565b61380760008484846136e3565b610c9b5760405162461bcd60e51b815260040161095c9061492e565b60006001600160e01b03198216637520567560e01b148061385457506001600160e01b0319821663d5298fa360e01b145b80610a0e57506301ffc9a760e01b6001600160e01b0319831614610a0e565b6000600161388084611f1f565b61388a9190614b3e565b6000838152600d60205260409020549091508082146138dd576001600160a01b0384166000908152600c602090815260408083208584528252808320548484528184208190558352600d90915290208190555b506000918252600d602090815260408084208490556001600160a01b039094168352600c81528383209183525290812055565b600e5460009061392290600190614b3e565b6000838152600f6020526040812054600e805493945090928490811061394a5761394a614c27565b9060005260206000200154905080600e838154811061396b5761396b614c27565b6000918252602080832090910192909255828152600f9091526040808220849055858252812055600e8054806139a3576139a3614c11565b6001900381819060005260206000200160009055905550505050565b60006139ca83611f1f565b6001600160a01b039093166000908152600c602090815260408083208684528252808320859055938252600d9052919091209190915550565b6001600160a01b038216613a595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161095c565b613a6281612cec565b15613aae5760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604482015260640161095c565b613aba6000838361362b565b6001600160a01b0382166000908152600960205260408120805460019290613ae3908490614af3565b909155505060008181526008602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b828054613b4d90614b81565b90600052602060002090601f016020900481019282613b6f5760008555613bb5565b82601f10613b885782800160ff19823516178555613bb5565b82800160010185558215613bb5579182015b82811115613bb5578235825591602001919060010190613b9a565b50613bc1929150613c81565b5090565b60405180608001604052806004905b6060815260200190600190039081613bd45790505090565b5080546000825560030290600052602060002090810190612aeb9190613c96565b828054613c1990614b81565b90600052602060002090601f016020900481019282613c3b5760008555613bb5565b82601f10613c5457805160ff1916838001178555613bb5565b82800160010185558215613bb5579182015b82811115613bb5578251825591602001919060010190613c66565b5b80821115613bc15760008155600101613c82565b5b80821115613bc15780546001600160a01b03199081168255600182018054909116905560006002820155600301613c97565b6000613cdc613cd784614acc565b614a9c565b9050828152838383011115613cf057600080fd5b828260208301376000602084830101529392505050565b60008083601f840112613d1957600080fd5b5081356001600160401b03811115613d3057600080fd5b6020830191508360208260051b8501011115613d4b57600080fd5b9250929050565b600082601f830112613d6357600080fd5b612e7983833560208501613cc9565b600060208284031215613d8457600080fd5b8135612e7981614c53565b600060208284031215613da157600080fd5b8151612e7981614c53565b60008060408385031215613dbf57600080fd5b8235613dca81614c53565b91506020830135613dda81614c53565b809150509250929050565b600080600060608486031215613dfa57600080fd5b8335613e0581614c53565b92506020840135613e1581614c53565b929592945050506040919091013590565b60008060008060808587031215613e3c57600080fd5b8435613e4781614c53565b93506020850135613e5781614c53565b92506040850135915060608501356001600160401b03811115613e7957600080fd5b613e8587828801613d52565b91505092959194509250565b60008060408385031215613ea457600080fd5b8235613eaf81614c53565b91506020830135613dda81614c68565b60008060408385031215613ed257600080fd5b8235613edd81614c53565b946020939093013593505050565b600060208284031215613efd57600080fd5b8151612e7981614c68565b600060208284031215613f1a57600080fd5b8135612e7981614c76565b600060208284031215613f3757600080fd5b8151612e7981614c76565b600060208284031215613f5457600080fd5b81356001600160401b03811115613f6a57600080fd5b8201601f81018413613f7b57600080fd5b61265884823560208401613cc9565b600060208284031215613f9c57600080fd5b81516001600160401b03811115613fb257600080fd5b8201601f81018413613fc357600080fd5b8051613fd1613cd782614acc565b818152856020838501011115613fe657600080fd5b613ff7826020830160208601614b55565b95945050505050565b60006020828403121561401257600080fd5b5035919050565b60008060006060848603121561402e57600080fd5b833592506020840135613e1581614c53565b60008060006040848603121561405557600080fd5b8335925060208401356001600160401b0381111561407257600080fd5b61407e86828701613d07565b9497909650939450505050565b60008060008060008060006080888a0312156140a657600080fd5b8735965060208801356001600160401b03808211156140c457600080fd5b6140d08b838c01613d07565b909850965060408a01359150808211156140e957600080fd5b6140f58b838c01613d07565b909650945060608a013591508082111561410e57600080fd5b5061411b8a828b01613d07565b989b979a50959850939692959293505050565b6000806040838503121561414157600080fd5b50508035926020909101359150565b600080600080600060a0868803121561416857600080fd5b85359450602086013593506040860135925060608601356001600160401b0381111561419357600080fd5b61419f88828901613d52565b92505060808601356141b081614c68565b809150509295509295909350565b600081518084526141d6816020860160208601614b55565b601f01601f19169290920160200192915050565b600081516141fc818560208601614b55565b9290920192915050565b60006001600160fb1b0383111561421c57600080fd5b8260051b80858437600092019182525092915050565b60008351614244818460208801614b55565b835190830190614258818360208801614b55565b01949350505050565b60008251614273818460208701614b55565b600b60fa1b920191825250600101919050565b60008351614298818460208801614b55565b600b60fa1b90830190815283516142b6816001840160208801614b55565b01600101949350505050565b600084516142d4818460208901614b55565b6e3d913a3930b4ba2fba3cb832911d1160891b908301908152845161430081600f840160208901614b55565b6a1116113b30b63ab2911d1160a91b600f9290910191820152835161432c81601a840160208801614b55565b61227d60f01b601a9290910191820152601c0195945050505050565b6000855161435a818460208a01614b55565b85519083019061436e818360208a01614b55565b8551910190614381818360208901614b55565b8451910190614394818360208801614b55565b019695505050505050565b600082516143b1818460208701614b55565b7f2c7b2274726169745f74797065223a2253594e544845544943222c2276616c759201918252506965223a2274727565227d60b01b6020820152602a01919050565b737b226e616d65223a20224d657461636f7265202360601b81528351600090614423816014850160208901614b55565b7f222c20226465736372697074696f6e223a20224d657461436f726520697320616014918401918201527f6e206964656e746974792073797374656d2077686963682063616e206d616b6560348201527f20616c6c206d657461766572736520636974697a656e73206a6f696e20696e7460548201527f6f20646966666572656e74206d657461766572736573206279207573696e672060748201527f73616d65204d657461436f7265204964656e746974792e20546865206669727360948201527f74206d6f64756c6172204e46542077697468204d657461436f7265206174206960b48201527f747320636f72652c20776974682061726269747261727920617474726962757460d48201527f6573206164646974696f6e20616e642072656d6f76616c2c20667265656c792060f48201527f636f6d62696e6520616e6420646976696465206561636820636f6d706f6e656e6101148201527f74732e20416c7265616479206164617074656420746f206d756c7469706c65206101348201527f6d657461766572736520626c6f636b636861696e2067616d65732e20465554556101548201527f524520495320434f4d4d494e47222c2022696d616765223a2022646174613a69610174820152731b5859d94bdcdd99cade1b5b0ed8985cd94d8d0b60621b61019482015261465861464a6146446146286101a88501896141ea565b6f222c2261747472696275746573223a5b60801b815260100190565b866141ea565b615d7d60f01b815260020190565b9695505050505050565b6e3d913a3930b4ba2fba3cb832911d1160891b8152825160009061468d81600f850160208801614b55565b6a1116113b30b63ab2911d1160a91b600f9184019182015283516146b881601a840160208801614b55565b61227d60f01b601a9290910191820152601c01949350505050565b694d657461636f7265202360b01b8152600082516146f881600a850160208701614b55565b7f3c2f746578743e3c7465787420783d2231302220793d2234302220636c617373600a939091019283015250671e913130b9b2911f60c11b602a820152603201919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161477581601d850160208701614b55565b91909101601d0192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614658908301846141be565b602080825282518282018190526000919060409081850190868401855b8281101561483157815180516001600160a01b03908116865287820151168786015285015185850152606090930192908501906001016147f6565b5091979650505050505050565b6020808252825182820181905260009190848201906040850190845b818110156148765783518352928401929184019160010161485a565b50909695505050505050565b602081526000612e7960208301846141be565b84815260208101849052606060408201819052810182905260006001600160fb1b038311156148c357600080fd5b8260051b808560808501376000920160800191825250949350505050565b6080815260006148f460808301876141be565b828103602084015261490681876141be565b9050828103604084015261491a81866141be565b915050821515606083015295945050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526030908201527f4d657461636f72653a2063616c6c6572206973206e6f7420746f6b656e206f7760408201526f1b995c881b9bdc88185c1c1c9bdd995960821b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000808335601e19843603018112614a6d57600080fd5b8301803591506001600160401b03821115614a8757600080fd5b602001915036819003821315613d4b57600080fd5b604051601f8201601f191681016001600160401b0381118282101715614ac457614ac4614c3d565b604052919050565b60006001600160401b03821115614ae557614ae5614c3d565b50601f01601f191660200190565b60008219821115614b0657614b06614be5565b500190565b600082614b1a57614b1a614bfb565b500490565b6000816000190483118215151615614b3957614b39614be5565b500290565b600082821015614b5057614b50614be5565b500390565b60005b83811015614b70578181015183820152602001614b58565b83811115610dea5750506000910152565b600181811c90821680614b9557607f821691505b6020821081141561266057634e487b7160e01b600052602260045260246000fd5b6000600019821415614bca57614bca614be5565b5060010190565b600082614be057614be0614bfb565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612aeb57600080fd5b8015158114612aeb57600080fd5b6001600160e01b031981168114612aeb57600080fdfe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e3c7465787420783d2231302220793d2232302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220fefcd729082980f3dc998dae29e87999b33b31fd05192084b8338e771b0600b964736f6c63430008070033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.