Contract 0xD32D01A43C869EDCD1117C640FBDCFCFD97D9D65 4

 

Contract Overview

Nominex: NMX Token
Balance:
0 BNB

BNB Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x516e06f1560f73dde67566d53c2568afb8525211db7dae66de0feb24149fef33Transfer120468332021-10-24 9:53:2110 mins ago0x1e16353fbf835d423d45f9bb07c32537662b9fcc IN  Nominex: NMX Token0 BNB0.000106385
0x44911ef2c809ad4f4dcc2e72170e91af29790cc0729a268f429470d32d7548a3Transfer120467532021-10-24 9:48:5615 mins ago0x25f8a380b2202b53db6c57ddae4fd7e8af3662a6 IN  Nominex: NMX Token0 BNB0.0010253
0x8b14ac8fdab9224df98c96805e77142fd76377204b429e02e54bd08265d03926Transfer120465762021-10-24 9:39:3024 mins ago0xd50649a5027d1ae4b1851c951e8bd4a9a381d9ba IN  Nominex: NMX Token0 BNB0.0007253
0x9ab3872e6c7ce9fc69170f0a40aaa19a0533072e4e35a21352f85fb8cf535860Approve120465042021-10-24 9:35:5128 mins ago0x69b2168ffedc2a5d320f5f217f8fd4f705ce74c2 IN  Nominex: NMX Token0 BNB0.00022258
0x3bf8491c84b4971420c6c1c09fe72ad8bcde17f75b839aa47a7e04b4e3246a37Approve120463902021-10-24 9:30:0934 mins ago0x99f2d2177194526dea4e9a5c2ba687dab2b0b77e IN  Nominex: NMX Token0 BNB0.00022258
0x4e4ebe2fbcdc6db5d3cd1c9ca2be45d15d04ca391f89bf1bceb433da8f5650edApprove120462322021-10-24 9:22:1541 mins ago0x80db16c3b5b66c361578b9d556e0f1609bc9eecd IN  Nominex: NMX Token0 BNB0.00022258
0x04c83c0df74d125542dfeec9deb686626d856a9fb192863995bff9f0568ea21dTransfer120459992021-10-24 9:10:3653 mins ago0xea29510526c36a140ffb7416a13efb8ad6b58f78 IN  Nominex: NMX Token0 BNB0.00102506
0x772397c8930d6051a165cd5a0b99ea6311af52c2ca87b80639b11a3ba5c85dd3Transfer120459582021-10-24 9:08:3355 mins ago0x3dd3b7699f9b4cd939d8cc9720cde01a2444374d IN  Nominex: NMX Token0 BNB0.00102506
0xc624df13b7800fc9a4c4e7d814f69b159baf3bd64ec13528ab46bf4a77b447feApprove120459422021-10-24 9:07:4556 mins ago0x118171a0acd97b200bac36d641ac29d4d8f0cb17 IN  Nominex: NMX Token0 BNB0.00022258
0x1cc498726abdd82850dc755970f0e45809eb8d97c9f331bb096dfc8101af6b8dTransfer120459062021-10-24 9:05:5758 mins ago0xae90b6fbf8f85ff5ba0c174c43b57d16e51852d8 IN  Nominex: NMX Token0 BNB0.0010253
0x96e877b870dfaa364b1c125bff30565e95070a867a2923d7ca6ed3ba2a8cfeefTransfer120458682021-10-24 9:04:031 hr ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000181385
0x7f7c99fbf47fad9f328ce11ed682af855694741acf370f04e5e1d69847f0049fTransfer120458322021-10-24 9:02:151 hr 1 min ago0x3af491c749cb72ef702287e9f53756b81e904a0e IN  Nominex: NMX Token0 BNB0.000106385
0x7ceaad3a75e615606ef179cafe3bc0a0c6c9c4ab070f70cd043d273a001add00Transfer120458312021-10-24 9:02:121 hr 2 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0xdc9f86f8f621ad02164ea01018bef35f96666d96a1a167d7aee045cdce730e46Transfer120458102021-10-24 9:01:091 hr 3 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0xba3b63925dfb363d9c8425f3961f4388ae33ee3321c7ff18d7eda58341013292Transfer120458052021-10-24 9:00:541 hr 3 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0x1e36066ddeb3ffe0dc2055a1337f27c636d896fed32870beb16a7c8e8b7f6dbcTransfer120458002021-10-24 9:00:391 hr 3 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0x9ba106564b113832771f1844e925575384537f0ad1635f32680d00a4a366b1c5Transfer120457962021-10-24 9:00:271 hr 3 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0x2ab2da02a35cc62bcb5e8743597262aa904a5fa9c8c4dfa3523d223a10d1041fTransfer120457922021-10-24 9:00:151 hr 3 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0x67dd7a77ccb97152bd7d498ec743fd09591f0365fb439e6817777544a095e05cTransfer120457762021-10-24 8:59:271 hr 4 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000208265
0x4ff51f056ffa2b35067fb3e6d16beda9c3233397efdc8d1ca85fea21a4583dfdTransfer120457722021-10-24 8:59:151 hr 4 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0xdb50eb941f4eb4e2e02a3fc4704e6031d609805e1c0825881de67be1fb24ce92Transfer120457662021-10-24 8:58:571 hr 5 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0xb972556ae5f8e18a169e74cd880b3bb5112259e98fb43e5774310353b68d6913Transfer120457612021-10-24 8:58:421 hr 5 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0x573655fa015642755140f4afd721a107bdef447e4f9f280204d280efb2891aebTransfer120457562021-10-24 8:58:271 hr 5 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0xea53e39fd3ff10fbc638842a11f0134428ae4ac650804514bd9672387d251685Transfer120457532021-10-24 8:58:181 hr 5 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
0x1cba2cf0d6a1e6ba27b0228ae2f1ccb399996f913f6c18b457f1ba72e122ad13Transfer120457362021-10-24 8:57:271 hr 6 mins ago0x1a72cce42499361fff103855f845b8cfc1c25b67 IN  Nominex: NMX Token0 BNB0.000256385
[ Download CSV Export 

OVERVIEW

NMX is the utility token of Nominex exchange that allows for utilitarian staking.

Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x602acce862a7a10978cd38f4def1d31ebe877a4bd902e3f97f2ffc3cda54df6f54713122021-03-07 11:58:33230 days 22 hrs ago PancakeSwap: BUSD-T-NMX 3 Nominex: NMX Token0 BNB
0x602acce862a7a10978cd38f4def1d31ebe877a4bd902e3f97f2ffc3cda54df6f54713122021-03-07 11:58:33230 days 22 hrs ago PancakeSwap: BUSD-T-NMX 3 Nominex: NMX Token0 BNB
0x44f1cdc13a12b43254b4ef525a8a1e865b5666fbe4a22319c2c5a10291d3886f54712982021-03-07 11:57:51230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
0x44f1cdc13a12b43254b4ef525a8a1e865b5666fbe4a22319c2c5a10291d3886f54712982021-03-07 11:57:51230 days 22 hrs ago Nominex: NMX Token 0xc86e74935181acb6de7c9d8307dd4092e35cf4d00 BNB
0x44f1cdc13a12b43254b4ef525a8a1e865b5666fbe4a22319c2c5a10291d3886f54712982021-03-07 11:57:51230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
0xca19702aae9a79859ec19810de942be6df896dc36ee099bc154837a7039d67d054712822021-03-07 11:57:03230 days 22 hrs ago PancakeSwap: BUSD-T-NMX 3 Nominex: NMX Token0 BNB
0xca19702aae9a79859ec19810de942be6df896dc36ee099bc154837a7039d67d054712822021-03-07 11:57:03230 days 22 hrs ago PancakeSwap: Router Nominex: NMX Token0 BNB
0xe48216f103957ef673157e2f2e3a590a0e980d0d18800c515069b03a466c052a54712632021-03-07 11:56:06230 days 22 hrs ago 0x9cd2d1a3214c12bb6dbfa7dbc3b0641c26a2f9a6 Nominex: NMX Token0 BNB
0xe48216f103957ef673157e2f2e3a590a0e980d0d18800c515069b03a466c052a54712632021-03-07 11:56:06230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
0xe48216f103957ef673157e2f2e3a590a0e980d0d18800c515069b03a466c052a54712632021-03-07 11:56:06230 days 22 hrs ago Nominex: NMX Token 0xc86e74935181acb6de7c9d8307dd4092e35cf4d00 BNB
0xe48216f103957ef673157e2f2e3a590a0e980d0d18800c515069b03a466c052a54712632021-03-07 11:56:06230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
0xdbcd3d6e315628349a4207c5ec16ef975a2c28f3f47554d5a24f5584440b505854712622021-03-07 11:56:03230 days 22 hrs ago PancakeSwap: BUSD-T-NMX 3 Nominex: NMX Token0 BNB
0xdbcd3d6e315628349a4207c5ec16ef975a2c28f3f47554d5a24f5584440b505854712622021-03-07 11:56:03230 days 22 hrs ago PancakeSwap: BUSD-T-NMX 3 Nominex: NMX Token0 BNB
0xd74d45e99b4c08fb4b2ea0b418c435262e0a118872b35ec516986f62c62c5ae454712462021-03-07 11:55:15230 days 22 hrs ago PancakeSwap: BUSD-T-NMX 3 Nominex: NMX Token0 BNB
0xd74d45e99b4c08fb4b2ea0b418c435262e0a118872b35ec516986f62c62c5ae454712462021-03-07 11:55:15230 days 22 hrs ago PancakeSwap: Router Nominex: NMX Token0 BNB
0x15cfa4bcdea5ee2e031138c6a6857051dd014c7d213faad10b8381e305d0aefd54712422021-03-07 11:55:03230 days 22 hrs ago 0x9cd2d1a3214c12bb6dbfa7dbc3b0641c26a2f9a6 Nominex: NMX Token0 BNB
0x15cfa4bcdea5ee2e031138c6a6857051dd014c7d213faad10b8381e305d0aefd54712422021-03-07 11:55:03230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
0x15cfa4bcdea5ee2e031138c6a6857051dd014c7d213faad10b8381e305d0aefd54712422021-03-07 11:55:03230 days 22 hrs ago Nominex: NMX Token 0xc86e74935181acb6de7c9d8307dd4092e35cf4d00 BNB
0x15cfa4bcdea5ee2e031138c6a6857051dd014c7d213faad10b8381e305d0aefd54712422021-03-07 11:55:03230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
0x652418b31f972a202a3792d96e4e2957faa07f78d81ce2aac43852d37dcd5c3e54712282021-03-07 11:54:21230 days 22 hrs ago PancakeSwap: BUSD-T-NMX 3 Nominex: NMX Token0 BNB
0x652418b31f972a202a3792d96e4e2957faa07f78d81ce2aac43852d37dcd5c3e54712282021-03-07 11:54:21230 days 22 hrs ago PancakeSwap: Router Nominex: NMX Token0 BNB
0xf33d60e0b8617e0ff3abb02f7bb95d2ca0f18a165d288f7acc73f254c432c23654712232021-03-07 11:54:06230 days 22 hrs ago 0x9cd2d1a3214c12bb6dbfa7dbc3b0641c26a2f9a6 Nominex: NMX Token0 BNB
0xf33d60e0b8617e0ff3abb02f7bb95d2ca0f18a165d288f7acc73f254c432c23654712232021-03-07 11:54:06230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
0xf33d60e0b8617e0ff3abb02f7bb95d2ca0f18a165d288f7acc73f254c432c23654712232021-03-07 11:54:06230 days 22 hrs ago Nominex: NMX Token 0xc86e74935181acb6de7c9d8307dd4092e35cf4d00 BNB
0xf33d60e0b8617e0ff3abb02f7bb95d2ca0f18a165d288f7acc73f254c432c23654712232021-03-07 11:54:06230 days 22 hrs ago 0xc2f8f34907c73e3bf509e8f82eb44cb0a7e00cdc Nominex: NMX Token0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Nmx

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : Lib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;

/**
 * @dev kinds of possible pools
 *
 * @param DEFAULT_VALUE - dummy type for null value
 * @param PRIMARY - blockchain based staking. All rules are declared in the  contracts
 * @param NOMINEX - tokens for Nominex company (BONUS and TEAM pools included)
 */
enum MintPool {DEFAULT_VALUE, PRIMARY, NOMINEX}

/**
 * @dev current state of the schedule for each MintPool
 *
 * @param time last invocation time
 * @param itemIndex index of current item in MintSchedule.items
 * @param weekIndex index of current week in current item in MintSchedule.items
 * @param weekStartTime start time of the current week
 * @param nextTickSupply amount of Nmx to be distributed next second
 */
struct MintScheduleState {
    uint40 time;
    uint8 itemIndex;
    uint16 weekIndex;
    uint40 weekStartTime;
    uint128 nextTickSupply;
}

File 2 of 11 : MintSchedule.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "./Lib.sol";
import "./RecoverableByOwner.sol";
import "abdk-libraries-solidity/ABDKMath64x64.sol";

contract MintSchedule is RecoverableByOwner {
    /**
     @dev structure to describe the mint schedule. After each week MintScheduleState.nextTickSupply decreases.
     When the schedule completes weekCount weeks in current item it goes to the next item in the items.
     @param weekCount duration of the item in weeks
     @param weekCompletenessMultiplier a number nextTickSupply is multiplied by after each week in the item
     @param poolShares shares of the mint pool in the item
     */
    struct ScheduleItem {
        uint16 weekCount;
        int128 weekCompletenessMultiplier;
        int128[] poolShares;
    }
    uint40 constant WEEK_DURATION = 7 days;

    using ABDKMath64x64 for int128;
    ScheduleItem[] public items; /// @dev array of shcedule describing items

    constructor() {
        // 0.0, 0.625, 0.375
        int128[3] memory shares_01_28 =
            [
                0,
                ABDKMath64x64.divu(625, 1000),
                ABDKMath64x64.divu(375, 1000)
            ];

        // 0.0, 0.5625, 0.4375
        int128[3] memory shares_29_56 =
            [
                0,
                ABDKMath64x64.divu(5625, 10000),
                ABDKMath64x64.divu(4375, 10000)
            ];

        // 0.0, 0.5, 0.5
        int128[3] memory shares_57_xx =
            [
                0,
                ABDKMath64x64.divu(5, 10),
                ABDKMath64x64.divu(5, 10)
            ];

        /* period 1-7 days | duration 7 days | summary 1 week */
        ScheduleItem storage item = items.push();
        item.weekCount = 1;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(75, 100);
        item.poolShares = shares_01_28;

        /* period 8-14 days | duration 7 days | summary 2 weeks */
        item = items.push();
        item.weekCount = 1;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(35, 100);
        item.poolShares = shares_01_28;

        /* period 15-28 days | 2 weeks | summary 4 weeks */
        item = items.push();
        item.weekCount = 2;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(104, 100);
        item.poolShares = shares_01_28;

        /* period 29-56 days | 4 weeks | summary 8 weeks */
        item = items.push();
        item.weekCount = 4;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(104, 100);
        item.poolShares = shares_29_56;

        /* period 57-105 days | 7 weeks | summary 15 weeks */
        item = items.push();
        item.weekCount = 7;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(104, 100);
        item.poolShares = shares_57_xx;

        /* period 106-196 days | duration 3 months | summary 28 weeks */
        item = items.push();
        item.weekCount = 13;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(102, 100);
        item.poolShares = shares_57_xx;

        /* period 197-287 days | duration 3 months | summary 41 weeks */
        item = items.push();
        item.weekCount = 13;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(101, 100);
        item.poolShares = shares_57_xx;

        /* period 288-378 days | duration 3 months | summary 54 weeks */
        item = items.push();
        item.weekCount = 13;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(1, 1);
        item.poolShares = shares_57_xx;

        /* period 379-560 days | duration 6 months | summary 80 weeks */
        item = items.push();
        item.weekCount = 26;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(9995, 10000);
        item.poolShares = shares_57_xx;

        /* period 561-742 days | duration 6 months | summary 106 weeks */
        item = items.push();
        item.weekCount = 26;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(999, 1000);
        item.poolShares = shares_57_xx;

        /* period 743-924 days | duration 6 months | summary 132 weeks */
        item = items.push();
        item.weekCount = 26;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(9985, 10000);
        item.poolShares = shares_57_xx;

        /* period 925-1106 days | duration 6 months | summary 158 weeks */
        item = items.push();
        item.weekCount = 26;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(998, 1000);
        item.poolShares = shares_57_xx;

        /* period 1107-1470 days | duration 1 year | summary 210 weeks */
        item = items.push();
        item.weekCount = 52;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(9975, 10000);
        item.poolShares = shares_57_xx;

        /* period 1471-1834 days | duration 1 year | summary 262 weeks */
        item = items.push();
        item.weekCount = 52;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(997, 1000);
        item.poolShares = shares_57_xx;

        /* period 1835-2198 days | duration 1 year | summary 314 weeks */
        item = items.push();
        item.weekCount = 52;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(9965, 10000);
        item.poolShares = shares_57_xx;

        /* period 2199-2562 days | duration 1 year | summary 366 weeks */
        item = items.push();
        item.weekCount = 52;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(996, 1000);
        item.poolShares = shares_57_xx;

        /* period 2563-2926 days | duration 1 year | summary 418 weeks */
        item = items.push();
        item.weekCount = 52;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(997, 1000);
        item.poolShares = shares_57_xx;

        /* period 2927-3654 days | duration 2 year | summary 522 weeks */
        item = items.push();
        item.weekCount = 104;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(998, 1000);
        item.poolShares = shares_57_xx;

        /* period 3655-5110 days | duration 4 years | summary 730 weeks */
        item = items.push();
        item.weekCount = 208;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(999, 1000);
        item.poolShares = shares_57_xx;

        /* period 5111-8022 days | duration 8 years | summary 1146 weeks */
        item = items.push();
        item.weekCount = 416;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(9995, 10000);
        item.poolShares = shares_57_xx;

        /* period 8023-22582 days | duration 40 years | summary 3226 weeks */
        item = items.push();
        item.weekCount = 2080;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(9999, 10000);
        item.poolShares = shares_57_xx;

        /* period 22583-26096 days | duration 10 years (without 18 weeks) | summary 3728 weeks */
        item = items.push();
        item.weekCount = 502;
        item.weekCompletenessMultiplier = ABDKMath64x64.divu(99995, 100000);
        item.poolShares = shares_57_xx;
    }

    /**
     @dev calculates changes in scheduleState based on the time passed from last update and returns updated state and amount of Nmx to be minted
     */
    function makeProgress(
        MintScheduleState memory scheduleState,
        uint40 time,
        MintPool pool
    ) external view returns (uint256 nmxSupply, MintScheduleState memory) {
        if (time <= scheduleState.time) return (0, scheduleState);
        while (
            time > scheduleState.time && scheduleState.itemIndex < items.length
        ) {
            ScheduleItem storage item = items[scheduleState.itemIndex];
            uint40 boundary =
                min(time, scheduleState.weekStartTime + WEEK_DURATION);
            uint256 secondsFromLastUpdate = boundary - scheduleState.time;
            nmxSupply +=
                secondsFromLastUpdate *
                item.poolShares[uint256(pool)].mulu(
                    uint256(scheduleState.nextTickSupply)
                );
            persistStateChange(scheduleState, item, boundary);
        }
        return (nmxSupply, scheduleState);
    }

    function persistStateChange(
        MintScheduleState memory state,
        ScheduleItem memory item,
        uint40 time
    ) private pure {
        state.time = time;
        if (time == state.weekStartTime + WEEK_DURATION) {
            state.nextTickSupply = uint128(
                item.weekCompletenessMultiplier.mulu(
                    uint256(state.nextTickSupply)
                )
            );
            state.weekIndex++;
            state.weekStartTime = time;
            if (state.weekIndex == item.weekCount) {
                state.weekIndex = 0;
                state.itemIndex++;
            }
        }
    }

    function min(uint40 a, uint40 b) private pure returns (uint40) {
        if (a < b) return a;
        return b;
    }
}

File 3 of 11 : Nmx.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "./NmxSupplier.sol";
import "./MintSchedule.sol";
import "./RecoverableByOwner.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract Nmx is ERC20, NmxSupplier, RecoverableByOwner {
    bytes32 immutable public DOMAIN_SEPARATOR;
    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant PERMIT_TYPEHASH =
        0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
    mapping(address => uint256) public nonces;

    address public mintSchedule;
    mapping(address => MintPool) public poolByOwner;
    address[3] public poolOwners; // 3 - number of MintPool values
    /** @dev dedicated state for every pool to decrease gas consumtion in case of staking/unstaking - no updates related to other mint pools are required to be persisted */
    MintScheduleState[3] public poolMintStates; // 3 - number of MintPool values

    uint40 private constant DISTRIBUTION_START_TIME = 1614319200; // 2021-02-26T06:00:00Z

    event PoolOwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner,
        MintPool indexed pool
    );
    event ScheduleChanged(address previousSchedule, address newSchedule);

    constructor(address _mintSchedule) ERC20("Nominex", "NMX") {
        uint256 chainId;
        assembly {
            chainId := chainid()
        }
        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256(
                    "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
                ),
                keccak256(bytes(name())),
                keccak256(bytes("1")),
                chainId,
                address(this)
            )
        );
        emit ScheduleChanged(mintSchedule, _mintSchedule);
        mintSchedule = _mintSchedule;
        for (
            uint256 i = uint256(MintPool.PRIMARY);
            i <= uint256(MintPool.NOMINEX);
            i++
        ) {
            MintScheduleState storage poolMintState = poolMintStates[i];
            poolMintState.nextTickSupply =
                (40000 * 10**18) /
                uint40(1 days) +
                1; // +1 - to coupe with rounding error when daily supply is 9999.9999...
            poolMintState.time = DISTRIBUTION_START_TIME;
            poolMintState.weekStartTime = DISTRIBUTION_START_TIME;
        }
        // amount of Nmx has been distributed or sold already at the moment of contract deployment
        uint256 alreadyDistributedAmount = 7505656;
        // airdrops, starts of liquidity mining pools, running other secondary liquidity mining pools
        uint256 additionalAmount = 20000000;
        _mint(_msgSender(), (alreadyDistributedAmount + additionalAmount) * 10**18);
    }

    function changeSchedule(address _mintSchedule) external onlyOwner {
        require(_mintSchedule != address(0), "NMX: new schedule can not have zero address");
        require(_mintSchedule != mintSchedule, "NMX: new schedule can not be equal to the previous one");
        emit ScheduleChanged(mintSchedule, _mintSchedule);
        mintSchedule = _mintSchedule;
    }

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        require(deadline >= block.timestamp, "NMX: deadline expired");
        bytes32 digest =
            keccak256(
                abi.encodePacked(
                    "\x19\x01",
                    DOMAIN_SEPARATOR,
                    keccak256(
                        abi.encode(
                            PERMIT_TYPEHASH,
                            owner,
                            spender,
                            value,
                            nonces[owner]++,
                            deadline
                        )
                    )
                )
            );
        address recoveredAddress = ecrecover(digest, v, r, s);
        require(
            recoveredAddress != address(0) && recoveredAddress == owner,
            "NMX: invalid signature"
        );
        _approve(owner, spender, value);
    }

    /// @dev the contract owner can change any of mint pool owners
    function transferPoolOwnership(MintPool pool, address newOwner) external {
        address currentOwner = poolOwners[uint256(pool)];
        require(
            newOwner != currentOwner,
            "NMX: new owner must differs from the old one"
        );
        require(
            _msgSender() == owner() || _msgSender() == currentOwner,
            "NMX: only owner can transfer pool ownership"
        );
        MintPool existentPoolOfNewOwner = poolByOwner[newOwner];
        require(MintPool.DEFAULT_VALUE == existentPoolOfNewOwner || newOwner == address(0), "NMX: every pool must have dedicated owner");

        emit PoolOwnershipTransferred(currentOwner, newOwner, pool);
        poolOwners[uint256(pool)] = newOwner;
        poolByOwner[currentOwner] = MintPool.DEFAULT_VALUE;
        poolByOwner[newOwner] = pool;
    }

    /**
      @dev if caller is owner of any mint pool it will be supplied with Nmx based on the schedule and time passed from the moment
      when the method was invoked by the same mint pool owner last time
      @param maxTime the upper limit of the time to make calculations
    */
    function supplyNmx(uint40 maxTime) external override returns (uint256) {
        if (maxTime > uint40(block.timestamp)) maxTime = uint40(block.timestamp);
        MintPool pool = poolByOwner[_msgSender()];
        if (pool == MintPool.DEFAULT_VALUE) return 0;
        MintScheduleState storage state = poolMintStates[uint256(pool)];
        (uint256 supply, MintScheduleState memory newState) =
            MintSchedule(mintSchedule).makeProgress(
                state,
                maxTime,
                pool
            );
        poolMintStates[uint256(pool)] = newState;
        _mint(_msgSender(), supply);
        return supply;
    }

    /// @dev view function to support displaying PRIMARY POOL daily supply on UI
    function rewardRate() external view returns (uint256) {
        (, MintScheduleState memory newState) =
            MintSchedule(mintSchedule).makeProgress(
                poolMintStates[uint256(MintPool.PRIMARY)],
                uint40(block.timestamp),
                MintPool.PRIMARY
            );
        return uint256(newState.nextTickSupply);
    }
}

File 4 of 11 : NmxSupplier.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.8.0;

/**
 * @dev Interface to got minted Nmx.
 */
interface NmxSupplier {
    /**
      @dev if caller is owner of any mint pool it will be supplied with Nmx based on the schedule and time passed from the moment
      when the method was invoked by the same mint pool owner last time
      @param maxTime the upper limit of the time to make calculations
    */
    function supplyNmx(uint40 maxTime) external returns (uint256);
}

File 5 of 11 : RecoverableByOwner.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.8.0;

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

/**
 @dev The contract is intendent to help recovering arbitrary ERC20 tokens and ETH accidentally transferred to the contract address
 */
abstract contract RecoverableByOwner is Ownable {
    function getRecoverableAmount(address tokenAddress)
        internal
        view
        virtual
        returns (uint256)
    {
        if (tokenAddress == address(0)) return address(this).balance;
        else return IERC20(tokenAddress).balanceOf(address(this));
    }

    /**
     @param tokenAddress ERC20 token's address to recover or address(0) to recover ETH
     @param amount to recover from contract's address
     @param to address to receive tokens from the contract
     */
    function recoverFunds(
        address tokenAddress,
        uint256 amount,
        address to
    ) external onlyOwner {
        uint256 recoverableAmount = getRecoverableAmount(tokenAddress);
        require(
            amount <= recoverableAmount,
            "RecoverableByOwner: RECOVERABLE_AMOUNT_NOT_ENOUGH"
        );
        if (tokenAddress == address(0)) recoverEth(amount, to);
        else recoverErc20(tokenAddress, amount, to);
    }

    function recoverEth(uint256 amount, address to) private {
        address payable toPayable = payable(to);
        toPayable.transfer(amount);
    }

    function recoverErc20(
        address tokenAddress,
        uint256 amount,
        address to
    ) private {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = tokenAddress.call(abi.encodeWithSelector(0xa9059cbb, to, amount));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'RecoverableByOwner: TRANSFER_FAILED');
    }
}

File 6 of 11 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

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

File 7 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../GSN/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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

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

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

File 8 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @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) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @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 sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

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

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts 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 mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 9 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";

/**
 * @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 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) public {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view 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 {_setupDecimals} is
     * called.
     *
     * 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 returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[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) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @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) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @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].add(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) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        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 {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @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 Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens 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 amount) internal virtual { }
}

File 10 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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);
}

File 11 of 11 : ABDKMath64x64.sol
// SPDX-License-Identifier: BSD-4-Clause
/*
 * ABDK Math 64.64 Smart Contract Library.  Copyright © 2019 by ABDK Consulting.
 * Author: Mikhail Vladimirov <[email protected]>
 */
pragma solidity ^0.5.0 || ^0.6.0 || ^0.7.0;

/**
 * Smart contract library of mathematical functions operating with signed
 * 64.64-bit fixed point numbers.  Signed 64.64-bit fixed point number is
 * basically a simple fraction whose numerator is signed 128-bit integer and
 * denominator is 2^64.  As long as denominator is always the same, there is no
 * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are
 * represented by int128 type holding only the numerator.
 */
library ABDKMath64x64 {
  /*
   * Minimum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;

  /*
   * Maximum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

  /**
   * Convert signed 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromInt (int256 x) internal pure returns (int128) {
    require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF);
    return int128 (x << 64);
  }

  /**
   * Convert signed 64.64 fixed point number into signed 64-bit integer number
   * rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64-bit integer number
   */
  function toInt (int128 x) internal pure returns (int64) {
    return int64 (x >> 64);
  }

  /**
   * Convert unsigned 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromUInt (uint256 x) internal pure returns (int128) {
    require (x <= 0x7FFFFFFFFFFFFFFF);
    return int128 (x << 64);
  }

  /**
   * Convert signed 64.64 fixed point number into unsigned 64-bit integer
   * number rounding down.  Revert on underflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return unsigned 64-bit integer number
   */
  function toUInt (int128 x) internal pure returns (uint64) {
    require (x >= 0);
    return uint64 (x >> 64);
  }

  /**
   * Convert signed 128.128 fixed point number into signed 64.64-bit fixed point
   * number rounding down.  Revert on overflow.
   *
   * @param x signed 128.128-bin fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function from128x128 (int256 x) internal pure returns (int128) {
    int256 result = x >> 64;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Convert signed 64.64 fixed point number into signed 128.128 fixed point
   * number.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 128.128 fixed point number
   */
  function to128x128 (int128 x) internal pure returns (int256) {
    return int256 (x) << 64;
  }

  /**
   * Calculate x + y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function add (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) + y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x - y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sub (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) - y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x * y rounding down.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function mul (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) * y >> 64;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x * y rounding towards zero, where x is signed 64.64 fixed point
   * number and y is signed 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y signed 256-bit integer number
   * @return signed 256-bit integer number
   */
  function muli (int128 x, int256 y) internal pure returns (int256) {
    if (x == MIN_64x64) {
      require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF &&
        y <= 0x1000000000000000000000000000000000000000000000000);
      return -y << 63;
    } else {
      bool negativeResult = false;
      if (x < 0) {
        x = -x;
        negativeResult = true;
      }
      if (y < 0) {
        y = -y; // We rely on overflow behavior here
        negativeResult = !negativeResult;
      }
      uint256 absoluteResult = mulu (x, uint256 (y));
      if (negativeResult) {
        require (absoluteResult <=
          0x8000000000000000000000000000000000000000000000000000000000000000);
        return -int256 (absoluteResult); // We rely on overflow behavior here
      } else {
        require (absoluteResult <=
          0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
        return int256 (absoluteResult);
      }
    }
  }

  /**
   * Calculate x * y rounding down, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y unsigned 256-bit integer number
   * @return unsigned 256-bit integer number
   */
  function mulu (int128 x, uint256 y) internal pure returns (uint256) {
    if (y == 0) return 0;

    require (x >= 0);

    uint256 lo = (uint256 (x) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64;
    uint256 hi = uint256 (x) * (y >> 128);

    require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
    hi <<= 64;

    require (hi <=
      0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo);
    return hi + lo;
  }

  /**
   * Calculate x / y rounding towards zero.  Revert on overflow or when y is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function div (int128 x, int128 y) internal pure returns (int128) {
    require (y != 0);
    int256 result = (int256 (x) << 64) / y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are signed 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x signed 256-bit integer number
   * @param y signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divi (int256 x, int256 y) internal pure returns (int128) {
    require (y != 0);

    bool negativeResult = false;
    if (x < 0) {
      x = -x; // We rely on overflow behavior here
      negativeResult = true;
    }
    if (y < 0) {
      y = -y; // We rely on overflow behavior here
      negativeResult = !negativeResult;
    }
    uint128 absoluteResult = divuu (uint256 (x), uint256 (y));
    if (negativeResult) {
      require (absoluteResult <= 0x80000000000000000000000000000000);
      return -int128 (absoluteResult); // We rely on overflow behavior here
    } else {
      require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return int128 (absoluteResult); // We rely on overflow behavior here
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divu (uint256 x, uint256 y) internal pure returns (int128) {
    require (y != 0);
    uint128 result = divuu (x, y);
    require (result <= uint128 (MAX_64x64));
    return int128 (result);
  }

  /**
   * Calculate -x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function neg (int128 x) internal pure returns (int128) {
    require (x != MIN_64x64);
    return -x;
  }

  /**
   * Calculate |x|.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function abs (int128 x) internal pure returns (int128) {
    require (x != MIN_64x64);
    return x < 0 ? -x : x;
  }

  /**
   * Calculate 1 / x rounding towards zero.  Revert on overflow or when x is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function inv (int128 x) internal pure returns (int128) {
    require (x != 0);
    int256 result = int256 (0x100000000000000000000000000000000) / x;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function avg (int128 x, int128 y) internal pure returns (int128) {
    return int128 ((int256 (x) + int256 (y)) >> 1);
  }

  /**
   * Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down.
   * Revert on overflow or in case x * y is negative.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function gavg (int128 x, int128 y) internal pure returns (int128) {
    int256 m = int256 (x) * int256 (y);
    require (m >= 0);
    require (m <
        0x4000000000000000000000000000000000000000000000000000000000000000);
    return int128 (sqrtu (uint256 (m)));
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y uint256 value
   * @return signed 64.64-bit fixed point number
   */
  function pow (int128 x, uint256 y) internal pure returns (int128) {
    uint256 absoluteResult;
    bool negativeResult = false;
    if (x >= 0) {
      absoluteResult = powu (uint256 (x) << 63, y);
    } else {
      // We rely on overflow behavior here
      absoluteResult = powu (uint256 (uint128 (-x)) << 63, y);
      negativeResult = y & 1 > 0;
    }

    absoluteResult >>= 63;

    if (negativeResult) {
      require (absoluteResult <= 0x80000000000000000000000000000000);
      return -int128 (absoluteResult); // We rely on overflow behavior here
    } else {
      require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return int128 (absoluteResult); // We rely on overflow behavior here
    }
  }

  /**
   * Calculate sqrt (x) rounding down.  Revert if x < 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sqrt (int128 x) internal pure returns (int128) {
    require (x >= 0);
    return int128 (sqrtu (uint256 (x) << 64));
  }

  /**
   * Calculate binary logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function log_2 (int128 x) internal pure returns (int128) {
    require (x > 0);

    int256 msb = 0;
    int256 xc = x;
    if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
    if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
    if (xc >= 0x10000) { xc >>= 16; msb += 16; }
    if (xc >= 0x100) { xc >>= 8; msb += 8; }
    if (xc >= 0x10) { xc >>= 4; msb += 4; }
    if (xc >= 0x4) { xc >>= 2; msb += 2; }
    if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

    int256 result = msb - 64 << 64;
    uint256 ux = uint256 (x) << uint256 (127 - msb);
    for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) {
      ux *= ux;
      uint256 b = ux >> 255;
      ux >>= 127 + b;
      result += bit * int256 (b);
    }

    return int128 (result);
  }

  /**
   * Calculate natural logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function ln (int128 x) internal pure returns (int128) {
    require (x > 0);

    return int128 (
        uint256 (log_2 (x)) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128);
  }

  /**
   * Calculate binary exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp_2 (int128 x) internal pure returns (int128) {
    require (x < 0x400000000000000000); // Overflow

    if (x < -0x400000000000000000) return 0; // Underflow

    uint256 result = 0x80000000000000000000000000000000;

    if (x & 0x8000000000000000 > 0)
      result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128;
    if (x & 0x4000000000000000 > 0)
      result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128;
    if (x & 0x2000000000000000 > 0)
      result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128;
    if (x & 0x1000000000000000 > 0)
      result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128;
    if (x & 0x800000000000000 > 0)
      result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128;
    if (x & 0x400000000000000 > 0)
      result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128;
    if (x & 0x200000000000000 > 0)
      result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128;
    if (x & 0x100000000000000 > 0)
      result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128;
    if (x & 0x80000000000000 > 0)
      result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128;
    if (x & 0x40000000000000 > 0)
      result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128;
    if (x & 0x20000000000000 > 0)
      result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128;
    if (x & 0x10000000000000 > 0)
      result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128;
    if (x & 0x8000000000000 > 0)
      result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128;
    if (x & 0x4000000000000 > 0)
      result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128;
    if (x & 0x2000000000000 > 0)
      result = result * 0x1000162E525EE054754457D5995292026 >> 128;
    if (x & 0x1000000000000 > 0)
      result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128;
    if (x & 0x800000000000 > 0)
      result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128;
    if (x & 0x400000000000 > 0)
      result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128;
    if (x & 0x200000000000 > 0)
      result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128;
    if (x & 0x100000000000 > 0)
      result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128;
    if (x & 0x80000000000 > 0)
      result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128;
    if (x & 0x40000000000 > 0)
      result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128;
    if (x & 0x20000000000 > 0)
      result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128;
    if (x & 0x10000000000 > 0)
      result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128;
    if (x & 0x8000000000 > 0)
      result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128;
    if (x & 0x4000000000 > 0)
      result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128;
    if (x & 0x2000000000 > 0)
      result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128;
    if (x & 0x1000000000 > 0)
      result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128;
    if (x & 0x800000000 > 0)
      result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128;
    if (x & 0x400000000 > 0)
      result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128;
    if (x & 0x200000000 > 0)
      result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128;
    if (x & 0x100000000 > 0)
      result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128;
    if (x & 0x80000000 > 0)
      result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128;
    if (x & 0x40000000 > 0)
      result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128;
    if (x & 0x20000000 > 0)
      result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128;
    if (x & 0x10000000 > 0)
      result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128;
    if (x & 0x8000000 > 0)
      result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128;
    if (x & 0x4000000 > 0)
      result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128;
    if (x & 0x2000000 > 0)
      result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128;
    if (x & 0x1000000 > 0)
      result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128;
    if (x & 0x800000 > 0)
      result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128;
    if (x & 0x400000 > 0)
      result = result * 0x100000000002C5C85FDF477B662B26945 >> 128;
    if (x & 0x200000 > 0)
      result = result * 0x10000000000162E42FEFA3AE53369388C >> 128;
    if (x & 0x100000 > 0)
      result = result * 0x100000000000B17217F7D1D351A389D40 >> 128;
    if (x & 0x80000 > 0)
      result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128;
    if (x & 0x40000 > 0)
      result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128;
    if (x & 0x20000 > 0)
      result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128;
    if (x & 0x10000 > 0)
      result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128;
    if (x & 0x8000 > 0)
      result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128;
    if (x & 0x4000 > 0)
      result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128;
    if (x & 0x2000 > 0)
      result = result * 0x1000000000000162E42FEFA39F02B772C >> 128;
    if (x & 0x1000 > 0)
      result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128;
    if (x & 0x800 > 0)
      result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128;
    if (x & 0x400 > 0)
      result = result * 0x100000000000002C5C85FDF473DEA871F >> 128;
    if (x & 0x200 > 0)
      result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128;
    if (x & 0x100 > 0)
      result = result * 0x100000000000000B17217F7D1CF79E949 >> 128;
    if (x & 0x80 > 0)
      result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128;
    if (x & 0x40 > 0)
      result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128;
    if (x & 0x20 > 0)
      result = result * 0x100000000000000162E42FEFA39EF366F >> 128;
    if (x & 0x10 > 0)
      result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128;
    if (x & 0x8 > 0)
      result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128;
    if (x & 0x4 > 0)
      result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128;
    if (x & 0x2 > 0)
      result = result * 0x1000000000000000162E42FEFA39EF358 >> 128;
    if (x & 0x1 > 0)
      result = result * 0x10000000000000000B17217F7D1CF79AB >> 128;

    result >>= uint256 (63 - (x >> 64));
    require (result <= uint256 (MAX_64x64));

    return int128 (result);
  }

  /**
   * Calculate natural exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp (int128 x) internal pure returns (int128) {
    require (x < 0x400000000000000000); // Overflow

    if (x < -0x400000000000000000) return 0; // Underflow

    return exp_2 (
        int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128));
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return unsigned 64.64-bit fixed point number
   */
  function divuu (uint256 x, uint256 y) private pure returns (uint128) {
    require (y != 0);

    uint256 result;

    if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
      result = (x << 64) / y;
    else {
      uint256 msb = 192;
      uint256 xc = x >> 192;
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1);
      require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

      uint256 hi = result * (y >> 128);
      uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

      uint256 xh = x >> 192;
      uint256 xl = x << 64;

      if (xl < lo) xh -= 1;
      xl -= lo; // We rely on overflow behavior here
      lo = hi << 128;
      if (xl < lo) xh -= 1;
      xl -= lo; // We rely on overflow behavior here

      assert (xh == hi >> 128);

      result += xl / y;
    }

    require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
    return uint128 (result);
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is unsigned 129.127 fixed point
   * number and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x unsigned 129.127-bit fixed point number
   * @param y uint256 value
   * @return unsigned 129.127-bit fixed point number
   */
  function powu (uint256 x, uint256 y) private pure returns (uint256) {
    if (y == 0) return 0x80000000000000000000000000000000;
    else if (x == 0) return 0;
    else {
      int256 msb = 0;
      uint256 xc = x;
      if (xc >= 0x100000000000000000000000000000000) { xc >>= 128; msb += 128; }
      if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      int256 xe = msb - 127;
      if (xe > 0) x >>= uint256 (xe);
      else x <<= uint256 (-xe);

      uint256 result = 0x80000000000000000000000000000000;
      int256 re = 0;

      while (y > 0) {
        if (y & 1 > 0) {
          result = result * x;
          y -= 1;
          re += xe;
          if (result >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            result >>= 128;
            re += 1;
          } else result >>= 127;
          if (re < -127) return 0; // Underflow
          require (re < 128); // Overflow
        } else {
          x = x * x;
          y >>= 1;
          xe <<= 1;
          if (x >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            x >>= 128;
            xe += 1;
          } else x >>= 127;
          if (xe < -127) return 0; // Underflow
          require (xe < 128); // Overflow
        }
      }

      if (re > 0) result <<= uint256 (re);
      else if (re < 0) result >>= uint256 (-re);

      return result;
    }
  }

  /**
   * Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer
   * number.
   *
   * @param x unsigned 256-bit integer number
   * @return unsigned 128-bit integer number
   */
  function sqrtu (uint256 x) private pure returns (uint128) {
    if (x == 0) return 0;
    else {
      uint256 xx = x;
      uint256 r = 1;
      if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; }
      if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; }
      if (xx >= 0x100000000) { xx >>= 32; r <<= 16; }
      if (xx >= 0x10000) { xx >>= 16; r <<= 8; }
      if (xx >= 0x100) { xx >>= 8; r <<= 4; }
      if (xx >= 0x10) { xx >>= 4; r <<= 2; }
      if (xx >= 0x8) { r <<= 1; }
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1; // Seven iterations should be enough
      uint256 r1 = x / r;
      return uint128 (r < r1 ? r : r1);
    }
  }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_mintSchedule","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"},{"indexed":true,"internalType":"enum MintPool","name":"pool","type":"uint8"}],"name":"PoolOwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousSchedule","type":"address"},{"indexed":false,"internalType":"address","name":"newSchedule","type":"address"}],"name":"ScheduleChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_mintSchedule","type":"address"}],"name":"changeSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintSchedule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolByOwner","outputs":[{"internalType":"enum MintPool","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolMintStates","outputs":[{"internalType":"uint40","name":"time","type":"uint40"},{"internalType":"uint8","name":"itemIndex","type":"uint8"},{"internalType":"uint16","name":"weekIndex","type":"uint16"},{"internalType":"uint40","name":"weekStartTime","type":"uint40"},{"internalType":"uint128","name":"nextTickSupply","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolOwners","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"recoverFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint40","name":"maxTime","type":"uint40"}],"name":"supplyNmx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MintPool","name":"pool","type":"uint8"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferPoolOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b5060405162002de238038062002de2833981016040819052620000349162000576565b6040518060400160405280600781526020016609cdedad2dccaf60cb1b8152506040518060400160405280600381526020016209c9ab60eb1b815250816003908051906020019062000088929190620004ca565b5080516200009e906004906020840190620004ca565b50506005805460ff19166012179055506000620000ba620002b6565b60058054610100600160a81b0319166101006001600160a01b03841690810291909117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350467f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6200013c620002ba565b805160209182012060408051808201825260018152603160f81b90840152516200018e93927fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6918691309101620005b9565b60408051601f198184030181529082905280516020909101206080526007547fa6509ca3be3e568c1d4d170b2a7d6f8c1a60b4abc5a7f3f1f3078a56f596ea9c91620001e6916001600160a01b03169085906200059f565b60405180910390a1600780546001600160a01b0319166001600160a01b03841617905560015b6002811162000281576000600c82600381106200022557fe5b0180546360388e60600160681b600160e81b031990911674066cc65ca791da13000000000000000000000000001764ffffffffff19161764ffffffffff60401b19166b60388e600000000000000000179055506001016200020c565b50627286f86301312d00620002ac62000299620002b6565b670de0b6b3a76400008484010262000354565b50505050620005e5565b3390565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156200034a5780601f106200031e576101008083540402835291602001916200034a565b820191906000526020600020905b8154815290600101906020018083116200032c57829003601f168201915b5050505050905090565b6001600160a01b038216620003b0576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b620003be6000838362000463565b620003da816002546200046860201b6200165c1790919060201c565b6002556001600160a01b038216600090815260208181526040909120546200040d9183906200165c62000468821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b505050565b600082820183811015620004c3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826200050257600085556200054d565b82601f106200051d57805160ff19168380011785556200054d565b828001600101855582156200054d579182015b828111156200054d57825182559160200191906001019062000530565b506200055b9291506200055f565b5090565b5b808211156200055b576000815560010162000560565b60006020828403121562000588578081fd5b81516001600160a01b0381168114620004c3578182fd5b6001600160a01b0392831681529116602082015260400190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b6080516127dd62000605600039806107ac52806112d252506127dd6000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c8063715018a6116100f9578063a457c2d711610097578063d505accf11610071578063d505accf14610362578063d555a0a414610375578063dd62ed3e14610395578063f2fde38b146103a8576101b9565b8063a457c2d714610334578063a9059cbb14610347578063b53dc8cb1461035a576101b9565b8063865d049d116100d3578063865d049d146102f15780638da5cb5b1461031157806395d89b41146103195780639f004b7a14610321576101b9565b8063715018a6146102ce5780637b0a47ee146102d65780637ecebe00146102de576101b9565b8063313ce5671161016657806339509351116101405780633950935114610282578063454e6e44146102955780634c39756b146102a857806370a08231146102bb576101b9565b8063313ce5671461024157806335be62d2146102565780633644e5151461027a576101b9565b806323b872dd1161019757806323b872dd146102115780632750281f1461022457806330adf81f14610239576101b9565b806306fdde03146101be578063095ea7b3146101dc57806318160ddd146101fc575b600080fd5b6101c66103bb565b6040516101d391906122d0565b60405180910390f35b6101ef6101ea366004611fe9565b61046f565b6040516101d3919061224f565b61020461048d565b6040516101d3919061225a565b6101ef61021f366004611f42565b610493565b610237610232366004611ef6565b610534565b005b610204610710565b610249610734565b6040516101d391906125f9565b61026961026436600461206d565b61073d565b6040516101d39594939291906125b0565b6102046107aa565b6101ef610290366004611fe9565b6107ce565b6102376102a336600461204d565b610829565b6102376102b6366004612012565b610af4565b6102046102c9366004611ef6565b610c2b565b610237610c57565b610204610d61565b6102046102ec366004611ef6565b610e2f565b6103046102ff36600461206d565b610e41565b6040516101d39190612207565b610304610e6e565b6101c6610e8f565b61020461032f366004612155565b610f0e565b6101ef610342366004611fe9565b6111be565b6101ef610355366004611fe9565b611233565b610304611247565b610237610370366004611f7d565b611263565b610388610383366004611ef6565b611475565b6040516101d391906122c2565b6102046103a3366004611f10565b61148a565b6102376103b6366004611ef6565b6114c2565b60038054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104655780601f1061043a57610100808354040283529160200191610465565b820191906000526020600020905b81548152906001019060200180831161044857829003601f168201915b5050505050905090565b600061048361047c6116d7565b84846116db565b5060015b92915050565b60025490565b60006104a0848484611822565b61052a846104ac6116d7565b610525856040518060600160405280602881526020016127126028913973ffffffffffffffffffffffffffffffffffffffff8a166000908152600160205260408120906104f76116d7565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205491906119f2565b6116db565b5060019392505050565b61053c6116d7565b600554610100900473ffffffffffffffffffffffffffffffffffffffff9081169116146105ca57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610620576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106179061248f565b60405180910390fd5b60075473ffffffffffffffffffffffffffffffffffffffff82811691161415610675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790612523565b6007546040517fa6509ca3be3e568c1d4d170b2a7d6f8c1a60b4abc5a7f3f1f3078a56f596ea9c916106c19173ffffffffffffffffffffffffffffffffffffffff909116908490612228565b60405180910390a1600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60055460ff1690565b600c816003811061074d57600080fd5b015464ffffffffff808216925065010000000000820460ff16916601000000000000810461ffff169168010000000000000000820416906d010000000000000000000000000090046fffffffffffffffffffffffffffffffff1685565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006104836107db6116d7565b8461052585600160006107ec6116d7565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918c16815292529020549061165c565b6000600983600281111561083957fe5b6003811061084357fe5b015473ffffffffffffffffffffffffffffffffffffffff9081169150821681141561089a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790612432565b6108a2610e6e565b73ffffffffffffffffffffffffffffffffffffffff166108c06116d7565b73ffffffffffffffffffffffffffffffffffffffff16148061091457508073ffffffffffffffffffffffffffffffffffffffff166108fc6116d7565b73ffffffffffffffffffffffffffffffffffffffff16145b61094a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790612341565b73ffffffffffffffffffffffffffffffffffffffff821660009081526008602052604090205460ff1680600281111561097f57fe5b158061099f575073ffffffffffffffffffffffffffffffffffffffff8316155b6109d5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610617906123d5565b8360028111156109e157fe5b8373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f305b531474a817df0dd9653c69a07f7b31086b3caa3b98e30981eb5da32a4e8960405160405180910390a4826009856002811115610a4a57fe5b60038110610a5457fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92831617905582811660009081526008602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009081169091559286168252902080548692166001836002811115610ae957fe5b021790555050505050565b610afc6116d7565b600554610100900473ffffffffffffffffffffffffffffffffffffffff908116911614610b8a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000610b9584611aa3565b905080831115610bf0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806126bb6031913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416610c1a57610c158383611b66565b610c25565b610c25848484611bab565b50505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b610c5f6116d7565b600554610100900473ffffffffffffffffffffffffffffffffffffffff908116911614610ced57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600554604051600091610100900473ffffffffffffffffffffffffffffffffffffffff16907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600580547fffffffffffffffffffffff0000000000000000000000000000000000000000ff169055565b6007546040517fba6af8c3000000000000000000000000000000000000000000000000000000008152600091829173ffffffffffffffffffffffffffffffffffffffff9091169063ba6af8c390610dc290600d904290600190600401612580565b60c06040518083038186803b158015610dda57600080fd5b505afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190612085565b608001516fffffffffffffffffffffffffffffffff169250505090565b60066020526000908152604090205481565b60098160038110610e5157600080fd5b015473ffffffffffffffffffffffffffffffffffffffff16905081565b600554610100900473ffffffffffffffffffffffffffffffffffffffff1690565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104655780601f1061043a57610100808354040283529160200191610465565b60004264ffffffffff168264ffffffffff161115610f2a574291505b600060086000610f386116d7565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160009081205460ff169150816002811115610f7257fe5b1415610f82576000915050610c52565b6000600c826002811115610f9257fe5b60038110610f9c57fe5b6007546040517fba6af8c3000000000000000000000000000000000000000000000000000000008152929091019250600091829173ffffffffffffffffffffffffffffffffffffffff169063ba6af8c390610fff9086908a908990600401612580565b60c06040518083038186803b15801561101757600080fd5b505afa15801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f9190612085565b9150915080600c85600281111561106257fe5b6003811061106c57fe5b8251910180546020840151604085015160608601516080909601517fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000090931664ffffffffff958616177fffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffff166501000000000060ff90931692909202919091177fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff16660100000000000061ffff90921691909102177fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff16680100000000000000009390941692909202929092177fffffff00000000000000000000000000000000ffffffffffffffffffffffffff166d01000000000000000000000000006fffffffffffffffffffffffffffffffff909216919091021790556111b56111af6116d7565b83611d71565b50949350505050565b60006104836111cb6116d7565b846105258560405180606001604052806025815260200161278360259139600160006111f56116d7565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918d168152925290205491906119f2565b60006104836112406116d7565b8484611822565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b4284101561129d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106179061239e565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260066020908152604080832080546001810190915590517f000000000000000000000000000000000000000000000000000000000000000092611328927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928d928d928d9290918d9101612263565b6040516020818303038152906040528051906020012060405160200161134f9291906121d1565b60405160208183030381529060405280519060200120905060006001828686866040516000815260200160405260405161138c94939291906122a4565b6020604051602081039080840390855afa1580156113ae573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81161580159061142957508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b61145f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610617906124ec565b61146a8989896116db565b505050505050505050565b60086020526000908152604090205460ff1681565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6114ca6116d7565b600554610100900473ffffffffffffffffffffffffffffffffffffffff90811691161461155857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166115c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806126736026913960400191505060405180910390fd5b60055460405173ffffffffffffffffffffffffffffffffffffffff80841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b6000828201838110156116d057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b73ffffffffffffffffffffffffffffffffffffffff8316611747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061275f6024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806126996022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff831661188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061273a6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166118fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061262d6023913960400191505060405180910390fd5b611905838383611ea2565b61194f816040518060600160405280602681526020016126ec6026913973ffffffffffffffffffffffffffffffffffffffff861660009081526020819052604090205491906119f2565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220939093559084168152205461198b908261165c565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611a9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a60578181015183820152602001611a48565b50505050905090810190601f168015611a8d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600073ffffffffffffffffffffffffffffffffffffffff8216611ac7575047610c52565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015611b3357600080fd5b505afa158015611b47573d6000803e3d6000fd5b505050506040513d6020811015611b5d57600080fd5b50519050610c52565b604051819073ffffffffffffffffffffffffffffffffffffffff82169084156108fc029085906000818181858888f19350505050158015610c25573d6000803e3d6000fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8381166024830152604480830186905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251825160009485949389169392918291908083835b60208310611c8057805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611c43565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611ce2576040519150601f19603f3d011682016040523d82523d6000602084013e611ce7565b606091505b5091509150818015611d15575080511580611d155750808060200190516020811015611d1257600080fd5b50515b611d6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806126506023913960400191505060405180910390fd5b5050505050565b73ffffffffffffffffffffffffffffffffffffffff8216611df357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611dff60008383611ea2565b600254611e0c908261165c565b60025573ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054611e3f908261165c565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c5257600080fd5b80516fffffffffffffffffffffffffffffffff81168114610c5257600080fd5b8051610c5281612607565b600060208284031215611f07578081fd5b6116d082611ea7565b60008060408385031215611f22578081fd5b611f2b83611ea7565b9150611f3960208401611ea7565b90509250929050565b600080600060608486031215611f56578081fd5b611f5f84611ea7565b9250611f6d60208501611ea7565b9150604084013590509250925092565b600080600080600080600060e0888a031215611f97578283fd5b611fa088611ea7565b9650611fae60208901611ea7565b955060408801359450606088013593506080880135611fcc8161261d565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611ffb578182fd5b61200483611ea7565b946020939093013593505050565b600080600060608486031215612026578283fd5b61202f84611ea7565b92506020840135915061204460408501611ea7565b90509250925092565b6000806040838503121561205f578182fd5b823560038110611f2b578283fd5b60006020828403121561207e578081fd5b5035919050565b60008082840360c0811215612098578283fd5b8351925060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156120cb578182fd5b5060405160a0810181811067ffffffffffffffff821117156120e957fe5b60405260208401516120fa81612607565b8152604084015161210a8161261d565b6020820152606084015161ffff81168114612123578283fd5b604082015261213460808501611eeb565b606082015261214560a08501611ecb565b6080820152809150509250929050565b600060208284031215612166578081fd5b81356116d081612607565b6003811061217b57fe5b9052565b805464ffffffffff808216845260ff8260281c16602085015261ffff8260301c166040850152808260401c166060850152506fffffffffffffffffffffffffffffffff8160681c166080840152505050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b901515815260200190565b90815260200190565b95865273ffffffffffffffffffffffffffffffffffffffff94851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b602081016104878284612171565b6000602080835283518082850152825b818110156122fc578581018301518582016040015282016122e0565b8181111561230d5783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6020808252602b908201527f4e4d583a206f6e6c79206f776e65722063616e207472616e7366657220706f6f60408201527f6c206f776e657273686970000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f4e4d583a20646561646c696e6520657870697265640000000000000000000000604082015260600190565b60208082526029908201527f4e4d583a20657665727920706f6f6c206d75737420686176652064656469636160408201527f746564206f776e65720000000000000000000000000000000000000000000000606082015260800190565b6020808252602c908201527f4e4d583a206e6577206f776e6572206d75737420646966666572732066726f6d60408201527f20746865206f6c64206f6e650000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f4e4d583a206e6577207363686564756c652063616e206e6f742068617665207a60408201527f65726f2061646472657373000000000000000000000000000000000000000000606082015260800190565b60208082526016908201527f4e4d583a20696e76616c6964207369676e617475726500000000000000000000604082015260600190565b60208082526036908201527f4e4d583a206e6577207363686564756c652063616e206e6f742062652065717560408201527f616c20746f207468652070726576696f7573206f6e6500000000000000000000606082015260800190565b60e0810161258e828661217f565b64ffffffffff841660a08301526125a860c0830184612171565b949350505050565b64ffffffffff958616815260ff94909416602085015261ffff92909216604084015290921660608201526fffffffffffffffffffffffffffffffff909116608082015260a00190565b60ff91909116815260200190565b64ffffffffff8116811461261a57600080fd5b50565b60ff8116811461261a57600080fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573735265636f76657261626c6542794f776e65723a205452414e534645525f4641494c45444f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735265636f76657261626c6542794f776e65723a205245434f56455241424c455f414d4f554e545f4e4f545f454e4f55474845524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f845ab1c5754531589818f4f298e60a68806357671a26cbecadbd96984fbb27164736f6c63430007060033000000000000000000000000c86e74935181acb6de7c9d8307dd4092e35cf4d0

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

000000000000000000000000c86e74935181acb6de7c9d8307dd4092e35cf4d0

-----Decoded View---------------
Arg [0] : _mintSchedule (address): 0xc86e74935181acb6de7c9d8307dd4092e35cf4d0

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c86e74935181acb6de7c9d8307dd4092e35cf4d0


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