Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840
Balance 0 ETH
Nonce 1
Code Size 16679 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

16679 bytes
0x608060405234801561001057600080fd5b50600436106103355760003560e01c806368a2972f116101b25780639cff2eba116100f9578063c4bc5da5116100a2578063d505accf1161007c578063d505accf1461065a578063d547741f1461066d578063dd62ed3e14610680578063eaf9d1941461069357610335565b8063c4bc5da514610637578063ca15c8731461063f578063d391014b1461065257610335565b8063b187bd26116100d3578063b187bd2614610609578063b492da9114610611578063c238651b1461062457610335565b80639cff2eba146105d0578063a457c2d7146105e3578063a9059cbb146105f657610335565b80638cbfeb0c1161015b57806392afc33a1161013557806392afc33a146105b857806395d89b41146105c057806397c1d32f146105c857610335565b80638cbfeb0c1461057f5780639010d07c1461059257806391d14854146105a557610335565b80637ecebe001161018c5780637ecebe001461054457806382e17b65146105575780638493712a1461057757610335565b806368a2972f146104fe57806370a082311461051e578063789210b31461053157610335565b806323b872dd1161028157806336568abe1161022a5780634abd991d116102045780634abd991d146104bd57806354ff02d8146104d05780635aacfa5d146104d857806366830b21146104eb57610335565b806336568abe1461048f57806339509351146104a2578063439766ce146104b557610335565b8063313ce5671161025b578063313ce5671461046a5780633408e4701461047f5780633644e5151461048757610335565b806323b872dd14610431578063248a9ca3146104445780632f2ff15d1461045757610335565b80630bb9ff5d116102e35780631bf73b72116102bd5780631bf73b72146104035780631f2eba241461040b578063209ab7111461041e57610335565b80630bb9ff5d146103d357806318160ddd146103e857806318a8ad87146103f057610335565b806306fb1a071161031457806306fb1a071461038b57806306fdde03146103ab578063095ea7b3146103c057610335565b80622457831461033a57806301ffc9a7146103635780630288f0fb14610383575b600080fd5b61034d6103483660046132c0565b6106a6565b60405161035a91906139e0565b60405180910390f35b6103766103713660046135c3565b61077b565b60405161035a91906139b4565b61034d6107c1565b61039e610399366004613566565b6107e5565b60405161035a91906137bf565b6103b3610823565b60405161035a9190613a67565b6103766103ce366004613313565b6108b6565b6103e66103e1366004613313565b6108d4565b005b61034d61097a565b6103e66103fe366004613313565b610a3d565b61034d610ac8565b6103e6610419366004613313565b610ace565b6103e661042c3660046131b7565b610b59565b61037661043f36600461320b565b610bf7565b61034d610452366004613566565b610cd8565b6103e661046536600461357e565b610ced565b610472610d14565b60405161035a9190613f68565b61034d610d19565b61034d610d1d565b6103e661049d36600461357e565b610d27565b6103766104b0366004613313565b610d49565b6103e6610d98565b61034d6104cb3660046131b7565b610dd9565b61034d610eaa565b6103e66104e636600461333e565b610ece565b6103e66104f9366004613313565b611101565b61051161050c36600461333e565b61118c565b60405161035a919061395c565b61034d61052c3660046131b7565b611265565b6103e661053f36600461341c565b61133c565b61034d6105523660046131b7565b611857565b61056a61056536600461333e565b611878565b60405161035a9190613861565b61034d611949565b6103e661058d366004613313565b61196d565b61039e6105a03660046135a2565b611bfa565b6103766105b336600461357e565b611c12565b61034d611c3b565b6103b3611c5f565b61034d611c6e565b6103e66105de36600461320b565b611c92565b6103766105f1366004613313565b611d46565b610376610604366004613313565b611dc1565b610376611df9565b6103e661061f366004613313565b611e02565b61037661063236600461320b565b611f50565b6103e6611fd3565b61034d61064d366004613566565b612010565b61034d612027565b6103e661066836600461324b565b61202c565b6103e661067b36600461357e565b61210e565b61034d61068e3660046131d3565b612118565b6103e66106a13660046135eb565b612143565b60008060076000815481106106cb57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546040517e2457830000000000000000000000000000000000000000000000000000000081526001600160a01b0390911691508190622457839061072290889088908890600401613811565b60206040518083038186803b15801561073a57600080fd5b505afa15801561074e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610772919061369b565b95945050505050565b60006001600160e01b031982167f5a05180f0000000000000000000000000000000000000000000000000000000014806107b957506107b98261218d565b90505b919050565b7f233299fc8224c0cb5b2b8b651b93354cf11d5245f1374bb37773608ffa1913c181565b60006007828154811061080857634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031692915050565b60606004805461083290614060565b80601f016020809104026020016040519081016040528092919081815260200182805461085e90614060565b80156108ab5780601f10610880576101008083540402835291602001916108ab565b820191906000526020600020905b81548152906001019060200180831161088e57829003601f168201915b505050505090505b90565b60006108ca6108c36121cb565b84846121cf565b5060015b92915050565b60085460ff16156109005760405162461bcd60e51b81526004016108f790613d8e565b60405180910390fd5b7faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b6014616109328161092d6121cb565b612283565b61093c83836122e7565b7f099fc78bcf3c24b8cd6ad4eda1e3eb007e511c09c640af1c46437ded34cf10f2838360405161096d929190613834565b60405180910390a1505050565b6000600760008154811061099e57634e487b7160e01b600052603260045260246000fd5b60009182526020918290200154604080517fc4e41b2200000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169263c4e41b2292600480840193829003018186803b158015610a0057600080fd5b505afa158015610a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a38919061369b565b905090565b60085460ff1615610a605760405162461bcd60e51b81526004016108f790613d8e565b7fb5b5a86cc252b1b75a439c6ff372933ceb0690188924e6461150adeb00ab80d8610a8d8161092d6121cb565b610a978383612476565b7f0a5b82707bc4ce1d57e909b70adb28e393a34c2ab77e30f862ca2e0e9f8da905838360405161096d929190613834565b60075490565b60085460ff1615610af15760405162461bcd60e51b81526004016108f790613d8e565b7faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b601461610b1e8161092d6121cb565b610b2883836122e7565b7f7d48429c6eb871d47dea691d65bb2d1f99eaf5d33e7a06363b8fafb3f6ea0178838360405161096d929190613834565b60006007600081548110610b7d57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b0316905080635603b9f9610ba26121cb565b846040518363ffffffff1660e01b8152600401610bc09291906137d3565b600060405180830381600087803b158015610bda57600080fd5b505af1158015610bee573d6000803e3d6000fd5b50505050505b50565b60085460009060ff1615610c1d5760405162461bcd60e51b81526004016108f790613d8e565b6001600160a01b038416610c435760405162461bcd60e51b81526004016108f790613c81565b610c4e84848461262b565b6001600160a01b038416600090815260036020526040812081610c6f6121cb565b6001600160a01b03166001600160a01b0316815260200190815260200160002054905082811015610cb25760405162461bcd60e51b81526004016108f790613dc5565b610ccd85610cbe6121cb565b610cc88685614002565b6121cf565b506001949350505050565b60009081526020819052604090206001015490565b610cf78282612859565b6000828152600160205260409020610d0f9082612178565b505050565b601290565b4690565b6000610a38612878565b610d31828261293b565b6000828152600160205260409020610d0f908261297d565b60006108ca610d566121cb565b848460036000610d646121cb565b6001600160a01b03908116825260208083019390935260409182016000908120918b1681529252902054610cc89190613fcb565b60085460ff1615610dbb5760405162461bcd60e51b81526004016108f790613d8e565b6000610dc98161092d6121cb565b506008805460ff19166001179055565b6000806007600081548110610dfe57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546040517f4abd991d0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911691508190634abd991d90610e539086906004016137bf565b60206040518083038186803b158015610e6b57600080fd5b505afa158015610e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea3919061369b565b9392505050565b7fb5b5a86cc252b1b75a439c6ff372933ceb0690188924e6461150adeb00ab80d881565b60085460ff1615610ef15760405162461bcd60e51b81526004016108f790613d8e565b60006007600081548110610f1557634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546040517f3830551a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911691508190633830551a90610f6c908690869060040161384d565b600060405180830381600087803b158015610f8657600080fd5b505af1158015610f9a573d6000803e3d6000fd5b505050506000816001600160a01b0316634abd991d610fb76121cb565b6040518263ffffffff1660e01b8152600401610fd391906137bf565b60206040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611023919061369b565b9050600081116110455760405162461bcd60e51b81526004016108f790613b06565b816001600160a01b031663e355681961105c6121cb565b6040518263ffffffff1660e01b815260040161107891906137bf565b600060405180830381600087803b15801561109257600080fd5b505af11580156110a6573d6000803e3d6000fd5b505050506110bb6110b56121cb565b826122e7565b7f5b166da4c6bcfd67577f205ac2ee4ef2ce2e24d51237eafb87f82df73f03f6146110e46121cb565b826040516110f3929190613834565b60405180910390a150505050565b60085460ff16156111245760405162461bcd60e51b81526004016108f790613d8e565b7fb5b5a86cc252b1b75a439c6ff372933ceb0690188924e6461150adeb00ab80d86111518161092d6121cb565b61115b8383612476565b7f3eac2380fcf2b255bd916ae212498a2e55f3c99baab43d3eb29cb6349639d0d2838360405161096d929190613834565b6060600060076000815481106111b257634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546040517f68a2972f0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116915081906368a2972f90611209908790879060040161384d565b60006040518083038186803b15801561122157600080fd5b505afa158015611235573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261125d919081019061348c565b949350505050565b6000600760008154811061128957634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03858116845260029092526040928390205492517f2b04e840000000000000000000000000000000000000000000000000000000008152911691632b04e840916112ec918691600401613834565b60206040518083038186803b15801561130457600080fd5b505afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b9919061369b565b600061134a8161092d6121cb565b60005b6007548110156114dc576113b67faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b6014616007838154811061139c57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031661210e565b6113fb7fb5b5a86cc252b1b75a439c6ff372933ceb0690188924e6461150adeb00ab80d86007838154811061139c57634e487b7160e01b600052603260045260246000fd5b6114407f02a8464c3e212c8f1064432774c6cc3e76f14bd7ccdafd9a1d1cf9b43b51e5246007838154811061139c57634e487b7160e01b600052603260045260246000fd5b6114857f233299fc8224c0cb5b2b8b651b93354cf11d5245f1374bb37773608ffa1913c16007838154811061139c57634e487b7160e01b600052603260045260246000fd5b6114ca7f5772712b2943d95a931c0b3a7ddf59cba41b664500d9b93626000a17809f04d16007838154811061139c57634e487b7160e01b600052603260045260246000fd5b806114d481614095565b91505061134d565b506114e96007600061305c565b60005b828110156118255783838281811061151457634e487b7160e01b600052603260045260246000fd5b61152a92602060c090920201908101915061354c565b1561158b5761158b7faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b60146185858481811061157357634e487b7160e01b600052603260045260246000fd5b905060c0020160a001602081019061046591906131b7565b8383828181106115ab57634e487b7160e01b600052603260045260246000fd5b905060c0020160200160208101906115c3919061354c565b1561160c5761160c7fb5b5a86cc252b1b75a439c6ff372933ceb0690188924e6461150adeb00ab80d885858481811061157357634e487b7160e01b600052603260045260246000fd5b83838281811061162c57634e487b7160e01b600052603260045260246000fd5b905060c002016040016020810190611644919061354c565b1561168d5761168d7f02a8464c3e212c8f1064432774c6cc3e76f14bd7ccdafd9a1d1cf9b43b51e52485858481811061157357634e487b7160e01b600052603260045260246000fd5b8383828181106116ad57634e487b7160e01b600052603260045260246000fd5b905060c0020160600160208101906116c5919061354c565b1561170e5761170e7f233299fc8224c0cb5b2b8b651b93354cf11d5245f1374bb37773608ffa1913c185858481811061157357634e487b7160e01b600052603260045260246000fd5b83838281811061172e57634e487b7160e01b600052603260045260246000fd5b905060c002016080016020810190611746919061354c565b1561178f5761178f7f5772712b2943d95a931c0b3a7ddf59cba41b664500d9b93626000a17809f04d185858481811061157357634e487b7160e01b600052603260045260246000fd5b60078484838181106117b157634e487b7160e01b600052603260045260246000fd5b905060c0020160a00160208101906117c991906131b7565b81546001810183556000928352602090922090910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039092169190911790558061181d81614095565b9150506114ec565b507f13340c8e795b6b33898709afdee63a73df74c7ca9d8204d3265aa483ac0e4037838360405161096d9291906138ae565b6001600160a01b03811660009081526006602052604081206107b990612992565b60606000600760008154811061189e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546040517f82e17b650000000000000000000000000000000000000000000000000000000081526001600160a01b03909116915081906382e17b65906118f5908790879060040161384d565b60006040518083038186803b15801561190d57600080fd5b505afa158015611921573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261125d919081019061337e565b7f02a8464c3e212c8f1064432774c6cc3e76f14bd7ccdafd9a1d1cf9b43b51e52481565b60085460ff16156119905760405162461bcd60e51b81526004016108f790613d8e565b600060076001815481106119b457634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031690506119d36121cb565b6001600160a01b0316816001600160a01b031614611a035760405162461bcd60e51b81526004016108f790613bd1565b60006007600081548110611a2757634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b038581168452600290925260408320805492909116935085929091611a62908490614002565b90915550506040517fcb1236370000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063cb12363790611aac9086906004016139e0565b60206040518083038186803b158015611ac457600080fd5b505afa158015611ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611afc919061369b565b6001600160a01b03851660009081526002602052604081208054909190611b24908490613fcb565b92505081905550806001600160a01b031663e8ac6e4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611b6657600080fd5b505af1158015611b7a573d6000803e3d6000fd5b50505050836001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611bc191906139e0565b60405180910390a37f814f4cde641f205fbac4d156545ee0a5850d9338c94b952acec9852c0a52804384846040516110f3929190613834565b6000828152600160205260408120610ea39083612996565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b7faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b60146181565b60606005805461083290614060565b7f5772712b2943d95a931c0b3a7ddf59cba41b664500d9b93626000a17809f04d181565b60085460ff1615611cb55760405162461bcd60e51b81526004016108f790613d8e565b7f02a8464c3e212c8f1064432774c6cc3e76f14bd7ccdafd9a1d1cf9b43b51e524611ce28161092d6121cb565b6001600160a01b038416611d085760405162461bcd60e51b81526004016108f790613c81565b611d1384848461262b565b7f4f21c37c3184c9b0bbc63a812b0a1a148f15f1bd6db127e7e562d9b0436803258484846040516110f3939291906137ed565b60008060036000611d556121cb565b6001600160a01b0390811682526020808301939093526040918201600090812091881681529252902054905082811015611da15760405162461bcd60e51b81526004016108f790613e59565b611db7611dac6121cb565b85610cc88685614002565b5060019392505050565b60085460009060ff1615611de75760405162461bcd60e51b81526004016108f790613d8e565b6108ca611df26121cb565b848461262b565b60085460ff1681565b60085460ff1615611e255760405162461bcd60e51b81526004016108f790613d8e565b7f5772712b2943d95a931c0b3a7ddf59cba41b664500d9b93626000a17809f04d1611e528161092d6121cb565b60006007600081548110611e7657634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03878116845260029092526040928390205492517f36098758000000000000000000000000000000000000000000000000000000008152911692508291633609875891611edc918791600401613f5a565b602060405180830381600087803b158015611ef657600080fd5b505af1158015611f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2e919061369b565b6001600160a01b03909416600090815260026020526040902093909355505050565b60085460009060ff16611f755760405162461bcd60e51b81526004016108f790613b9a565b7f233299fc8224c0cb5b2b8b651b93354cf11d5245f1374bb37773608ffa1913c1611fa28161092d6121cb565b6001600160a01b038516611fc85760405162461bcd60e51b81526004016108f790613c81565b610ccd85858561262b565b60085460ff16611ff55760405162461bcd60e51b81526004016108f790613b9a565b60006120038161092d6121cb565b506008805460ff19169055565b60008181526001602052604081206107b9906129a2565b600081565b8342111561204c5760405162461bcd60e51b81526004016108f790613c08565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c988888861207b8c6129ad565b89604051602001612091969594939291906139e9565b60405160208183030381529060405280519060200120905060006120b4826129df565b905060006120c4828787876129f2565b9050896001600160a01b0316816001600160a01b0316146120f75760405162461bcd60e51b81526004016108f790613cfa565b6121028a8a8a6121cf565b50505050505050505050565b610d318282612adf565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006121518161092d6121cb565b61215d6004868661307a565b50610bee6005848461307a565b6121748282612afe565b5050565b6000610ea3836001600160a01b038416612b83565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806107b957506107b982612bcd565b3390565b6001600160a01b0383166121f55760405162461bcd60e51b81526004016108f790613d31565b6001600160a01b03821661221b5760405162461bcd60e51b81526004016108f790613b3d565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906122769085906139e0565b60405180910390a3505050565b61228d8282611c12565b612174576122a5816001600160a01b03166014612bff565b6122b0836020612bff565b6040516020016122c192919061373e565b60408051601f198184030181529082905262461bcd60e51b82526108f791600401613a67565b6000600760008154811061230b57634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516342e58a6360e01b81526001600160a01b03909116925082906342e58a639061234b90600190889088906004016139bf565b602060405180830381600087803b15801561236557600080fd5b505af1158015612379573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239d919061369b565b6001600160a01b0385166000908152600260205260408120805492935083929091906123ca908490613fcb565b92505081905550816001600160a01b031663e8ac6e4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561240c57600080fd5b505af1158015612420573d6000803e3d6000fd5b50505050836001600160a01b031660006001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161246891906139e0565b60405180910390a350505050565b6000600760008154811061249a57634e487b7160e01b600052603260045260246000fd5b6000918252602082200154600780546001600160a01b0390921693509082906124d357634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516342e58a6360e01b81526001600160a01b03909116916342e58a639161250e9190889088906004016139bf565b602060405180830381600087803b15801561252857600080fd5b505af115801561253c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612560919061369b565b6001600160a01b03851660009081526002602052604081208054929350839290919061258d908490614002565b92505081905550816001600160a01b031663e8ac6e4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156125cf57600080fd5b505af11580156125e3573d6000803e3d6000fd5b5050505060006001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161246891906139e0565b6001600160a01b0382166126515760405162461bcd60e51b81526004016108f790613c81565b816001600160a01b0316836001600160a01b031614156126835760405162461bcd60e51b81526004016108f790613e22565b600060076000815481106126a757634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546040805160a0810182526001600160a01b038981168083528982168387018190528385018a9052908752600280875284882054606085015290875290945281852054608082015290517f815a61e0000000000000000000000000000000000000000000000000000000008152929091169350839163815a61e09161273b91600401613f13565b608060405180830381600087803b15801561275557600080fd5b505af1158015612769573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061278d9190613654565b80516001600160a01b03808816600081815260026020908152604080832095909555850151928916808252908490209290925560608401519251939450909290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef916127fa91906139e0565b60405180910390a360006001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040015160405161284a91906139e0565b60405180910390a35050505050565b61286282610cd8565b61286e8161092d6121cb565b610d0f8383612afe565b60007f00000000000000000000000000000000000000000000000000000000000000014614156128c957507f96ded2f296fa7485a7df8bca43276511bf4a974a2b67c64c51720c159ba148426108b3565b6129347f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7f9b7555cee7d8d1f28094435c4a9470c9eaf720c49e00f1a5b09c1e4e4d9438507fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6612df6565b90506108b3565b6129436121cb565b6001600160a01b0316816001600160a01b0316146129735760405162461bcd60e51b81526004016108f790613eb6565b6121748282612e30565b6000610ea3836001600160a01b038416612eb3565b5490565b6000610ea38383612fd0565b60006107b982612992565b6001600160a01b03811660009081526006602052604081206129ce81612992565b91506129d981613008565b50919050565b60006107b96129ec612878565b83613011565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115612a345760405162461bcd60e51b81526004016108f790613c3f565b8360ff16601b1480612a4957508360ff16601c145b612a655760405162461bcd60e51b81526004016108f790613cb8565b600060018686868660405160008152602001604052604051612a8a9493929190613a49565b6020604051602081039080840390855afa158015612aac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166107725760405162461bcd60e51b81526004016108f790613a9a565b612ae882610cd8565b612af48161092d6121cb565b610d0f8383612e30565b612b088282611c12565b612174576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055612b3f6121cb565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000612b8f8383613044565b612bc5575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108ce565b5060006108ce565b6001600160e01b031981167f01ffc9a70000000000000000000000000000000000000000000000000000000014919050565b60606000612c0e836002613fe3565b612c19906002613fcb565b67ffffffffffffffff811115612c3f57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612c69576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612cae57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612d0757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612d2b846002613fe3565b612d36906001613fcb565b90505b6001811115612dd7577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612d8557634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110612da957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612dd081614049565b9050612d39565b508315610ea35760405162461bcd60e51b81526004016108f790613ad1565b60008383834630604051602001612e11959493929190613a1d565b6040516020818303038152906040528051906020012090509392505050565b612e3a8282611c12565b15612174576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055612e6f6121cb565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60008181526001830160205260408120548015612fc6576000612ed7600183614002565b8554909150600090612eeb90600190614002565b9050818114612f6c576000866000018281548110612f1957634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080876000018481548110612f4a57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612f8b57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108ce565b60009150506108ce565b6000826000018281548110612ff557634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b80546001019055565b60008282604051602001613026929190613708565b60405160208183030381529060405280519060200120905092915050565b60009081526001919091016020526040902054151590565b5080546000825590600052602060002090810190610bf491906130fe565b82805461308690614060565b90600052602060002090601f0160209004810192826130a857600085556130ee565b82601f106130c15782800160ff198235161785556130ee565b828001600101855582156130ee579182015b828111156130ee5782358255916020019190600101906130d3565b506130fa9291506130fe565b5090565b5b808211156130fa57600081556001016130ff565b80356107bc816140dc565b60008083601f84011261312f578182fd5b50813567ffffffffffffffff811115613146578182fd5b602083019150836020808302850101111561316057600080fd5b9250929050565b803580151581146107bc57600080fd5b60008083601f840112613188578182fd5b50813567ffffffffffffffff81111561319f578182fd5b60208301915083602082850101111561316057600080fd5b6000602082840312156131c8578081fd5b8135610ea3816140dc565b600080604083850312156131e5578081fd5b82356131f0816140dc565b91506020830135613200816140dc565b809150509250929050565b60008060006060848603121561321f578081fd5b833561322a816140dc565b9250602084013561323a816140dc565b929592945050506040919091013590565b600080600080600080600060e0888a031215613265578283fd5b8735613270816140dc565b96506020880135613280816140dc565b95506040880135945060608801359350608088013560ff811681146132a3578384fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806000604084860312156132d4578283fd5b83356132df816140dc565b9250602084013567ffffffffffffffff8111156132fa578283fd5b6133068682870161311e565b9497909650939450505050565b60008060408385031215613325578182fd5b8235613330816140dc565b946020939093013593505050565b60008060208385031215613350578182fd5b823567ffffffffffffffff811115613366578283fd5b6133728582860161311e565b90969095509350505050565b60006020808385031215613390578182fd5b825167ffffffffffffffff8111156133a6578283fd5b8301601f810185136133b6578283fd5b80516133c96133c482613fa7565b613f76565b81815283810190838501858402850186018910156133e5578687fd5b8694505b838510156134105780516133fc816140dc565b8352600194909401939185019185016133e9565b50979650505050505050565b6000806020838503121561342e578182fd5b823567ffffffffffffffff80821115613445578384fd5b818501915085601f830112613458578384fd5b813581811115613466578485fd5b86602060c08302850101111561347a578485fd5b60209290920196919550909350505050565b6000602080838503121561349e578182fd5b825167ffffffffffffffff8111156134b4578283fd5b8301601f810185136134c4578283fd5b80516134d26133c482613fa7565b818152838101908385016040808502860187018a10156134f0578788fd5b8795505b8486101561353e5780828b03121561350a578788fd5b61351381613f76565b825161351e816140dc565b8152828801518882015284526001959095019492860192908101906134f4565b509098975050505050505050565b60006020828403121561355d578081fd5b610ea382613167565b600060208284031215613577578081fd5b5035919050565b60008060408385031215613590578182fd5b823591506020830135613200816140dc565b600080604083850312156135b4578182fd5b50508035926020909101359150565b6000602082840312156135d4578081fd5b81356001600160e01b031981168114610ea3578182fd5b60008060008060408587031215613600578182fd5b843567ffffffffffffffff80821115613617578384fd5b61362388838901613177565b9096509450602087013591508082111561363b578384fd5b5061364887828801613177565b95989497509550505050565b600060808284031215613665578081fd5b61366f6080613f76565b825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b6000602082840312156136ac578081fd5b5051919050565b6001600160a01b03169052565b60008284526020808501945082825b858110156136fd5781356136e2816140dc565b6001600160a01b0316875295820195908201906001016136cf565b509495945050505050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351613776816017850160208801614019565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516137b3816028840160208801614019565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006001600160a01b0385168252604060208301526107726040830184866136c0565b6001600160a01b03929092168252602082015260400190565b60006020825261125d6020830184866136c0565b6020808252825182820181905260009190848201906040850190845b818110156138a25783516001600160a01b03168352928401929184019160010161387d565b50909695505050505050565b6020808252818101839052600090604080840186845b8781101561394f576138d582613167565b151583526138e4858301613167565b1515858401526138f5848301613167565b1515848401526060613908818401613167565b151590840152608061391b838201613167565b15159084015260a061392e838201613113565b61393a828601826136b3565b505060c09283019291909101906001016138c4565b5090979650505050505050565b602080825282518282018190526000919060409081850190868401855b828110156139a757815180516001600160a01b03168552860151868501529284019290850190600101613979565b5091979650505050505050565b901515815260200190565b92151583526001600160a01b03919091166020830152604082015260600190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082528251806020840152613a86816040850160208701614019565b601f01601f19169190910160400192915050565b60208082526018908201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604082015260600190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252600e908201527f444546543a202172657761726473000000000000000000000000000000000000604082015260600190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560408201527f7373000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600d908201527f444546543a202170617573656400000000000000000000000000000000000000604082015260600190565b60208082526017908201527f444546543a202156455354494e475f434f4e5452414354000000000000000000604082015260600190565b6020808252601d908201527f45524332305065726d69743a206578706972656420646561646c696e65000000604082015260600190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604082015261756560f01b606082015260800190565b6020808252600b908201527f444546543a20216275726e000000000000000000000000000000000000000000604082015260600190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604082015261756560f01b606082015260800190565b6020808252601e908201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604082015260600190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460408201527f7265737300000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600c908201527f444546543a207061757365640000000000000000000000000000000000000000604082015260600190565b60208082526027908201527f444546543a207472616e7366657220616d6f756e74206578636565647320616c60408201527f6c6f77616e636500000000000000000000000000000000000000000000000000606082015260800190565b6020808252600b908201527f444546543a202173656c66000000000000000000000000000000000000000000604082015260600190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760408201527f207a65726f000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201527f20726f6c657320666f722073656c660000000000000000000000000000000000606082015260800190565b600060a0820190506001600160a01b038084511683528060208501511660208401525060408301516040830152606083015160608301526080830151608083015292915050565b918252602082015260400190565b60ff91909116815260200190565b604051601f8201601f1916810167ffffffffffffffff81118282101715613f9f57613f9f6140c6565b604052919050565b600067ffffffffffffffff821115613fc157613fc16140c6565b5060209081020190565b60008219821115613fde57613fde6140b0565b500190565b6000816000190483118215151615613ffd57613ffd6140b0565b500290565b600082821015614014576140146140b0565b500390565b60005b8381101561403457818101518382015260200161401c565b83811115614043576000848401525b50505050565b600081614058576140586140b0565b506000190190565b60028104600182168061407457607f821691505b602082108114156129d957634e487b7160e01b600052602260045260246000fd5b60006000198214156140a9576140a96140b0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610bf457600080fdfea2646970667358221220696d4922b0b23ae3f3f6f9c632fa2af5c4ec3041a14cdc576fb1e77a016f5cf764736f6c63430008010033

Verified Source Code Partial Match

Compiler: v0.8.1+commit.df193b15 EVM: istanbul Optimization: Yes (1000 runs)
DefiFactoryToken.sol 1933 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/*
🌎 Website: https://DefiFactory.finance
💻 Dashboard: https://app.defifactory.fi
👉 Telegram: https://t.me/DefiFactoryBot?start=info-join
*/

struct TaxAmountsInput {
    address sender;
    address recipient;
    uint transferAmount;
    uint senderRealBalance;
    uint recipientRealBalance;
}
struct TaxAmountsOutput {
    uint senderRealBalance;
    uint recipientRealBalance;
    uint burnAndRewardAmount;
    uint recipientGetsAmount;
}
struct TemporaryReferralRealAmountsBulk {
    address addr;
    uint realBalance;
}

interface INoBotsTech {
    function prepareTaxAmounts(
        TaxAmountsInput calldata taxAmountsInput
    ) 
        external
        returns(TaxAmountsOutput memory taxAmountsOutput);
    
    function getTemporaryReferralRealAmountsBulk(address[] calldata addrs)
        external
        view
        returns (TemporaryReferralRealAmountsBulk[] memory);
        
    function prepareHumanAddressMintOrBurnRewardsAmounts(bool isMint, address account, uint desiredAmountToMintOrBurn)
        external
        returns (uint realAmountToMintOrBurn);
        
    function getBalance(address account, uint accountBalance)
        external
        view
        returns(uint);
        
    function getRealBalance(address account, uint accountBalance)
        external
        view
        returns(uint);
        
    function getRealBalanceTeamVestingContract(uint accountBalance)
        external
        view
        returns(uint);
        
    function getTotalSupply()
        external
        view
        returns (uint);
        
    function grantRole(bytes32 role, address account) 
        external;
        
    function getCalculatedReferrerRewards(address addr, address[] calldata referrals)
        external
        view
        returns (uint);
        
    function getCachedReferrerRewards(address addr)
        external
        view
        returns (uint);
    
    function updateReferrersRewards(address[] calldata referrals)
        external;
    
    function clearReferrerRewards(address addr)
        external;
    
    function chargeCustomTax(uint taxAmount, uint accountBalance)
        external
        returns (uint);
    
    function chargeCustomTaxTeamVestingContract(uint taxAmount, uint accountBalance)
        external
        returns (uint);
        
    function registerReferral(address referral, address referrer)
        external;
        
    function filterNonZeroReferrals(address[] calldata referrals)
        external
        view
        returns (address[] memory);
        
    function publicForcedUpdateCacheMultiplier()
        external;
    
    event MultiplierUpdated(uint newMultiplier);
    event BotTransactionDetected(address from, address to, uint transferAmount, uint taxedAmount);
    event ReferrerRewardUpdated(address referrer, uint amount);
    event ReferralRegistered(address referral, address referrer);
    event ReferrerReplaced(address referral, address referrerFrom, address referrerTo);
}

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

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

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

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

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

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

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

}

/**
 * @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);
}

/**
 * @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;
    }
}

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    function hasRole(bytes32 role, address account) external view returns (bool);
    function getRoleAdmin(bytes32 role) external view returns (bytes32);
    function grantRole(bytes32 role, address account) external;
    function revokeRole(bytes32 role, address account) external;
    function renounceRole(bytes32 role, address account) external;
}

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `ROLE_ADMIN`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `ROLE_ADMIN` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping (address => bool) members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant ROLE_ADMIN = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if(!hasRole(role, account)) {
            revert(string(abi.encodePacked(
                "AccessControl: account ",
                Strings.toHexString(uint160(account), 20),
                " is missing role ",
                Strings.toHexString(uint256(role), 32)
            )));
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable {
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers;

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

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {grantRole} to track enumerable memberships
     */
    function grantRole(bytes32 role, address account) public virtual override {
        super.grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {revokeRole} to track enumerable memberships
     */
    function revokeRole(bytes32 role, address account) public virtual override {
        super.revokeRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {renounceRole} to track enumerable memberships
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        super.renounceRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {_setupRole} to track enumerable memberships
     */
    function _setupRole(bytes32 role, address account) internal virtual override {
        super._setupRole(role, account);
        _roleMembers[role].add(account);
    }
}

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

/**
 * @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);
}

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping (address => uint256) internal _RealBalances;

    mapping (address => mapping (address => uint256)) internal _allowances;


    string internal _name;
    string internal _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The defaut value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // overriden in parent contract
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _RealBalances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) { }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual { }


    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }
}

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            // solhint-disable-next-line no-inline-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
        } else if (signature.length == 64) {
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            // solhint-disable-next-line no-inline-assembly
            assembly {
                let vs := mload(add(signature, 0x40))
                r := mload(add(signature, 0x20))
                s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
                v := add(shr(255, vs), 27)
            }
        } else {
            revert("ECDSA: invalid signature length");
        }

        return recover(hash, v, r, s);
    }

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

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

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

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

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;
    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
       ...

// [truncated — 68266 bytes total]

Read Contract

DOMAIN_SEPARATOR 0x3644e515 → bytes32
ROLE_ADMIN 0xd391014b → bytes32
ROLE_BURNER 0x54ff02d8 → bytes32
ROLE_MINTER 0x92afc33a → bytes32
ROLE_MODERATOR 0x0288f0fb → bytes32
ROLE_TAXER 0x97c1d32f → bytes32
ROLE_TRANSFERER 0x8493712a → bytes32
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
filterNonZeroReferrals 0x82e17b65 → address[]
getCachedReferrerRewards 0x4abd991d → uint256
getCalculatedReferrerRewards 0x00245783 → uint256
getChainId 0x3408e470 → uint256
getRoleAdmin 0x248a9ca3 → bytes32
getRoleMember 0x9010d07c → address
getRoleMemberCount 0xca15c873 → uint256
getTemporaryReferralRealAmountsBulk 0x68a2972f → tuple[]
getUtilsContractAtPos 0x06fb1a07 → address
getUtilsContractsCount 0x1bf73b72 → uint256
hasRole 0x91d14854 → bool
isPaused 0xb187bd26 → bool
name 0x06fdde03 → string
nonces 0x7ecebe00 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 23 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burnByBridge 0x66830b21
address from
uint256 desiredAmountToBurn
burnHumanAddress 0x18a8ad87
address from
uint256 desiredAmountToBurn
chargeCustomTax 0xb492da91
address from
uint256 amount
claimReferrerRewards 0x5aacfa5d
address[] referrals
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
grantRole 0x2f2ff15d
bytes32 role
address account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mintByBridge 0x1f2eba24
address to
uint256 desiredAmountToMint
mintHumanAddress 0x0bb9ff5d
address to
uint256 desiredAmountToMint
moderatorTransferFromWhilePaused 0xc238651b
address sender
address recipient
uint256 amount
returns: bool
pauseContract 0x439766ce
No parameters
permit 0xd505accf
address owner
address spender
uint256 value
uint256 deadline
uint8 v
bytes32 r
bytes32 s
registerReferral 0x209ab711
address referrer
renounceRole 0x36568abe
bytes32 role
address account
resumeContract 0xc4bc5da5
No parameters
revokeRole 0xd547741f
bytes32 role
address account
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferCustom 0x9cff2eba
address sender
address recipient
uint256 amount
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferFromTeamVestingContract 0x8cbfeb0c
address recipient
uint256 amount
updateNameAndSymbol 0xeaf9d194
string __name
string __symbol
updateUtilsContracts 0x5c1fd015
tuple[] accessSettings

Recent Transactions

No transactions found for this address