Contract Address Details
contract
token

0x27B9C2Bd4BaEa18ABdF49169054c1C1c12af9862

Token
SNAFU (SNAFU)
Creator
0x344b3a–c73866 at 0x1fcf97–4fe1e9
Balance
0 xDAI ( )
Tokens
Fetching tokens...
Transactions
4,394 Transactions
Transfers
1,370 Transfers
Gas Used
160,085,448
Last Balance Update
24441115
Contract name:
SNAFU20Pair




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
EVM Version
istanbul




Verified at
2021-04-03T15:23:38.162715Z

Constructor Arguments

00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000211654585005212800000000000000000000000000000ed1efc6efceaab9f6d609fec89c9e675bf1efb0a000000000000000000000000ea912373bef07e06f04fde1d8218eb6c77cff67a000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000003635c9adc5dea000000000000000000000000000000000000000000000000000000000000000000005534e4146550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005534e414655000000000000000000000000000000000000000000000000000000

Arg [0] (string) : SNAFU
Arg [1] (string) : SNAFU
Arg [2] (uint256) : 2500000000000000000000000
Arg [3] (address) : 0xed1efc6efceaab9f6d609fec89c9e675bf1efb0a
Arg [4] (address) : 0xea912373bef07e06f04fde1d8218eb6c77cff67a
Arg [5] (uint256) : 5
Arg [6] (uint256) : 1000000000000000000000

              

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;


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

// 
/**
 * _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {

    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    )
        external
        returns(bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    )
        external
        returns(bytes4);
}

// 
/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

// 
/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    constructor() internal {
        _registerInterface(
            ERC1155Receiver(address(0)).onERC1155Received.selector ^
            ERC1155Receiver(address(0)).onERC1155BatchReceived.selector
        );
    }
}

// 
/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;
}

// 
/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

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

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

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

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

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

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

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

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

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

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

    mapping(address => uint256) private _balances;

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

    uint256 public override totalSupply;

    string public name;
    string public symbol;
    uint8 public decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor() public {}


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

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        _transfer(msg.sender, 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(msg.sender, 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,
            msg.sender,
            _allowances[sender][msg.sender].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(
            msg.sender,
            spender,
            _allowances[msg.sender][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(
            msg.sender,
            spender,
            _allowances[msg.sender][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 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 {}

    // Added from import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";

    function burn(uint256 amount) public virtual {
        _burn(msg.sender, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 decreasedAllowance =
            allowance(account, msg.sender).sub(
                amount,
                "ERC20: burn amount exceeds allowance"
            );

        _approve(account, msg.sender, decreasedAllowance);
        _burn(account, amount);
    }
}

// 
// ERC1155
//import "@openzeppelin/contracts/utils/EnumerableSet.sol";
contract SNAFU20Pair is ERC20, ERC1155Receiver {
    address public owner;
    address public daoAddress;
    address public nftAddress;
    uint256 public max_token_value_cap;
    uint256 public fee;
    bool public enableSwap;

    mapping(uint256 => uint256) public tokenIdsToEditions;

    //using EnumerableSet for EnumerableSet.UintSet;
    //EnumerableSet.UintSet lockedNfts;

    event Withdraw(uint256[] indexed _tokenIds, uint256[] indexed amounts);
    event SetEditions(uint256[] indexed _tokenIds, uint256[] indexed editions);

    // create new token
    constructor(
        string memory _name,
        string memory _symbol,
        uint256 _initialSupply,
        address _nftAddress,
        address _daoAddress,
        uint256 _fee,
        uint256 _max_token_value_cap
    ) public {
        _mint(msg.sender, _initialSupply);
        owner = msg.sender;
        fee = _fee;
        name = _name;
        symbol = _symbol;
        decimals = 18;
        nftAddress = _nftAddress;
        daoAddress = _daoAddress;
        max_token_value_cap = _max_token_value_cap;
    }

    function getTokenValue(uint256 tokenId) public view returns (uint256) {
        return max_token_value_cap.div(tokenIdsToEditions[tokenId]);
    }

    function getTokenInfo(uint256 tokenId, uint256 value)
        public
        view
        returns (
            string memory,
            uint256,
            uint256,
            uint256 //URI,  editions, sellprice, fee
        )
    {
        uint256 tokenPrice = getTokenValue(tokenId);
        uint256 computedFee = (tokenPrice.mul(value)).mul(fee).div(100);
        uint256 price =
            (tokenPrice.mul(value)).mul(uint256(100).sub(fee)).div(100);

        return (
            IERC1155MetadataURI(nftAddress).uri(tokenId),
            tokenIdsToEditions[tokenId],
            price,
            computedFee
        );
    }

    // withdraw nft and burn tokens
    function withdraw(
        uint256[] calldata _tokenIds,
        uint256[] calldata amounts,
        address receipient
    ) external {
        if (_tokenIds.length == 1) {
            require(tokenIdsToEditions[_tokenIds[0]] != 0, "editions not set");
            _burn(msg.sender, (getTokenValue(_tokenIds[0]).mul(amounts[0])));
            _withdraw1155(address(this), receipient, _tokenIds[0], amounts[0]);
        } else {
            _batchWithdraw1155(address(this), receipient, _tokenIds, amounts);
        }

        emit Withdraw(_tokenIds, amounts);
    }

    function _withdraw1155(
        address _from,
        address _to,
        uint256 _tokenId,
        uint256 value
    ) internal {
        IERC1155(nftAddress).safeTransferFrom(
            _from,
            _to,
            _tokenId,
            value,
            "0x0"
        );
    }

    function _batchWithdraw1155(
        address _from,
        address _to,
        uint256[] memory _tokenIds,
        uint256[] memory amounts
    ) internal {
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            require(tokenIdsToEditions[_tokenIds[i]] != 0, "editions not set");
            _burn(msg.sender, (getTokenValue(_tokenIds[i]).mul(amounts[i])));
        }

        IERC1155(nftAddress).safeBatchTransferFrom(
            _from,
            _to,
            _tokenIds,
            amounts,
            "0x0"
        );
    }

    function swap1155(
        uint256 in_id,
        uint256 in_amount,
        uint256 out_id,
        uint256 out_amount
    ) external {
        require(
            tokenIdsToEditions[in_id] != 0 && tokenIdsToEditions[out_id] != 0,
            "Editions must be set!"
        );
        require(enableSwap, "Swap is disabled");
        require(in_amount == out_amount, "Need to swap same amount of NFTs");
        require(
            getTokenValue(in_id) == getTokenValue(out_id),
            "Token to swap must have the same value"
        );

        IERC1155(nftAddress).safeTransferFrom(
            address(this),
            msg.sender,
            out_id,
            out_amount,
            "0x0"
        );
        IERC1155(nftAddress).safeTransferFrom(
            msg.sender,
            address(this),
            in_id,
            in_amount,
            "INTERNAL"
        );
    }

    function onERC1155Received(
        address operator,
        address,
        uint256 tokenId,
        uint256 value,
        bytes memory data
    ) public virtual override returns (bytes4) {
        require(nftAddress == msg.sender, "forbidden");
        require(tokenIdsToEditions[tokenId] != 0, "editions not set");
        if (keccak256(data) != keccak256("INTERNAL")) {
            uint256 tokenPrice = getTokenValue(tokenId);
            _mint(daoAddress, (tokenPrice.mul(value)).mul(fee).div(100));
            _mint(
                operator,
                (tokenPrice.mul(value)).mul(uint256(100).sub(fee)).div(100)
            );
        }
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address operator,
        address,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) public virtual override returns (bytes4) {
        require(nftAddress == msg.sender, "forbidden");
        if (keccak256(data) != keccak256("INTERNAL")) {
            for (uint256 i = 0; i < ids.length; i++) {
                require(tokenIdsToEditions[ids[i]] != 0, "editions not set");
                uint256 tokenPrice = getTokenValue(ids[i]);

                _mint(
                    daoAddress,
                    (tokenPrice.mul(values[i])).mul(fee).div(100)
                );
                _mint(
                    operator,
                    (tokenPrice.mul(values[i])).mul(uint256(100).sub(fee)).div(
                        100
                    )
                );
            }
        }
        return this.onERC1155BatchReceived.selector;
    }

    function setParams(
        string calldata _name,
        string calldata _symbol
    ) public {
        require(msg.sender == owner, "!authorized");
        name = _name;
        symbol = _symbol;
    }

    function setEnableSwap(bool _enableSwap) public{
        require(msg.sender == owner, "!authorized");
        enableSwap = _enableSwap;
    }

    function setFee(uint256 _fee) public{
        require(msg.sender == owner, "!authorized");
        fee = _fee;
    }

    function setOwner(address _owner) public{
        require(msg.sender == owner, "!authorized");
        require(owner != address(0), "cannot set contract owner to zero");
        owner = _owner;
    }

    function setDaoAddress(address _daoAddress) public{
        require(msg.sender == owner, "!authorized");
        require(_daoAddress != address(0), "cannot set contract owner to zero");
        daoAddress = _daoAddress;
    }

    function setTokenValueCap(uint256 _max_token_value_cap) public{
        require(msg.sender == owner, "!authorized");
        require(_max_token_value_cap != 0, "Max value cannot be zero");
        max_token_value_cap = _max_token_value_cap;
    }

    function setTokenEditions(
        uint256[] memory tokenIds,
        uint256[] memory editions
    ) external {
        require(msg.sender == owner, "!authorized");
        require(
            tokenIds.length == editions.length,
            "Array must have same size!"
        );

        for (uint256 i = 0; i < tokenIds.length; i++) {
            require(editions[i] != 0, "Cannot set an edition number to zero");
            tokenIdsToEditions[tokenIds[i]] = editions[i];
        }

        emit SetEditions(tokenIds, editions);
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"uint256","name":"_initialSupply","internalType":"uint256"},{"type":"address","name":"_nftAddress","internalType":"address"},{"type":"address","name":"_daoAddress","internalType":"address"},{"type":"uint256","name":"_fee","internalType":"uint256"},{"type":"uint256","name":"_max_token_value_cap","internalType":"uint256"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SetEditions","inputs":[{"type":"uint256[]","name":"_tokenIds","internalType":"uint256[]","indexed":true},{"type":"uint256[]","name":"editions","internalType":"uint256[]","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"uint256[]","name":"_tokenIds","internalType":"uint256[]","indexed":true},{"type":"uint256[]","name":"amounts","internalType":"uint256[]","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnFrom","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"daoAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"enableSwap","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"fee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTokenInfo","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTokenValue","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"max_token_value_cap","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"nftAddress","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC1155BatchReceived","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"},{"type":"uint256[]","name":"values","internalType":"uint256[]"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC1155Received","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDaoAddress","inputs":[{"type":"address","name":"_daoAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setEnableSwap","inputs":[{"type":"bool","name":"_enableSwap","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFee","inputs":[{"type":"uint256","name":"_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOwner","inputs":[{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setParams","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTokenEditions","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"},{"type":"uint256[]","name":"editions","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTokenValueCap","inputs":[{"type":"uint256","name":"_max_token_value_cap","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap1155","inputs":[{"type":"uint256","name":"in_id","internalType":"uint256"},{"type":"uint256","name":"in_amount","internalType":"uint256"},{"type":"uint256","name":"out_id","internalType":"uint256"},{"type":"uint256","name":"out_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenIdsToEditions","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256[]","name":"_tokenIds","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"address","name":"receipient","internalType":"address"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106102065760003560e01c806370a082311161011a578063a9059cbb116100ad578063dd62ed3e1161007c578063dd62ed3e14610a96578063ddca3f4314610ac4578063f0d68ee414610acc578063f23a6e6114610afb578063f3c0d76d14610bc457610206565b8063a9059cbb146107b1578063bc197c81146107dd578063cae0af09146109bb578063d10424c714610a7957610206565b806395d89b41116100e957806395d89b41146107385780639a3cac6a14610740578063a457c2d714610766578063a60ba16d1461079257610206565b806370a08231146106c157806379cc6790146106e75780638da5cb5b146107135780638f8d8a931461071b57610206565b806323b872dd1161019d578063395093511161016c578063395093511461058c57806342966c68146105b8578063456a09c8146105d55780635bf8633a1461069c57806369fe0e2d146106a457610206565b806323b872dd14610528578063296914481461055e5780632dea689014610566578063313ce5671461056e57610206565b806313af4035116101d957806313af40351461039f57806318160ddd146103c7578063208dd3b1146103e15780632131c68c1461050457610206565b806301ffc9a71461020b57806306fdde0314610246578063095ea7b3146102c35780630a81adc1146102ef575b600080fd5b6102326004803603602081101561022157600080fd5b50356001600160e01b031916610be1565b604080519115158252519081900360200190f35b61024e610c00565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610288578181015183820152602001610270565b50505050905090810190601f1680156102b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610232600480360360408110156102d957600080fd5b506001600160a01b038135169060200135610c8e565b6103126004803603604081101561030557600080fd5b5080359060200135610ca5565b6040518080602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b83811015610361578181015183820152602001610349565b50505050905090810190601f16801561038e5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b6103c5600480360360208110156103b557600080fd5b50356001600160a01b0316610e6b565b005b6103cf610f21565b60408051918252519081900360200190f35b6103c5600480360360408110156103f757600080fd5b810190602081018135600160201b81111561041157600080fd5b82018360208201111561042357600080fd5b803590602001918460208302840111600160201b8311171561044457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561049357600080fd5b8201836020820111156104a557600080fd5b803590602001918460208302840111600160201b831117156104c657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610f27945050505050565b61050c61111e565b604080516001600160a01b039092168252519081900360200190f35b6102326004803603606081101561053e57600080fd5b506001600160a01b0381358116916020810135909116906040013561112d565b610232611196565b6103cf61119f565b6105766111a5565b6040805160ff9092168252519081900360200190f35b610232600480360360408110156105a257600080fd5b506001600160a01b0381351690602001356111ae565b6103c5600480360360208110156105ce57600080fd5b50356111e4565b6103c5600480360360608110156105eb57600080fd5b810190602081018135600160201b81111561060557600080fd5b82018360208201111561061757600080fd5b803590602001918460208302840111600160201b8311171561063857600080fd5b919390929091602081019035600160201b81111561065557600080fd5b82018360208201111561066757600080fd5b803590602001918460208302840111600160201b8311171561068857600080fd5b9193509150356001600160a01b03166111f1565b61050c6113b4565b6103c5600480360360208110156106ba57600080fd5b50356113c3565b6103cf600480360360208110156106d757600080fd5b50356001600160a01b0316611415565b6103c5600480360360408110156106fd57600080fd5b506001600160a01b038135169060200135611430565b61050c61147c565b6103cf6004803603602081101561073157600080fd5b503561148b565b61024e61149d565b6103c56004803603602081101561075657600080fd5b50356001600160a01b03166114f8565b6102326004803603604081101561077c57600080fd5b506001600160a01b0381351690602001356115ac565b6103c5600480360360208110156107a857600080fd5b503515156115fb565b610232600480360360408110156107c757600080fd5b506001600160a01b03813516906020013561165b565b61099e600480360360a08110156107f357600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b81111561082657600080fd5b82018360208201111561083857600080fd5b803590602001918460208302840111600160201b8311171561085957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108a857600080fd5b8201836020820111156108ba57600080fd5b803590602001918460208302840111600160201b831117156108db57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561092a57600080fd5b82018360208201111561093c57600080fd5b803590602001918460018302840111600160201b8311171561095d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611668945050505050565b604080516001600160e01b03199092168252519081900360200190f35b6103c5600480360360408110156109d157600080fd5b810190602081018135600160201b8111156109eb57600080fd5b8201836020820111156109fd57600080fd5b803590602001918460018302840111600160201b83111715610a1e57600080fd5b919390929091602081019035600160201b811115610a3b57600080fd5b820183602082011115610a4d57600080fd5b803590602001918460018302840111600160201b83111715610a6e57600080fd5b50909250905061181b565b6103cf60048036036020811015610a8f57600080fd5b5035611888565b6103cf60048036036040811015610aac57600080fd5b506001600160a01b03813581169160200135166118a3565b6103cf6118ce565b6103c560048036036080811015610ae257600080fd5b50803590602081013590604081013590606001356118d4565b61099e600480360360a0811015610b1157600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b811115610b5057600080fd5b820183602082011115610b6257600080fd5b803590602001918460018302840111600160201b83111715610b8357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b62945050505050565b6103c560048036036020811015610bda57600080fd5b5035611ca9565b6001600160e01b03191660009081526006602052604090205460ff1690565b6003805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c865780601f10610c5b57610100808354040283529160200191610c86565b820191906000526020600020905b815481529060010190602001808311610c6957829003601f168201915b505050505081565b6000610c9b338484611dae565b5060015b92915050565b6060600080600080610cb687611888565b90506000610ce46064610cde600b54610cd88b87611e9a90919063ffffffff16565b90611e9a565b90611ef3565b90506000610d106064610cde610d06600b546064611f5a90919063ffffffff16565b610cd8878d611e9a565b600954604080516303a24d0760e21b8152600481018d905290519293506001600160a01b0390911691630e89341c91602480820192600092909190829003018186803b158015610d5f57600080fd5b505afa158015610d73573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610d9c57600080fd5b8101908080516040519392919084600160201b821115610dbb57600080fd5b908301906020820185811115610dd057600080fd5b8251600160201b811182820188101715610de957600080fd5b82525081516020918201929091019080838360005b83811015610e16578181015183820152602001610dfe565b50505050905090810190601f168015610e435780820380516001836020036101000a031916815260200191505b50604090815260009d8e52600d602052909c2054929c929b5092995092975095505050505050565b6007546001600160a01b03163314610eb8576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6007546001600160a01b0316610eff5760405162461bcd60e51b81526004018080602001828103825260218152602001806127116021913960400191505060405180910390fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60025481565b6007546001600160a01b03163314610f74576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b8051825114610fca576040805162461bcd60e51b815260206004820152601a60248201527f4172726179206d75737420686176652073616d652073697a6521000000000000604482015290519081900360640190fd5b60005b825181101561107057818181518110610fe257fe5b6020026020010151600014156110295760405162461bcd60e51b81526004018080602001828103825260248152602001806127e56024913960400191505060405180910390fd5b81818151811061103557fe5b6020026020010151600d600085848151811061104d57fe5b602090810291909101810151825281019190915260400160002055600101610fcd565b508060405180828051906020019060200280838360005b8381101561109f578181015183820152602001611087565b5050505090500191505060405180910390208260405180828051906020019060200280838360005b838110156110df5781810151838201526020016110c7565b505060405194909201849003842095507f57de6ff61529c0f710b9525563a8889fc053b1c340491897a60e7b09f4c6729e945060009392505050a35050565b6008546001600160a01b031681565b600061113a848484611fb7565b61118c843361118785604051806060016040528060288152602001612753602891396001600160a01b038a1660009081526001602090815260408083203384529091529020549190612112565b611dae565b5060019392505050565b600c5460ff1681565b600a5481565b60055460ff1681565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610c9b9185906111879086611d4d565b6111ee33826121a9565b50565b60018414156112dc57600d60008686600081811061120b57fe5b9050602002013581526020019081526020016000205460001415611269576040805162461bcd60e51b815260206004820152601060248201526f19591a5d1a5bdb9cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b6112a5336112a08585600081811061127d57fe5b90506020020135610cd88989600081811061129457fe5b90506020020135611888565b6121a9565b6112d73082878760008181106112b757fe5b90506020020135868660008181106112cb57fe5b905060200201356122a5565b61134b565b61134b308287878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525061232392505050565b8282604051808383602002808284376040519201829003822094508993508892508190508360208402808284376040519201829003822094507f4b24ec11eaffb918f4ecb6e20f72842b4d6fc3d7fc18165b9000158982c2c9c993506000925050a35050505050565b6009546001600160a01b031681565b6007546001600160a01b03163314611410576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b600b55565b6001600160a01b031660009081526020819052604090205490565b60006114608260405180606001604052806024815260200161277b6024913961145986336118a3565b9190612112565b905061146d833383611dae565b61147783836121a9565b505050565b6007546001600160a01b031681565b600d6020526000908152604090205481565b6004805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c865780601f10610c5b57610100808354040283529160200191610c86565b6007546001600160a01b03163314611545576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6001600160a01b03811661158a5760405162461bcd60e51b81526004018080602001828103825260218152602001806127116021913960400191505060405180910390fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6000610c9b33846111878560405180606001604052806025815260200161282d602591393360009081526001602090815260408083206001600160a01b038d1684529091529020549190612112565b6007546001600160a01b03163314611648576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b600c805460ff1916911515919091179055565b6000610c9b338484611fb7565b6009546000906001600160a01b031633146116b6576040805162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015290519081900360640190fd5b815160208301207f3ef23a75cdc0ee453858c625d528a8ed734f4d7af19c18f576ef9e0acee106c3146118095760005b845181101561180757600d60008683815181106116ff57fe5b60200260200101518152602001908152602001600020546000141561175e576040805162461bcd60e51b815260206004820152601060248201526f19591a5d1a5bdb9cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b600061177c86838151811061176f57fe5b6020026020010151611888565b90506117cd600860009054906101000a90046001600160a01b03166117c86064610cde600b54610cd88b89815181106117b157fe5b602002602001015188611e9a90919063ffffffff16565b6124da565b6117fe886117c86064610cde6117ef600b546064611f5a90919063ffffffff16565b610cd88b89815181106117b157fe5b506001016116e6565b505b5063bc197c8160e01b95945050505050565b6007546001600160a01b03163314611868576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b611874600385856125ca565b50611881600483836125ca565b5050505050565b6000818152600d6020526040812054600a54610c9f91611ef3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600b5481565b6000848152600d6020526040902054158015906118fe57506000828152600d602052604090205415155b611947576040805162461bcd60e51b815260206004820152601560248201527445646974696f6e73206d757374206265207365742160581b604482015290519081900360640190fd5b600c5460ff16611991576040805162461bcd60e51b815260206004820152601060248201526f14ddd85c081a5cc8191a5cd8589b195960821b604482015290519081900360640190fd5b8083146119e5576040805162461bcd60e51b815260206004820181905260248201527f4e65656420746f20737761702073616d6520616d6f756e74206f66204e465473604482015290519081900360640190fd5b6119ee82611888565b6119f785611888565b14611a335760405162461bcd60e51b81526004018080602001828103825260268152602001806126c56026913960400191505060405180910390fd5b60095460408051637921219560e11b8152306004820152336024820152604481018590526064810184905260a06084820152600360a48201526203078360ec1b60c482015290516001600160a01b039092169163f242432a9160e48082019260009290919082900301818387803b158015611aad57600080fd5b505af1158015611ac1573d6000803e3d6000fd5b505060095460408051637921219560e11b8152336004820152306024820152604481018990526064810188905260a06084820152600860a482015267125395115493905360c21b60c482015290516001600160a01b03909216935063f242432a925060e48082019260009290919082900301818387803b158015611b4457600080fd5b505af1158015611b58573d6000803e3d6000fd5b5050505050505050565b6009546000906001600160a01b03163314611bb0576040805162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015290519081900360640190fd5b6000848152600d6020526040902054611c03576040805162461bcd60e51b815260206004820152601060248201526f19591a5d1a5bdb9cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b815160208301207f3ef23a75cdc0ee453858c625d528a8ed734f4d7af19c18f576ef9e0acee106c314611c97576000611c3b85611888565b600854600b54919250611c69916001600160a01b03909116906117c890606490610cde90610cd8878b611e9a565b611c95876117c86064610cde611c8b600b546064611f5a90919063ffffffff16565b610cd8878b611e9a565b505b5063f23a6e6160e01b95945050505050565b6007546001600160a01b03163314611cf6576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b80611d48576040805162461bcd60e51b815260206004820152601860248201527f4d61782076616c75652063616e6e6f74206265207a65726f0000000000000000604482015290519081900360640190fd5b600a55565b600082820183811015611da7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038316611df35760405162461bcd60e51b81526004018080602001828103825260248152602001806128096024913960400191505060405180910390fd5b6001600160a01b038216611e385760405162461bcd60e51b81526004018080602001828103825260228152602001806126a36022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082611ea957506000610c9f565b82820282848281611eb657fe5b0414611da75760405162461bcd60e51b81526004018080602001828103825260218152602001806127326021913960400191505060405180910390fd5b6000808211611f49576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611f5257fe5b049392505050565b600082821115611fb1576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b038316611ffc5760405162461bcd60e51b81526004018080602001828103825260258152602001806127c06025913960400191505060405180910390fd5b6001600160a01b0382166120415760405162461bcd60e51b815260040180806020018281038252602381526020018061265e6023913960400191505060405180910390fd5b61204c838383611477565b612089816040518060600160405280602681526020016126eb602691396001600160a01b0386166000908152602081905260409020549190612112565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546120b89082611d4d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156121a15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561216657818101518382015260200161214e565b50505050905090810190601f1680156121935780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166121ee5760405162461bcd60e51b815260040180806020018281038252602181526020018061279f6021913960400191505060405180910390fd5b6121fa82600083611477565b61223781604051806060016040528060228152602001612681602291396001600160a01b0385166000908152602081905260409020549190612112565b6001600160a01b03831660009081526020819052604090205560025461225d9082611f5a565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60095460408051637921219560e11b81526001600160a01b0387811660048301528681166024830152604482018690526064820185905260a06084830152600360a48301526203078360ec1b60c48301529151919092169163f242432a9160e480830192600092919082900301818387803b158015611b4457600080fd5b60005b82518110156123d057600d600084838151811061233f57fe5b60200260200101518152602001908152602001600020546000141561239e576040805162461bcd60e51b815260206004820152601060248201526f19591a5d1a5bdb9cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b6123c8336112a08484815181106123b157fe5b6020026020010151610cd887868151811061176f57fe5b600101612326565b50600954604051631759616b60e11b81526001600160a01b0386811660048301908152868216602484015260a060448401908152865160a485015286519290941693632eb2c2d6938993899389938993919290916064810191608482019160c401906020808901910280838360005b8381101561245757818101518382015260200161243f565b50505050905001848103835285818151815260200191508051906020019060200280838360005b8381101561249657818101518382015260200161247e565b50505050905001848103825260038152602001806203078360ec1b815250602001975050505050505050600060405180830381600087803b158015611b4457600080fd5b6001600160a01b038216612535576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61254160008383611477565b60025461254e9082611d4d565b6002556001600160a01b0382166000908152602081905260409020546125749082611d4d565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061260b5782800160ff19823516178555612638565b82800160010185558215612638579182015b8281111561263857823582559160200191906001019061261d565b50612644929150612648565b5090565b5b80821115612644576000815560010161264956fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f2061646472657373546f6b656e20746f2073776170206d7573742068617665207468652073616d652076616c756545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636563616e6e6f742073657420636f6e7472616374206f776e657220746f207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737343616e6e6f742073657420616e2065646974696f6e206e756d62657220746f207a65726f45524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c7a5618118e2102c653561884b23e10400e9d1ef232c232364fed7863a83880064736f6c634300060c0033