Contract 0x80a708b92939b373e86ef8e8cfc9e05efe2f5e49

 

Contract Overview

Polygon: Fx ERC1155 Child Tunnel
Balance:
0 MATIC

MATIC Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xfab85621b806725509838f0dd30b75c8e51438b8111a005f00123034d32d17e2Set Fx Root Tunn...220408942021-12-02 7:01:49209 days 3 hrs ago0x30567d4a92c63ac67191c4ea4b51f7f0cfcfcfd7 IN  Polygon: Fx ERC1155 Child Tunnel0 MATIC0.0013208730
0xd95700e807ffa66ee82379201cd579cbbb59b7ade69bdf207830546f1ddbca270x60806040220392912021-12-02 5:59:54209 days 4 hrs ago0x30567d4a92c63ac67191c4ea4b51f7f0cfcfcfd7 IN  Create: FxERC1155ChildTunnel0 MATIC0.052919130
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
FxERC1155ChildTunnel

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion
File 1 of 10 : FxERC1155ChildTunnel.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IFxERC1155} from "../../tokens/IFxERC1155.sol";
import {ERC1155Holder} from "../../lib/ERC1155Holder.sol";
import {Create2} from "../..//lib/Create2.sol";
import {FxBaseChildTunnel} from "../../tunnel/FxBaseChildTunnel.sol";

contract FxERC1155ChildTunnel is FxBaseChildTunnel, Create2, ERC1155Holder {
    bytes32 public constant DEPOSIT = keccak256("DEPOSIT");
    bytes32 public constant DEPOSIT_BATCH = keccak256("DEPOSIT_BATCH");
    bytes32 public constant WITHDRAW = keccak256("WITHDRAW");
    bytes32 public constant WITHDRAW_BATCH = keccak256("WITHDRAW_BATCH");
    bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN");
    //string public constant URI = "FXERC1155URI" ;

    event TokenMapped(address indexed rootToken, address indexed childToken);
    // root to child token
    mapping(address => address) public rootToChildToken;
    address public tokenTemplate;

    constructor(address _fxChild, address _tokenTemplate) FxBaseChildTunnel(_fxChild) {
        tokenTemplate = _tokenTemplate;
        require(_isContract(_tokenTemplate), "Token template is not contract");
    }

    function withdraw(
        address childToken,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public {
        _withdraw(childToken, msg.sender, id, amount, data);
    }

    function withdrawTo(
        address childToken,
        address receiver,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public {
        _withdraw(childToken, receiver, id, amount, data);
    }

    function withdrawBatch(
        address childToken,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public {
        _withdrawBatch(childToken, msg.sender, ids, amounts, data);
    }

    function withdrawToBatch(
        address childToken,
        address receiver,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public {
        _withdrawBatch(childToken, receiver, ids, amounts, data);
    }

    function _processMessageFromRoot(
        uint256, /* stateId */
        address sender,
        bytes memory data
    ) internal override validateSender(sender) {
        (bytes32 syncType, bytes memory syncData) = abi.decode(data, (bytes32, bytes));

        if (syncType == MAP_TOKEN) {
            _mapToken(syncData);
        } else if (syncType == DEPOSIT) {
            _syncDeposit(syncData);
        } else if (syncType == DEPOSIT_BATCH) {
            _syncDepositBatch(syncData);
        } else {
            revert("FxERC1155ChildTunnel: INVALID_SYNC_TYPE");
        }
    }

    function _mapToken(bytes memory syncData) internal returns (address) {
        (address rootToken, string memory uri) = abi.decode(syncData, (address, string));

        address childToken = rootToChildToken[rootToken];
        require(childToken == address(0x0), "FxERC1155ChildTunnel: ALREADY_MAPPED");

        bytes32 salt = keccak256(abi.encodePacked(rootToken));
        childToken = createClone(salt, tokenTemplate);
        IFxERC1155(childToken).initialize(address(this), rootToken, string(abi.encodePacked(uri)));

        rootToChildToken[rootToken] = childToken;
        emit TokenMapped(rootToken, childToken);

        return childToken;
    }

    function _syncDeposit(bytes memory syncData) internal {
        (address rootToken, address depositor, address user, uint256 id, uint256 amount, bytes memory data) = abi
            .decode(syncData, (address, address, address, uint256, uint256, bytes));

        address childToken = rootToChildToken[rootToken];
        IFxERC1155 childTokenContract = IFxERC1155(childToken);

        childTokenContract.mint(user, id, amount, data);
    }

    function _syncDepositBatch(bytes memory syncData) internal {
        (
            address rootToken,
            address depositor,
            address user,
            uint256[] memory ids,
            uint256[] memory amounts,
            bytes memory data
        ) = abi.decode(syncData, (address, address, address, uint256[], uint256[], bytes));

        address childToken = rootToChildToken[rootToken];
        IFxERC1155 childTokenContract = IFxERC1155(childToken);

        childTokenContract.mintBatch(user, ids, amounts, data);
    }

    function _withdraw(
        address childToken,
        address receiver,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal {
        IFxERC1155 childTokenContract = IFxERC1155(childToken);
        address rootToken = childTokenContract.connectedToken();

        require(
            childToken != address(0x0) && rootToken != address(0x0) && childToken == rootToChildToken[rootToken],
            "FxERC1155ChildTunnel: NO_MAPPED_TOKEN"
        );

        childTokenContract.burn(msg.sender, id, amount);

        bytes memory message = abi.encode(WITHDRAW, abi.encode(rootToken, childToken, receiver, id, amount, data));
        _sendMessageToRoot(message);
    }

    function _withdrawBatch(
        address childToken,
        address receiver,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal {
        IFxERC1155 childTokenContract = IFxERC1155(childToken);
        address rootToken = childTokenContract.connectedToken();

        require(
            childToken != address(0x0) && rootToken != address(0x0) && childToken == rootToChildToken[rootToken],
            "FxERC1155ChildTunnel: NO_MAPPED_TOKEN"
        );

        childTokenContract.burnBatch(msg.sender, ids, amounts);

        bytes memory message = abi.encode(
            WITHDRAW_BATCH,
            abi.encode(rootToken, childToken, receiver, ids, amounts, data)
        );
        _sendMessageToRoot(message);
    }

    function _isContract(address _addr) private view returns (bool) {
        uint32 size;
        assembly {
            size := extcodesize(_addr)
        }
        return (size > 0);
    }
}

File 2 of 10 : IFxERC1155.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC1155} from "../lib/IERC1155.sol";

interface IFxERC1155 is IERC1155 {
    function fxManager() external returns (address);

    function initialize(
        address fxManager_,
        address connectedToken_,
        string memory uri_
    ) external;

    function connectedToken() external returns (address);

    function mint(
        address user,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) external;

    function mintBatch(
        address user,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) external;

    function burn(
        address user,
        uint256 id,
        uint256 amount
    ) external;

    function burnBatch(
        address user,
        uint256[] memory ids,
        uint256[] memory amounts
    ) external;
}

File 3 of 10 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 4 of 10 : Create2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Create2 adds common methods for minimal proxy with create2
abstract contract Create2 {
    // creates clone using minimal proxy
    function createClone(bytes32 _salt, address _target) internal returns (address _result) {
        bytes20 _targetBytes = bytes20(_target);

        assembly {
            let clone := mload(0x40)
            mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(clone, 0x14), _targetBytes)
            mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            _result := create2(0, clone, 0x37, _salt)
        }

        require(_result != address(0), "Create2: Failed on minimal deploy");
    }

    // get minimal proxy creation code
    function minimalProxyCreationCode(address logic) internal pure returns (bytes memory) {
        bytes10 creation = 0x3d602d80600a3d3981f3;
        bytes10 prefix = 0x363d3d373d3d3d363d73;
        bytes20 targetBytes = bytes20(logic);
        bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;
        return abi.encodePacked(creation, prefix, targetBytes, suffix);
    }

    // get computed create2 address
    function computedCreate2Address(
        bytes32 salt,
        bytes32 bytecodeHash,
        address deployer
    ) public pure returns (address) {
        bytes32 _data = keccak256(abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash));
        return address(uint160(uint256(_data)));
    }
}

File 5 of 10 : FxBaseChildTunnel.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// IFxMessageProcessor represents interface to process message
interface IFxMessageProcessor {
    function processMessageFromRoot(
        uint256 stateId,
        address rootMessageSender,
        bytes calldata data
    ) external;
}

/**
 * @notice Mock child tunnel contract to receive and send message from L2
 */
abstract contract FxBaseChildTunnel is IFxMessageProcessor {
    // MessageTunnel on L1 will get data from this event
    event MessageSent(bytes message);

    // fx child
    address public fxChild;

    // fx root tunnel
    address public fxRootTunnel;

    constructor(address _fxChild) {
        fxChild = _fxChild;
    }

    // Sender must be fxRootTunnel in case of ERC20 tunnel
    modifier validateSender(address sender) {
        require(sender == fxRootTunnel, "FxBaseChildTunnel: INVALID_SENDER_FROM_ROOT");
        _;
    }

    // set fxRootTunnel if not set already
    function setFxRootTunnel(address _fxRootTunnel) external {
        require(fxRootTunnel == address(0x0), "FxBaseChildTunnel: ROOT_TUNNEL_ALREADY_SET");
        fxRootTunnel = _fxRootTunnel;
    }

    function processMessageFromRoot(
        uint256 stateId,
        address rootMessageSender,
        bytes calldata data
    ) external override {
        require(msg.sender == fxChild, "FxBaseChildTunnel: INVALID_SENDER");
        _processMessageFromRoot(stateId, rootMessageSender, data);
    }

    /**
     * @notice Emit message that can be received on Root Tunnel
     * @dev Call the internal function when need to emit message
     * @param message bytes message that will be sent to Root Tunnel
     * some message examples -
     *   abi.encode(tokenId);
     *   abi.encode(tokenId, tokenMetadata);
     *   abi.encode(messageType, messageData);
     */
    function _sendMessageToRoot(bytes memory message) internal {
        emit MessageSent(message);
    }

    /**
     * @notice Process message received from Root Tunnel
     * @dev function needs to be implemented to handle message as per requirement
     * This is called by onStateReceive function.
     * Since it is called via a system call, any event will not be emitted during its execution.
     * @param stateId unique state id
     * @param sender root message sender
     * @param message bytes message that was sent from Root Tunnel
     */
    function _processMessageFromRoot(
        uint256 stateId,
        address sender,
        bytes memory message
    ) internal virtual;
}

File 6 of 10 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 7 of 10 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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);
}

File 8 of 10 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC1155Receiver.sol";
import "./ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

File 9 of 10 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 9999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_fxChild","type":"address"},{"internalType":"address","name":"_tokenTemplate","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"}],"name":"MessageSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"}],"name":"TokenMapped","type":"event"},{"inputs":[],"name":"DEPOSIT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_BATCH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAP_TOKEN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_BATCH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes32","name":"bytecodeHash","type":"bytes32"},{"internalType":"address","name":"deployer","type":"address"}],"name":"computedCreate2Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"fxChild","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fxRootTunnel","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stateId","type":"uint256"},{"internalType":"address","name":"rootMessageSender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"processMessageFromRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rootToChildToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_fxRootTunnel","type":"address"}],"name":"setFxRootTunnel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"childToken","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"childToken","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"withdrawBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"childToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"childToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"withdrawToBatch","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162001f7338038062001f738339810160408190526200003491620000c7565b600080546001600160a01b038085166001600160a01b03199283161790925560038054928416929091169190911790556200006f816200009f565b620000975760405162461bcd60e51b81526004016200008e90620000fe565b60405180910390fd5b505062000135565b63ffffffff813b1615155b919050565b80516001600160a01b0381168114620000aa57600080fd5b60008060408385031215620000da578182fd5b620000e583620000af565b9150620000f560208401620000af565b90509250929050565b6020808252601e908201527f546f6b656e2074656d706c617465206973206e6f7420636f6e74726163740000604082015260600190565b611e2e80620001456000396000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c80637f1e9cb0116100cd578063b324d3ed11610081578063d81c8e5211610066578063d81c8e5214610278578063ea60c7c414610280578063f23a6e611461029357610151565b8063b324d3ed14610250578063bc197c811461025857610151565b806388837094116100b257806388837094146102225780639a7c4b7114610235578063b2edfcd21461024857610151565b80637f1e9cb014610212578063886a69ba1461021a57610151565b806316ba719711610124578063450d11f011610109578063450d11f0146101e45780634c958e23146101ec5780637337957f146101ff57610151565b806316ba7197146101bc578063266ceabb146101d157610151565b806301ffc9a71461015657806303af05ab1461017f5780630814d3dd146101945780630bd0ca9a146101a9575b600080fd5b6101696101643660046115e4565b6102a6565b6040516101769190611a02565b60405180910390f35b61019261018d366004611374565b610302565b005b61019c610316565b60405161017691906117be565b6101926101b736600461151c565b610332565b6101c4610345565b6040516101769190611a0d565b6101926101df366004611485565b610369565b61019c610376565b6101926101fa36600461141e565b610392565b61019c61020d366004611571565b61039f565b61019c6103e0565b6101c46103fc565b6101926102303660046111a0565b610420565b610192610243366004611624565b6104c0565b6101c4610552565b6101c4610576565b61026b610266366004611374565b61059a565b6040516101769190611a37565b6101c46105c4565b61019c61028e3660046111a0565b6105e8565b61026b6102a136600461141e565b610610565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806102fc57506102fc8261063a565b92915050565b61030f8585858585610684565b5050505050565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b61033f84338585856108ba565b50505050565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b61033f8433858585610684565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b61030f85858585856108ba565b60008060ff60f81b8386866040516020016103bd949392919061173e565b60408051601f1981840301815291905280516020909101209150505b9392505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b60015473ffffffffffffffffffffffffffffffffffffffff1615610479576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611ca5565b60405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610511576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611a77565b61033f848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610aae92505050565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b7f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b60026020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f01ffc9a70000000000000000000000000000000000000000000000000000000014919050565b600085905060008173ffffffffffffffffffffffffffffffffffffffff16630a8a49146040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156106d357600080fd5b505af11580156106e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070b91906111bc565b905073ffffffffffffffffffffffffffffffffffffffff871615801590610747575073ffffffffffffffffffffffffffffffffffffffff811615155b801561077c575073ffffffffffffffffffffffffffffffffffffffff8082166000908152600260205260409020548882169116145b6107b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611b8e565b6040517f6b20c45400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690636b20c45490610808903390899089906004016118ee565b600060405180830381600087803b15801561082257600080fd5b505af1158015610836573d6000803e3d6000fd5b5050505060007f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed2828989898989604051602001610878969594939291906117df565b60408051601f19818403018152908290526108969291602001611a16565b60405160208183030381529060405290506108b081610bf7565b5050505050505050565b600085905060008173ffffffffffffffffffffffffffffffffffffffff16630a8a49146040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561090957600080fd5b505af115801561091d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094191906111bc565b905073ffffffffffffffffffffffffffffffffffffffff87161580159061097d575073ffffffffffffffffffffffffffffffffffffffff811615155b80156109b2575073ffffffffffffffffffffffffffffffffffffffff8082166000908152600260205260409020548882169116145b6109e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611b8e565b6040517ff5298aca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063f5298aca90610a3e90339089908990600401611999565b600060405180830381600087803b158015610a5857600080fd5b505af1158015610a6c573d6000803e3d6000fd5b5050505060007f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286982898989898960405160200161087896959493929190611853565b600154829073ffffffffffffffffffffffffffffffffffffffff808316911614610b04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611ad4565b60008083806020019051810190610b1b91906115a9565b915091507f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad821415610b5657610b5081610c31565b50610bef565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f821821415610b8c57610b8781610e13565b610bef565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d18821415610bbd57610b8781610eeb565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611b31565b505050505050565b7f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b03681604051610c269190611a64565b60405180910390a150565b600080600083806020019051810190610c4a9190611312565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260026020526040902054929450909250168015610cb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611beb565b600083604051602001610cc3919061170e565b60408051601f198184030181529190528051602090910120600354909150610d0290829073ffffffffffffffffffffffffffffffffffffffff16610f86565b91508173ffffffffffffffffffffffffffffffffffffffff16634571e3a6308686604051602001610d3391906117a2565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610d60939291906118ac565b600060405180830381600087803b158015610d7a57600080fd5b505af1158015610d8e573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff84811660008181526002602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169487169485179055517f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e6179190a350949350505050565b60008060008060008086806020019051810190610e309190611296565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260026020526040908190205490517f731133e9000000000000000000000000000000000000000000000000000000008152979d50959b509399509197509550935016908190819063731133e990610eae9089908990899089906004016119c7565b600060405180830381600087803b158015610ec857600080fd5b505af1158015610edc573d6000803e3d6000fd5b50505050505050505050505050565b60008060008060008086806020019051810190610f0891906111d8565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260026020526040908190205490517f1f7fdffa000000000000000000000000000000000000000000000000000000008152979d50959b5093995091975095509350169081908190631f7fdffa90610eae908990899089908990600401611939565b6000808260601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152846037826000f592505073ffffffffffffffffffffffffffffffffffffffff8216611038576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090611c48565b5092915050565b600061105261104d84611d50565b611d02565b905082815283838301111561106657600080fd5b6103d9836020830184611d78565b600082601f830112611084578081fd5b8135602061109461104d83611d2c565b82815281810190858301838502870184018810156110b0578586fd5b855b858110156110ce578135845292840192908401906001016110b2565b5090979650505050505050565b600082601f8301126110eb578081fd5b815160206110fb61104d83611d2c565b8281528181019085830183850287018401881015611117578586fd5b855b858110156110ce57815184529284019290840190600101611119565b600082601f830112611145578081fd5b813561115361104d82611d50565b818152846020838601011115611167578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112611191578081fd5b6103d98383516020850161103f565b6000602082840312156111b1578081fd5b81356103d981611dd3565b6000602082840312156111cd578081fd5b81516103d981611dd3565b60008060008060008060c087890312156111f0578182fd5b86516111fb81611dd3565b602088015190965061120c81611dd3565b604088015190955061121d81611dd3565b606088015190945067ffffffffffffffff8082111561123a578384fd5b6112468a838b016110db565b9450608089015191508082111561125b578384fd5b6112678a838b016110db565b935060a089015191508082111561127c578283fd5b5061128989828a01611181565b9150509295509295509295565b60008060008060008060c087890312156112ae578182fd5b86516112b981611dd3565b60208801519096506112ca81611dd3565b60408801519095506112db81611dd3565b80945050606087015192506080870151915060a087015167ffffffffffffffff811115611306578182fd5b61128989828a01611181565b60008060408385031215611324578182fd5b825161132f81611dd3565b602084015190925067ffffffffffffffff81111561134b578182fd5b8301601f8101851361135b578182fd5b61136a8582516020840161103f565b9150509250929050565b600080600080600060a0868803121561138b578283fd5b853561139681611dd3565b945060208601356113a681611dd3565b9350604086013567ffffffffffffffff808211156113c2578485fd5b6113ce89838a01611074565b945060608801359150808211156113e3578283fd5b6113ef89838a01611074565b93506080880135915080821115611404578283fd5b5061141188828901611135565b9150509295509295909350565b600080600080600060a08688031215611435578283fd5b853561144081611dd3565b9450602086013561145081611dd3565b93506040860135925060608601359150608086013567ffffffffffffffff811115611479578182fd5b61141188828901611135565b6000806000806080858703121561149a578182fd5b84356114a581611dd3565b9350602085013567ffffffffffffffff808211156114c1578384fd5b6114cd88838901611074565b945060408701359150808211156114e2578384fd5b6114ee88838901611074565b93506060870135915080821115611503578283fd5b5061151087828801611135565b91505092959194509250565b60008060008060808587031215611531578182fd5b843561153c81611dd3565b93506020850135925060408501359150606085013567ffffffffffffffff811115611565578182fd5b61151087828801611135565b600080600060608486031215611585578081fd5b8335925060208401359150604084013561159e81611dd3565b809150509250925092565b600080604083850312156115bb578182fd5b82519150602083015167ffffffffffffffff8111156115d8578182fd5b61136a85828601611181565b6000602082840312156115f5578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146103d9578182fd5b60008060008060608587031215611639578182fd5b84359350602085013561164b81611dd3565b9250604085013567ffffffffffffffff80821115611667578384fd5b818701915087601f83011261167a578384fd5b813581811115611688578485fd5b886020828501011115611699578485fd5b95989497505060200194505050565b6000815180845260208085019450808401835b838110156116d7578151875295820195908201906001016116bb565b509495945050505050565b600081518084526116fa816020860160208601611d78565b601f01601f19169290920160200192915050565b60609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b7fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b600082516117b4818460208701611d78565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8089168352808816602084015280871660408401525060c0606083015261182060c08301866116a8565b828103608084015261183281866116a8565b905082810360a084015261184681856116e2565b9998505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8089168352808816602084015280871660408401525084606083015283608083015260c060a08301526118a060c08301846116e2565b98975050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526118e560608301846116e2565b95945050505050565b600073ffffffffffffffffffffffffffffffffffffffff851682526060602083015261191d60608301856116a8565b828103604084015261192f81856116a8565b9695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff861682526080602083015261196860808301866116a8565b828103604084015261197a81866116a8565b9050828103606084015261198e81856116e2565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff9390931683526020830191909152604082015260600190565b600073ffffffffffffffffffffffffffffffffffffffff861682528460208301528360408301526080606083015261192f60808301846116e2565b901515815260200190565b90815260200190565b600083825260406020830152611a2f60408301846116e2565b949350505050565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b6000602082526103d960208301846116e2565b60208082526021908201527f4678426173654368696c6454756e6e656c3a20494e56414c49445f53454e444560408201527f5200000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f4678426173654368696c6454756e6e656c3a20494e56414c49445f53454e444560408201527f525f46524f4d5f524f4f54000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f4678455243313135354368696c6454756e6e656c3a20494e56414c49445f535960408201527f4e435f5459504500000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f4678455243313135354368696c6454756e6e656c3a204e4f5f4d41505045445f60408201527f544f4b454e000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f4678455243313135354368696c6454756e6e656c3a20414c52454144595f4d4160408201527f5050454400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f437265617465323a204661696c6564206f6e206d696e696d616c206465706c6f60408201527f7900000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f4678426173654368696c6454756e6e656c3a20524f4f545f54554e4e454c5f4160408201527f4c52454144595f53455400000000000000000000000000000000000000000000606082015260800190565b60405181810167ffffffffffffffff81118282101715611d2457611d24611da4565b604052919050565b600067ffffffffffffffff821115611d4657611d46611da4565b5060209081020190565b600067ffffffffffffffff821115611d6a57611d6a611da4565b50601f01601f191660200190565b60005b83811015611d93578181015183820152602001611d7b565b8381111561033f5750506000910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114611df557600080fd5b5056fea2646970667358221220f2b86ed7b24de83c3cbc5494708dac4229ab02ae54b639bec6e0bfd80bb28f0564736f6c634300080000330000000000000000000000008397259c983751daf40400790063935a11afa28a0000000000000000000000004443c9877ab1767e1080fa70ac038758e526c609

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

0000000000000000000000008397259c983751daf40400790063935a11afa28a0000000000000000000000004443c9877ab1767e1080fa70ac038758e526c609

-----Decoded View---------------
Arg [0] : _fxChild (address): 0x8397259c983751daf40400790063935a11afa28a
Arg [1] : _tokenTemplate (address): 0x4443c9877ab1767e1080fa70ac038758e526c609

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008397259c983751daf40400790063935a11afa28a
Arg [1] : 0000000000000000000000004443c9877ab1767e1080fa70ac038758e526c609


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.