Contract 0xc7B8285a9E099e8c21CA5516D23348D8dBADdE4a 2

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x49951257142b58f8810324905600d3adba71dd565c3ccf943df5c9a30773ab84Withdraw132999292021-12-08 15:47:3038 secs ago0x786bef9870b33f531e4dec998b749ba6505a3947 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00484737813
0xeb3d7e0390f95b22d3ea238ed0ebe5cd677fb1071bb7418b02d98226c496619aDeposit132999242021-12-08 15:47:1553 secs ago0xb479dd40f915d74f8874293610ce16aea878710f IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00059865
0x31f5ea0c8b46806eb2d6dc69d9d10cd112450aadbf079516a281b78d36c16ec3Deposit132999232021-12-08 15:47:1256 secs ago0xc5f3bae387cd6e3ee447ffb207903a6e83010802 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00064121841
0x376f2e8b2aa2c5ec6c9ee9b9557abe5c68371b47e0ba0912013332615c627f3aWithdraw132999112021-12-08 15:46:361 min ago0x91541db8ddf5527cb81208a48e1405177c374ba8 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.006189689205
0x0bc0d93a8e430c75784accc5d2d83724457a6b7587eab7255d9788a23a1abdd4Deposit132998982021-12-08 15:45:572 mins ago0x2dc7c750135befce141dd270b337548c18a1b9dd IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.004265725
0x994d395b920df4e3f7237715201db2ed36e2ccdf5c8ad63115f55b6ec5f9b27aDeposit132998942021-12-08 15:45:452 mins ago0xa44455d6947394b4e8e929ed2d519029f6be91d5 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00059865
0xb9cfad12ba6dfb99daf70057231174133cd3b37278a93cf88605a8d2bb709409Deposit132998772021-12-08 15:44:543 mins ago0x3be16e0692f5061ef23ea0996f9c550eb143efc7 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00071702
0x02b6148ed717f0aef07cad8119484ea3e30555325bd9b952574bdbe34e34dbd0Deposit132998622021-12-08 15:44:044 mins ago0x3cd717aba5497c29a8833275b9dedfc7035a56a0 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.005563145
0x50a33142dea6bbb51e5854011a5ad5dfe5d2a80697accfd848063fe268d01c89Withdraw132998492021-12-08 15:43:144 mins ago0x35e5ffbf29b2d0a2a03210909c000d37208bb675 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00592946
0xd30e8e94a4a22f4682848cf7389d23d7f05fdd9a1e653d3ae962aecbbcf8ad23Deposit132998372021-12-08 15:42:375 mins ago0xf24fc9735f67ca9c7cff40e26cdbf0b42b03255f IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.013363265
0xe1f5730df8bafcffc37446e33aed76e889130d98c5af95749d223990e1ec068fWithdraw132998292021-12-08 15:42:095 mins ago0x92ea98ff3431dac2221d7b569042b79047e138c1 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.0057512
0x86eea764c3245e95006f79fb983e03c63d2b92b209a344fc8987335f43fb138eDeposit132998252021-12-08 15:41:576 mins ago0xb006c71f3f7129b7077a3f9060c71db43b941b4d IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.0007922
0xf2e0a154817362ff49a93777ce89653afdacd1dd5038b61a1f9ac9ebf77b0ecbDeposit132997482021-12-08 15:38:0610 mins ago0x301e33ca75ba163d30ed9637d80c532a9b27d5d9 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00716461
0x3b36c29cdd71585c76e2ad85140d45b4d97b83f8ec9d3ae4f81f826818eabd13Deposit132997382021-12-08 15:37:3610 mins ago0xe3c78d15d7eaa78c64080f8c4d1d7a40d9484d6d IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00571105
0x7a80b91d7386553b105951530d4bbbea34323334fd05567611a989caba683c84Deposit132997162021-12-08 15:36:2811 mins ago0x9535dc8e7ef9c56c0f7ac0e810c701fd078b32be IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00062798
0xe2df113ef2dd0ab9479d233cfb3901069ae3dffcf19ede3621dc1ea85b111063Deposit132997112021-12-08 15:36:1311 mins ago0xd79f6dfa1bad20f7f536f2d8ff3e7eae1c26db0e IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.0007327476
0x0d6b333ccfa77813a0e589b860e9d8e017cebca2ed1e2861a5c854828cfdafc7Deposit132997082021-12-08 15:36:0412 mins ago0x668427eec09695c0a643712659225c304439be5a IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00071714
0x411d190621c3da0fd62a706ad10023470386183749e53f074766df5d0d4713a6Deposit132996942021-12-08 15:35:2212 mins ago0x0d80ad172b893c51f382357252be6676cc8c230e IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00575129
0xa86f8c919083ee837a16db02cf371e218aab55faad00765fdb744a13b8ebefa5Deposit132996842021-12-08 15:34:5213 mins ago0xb5e3e3640e8b191547c7735d7f4caae695b98c5b IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00586406
0x5e318c2226eacf0dfccd52d9f434b549605de6fa32aad3423243a3fd896b2232Deposit132996732021-12-08 15:34:1913 mins ago0x2e945efeeabd6da517e21a8d24f6dfaace9cba39 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00571105
0xceed94698f965e33c20024a800617c731533f8fc80ce71eca9fdd7c146ac2a80Deposit132996652021-12-08 15:33:5514 mins ago0x2a13acdb4aefa3539aba8d8de084b9fae05f2a18 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00446644
0x1afbe894628d9c87154019331f8c26159201f81b727da49753a1996db6506db2Deposit132996602021-12-08 15:33:4014 mins ago0x7ee3687a59460d67a957ccde81b5840c0031621c IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00556319
0x93b64da84ecd10340831be7c3544f0216c446a1ae3b9c870920a314950651a8cDeposit132996462021-12-08 15:32:5815 mins ago0xd06b04f943475dc9277c7474a974c44589891838 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.013474115
0x729b84370080e77dcb07bf2eb92dcfbdc0ab7fca36ab865c03d42876b9c2623bDeposit132996412021-12-08 15:32:4315 mins ago0x82d587a505791b576e54567f8ff07784a2f89dbb IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.005786855
0xc109a0580cfa3f42a90f75fc0177447be7d736d8cd2492076eb7a1049b5b3aedDeposit132996302021-12-08 15:32:1015 mins ago0xeeaf22484b92e95160b0e4da0fd239c1ea1e94f2 IN  0xc7b8285a9e099e8c21ca5516d23348d8dbadde4a0 BNB0.00585575
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LiquidityMiningMaster

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 19 : DAOToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../interfaces/IDAOToken.sol";

// DAOToken with Governance.
contract DAOToken is IDAOToken, ERC20 {
    using SafeMath for uint256;

    /// @notice A record of each accounts delegate
    mapping(address => address) public override delegates;

    /// @notice A record of votes checkpoints for each account, by index
    mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;

    /// @notice The number of checkpoints for each account
    mapping(address => uint32) public numCheckpoints;

    /// @notice The EIP-712 typehash for the contract's domain
    bytes32 public constant DOMAIN_TYPEHASH =
        keccak256(
            "EIP712Domain(string name,uint256 chainId,address verifyingContract)"
        );

    /// @notice The EIP-712 typehash for the delegation struct used by the contract
    bytes32 public constant DELEGATION_TYPEHASH =
        keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");

    /// @notice A record of states for signing / validating signatures
    mapping(address => uint256) public nonces;

    constructor(string memory name, string memory symbol) ERC20(name, symbol) {}

    function _mint(address to, uint256 amount) internal override {
        super._mint(to, amount);
        _moveDelegates(address(0), delegates[to], amount);
    }

    function _burn(address from, uint256 amount) internal override {
        super._burn(from, amount);
        _moveDelegates(delegates[from], address(0), amount);
    }

    /**
     * @notice Delegate votes from `msg.sender` to `delegatee`
     * @param delegatee The address to delegate votes to
     */
    function delegate(address delegatee) external override {
        return _delegate(_msgSender(), delegatee);
    }

    /**
     * @notice Delegates votes from signatory to `delegatee`
     * @param delegatee The address to delegate votes to
     * @param nonce The contract state required to match the signature
     * @param expiry The time at which to expire the signature
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function delegateBySig(
        address delegatee,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external override {
        bytes32 domainSeparator = keccak256(
            abi.encode(
                DOMAIN_TYPEHASH,
                keccak256(bytes(name())),
                getChainId(),
                address(this)
            )
        );

        bytes32 structHash = keccak256(
            abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)
        );

        bytes32 digest = keccak256(
            abi.encodePacked("\x19\x01", domainSeparator, structHash)
        );

        address signatory = ecrecover(digest, v, r, s);
        require(
            signatory != address(0),
            "DAOToken::delegateBySig: Invalid signature"
        );
        require(
            nonce == nonces[signatory]++,
            "DAOToken::delegateBySig: Invalid nonce"
        );
        require(
            block.timestamp <= expiry,
            "DAOToken::delegateBySig: Signature expired"
        );
        return _delegate(signatory, delegatee);
    }

    /**
     * @notice Gets the current votes balance for `account`
     * @param account The address to get votes balance
     * @return The number of current votes for `account`
     */
    function getCurrentVotes(address account)
        external
        view
        override
        returns (uint256)
    {
        uint32 nCheckpoints = numCheckpoints[account];
        return
            nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
    }

    /**
     * @notice Determine the prior number of votes for an account as of a block number
     * @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
     * @param account The address of the account to check
     * @param blockNumber The block number to get the vote balance at
     * @return The number of votes the account had as of the given block
     */
    function getPriorVotes(address account, uint256 blockNumber)
        external
        view
        override
        returns (uint256)
    {
        require(
            blockNumber < block.number,
            "DAOToken::getPriorVotes: Not yet determined"
        );

        uint32 nCheckpoints = numCheckpoints[account];
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
            return checkpoints[account][nCheckpoints - 1].votes;
        }

        // Next check implicit zero balance
        if (checkpoints[account][0].fromBlock > blockNumber) {
            return 0;
        }

        uint32 lower = 0;
        uint32 upper = nCheckpoints - 1;
        while (upper > lower) {
            uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
            Checkpoint memory cp = checkpoints[account][center];
            if (cp.fromBlock == blockNumber) {
                return cp.votes;
            } else if (cp.fromBlock < blockNumber) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return checkpoints[account][lower].votes;
    }

    function _delegate(address delegator, address delegatee) internal {
        address currentDelegate = delegates[delegator];
        uint256 delegatorBalance = balanceOf(delegator);
        delegates[delegator] = delegatee;

        emit DelegateChanged(delegator, currentDelegate, delegatee);

        _moveDelegates(currentDelegate, delegatee, delegatorBalance);
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `to`
     * @param to The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address to, uint256 amount)
        public
        override
        returns (bool)
    {
        _transfer(_msgSender(), to, amount);
        _moveDelegates(delegates[_msgSender()], delegates[to], amount);
        return true;
    }

    /**
     * @notice Transfer `amount` tokens from `from` to `to`
     * @param from The address of the source account
     * @param to The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public override returns (bool) {
        _transfer(from, to, amount);
        _approve(
            from,
            _msgSender(),
            allowance(from, _msgSender()).sub(
                amount,
                "DAOToken::transferFrom: transfer amount exceeds allowance"
            )
        );

        _moveDelegates(delegates[from], delegates[to], amount);
        return true;
    }

    function _moveDelegates(
        address srcRep,
        address dstRep,
        uint256 amount
    ) internal {
        if (srcRep != dstRep && amount > 0) {
            if (srcRep != address(0)) {
                uint32 srcRepNum = numCheckpoints[srcRep];
                uint256 srcRepOld = srcRepNum > 0
                    ? checkpoints[srcRep][srcRepNum - 1].votes
                    : 0;
                uint256 srcRepNew = srcRepOld.sub(amount);
                _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
            }

            if (dstRep != address(0)) {
                uint32 dstRepNum = numCheckpoints[dstRep];
                uint256 dstRepOld = dstRepNum > 0
                    ? checkpoints[dstRep][dstRepNum - 1].votes
                    : 0;
                uint256 dstRepNew = dstRepOld.add(amount);
                _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
            }
        }
    }

    function _writeCheckpoint(
        address delegatee,
        uint32 nCheckpoints,
        uint256 oldVotes,
        uint256 newVotes
    ) internal {
        uint32 blockNumber = safe32(
            block.number,
            "DAOToken::_writeCheckpoint: Block number exceeds 32 bits"
        );

        if (
            nCheckpoints > 0 &&
            checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber
        ) {
            checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
        } else {
            checkpoints[delegatee][nCheckpoints] = Checkpoint(
                blockNumber,
                newVotes
            );
            numCheckpoints[delegatee] = nCheckpoints + 1;
        }

        emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
    }

    function safe32(uint256 n, string memory errorMessage)
        internal
        pure
        returns (uint32)
    {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function getChainId() internal pure returns (uint256) {
        uint256 chainId;
        assembly {
            chainId := chainid()
        }
        return chainId;
    }
}

File 2 of 19 : ICore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

import "./IPermissions.sol";
import "../interfaces/IXMSToken.sol";
import "../interfaces/IUSDMToken.sol";

/// @title Core Interface
/// @author USDM Protocol
interface ICore is IPermissions {
    // ----------- Events -----------

    event XMSSupportRatioUpdate(uint256 _xmsSupportRatio);
    event USDMUpdate(address indexed _usdm);
    event XMSUpdate(address indexed _xms);
    event GenesisGroupUpdate(address indexed _genesisGroup);
    event TokenAllocation(address indexed _to, uint256 _amount);
    event TokenApprove(address indexed _to, uint256 _amount);
    event GenesisPeriodComplete(uint256 _timestamp);

    // ----------- Governor only state changing api -----------

    function setXMSSupportRatio(uint256 _xmsSupportRatio) external;

    function setUSDM(address token) external;

    function setXMS(address token) external;

    function setGenesisGroup(address _genesisGroup) external;

    function allocateXMS(address to, uint256 amount) external;

    function allocateToken(
        address token,
        address to,
        uint256 amount
    ) external;

    function approveXMS(address to, uint256 amount) external;

    function approveToken(
        address token,
        address to,
        uint256 amount
    ) external;

    function setApprovedPairAndContract(address _pair, address _contract)
        external;

    function removeApprovedPairAndContract(address _pair, address _contract)
        external;

    // ----------- Genesis Group only state changing api -----------

    function completeGenesisGroup() external;

    // ----------- Getters -----------

    function getApprovedPairsLength() external view returns (uint256);

    function getApprovedContractsLength(address _pair)
        external
        view
        returns (uint256);

    function approvedPairs(uint256 idx) external view returns (address);

    function approvedPairExisted(address pair) external view returns (bool);

    function approvedContracts(address pair, uint256 idx)
        external
        view
        returns (address);

    function approvedContractExisted(address pair, address _contract)
        external
        view
        returns (bool);

    function xmsSupportRatio() external view returns (uint256);

    function xmsSupportRatioPrecision() external view returns (uint256);

    function usdm() external view returns (IUSDMToken);

    function xms() external view returns (IXMSToken);

    function genesisGroup() external view returns (address);

    function hasGenesisGroupCompleted() external view returns (bool);
}

File 3 of 19 : ICoreRef.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

import "./ICore.sol";

/// @title CoreRef interface
/// @author USDM Protocol
interface ICoreRef {
    // ----------- Events -----------

    event CoreUpdate(address indexed _core);

    // ----------- Governor only state changing api -----------

    function setCore(address core_) external;

    function pause() external;

    function unpause() external;

    // ----------- Getters -----------

    function core() external view returns (ICore);

    function usdm() external view returns (IUSDMToken);

    function xms() external view returns (IXMSToken);

    function usdmBalance() external view returns (uint256);

    function xmsBalance() external view returns (uint256);

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

File 4 of 19 : IDAOToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;

interface IDAOToken {
    struct Checkpoint {
        uint32 fromBlock;
        uint256 votes;
    }

    // ----------- Events -----------

    /// @notice An event thats emitted when an account changes its delegate
    event DelegateChanged(
        address indexed delegator,
        address indexed fromDelegate,
        address indexed toDelegate
    );

    /// @notice An event thats emitted when a delegate account's vote balance changes
    event DelegateVotesChanged(
        address indexed delegate,
        uint256 previousBalance,
        uint256 newBalance
    );

    // ----------- State changing api -----------

    function delegates(address delegator) external view returns (address);

    function delegate(address delegatee) external;

    function delegateBySig(
        address delegatee,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    // ----------- Getters -----------

    function getCurrentVotes(address account) external view returns (uint256);

    function getPriorVotes(address account, uint256 blockNumber)
        external
        view
        returns (uint256);
}

File 5 of 19 : ILiquidityMiningMaster.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

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

interface ILiquidityMiningMaster {
    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of XMS
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accXMSPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accXMSPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. XMS to distribute per block.
        uint256 lastRewardBlock; // Last block number that XMS distribution occurs.
        uint256 accXMSPerShare; // Accumulated XMS per share, times 1e12. See below.
    }

    // ----------- Events -----------

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 amount
    );
    event UpdateEmissionRate(address indexed user, uint256 xmsPerBlock);
    event UpdateEndBlock(address indexed user, uint256 endBlock);
    event UpdateVestingMaster(address indexed user, address vestingMaster);

    // ----------- State changing api -----------

    function massUpdatePools() external;

    function updatePool(uint256 pid) external;

    function deposit(uint256 pid, uint256 amount) external;

    function withdraw(uint256 pid, uint256 amount) external;

    function emergencyWithdraw(uint256 pid) external;

    // ----------- Governor only state changing API -----------

    function addPool(
        uint256 allocPoint,
        IERC20 lpToken,
        bool withUpdate
    ) external;

    function setPool(
        uint256 pid,
        uint256 allocPoint,
        bool withUpdate
    ) external;

    function updateXmsPerBlock(uint256 _xmsPerBlock) external;

    function updateEndBlock(uint256 _endBlock) external;

    function updateVestingMaster(address _vestingMaster) external;

    // ----------- Getters -----------

    function pair2Pid(address pair) external view returns (uint256);

    function pendingXMS(uint256 pid, address user)
        external
        view
        returns (uint256);

    function poolInfo(uint256 pid)
        external
        view
        returns (
            IERC20 lpToken,
            uint256 allocPoint,
            uint256 lastRewardBlock,
            uint256 accXMSPerShare
        );

    function userInfo(uint256 pid, address user)
        external
        view
        returns (uint256 amount, uint256 rewardDebt);

    function poolExistence(IERC20 lp) external view returns (bool);

    function xmsPerBlock() external view returns (uint256);

    function BONUS_MULTIPLIER() external view returns (uint256);

    function totalAllocPoint() external view returns (uint256);

    function startBlock() external view returns (uint256);

    function endBlock() external view returns (uint256);

    function poolLength() external view returns (uint256);

    function getMultiplier(uint256 from, uint256 to)
        external
        pure
        returns (uint256);
}

File 6 of 19 : IPermissions.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

/// @title Permissions interface
/// @author USDM Protocol
interface IPermissions {
    // ----------- Governor only state changing api -----------

    function createRole(bytes32 role, bytes32 adminRole) external;

    function grantMinter(address minter) external;

    function grantBurner(address burner) external;

    function grantPCVController(address pcvController) external;

    function grantGovernor(address governor) external;

    function grantGuardian(address guardian) external;

    function revokeMinter(address minter) external;

    function revokeBurner(address burner) external;

    function revokePCVController(address pcvController) external;

    function revokeGovernor(address governor) external;

    function revokeGuardian(address guardian) external;

    // ----------- Revoker only state changing api -----------

    function revokeOverride(bytes32 role, address account) external;

    // ----------- Getters -----------

    function isBurner(address _address) external view returns (bool);

    function isMinter(address _address) external view returns (bool);

    function isGovernor(address _address) external view returns (bool);

    function isGuardian(address _address) external view returns (bool);

    function isPCVController(address _address) external view returns (bool);
}

File 7 of 19 : IUSDMToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;

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

interface IUSDMToken is IERC20 {
    // ----------- Minter State changing api -----------

    function mint(address _to, uint256 _amount) external;

    // ----------- Burner State changing api -----------

    // ----------- State changing api -----------

    function burn(uint256 _amount) external;

    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

File 8 of 19 : IVestingMaster.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

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

interface IVestingMaster {
    struct LockedReward {
        uint256 locked;
        uint256 timestamp;
    }
    // ----------- Events -----------

    event Lock(address indexed user, uint256 amount);
    event Claim(address indexed user, uint256 amount);

    // ----------- Farms only State changing api -----------

    function lock(address, uint256) external;

    // ----------- state changing API -----------

    function claim() external;

    // ----------- Getters -----------

    function period() external view returns (uint256);

    function lockedPeriodAmount() external view returns (uint256);

    function vestingToken() external view returns (IERC20);

    function userLockedRewards(address account, uint256 idx)
        external
        view
        returns (uint256, uint256);

    function totalLockedRewards() external view returns (uint256);

    function getVestingAmount() external view returns (uint256, uint256);
}

File 9 of 19 : IXMSToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;

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

interface IXMSToken is IERC20 {
    struct Checkpoint {
        uint32 fromBlock;
        uint96 votes;
    }

    // ----------- Events -----------

    /// @notice An event thats emitted when an account changes its delegate
    event DelegateChanged(
        address indexed delegator,
        address indexed fromDelegate,
        address indexed toDelegate
    );

    /// @notice An event thats emitted when a delegate account's vote balance changes
    event DelegateVotesChanged(
        address indexed delegate,
        uint256 previousBalance,
        uint256 newBalance
    );

    // ----------- Minter State changing api -----------

    function mint(address _to, uint256 _amount) external;

    // ----------- State changing api -----------

    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    function delegates(address delegator) external view returns (address);

    function delegate(address delegatee) external;

    function delegateBySig(
        address delegatee,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    // ----------- Getters -----------

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

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

    function decimals() external view returns (uint8);

    function getCurrentVotes(address account) external view returns (uint96);

    function getPriorVotes(address account, uint256 blockNumber)
        external
        view
        returns (uint96);
}

File 10 of 19 : LiquidityMiningMaster.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "../interfaces/ILiquidityMiningMaster.sol";
import "../interfaces/IVestingMaster.sol";
import "../refs/CoreRef.sol";
import "../base/DAOToken.sol";

// Earn XMS
contract LiquidityMiningMaster is
    ILiquidityMiningMaster,
    ReentrancyGuard,
    CoreRef,
    DAOToken
{
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IVestingMaster public vestingMaster;

    // Info of each pool.
    PoolInfo[] public override poolInfo;

    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public override userInfo;

    // Pair corresponding pid
    mapping(address => uint256) public override pair2Pid;
    mapping(IERC20 => bool) public override poolExistence;

    // XMS tokens created per block.
    uint256 public override xmsPerBlock;

    // Bonus muliplier for early XMS makers.
    uint256 public constant override BONUS_MULTIPLIER = 1;

    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public override totalAllocPoint = 0;

    // The block number when XMS mining starts.
    uint256 public override startBlock;

    // The block number when XMS mining ends.
    uint256 public override endBlock;

    constructor(
        address _core,
        address _vestingMaster,
        uint256 _xmsPerBlock,
        uint256 _startBlock,
        uint256 _endBlock
    ) CoreRef(_core) DAOToken("Mars Farms Seed Token", "MSEED") {
        require(
            _startBlock < _endBlock,
            "LiquidityMiningMaster::constructor: End less than start"
        );
        vestingMaster = IVestingMaster(_vestingMaster);
        xmsPerBlock = _xmsPerBlock;
        startBlock = _startBlock;
        endBlock = _endBlock;
    }

    modifier nonDuplicated(IERC20 _lpToken) {
        require(
            !poolExistence[_lpToken],
            "LiquidityMiningMaster::nonDuplicated: Duplicated"
        );
        _;
    }

    modifier validatePid(uint256 _pid) {
        require(
            _pid < poolInfo.length,
            "LiquidityMiningMaster::validatePid: Not exist"
        );
        _;
    }

    function poolLength() public view override returns (uint256) {
        return poolInfo.length;
    }

    // Add a new lp to the pool. Can only be called by the governor.
    function addPool(
        uint256 _allocPoint,
        IERC20 _lpToken,
        bool _withUpdate
    ) public override onlyGuardianOrGovernor nonDuplicated(_lpToken) {
        require(
            block.number < endBlock,
            "LiquidityMiningMaster::addPool: Exceed endblock"
        );
        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock = block.number > startBlock
            ? block.number
            : startBlock;
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        poolExistence[_lpToken] = true;
        poolInfo.push(
            PoolInfo({
                lpToken: _lpToken,
                allocPoint: _allocPoint,
                lastRewardBlock: lastRewardBlock,
                accXMSPerShare: 0
            })
        );
        pair2Pid[address(_lpToken)] = poolLength() - 1;
    }

    // Update the given pool's XMS allocation point and deposit fee. Can only be called by the governor.
    function setPool(
        uint256 _pid,
        uint256 _allocPoint,
        bool _withUpdate
    ) public override validatePid(_pid) onlyGuardianOrGovernor {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(
            _allocPoint
        );
        poolInfo[_pid].allocPoint = _allocPoint;
    }

    // Return reward multiplier over the given _from to _to block.
    function getMultiplier(uint256 _from, uint256 _to)
        public
        pure
        override
        returns (uint256)
    {
        return _to.sub(_from).mul(BONUS_MULTIPLIER);
    }

    function getXMSReward(uint256 _pid)
        internal
        view
        returns (uint256 xmsReward)
    {
        PoolInfo storage pool = poolInfo[_pid];
        require(
            pool.lastRewardBlock < block.number,
            "LiquidityMiningMaster::getXMSReward: Must little than the current block number"
        );
        uint256 multiplier = getMultiplier(
            pool.lastRewardBlock,
            block.number >= endBlock ? endBlock : block.number
        );
        xmsReward = multiplier.mul(xmsPerBlock).mul(pool.allocPoint).div(
            totalAllocPoint
        );
    }

    // View function to see pending XMS on frontend.
    function pendingXMS(uint256 _pid, address _user)
        external
        view
        override
        validatePid(_pid)
        returns (uint256)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accXMSPerShare = pool.accXMSPerShare;
        uint256 lpSupply = address(xms()) == address(pool.lpToken)
            ? totalSupply()
            : pool.lpToken.balanceOf(address(this));
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 shareReward = getXMSReward(_pid);
            accXMSPerShare = accXMSPerShare.add(
                shareReward.mul(1e12).div(lpSupply)
            );
        }
        return user.amount.mul(accXMSPerShare).div(1e12).sub(user.rewardDebt);
    }

    // Update reward variables for all pools. Be careful of gas spending!
    function massUpdatePools() public override {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public override validatePid(_pid) {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        if (pool.lastRewardBlock >= endBlock) {
            return;
        }
        uint256 lpSupply = address(xms()) == address(pool.lpToken)
            ? totalSupply()
            : pool.lpToken.balanceOf(address(this));
        uint256 lastRewardBlock = block.number >= endBlock
            ? endBlock
            : block.number;
        if (lpSupply == 0 || pool.allocPoint == 0) {
            pool.lastRewardBlock = lastRewardBlock;
            return;
        }
        uint256 shareReward = getXMSReward(_pid);
        pool.accXMSPerShare = pool.accXMSPerShare.add(
            shareReward.mul(1e12).div(lpSupply)
        );
        pool.lastRewardBlock = lastRewardBlock;
    }

    // Deposit LP tokens to LiquidityMiningMaster for XMS allocation.
    function deposit(uint256 _pid, uint256 _amount)
        public
        override
        validatePid(_pid)
        nonReentrant
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.amount > 0) {
            uint256 pending = user
                .amount
                .mul(pool.accXMSPerShare)
                .div(1e12)
                .sub(user.rewardDebt);
            if (pending > 0) {
                uint256 locked;
                if (address(vestingMaster) != address(0)) {
                    locked = pending
                        .div(vestingMaster.lockedPeriodAmount() + 1)
                        .mul(vestingMaster.lockedPeriodAmount());
                }
                safeXMSTransfer(msg.sender, pending.sub(locked));
                if (locked > 0) {
                    uint256 actualAmount = safeXMSTransfer(
                        address(vestingMaster),
                        locked
                    );
                    vestingMaster.lock(msg.sender, actualAmount);
                }
            }
        }
        if (_amount > 0) {
            pool.lpToken.safeTransferFrom(
                address(msg.sender),
                address(this),
                _amount
            );
            if (address(xms()) == address(pool.lpToken)) {
                _mint(msg.sender, _amount);
            }
            user.amount = user.amount.add(_amount);
        }
        user.rewardDebt = user.amount.mul(pool.accXMSPerShare).div(1e12);
        emit Deposit(msg.sender, _pid, _amount);
    }

    // Withdraw LP tokens from LiquidityMiningMaster.
    function withdraw(uint256 _pid, uint256 _amount)
        public
        override
        validatePid(_pid)
        nonReentrant
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(
            user.amount >= _amount,
            "LiquidityMiningMaster::withdraw: Not good"
        );
        updatePool(_pid);
        if (user.amount > 0) {
            uint256 pending = user
                .amount
                .mul(pool.accXMSPerShare)
                .div(1e12)
                .sub(user.rewardDebt);
            if (pending > 0) {
                uint256 locked;
                if (address(vestingMaster) != address(0)) {
                    locked = pending
                        .div(vestingMaster.lockedPeriodAmount() + 1)
                        .mul(vestingMaster.lockedPeriodAmount());
                }
                safeXMSTransfer(msg.sender, pending.sub(locked));
                if (locked > 0) {
                    uint256 actualAmount = safeXMSTransfer(
                        address(vestingMaster),
                        locked
                    );
                    vestingMaster.lock(msg.sender, actualAmount);
                }
            }
        }
        if (_amount > 0) {
            user.amount = user.amount.sub(_amount);
            if (address(xms()) == address(pool.lpToken)) {
                _burn(msg.sender, _amount);
            }
            pool.lpToken.safeTransfer(address(msg.sender), _amount);
        }
        user.rewardDebt = user.amount.mul(pool.accXMSPerShare).div(1e12);
        emit Withdraw(msg.sender, _pid, _amount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid)
        public
        override
        validatePid(_pid)
        nonReentrant
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 amount = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;
        if (address(xms()) == address(pool.lpToken)) {
            _burn(msg.sender, amount);
        }
        pool.lpToken.safeTransfer(address(msg.sender), amount);
        emit EmergencyWithdraw(msg.sender, _pid, amount);
    }

    // Safe XMS transfer function, just in case if rounding error causes pool to not have enough XMS.
    function safeXMSTransfer(address _to, uint256 _amount)
        internal
        returns (uint256)
    {
        uint256 balance = xmsBalance();
        uint256 amount;
        uint256 floorAmount = totalSupply();
        if (balance > floorAmount) {
            if (_amount > balance.sub(floorAmount)) {
                amount = balance.sub(floorAmount);
            } else {
                amount = _amount;
            }
        }
        require(
            xms().transfer(_to, amount),
            "LiquidityMiningMaster::safeXMSTransfer: Transfer failed"
        );
        return amount;
    }

    function updateXmsPerBlock(uint256 _xmsPerBlock)
        public
        override
        onlyGuardianOrGovernor
    {
        massUpdatePools();
        xmsPerBlock = _xmsPerBlock;
        emit UpdateEmissionRate(msg.sender, _xmsPerBlock);
    }

    function updateEndBlock(uint256 _endBlock)
        public
        override
        onlyGuardianOrGovernor
    {
        require(
            _endBlock > startBlock,
            "LiquidityMiningMaster::updateEndBlock: Less"
        );
        for (uint256 pid = 0; pid < poolInfo.length; ++pid) {
            require(
                _endBlock > poolInfo[pid].lastRewardBlock,
                "LiquidityMiningMaster::updateEndBlock: Less"
            );
        }
        massUpdatePools();
        endBlock = _endBlock;
        emit UpdateEndBlock(msg.sender, _endBlock);
    }

    function updateVestingMaster(address _vestingMaster)
        public
        override
        onlyGovernor
    {
        vestingMaster = IVestingMaster(_vestingMaster);
        emit UpdateVestingMaster(msg.sender, _vestingMaster);
    }
}

File 11 of 19 : CoreRef.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

import "../interfaces/ICoreRef.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";

/// @title A Reference to Core
/// @author USDM Protocol
/// @notice Defines some modifiers and utilities around interacting with Core
abstract contract CoreRef is ICoreRef, Pausable {
    using SafeMath for uint256;

    ICore private _core;

    /// @notice CoreRef constructor
    /// @param core_ USDM Core to reference
    constructor(address core_) {
        _core = ICore(core_);
    }

    modifier ifMinterSelf() {
        if (_core.isMinter(address(this))) {
            _;
        }
    }

    modifier ifBurnerSelf() {
        if (_core.isBurner(address(this))) {
            _;
        }
    }

    modifier onlyMinter() {
        require(
            _core.isMinter(msg.sender),
            "CoreRef::onlyMinter: Caller is not a minter"
        );
        _;
    }

    modifier onlyBurner() {
        require(
            _core.isBurner(msg.sender),
            "CoreRef::onlyBurner: Caller is not a burner"
        );
        _;
    }

    modifier onlyPCVController() {
        require(
            _core.isPCVController(msg.sender),
            "CoreRef::onlyPCVController: Caller is not a PCV controller"
        );
        _;
    }

    modifier onlyGovernor() {
        require(
            _core.isGovernor(msg.sender),
            "CoreRef::onlyGovernor: Caller is not a governor"
        );
        _;
    }

    modifier onlyGuardianOrGovernor() {
        require(
            _core.isGovernor(msg.sender) || _core.isGuardian(msg.sender),
            "CoreRef::onlyGuardianOrGovernor: Caller is not a guardian or governor"
        );
        _;
    }

    modifier onlyUSDM() {
        require(
            msg.sender == address(usdm()),
            "CoreRef::onlyUSDM: Caller is not USDM"
        );
        _;
    }

    modifier onlyGenesisGroup() {
        require(
            msg.sender == _core.genesisGroup(),
            "CoreRef::onlyGenesisGroup: Caller is not GenesisGroup"
        );
        _;
    }

    modifier postGenesis() {
        require(
            _core.hasGenesisGroupCompleted(),
            "CoreRef::postGenesis: Still in genesis period"
        );
        _;
    }

    modifier nonContract() {
        require(
            !Address.isContract(msg.sender),
            "CoreRef::nonContract: Caller is a contract"
        );
        _;
    }

    /// @notice Set new Core reference address
    /// @param core_ The new core address
    function setCore(address core_) external override onlyGovernor {
        _core = ICore(core_);
        emit CoreUpdate(core_);
    }

    /// @notice Set pausable methods to paused
    function pause() public override onlyGuardianOrGovernor {
        _pause();
    }

    /// @notice Set pausable methods to unpaused
    function unpause() public override onlyGuardianOrGovernor {
        _unpause();
    }

    /// @notice Address of the Core contract referenced
    /// @return ICore implementation address
    function core() public view override returns (ICore) {
        return _core;
    }

    /// @notice Address of the USDM contract referenced by Core
    /// @return IUSDMToken implementation address
    function usdm() public view override returns (IUSDMToken) {
        return _core.usdm();
    }

    /// @notice Address of the XMS contract referenced by Core
    /// @return IUSDMToken implementation address
    function xms() public view override returns (IXMSToken) {
        return _core.xms();
    }

    /// @notice USDM balance of contract
    /// @return USDM amount held
    function usdmBalance() public view override returns (uint256) {
        return usdm().balanceOf(address(this));
    }

    /// @notice XMS balance of contract
    /// @return XMS amount held
    function xmsBalance() public view override returns (uint256) {
        return xms().balanceOf(address(this));
    }

    /// @notice Calculate the usdm amount of governance
    function getUSDMAmountGovernance()
        public
        view
        override
        returns (uint256 usdmAmount)
    {
        address pair;
        address _contract;
        for (uint256 i; i < core().getApprovedPairsLength(); i++) {
            pair = core().approvedPairs(i);
            for (uint256 j; j < core().getApprovedContractsLength(pair); j++) {
                _contract = core().approvedContracts(pair, j);
                usdmAmount = usdmAmount.add(
                    core()
                        .usdm()
                        .balanceOf(pair)
                        .mul(IERC20(pair).balanceOf(_contract))
                        .div(IERC20(pair).totalSupply())
                );
            }
        }
    }

    function _burnUSDMHeld() internal {
        usdm().burn(usdmBalance());
    }

    function _mintUSDM(uint256 amount) internal {
        usdm().mint(address(this), amount);
    }
}

File 12 of 19 : 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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        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) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        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, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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);
        return a / b;
    }

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

File 13 of 19 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/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 virtual returns (string memory) {
        return _name;
    }

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

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual 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 virtual {
        _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 14 of 19 : 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 15 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 16 of 19 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 17 of 19 : 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 18 of 19 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

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

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_core","type":"address"},{"internalType":"address","name":"_vestingMaster","type":"address"},{"internalType":"uint256","name":"_xmsPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_endBlock","type":"uint256"}],"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":"_core","type":"address"}],"name":"CoreUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"xmsPerBlock","type":"uint256"}],"name":"UpdateEmissionRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"UpdateEndBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"vestingMaster","type":"address"}],"name":"UpdateVestingMaster","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BONUS_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","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":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint256","name":"votes","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"core","outputs":[{"internalType":"contract ICore","name":"","type":"address"}],"stateMutability":"view","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":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUSDMAmountGovernance","outputs":[{"internalType":"uint256","name":"usdmAmount","type":"uint256"}],"stateMutability":"view","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":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pair2Pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingXMS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"poolExistence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accXMSPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"core_","type":"address"}],"name":"setCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endBlock","type":"uint256"}],"name":"updateEndBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vestingMaster","type":"address"}],"name":"updateVestingMaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_xmsPerBlock","type":"uint256"}],"name":"updateXmsPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdm","outputs":[{"internalType":"contract IUSDMToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdmBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingMaster","outputs":[{"internalType":"contract IVestingMaster","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xms","outputs":[{"internalType":"contract IXMSToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xmsBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xmsPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405260006012553480156200001657600080fd5b506040516200492338038062004923833981016040819052620000399162000217565b604080518082018252601581527f4d617273204661726d73205365656420546f6b656e0000000000000000000000602080830191825283518085019094526005808552641354d1515160da1b918501919091526001600081905580546001600160a81b0319166101006001600160a01b038c1602179055825192939284928492620000c7929091906200014e565b508051620000dd9060069060208401906200014e565b50506007805460ff191660121790555050508082106200011a5760405162461bcd60e51b8152600401620001119062000269565b60405180910390fd5b600c80546001600160a01b0319166001600160a01b03959095169490941790935560119190915560135560145550620002c6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001865760008555620001d1565b82601f10620001a157805160ff1916838001178555620001d1565b82800160010185558215620001d1579182015b82811115620001d1578251825591602001919060010190620001b4565b50620001df929150620001e3565b5090565b5b80821115620001df5760008155600101620001e4565b80516001600160a01b03811681146200021257600080fd5b919050565b600080600080600060a086880312156200022f578081fd5b6200023a86620001fa565b94506200024a60208701620001fa565b6040870151606088015160809098015196999198509695945092505050565b60208082526037908201527f4c69717569646974794d696e696e674d61737465723a3a636f6e73747275637460408201527f6f723a20456e64206c657373207468616e207374617274000000000000000000606082015260800190565b61464d80620002d66000396000f3fe608060405234801561001057600080fd5b50600436106103415760003560e01c8063630b5ba1116101b85780639a57462211610104578063dd62ed3e116100a2578063e7a324dc1161007c578063e7a324dc14610697578063ee138d0f1461069f578063f1127ed8146106a7578063f2f4eb26146106c857610341565b8063dd62ed3e1461065e578063e2bbb15814610671578063e6a8fc711461068457610341565b8063b4b5ea57116100de578063b4b5ea5714610612578063c3cda52014610625578063c811658514610638578063cbd258b51461064b57610341565b80639a574622146105e4578063a457c2d7146105ec578063a9059cbb146105ff57610341565b806380009630116101715780638aa285501161014b5780638aa28550146105a05780638dbb1e3a146105a857806393f1a40b146105bb57806395d89b41146105dc57610341565b8063800096301461057d578063835c5cbb146105905780638456cb591461059857610341565b8063630b5ba1146105095780636fcfff451461051157806370a0823114610531578063782d6fe1146105445780637abceffd146105575780637ecebe001461056a57610341565b806326f87c011161029257806346ca6bea116102305780635312ea8e1161020a5780635312ea8e146104c8578063587cde1e146104db5780635c19a95c146104ee5780635c975abb1461050157610341565b806346ca6bea1461049a57806348cd4cb1146104ad57806351eb05a6146104b557610341565b8063395093511161026c57806339509351146104595780633f4ba83a1461046c578063441a3e7014610474578063447382271461048757610341565b806326f87c01146104345780632e6e35b91461043c578063313ce5671461044457610341565b80631526fe27116102ff5780631eccdf07116102d95780631eccdf07146103f157806320606b70146104065780632124ca441461040e57806323b872dd1461042157610341565b80631526fe27146103be57806317caf6f1146103e157806318160ddd146103e957610341565b80626f02311461034657806306fdde031461035b578063081e3eda14610379578063083c63231461038e578063095ea7b3146103965780630f057c23146103b6575b600080fd5b610359610354366004613e8c565b6106d0565b005b6103636108c1565b6040516103709190613fd6565b60405180910390f35b610381610957565b6040516103709190613fa7565b61038161095d565b6103a96103a4366004613db0565b610963565b6040516103709190613f9c565b610381610981565b6103d16103cc366004613e8c565b610a0b565b6040516103709493929190613fb0565b610381610a4f565b610381610a55565b6103f9610a5b565b6040516103709190613f6f565b610381610a6a565b61035961041c366004613d00565b610a8e565b6103a961042f366004613d70565b610b7b565b610381610c06565b61038161103b565b61044c611045565b6040516103709190614369565b6103a9610467366004613db0565b61104e565b61035961109c565b610359610482366004613f21565b6111d0565b610359610495366004613e8c565b61156e565b6103596104a8366004613f42565b6116d7565b61038161189e565b6103596104c3366004613e8c565b6118a4565b6103596104d6366004613e8c565b611a3a565b6103f96104e9366004613d00565b611b7e565b6103596104fc366004613d00565b611b99565b6103a9611bad565b610359611bb6565b61052461051f366004613d00565b611bd5565b6040516103709190614342565b61038161053f366004613d00565b611bed565b610381610552366004613db0565b611c08565b610359610565366004613ee0565b611e0b565b610381610578366004613d00565b6120f8565b61035961058b366004613d00565b61210a565b6103f96121fc565b610359612282565b6103816123b4565b6103816105b6366004613f21565b6123b9565b6105ce6105c9366004613ebc565b6123ca565b604051610370929190614334565b6103636123ee565b61038161244f565b6103a96105fa366004613db0565b612455565b6103a961060d366004613db0565b6124bd565b610381610620366004613d00565b61251b565b610359610633366004613ddb565b61257e565b610381610646366004613d00565b6127f1565b6103a9610659366004613d00565b612803565b61038161066c366004613d38565b612818565b61035961067f366004613f21565b612843565b610381610692366004613ebc565b612ae3565b610381612c71565b6103f9612c95565b6106ba6106b5366004613e3b565b612ce3565b604051610370929190614353565b6103f9612d10565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b890610704903390600401613f6f565b60206040518083038186803b15801561071c57600080fd5b505afa158015610730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107549190613e70565b806107de5750600154604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba219061078e903390600401613f6f565b60206040518083038186803b1580156107a657600080fd5b505afa1580156107ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107de9190613e70565b6108035760405162461bcd60e51b81526004016107fa90614199565b60405180910390fd5b60135481116108245760405162461bcd60e51b81526004016107fa9061429a565b60005b600d5481101561087657600d818154811061083e57fe5b906000526020600020906004020160020154821161086e5760405162461bcd60e51b81526004016107fa9061429a565b600101610827565b5061087f611bb6565b601481905560405133907f316ee89ca026e5355cff2b64939ee0e5af49bde19b755b42bbde0f5bea039825906108b6908490613fa7565b60405180910390a250565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561094d5780601f106109225761010080835404028352916020019161094d565b820191906000526020600020905b81548152906001019060200180831161093057829003601f168201915b5050505050905090565b600d5490565b60145481565b6000610977610970612d24565b8484612d28565b5060015b92915050565b600061098b612c95565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109b69190613f6f565b60206040518083038186803b1580156109ce57600080fd5b505afa1580156109e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a069190613ea4565b905090565b600d8181548110610a1b57600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919084565b60125481565b60045490565b600c546001600160a01b031681565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b890610ac2903390600401613f6f565b60206040518083038186803b158015610ada57600080fd5b505afa158015610aee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b129190613e70565b610b2e5760405162461bcd60e51b81526004016107fa90614079565b600c80546001600160a01b0319166001600160a01b03831617905560405133907fedd017b4981fb4d0d4df1c48baed994ce8b4dc47ba89a2010ce592b7df5c6dc4906108b6908490613f6f565b6000610b88848484612e14565b610bc984610b94612d24565b610bc48560405180606001604052806039815260200161442860399139610bbd8a61066c612d24565b9190612f71565b612d28565b6001600160a01b03808516600090815260086020526040808220548684168352912054610bfb92918216911684613008565b5060015b9392505050565b6000806000805b610c15612d10565b6001600160a01b031663d200a2186040518163ffffffff1660e01b815260040160206040518083038186803b158015610c4d57600080fd5b505afa158015610c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c859190613ea4565b81101561103557610c94612d10565b6001600160a01b03166379c9679b826040518263ffffffff1660e01b8152600401610cbf9190613fa7565b60206040518083038186803b158015610cd757600080fd5b505afa158015610ceb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0f9190613d1c565b925060005b610d1c612d10565b6001600160a01b03166380e2b70e856040518263ffffffff1660e01b8152600401610d479190613f6f565b60206040518083038186803b158015610d5f57600080fd5b505afa158015610d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d979190613ea4565b81101561102c57610da6612d10565b6001600160a01b031663a0a01d9d85836040518363ffffffff1660e01b8152600401610dd3929190613f83565b60206040518083038186803b158015610deb57600080fd5b505afa158015610dff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e239190613d1c565b925061102261101b856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e6457600080fd5b505afa158015610e78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9c9190613ea4565b6040516370a0823160e01b8152611015906001600160a01b038916906370a0823190610ecc908a90600401613f6f565b60206040518083038186803b158015610ee457600080fd5b505afa158015610ef8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1c9190613ea4565b610f24612d10565b6001600160a01b031663ee138d0f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5c57600080fd5b505afa158015610f70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f949190613d1c565b6001600160a01b03166370a082318a6040518263ffffffff1660e01b8152600401610fbf9190613f6f565b60206040518083038186803b158015610fd757600080fd5b505afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100f9190613ea4565b9061314a565b906131a3565b869061320a565b9450600101610d14565b50600101610c0d565b50505090565b600061098b6121fc565b60075460ff1690565b600061097761105b612d24565b84610bc4856003600061106c612d24565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061320a565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b8906110d0903390600401613f6f565b60206040518083038186803b1580156110e857600080fd5b505afa1580156110fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111209190613e70565b806111aa5750600154604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba219061115a903390600401613f6f565b60206040518083038186803b15801561117257600080fd5b505afa158015611186573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111aa9190613e70565b6111c65760405162461bcd60e51b81526004016107fa90614199565b6111ce613264565b565b600d54829081106111f35760405162461bcd60e51b81526004016107fa90614204565b6002600054141561124b576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155600d80548590811061126057fe5b60009182526020808320878452600e8252604080852033865290925292208054600490920290920192508411156112a95760405162461bcd60e51b81526004016107fa90614251565b6112b2856118a4565b8054156114b05760006112ed82600101546112e764e8d4a510006110158760030154876000015461314a90919063ffffffff16565b90613304565b905080156114ae57600c546000906001600160a01b03161561141257600c54604080516302f4bde360e11b8152905161140f926001600160a01b0316916305e97bc6916004808301926020929190829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190613ea4565b600c54604080516302f4bde360e11b8152905161100f926001600160a01b0316916305e97bc6916004808301926020929190829003018186803b1580156113cd57600080fd5b505afa1580156113e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114059190613ea4565b85906001016131a3565b90505b611425336114208484613304565b613361565b5080156114ac57600c54600090611445906001600160a01b031683613361565b600c5460405163282d3fdf60e01b81529192506001600160a01b03169063282d3fdf906114789033908590600401613f83565b600060405180830381600087803b15801561149257600080fd5b505af11580156114a6573d6000803e3d6000fd5b50505050505b505b505b83156115065780546114c29085613304565b815581546001600160a01b03166114d76121fc565b6001600160a01b031614156114f0576114f03385613455565b8154611506906001600160a01b03163386613485565b600382015481546115219164e8d4a51000916110159161314a565b6001820155604051859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689061155a908890613fa7565b60405180910390a350506001600055505050565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b8906115a2903390600401613f6f565b60206040518083038186803b1580156115ba57600080fd5b505afa1580156115ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f29190613e70565b8061167c5750600154604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba219061162c903390600401613f6f565b60206040518083038186803b15801561164457600080fd5b505afa158015611658573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167c9190613e70565b6116985760405162461bcd60e51b81526004016107fa90614199565b6116a0611bb6565b601181905560405133907fe2492e003bbe8afa53088b406f0c1cb5d9e280370fc72a74cf116ffd343c4053906108b6908490613fa7565b600d54839081106116fa5760405162461bcd60e51b81526004016107fa90614204565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b89061172e903390600401613f6f565b60206040518083038186803b15801561174657600080fd5b505afa15801561175a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177e9190613e70565b806118085750600154604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba21906117b8903390600401613f6f565b60206040518083038186803b1580156117d057600080fd5b505afa1580156117e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118089190613e70565b6118245760405162461bcd60e51b81526004016107fa90614199565b811561183257611832611bb6565b61186f83611869600d878154811061184657fe5b90600052602060002090600402016001015460125461330490919063ffffffff16565b9061320a565b60128190555082600d858154811061188357fe5b90600052602060002090600402016001018190555050505050565b60135481565b600d54819081106118c75760405162461bcd60e51b81526004016107fa90614204565b6000600d83815481106118d657fe5b90600052602060002090600402019050806002015443116118f75750611a36565b60145481600201541061190a5750611a36565b80546000906001600160a01b03166119206121fc565b6001600160a01b0316146119b25781546040516370a0823160e01b81526001600160a01b03909116906370a082319061195d903090600401613f6f565b60206040518083038186803b15801561197557600080fd5b505afa158015611989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ad9190613ea4565b6119ba565b6119ba610a55565b905060006014544310156119ce57436119d2565b6014545b90508115806119e357506001830154155b156119f75760029092019190915550611a36565b6000611a02866134d7565b9050611a25611a1a846110158464e8d4a5100061314a565b60038601549061320a565b600385015550600290920191909155505b5050565b600d5481908110611a5d5760405162461bcd60e51b81526004016107fa90614204565b60026000541415611ab5576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155600d805484908110611aca57fe5b60009182526020808320868452600e825260408085203386529092529083208054848255600182019490945560049092020180549093509091906001600160a01b0316611b156121fc565b6001600160a01b03161415611b2e57611b2e3382613455565b8254611b44906001600160a01b03163383613485565b84336001600160a01b03167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05958360405161155a9190613fa7565b6008602052600090815260409020546001600160a01b031681565b611baa611ba4612d24565b82613569565b50565b60015460ff1690565b600d5460005b81811015611a3657611bcd816118a4565b600101611bbc565b600a6020526000908152604090205463ffffffff1681565b6001600160a01b031660009081526002602052604090205490565b6000438210611c485760405162461bcd60e51b815260040180806020018281038252602b8152602001806145c8602b913960400191505060405180910390fd5b6001600160a01b0383166000908152600a602052604090205463ffffffff1680611c7657600091505061097b565b6001600160a01b038416600090815260096020908152604080832063ffffffff600019860181168552925290912054168310611ce5576001600160a01b03841660009081526009602090815260408083206000199490940163ffffffff1683529290522060010154905061097b565b6001600160a01b038416600090815260096020908152604080832083805290915290205463ffffffff16831015611d2057600091505061097b565b600060001982015b8163ffffffff168163ffffffff161115611dd4576000600263ffffffff848403166001600160a01b038916600090815260096020908152604080832094909304860363ffffffff8181168452948252918390208351808501909452805490941680845260019094015490830152925090871415611daf5760200151945061097b9350505050565b805163ffffffff16871115611dc657819350611dcd565b6001820392505b5050611d28565b506001600160a01b038516600090815260096020908152604080832063ffffffff9094168352929052206001015491505092915050565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b890611e3f903390600401613f6f565b60206040518083038186803b158015611e5757600080fd5b505afa158015611e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e8f9190613e70565b80611f195750600154604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba2190611ec9903390600401613f6f565b60206040518083038186803b158015611ee157600080fd5b505afa158015611ef5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f199190613e70565b611f355760405162461bcd60e51b81526004016107fa90614199565b6001600160a01b038216600090815260106020526040902054829060ff1615611f705760405162461bcd60e51b81526004016107fa90614029565b6014544310611f915760405162461bcd60e51b81526004016107fa906142e5565b8115611f9f57611f9f611bb6565b60006013544311611fb257601354611fb4565b435b601254909150611fc4908661320a565b6012556001600160a01b0384811660008181526010602090815260408083208054600160ff19909116811790915581516080810183529485529184018a815290840186815260608501848152600d80548086018255955294517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5600490950294850180546001600160a01b0319169190971617909555517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb683015592517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb782015590517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb8909101556120d4610957565b6001600160a01b039095166000908152600f60205260409020940390935550505050565b600b6020526000908152604090205481565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b89061213e903390600401613f6f565b60206040518083038186803b15801561215657600080fd5b505afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e9190613e70565b6121aa5760405162461bcd60e51b81526004016107fa90614079565b60018054610100600160a81b0319166101006001600160a01b038416908102919091179091556040517fad9400e618eb1344fde53db22397a1b82c765527ecbba3a5c86bcac15090828b90600090a250565b600060018054906101000a90046001600160a01b03166001600160a01b031663835c5cbb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561224a57600080fd5b505afa15801561225e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a069190613d1c565b600154604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b8906122b6903390600401613f6f565b60206040518083038186803b1580156122ce57600080fd5b505afa1580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190613e70565b806123905750600154604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba2190612340903390600401613f6f565b60206040518083038186803b15801561235857600080fd5b505afa15801561236c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123909190613e70565b6123ac5760405162461bcd60e51b81526004016107fa90614199565b6111ce6135fe565b600181565b6000610bff600161100f8486613304565b600e6020908152600092835260408084209091529082529020805460019091015482565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561094d5780601f106109225761010080835404028352916020019161094d565b60115481565b6000610977612462612d24565b84610bc4856040518060600160405280602581526020016145f3602591396003600061248c612d24565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190612f71565b60006124d16124ca612d24565b8484612e14565b610977600860006124e0612d24565b6001600160a01b0390811682526020808301939093526040918201600090812054888316825260089094529190912054918116911684613008565b6001600160a01b0381166000908152600a602052604081205463ffffffff1680612546576000610bff565b6001600160a01b038316600090815260096020908152604080832063ffffffff60001986011684529091529020600101549392505050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666125a96108c1565b805190602001206125b8613680565b60408051602080820195909552808201939093526060830191909152306080808401919091528151808403909101815260a0830182528051908401207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08401526001600160a01b038b1660e084015261010083018a90526101208084018a9052825180850390910181526101408401835280519085012061190160f01b6101608501526101628401829052610182808501829052835180860390910181526101a285018085528151918701919091206000918290526101c2860180865281905260ff8b166101e287015261020286018a90526102228601899052935192965090949293909260019261024280840193601f198301929081900390910190855afa1580156126eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661273d5760405162461bcd60e51b815260040180806020018281038252602a815260200180614574602a913960400191505060405180910390fd5b6001600160a01b0381166000908152600b60205260409020805460018101909155891461279b5760405162461bcd60e51b81526004018080602001828103825260268152602001806145246026913960400191505060405180910390fd5b874211156127da5760405162461bcd60e51b815260040180806020018281038252602a81526020018061454a602a913960400191505060405180910390fd5b6127e4818b613569565b505050505b505050505050565b600f6020526000908152604090205481565b60106020526000908152604090205460ff1681565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d54829081106128665760405162461bcd60e51b81526004016107fa90614204565b600260005414156128be576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155600d8054859081106128d357fe5b60009182526020808320878452600e82526040808520338652909252922060049091029091019150612904856118a4565b805415612a3757600061293982600101546112e764e8d4a510006110158760030154876000015461314a90919063ffffffff16565b90508015612a3557600c546000906001600160a01b03161561299e57600c54604080516302f4bde360e11b8152905161299b926001600160a01b0316916305e97bc6916004808301926020929190829003018186803b15801561134f57600080fd5b90505b6129ac336114208484613304565b508015612a3357600c546000906129cc906001600160a01b031683613361565b600c5460405163282d3fdf60e01b81529192506001600160a01b03169063282d3fdf906129ff9033908590600401613f83565b600060405180830381600087803b158015612a1957600080fd5b505af1158015612a2d573d6000803e3d6000fd5b50505050505b505b505b8315612a8f578154612a54906001600160a01b0316333087613684565b81546001600160a01b0316612a676121fc565b6001600160a01b03161415612a8057612a8033856136de565b8054612a8c908561320a565b81555b60038201548154612aaa9164e8d4a51000916110159161314a565b6001820155604051859033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159061155a908890613fa7565b600d5460009083908110612b095760405162461bcd60e51b81526004016107fa90614204565b6000600d8581548110612b1857fe5b60009182526020808320888452600e825260408085206001600160a01b038a8116875293528420600493909302016003810154815491955092939116612b5c6121fc565b6001600160a01b031614612bee5783546040516370a0823160e01b81526001600160a01b03909116906370a0823190612b99903090600401613f6f565b60206040518083038186803b158015612bb157600080fd5b505afa158015612bc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be99190613ea4565b612bf6565b612bf6610a55565b9050836002015443118015612c0a57508015155b15612c3d576000612c1a896134d7565b9050612c39612c32836110158464e8d4a5100061314a565b849061320a565b9250505b612c6583600101546112e764e8d4a5100061101586886000015461314a90919063ffffffff16565b98975050505050505050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600060018054906101000a90046001600160a01b03166001600160a01b031663ee138d0f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561224a57600080fd5b60096020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b60015461010090046001600160a01b031690565b3390565b6001600160a01b038316612d6d5760405162461bcd60e51b81526004018080602001828103825260248152602001806145006024913960400191505060405180910390fd5b6001600160a01b038216612db25760405162461bcd60e51b81526004018080602001828103825260228152602001806143e06022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316612e595760405162461bcd60e51b81526004018080602001828103825260258152602001806144db6025913960400191505060405180910390fd5b6001600160a01b038216612e9e5760405162461bcd60e51b815260040180806020018281038252602381526020018061439b6023913960400191505060405180910390fd5b612ea9838383613145565b612ee681604051806060016040528060268152602001614402602691396001600160a01b0386166000908152600260205260409020549190612f71565b6001600160a01b038085166000908152600260205260408082209390935590841681522054612f15908261320a565b6001600160a01b0380841660008181526002602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156130005760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612fc5578181015183820152602001612fad565b50505050905090810190601f168015612ff25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b816001600160a01b0316836001600160a01b03161415801561302a5750600081115b15613145576001600160a01b038316156130bc576001600160a01b0383166000908152600a602052604081205463ffffffff16908161306a57600061309c565b6001600160a01b038516600090815260096020908152604080832063ffffffff60001987011684529091529020600101545b905060006130aa8285613304565b90506130b88684848461370d565b5050505b6001600160a01b03821615613145576001600160a01b0382166000908152600a602052604081205463ffffffff1690816130f7576000613129565b6001600160a01b038416600090815260096020908152604080832063ffffffff60001987011684529091529020600101545b90506000613137828561320a565b90506127e98584848461370d565b505050565b6000826131595750600061097b565b8282028284828161316657fe5b0414610bff5760405162461bcd60e51b81526004018080602001828103825260218152602001806144996021913960400191505060405180910390fd5b60008082116131f9576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161320257fe5b049392505050565b600082820183811015610bff576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b61326c611bad565b6132b4576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6132e7612d24565b604080516001600160a01b039092168252519081900360200190a1565b60008282111561335b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008061336c61103b565b9050600080613379610a55565b9050808311156133a95761338d8382613304565b8511156133a55761339e8382613304565b91506133a9565b8491505b6133b16121fc565b6001600160a01b031663a9059cbb87846040518363ffffffff1660e01b81526004016133de929190613f83565b602060405180830381600087803b1580156133f857600080fd5b505af115801561340c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134309190613e70565b61344c5760405162461bcd60e51b81526004016107fa9061413c565b50949350505050565b61345f8282613872565b6001600160a01b03808316600090815260086020526040812054611a3692169083613008565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261314590849061396e565b600080600d83815481106134e757fe5b906000526020600020906004020190504381600201541061351a5760405162461bcd60e51b81526004016107fa906140c8565b600061353c826002015460145443101561353457436105b6565b6014546123b9565b9050613561601254611015846001015461100f6011548661314a90919063ffffffff16565b949350505050565b6001600160a01b038083166000908152600860205260408120549091169061359084611bed565b6001600160a01b0385811660008181526008602052604080822080546001600160a01b031916898616908117909155905194955093928616927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46135f8828483613008565b50505050565b613606611bad565b1561364b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586132e7612d24565b4690565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526135f890859061396e565b6136e88282613a1f565b6001600160a01b03808316600090815260086020526040812054611a36921683613008565b60006137314360405180606001604052806038815260200161446160389139613b11565b905060008463ffffffff1611801561377a57506001600160a01b038516600090815260096020908152604080832063ffffffff6000198901811685529252909120548282169116145b156137b7576001600160a01b038516600090815260096020908152604080832063ffffffff60001989011684529091529020600101829055613828565b60408051808201825263ffffffff808416825260208083018681526001600160a01b038a166000818152600984528681208b8616825284528681209551865490861663ffffffff199182161787559251600196870155908152600a9092529390208054928801909116919092161790555b604080518481526020810184905281516001600160a01b038816927fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724928290030190a25050505050565b6001600160a01b0382166138b75760405162461bcd60e51b81526004018080602001828103825260218152602001806144ba6021913960400191505060405180910390fd5b6138c382600083613145565b613900816040518060600160405280602281526020016143be602291396001600160a01b0385166000908152600260205260409020549190612f71565b6001600160a01b0383166000908152600260205260409020556004546139269082613304565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60006139c3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613b6f9092919063ffffffff16565b805190915015613145578080602001905160208110156139e257600080fd5b50516131455760405162461bcd60e51b815260040180806020018281038252602a81526020018061459e602a913960400191505060405180910390fd5b6001600160a01b038216613a7a576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b613a8660008383613145565b600454613a93908261320a565b6004556001600160a01b038216600090815260026020526040902054613ab9908261320a565b6001600160a01b03831660008181526002602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000816401000000008410613b675760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612fc5578181015183820152602001612fad565b509192915050565b6060613561848460008585613b8385613c94565b613bd4576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310613c125780518252601f199092019160209182019101613bf3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613c74576040519150601f19603f3d011682016040523d82523d6000602084013e613c79565b606091505b5091509150613c89828286613c9a565b979650505050505050565b3b151590565b60608315613ca9575081610bff565b825115613cb95782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315612fc5578181015183820152602001612fad565b600060208284031215613d11578081fd5b8135610bff81614377565b600060208284031215613d2d578081fd5b8151610bff81614377565b60008060408385031215613d4a578081fd5b8235613d5581614377565b91506020830135613d6581614377565b809150509250929050565b600080600060608486031215613d84578081fd5b8335613d8f81614377565b92506020840135613d9f81614377565b929592945050506040919091013590565b60008060408385031215613dc2578182fd5b8235613dcd81614377565b946020939093013593505050565b60008060008060008060c08789031215613df3578182fd5b8635613dfe81614377565b95506020870135945060408701359350606087013560ff81168114613e21578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215613e4d578182fd5b8235613e5881614377565b9150602083013563ffffffff81168114613d65578182fd5b600060208284031215613e81578081fd5b8151610bff8161438c565b600060208284031215613e9d578081fd5b5035919050565b600060208284031215613eb5578081fd5b5051919050565b60008060408385031215613ece578182fd5b823591506020830135613d6581614377565b600080600060608486031215613ef4578081fd5b833592506020840135613f0681614377565b91506040840135613f168161438c565b809150509250925092565b60008060408385031215613f33578182fd5b50508035926020909101359150565b600080600060608486031215613f56578081fd5b83359250602084013591506040840135613f168161438c565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b6000602080835283518082850152825b8181101561400257858101830151858201604001528201613fe6565b818111156140135783604083870101525b50601f01601f1916929092016040019392505050565b60208082526030908201527f4c69717569646974794d696e696e674d61737465723a3a6e6f6e4475706c696360408201526f185d19590e88111d5c1b1a58d85d195960821b606082015260800190565b6020808252602f908201527f436f72655265663a3a6f6e6c79476f7665726e6f723a2043616c6c657220697360408201526e103737ba10309033b7bb32b93737b960891b606082015260800190565b6020808252604e908201527f4c69717569646974794d696e696e674d61737465723a3a676574584d5352657760408201527f6172643a204d757374206c6974746c65207468616e207468652063757272656e60608201526d3a10313637b1b590373ab6b132b960911b608082015260a00190565b60208082526037908201527f4c69717569646974794d696e696e674d61737465723a3a73616665584d53547260408201527f616e736665723a205472616e73666572206661696c6564000000000000000000606082015260800190565b60208082526045908201527f436f72655265663a3a6f6e6c79477561726469616e4f72476f7665726e6f723a60408201527f2043616c6c6572206973206e6f74206120677561726469616e206f7220676f7660608201526432b93737b960d91b608082015260a00190565b6020808252602d908201527f4c69717569646974794d696e696e674d61737465723a3a76616c69646174655060408201526c1a590e88139bdd08195e1a5cdd609a1b606082015260800190565b60208082526029908201527f4c69717569646974794d696e696e674d61737465723a3a77697468647261773a60408201526808139bdd0819dbdbd960ba1b606082015260800190565b6020808252602b908201527f4c69717569646974794d696e696e674d61737465723a3a757064617465456e6460408201526a426c6f636b3a204c65737360a81b606082015260800190565b6020808252602f908201527f4c69717569646974794d696e696e674d61737465723a3a616464506f6f6c3a2060408201526e45786365656420656e64626c6f636b60881b606082015260800190565b918252602082015260400190565b63ffffffff91909116815260200190565b63ffffffff929092168252602082015260400190565b60ff91909116815260200190565b6001600160a01b0381168114611baa57600080fd5b8015158114611baa57600080fdfe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636544414f546f6b656e3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636544414f546f6b656e3a3a5f7772697465436865636b706f696e743a20426c6f636b206e756d62657220657863656564732033322062697473536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737344414f546f6b656e3a3a64656c656761746542795369673a20496e76616c6964206e6f6e636544414f546f6b656e3a3a64656c656761746542795369673a205369676e6174757265206578706972656444414f546f6b656e3a3a64656c656761746542795369673a20496e76616c6964207369676e61747572655361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656444414f546f6b656e3a3a6765745072696f72566f7465733a204e6f74207965742064657465726d696e656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212204fadf2698282aa78e679d540871e52216134434e0bb32fea57f461b1425cc23f64736f6c6343000706003300000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7000000000000000000000000381facb9282770a5e3ac6c8637096b442039c3db0000000000000000000000000000000000000000000000004064976a8dd000000000000000000000000000000000000000000000000000000000000000a0c61c0000000000000000000000000000000000000000000000000000000001dd2e1c

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

00000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7000000000000000000000000381facb9282770a5e3ac6c8637096b442039c3db0000000000000000000000000000000000000000000000004064976a8dd000000000000000000000000000000000000000000000000000000000000000a0c61c0000000000000000000000000000000000000000000000000000000001dd2e1c

-----Decoded View---------------
Arg [0] : _core (address): 0x00789cfb69499c65ac9a3a68fb4917c9b4fca2a7
Arg [1] : _vestingMaster (address): 0x381facb9282770a5e3ac6c8637096b442039c3db
Arg [2] : _xmsPerBlock (uint256): 4640000000000000000
Arg [3] : _startBlock (uint256): 10536476
Arg [4] : _endBlock (uint256): 31272476

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7
Arg [1] : 000000000000000000000000381facb9282770a5e3ac6c8637096b442039c3db
Arg [2] : 0000000000000000000000000000000000000000000000004064976a8dd00000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000a0c61c
Arg [4] : 0000000000000000000000000000000000000000000000000000000001dd2e1c


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.