Contract 0x7859b01bbf675d67da8cd128a50d155cd881b576 5

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x7d759afb1d2186ca49b86e60596ee5d078be9ebffd90308b2f0e8f9532761f9bApprove130625642021-11-29 23:57:563 mins ago0x9ebd5d49426ecce20ba1714c760f8140a88dbfa4 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x6f954e3345dec2044745f5de9e17799e9b64b85e61e24fd39ec93a1c543a7634Approve130625612021-11-29 23:57:473 mins ago0x13c6583620c1eb7f1741387d6538508b9464e47d IN  Mars Ecosystem: XMS Token0 BNB0.000271242
0x261de89a2f0c3da7f78b472ec24f7d1f834a80ae34b8ddadeb112714ea624df5Approve130624892021-11-29 23:53:337 mins ago0x2c9e019d8b75a1c629637b931597a4a663c88c9b IN  Mars Ecosystem: XMS Token0 BNB0.000271242
0x13fca436fdc870a37b2f3895903d325d526f989fb6037e274d58ef3edf6ffdb7Approve130624512021-11-29 23:51:399 mins ago0x2bc917ed0e57f30443802cfd56cb8654b2afba98 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x01e5418b1d6750c9fd7e076cb01cb229a8e38bc951f95b2d311d76b6d17ab566Approve130624502021-11-29 23:51:369 mins ago0x27ae7e0ae54675de72bb99e33973652f4986e4bd IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0xe1e1b0f85b63dbca0717d42f97e0706a41a82469d99d717a7096a2ffc889c438Approve130623472021-11-29 23:46:2314 mins ago0x2eb253762176763331867807749a48b8d59755f6 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x015209ac444898623b0770e79362ad7128f6c901c041a894fa01a198d373d9d9Approve130623242021-11-29 23:45:1415 mins ago0x16e404398fdd6dd445df62f576e5061e8293077e IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x2e4d256d78ec99712e74c0db3067bc08ad6fff648c3a136a4f7c6562b0fbb3ddApprove130623112021-11-29 23:44:3116 mins ago0xe246bc5d9960ebd1df1d10aba6155d76bb403fd1 IN  Mars Ecosystem: XMS Token0 BNB0.000242083485
0x1cad7d2f39632e544b97f81db84502fe1fd99a3210ddff3390d9fbb1414e6683Approve130622992021-11-29 23:43:4117 mins ago0xb1946a1fc4e20cf535998ea7219e56f80e388668 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x1a16ce129d222d23f397d17298602bd401fe564d0c4be3f4f65f5500504cff81Approve130622832021-11-29 23:42:3818 mins ago0x837a987d5b7545365c918f03cb477da5e441e217 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x5feebd0cde16f0b8c1e2932c256ead5d4b43f8324e8f9d2b9d1c9fd978ece9a0Approve130622772021-11-29 23:42:1518 mins ago0x1a1e9c7a68e7184f4f103a895b3dc612ee745136 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x1f27684b045ba070ecb1783a937f5aed46b90002249807d5b6f2d76fbf8884a0Approve130622582021-11-29 23:41:1119 mins ago0xb0a57cfa4ec0f2b48264a5470500d0a99f76175c IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0xf816bab72ebc39cdee7c940bbef63fd89c0f2e87108e347b2e9794955b024d2aApprove130622172021-11-29 23:38:5122 mins ago0x62a79b7ecf3d79c4f98f0063e2ea25287fe59c07 IN  Mars Ecosystem: XMS Token0 BNB0.000242083485
0xab925991a774027cf3cf622db9d0c7e918d1a4f6df280ba5aea11ee9efe113b1Approve130621972021-11-29 23:37:5123 mins ago0xab9fe8b2f56adc54a85a7e43be77a21cbaac2524 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0xed47c12601f8128641e98a48f55cc58f5977be1910b5ad3c5a148b4ad05b896eApprove130621892021-11-29 23:37:2723 mins ago0xa5dcc68621618f6b4c4c8014805d0b77873f6a34 IN  Mars Ecosystem: XMS Token0 BNB0.000242083485
0x23f05fdfda2b3091a34f28856b47df492a3551b49d4797a557241a9e0ab5906fApprove130621862021-11-29 23:37:1823 mins ago0x6690eab81a7aae644b6d4b87f415531a26bb83e6 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0xc618008b262546d99de376882f4215df83cea533623ddc7e5dc5e08e6de60198Approve130620872021-11-29 23:32:0628 mins ago0x97c2d2308d02dea8e636cc0a725e5e2e75f478ce IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x64e4f1a4b81c87877228cbdf04a6381a0bcc631686f5aff63d25b78c5c6b5536Approve130620632021-11-29 23:30:4030 mins ago0x5af48012813e31bebf8a2af5a68ebd9371a2da0b IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x06333e8d3846b18136f99a1e17d80c030db9e90da2057c76782294dc5ab762d5Approve130620622021-11-29 23:30:3730 mins ago0xc4c10be7e2d2c7c28af0c08855a74a7935a4bd89 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0xf626c28faca93bdc38d01f6708cc1a77d23cf1a40dbcf6d5a05e3ea92374880eApprove130620412021-11-29 23:29:3331 mins ago0xe263d59c6fac4cfbd797b2f587d1f1b824e3f5a5 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0xc70333640ad94ecd2845d09c97fe5c68023fa3b7a5c6a8d40d45396341ba6d05Transfer130620312021-11-29 23:29:0331 mins ago0xaccd292468caf4b169d614cc1191e74dc0dd3e72 IN  Mars Ecosystem: XMS Token0 BNB0.000176134
0x04e53ab75ea173c4810f8bf9d680a58c23eaed9d26485fb4a8e59ec9defb8e58Approve130620202021-11-29 23:28:3032 mins ago0xdd9ad577a2bc21ee6aff8c98c76f60047e2b924c IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x390a3bf988520a5cc6be162b4f362a58474ee38a96a9458c00015d5524508393Approve130620132021-11-29 23:28:0932 mins ago0x5b0450c0c90d39e3f48dc97c1382f615e2b5fac6 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x2389e809f73a1f7974014b10faf84a57ede67041007abadfb9843b2827f25403Approve130619632021-11-29 23:25:3935 mins ago0xac4ee5ce00407a39c7a605179dc3343d840708c9 IN  Mars Ecosystem: XMS Token0 BNB0.000226035
0x1b666f431b83fc655a8b8f7c56b730b01d3bf8937e5ad5add683ebcff64ada71Approve130619362021-11-29 23:24:1836 mins ago0x15a754952071b94c0eca0d248a48e352c6e30dfb IN  Mars Ecosystem: XMS Token0 BNB0.000242083485
[ Download CSV Export 

OVERVIEW

Mars Ecosystem builds the central bank and reserve currency for DeFi.

Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
XMSToken

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 12 : XMSToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;

import "../interfaces/IXMSToken.sol";
import "../refs/CoreRef.sol";

// XMSToken with Governance.
contract XMSToken is IXMSToken, CoreRef {
    string public constant override name = "Mars Ecosystem Token";

    string public constant override symbol = "XMS";

    uint8 public constant override decimals = 18;

    /// @notice Total number of tokens in circulation
    uint256 public override totalSupply = 1_000_000_000e18;

    // Allowance amounts on behalf of others
    mapping(address => mapping(address => uint96)) internal _allowances;

    // Official record of token balances for each account
    mapping(address => uint96) internal _balances;

    /// @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 The EIP-712 typehash for the permit struct used by the contract
    bytes32 public constant PERMIT_TYPEHASH =
        keccak256(
            "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
        );

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

    constructor(address _treasury, address _core) CoreRef(_core) {
        _balances[_treasury] = uint96(totalSupply);
        emit Transfer(address(0), _treasury, totalSupply);
    }

    function mint(address _to, uint256 _amount) external override onlyGovernor {
        require(_to != address(0), "XMSToken::mint: Zero address");
        uint96 amount =
            safe96(_amount, "XMSToken::mint: Amount exceeds 96 bits");
        uint96 safeSupply =
            safe96(totalSupply, "XMSToken::mint: TotalSupply exceeds 96 bits");
        totalSupply = add96(
            safeSupply,
            amount,
            "XMSToken::mint: TotalSupply exceeds 96 bits"
        );

        // transfer the amount to the recipient
        _balances[_to] = add96(
            _balances[_to],
            amount,
            "XMSToken::mint: Transfer amount overflows"
        );
        emit Transfer(address(0), _to, amount);

        // move delegates
        _moveDelegates(address(0), delegates[_to], amount);
    }

    /**
     * @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
     * @param account The address of the account holding the funds
     * @param spender The address of the account spending the funds
     * @return The number of tokens approved
     */
    function allowance(address account, address spender)
        external
        view
        override
        returns (uint256)
    {
        return _allowances[account][spender];
    }

    /**
     * @notice Approve `spender` to transfer up to `amount` from `msg.sender`
     * @dev This will overwrite the approval amount for `spender`
     *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
     * @param spender The address of the account which may transfer tokens
     * @param amount The number of tokens that are approved (2^256-1 means infinite)
     * @return Whether or not the approval succeeded
     */
    function approve(address spender, uint256 amount)
        external
        override
        returns (bool)
    {
        uint96 amount_;
        if (amount == uint256(-1)) {
            amount_ = uint96(-1);
        } else {
            amount_ = safe96(
                amount,
                "XMSToken::approve: Amount exceeds 96 bits"
            );
        }

        _allowances[msg.sender][spender] = amount_;

        emit Approval(msg.sender, spender, amount_);
        return true;
    }

    /**
     * @notice Triggers an approval from owner to spends
     * @param owner The address to approve from
     * @param spender The address to be approved
     * @param amount The number of tokens that are approved (2^256-1 means infinite)
     * @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 permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external override {
        uint96 amount_;
        if (amount == uint256(-1)) {
            amount_ = uint96(-1);
        } else {
            amount_ = safe96(
                amount,
                "XMSToken::permit: Amount exceeds 96 bits"
            );
        }
        bytes32 domainSeparator =
            keccak256(
                abi.encode(
                    DOMAIN_TYPEHASH,
                    keccak256(bytes(name)),
                    getChainId(),
                    address(this)
                )
            );

        bytes32 digest =
            keccak256(
                abi.encodePacked(
                    "\x19\x01",
                    domainSeparator,
                    keccak256(
                        abi.encode(
                            PERMIT_TYPEHASH,
                            owner,
                            spender,
                            amount,
                            nonce,
                            expiry
                        )
                    )
                )
            );
        address signatory = ecrecover(digest, v, r, s);
        require(signatory == owner, "XMSToken::permit: Unauthorized");
        require(nonce == nonces[owner]++, "XMSToken::permit: Invalid nonce");
        require(signatory != address(0), "XMSToken::permit: Invalid signature");

        require(
            block.timestamp <= expiry,
            "XMSToken::permit: Signature expired"
        );
        _allowances[owner][spender] = amount_;

        emit Approval(owner, spender, amount_);
    }

    /**
     * @notice Get the number of tokens held by the `account`
     * @param account The address of the account to get the balance of
     * @return The number of tokens held
     */
    function balanceOf(address account)
        external
        view
        override
        returns (uint256)
    {
        return _balances[account];
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `to`
     * @param to The address of the destination account
     * @param rawAmount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address to, uint256 rawAmount)
        external
        override
        returns (bool)
    {
        uint96 amount =
            safe96(rawAmount, "XMSToken::transfer: Amount exceeds 96 bits");
        _transferTokens(msg.sender, 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 rawAmount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(
        address from,
        address to,
        uint256 rawAmount
    ) external override returns (bool) {
        address spender = msg.sender;
        uint96 spenderAllowance = _allowances[from][spender];
        uint96 amount =
            safe96(rawAmount, "XMSToken::transferFrom: Amount exceeds 96 bits");

        if (spender != from && spenderAllowance != uint96(-1)) {
            uint96 newAllowance =
                sub96(
                    spenderAllowance,
                    amount,
                    "XMSToken::transferFrom: Transfer amount exceeds spender allowance"
                );
            _allowances[from][spender] = newAllowance;

            emit Approval(from, spender, newAllowance);
        }

        _transferTokens(from, to, amount);
        return true;
    }

    /**
     * @notice Delegate votes from `msg.sender` to `delegatee`
     * @param delegatee The address to delegate votes to
     */
    function delegate(address delegatee) external override {
        return _delegate(msg.sender, 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),
            "XMSToken::delegateBySig: Invalid signature"
        );
        require(
            nonce == nonces[signatory]++,
            "XMSToken::delegateBySig: Invalid nonce"
        );
        require(
            block.timestamp <= expiry,
            "XMSToken::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 (uint96)
    {
        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 (uint96)
    {
        require(
            blockNumber < block.number,
            "XMSToken::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];
        uint96 delegatorBalance = _balances[delegator];
        delegates[delegator] = delegatee;

        emit DelegateChanged(delegator, currentDelegate, delegatee);

        _moveDelegates(currentDelegate, delegatee, delegatorBalance);
    }

    function _transferTokens(
        address from,
        address to,
        uint96 amount
    ) internal {
        require(
            from != address(0),
            "XMSToken::_transferTokens: Cannot transfer from the zero address"
        );
        require(
            to != address(0),
            "XMSToken::_transferTokens: Cannot transfer to the zero address"
        );

        _balances[from] = sub96(
            _balances[from],
            amount,
            "XMSToken::_transferTokens: Transfer amount exceeds balance"
        );
        _balances[to] = add96(
            _balances[to],
            amount,
            "XMSToken::_transferTokens: Transfer amount overflows"
        );
        emit Transfer(from, to, amount);

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

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

            if (dstRep != address(0)) {
                uint32 dstRepNum = numCheckpoints[dstRep];
                uint96 dstRepOld =
                    dstRepNum > 0
                        ? checkpoints[dstRep][dstRepNum - 1].votes
                        : 0;
                uint96 dstRepNew =
                    add96(
                        dstRepOld,
                        amount,
                        "XMSToken::_moveDelegates: Vote amount overflows"
                    );
                _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
            }
        }
    }

    function _writeCheckpoint(
        address delegatee,
        uint32 nCheckpoints,
        uint96 oldVotes,
        uint96 newVotes
    ) internal {
        uint32 blockNumber =
            safe32(
                block.number,
                "XMSToken::_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 safe96(uint256 n, string memory errorMessage)
        internal
        pure
        returns (uint96)
    {
        require(n < 2**96, errorMessage);
        return uint96(n);
    }

    function add96(
        uint96 a,
        uint96 b,
        string memory errorMessage
    ) internal pure returns (uint96) {
        uint96 c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function sub96(
        uint96 a,
        uint96 b,
        string memory errorMessage
    ) internal pure returns (uint96) {
        require(b <= a, errorMessage);
        return a - b;
    }

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

File 2 of 12 : 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 12 : 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 12 : 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 5 of 12 : 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 6 of 12 : 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 7 of 12 : 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 += 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 8 of 12 : 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 9 of 12 : 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 10 of 12 : 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 11 of 12 : 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 12 of 12 : 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());
    }
}

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":"_treasury","type":"address"},{"internalType":"address","name":"_core","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_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":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"},{"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":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","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":"uint96","name":"votes","type":"uint96"}],"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":"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":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUSDMAmountGovernance","outputs":[{"internalType":"uint256","name":"usdmAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","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":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"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":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"core_","type":"address"}],"name":"setCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"rawAmount","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":"rawAmount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","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":[],"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"}]

60806040526b033b2e3c9fd0803ce800000060015534801561002057600080fd5b50604051612efe380380612efe8339818101604052604081101561004357600080fd5b508051602091820151600080546001600160a81b0319166101006001600160a01b03808516919091029190911782556001805491851680845260038752604080852080546001600160601b0319166001600160601b03909516949094179093559054825190815291519495939490937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a35050612e13806100eb6000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c806370a082311161010f578063b4b5ea57116100a2578063e7a324dc11610071578063e7a324dc1461061e578063ee138d0f14610626578063f1127ed81461062e578063f2f4eb2614610688576101f0565b8063b4b5ea571461052b578063c3cda52014610551578063dbaef5e014610598578063dd62ed3e146105f0576101f0565b8063835c5cbb116100de578063835c5cbb146104e75780638456cb59146104ef57806395d89b41146104f7578063a9059cbb146104ff576101f0565b806370a082311461042d578063782d6fe1146104535780637ecebe001461049b57806380009630146104c1576101f0565b806330adf81f11610187578063587cde1e11610156578063587cde1e1461037e5780635c19a95c146103c05780635c975abb146103e65780636fcfff45146103ee576101f0565b806330adf81f14610322578063313ce5671461032a5780633f4ba83a1461034857806340c10f1914610352576101f0565b806320606b70116101c357806320606b70146102d457806323b872dd146102dc57806326f87c01146103125780632e6e35b91461031a576101f0565b806306fdde03146101f5578063095ea7b3146102725780630f057c23146102b257806318160ddd146102cc575b600080fd5b6101fd610690565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023757818101518382015260200161021f565b50505050905090810190601f1680156102645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61029e6004803603604081101561028857600080fd5b506001600160a01b0381351690602001356106c0565b604080519115158252519081900360200190f35b6102ba61077e565b60408051918252519081900360200190f35b6102ba610808565b6102ba61080e565b61029e600480360360608110156102f257600080fd5b506001600160a01b03813581169160208101359091169060400135610832565b6102ba610977565b6102ba610da4565b6102ba610dae565b610332610dd2565b6040805160ff9092168252519081900360200190f35b610350610dd7565b005b6103506004803603604081101561036857600080fd5b506001600160a01b038135169060200135610f14565b6103a46004803603602081101561039457600080fd5b50356001600160a01b0316611169565b604080516001600160a01b039092168252519081900360200190f35b610350600480360360208110156103d657600080fd5b50356001600160a01b0316611184565b61029e611191565b6104146004803603602081101561040457600080fd5b50356001600160a01b031661119a565b6040805163ffffffff9092168252519081900360200190f35b6102ba6004803603602081101561044357600080fd5b50356001600160a01b03166111b2565b61047f6004803603604081101561046957600080fd5b506001600160a01b0381351690602001356111d6565b604080516001600160601b039092168252519081900360200190f35b6102ba600480360360208110156104b157600080fd5b50356001600160a01b03166113fe565b610350600480360360208110156104d757600080fd5b50356001600160a01b0316611410565b6103a4611500565b610350611587565b6101fd6116b9565b61029e6004803603604081101561051557600080fd5b506001600160a01b0381351690602001356116d8565b61047f6004803603602081101561054157600080fd5b50356001600160a01b0316611714565b610350600480360360c081101561056757600080fd5b506001600160a01b038135169060208101359060408101359060ff6060820135169060808101359060a00135611785565b61035060048036036101008110156105af57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060ff60a0820135169060c08101359060e00135611a36565b6102ba6004803603604081101561060657600080fd5b506001600160a01b0381358116916020013516611e66565b6102ba611e9a565b6103a4611ebe565b6106606004803603604081101561064457600080fd5b5080356001600160a01b0316906020013563ffffffff16611f0d565b6040805163ffffffff90931683526001600160601b0390911660208301528051918290030190f35b6103a4611f42565b6040518060400160405280601481526020017326b0b9399022b1b7b9bcb9ba32b6902a37b5b2b760611b81525081565b6000806000198314156106d657506000196106fb565b6106f883604051806060016040528060298152602001612d1260299139611f56565b90505b3360008181526002602090815260408083206001600160a01b0389168085529083529281902080546001600160601b0319166001600160601b038716908117909155815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a360019150505b92915050565b6000610788611ebe565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016107b39190612915565b60206040518083038186803b1580156107cb57600080fd5b505afa1580156107df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080391906128fd565b905090565b60015481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b03831660009081526002602090815260408083203380855290835281842054825160608101909352602e80845291936001600160601b0390911692859261088a9288929190612b6290830139611f56565b9050866001600160a01b0316836001600160a01b0316141580156108b757506001600160601b0382811614155b1561095f5760006108e18383604051806080016040528060418152602001612b2160419139611ff0565b6001600160a01b038981166000818152600260209081526040808320948a168084529482529182902080546001600160601b0319166001600160601b03871690811790915582519081529151949550929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a3505b61096a87878361205d565b5060019695505050505050565b6000806000805b610986611f42565b6001600160a01b031663d200a2186040518163ffffffff1660e01b815260040160206040518083038186803b1580156109be57600080fd5b505afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f691906128fd565b811015610d9e57610a05611f42565b6001600160a01b03166379c9679b826040518263ffffffff1660e01b8152600401610a3091906129fc565b60206040518083038186803b158015610a4857600080fd5b505afa158015610a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8091906128c1565b925060005b610a8d611f42565b6001600160a01b03166380e2b70e856040518263ffffffff1660e01b8152600401610ab89190612915565b60206040518083038186803b158015610ad057600080fd5b505afa158015610ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0891906128fd565b811015610d9557610b17611f42565b6001600160a01b031663a0a01d9d85836040518363ffffffff1660e01b8152600401610b44929190612929565b60206040518083038186803b158015610b5c57600080fd5b505afa158015610b70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9491906128c1565b9250610d89846001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610bd257600080fd5b505afa158015610be6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0a91906128fd565b6040516370a0823160e01b8152610d83906001600160a01b038816906370a0823190610c3a908990600401612915565b60206040518083038186803b158015610c5257600080fd5b505afa158015610c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8a91906128fd565b610c92611f42565b6001600160a01b031663ee138d0f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610cca57600080fd5b505afa158015610cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0291906128c1565b6001600160a01b03166370a08231896040518263ffffffff1660e01b8152600401610d2d9190612915565b60206040518083038186803b158015610d4557600080fd5b505afa158015610d59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7d91906128fd565b90612242565b9061229b565b90940193600101610a85565b5060010161097e565b50505090565b6000610788611500565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b600054604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b890610e0b903390600401612915565b60206040518083038186803b158015610e2357600080fd5b505afa158015610e37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5b91906128dd565b80610ee55750600054604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba2190610e95903390600401612915565b60206040518083038186803b158015610ead57600080fd5b505afa158015610ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee591906128dd565b610f0a5760405162461bcd60e51b8152600401610f0190612991565b60405180910390fd5b610f12612302565b565b600054604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b890610f48903390600401612915565b60206040518083038186803b158015610f6057600080fd5b505afa158015610f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9891906128dd565b610fb45760405162461bcd60e51b8152600401610f0190612942565b6001600160a01b03821661100f576040805162461bcd60e51b815260206004820152601c60248201527f584d53546f6b656e3a3a6d696e743a205a65726f206164647265737300000000604482015290519081900360640190fd5b600061103382604051806060016040528060268152602001612db860269139611f56565b9050600061105b6001546040518060600160405280602b8152602001612abe602b9139611f56565b905061108081836040518060600160405280602b8152602001612abe602b91396123a2565b6001600160601b039081166001556001600160a01b0385166000908152600360209081526040918290205482516060810190935260298084526110d39491909116928692909190612bba908301396123a2565b6001600160a01b038516600081815260036020908152604080832080546001600160601b0319166001600160601b039687161790558051948716855251929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a36001600160a01b0380851660009081526004602052604081205461116392168461240c565b50505050565b6004602052600090815260409020546001600160a01b031681565b61118e338261259e565b50565b60005460ff1690565b60066020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600360205260409020546001600160601b031690565b60004382106112165760405162461bcd60e51b815260040180806020018281038252602b815260200180612a55602b913960400191505060405180910390fd5b6001600160a01b03831660009081526006602052604090205463ffffffff1680611244576000915050610778565b6001600160a01b038416600090815260056020908152604080832063ffffffff6000198601811685529252909120541683106112c0576001600160a01b03841660009081526005602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610778565b6001600160a01b038416600090815260056020908152604080832083805290915290205463ffffffff168310156112fb576000915050610778565b600060001982015b8163ffffffff168163ffffffff1611156113b9576000600263ffffffff848403166001600160a01b038916600090815260056020908152604080832094909304860363ffffffff818116845294825291839020835180850190945254938416808452600160201b9094046001600160601b031690830152925090871415611394576020015194506107789350505050565b805163ffffffff168711156113ab578193506113b2565b6001820392505b5050611303565b506001600160a01b038516600090815260056020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60076020526000908152604090205481565b600054604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b890611444903390600401612915565b60206040518083038186803b15801561145c57600080fd5b505afa158015611470573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149491906128dd565b6114b05760405162461bcd60e51b8152600401610f0190612942565b60008054610100600160a81b0319166101006001600160a01b03841690810291909117825560405190917fad9400e618eb1344fde53db22397a1b82c765527ecbba3a5c86bcac15090828b91a250565b60008060019054906101000a90046001600160a01b03166001600160a01b031663835c5cbb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561154f57600080fd5b505afa158015611563573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080391906128c1565b600054604051631c86b03760e31b81526101009091046001600160a01b03169063e43581b8906115bb903390600401612915565b60206040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160b91906128dd565b806116955750600054604051630c68ba2160e01b81526101009091046001600160a01b031690630c68ba2190611645903390600401612915565b60206040518083038186803b15801561165d57600080fd5b505afa158015611671573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169591906128dd565b6116b15760405162461bcd60e51b8152600401610f0190612991565b610f12612622565b60405180604001604052806003815260200162584d5360e81b81525081565b6000806116fd836040518060600160405280602a8152602001612c30602a9139611f56565b905061170a33858361205d565b5060019392505050565b6001600160a01b03811660009081526006602052604081205463ffffffff168061173f57600061177e565b6001600160a01b0383166000908152600560209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b60408051808201909152601481527326b0b9399022b1b7b9bcb9ba32b6902a37b5b2b760611b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fe59041d2f68de3427e75b26a4f72e5df2c500f8e230c11eafa42bb95fd34d2016117fd6126a5565b60408051602080820195909552808201939093526060830191909152306080808401919091528151808403909101815260a0830182528051908401207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08401526001600160a01b038b1660e084015261010083018a90526101208084018a9052825180850390910181526101408401835280519085012061190160f01b6101608501526101628401829052610182808501829052835180860390910181526101a285018085528151918701919091206000918290526101c2860180865281905260ff8b166101e287015261020286018a90526102228601899052935192965090949293909260019261024280840193601f198301929081900390910190855afa158015611930573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166119825760405162461bcd60e51b815260040180806020018281038252602a815260200180612c06602a913960400191505060405180910390fd5b6001600160a01b038116600090815260076020526040902080546001810190915589146119e05760405162461bcd60e51b8152600401808060200182810382526026815260200180612d926026913960400191505060405180910390fd5b87421115611a1f5760405162461bcd60e51b815260040180806020018281038252602a815260200180612b90602a913960400191505060405180910390fd5b611a29818b61259e565b505050505b505050505050565b6000600019871415611a4b5750600019611a70565b611a6d87604051806060016040528060288152602001612c5a60289139611f56565b90505b60408051808201909152601481527326b0b9399022b1b7b9bcb9ba32b6902a37b5b2b760611b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fe59041d2f68de3427e75b26a4f72e5df2c500f8e230c11eafa42bb95fd34d201611ae86126a5565b60408051602080820195909552808201939093526060830191909152306080808401919091528151808403909101815260a0830182528051908401207f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c960c08401526001600160a01b038e811660e08501528d1661010084015261012083018c905261014083018b90526101608084018b9052825180850390910181526101808401835280519085012061190160f01b6101a08501526101a284018290526101c280850191909152825180850390910181526101e28401808452815191860191909120600091829052610202850180855281905260ff8b1661022286015261024285018a90526102628501899052925191955091939192600192610282808301939192601f198301929081900390910190855afa158015611c2d573d6000803e3d6000fd5b5050506020604051035190508b6001600160a01b0316816001600160a01b031614611c9f576040805162461bcd60e51b815260206004820152601e60248201527f584d53546f6b656e3a3a7065726d69743a20556e617574686f72697a65640000604482015290519081900360640190fd5b6001600160a01b038c1660009081526007602052604090208054600181019091558914611d13576040805162461bcd60e51b815260206004820152601f60248201527f584d53546f6b656e3a3a7065726d69743a20496e76616c6964206e6f6e636500604482015290519081900360640190fd5b6001600160a01b038116611d585760405162461bcd60e51b8152600401808060200182810382526023815260200180612d6f6023913960400191505060405180910390fd5b87421115611d975760405162461bcd60e51b8152600401808060200182810382526023815260200180612be36023913960400191505060405180910390fd5b83600260008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b031602179055508a6001600160a01b03168c6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258660405180826001600160601b0316815260200191505060405180910390a3505050505050505050505050565b6001600160a01b0391821660009081526002602090815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b60008060019054906101000a90046001600160a01b03166001600160a01b031663ee138d0f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561154f57600080fd5b600560209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b60005461010090046001600160a01b031690565b600081600160601b8410611fe85760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611fad578181015183820152602001611f95565b50505050905090810190601f168015611fda5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b6000836001600160601b0316836001600160601b0316111582906120555760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611fad578181015183820152602001611f95565b505050900390565b6001600160a01b0383166120a25760405162461bcd60e51b8152600401808060200182810382526040815260200180612c826040913960400191505060405180910390fd5b6001600160a01b0382166120e75760405162461bcd60e51b815260040180806020018281038252603e815260200180612a80603e913960400191505060405180910390fd5b6001600160a01b03831660009081526003602090815260409182902054825160608101909352603a808452612132936001600160601b039092169285929190612a1b90830139611ff0565b6001600160a01b03848116600090815260036020908152604080832080546001600160601b0319166001600160601b0396871617905592861682529082902054825160608101909352603480845261219a9491909116928592909190612d3b908301396123a2565b6001600160a01b0383811660008181526003602090815260409182902080546001600160601b0319166001600160601b039687161790558151948616855290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a36001600160a01b0380841660009081526004602052604080822054858416835291205461223d9291821691168361240c565b505050565b60008261225157506000610778565b8282028284828161225e57fe5b041461177e5760405162461bcd60e51b8152600401808060200182810382526021815260200180612cf16021913960400191505060405180910390fd5b60008082116122f1576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816122fa57fe5b049392505050565b61230a611191565b612352576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6123856126a9565b604080516001600160a01b039092168252519081900360200190a1565b6000838301826001600160601b0380871690831610156124035760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611fad578181015183820152602001611f95565b50949350505050565b816001600160a01b0316836001600160a01b03161415801561243757506000816001600160601b0316115b1561223d576001600160a01b038316156124ef576001600160a01b03831660009081526006602052604081205463ffffffff1690816124775760006124b6565b6001600160a01b0385166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006124dd82856040518060600160405280602f8152602001612cc2602f9139611ff0565b90506124eb868484846126ad565b5050505b6001600160a01b0382161561223d576001600160a01b03821660009081526006602052604081205463ffffffff16908161252a576000612569565b6001600160a01b0384166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061259082856040518060600160405280602f8152602001612cc2602f91396123a2565b9050611a2e858484846126ad565b6001600160a01b03808316600081815260046020818152604080842080546003845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461116382848361240c565b61262a611191565b1561266f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586123856126a9565b4690565b3390565b60006126d143604051806060016040528060388152602001612ae96038913961286c565b905060008463ffffffff1611801561271a57506001600160a01b038516600090815260056020908152604080832063ffffffff6000198901811685529252909120548282169116145b15612779576001600160a01b0385166000908152600560209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055612818565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600583528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600690935292909220805460018801909316929091169190911790555b604080516001600160601b0380861682528416602082015281516001600160a01b038816927fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724928290030190a25050505050565b600081600160201b8410611fe85760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611fad578181015183820152602001611f95565b6000602082840312156128d2578081fd5b815161177e81612a05565b6000602082840312156128ee578081fd5b8151801515811461177e578182fd5b60006020828403121561290e578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252602f908201527f436f72655265663a3a6f6e6c79476f7665726e6f723a2043616c6c657220697360408201526e103737ba10309033b7bb32b93737b960891b606082015260800190565b60208082526045908201527f436f72655265663a3a6f6e6c79477561726469616e4f72476f7665726e6f723a60408201527f2043616c6c6572206973206e6f74206120677561726469616e206f7220676f7660608201526432b93737b960d91b608082015260a00190565b90815260200190565b6001600160a01b038116811461118e57600080fdfe584d53546f6b656e3a3a5f7472616e73666572546f6b656e733a205472616e7366657220616d6f756e7420657863656564732062616c616e6365584d53546f6b656e3a3a6765745072696f72566f7465733a204e6f74207965742064657465726d696e6564584d53546f6b656e3a3a5f7472616e73666572546f6b656e733a2043616e6e6f74207472616e7366657220746f20746865207a65726f2061646472657373584d53546f6b656e3a3a6d696e743a20546f74616c537570706c7920657863656564732039362062697473584d53546f6b656e3a3a5f7772697465436865636b706f696e743a20426c6f636b206e756d62657220657863656564732033322062697473584d53546f6b656e3a3a7472616e7366657246726f6d3a205472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365584d53546f6b656e3a3a7472616e7366657246726f6d3a20416d6f756e7420657863656564732039362062697473584d53546f6b656e3a3a64656c656761746542795369673a205369676e61747572652065787069726564584d53546f6b656e3a3a6d696e743a205472616e7366657220616d6f756e74206f766572666c6f7773584d53546f6b656e3a3a7065726d69743a205369676e61747572652065787069726564584d53546f6b656e3a3a64656c656761746542795369673a20496e76616c6964207369676e6174757265584d53546f6b656e3a3a7472616e736665723a20416d6f756e7420657863656564732039362062697473584d53546f6b656e3a3a7065726d69743a20416d6f756e7420657863656564732039362062697473584d53546f6b656e3a3a5f7472616e73666572546f6b656e733a2043616e6e6f74207472616e736665722066726f6d20746865207a65726f2061646472657373584d53546f6b656e3a3a5f6d6f766544656c6567617465733a20566f746520616d6f756e74206f766572666c6f7773536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77584d53546f6b656e3a3a617070726f76653a20416d6f756e7420657863656564732039362062697473584d53546f6b656e3a3a5f7472616e73666572546f6b656e733a205472616e7366657220616d6f756e74206f766572666c6f7773584d53546f6b656e3a3a7065726d69743a20496e76616c6964207369676e6174757265584d53546f6b656e3a3a64656c656761746542795369673a20496e76616c6964206e6f6e6365584d53546f6b656e3a3a6d696e743a20416d6f756e7420657863656564732039362062697473a2646970667358221220bfeaf4134bc6100fd84d8a11eb0155066b0ab42b49189d86ceb0a3d4f68574e464736f6c634300070600330000000000000000000000004596486669c23fedcafe2da6dd8daebd37bb8dcf00000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7

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

0000000000000000000000004596486669c23fedcafe2da6dd8daebd37bb8dcf00000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7

-----Decoded View---------------
Arg [0] : _treasury (address): 0x4596486669c23fedcafe2da6dd8daebd37bb8dcf
Arg [1] : _core (address): 0x00789cfb69499c65ac9a3a68fb4917c9b4fca2a7

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004596486669c23fedcafe2da6dd8daebd37bb8dcf
Arg [1] : 00000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7


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.