Contract 0xDD5A649fC076886Dfd4b9Ad6aCFC9B5eb882e83c 6

 
Txn Hash
Method
Block
From
To
Value
0x9542b8dbdbbc9b52ea7375cc04ac26180e93645b7d91a42180bcb6fc5ad6073b0x8df9da46152549142022-08-01 6:08:5010 days 6 hrs ago0x243350c0192adfee327fd836c55d48defbb7967c IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00048054 5.‍12257086
0x6d5a972ee7ab76371f98b5e979bbe0cd04a9f8c80db877ba59d17eea0b9a67780x8df9da46151373882022-07-13 23:59:5928 days 12 hrs ago0x1496fc458e4f5497842942b2c17e6ea3a8534dc7 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍0007831210
0xc5866b4b455535a0d2134b0aebabe5f8d390dc4412c857c65ffdcc89f0df741eTransfer149003442022-06-04 1:01:5468 days 11 hrs ago0xc4b8fe4ee7d45548ce04bd3855c0e76553c88530 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍05 Ether0.‍00203799 40.‍57981194
0x6a904595f39b54a1045087bd41fbcb20cd088ed7239973e75a74921c03c9315c0x8df9da46148656852022-05-29 9:23:2274 days 3 hrs ago0xbd25138c4e5c11c1760ea9eb2fed9dd4cd0c035b IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00075056 8
0x3b27c332fc15cce2db776cddc81c52a92bdf72f23ff022e8a17dc1e7717ff9770x8df9da46148632062022-05-28 23:44:3874 days 12 hrs ago0x9374884fbbef1430b03f5361cbfd8564444fd282 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00084438 9
0xa8353de762f1fae8cc077f3c7bbbcfe2a28effdb89065a9baa96200b324524f60x8df9da46148543012022-05-27 13:04:3075 days 23 hrs ago0x1cd51bc3f024883cbd61be859a95681ed0e186b4 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00200623 72.‍10964877
0x16b01e099a187c715261fbf954685376428d18eeb04f6f344c717e3b204af546Transfer148454332022-05-26 2:36:1477 days 9 hrs ago0xa163063411d26023325fbdc87bd86aff89e87e4d IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c3.‍77609199 Ether0.‍0014301 28.‍47564771
0xbb7824a5ef1649b99f1936c43ef0716d86d648651d549eb13a5430268d74a15eTransfer148315872022-05-23 20:18:5079 days 16 hrs ago0x36d54d09632317ceb96a95d4d0600301eea2f723 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍05 Ether0.‍00137456 27.‍36980437
0x651e194955f28671acfb6aac8280a5f55f0811dab95a86be1a9ad107e5cee638Transfer148211222022-05-22 3:26:3181 days 8 hrs agoENS Name *нахуй.eth IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00036822 10
0x106288323f63cfc92e13735c16f07b9c9639d2d26cefaabc59806bdaef8b574bTransfer148131872022-05-20 20:38:2582 days 15 hrs agoENS Name seenzheng.eth IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c1 Ether0.‍00139745 27.‍82563367
0xe598a61f41a6eab50c686288b2445b6a46d93c41b68f40b7a873e589ff6f0c92Transfer147940222022-05-17 18:03:5785 days 18 hrs ago0x71decba42afda28b3e26d867fade4d88d814ad45 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00743804202
0x4f84858440172ad5832c9c6069975047d29c5d2fe53840debd21ee221a6281cfTransfer147868272022-05-16 14:46:2786 days 21 hrs ago0x3bbeddd69b637a37ab02fc6c7590af893f8839e7 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍04 Ether0.‍00286305 57.‍00800391
0xf9b7f01fed4029e8cde00b4487d808d078172c90c1897e2227794c45c25e6d4a0x8df9da46147453542022-05-10 0:01:3193 days 12 hrs ago0x903360276937285f8ed03e574226f38ecdb5a6a7 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00724144 183.‍34160869
0xf89efc054a3bdad2af874b56234a168991d33f1dadeb10887861d0802bc58672Transfer147257082022-05-06 20:45:5596 days 15 hrs ago0x5491ff4696fb0b5fe5b2ddc12c9feade724c7fe6 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍015 Ether0.‍00156001 31.‍06230009
0x0c6f5d70af3030c9f8ccbac643c667b49291697a1a7aa5dde9a93016c3c9c0d1Transfer147123862022-05-04 17:57:1498 days 18 hrs ago0xfc75be758c30c6868784334310e808a236912bc4 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍05 Ether0.‍00303943 60.‍52008634
0x57ca6ae5fd18c74af514aea8511fedb301efbe8cef896841a2b98235a44f3cc1Transfer147115912022-05-04 14:52:0598 days 21 hrs ago0x00629785bfb05f524b37d6dda2348a4801fc1615 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00108743 51.‍78279941
0x2fa6bbcb214d531ae03cae39223b4d6a88b2431efbb93a33206dcf07072f32e4Transfer146888892022-05-01 1:03:42102 days 11 hrs ago0x10a298328fc1ef41c529a52cab9fb3794b325d9f IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍1 Ether0.‍401776 8,000
0xa1978cdf58f9205000d3dd3c8095c8382b8921d9c2bbd4c2e0b71ec003dff7c4Transfer146738942022-04-28 16:27:25104 days 19 hrs ago0x5f1dde23eafafa3d6102254a69b07b07b10b6b41 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍07 Ether0.‍00323433 64.‍4006986
0x962f8abdb7629053a9d07a104f32f2cf284c4144537d83f02dc01d4f5b0ff7c10x8df9da46146734202022-04-28 14:38:05104 days 21 hrs ago0xa44d9a4e562abc2ea8e6dab04a4849ef3be96ea1 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00237168 60.‍04728001
0x7a4427c7b73b8c91de10530d7810bb64d347792139c42a0abc2fc89473a1e24d0x8df9da46146734202022-04-28 14:38:05104 days 21 hrs ago0xa44d9a4e562abc2ea8e6dab04a4849ef3be96ea1 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00237168 60.‍04728001
0xc5c890f1ad1ed60a63f601e9d24461c1874eb8b827a64c11f2d02dbc1c8fa7c5Transfer146595872022-04-26 10:19:57107 days 2 hrs ago0xf56b5d8e3a553633c0d801ba279f7ee711943aa9 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0.‍015 Ether0.‍00164401 32.‍73505483
0x48303117d5ab3dec971a10f68ad25ac72f5b7405bf4391f7036f30663f6609be0x8df9da46146543902022-04-25 14:43:28107 days 21 hrs ago0xca4073ce6451f291daba55cc4eaf58d2c0166655 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍0028263 51.‍17059531
0x1de5f8b66ab4c200b2da95fc8872556c92cf0df96e995922550b875d222ca6c1Transfer146515962022-04-25 4:06:00108 days 8 hrs ago0xaabbc33be7564f7fc4784ad57a3e02e3d5f10550 IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00157057 42.‍65308741
0xa884d7d94f134d223b07b201a572c1b90bfd623691d6610de7028730fb3756930x8df9da46146481412022-04-24 15:08:11108 days 21 hrs agoENS Name hyn007.eth IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0 Ether0.‍00248313 44.‍95744878
0x794a870d581f5ea01332c28327263955711d29b8367e13fd98a0bc7247e6bd49Transfer146477562022-04-24 13:34:37108 days 22 hrs ago0x68eee8a87928dc4894d2cf970ef9b79146ba387f IN  0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c1.‍2 Ether0.‍00174045 34.‍6551621
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xc5866b4b455535a0d2134b0aebabe5f8d390dc4412c857c65ffdcc89f0df741e149003442022-06-04 1:01:5468 days 11 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍045 Ether
0xc5866b4b455535a0d2134b0aebabe5f8d390dc4412c857c65ffdcc89f0df741e149003442022-06-04 1:01:5468 days 11 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍005 Ether
0x16b01e099a187c715261fbf954685376428d18eeb04f6f344c717e3b204af546148454332022-05-26 2:36:1477 days 9 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d73.‍39848279 Ether
0x16b01e099a187c715261fbf954685376428d18eeb04f6f344c717e3b204af546148454332022-05-26 2:36:1477 days 9 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍37760919 Ether
0xbb7824a5ef1649b99f1936c43ef0716d86d648651d549eb13a5430268d74a15e148315872022-05-23 20:18:5079 days 16 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍045 Ether
0xbb7824a5ef1649b99f1936c43ef0716d86d648651d549eb13a5430268d74a15e148315872022-05-23 20:18:5079 days 16 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍005 Ether
0x106288323f63cfc92e13735c16f07b9c9639d2d26cefaabc59806bdaef8b574b148131872022-05-20 20:38:2582 days 15 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍9 Ether
0x106288323f63cfc92e13735c16f07b9c9639d2d26cefaabc59806bdaef8b574b148131872022-05-20 20:38:2582 days 15 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍1 Ether
0x4f84858440172ad5832c9c6069975047d29c5d2fe53840debd21ee221a6281cf147868272022-05-16 14:46:2786 days 21 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍036 Ether
0x4f84858440172ad5832c9c6069975047d29c5d2fe53840debd21ee221a6281cf147868272022-05-16 14:46:2786 days 21 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍004 Ether
0xf89efc054a3bdad2af874b56234a168991d33f1dadeb10887861d0802bc58672147257082022-05-06 20:45:5596 days 15 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍0135 Ether
0xf89efc054a3bdad2af874b56234a168991d33f1dadeb10887861d0802bc58672147257082022-05-06 20:45:5596 days 15 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍0015 Ether
0x0c6f5d70af3030c9f8ccbac643c667b49291697a1a7aa5dde9a93016c3c9c0d1147123862022-05-04 17:57:1498 days 18 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍045 Ether
0x0c6f5d70af3030c9f8ccbac643c667b49291697a1a7aa5dde9a93016c3c9c0d1147123862022-05-04 17:57:1498 days 18 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍005 Ether
0x2fa6bbcb214d531ae03cae39223b4d6a88b2431efbb93a33206dcf07072f32e4146888892022-05-01 1:03:42102 days 11 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍09 Ether
0x2fa6bbcb214d531ae03cae39223b4d6a88b2431efbb93a33206dcf07072f32e4146888892022-05-01 1:03:42102 days 11 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍01 Ether
0xa1978cdf58f9205000d3dd3c8095c8382b8921d9c2bbd4c2e0b71ec003dff7c4146738942022-04-28 16:27:25104 days 19 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍063 Ether
0xa1978cdf58f9205000d3dd3c8095c8382b8921d9c2bbd4c2e0b71ec003dff7c4146738942022-04-28 16:27:25104 days 19 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍007 Ether
0xc5c890f1ad1ed60a63f601e9d24461c1874eb8b827a64c11f2d02dbc1c8fa7c5146595872022-04-26 10:19:57107 days 2 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍0135 Ether
0xc5c890f1ad1ed60a63f601e9d24461c1874eb8b827a64c11f2d02dbc1c8fa7c5146595872022-04-26 10:19:57107 days 2 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍0015 Ether
0x794a870d581f5ea01332c28327263955711d29b8367e13fd98a0bc7247e6bd49146477562022-04-24 13:34:37108 days 22 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d71.‍08 Ether
0x794a870d581f5ea01332c28327263955711d29b8367e13fd98a0bc7247e6bd49146477562022-04-24 13:34:37108 days 22 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍12 Ether
0x4585e72ea6f49dba95ee68d64ccd49e0daaad4b5a48da55226dd07b94edd6933146330602022-04-22 6:26:26111 days 5 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍72 Ether
0x4585e72ea6f49dba95ee68d64ccd49e0daaad4b5a48da55226dd07b94edd6933146330602022-04-22 6:26:26111 days 5 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍08 Ether
0x32b90f300d285e57df646dc06be2a132b1b11712d3e0c639a2affa1f44a8c419146236312022-04-20 18:55:47112 days 17 hrs ago 0xdd5a649fc076886dfd4b9ad6acfc9b5eb882e83c0x669f499e7ba51836bb76f7dd2bc3c1a37a5342d70.‍0009 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
The_Association_Sales

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 26 : The_Association_Sales.sol
pragma solidity ^0.8.7;
// SPDX-Licence-Identifier: GPL-3.0-or-later

/*

kkkkkkkOK0kkOXN0kkOXKkkkkkk0WMMM0kXMMMW0kkkkOXMMMNOdoodkXMWWKxoood0WMMMNOkkkk0NMMMW0doookXMWKkkkKMMN0kkkkONXkkkkkkkOK0kkOXMW0xoooxKWMXkkkOXMKkkONXkxkk
........l:...x0;..,Oo......:XMWX:,0MWMK;.....xMM0:.    .,ONx'.    .lXNd,......;kWXl.    .,kNl...oWM0,....'ko........c:...kXl.    .'xNd....dWo..'OKdl;.
;.   .':o,  .x0'  .kl   .,,oN0c'.'kNMMk.     cWNc   ',   :x'  .:.  .xd.  .,'.  '0d   ';.  ,0l   lWMd.     lx;.    ':o,  .xd.  .:.  'Oo    ;Xo  .kW0ocd
Wx.  '0WK,  .x0'  .kl   cNWWK;   .,kMWo   .  ,KX;   dO;..cl.  ;Kd..'dc   lKk;  .xc   oK,  .kl   lWWc  ..  :XMx.  ,0WK,  .xl   lX;  .xo    .xo  .kk..lx
Mk.  '0MK;   ok.  .kl   :KKXO'  .dllNX;  ',  .kX;   c00KXNx.  .x0KXNXc   oXO;  .dc   oNOxxkKc   lWK,  ,,  '0Mk.  ,KMK,  .xl   lX:  .dl     cc  .kO:;;;
Mk.  '0MK,   ..   .kl    ..l0:   ,;.oO'  :l   dWo    ..,lK0,    .':kXc   oXO;  .d:   oMMMMMWc   lWO.  cc  .xMk.  ,KMK,  .xl   lX:  .dl   . .,  .kKo;,,
Mk.  '0MK,   ..   .kl   .''lX0,  .;:xd.  ox.  cNNxc,'.   :X0o;,.   .xc   oXO;  .d:   oMMMMMNc   lWd   dd   lWk.  ,KMK,  .xl   lX:  .dl  .;.    .kMWdc:
Mk.  '0MK,  .oO'  .kl   cXNWWMXo. lNWl   .'   ,0NXXXXd.  'ONXXXK;   c:   lXO;  .dc   oNkooxKc   lNc   ..   ;Xk.  ,KMK,  .xl   lX:  .dl  .o,    .kMWOxo
Mk.  '0MK,  .x0'  .kl   cXNWMMMWKl;kX;        .xo..'kk.  ,o;..lKc   lc   oKk;  .xc   o0,  .kl   l0,        .Ok.  ,KMK,  .xl   lK;  .xo  .kl    .OWNNXc
Mk.  '0MK;  .x0'  .kl   ..'lNMMMMWdxO.  .dk,   ol   .'   :k'  .,.  .xo   ':,.  'Od   .,.  ,0l   lk.  'xx'   dk.  ,KMK,  .xx.  .,.  'Oo  .kO.   .kKdol.
MO,..:KMXc..'kK:..;Od......cXMMMMM0kx,..cXWo...o0o'.....:0Wk;.....'dNKc.      'xNXo'.....;ONo...od'..lNNl...dO,..cXMXc..,kNd'.....,kWd..,ONl...;0WWWNl
MNK00KWMWX00KNWK00KWN000000XWMMMMMWWNKK0XWMN000XWWXOxkkKWMMMN0kxkOXWMMN0dllooxKWWMMXOkkk0NMWX000XX000XMMX000XNK00XWMWX00KNMMXOkkk0NMMNK0KNWX000KNMMMWX

*/

/// @author: galaxis.xyz - The platform for decentralized communities.

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/IERC1820Registry.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777.sol";

import "./ssp/community_interface.sol";
import "./ssp/sale_configuration.sol";
import "./ssp/recovery.sol";
import "./ssp/IRNG.sol";
import "./ssp/dusty.sol";
import "./ssp/card_with_card.sol";
import "./ssp/token_interface.sol";

struct sale_data {
    uint256 maxTokens;
    uint256 mintPosition;
    address[] wallets;
    uint16[] shares;
    uint256 fullPrice;
    uint256 discountPrice;
    uint256 presaleStart;
    uint256 presaleEnd;
    uint256 saleStart;
    uint256 saleEnd;
    uint256 dustPrice;
    bool areTokensLocked;
    uint256 maxFreeEC;
    uint256 totalFreeEC;
    uint256 maxDiscount;
    uint256 totalDiscount;
    uint256 freePerAddress;
    uint256 discountedPerAddress;
    string tokenPreRevealURI;
    address signer;
    bool presaleIsActive;
    bool saleIsActive;
    bool dustMintingActive;
    uint256 freeClaimedByThisUser;
    uint256 discountedClaimedByThisUser;
    address etherCards;
    address DUST;
    address ecVault;
    uint256 maxPerSaleMint;
    uint256 MaxUserMintable;
    uint256 userMinted;
    bool randomReceived;
    bool secondReceived;
    uint256 randomCL;
    uint256 randomCL2;
    uint256 ts1;
    uint256 ts;
}

struct sale_params {
    uint256 projectID;
    token_interface token;
    IERC721 ec;
    address dust;
    uint256 maxTokens;
    uint256 maxDiscount; //<--- max sold in presale across presale dust / eth
    uint256 maxPerSaleMint;
    uint256 clientMintLimit;
    uint256 ecMintLimit;
    uint256 discountedPerAddress; //<-- should apply to all presale
    uint256 freeForEC; //<-- for EC card holders
    uint256 discountPrice; //<-- for EC card holders - if zero not available should have *** dust ***
    uint256 discountDustPrice; //<-- for EC card holders - if zero not available should have *** dust ***
    uint256 fullPrice;
    address signer;
    uint256 saleStart;
    uint256 saleEnd;
    uint256 presaleStart;
    uint256 presaleEnd;
    uint256 fullDustPrice;
    address[] wallets;
    uint16[] shares;
}

// check approval limit - start / end of presale

contract The_Association_Sales is
    sale_configuration,
    Ownable,
    recovery,
    ReentrancyGuard,
    dusty,
    card_with_card
{
    using SafeMath for uint256;
    using Strings for uint256;

    uint256 public immutable projectID;
    token_interface public _token;

    uint256 immutable _MaxUserMintable;
    uint256 _userMinted;

    uint256 _ts1;
    uint256 _ts2;

    address private immutable _DUST;
    IERC721 private immutable _EC;

    uint16 public batchNumber;

    mapping(address => uint256) _freeClaimedPerWallet;
    mapping(address => uint256) _discountedClaimedPerWallet;

    event RandomProcessed(
        uint256 stage,
        uint256 randUsed_,
        uint256 _start,
        uint256 _stop,
        uint256 _supply
    );
    event batchWhitelistMint(uint16 indexed batchNumber, address receiver);
    event ETHPresale(address from, uint256 number_of_items, uint256 price);
    event ETHSale(address buyer, uint256 number_to_buy, uint256 ethAmount);
    event Allowed(address, bool);

    modifier onlyAllowed() {
        require(
            _token.permitted(msg.sender) || (msg.sender == owner()),
            "Unauthorised"
        );
        _;
    }

    // the constructor takes the bare minimum to conduct a presale and sale.

    constructor(sale_params memory sp)
        dusty(
            sp.dust,
            sp.signer,
            sp.fullDustPrice,
            sp.discountDustPrice,
            sp.maxPerSaleMint,
            sp.wallets,
            sp.shares
        )
        card_with_card(sp.signer)
    {
        projectID = sp.projectID;
        _EC = sp.ec;
        _token = sp.token;
        _DUST = sp.dust;
        _MaxUserMintable = sp.maxTokens - (sp.clientMintLimit + sp.ecMintLimit);

        _maxSupply = sp.maxTokens;
        _maxDiscount = sp.maxDiscount;

        _discountedPerAddress = sp.discountedPerAddress;
        _discountPrice = sp.discountPrice;
        _fullPrice = sp.fullPrice;

        _saleStart = sp.saleStart;
        _saleEnd = sp.saleEnd;

        _presaleStart = sp.presaleStart;
        _presaleEnd = sp.presaleEnd;

        _maxFreeEC = sp.freeForEC;
    }

    function _split(uint256 amount) internal {
        //  console.log("num wallets",wallets.length);
        bool sent;
        uint256 _total;
        for (uint256 j = 0; j < wallets.length; j++) {
            uint256 _amount = (amount * shares[j]) / 1000;
            if (j == wallets.length - 1) {
                _amount = amount - _total;
            } else {
                _total += _amount;
            }
            (sent, ) = wallets[j].call{value: _amount}(""); // don't use send or xfer (gas)
            require(sent, "Failed to send Ether");
        }
    }

    function setup(uint16 _batchNumber) external onlyAllowed {
        batchNumber = _batchNumber;
    }

    function checkDiscountAvailable(address buyer)
        public
        view
        returns (
            bool[3] memory,
            bool,
            uint256,
            uint256,
            uint256
        )
    {
        bool _final = false;

        return (
            [false, false, true],
            _final, // _final,
            _discountedClaimedPerWallet[buyer], // EC
            presold[buyer], // Not in use.
            _token.availableToMint()
        );
    }

    function mint_approved(
        vData memory info,
        uint256 number_of_items_requested,
        uint16 _batchNumber
    ) external {
        require(batchNumber == _batchNumber, "!batch");
        address from = msg.sender;
        require(verify(info), "Unauthorised access secret");
        _discountedClaimedPerWallet[msg.sender] += 1;
        require(
            _discountedClaimedPerWallet[msg.sender] <= 1,
            "Number exceeds max discounted per address"
        );
        presold[from] = 1;
        _mintCards(number_of_items_requested, from);
        emit batchWhitelistMint(_batchNumber, msg.sender);
    }

    // make sure this respects ec_limit and client_limit
    function mint(uint256 numberOfCards) external {
        _discountedClaimedPerWallet[msg.sender] += numberOfCards;
        require(
            _discountedClaimedPerWallet[msg.sender] <= maxPerSaleMint,
            "Number exceeds max discounted per address"
        );
        require(checkSaleIsActive(), "sale is not open");
        require(
            numberOfCards <= maxPerSaleMint,
            "Exceeds max per Transaction Mint"
        );
        _mintPayable(numberOfCards, msg.sender, _fullPrice);
    }

    function _mintPayable(
        uint256 numberOfCards,
        address recipient,
        uint256 price
    ) internal override {
        _mintCards(numberOfCards, recipient);
    }

    function _mintCards(uint256 numberOfCards, address recipient)
        internal
        override(dusty, card_with_card)
    {
        _userMinted += numberOfCards;
        require(
            _userMinted <= _MaxUserMintable,
            "This exceeds maximum number of user mintable cards"
        );
        _token.mintCards(numberOfCards, recipient);
    }

    function _mintDiscountCards(uint256 numberOfCards, address recipient)
        internal
        override(dusty, card_with_card)
    {
        _totalDiscount += numberOfCards;
        require(
            _maxDiscount >= _totalDiscount,
            "Too many discount tokens claimed"
        );
        _mintCards(numberOfCards, recipient);
    }

    function _mintDiscountPayable(
        uint256 numberOfCards,
        address recipient,
        uint256 price
    ) internal override(card_with_card) {
        require(msg.value == numberOfCards.mul(price), "wrong amount sent");
        _mintDiscountCards(numberOfCards, recipient);
        // _split(msg.value);
    }

    function setSaleDates(uint256 _start, uint256 _end) external onlyAllowed {
        _saleStart = _start;
        _saleEnd = _end;
    }

    function setPresaleDates(uint256 _start, uint256 _end)
        external
        onlyAllowed
    {
        _presaleStart = _start;
        _presaleEnd = _end;
    }

    function setMaxPerSaleMint(uint256 _maxPerSaleMint) external onlyOwner {
        maxPerSaleMint = _maxPerSaleMint;
    }

    function checkSaleIsActive() public view override returns (bool) {
        if ((_saleStart <= block.timestamp) && (_saleEnd >= block.timestamp))
            return true;
        return false;
    }

    function checkPresaleIsActive() public view override returns (bool) {
        if (
            (_presaleStart <= block.timestamp) &&
            (_presaleEnd >= block.timestamp)
        ) return true;
        return false;
    }

    function setWallets(
        address payable[] memory _wallets,
        uint16[] memory _shares
    ) public onlyOwner {
        require(_wallets.length == _shares.length, "!l");
        wallets = _wallets;
        shares = _shares;
    }

    receive() external payable {
        _split(msg.value);
    }

    function tellEverything(address addr)
        external
        view
        returns (sale_data memory)
    {
        // if community module active - get the community.taken[msg.sender]

        token_interface.TKS memory tokenData = _token.tellEverything();
        return
            sale_data(
                _maxSupply,
                tokenData._mintPosition,
                wallets,
                shares,
                _fullPrice,
                _discountPrice,
                _presaleStart,
                _presaleEnd,
                _saleStart,
                _saleEnd,
                _dustPrice,
                tokenData._lockTillSaleEnd,
                _maxFreeEC,
                _totalFreeEC,
                _maxDiscount,
                _totalDiscount,
                _freePerAddress,
                _discountedPerAddress,
                _token.tokenPreRevealURI(),
                _signer,
                checkPresaleIsActive(),
                checkSaleIsActive(),
                checkSaleIsActive() &&
                    (fullDustPrice > 0 || discountDustPrice > 0),
                _freeClaimedPerWallet[addr],
                _discountedClaimedPerWallet[addr],
                address(_EC),
                _DUST,
                _ecVault,
                maxPerSaleMint,
                _MaxUserMintable,
                _userMinted,
                tokenData._randomReceived,
                tokenData._secondReceived,
                tokenData._randomCL,
                tokenData._randomCL2,
                tokenData._ts1,
                tokenData._ts2
            );
    }
}

File 2 of 26 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

    /**
     * @dev 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 3 of 26 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

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 4 of 26 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 5 of 26 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

File 6 of 26 : IERC1820Registry.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC1820Registry.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the global ERC1820 Registry, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register
 * implementers for interfaces in this registry, as well as query support.
 *
 * Implementers may be shared by multiple accounts, and can also implement more
 * than a single interface for each account. Contracts can implement interfaces
 * for themselves, but externally-owned accounts (EOA) must delegate this to a
 * contract.
 *
 * {IERC165} interfaces can also be queried via the registry.
 *
 * For an in-depth explanation and source code analysis, see the EIP text.
 */
interface IERC1820Registry {
    /**
     * @dev Sets `newManager` as the manager for `account`. A manager of an
     * account is able to set interface implementers for it.
     *
     * By default, each account is its own manager. Passing a value of `0x0` in
     * `newManager` will reset the manager to this initial state.
     *
     * Emits a {ManagerChanged} event.
     *
     * Requirements:
     *
     * - the caller must be the current manager for `account`.
     */
    function setManager(address account, address newManager) external;

    /**
     * @dev Returns the manager for `account`.
     *
     * See {setManager}.
     */
    function getManager(address account) external view returns (address);

    /**
     * @dev Sets the `implementer` contract as ``account``'s implementer for
     * `interfaceHash`.
     *
     * `account` being the zero address is an alias for the caller's address.
     * The zero address can also be used in `implementer` to remove an old one.
     *
     * See {interfaceHash} to learn how these are created.
     *
     * Emits an {InterfaceImplementerSet} event.
     *
     * Requirements:
     *
     * - the caller must be the current manager for `account`.
     * - `interfaceHash` must not be an {IERC165} interface id (i.e. it must not
     * end in 28 zeroes).
     * - `implementer` must implement {IERC1820Implementer} and return true when
     * queried for support, unless `implementer` is the caller. See
     * {IERC1820Implementer-canImplementInterfaceForAddress}.
     */
    function setInterfaceImplementer(
        address account,
        bytes32 _interfaceHash,
        address implementer
    ) external;

    /**
     * @dev Returns the implementer of `interfaceHash` for `account`. If no such
     * implementer is registered, returns the zero address.
     *
     * If `interfaceHash` is an {IERC165} interface id (i.e. it ends with 28
     * zeroes), `account` will be queried for support of it.
     *
     * `account` being the zero address is an alias for the caller's address.
     */
    function getInterfaceImplementer(address account, bytes32 _interfaceHash) external view returns (address);

    /**
     * @dev Returns the interface hash for an `interfaceName`, as defined in the
     * corresponding
     * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].
     */
    function interfaceHash(string calldata interfaceName) external pure returns (bytes32);

    /**
     * @notice Updates the cache with whether the contract implements an ERC165 interface or not.
     * @param account Address of the contract for which to update the cache.
     * @param interfaceId ERC165 interface for which to update the cache.
     */
    function updateERC165Cache(address account, bytes4 interfaceId) external;

    /**
     * @notice Checks whether a contract implements an ERC165 interface or not.
     * If the result is not cached a direct lookup on the contract address is performed.
     * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
     * {updateERC165Cache} with the contract address.
     * @param account Address of the contract to check.
     * @param interfaceId ERC165 interface to check.
     * @return True if `account` implements `interfaceId`, false otherwise.
     */
    function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);

    /**
     * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
     * @param account Address of the contract to check.
     * @param interfaceId ERC165 interface to check.
     * @return True if `account` implements `interfaceId`, false otherwise.
     */
    function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);

    event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);

    event ManagerChanged(address indexed account, address indexed newManager);
}

File 7 of 26 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

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 making 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 8 of 26 : IERC777Recipient.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC777/IERC777Recipient.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.
 *
 * Accounts can be notified of {IERC777} tokens being sent to them by having a
 * contract implement this interface (contract holders can be their own
 * implementer) and registering it on the
 * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
 *
 * See {IERC1820Registry} and {ERC1820Implementer}.
 */
interface IERC777Recipient {
    /**
     * @dev Called by an {IERC777} token contract whenever tokens are being
     * moved or created into a registered account (`to`). The type of operation
     * is conveyed by `from` being the zero address or not.
     *
     * This call occurs _after_ the token contract's state is updated, so
     * {IERC777-balanceOf}, etc., can be used to query the post-operation state.
     *
     * This function may revert to prevent the operation from being executed.
     */
    function tokensReceived(
        address operator,
        address from,
        address to,
        uint256 amount,
        bytes calldata userData,
        bytes calldata operatorData
    ) external;
}

File 9 of 26 : IERC777.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC777/IERC777.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC777Token standard as defined in the EIP.
 *
 * This contract uses the
 * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 registry standard] to let
 * token holders and recipients react to token movements by using setting implementers
 * for the associated interfaces in said registry. See {IERC1820Registry} and
 * {ERC1820Implementer}.
 */
interface IERC777 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the smallest part of the token that is not divisible. This
     * means all token operations (creation, movement and destruction) must have
     * amounts that are a multiple of this number.
     *
     * For most token contracts, this value will equal 1.
     */
    function granularity() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by an account (`owner`).
     */
    function balanceOf(address owner) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * If send or receive hooks are registered for the caller and `recipient`,
     * the corresponding functions will be called with `data` and empty
     * `operatorData`. See {IERC777Sender} and {IERC777Recipient}.
     *
     * Emits a {Sent} event.
     *
     * Requirements
     *
     * - the caller must have at least `amount` tokens.
     * - `recipient` cannot be the zero address.
     * - if `recipient` is a contract, it must implement the {IERC777Recipient}
     * interface.
     */
    function send(
        address recipient,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev Destroys `amount` tokens from the caller's account, reducing the
     * total supply.
     *
     * If a send hook is registered for the caller, the corresponding function
     * will be called with `data` and empty `operatorData`. See {IERC777Sender}.
     *
     * Emits a {Burned} event.
     *
     * Requirements
     *
     * - the caller must have at least `amount` tokens.
     */
    function burn(uint256 amount, bytes calldata data) external;

    /**
     * @dev Returns true if an account is an operator of `tokenHolder`.
     * Operators can send and burn tokens on behalf of their owners. All
     * accounts are their own operator.
     *
     * See {operatorSend} and {operatorBurn}.
     */
    function isOperatorFor(address operator, address tokenHolder) external view returns (bool);

    /**
     * @dev Make an account an operator of the caller.
     *
     * See {isOperatorFor}.
     *
     * Emits an {AuthorizedOperator} event.
     *
     * Requirements
     *
     * - `operator` cannot be calling address.
     */
    function authorizeOperator(address operator) external;

    /**
     * @dev Revoke an account's operator status for the caller.
     *
     * See {isOperatorFor} and {defaultOperators}.
     *
     * Emits a {RevokedOperator} event.
     *
     * Requirements
     *
     * - `operator` cannot be calling address.
     */
    function revokeOperator(address operator) external;

    /**
     * @dev Returns the list of default operators. These accounts are operators
     * for all token holders, even if {authorizeOperator} was never called on
     * them.
     *
     * This list is immutable, but individual holders may revoke these via
     * {revokeOperator}, in which case {isOperatorFor} will return false.
     */
    function defaultOperators() external view returns (address[] memory);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient`. The caller must
     * be an operator of `sender`.
     *
     * If send or receive hooks are registered for `sender` and `recipient`,
     * the corresponding functions will be called with `data` and
     * `operatorData`. See {IERC777Sender} and {IERC777Recipient}.
     *
     * Emits a {Sent} event.
     *
     * Requirements
     *
     * - `sender` cannot be the zero address.
     * - `sender` must have at least `amount` tokens.
     * - the caller must be an operator for `sender`.
     * - `recipient` cannot be the zero address.
     * - if `recipient` is a contract, it must implement the {IERC777Recipient}
     * interface.
     */
    function operatorSend(
        address sender,
        address recipient,
        uint256 amount,
        bytes calldata data,
        bytes calldata operatorData
    ) external;

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the total supply.
     * The caller must be an operator of `account`.
     *
     * If a send hook is registered for `account`, the corresponding function
     * will be called with `data` and `operatorData`. See {IERC777Sender}.
     *
     * Emits a {Burned} event.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     * - the caller must be an operator for `account`.
     */
    function operatorBurn(
        address account,
        uint256 amount,
        bytes calldata data,
        bytes calldata operatorData
    ) external;

    event Sent(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256 amount,
        bytes data,
        bytes operatorData
    );

    event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);

    event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);

    event AuthorizedOperator(address indexed operator, address indexed tokenHolder);

    event RevokedOperator(address indexed operator, address indexed tokenHolder);
}

File 10 of 26 : community_interface.sol
pragma solidity ^0.8.7;

interface community_interface {
    function community_claimed(address) external view returns (uint256);

    function communityPurchase(
        address recipient,
        uint256 tokenCount,
        bytes memory signature,
        uint256 role
    ) external payable;
}

File 11 of 26 : sale_configuration.sol
pragma solidity ^0.8.7;

contract sale_configuration {
    uint256 _maxSupply;
    uint256 _clientMintLimit;
    uint256 _ecMintLimit;
    uint256 _fullPrice;
    uint256 _discountPrice; // obsolete
    uint256 _communityPrice; // obsolete
    uint256 _presaleStart; // obsolete
    uint256 _presaleEnd; // obsolete
    uint256 _saleStart;
    uint256 _saleEnd;
    uint256 _dustPrice; // obsolete
    uint256 _discountedPerAddress; // obsolete
    uint256 _totalDiscount; // obsolete
    uint256 _maxDiscount; // obsolete
    uint256 _maxPerSaleMint;
    uint256 _freePerAddress;
    address _signer;

    uint256 _maxFreeEC; // obsolete
    uint256 _totalFreeEC; // obsolete
    uint256 _ecMintPosition;
    uint256 _clientMintPosition;
    address _ecVault;
}

File 12 of 26 : recovery.sol
pragma solidity ^0.8.7;
// SPDX-Licence-Identifier: RIGHT-CLICK-SAVE-ONLY

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract recovery is Ownable {
    // blackhole prevention methods
    function retrieveETH() external onlyOwner {
        (bool sent, ) =
            payable(msg.sender).call{value: address(this).balance}(""); // don't use send or xfer (gas)
        require(sent, "Failed to send Ether");
    }

    function retrieveERC20(address _tracker, uint256 amount)
        external
        onlyOwner
    {
        IERC20(_tracker).transfer(msg.sender, amount);
    }

    function retrieve721(address _tracker, uint256 id) external onlyOwner {
        IERC721(_tracker).transferFrom(address(this), msg.sender, id);
    }
}

File 13 of 26 : IRNG.sol
pragma solidity ^0.8.7;

interface IRNG {
    function requestRandomNumber() external returns (bytes32);

    function requestRandomNumberWithCallback() external returns (bytes32);

    function isRequestComplete(bytes32 requestId)
        external
        view
        returns (bool isCompleted);

    function randomNumber(bytes32 requestId)
        external
        view
        returns (uint256 randomNum);

    function setAuth(address user, bool grant) external;
}

File 14 of 26 : dusty.sol
pragma solidity ^0.8.7;
// SPDX-Licence-Identifier: RIGHT-CLICK-SAVE-ONLY

import "@openzeppelin/contracts/utils/introspection/IERC1820Registry.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777.sol";

//import "hardhat/console.sol";

abstract contract dusty is IERC777Recipient, ReentrancyGuard {
    // struct community_data {
    //     uint256 start;
    //     uint256 end;
    //     uint256 price;
    //     bool    isDust;
    //     uint256 max_purchase;
    //     address purchaser;
    // }

    address DUST_TOKEN;
    address signer;
    address[] wallets;
    uint16[] shares;
    uint256 fullDustPrice;
    uint256 discountDustPrice;
    uint256 maxPerSaleMint;

    mapping(address => uint256) presold;

    bytes32 private constant TOKENS_RECIPIENT_INTERFACE_HASH =
        keccak256("ERC777TokensRecipient");
    IERC1820Registry internal constant _ERC1820_REGISTRY =
        IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);

    event DustPresale(address from, uint256 number_of_items, uint256 price);
    event DustSale(address buyer, uint256 number_to_buy, uint256 dustAmount);

    constructor(
        address dust,
        address _signer,
        uint256 _fullDustPrice,
        uint256 _discountDustPrice,
        uint256 _maxPerSaleMint,
        address[] memory _wallets,
        uint16[] memory _shares
    ) {
        DUST_TOKEN = dust;
        _ERC1820_REGISTRY.setInterfaceImplementer(
            address(this),
            TOKENS_RECIPIENT_INTERFACE_HASH,
            address(this)
        );
        wallets = _wallets;
        shares = _shares;
        signer = _signer;
        fullDustPrice = _fullDustPrice;
        discountDustPrice = _discountDustPrice;
        maxPerSaleMint = _maxPerSaleMint;
    }

    // https://twitter.com/nicksdjohnson/status/1485769228481605639?s=20&t=22PZlf-8awaea2bubNw72A
    // ```
    // bytes4 selector = bytes4(data[:4]);
    // uint256 id = uint256(bytes32(data[4:36]));
    // ```

    struct vData {
        bool mint_free;
        uint256 max_mint;
        address from;
        uint256 start;
        uint256 end;
        uint256 eth_price;
        uint256 dust_price;
        bytes signature;
    }

    function checkSaleIsActive() public view virtual returns (bool);

    function checkPresaleIsActive() public view virtual returns (bool);

    function tokensReceived(
        address,
        address from,
        address,
        uint256 amount,
        bytes calldata userData,
        bytes calldata
    ) external override nonReentrant {}

    function _mintCards(uint256 numberOfCards, address recipient)
        internal
        virtual;

    function _mintDiscountCards(uint256 numberOfCards, address recipient)
        internal
        virtual;

    function verify(vData memory info) public view returns (bool) {
        require(info.from != address(0), "INVALID_SIGNER");
        bytes memory cat =
            abi.encode(
                info.from,
                info.start,
                info.end,
                info.eth_price,
                info.dust_price,
                info.max_mint,
                info.mint_free
            );
        // console.log("data-->");
        // console.logBytes(cat);
        bytes32 hash = keccak256(cat);
        // console.log("hash ->");
        //    console.logBytes32(hash);
        require(info.signature.length == 65, "Invalid signature length");
        bytes32 sigR;
        bytes32 sigS;
        uint8 sigV;
        bytes memory signature = info.signature;
        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        assembly {
            sigR := mload(add(signature, 0x20))
            sigS := mload(add(signature, 0x40))
            sigV := byte(0, mload(add(signature, 0x60)))
        }

        bytes32 data =
            keccak256(
                abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
            );
        address recovered = ecrecover(data, sigV, sigR, sigS);
        return signer == recovered;
    }
}

File 15 of 26 : card_with_card.sol
pragma solidity ^0.8.7;
// SPDX-Licence-Identifier: RIGHT-CLICK-SAVE-ONLY

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

// import "hardhat/console.sol";

abstract contract card_with_card {
    struct saleInfo {
        address token_address;
        uint256 start;
        uint256 end;
        uint256 price;
        uint256 max_per_user;
        uint256 total;
        bool oneForOne;
        bytes signature;
    }

    address cwc_signer;

    constructor(address _signer) {
        cwc_signer = _signer;
    }

    function _mintCards(uint256 numberOfCards, address recipient)
        internal
        virtual;

    function _mintDiscountCards(uint256 numberOfCards, address recipient)
        internal
        virtual;

    function _mintDiscountPayable(
        uint256 numberOfCards,
        address recipient,
        uint256 price
    ) internal virtual;

    function _mintPayable(
        uint256 numberOfCards,
        address recipient,
        uint256 price
    ) internal virtual;

    function verify(saleInfo calldata sp) internal view returns (bool) {
        require(sp.token_address != address(0), "INVALID_TOKEN_ADDRESS");
        bytes memory cat =
            abi.encode(
                sp.token_address,
                sp.start,
                sp.end,
                sp.price,
                sp.max_per_user,
                sp.total,
                sp.oneForOne
            );

        bytes32 hash = keccak256(cat);

        require(sp.signature.length == 65, "Invalid signature length");
        bytes32 sigR;
        bytes32 sigS;
        uint8 sigV;
        bytes memory signature = sp.signature;
        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        assembly {
            sigR := mload(add(signature, 0x20))
            sigS := mload(add(signature, 0x40))
            sigV := byte(0, mload(add(signature, 0x60)))
        }

        bytes32 data =
            keccak256(
                abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
            );
        address recovered = ecrecover(data, sigV, sigR, sigS);
        return cwc_signer == recovered;
    }
}

File 16 of 26 : token_interface.sol
pragma solidity ^0.8.7;

interface token_interface {
    struct TKS {
        // Token Kitchen Sink
        uint256 _mintPosition;
        uint256 _ts1;
        uint256 _ts2;
        bool _randomReceived;
        bool _secondReceived;
        uint256 _randomCL;
        uint256 _randomCL2;
        bool _lockTillSaleEnd;
    }

    function setAllowed(address _addr, bool _state) external;

    function permitted(address) external view returns (bool);

    function mintCards(uint256 numberOfCards, address recipient) external;

    function tellEverything() external view returns (TKS memory);

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

    function availableToMint() external view returns (uint256);
}

File 17 of 26 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: 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 {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: 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 Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev 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 18 of 26 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 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 19 of 26 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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 20 of 26 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 22 of 26 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

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 23 of 26 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 26 of 26 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"uint256","name":"projectID","type":"uint256"},{"internalType":"contract token_interface","name":"token","type":"address"},{"internalType":"contract IERC721","name":"ec","type":"address"},{"internalType":"address","name":"dust","type":"address"},{"internalType":"uint256","name":"maxTokens","type":"uint256"},{"internalType":"uint256","name":"maxDiscount","type":"uint256"},{"internalType":"uint256","name":"maxPerSaleMint","type":"uint256"},{"internalType":"uint256","name":"clientMintLimit","type":"uint256"},{"internalType":"uint256","name":"ecMintLimit","type":"uint256"},{"internalType":"uint256","name":"discountedPerAddress","type":"uint256"},{"internalType":"uint256","name":"freeForEC","type":"uint256"},{"internalType":"uint256","name":"discountPrice","type":"uint256"},{"internalType":"uint256","name":"discountDustPrice","type":"uint256"},{"internalType":"uint256","name":"fullPrice","type":"uint256"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"uint256","name":"saleStart","type":"uint256"},{"internalType":"uint256","name":"saleEnd","type":"uint256"},{"internalType":"uint256","name":"presaleStart","type":"uint256"},{"internalType":"uint256","name":"presaleEnd","type":"uint256"},{"internalType":"uint256","name":"fullDustPrice","type":"uint256"},{"internalType":"address[]","name":"wallets","type":"address[]"},{"internalType":"uint16[]","name":"shares","type":"uint16[]"}],"internalType":"struct sale_params","name":"sp","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"bool","name":"","type":"bool"}],"name":"Allowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"number_of_items","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"DustPresale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"number_to_buy","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dustAmount","type":"uint256"}],"name":"DustSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"number_of_items","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"ETHPresale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"number_to_buy","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"ETHSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randUsed_","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_stop","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"RandomProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"batchNumber","type":"uint16"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"batchWhitelistMint","type":"event"},{"inputs":[],"name":"_token","outputs":[{"internalType":"contract token_interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"batchNumber","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"buyer","type":"address"}],"name":"checkDiscountAvailable","outputs":[{"internalType":"bool[3]","name":"","type":"bool[3]"},{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkPresaleIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkSaleIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfCards","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"mint_free","type":"bool"},{"internalType":"uint256","name":"max_mint","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"eth_price","type":"uint256"},{"internalType":"uint256","name":"dust_price","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct dusty.vData","name":"info","type":"tuple"},{"internalType":"uint256","name":"number_of_items_requested","type":"uint256"},{"internalType":"uint16","name":"_batchNumber","type":"uint16"}],"name":"mint_approved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tracker","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"retrieve721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tracker","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"retrieveERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"retrieveETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPerSaleMint","type":"uint256"}],"name":"setMaxPerSaleMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"setPresaleDates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"setSaleDates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"_wallets","type":"address[]"},{"internalType":"uint16[]","name":"_shares","type":"uint16[]"}],"name":"setWallets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_batchNumber","type":"uint16"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"tellEverything","outputs":[{"components":[{"internalType":"uint256","name":"maxTokens","type":"uint256"},{"internalType":"uint256","name":"mintPosition","type":"uint256"},{"internalType":"address[]","name":"wallets","type":"address[]"},{"internalType":"uint16[]","name":"shares","type":"uint16[]"},{"internalType":"uint256","name":"fullPrice","type":"uint256"},{"internalType":"uint256","name":"discountPrice","type":"uint256"},{"internalType":"uint256","name":"presaleStart","type":"uint256"},{"internalType":"uint256","name":"presaleEnd","type":"uint256"},{"internalType":"uint256","name":"saleStart","type":"uint256"},{"internalType":"uint256","name":"saleEnd","type":"uint256"},{"internalType":"uint256","name":"dustPrice","type":"uint256"},{"internalType":"bool","name":"areTokensLocked","type":"bool"},{"internalType":"uint256","name":"maxFreeEC","type":"uint256"},{"internalType":"uint256","name":"totalFreeEC","type":"uint256"},{"internalType":"uint256","name":"maxDiscount","type":"uint256"},{"internalType":"uint256","name":"totalDiscount","type":"uint256"},{"internalType":"uint256","name":"freePerAddress","type":"uint256"},{"internalType":"uint256","name":"discountedPerAddress","type":"uint256"},{"internalType":"string","name":"tokenPreRevealURI","type":"string"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"bool","name":"presaleIsActive","type":"bool"},{"internalType":"bool","name":"saleIsActive","type":"bool"},{"internalType":"bool","name":"dustMintingActive","type":"bool"},{"internalType":"uint256","name":"freeClaimedByThisUser","type":"uint256"},{"internalType":"uint256","name":"discountedClaimedByThisUser","type":"uint256"},{"internalType":"address","name":"etherCards","type":"address"},{"internalType":"address","name":"DUST","type":"address"},{"internalType":"address","name":"ecVault","type":"address"},{"internalType":"uint256","name":"maxPerSaleMint","type":"uint256"},{"internalType":"uint256","name":"MaxUserMintable","type":"uint256"},{"internalType":"uint256","name":"userMinted","type":"uint256"},{"internalType":"bool","name":"randomReceived","type":"bool"},{"internalType":"bool","name":"secondReceived","type":"bool"},{"internalType":"uint256","name":"randomCL","type":"uint256"},{"internalType":"uint256","name":"randomCL2","type":"uint256"},{"internalType":"uint256","name":"ts1","type":"uint256"},{"internalType":"uint256","name":"ts","type":"uint256"}],"internalType":"struct sale_data","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"tokensReceived","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"mint_free","type":"bool"},{"internalType":"uint256","name":"max_mint","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"eth_price","type":"uint256"},{"internalType":"uint256","name":"dust_price","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct dusty.vData","name":"info","type":"tuple"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101006040523480156200001257600080fd5b5060405162002fc438038062002fc48339810160408190526200003591620004fb565b806101c001518160600151826101c001518361026001518461018001518560c00151866102800151876102a001516200007d620000776200026160201b60201c565b62000265565b6001601755601880546001600160a01b0319166001600160a01b0389161790556040516329965a1d60e01b815230600482018190527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200011757600080fd5b505af11580156200012c573d6000803e3d6000fd5b50508351620001459250601a91506020850190620002b7565b5080516200015b90601b90602084019062000321565b5050601980546001600160a01b03199081166001600160a01b0397881617909155601c9490945550601d91909155601e5560208054821694831694909417845584516080526040850151606090811b6001600160601b031990811660e0908152958701516021805490941694169390931790915580850151901b1660c0525061010082015190820151620001f091906200071a565b816080015162000201919062000735565b60a09081526080820151600055810151600d55610120810151600b556101608101516004556101a08101516003556101e0810151600855610200810151600955610220810151600655610240810151600755610140015160115562000794565b3390565b601680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280548282559060005260206000209081019282156200030f579160200282015b828111156200030f57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002d8565b506200031d929150620003c7565b5090565b82805482825590600052602060002090600f016010900481019282156200030f5791602002820160005b838211156200038d57835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026200034b565b8015620003bd5782816101000a81549061ffff02191690556002016020816001010492830192600103026200038d565b50506200031d9291505b5b808211156200031d5760008155600101620003c8565b8051620003eb816200077b565b919050565b600082601f8301126200040257600080fd5b815160206200041b6200041583620006f4565b620006c1565b80838252828201915082860187848660051b89010111156200043c57600080fd5b60005b858110156200046857815162000455816200077b565b845292840192908401906001016200043f565b5090979650505050505050565b600082601f8301126200048757600080fd5b815160206200049a6200041583620006f4565b80838252828201915082860187848660051b8901011115620004bb57600080fd5b6000805b86811015620004ed57825161ffff81168114620004da578283fd5b85529385019391850191600101620004bf565b509198975050505050505050565b6000602082840312156200050e57600080fd5b81516001600160401b03808211156200052657600080fd5b908301906102c082860312156200053c57600080fd5b6200054662000695565b825181526200055860208401620003de565b60208201526200056b60408401620003de565b60408201526200057e60608401620003de565b60608201526080838101519082015260a0808401519082015260c0808401519082015260e08084015190820152610100808401519082015261012080840151908201526101408084015190820152610160808401519082015261018080840151908201526101a080840151908201526101c0620005fd818501620003de565b908201526101e08381015190820152610200808401519082015261022080840151908201526102408084015190820152610260808401519082015261028080840151838111156200064d57600080fd5b6200065b88828701620003f0565b8284015250506102a080840151838111156200067657600080fd5b620006848882870162000475565b918301919091525095945050505050565b6040516102c081016001600160401b0381118282101715620006bb57620006bb62000765565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620006ec57620006ec62000765565b604052919050565b60006001600160401b0382111562000710576200071062000765565b5060051b60200190565b600082198211156200073057620007306200074f565b500190565b6000828210156200074a576200074a6200074f565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146200079157600080fd5b50565b60805160a05160c05160601c60e05160601c6127e9620007db6000396000610de501526000610e11015260008181610e580152611a4d0152600061031201526127e96000f3fe6080604052600436106101785760003560e01c8063a0712d68116100cb578063dc12abb51161007f578063ea6cdcd211610059578063ea6cdcd21461043a578063ecd0c0c31461045a578063f2fde38b1461047a57600080fd5b8063dc12abb5146103da578063ddf8fa7e146103fa578063e5fa5f311461041a57600080fd5b8063b0c77f35116100b0578063b0c77f3514610382578063ba87306514610397578063d5b014c3146103c557600080fd5b8063a0712d6814610342578063a5b3abfb1461036257600080fd5b806367666d741161012d5780638da5cb5b116101075780638da5cb5b146102ae5780638df9da46146102e05780639c30ea511461030057600080fd5b806367666d74146102475780636f219bd614610274578063715018a61461029957600080fd5b80631efc6b041161015e5780631efc6b04146101cd57806332a8cf9e146101ed5780634ac52ecd1461020d57600080fd5b806223de291461018d57806317fd1e2f146101ad57600080fd5b36610188576101863461049a565b005b600080fd5b34801561019957600080fd5b506101866101a8366004611e91565b61060a565b3480156101b957600080fd5b506101866101c8366004611f42565b61066c565b3480156101d957600080fd5b506101866101e8366004611f6e565b610764565b3480156101f957600080fd5b50610186610208366004612221565b610836565b34801561021957600080fd5b5061022d610228366004611e6d565b610895565b60405161023e959493929190612319565b60405180910390f35b34801561025357600080fd5b50610267610262366004611e6d565b610982565b60405161023e9190612369565b34801561028057600080fd5b50610289610ecb565b604051901515815260200161023e565b3480156102a557600080fd5b50610186610ef2565b3480156102ba57600080fd5b506016546001600160a01b03165b6040516001600160a01b03909116815260200161023e565b3480156102ec57600080fd5b506101866102fb3660046121af565b610f58565b34801561030c57600080fd5b506103347f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161023e565b34801561034e57600080fd5b5061018661035d366004612221565b611102565b34801561036e57600080fd5b5061018661037d366004611f42565b61124f565b34801561038e57600080fd5b5061028961132d565b3480156103a357600080fd5b506025546103b29061ffff1681565b60405161ffff909116815260200161023e565b3480156103d157600080fd5b5061018661134b565b3480156103e657600080fd5b506101866103f5366004612253565b61143d565b34801561040657600080fd5b50610186610415366004612206565b611513565b34801561042657600080fd5b50610186610435366004612253565b6115f6565b34801561044657600080fd5b50610289610455366004612172565b6116cc565b34801561046657600080fd5b506021546102c8906001600160a01b031681565b34801561048657600080fd5b50610186610495366004611e6d565b6118f7565b60008060005b601a548110156106045760006103e8601b83815481106104c2576104c2612764565b600091825260209091206010820401546104ec91600f166002026101000a900461ffff16876126d1565b6104f691906126af565b601a54909150610508906001906126f0565b8214156105205761051983866126f0565b905061052d565b61052a8184612697565b92505b601a828154811061054057610540612764565b60009182526020822001546040516001600160a01b039091169183919081818185875af1925050503d8060008114610594576040519150601f19603f3d011682016040523d82523d6000602084013e610599565b606091505b505080945050836105f15760405162461bcd60e51b815260206004820152601460248201527f4661696c656420746f2073656e6420457468657200000000000000000000000060448201526064015b60405180910390fd5b50806105fc81612733565b9150506104a0565b50505050565b6002601754141561065d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105e8565b50506001601755505050505050565b6016546001600160a01b031633146106c65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e8565b6040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290526001600160a01b0383169063a9059cbb90604401602060405180830381600087803b15801561072757600080fd5b505af115801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f9190612037565b505050565b6016546001600160a01b031633146107be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e8565b805182511461080f5760405162461bcd60e51b815260206004820152600260248201527f216c00000000000000000000000000000000000000000000000000000000000060448201526064016105e8565b815161082290601a906020850190611b3c565b50805161075f90601b906020840190611bae565b6016546001600160a01b031633146108905760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e8565b601e55565b61089d611c52565b60408051606081018252600080825260208083018290526001838501526001600160a01b0380871683526027825284832054601f83528584205460215487517f74601c3c00000000000000000000000000000000000000000000000000000000815297519597889788978897889792968896909590949316926374601c3c9260048083019392829003018186803b15801561093757600080fd5b505afa15801561094b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096f919061223a565b939b929a50909850965090945092505050565b610ac5604051806104a0016040528060008152602001600081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b03168152602001600015158152602001600015158152602001600015158152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600015158152602001600015158152602001600081526020016000815260200160008152602001600081525090565b602154604080517f2f151b7600000000000000000000000000000000000000000000000000000000815290516000926001600160a01b031691632f151b7691600480830192610100929190829003018186803b158015610b2457600080fd5b505afa158015610b38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5c91906120cb565b9050604051806104a00160405280600054815260200182600001518152602001601a805480602002602001604051908101604052809291908181526020018280548015610bd257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bb4575b50505050508152602001601b805480602002602001604051908101604052809291908181526020018280548015610c5057602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610c175790505b50505050508152602001600354815260200160045481526020016006548152602001600754815260200160085481526020016009548152602001600a5481526020018260e001511515815260200160115481526020016012548152602001600d548152602001600c548152602001600f548152602001600b548152602001602160009054906101000a90046001600160a01b03166001600160a01b031663bcc0f7256040518163ffffffff1660e01b815260040160006040518083038186803b158015610d1c57600080fd5b505afa158015610d30573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d589190810190612054565b81526010546001600160a01b03166020820152604001610d7661132d565b15158152602001610d85610ecb565b15158152602001610d94610ecb565b8015610dae57506000601c541180610dae57506000601d54115b151581526001600160a01b0394851660008181526026602090815260408083205482860152928252602781529082902054828401527f000000000000000000000000000000000000000000000000000000000000000087166060808501919091527f0000000000000000000000000000000000000000000000000000000000000000881660808086019190915260155490981660a080860191909152601e5460c0808701919091527f000000000000000000000000000000000000000000000000000000000000000060e08701526022546101008701529187015115156101208601529786015115156101408501529685015161016084015295840151610180830152948301516101a082015291909301516101c0909101525090565b60004260085411158015610ee157504260095410155b15610eec5750600190565b50600090565b6016546001600160a01b03163314610f4c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e8565b610f5660006119d2565b565b60255461ffff828116911614610fb05760405162461bcd60e51b815260206004820152600660248201527f216261746368000000000000000000000000000000000000000000000000000060448201526064016105e8565b33610fba846116cc565b6110065760405162461bcd60e51b815260206004820152601a60248201527f556e617574686f7269736564206163636573732073656372657400000000000060448201526064016105e8565b336000908152602760205260408120805460019290611026908490612697565b9091555050336000908152602760205260409020546001101561109d5760405162461bcd60e51b815260206004820152602960248201527f4e756d6265722065786365656473206d617820646973636f756e74656420706560448201526872206164647265737360b81b60648201526084016105e8565b6001600160a01b0381166000908152601f60205260409020600190556110c38382611a31565b60405133815261ffff8316907f01945d29b0ca5ed6c040963fd02660745b70c4ae2e20234793b268045e5f81b69060200160405180910390a250505050565b3360009081526027602052604081208054839290611121908490612697565b9091555050601e543360009081526027602052604090205411156111995760405162461bcd60e51b815260206004820152602960248201527f4e756d6265722065786365656473206d617820646973636f756e74656420706560448201526872206164647265737360b81b60648201526084016105e8565b6111a1610ecb565b6111ed5760405162461bcd60e51b815260206004820152601060248201527f73616c65206973206e6f74206f70656e0000000000000000000000000000000060448201526064016105e8565b601e5481111561123f5760405162461bcd60e51b815260206004820181905260248201527f45786365656473206d617820706572205472616e73616374696f6e204d696e7460448201526064016105e8565b61124c8133600354611b32565b50565b6016546001600160a01b031633146112a95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e8565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152306004820152336024820152604481018290526001600160a01b038316906323b872dd906064015b600060405180830381600087803b15801561131157600080fd5b505af1158015611325573d6000803e3d6000fd5b505050505050565b60004260065411158015610ee157504260075410610eec5750600190565b6016546001600160a01b031633146113a55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e8565b604051600090339047908381818185875af1925050503d80600081146113e7576040519150601f19603f3d011682016040523d82523d6000602084013e6113ec565b606091505b505090508061124c5760405162461bcd60e51b815260206004820152601460248201527f4661696c656420746f2073656e6420457468657200000000000000000000000060448201526064016105e8565b602154604051636cc301e360e01b81523360048201526001600160a01b0390911690636cc301e39060240160206040518083038186803b15801561148057600080fd5b505afa158015611494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b89190612037565b806114cd57506016546001600160a01b031633145b6115085760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5cd95960a21b60448201526064016105e8565b600691909155600755565b602154604051636cc301e360e01b81523360048201526001600160a01b0390911690636cc301e39060240160206040518083038186803b15801561155657600080fd5b505afa15801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e9190612037565b806115a357506016546001600160a01b031633145b6115de5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5cd95960a21b60448201526064016105e8565b6025805461ffff191661ffff92909216919091179055565b602154604051636cc301e360e01b81523360048201526001600160a01b0390911690636cc301e39060240160206040518083038186803b15801561163957600080fd5b505afa15801561164d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116719190612037565b8061168657506016546001600160a01b031633145b6116c15760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5cd95960a21b60448201526064016105e8565b600891909155600955565b60408101516000906001600160a01b03166117295760405162461bcd60e51b815260206004820152600e60248201527f494e56414c49445f5349474e455200000000000000000000000000000000000060448201526064016105e8565b60008260400151836060015184608001518560a001518660c001518760200151886000015160405160200161179c97969594939291906001600160a01b03979097168752602087019590955260408601939093526060850191909152608084015260a0830152151560c082015260e00190565b60408051601f198184030181529190528051602082012060e0850151519192509060411461180c5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207369676e6174757265206c656e677468000000000000000060448201526064016105e8565b60e0840151602080820151604080840151606085015191517f19457468657265756d205369676e6564204d6573736167653a0a33320000000094810194909452603c840186905291939192600091821a929190605c0160408051601f198184030181528282528051602091820120600080855291840180845281905260ff87169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa1580156118cd573d6000803e3d6000fd5b5050604051601f1901516019546001600160a01b039081169116149b9a5050505050505050505050565b6016546001600160a01b031633146119515760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e8565b6001600160a01b0381166119cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105e8565b61124c815b601680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8160226000828254611a439190612697565b90915550506022547f00000000000000000000000000000000000000000000000000000000000000001015611ae05760405162461bcd60e51b815260206004820152603260248201527f546869732065786365656473206d6178696d756d206e756d626572206f66207560448201527f736572206d696e7461626c65206361726473000000000000000000000000000060648201526084016105e8565b6021546040517f134f3337000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b0383811660248301529091169063134f3337906044016112f7565b61075f8383611a31565b828054828255906000526020600020908101928215611b9e579160200282015b82811115611b9e578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190611b5c565b50611baa929150611c70565b5090565b82805482825590600052602060002090600f01601090048101928215611b9e5791602002820160005b83821115611c1757835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611bd7565b8015611c455782816101000a81549061ffff0219169055600201602081600101049283019260010302611c17565b5050611baa929150611c70565b60405180606001604052806003906020820280368337509192915050565b5b80821115611baa5760008155600101611c71565b8035611c9081612790565b919050565b600082601f830112611ca657600080fd5b81356020611cbb611cb68361264b565b61261a565b80838252828201915082860187848660051b8901011115611cdb57600080fd5b60005b85811015611d0157611cef82611e5b565b84529284019290840190600101611cde565b5090979650505050505050565b8035611c90816127a5565b8051611c90816127a5565b60008083601f840112611d3657600080fd5b50813567ffffffffffffffff811115611d4e57600080fd5b602083019150836020828501011115611d6657600080fd5b9250929050565b600082601f830112611d7e57600080fd5b8135611d8c611cb68261266f565b818152846020838601011115611da157600080fd5b816020850160208301376000918101602001919091529392505050565b60006101008284031215611dd157600080fd5b611dd96125f0565b9050611de482611d0e565b815260208201356020820152611dfc60408301611c85565b6040820152606082013560608201526080820135608082015260a082013560a082015260c082013560c082015260e082013567ffffffffffffffff811115611e4357600080fd5b611e4f84828501611d6d565b60e08301525092915050565b803561ffff81168114611c9057600080fd5b600060208284031215611e7f57600080fd5b8135611e8a81612790565b9392505050565b60008060008060008060008060c0898b031215611ead57600080fd5b8835611eb881612790565b97506020890135611ec881612790565b96506040890135611ed881612790565b955060608901359450608089013567ffffffffffffffff80821115611efc57600080fd5b611f088c838d01611d24565b909650945060a08b0135915080821115611f2157600080fd5b50611f2e8b828c01611d24565b999c989b5096995094979396929594505050565b60008060408385031215611f5557600080fd5b8235611f6081612790565b946020939093013593505050565b60008060408385031215611f8157600080fd5b823567ffffffffffffffff80821115611f9957600080fd5b818501915085601f830112611fad57600080fd5b81356020611fbd611cb68361264b565b8083825282820191508286018a848660051b8901011115611fdd57600080fd5b600096505b84871015612009578035611ff581612790565b835260019690960195918301918301611fe2565b509650508601359250508082111561202057600080fd5b5061202d85828601611c95565b9150509250929050565b60006020828403121561204957600080fd5b8151611e8a816127a5565b60006020828403121561206657600080fd5b815167ffffffffffffffff81111561207d57600080fd5b8201601f8101841361208e57600080fd5b805161209c611cb68261266f565b8181528560208385010111156120b157600080fd5b6120c2826020830160208601612707565b95945050505050565b60006101008083850312156120df57600080fd5b6040519081019067ffffffffffffffff821181831017156121025761210261277a565b816040528351815260208401516020820152604084015160408201526060840151915061212e826127a5565b81606082015261214060808501611d19565b608082015260a084015160a082015260c084015160c082015261216560e08501611d19565b60e0820152949350505050565b60006020828403121561218457600080fd5b813567ffffffffffffffff81111561219b57600080fd5b6121a784828501611dbe565b949350505050565b6000806000606084860312156121c457600080fd5b833567ffffffffffffffff8111156121db57600080fd5b6121e786828701611dbe565b935050602084013591506121fd60408501611e5b565b90509250925092565b60006020828403121561221857600080fd5b611e8a82611e5b565b60006020828403121561223357600080fd5b5035919050565b60006020828403121561224c57600080fd5b5051919050565b6000806040838503121561226657600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156122ae5781516001600160a01b031687529582019590820190600101612289565b509495945050505050565b600081518084526020808501945080840160005b838110156122ae57815161ffff16875295820195908201906001016122cd565b60008151808452612305816020860160208601612707565b601f01601f19169290920160200192915050565b60e08101818760005b60038110156123435781511515835260209283019290910190600101612322565b5050509415156060820152608081019390935260a083019190915260c090910152919050565b602081528151602082015260208201516040820152600060408301516104a080606085015261239c6104c0850183612275565b91506060850151601f19808685030160808701526123ba84836122b9565b9350608087015160a087015260a087015160c087015260c087015160e087015260e0870151915061010082818801528088015192505061012082818801528088015192505061014082818801528088015192505061016082818801528088015192505061018061242d8188018415159052565b8701516101a0878101919091528701516101c0808801919091528701516101e08088019190915287015161020080880191909152870151610220808801919091528701516102408088019190915287015186850382016102608089019190915290925061249a85846122ed565b945080880151925050506102806124bb818701836001600160a01b03169052565b86015190506102a06124d08682018315159052565b86015190506102c06124e58682018315159052565b86015190506102e06124fa8682018315159052565b86015161030086810191909152860151610320808701919091528601519050610340612530818701836001600160a01b03169052565b860151905061036061254c868201836001600160a01b03169052565b8601519050610380612568868201836001600160a01b03169052565b8601516103a0868101919091528601516103c0808701919091528601516103e08087019190915286015190506104006125a48187018315159052565b86015190506104206125b98682018315159052565b8601516104408681019190915286015161046080870191909152860151610480808701919091529095015193019290925250919050565b604051610100810167ffffffffffffffff811182821017156126145761261461277a565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156126435761264361277a565b604052919050565b600067ffffffffffffffff8211156126655761266561277a565b5060051b60200190565b600067ffffffffffffffff8211156126895761268961277a565b50601f01601f191660200190565b600082198211156126aa576126aa61274e565b500190565b6000826126cc57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156126eb576126eb61274e565b500290565b6000828210156127025761270261274e565b500390565b60005b8381101561272257818101518382015260200161270a565b838111156106045750506000910152565b60006000198214156127475761274761274e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461124c57600080fd5b801515811461124c57600080fdfea26469706673582212204cfce9af8b3a2980893c993a573042fd148a63ed8a0e6c859b46346958b9eac364736f6c63430008070033000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040000000000000000000000009b8b9c7c02be0bd0aa4d669bf6a1f6003424c6dc0000000000000000000000008598b4d577824bdd04a42404ac2dfcfd8b0dab350000000000000000000000008598b4d577824bdd04a42404ac2dfcfd8b0dab3500000000000000000000000000000000000000000000000000000000000046500000000000000000000000000000000000000000000000000000000000004088000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000004d800000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a741a462780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a741a46278000000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7000000000000000000000000000000000000000000000000000000014b230ce3000000000000000000000000000000000000000000000000000000014b230ce30000000000000000000000000000000000000000000000000000000062602e000000000000000000000000000000000000000000000000000000000062617f80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000384

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040000000000000000000000009b8b9c7c02be0bd0aa4d669bf6a1f6003424c6dc0000000000000000000000008598b4d577824bdd04a42404ac2dfcfd8b0dab350000000000000000000000008598b4d577824bdd04a42404ac2dfcfd8b0dab3500000000000000000000000000000000000000000000000000000000000046500000000000000000000000000000000000000000000000000000000000004088000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000004d800000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a741a462780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a741a46278000000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7000000000000000000000000000000000000000000000000000000014b230ce3000000000000000000000000000000000000000000000000000000014b230ce30000000000000000000000000000000000000000000000000000000062602e000000000000000000000000000000000000000000000000000000000062617f80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000384

-----Decoded View---------------
Arg [0] : sp (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
29 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [2] : 0000000000000000000000009b8b9c7c02be0bd0aa4d669bf6a1f6003424c6dc
Arg [3] : 0000000000000000000000008598b4d577824bdd04a42404ac2dfcfd8b0dab35
Arg [4] : 0000000000000000000000008598b4d577824bdd04a42404ac2dfcfd8b0dab35
Arg [5] : 0000000000000000000000000000000000000000000000000000000000004650
Arg [6] : 0000000000000000000000000000000000000000000000000000000000004088
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [8] : 00000000000000000000000000000000000000000000000000000000000004d8
Arg [9] : 00000000000000000000000000000000000000000000000000000000000000f0
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [12] : 000000000000000000000000000000000000000000000000010a741a46278000
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [14] : 000000000000000000000000000000000000000000000000010a741a46278000
Arg [15] : 000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7
Arg [16] : 000000000000000000000000000000000000000000000000000000014b230ce3
Arg [17] : 000000000000000000000000000000000000000000000000000000014b230ce3
Arg [18] : 0000000000000000000000000000000000000000000000000000000062602e00
Arg [19] : 0000000000000000000000000000000000000000000000000000000062617f80
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [21] : 00000000000000000000000000000000000000000000000000000000000002c0
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000320
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [24] : 000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7
Arg [25] : 000000000000000000000000669f499e7ba51836bb76f7dd2bc3c1a37a5342d7
Arg [26] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [27] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [28] : 0000000000000000000000000000000000000000000000000000000000000384


Block Transaction Difficulty Gas Used Reward
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.

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