ETH Price: $3,683.08 (+1.40%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Craft215052302024-12-29 2:46:118 days ago1735440371IN
0xcaaAbC37...9a757d2c0
0 ETH0.000940293.21911239
Craft214910112024-12-27 3:07:4710 days ago1735268867IN
0xcaaAbC37...9a757d2c0
0 ETH0.001559685.2558302
Craft214680112024-12-23 21:57:5913 days ago1734991079IN
0xcaaAbC37...9a757d2c0
0 ETH0.0038192212.86378964
Craft214643892024-12-23 9:47:5913 days ago1734947279IN
0xcaaAbC37...9a757d2c0
0 ETH0.0031372411.05133065
Disassemble214641162024-12-23 8:53:2313 days ago1734944003IN
0xcaaAbC37...9a757d2c0
0 ETH0.001096295.3336901
Craft214605022024-12-22 20:44:2314 days ago1734900263IN
0xcaaAbC37...9a757d2c0
0 ETH0.002356767.39346065
Craft214604562024-12-22 20:34:5914 days ago1734899699IN
0xcaaAbC37...9a757d2c0
0 ETH0.002433588.09325405
Craft214603882024-12-22 20:21:2314 days ago1734898883IN
0xcaaAbC37...9a757d2c0
0 ETH0.003440918.65859329
Craft214591342024-12-22 16:08:5914 days ago1734883739IN
0xcaaAbC37...9a757d2c0
0 ETH0.00205166.97287402
Craft214588632024-12-22 15:14:4714 days ago1734880487IN
0xcaaAbC37...9a757d2c0
0 ETH0.0029659710.00340351
Craft214583792024-12-22 13:37:2314 days ago1734874643IN
0xcaaAbC37...9a757d2c0
0 ETH0.002225487.08046595
Craft214582242024-12-22 13:06:1114 days ago1734872771IN
0xcaaAbC37...9a757d2c0
0 ETH0.002320477.5069063
Craft214548422024-12-22 1:46:1115 days ago1734831971IN
0xcaaAbC37...9a757d2c0
0 ETH0.002058266.83756228
Craft214547692024-12-22 1:31:3515 days ago1734831095IN
0xcaaAbC37...9a757d2c0
0 ETH0.00251957.39305194
Craft214264492024-12-18 2:31:4719 days ago1734489107IN
0xcaaAbC37...9a757d2c0
0 ETH0.0026700710.01413611
Craft214258692024-12-18 0:34:2319 days ago1734482063IN
0xcaaAbC37...9a757d2c0
0 ETH0.0036328112.44686224
Craft For214123232024-12-16 3:14:2321 days ago1734318863IN
0xcaaAbC37...9a757d2c0
0 ETH0.0028212710.04347532
Craft For214104312024-12-15 20:54:2321 days ago1734296063IN
0xcaaAbC37...9a757d2c0
0 ETH0.0036248311.83287009
Craft211876502024-11-14 18:13:4752 days ago1731608027IN
0xcaaAbC37...9a757d2c0
0 ETH0.0063896323.52408401
Disassemble211820562024-11-13 23:28:3553 days ago1731540515IN
0xcaaAbC37...9a757d2c0
0 ETH0.0062052829.50093846
Disassemble211819182024-11-13 23:00:5953 days ago1731538859IN
0xcaaAbC37...9a757d2c0
0 ETH0.0064115633.17893413
Disassemble200008192024-06-02 1:20:59218 days ago1717291259IN
0xcaaAbC37...9a757d2c0
0 ETH0.000944364.48968518
Craft198821532024-05-16 11:10:47234 days ago1715857847IN
0xcaaAbC37...9a757d2c0
0 ETH0.001512935.32831071
Craft198720102024-05-15 1:11:47236 days ago1715735507IN
0xcaaAbC37...9a757d2c0
0 ETH0.001478643.90480495
Disassemble198671662024-05-14 8:49:47236 days ago1715676587IN
0xcaaAbC37...9a757d2c0
0 ETH0.00107175.09535973
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TPLMechCrafter

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 8 : TPLMechCrafter.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

import {ERC165, IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

import {ITPLRevealedParts} from "../TPLRevealedParts/ITPLRevealedParts.sol";

/// @title TPLMechCrafter
/// @author CyberBrokers
/// @author dev by @dievardump
/// @notice Contract containing the Mech Crafting logic: use 6 parts + one afterglow to get a mech!
contract TPLMechCrafter is Ownable {
    error UserNotPartsOwner();
    error InvalidBodyPart();
    error InvalidPartsAmount();
    error InvalidModelAmount();
    error DelegationInactive();
    error NotAuthorized();
    error InvalidFees();

    error ErrorWithdrawing();
    error NothingToWithdraw();

    error ErrorDisassemblyFeePayment();

    error CraftingDisabled();
    error InvalidLength();

    /// @notice Emitted when a mech is assembled
    /// @param id the mech id
    /// @param partsIds the parts (body parts, afterglow) bitpacked
    /// @param extraData extra data used when crafting
    event MechAssembly(uint256 indexed id, uint256 partsIds, uint256 extraData);

    address public immutable TPL_REVEALED;
    address public immutable TPL_AFTERGLOW;
    address public immutable TPL_MECH;
    address public immutable TPL_PARTS_ESCROW;
    address public immutable DELEGATE_REGISTRY;

    uint256 public disassemblyFee;

    address public disassemblyFeeRecipient;

    bool public delegationActive;

    bool public craftingPublic;

    mapping(address => bool) public allowedCrafters;

    /// @notice Mech IDs linked to Engine ID; Once an engine is used, it will always mint the same Mech ID
    mapping(uint256 => uint256) public engineIds;

    modifier craftingAllowed() {
        if (!craftingPublic) {
            if (!allowedCrafters[msg.sender]) {
                revert CraftingDisabled();
            }
        }
        _;
    }

    constructor(
        address tplRevealed,
        address tplAfterglow,
        address tplMech,
        address tplPartsEscrow,
        address delegateRegistry,
        address disassemblyFeeRecipient_,
        uint256 disassemblyFee_
    ) {
        TPL_REVEALED = tplRevealed;
        TPL_AFTERGLOW = tplAfterglow;
        TPL_MECH = tplMech;
        TPL_PARTS_ESCROW = tplPartsEscrow;

        DELEGATE_REGISTRY = delegateRegistry;

        disassemblyFeeRecipient = disassemblyFeeRecipient_;
        disassemblyFee = disassemblyFee_;
    }

    /// @notice function allowing to parse the ExtraData sent with the mech build
    /// @param extraData the extra data
    /// @return seed the seed used for the name
    /// @return colors the colors used for the parts
    /// @return colorsActive the colors used for the parts
    /// @return emissive whether emissive is topToBottom or bottomToTop
    function parseExtraData(
        uint256 extraData
    ) external pure returns (uint256 seed, uint256[] memory colors, bool[] memory colorsActive, bool emissive) {
        seed = extraData & 0xffffff;
        extraData = extraData >> 24;

        colors = new uint256[](5);
        for (uint256 i; i < 5; i++) {
            colors[i] = extraData & 0xffffff;
            extraData = extraData >> 24;
        }

        colorsActive = new bool[](5);
        for (uint256 i; i < 5; i++) {
            colorsActive[i] = 1 == (extraData & 1);
            extraData = extraData >> 4;
        }

        emissive = (extraData & 1) == 1;
    }

    /////////////////////////////////////////////////////////
    // Actions                                             //
    /////////////////////////////////////////////////////////

    /// @notice Warning: This function should not be used directly from the contract. MechCrafting requires off-chain interactions
    ///         before the crafting.
    ///
    ///         Allows a TPL Revealed Mech Parts owner to craft a new Mech by using their parts
    /// @dev partsIds must be in the order of crafting (ARM_LEFT, ARM_RIGHT, ...) in order to make it less expensive
    /// @param partsIds the token ids to use to craft the mech
    /// @param afterglowId the afterglow id used on the mech
    /// @param extraData the data about seed for name, colors, emissive, ...
    function craft(uint256[] calldata partsIds, uint256 afterglowId, uint256 extraData) external craftingAllowed {
        _craft(partsIds, afterglowId, msg.sender, extraData);
    }

    /// @notice Warning: This function should not be used directly from the contract. MechCrafting requires off-chain interactions
    ///         before the crafting.
    ///
    ///         Allows a TPL Revealed Mech Parts owner to craft a new Mech by using their parts, with support of DelegateCash
    ///
    ///         requirements:
    ///             - All parts MUST be owned by the vault
    ///             - The afterglow MUST be owned by the vault
    ///             - The caller must be delegate for `vault` globally or on the current contract
    ///
    ///         Note that the Mech will be minted to the Vault directly
    ///
    /// @dev partsIds must be in the order of crafting (ARM_LEFT, ARM_RIGHT, ...) in order to make it less expensive
    /// @param partsIds the token ids to use to craft the mech
    /// @param afterglowId the afterglow id used on the mech
    /// @param extraData the data about seed for name, colors, emissive, ...
    /// @param vault the vault the current wallet tries to mint for
    function craftFor(
        uint256[] calldata partsIds,
        uint256 afterglowId,
        uint256 extraData,
        address vault
    ) external craftingAllowed {
        if (!delegationActive) {
            revert DelegationInactive();
        }

        _requireDelegate(vault);

        _craft(partsIds, afterglowId, vault, extraData);
    }

    /// @notice Allows a mech owner to dissasemble `mechId` and get back the parts & afterglow
    /// @param mechId the mech id
    function disassemble(uint256 mechId) external payable {
        _disassemble(mechId, msg.sender);
    }

    /// @notice Allows a mech owner to dissasemble `mechId` and get back the parts & afterglow, with support of DelegateCash
    /// @param mechId the mech id
    function disassembleFor(uint256 mechId, address vault) external payable {
        if (!delegationActive) {
            revert DelegationInactive();
        }

        _requireDelegate(vault);

        _disassemble(mechId, vault);
    }

    /////////////////////////////////////////////////////////
    // Owner                                               //
    /////////////////////////////////////////////////////////

    /// @notice Allows owner to set the disassembly fee & fee recipient
    /// @param newDisassemblyFeeRecipient the new fee recipient
    /// @param newFee the new fee
    function setDisassemblyFee(address newDisassemblyFeeRecipient, uint256 newFee) external onlyOwner {
        disassemblyFeeRecipient = newDisassemblyFeeRecipient;
        disassemblyFee = newFee;
    }

    /// @notice allows owner to activate or not interaction through delegate cash delegates
    /// @param isActive if we activate or not
    function setDelegationActive(bool isActive) external onlyOwner {
        delegationActive = isActive;
    }

    /// @notice allows owner to add or remove addresses allowed to craft even when public crafting is not open
    /// @param crafters the list of addresses to allow/disallow
    /// @param allowed if we are giving or removing the right to craft
    function setAllowedCrafters(address[] calldata crafters, bool allowed) external onlyOwner {
        uint256 length = crafters.length;
        if (length == 0) {
            revert InvalidLength();
        }

        for (uint i; i < length; i++) {
            allowedCrafters[crafters[i]] = allowed;
        }
    }

    /// @notice allows owner to change the "public crafting" status
    /// @param isPublic if the crafting is public or not
    function setCraftingPublic(bool isPublic) external onlyOwner {
        craftingPublic = isPublic;
    }

    /// @notice allows owner to withdraw the possible funds to `to`
    function withdraw(address to) external onlyOwner {
        uint256 balance = address(this).balance;

        if (balance == 0) {
            revert NothingToWithdraw();
        }

        (bool success, ) = to.call{value: balance}("");
        if (!success) {
            revert ErrorWithdrawing();
        }
    }

    /////////////////////////////////////////////////////////
    // Internals                                           //
    /////////////////////////////////////////////////////////

    /// @dev crafts
    function _craft(uint256[] calldata partsIds, uint256 afterglowId, address account, uint256 extraData) internal {
        uint256 length = partsIds.length;
        if (length != 6) {
            revert InvalidPartsAmount();
        }

        // get all ids "TokenData"
        ITPLRevealedParts.TokenData[] memory tokenPartsData = ITPLRevealedParts(TPL_REVEALED).partDataBatch(partsIds);

        uint256 packedIds;
        unchecked {
            uint256 engineModel = tokenPartsData[5].model;
            uint256 sameModelAsEngine;

            // verifies we have all the needed body parts
            // here we simply check that the bodyParts sent have the right types:
            // [ARM, ARM, HEAD, BODY, LEGS, ENGINE] which is [0, 0, 1, 2, 3, 4]
            // this is why they have to be sent in order
            if (
                tokenPartsData[0].bodyPart != 0 ||
                tokenPartsData[1].bodyPart != 0 ||
                tokenPartsData[2].bodyPart != 1 ||
                tokenPartsData[3].bodyPart != 2 ||
                tokenPartsData[4].bodyPart != 3 ||
                tokenPartsData[5].bodyPart != 4
            ) {
                revert InvalidBodyPart();
            }

            do {
                length--;
                if (tokenPartsData[length].model == engineModel) {
                    sameModelAsEngine++;
                }

                // builds the "packedIds" for the Mech to be able to store all the ids used to craft it
                packedIds = packedIds | (partsIds[length] << (length * 32));
            } while (length > 0);

            // engine + at least 2 parts
            if (sameModelAsEngine < 3) {
                revert InvalidModelAmount();
            }
        }

        // we add the afterglow id at the end
        packedIds = packedIds | (afterglowId << (6 * 32));

        // transfer all partsIds to TPL_PARTS_ESCROW
        ITPLRevealedParts(TPL_REVEALED).batchTransferFrom(account, TPL_PARTS_ESCROW, partsIds);

        // transfer the afterGlow to TPL_PARTS_ESCROW
        IERC1155(TPL_AFTERGLOW).safeTransferFrom(account, TPL_PARTS_ESCROW, afterglowId, 1, "");

        // then we mint the next Mech with the needed data
        uint256 engineKnownId = engineIds[partsIds[5]];
        if (engineKnownId != 0) {
            ITPLMech(TPL_MECH).mintToken(engineKnownId, account, packedIds);
        } else {
            engineKnownId = ITPLMech(TPL_MECH).mintNext(account, packedIds);
            engineIds[partsIds[5]] = engineKnownId;
        }

        emit MechAssembly(engineKnownId, packedIds, extraData);
    }

    function _disassemble(uint256 mechId, address account) internal {
        if (msg.value != disassemblyFee) {
            revert InvalidFees();
        }

        // make sure account is the owner of the mech.
        if (account != ITPLMech(TPL_MECH).ownerOf(mechId)) {
            revert NotAuthorized();
        }

        // get all ids used in the Mech assembly
        (uint256[] memory partsIds, uint256 afterglowId) = ITPLMech(TPL_MECH).getMechPartsIds(mechId);

        // burn the mech
        ITPLMech(TPL_MECH).burn(mechId);

        // batch transfer all IDs from ESCROW to account
        ITPLRevealedParts(TPL_REVEALED).batchTransferFrom(TPL_PARTS_ESCROW, account, partsIds);

        // transfer afterglow from ESCROW to account
        IERC1155(TPL_AFTERGLOW).safeTransferFrom(TPL_PARTS_ESCROW, account, afterglowId, 1, "");

        // if there is a fee
        if (msg.value > 0) {
            address disassemblyFeeRecipient_ = disassemblyFeeRecipient;
            // and a fee recipient
            if (disassemblyFeeRecipient_ != address(0)) {
                // send directly
                (bool success, ) = disassemblyFeeRecipient_.call{value: msg.value}("");
                if (!success) {
                    revert ErrorDisassemblyFeePayment();
                }
            }
        }
    }

    function _requireDelegate(address vault) internal view {
        // checks that msg.sender is delegate for vault, either globally or for the current contract or for the RevealedParts contract
        if (!IDelegateRegistry(DELEGATE_REGISTRY).checkDelegateForContract(msg.sender, vault, address(this))) {
            if (!IDelegateRegistry(DELEGATE_REGISTRY).checkDelegateForContract(msg.sender, vault, TPL_REVEALED)) {
                revert NotAuthorized();
            }
        }
    }
}

interface ITPLMech {
    function mintNext(address to, uint256 packedIds) external returns (uint256);

    function mintToken(uint256 tokenId, address to, uint256 packedIds) external;

    function ownerOf(uint256 mechId) external view returns (address);

    function burn(uint256 tokenId) external;

    function getMechPartsIds(uint256 tokenId) external view returns (uint256[] memory, uint256);
}

interface IDelegateRegistry {
    /**
     * @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault
     * @param delegate The hotwallet to act on your behalf
     * @param contract_ The address for the contract you're delegating
     * @param vault The cold wallet who issued the delegation
     */
    function checkDelegateForContract(address delegate, address vault, address contract_) external view returns (bool);
}

File 2 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 8 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/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 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 4 of 8 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 5 of 8 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

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;
    }
}

File 6 of 8 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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 7 of 8 : ITPLRevealedParts.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import {IBase721A} from "../../utils/tokens/ERC721/IBase721A.sol";

/// @title ITPLRevealedParts
/// @author CyberBrokers
/// @author dev by @dievardump
/// @notice Interface for the Revealed Parts contract.
interface ITPLRevealedParts is IBase721A {
    struct TokenData {
        uint256 generation;
        uint256 originalId;
        uint256 bodyPart;
        uint256 model;
        uint256[] stats;
    }

    /// @notice verifies that `account` owns all `tokenIds`
    /// @param account the account
    /// @param tokenIds the token ids to check
    /// @return if account owns all tokens
    function isOwnerOfBatch(address account, uint256[] calldata tokenIds) external view returns (bool);

    /// @notice returns a Mech Part data (body part and original id)
    /// @param tokenId the tokenId to check
    /// @return the Mech Part data (body part and original id)
    function partData(uint256 tokenId) external view returns (TokenData memory);

    /// @notice returns a list of Mech Part data (body part and original id)
    /// @param tokenIds the tokenIds to knoMechParts type of
    /// @return a list of Mech Part data (body part and original id)
    function partDataBatch(uint256[] calldata tokenIds) external view returns (TokenData[] memory);

    /// @notice Allows to burn tokens in batch
    /// @param tokenIds the tokens to burn
    function burnBatch(uint256[] calldata tokenIds) external;

    /// @notice Transfers the ownership of multiple NFTs from one address to another address
    /// @param _from The current owner of the NFT
    /// @param _to The new owner
    /// @param _tokenIds The NFTs to transfer
    function batchTransferFrom(
        address _from,
        address _to,
        uint256[] calldata _tokenIds
    ) external;
}

File 8 of 8 : IBase721A.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

interface IBase721A {
    /// @notice Allows a `minter` to mint `amount` tokens to `to` with `extraData_`
    /// @param to to whom we need to mint
    /// @param amount how many to mint
    /// @param extraData extraData for these items
    function mintTo(
        address to,
        uint256 amount,
        uint24 extraData
    ) external;
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"tplRevealed","type":"address"},{"internalType":"address","name":"tplAfterglow","type":"address"},{"internalType":"address","name":"tplMech","type":"address"},{"internalType":"address","name":"tplPartsEscrow","type":"address"},{"internalType":"address","name":"delegateRegistry","type":"address"},{"internalType":"address","name":"disassemblyFeeRecipient_","type":"address"},{"internalType":"uint256","name":"disassemblyFee_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CraftingDisabled","type":"error"},{"inputs":[],"name":"DelegationInactive","type":"error"},{"inputs":[],"name":"ErrorDisassemblyFeePayment","type":"error"},{"inputs":[],"name":"ErrorWithdrawing","type":"error"},{"inputs":[],"name":"InvalidBodyPart","type":"error"},{"inputs":[],"name":"InvalidFees","type":"error"},{"inputs":[],"name":"InvalidLength","type":"error"},{"inputs":[],"name":"InvalidModelAmount","type":"error"},{"inputs":[],"name":"InvalidPartsAmount","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NothingToWithdraw","type":"error"},{"inputs":[],"name":"UserNotPartsOwner","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"partsIds","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"extraData","type":"uint256"}],"name":"MechAssembly","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"DELEGATE_REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TPL_AFTERGLOW","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TPL_MECH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TPL_PARTS_ESCROW","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TPL_REVEALED","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedCrafters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"partsIds","type":"uint256[]"},{"internalType":"uint256","name":"afterglowId","type":"uint256"},{"internalType":"uint256","name":"extraData","type":"uint256"}],"name":"craft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"partsIds","type":"uint256[]"},{"internalType":"uint256","name":"afterglowId","type":"uint256"},{"internalType":"uint256","name":"extraData","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"name":"craftFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"craftingPublic","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegationActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mechId","type":"uint256"}],"name":"disassemble","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mechId","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"name":"disassembleFor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"disassemblyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disassemblyFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"engineIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"extraData","type":"uint256"}],"name":"parseExtraData","outputs":[{"internalType":"uint256","name":"seed","type":"uint256"},{"internalType":"uint256[]","name":"colors","type":"uint256[]"},{"internalType":"bool[]","name":"colorsActive","type":"bool[]"},{"internalType":"bool","name":"emissive","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"crafters","type":"address[]"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"setAllowedCrafters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isPublic","type":"bool"}],"name":"setCraftingPublic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isActive","type":"bool"}],"name":"setDelegationActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newDisassemblyFeeRecipient","type":"address"},{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"setDisassemblyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101206040523480156200001257600080fd5b5060405162001e0238038062001e028339810160408190526200003591620000f2565b620000403362000085565b6001600160a01b0396871660805294861660a05292851660c05290841660e052831661010052600280546001600160a01b03191691909316179091556001556200017e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000ed57600080fd5b919050565b600080600080600080600060e0888a0312156200010e57600080fd5b6200011988620000d5565b96506200012960208901620000d5565b95506200013960408901620000d5565b94506200014960608901620000d5565b93506200015960808901620000d5565b92506200016960a08901620000d5565b915060c0880151905092959891949750929550565b60805160a05160c05160e05161010051611bc86200023a600039600081816102e60152818161098b0152610a470152600081816101c401528181610d9201528181610e360152818161134401526113e601526000818161038c01528181610efb01528181610f820152818161114b01528181611212015261129c0152600081816103e001528181610e0501526113b701526000818161033a01528181610a1f01528181610b0b01528181610d6301526113150152611bc86000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063b51645db1161006f578063b51645db14610436578063d8474e5b14610456578063d8c40fbf1461046c578063df12ce881461049c578063f2fde38b146104af578063f43e231e146104cf57600080fd5b80638da5cb5b1461035c57806394d91ef61461037a578063a0816927146103ae578063a492ebf3146103ce578063a995ac6114610402578063abd8333a1461042357600080fd5b806351cff8d91161010857806351cff8d91461027e5780636b4fab2a1461029e578063715018a6146102bf5780638286eee2146102d457806382b981bd14610308578063837a334d1461032857600080fd5b80630d7795f0146101505780632ff7918d14610172578063396f9877146101925780633ed7e944146101b25780634618667c146102035780634f0d141814610243575b600080fd5b34801561015c57600080fd5b5061017061016b36600461153f565b6104ef565b005b34801561017e57600080fd5b5061017061018d3660046115aa565b610577565b34801561019e57600080fd5b506101706101ad3660046115e4565b6105a5565b3480156101be57600080fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561020f57600080fd5b5061023361021e36600461163b565b60036020526000908152604090205460ff1681565b60405190151581526020016101fa565b34801561024f57600080fd5b5061027061025e36600461165f565b60046020526000908152604090205481565b6040519081526020016101fa565b34801561028a57600080fd5b5061017061029936600461163b565b610641565b3480156102aa57600080fd5b5060025461023390600160a01b900460ff1681565b3480156102cb57600080fd5b506101706106e5565b3480156102e057600080fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561031457600080fd5b50610170610323366004611678565b6106f9565b34801561033457600080fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561036857600080fd5b506000546001600160a01b03166101e6565b34801561038657600080fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b3480156103ba57600080fd5b506002546101e6906001600160a01b031681565b3480156103da57600080fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561040e57600080fd5b5060025461023390600160a81b900460ff1681565b6101706104313660046116c9565b61074d565b34801561044257600080fd5b506101706104513660046116f9565b61078e565b34801561046257600080fd5b5061027060015481565b34801561047857600080fd5b5061048c61048736600461165f565b6107b4565b6040516101fa9493929190611751565b6101706104aa36600461165f565b6108b2565b3480156104bb57600080fd5b506101706104ca36600461163b565b6108bf565b3480156104db57600080fd5b506101706104ea3660046116f9565b61093a565b600254600160a81b900460ff16610530573360009081526003602052604090205460ff1661053057604051631c31257f60e21b815260040160405180910390fd5b600254600160a01b900460ff1661055a57604051633dc2b22960e11b815260040160405180910390fd5b61056381610960565b6105708585858486610acf565b5050505050565b61057f611069565b600280546001600160a01b0319166001600160a01b039390931692909217909155600155565b6105ad611069565b8160008190036105d05760405163251f56a160e21b815260040160405180910390fd5b60005b818110156105705782600360008787858181106105f2576105f26117b9565b9050602002016020810190610607919061163b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610639816117cf565b9150506105d3565b610649611069565b47600081900361066c57604051630686827b60e51b815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146106b9576040519150601f19603f3d011682016040523d82523d6000602084013e6106be565b606091505b50509050806106e05760405163adb57d7d60e01b815260040160405180910390fd5b505050565b6106ed611069565b6106f760006110c3565b565b600254600160a81b900460ff1661073a573360009081526003602052604090205460ff1661073a57604051631c31257f60e21b815260040160405180910390fd5b6107478484843385610acf565b50505050565b600254600160a01b900460ff1661077757604051633dc2b22960e11b815260040160405180910390fd5b61078081610960565b61078a8282611113565b5050565b610796611069565b60028054911515600160a01b0260ff60a01b19909216919091179055565b60408051600580825260c08201909252601883901c9262ffffff16916060918291600091906020820160a08036833701905050925060005b6005811015610831578562ffffff1684828151811061080d5761080d6117b9565b602090810291909101015260189590951c9480610829816117cf565b9150506107ec565b5060408051600580825260c08201909252906020820160a08036833701905050915060005b60058110156108a15785600116600114838281518110610878576108786117b9565b9115156020928302919091019091015260049590951c9480610899816117cf565b915050610856565b508460011660011490509193509193565b6108bc8133611113565b50565b6108c7611069565b6001600160a01b0381166109315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6108bc816110c3565b610942611069565b60028054911515600160a81b0260ff60a81b19909216919091179055565b60405163090c9a2d60e41b81523360048201526001600160a01b0382811660248301523060448301527f000000000000000000000000000000000000000000000000000000000000000016906390c9a2d090606401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f6919061180c565b6108bc5760405163090c9a2d60e41b81523360048201526001600160a01b0382811660248301527f0000000000000000000000000000000000000000000000000000000000000000811660448301527f000000000000000000000000000000000000000000000000000000000000000016906390c9a2d090606401602060405180830381865afa158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab2919061180c565b6108bc5760405163ea8e4eb560e01b815260040160405180910390fd5b8360068114610af15760405163e86dce2960e01b815260040160405180910390fd5b60405163a4bf5fd560e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a4bf5fd590610b42908a908a9060040161185b565b600060405180830381865afa158015610b5f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b879190810190611960565b905060008082600581518110610b9f57610b9f6117b9565b6020026020010151606001519050600083600081518110610bc257610bc26117b9565b6020026020010151604001516000141580610bfc575083600181518110610beb57610beb6117b9565b602002602001015160400151600014155b80610c26575083600281518110610c1557610c156117b9565b602002602001015160400151600114155b80610c50575083600381518110610c3f57610c3f6117b9565b602002602001015160400151600214155b80610c7a575083600481518110610c6957610c696117b9565b602002602001015160400151600314155b80610ca4575083600581518110610c9357610c936117b9565b602002602001015160400151600414155b15610cc257604051631704c2d160e01b815260040160405180910390fd5b84806001900395505081848681518110610cde57610cde6117b9565b60200260200101516060015103610cf3576001015b846020028a8a87818110610d0957610d096117b9565b90506020020135901b8317925060008511610cc2576003811015610d405760405163c3cd3f0160e01b815260040160405180910390fd5b505060405163f3993d1160e01b815260c087901b91909117906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f3993d1190610dbe9088907f0000000000000000000000000000000000000000000000000000000000000000908d908d90600401611a71565b600060405180830381600087803b158015610dd857600080fd5b505af1158015610dec573d6000803e3d6000fd5b5050604051637921219560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063f242432a9150610e639088907f0000000000000000000000000000000000000000000000000000000000000000908b90600190600401611aa8565b600060405180830381600087803b158015610e7d57600080fd5b505af1158015610e91573d6000803e3d6000fd5b505050506000600460008a8a6005818110610eae57610eae6117b9565b90506020020135815260200190815260200160002054905080600014610f5c57604051637811a5bf60e01b8152600481018290526001600160a01b038781166024830152604482018490527f00000000000000000000000000000000000000000000000000000000000000001690637811a5bf90606401600060405180830381600087803b158015610f3f57600080fd5b505af1158015610f53573d6000803e3d6000fd5b50505050611023565b604051634be80bdb60e11b81526001600160a01b038781166004830152602482018490527f000000000000000000000000000000000000000000000000000000000000000016906397d017b6906044016020604051808303816000875af1158015610fcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fef9190611ae0565b905080600460008b8b6005818110611009576110096117b9565b905060200201358152602001908152602001600020819055505b604080518381526020810187905282917f691db5579a98d3190721c8e94d31de7fbc32069049d54d92a9dbc937b2ab5d8e910160405180910390a2505050505050505050565b6000546001600160a01b031633146106f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610928565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600154341461113557604051632d8768f960e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa15801561119a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111be9190611af9565b6001600160a01b0316816001600160a01b0316146111ef5760405163ea8e4eb560e01b815260040160405180910390fd5b6040516301c4d0af60e01b81526004810183905260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906301c4d0af90602401600060405180830381865afa158015611259573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112819190810190611b16565b604051630852cd8d60e31b81526004810187905291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c6890602401600060405180830381600087803b1580156112e857600080fd5b505af11580156112fc573d6000803e3d6000fd5b505060405163f3993d1160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063f3993d119150611370907f00000000000000000000000000000000000000000000000000000000000000009087908790600401611b5d565b600060405180830381600087803b15801561138a57600080fd5b505af115801561139e573d6000803e3d6000fd5b5050604051637921219560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063f242432a9150611415907f00000000000000000000000000000000000000000000000000000000000000009087908690600190600401611aa8565b600060405180830381600087803b15801561142f57600080fd5b505af1158015611443573d6000803e3d6000fd5b505050506000341115610747576002546001600160a01b03168015610570576000816001600160a01b03163460405160006040518083038185875af1925050503d80600081146114af576040519150601f19603f3d011682016040523d82523d6000602084013e6114b4565b606091505b50509050806114d65760405163f8b814d160e01b815260040160405180910390fd5b505050505050565b60008083601f8401126114f057600080fd5b50813567ffffffffffffffff81111561150857600080fd5b6020830191508360208260051b850101111561152357600080fd5b9250929050565b6001600160a01b03811681146108bc57600080fd5b60008060008060006080868803121561155757600080fd5b853567ffffffffffffffff81111561156e57600080fd5b61157a888289016114de565b9096509450506020860135925060408601359150606086013561159c8161152a565b809150509295509295909350565b600080604083850312156115bd57600080fd5b82356115c88161152a565b946020939093013593505050565b80151581146108bc57600080fd5b6000806000604084860312156115f957600080fd5b833567ffffffffffffffff81111561161057600080fd5b61161c868287016114de565b9094509250506020840135611630816115d6565b809150509250925092565b60006020828403121561164d57600080fd5b81356116588161152a565b9392505050565b60006020828403121561167157600080fd5b5035919050565b6000806000806060858703121561168e57600080fd5b843567ffffffffffffffff8111156116a557600080fd5b6116b1878288016114de565b90989097506020870135966040013595509350505050565b600080604083850312156116dc57600080fd5b8235915060208301356116ee8161152a565b809150509250929050565b60006020828403121561170b57600080fd5b8135611658816115d6565b600081518084526020808501945080840160005b838110156117465781518752958201959082019060010161172a565b509495945050505050565b8481526000602060808184015261176b6080840187611716565b838103604085015285518082528287019183019060005b818110156117a0578351151583529284019291840191600101611782565b5050809350505050821515606083015295945050505050565b634e487b7160e01b600052603260045260246000fd5b6000600182016117ef57634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561181e57600080fd5b8151611658816115d6565b81835260006001600160fb1b0383111561184257600080fd5b8260051b80836020870137939093016020019392505050565b60208152600061186f602083018486611829565b949350505050565b60405160a0810167ffffffffffffffff8111828210171561189a5761189a6117f6565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156118c9576118c96117f6565b604052919050565b600067ffffffffffffffff8211156118eb576118eb6117f6565b5060051b60200190565b600082601f83011261190657600080fd5b8151602061191b611916836118d1565b6118a0565b82815260059290921b8401810191818101908684111561193a57600080fd5b8286015b84811015611955578051835291830191830161193e565b509695505050505050565b6000602080838503121561197357600080fd5b825167ffffffffffffffff8082111561198b57600080fd5b818501915085601f83011261199f57600080fd5b81516119ad611916826118d1565b81815260059190911b830184019084810190888311156119cc57600080fd5b8585015b83811015611a64578051858111156119e85760008081fd5b860160a0818c03601f1901811315611a005760008081fd5b611a08611877565b8983015181526040808401518b830152606080850151828401526080915081850151818401525082840151925088831115611a435760008081fd5b611a518e8c858701016118f5565b90820152855250509186019186016119d0565b5098975050505050505050565b6001600160a01b03858116825284166020820152606060408201819052600090611a9e9083018486611829565b9695505050505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b600060208284031215611af257600080fd5b5051919050565b600060208284031215611b0b57600080fd5b81516116588161152a565b60008060408385031215611b2957600080fd5b825167ffffffffffffffff811115611b4057600080fd5b611b4c858286016118f5565b925050602083015190509250929050565b6001600160a01b03848116825283166020820152606060408201819052600090611b8990830184611716565b9594505050505056fea26469706673582212204efd22b6012d76f32ae17b12f516eecd565eab28c92425489d11cce883123f9464736f6c634300081100330000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a64046000000000000000000000000a47fb7c4edd3475ce66f49a66b9bf1edbc61e52d000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed6000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf70600000000000000000000000000000000000076a84fef008cdabe6409d2fe638b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063b51645db1161006f578063b51645db14610436578063d8474e5b14610456578063d8c40fbf1461046c578063df12ce881461049c578063f2fde38b146104af578063f43e231e146104cf57600080fd5b80638da5cb5b1461035c57806394d91ef61461037a578063a0816927146103ae578063a492ebf3146103ce578063a995ac6114610402578063abd8333a1461042357600080fd5b806351cff8d91161010857806351cff8d91461027e5780636b4fab2a1461029e578063715018a6146102bf5780638286eee2146102d457806382b981bd14610308578063837a334d1461032857600080fd5b80630d7795f0146101505780632ff7918d14610172578063396f9877146101925780633ed7e944146101b25780634618667c146102035780634f0d141814610243575b600080fd5b34801561015c57600080fd5b5061017061016b36600461153f565b6104ef565b005b34801561017e57600080fd5b5061017061018d3660046115aa565b610577565b34801561019e57600080fd5b506101706101ad3660046115e4565b6105a5565b3480156101be57600080fd5b506101e67f000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf70681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561020f57600080fd5b5061023361021e36600461163b565b60036020526000908152604090205460ff1681565b60405190151581526020016101fa565b34801561024f57600080fd5b5061027061025e36600461165f565b60046020526000908152604090205481565b6040519081526020016101fa565b34801561028a57600080fd5b5061017061029936600461163b565b610641565b3480156102aa57600080fd5b5060025461023390600160a01b900460ff1681565b3480156102cb57600080fd5b506101706106e5565b3480156102e057600080fd5b506101e67f00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b81565b34801561031457600080fd5b50610170610323366004611678565b6106f9565b34801561033457600080fd5b506101e67f0000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a6404681565b34801561036857600080fd5b506000546001600160a01b03166101e6565b34801561038657600080fd5b506101e67f000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed681565b3480156103ba57600080fd5b506002546101e6906001600160a01b031681565b3480156103da57600080fd5b506101e67f000000000000000000000000a47fb7c4edd3475ce66f49a66b9bf1edbc61e52d81565b34801561040e57600080fd5b5060025461023390600160a81b900460ff1681565b6101706104313660046116c9565b61074d565b34801561044257600080fd5b506101706104513660046116f9565b61078e565b34801561046257600080fd5b5061027060015481565b34801561047857600080fd5b5061048c61048736600461165f565b6107b4565b6040516101fa9493929190611751565b6101706104aa36600461165f565b6108b2565b3480156104bb57600080fd5b506101706104ca36600461163b565b6108bf565b3480156104db57600080fd5b506101706104ea3660046116f9565b61093a565b600254600160a81b900460ff16610530573360009081526003602052604090205460ff1661053057604051631c31257f60e21b815260040160405180910390fd5b600254600160a01b900460ff1661055a57604051633dc2b22960e11b815260040160405180910390fd5b61056381610960565b6105708585858486610acf565b5050505050565b61057f611069565b600280546001600160a01b0319166001600160a01b039390931692909217909155600155565b6105ad611069565b8160008190036105d05760405163251f56a160e21b815260040160405180910390fd5b60005b818110156105705782600360008787858181106105f2576105f26117b9565b9050602002016020810190610607919061163b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610639816117cf565b9150506105d3565b610649611069565b47600081900361066c57604051630686827b60e51b815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146106b9576040519150601f19603f3d011682016040523d82523d6000602084013e6106be565b606091505b50509050806106e05760405163adb57d7d60e01b815260040160405180910390fd5b505050565b6106ed611069565b6106f760006110c3565b565b600254600160a81b900460ff1661073a573360009081526003602052604090205460ff1661073a57604051631c31257f60e21b815260040160405180910390fd5b6107478484843385610acf565b50505050565b600254600160a01b900460ff1661077757604051633dc2b22960e11b815260040160405180910390fd5b61078081610960565b61078a8282611113565b5050565b610796611069565b60028054911515600160a01b0260ff60a01b19909216919091179055565b60408051600580825260c08201909252601883901c9262ffffff16916060918291600091906020820160a08036833701905050925060005b6005811015610831578562ffffff1684828151811061080d5761080d6117b9565b602090810291909101015260189590951c9480610829816117cf565b9150506107ec565b5060408051600580825260c08201909252906020820160a08036833701905050915060005b60058110156108a15785600116600114838281518110610878576108786117b9565b9115156020928302919091019091015260049590951c9480610899816117cf565b915050610856565b508460011660011490509193509193565b6108bc8133611113565b50565b6108c7611069565b6001600160a01b0381166109315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6108bc816110c3565b610942611069565b60028054911515600160a81b0260ff60a81b19909216919091179055565b60405163090c9a2d60e41b81523360048201526001600160a01b0382811660248301523060448301527f00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b16906390c9a2d090606401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f6919061180c565b6108bc5760405163090c9a2d60e41b81523360048201526001600160a01b0382811660248301527f0000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a64046811660448301527f00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b16906390c9a2d090606401602060405180830381865afa158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab2919061180c565b6108bc5760405163ea8e4eb560e01b815260040160405180910390fd5b8360068114610af15760405163e86dce2960e01b815260040160405180910390fd5b60405163a4bf5fd560e01b81526000906001600160a01b037f0000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a64046169063a4bf5fd590610b42908a908a9060040161185b565b600060405180830381865afa158015610b5f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b879190810190611960565b905060008082600581518110610b9f57610b9f6117b9565b6020026020010151606001519050600083600081518110610bc257610bc26117b9565b6020026020010151604001516000141580610bfc575083600181518110610beb57610beb6117b9565b602002602001015160400151600014155b80610c26575083600281518110610c1557610c156117b9565b602002602001015160400151600114155b80610c50575083600381518110610c3f57610c3f6117b9565b602002602001015160400151600214155b80610c7a575083600481518110610c6957610c696117b9565b602002602001015160400151600314155b80610ca4575083600581518110610c9357610c936117b9565b602002602001015160400151600414155b15610cc257604051631704c2d160e01b815260040160405180910390fd5b84806001900395505081848681518110610cde57610cde6117b9565b60200260200101516060015103610cf3576001015b846020028a8a87818110610d0957610d096117b9565b90506020020135901b8317925060008511610cc2576003811015610d405760405163c3cd3f0160e01b815260040160405180910390fd5b505060405163f3993d1160e01b815260c087901b91909117906001600160a01b037f0000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a64046169063f3993d1190610dbe9088907f000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf706908d908d90600401611a71565b600060405180830381600087803b158015610dd857600080fd5b505af1158015610dec573d6000803e3d6000fd5b5050604051637921219560e11b81526001600160a01b037f000000000000000000000000a47fb7c4edd3475ce66f49a66b9bf1edbc61e52d16925063f242432a9150610e639088907f000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf706908b90600190600401611aa8565b600060405180830381600087803b158015610e7d57600080fd5b505af1158015610e91573d6000803e3d6000fd5b505050506000600460008a8a6005818110610eae57610eae6117b9565b90506020020135815260200190815260200160002054905080600014610f5c57604051637811a5bf60e01b8152600481018290526001600160a01b038781166024830152604482018490527f000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed61690637811a5bf90606401600060405180830381600087803b158015610f3f57600080fd5b505af1158015610f53573d6000803e3d6000fd5b50505050611023565b604051634be80bdb60e11b81526001600160a01b038781166004830152602482018490527f000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed616906397d017b6906044016020604051808303816000875af1158015610fcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fef9190611ae0565b905080600460008b8b6005818110611009576110096117b9565b905060200201358152602001908152602001600020819055505b604080518381526020810187905282917f691db5579a98d3190721c8e94d31de7fbc32069049d54d92a9dbc937b2ab5d8e910160405180910390a2505050505050505050565b6000546001600160a01b031633146106f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610928565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600154341461113557604051632d8768f960e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390527f000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed66001600160a01b031690636352211e90602401602060405180830381865afa15801561119a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111be9190611af9565b6001600160a01b0316816001600160a01b0316146111ef5760405163ea8e4eb560e01b815260040160405180910390fd5b6040516301c4d0af60e01b81526004810183905260009081906001600160a01b037f000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed616906301c4d0af90602401600060405180830381865afa158015611259573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112819190810190611b16565b604051630852cd8d60e31b81526004810187905291935091507f000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed66001600160a01b0316906342966c6890602401600060405180830381600087803b1580156112e857600080fd5b505af11580156112fc573d6000803e3d6000fd5b505060405163f3993d1160e01b81526001600160a01b037f0000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a6404616925063f3993d119150611370907f000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf7069087908790600401611b5d565b600060405180830381600087803b15801561138a57600080fd5b505af115801561139e573d6000803e3d6000fd5b5050604051637921219560e11b81526001600160a01b037f000000000000000000000000a47fb7c4edd3475ce66f49a66b9bf1edbc61e52d16925063f242432a9150611415907f000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf7069087908690600190600401611aa8565b600060405180830381600087803b15801561142f57600080fd5b505af1158015611443573d6000803e3d6000fd5b505050506000341115610747576002546001600160a01b03168015610570576000816001600160a01b03163460405160006040518083038185875af1925050503d80600081146114af576040519150601f19603f3d011682016040523d82523d6000602084013e6114b4565b606091505b50509050806114d65760405163f8b814d160e01b815260040160405180910390fd5b505050505050565b60008083601f8401126114f057600080fd5b50813567ffffffffffffffff81111561150857600080fd5b6020830191508360208260051b850101111561152357600080fd5b9250929050565b6001600160a01b03811681146108bc57600080fd5b60008060008060006080868803121561155757600080fd5b853567ffffffffffffffff81111561156e57600080fd5b61157a888289016114de565b9096509450506020860135925060408601359150606086013561159c8161152a565b809150509295509295909350565b600080604083850312156115bd57600080fd5b82356115c88161152a565b946020939093013593505050565b80151581146108bc57600080fd5b6000806000604084860312156115f957600080fd5b833567ffffffffffffffff81111561161057600080fd5b61161c868287016114de565b9094509250506020840135611630816115d6565b809150509250925092565b60006020828403121561164d57600080fd5b81356116588161152a565b9392505050565b60006020828403121561167157600080fd5b5035919050565b6000806000806060858703121561168e57600080fd5b843567ffffffffffffffff8111156116a557600080fd5b6116b1878288016114de565b90989097506020870135966040013595509350505050565b600080604083850312156116dc57600080fd5b8235915060208301356116ee8161152a565b809150509250929050565b60006020828403121561170b57600080fd5b8135611658816115d6565b600081518084526020808501945080840160005b838110156117465781518752958201959082019060010161172a565b509495945050505050565b8481526000602060808184015261176b6080840187611716565b838103604085015285518082528287019183019060005b818110156117a0578351151583529284019291840191600101611782565b5050809350505050821515606083015295945050505050565b634e487b7160e01b600052603260045260246000fd5b6000600182016117ef57634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561181e57600080fd5b8151611658816115d6565b81835260006001600160fb1b0383111561184257600080fd5b8260051b80836020870137939093016020019392505050565b60208152600061186f602083018486611829565b949350505050565b60405160a0810167ffffffffffffffff8111828210171561189a5761189a6117f6565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156118c9576118c96117f6565b604052919050565b600067ffffffffffffffff8211156118eb576118eb6117f6565b5060051b60200190565b600082601f83011261190657600080fd5b8151602061191b611916836118d1565b6118a0565b82815260059290921b8401810191818101908684111561193a57600080fd5b8286015b84811015611955578051835291830191830161193e565b509695505050505050565b6000602080838503121561197357600080fd5b825167ffffffffffffffff8082111561198b57600080fd5b818501915085601f83011261199f57600080fd5b81516119ad611916826118d1565b81815260059190911b830184019084810190888311156119cc57600080fd5b8585015b83811015611a64578051858111156119e85760008081fd5b860160a0818c03601f1901811315611a005760008081fd5b611a08611877565b8983015181526040808401518b830152606080850151828401526080915081850151818401525082840151925088831115611a435760008081fd5b611a518e8c858701016118f5565b90820152855250509186019186016119d0565b5098975050505050505050565b6001600160a01b03858116825284166020820152606060408201819052600090611a9e9083018486611829565b9695505050505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b600060208284031215611af257600080fd5b5051919050565b600060208284031215611b0b57600080fd5b81516116588161152a565b60008060408385031215611b2957600080fd5b825167ffffffffffffffff811115611b4057600080fd5b611b4c858286016118f5565b925050602083015190509250929050565b6001600160a01b03848116825283166020820152606060408201819052600090611b8990830184611716565b9594505050505056fea26469706673582212204efd22b6012d76f32ae17b12f516eecd565eab28c92425489d11cce883123f9464736f6c63430008110033

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

0000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a64046000000000000000000000000a47fb7c4edd3475ce66f49a66b9bf1edbc61e52d000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed6000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf70600000000000000000000000000000000000076a84fef008cdabe6409d2fe638b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : tplRevealed (address): 0x7bC1e07cdFA283db7cF3C680D16ca7F161a64046
Arg [1] : tplAfterglow (address): 0xa47FB7c4eDd3475CE66F49a66b9bf1edbc61e52d
Arg [2] : tplMech (address): 0xb286ac8EFf9F44e2C377c6770CAd5Fc78BFf9eD6
Arg [3] : tplPartsEscrow (address): 0xCa44FD402A0728Eae3af12E972138dD8Bf9bf706
Arg [4] : delegateRegistry (address): 0x00000000000076A84feF008CDAbe6409d2FE638B
Arg [5] : disassemblyFeeRecipient_ (address): 0x0000000000000000000000000000000000000000
Arg [6] : disassemblyFee_ (uint256): 0

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000007bc1e07cdfa283db7cf3c680d16ca7f161a64046
Arg [1] : 000000000000000000000000a47fb7c4edd3475ce66f49a66b9bf1edbc61e52d
Arg [2] : 000000000000000000000000b286ac8eff9f44e2c377c6770cad5fc78bff9ed6
Arg [3] : 000000000000000000000000ca44fd402a0728eae3af12e972138dd8bf9bf706
Arg [4] : 00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.