Contract 0xf78b989D3cF27EFc309887501a749fE2aEAAA277

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0xcade207cb33badfa0592b1b68b12273bf3b0f0911e183160d4cdb4e937b9015aExtract Diamond407937642023-03-26 15:46:3272 days 2 hrs ago0xd4928171a52f420855bf59bcaf3c7077f42298d5 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.419478666661 695.820166809
0x31ae6eacdd03cc7baba580cf20d99b28348be4e71cfc6c16718d6cdcd1e1ee56Extract Diamond407929792023-03-26 15:06:1872 days 3 hrs ago0xd4928171a52f420855bf59bcaf3c7077f42298d5 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.394553727484 651.449633017
0x1698cf2676009d84cd5916ff0c3ced52543304f6ecab6d9940e010b2bd7ab80eExtract Diamond407914942023-03-26 13:47:4672 days 4 hrs ago0x5ce2d6fdb0548234c376348aab6463378b7b7af3 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.385288132899 636.15116345
0x0baa1e7d54d2ba25a593bf2f4c22293f10241e4b779a65d3bce6203569f3736aExtract Diamond407914932023-03-26 13:47:4072 days 4 hrs ago0xd4928171a52f420855bf59bcaf3c7077f42298d5 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.375539268822 620.054765209
0x7dc31335f4acae4fb9fea30fb2af9532d5f8c828a5ab044d44d5abe3988967c1Extract Diamond407910522023-03-26 13:23:5872 days 5 hrs ago0xdb0b11d1281da49e950f89bd0f6b47d464d25f91 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.485526056835 805.377838511
0x570947c299fd498059f58702a2a8636090e6d2a6c82cd2874eb3dd87abe51391Extract Diamond407909962023-03-26 13:20:0472 days 5 hrs ago0xdb0b11d1281da49e950f89bd0f6b47d464d25f91 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.328293139311 544.56401508
0x1b72c26fa1ded216cf84ba6a8bbf92e4663aa91b3b715b06aa74ddffe2d3f9ebExtract Diamond407909032023-03-26 13:15:4272 days 5 hrs ago0xdb0b11d1281da49e950f89bd0f6b47d464d25f91 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.404003228621 667.05175161
0x6a8702206d14255a6532bfb4dbcf6790c741839f36de27642f34e6619993cd86Extract Diamond407908622023-03-26 13:12:3472 days 5 hrs ago0x1215991085d541a586f0e1968355a36e58c9b2b4 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.295124718305 549.876410778
0x5fe3c1c705c641ebe6fb7103deb311d28a5454a6844df69863a40f26d572f415Extract Diamond407907032023-03-26 13:04:5272 days 5 hrs ago0x1215991085d541a586f0e1968355a36e58c9b2b4 IN  0xf78b989d3cf27efc309887501a749fe2aeaaa2770 MATIC0.113506013483 210.386838236
0x93f54932710a777eddee5e32843d4125c27b2db06e2dccfeb407fb081b199fec0x60a06040407901332023-03-26 12:39:3472 days 6 hrs ago0x88c875606ae309172f89f231df5a9ffb5ad64994 IN  Create: Kimberlite0 MATIC0.5983712350
[ Download CSV Export 
Latest 9 internal transactions
Parent Txn Hash Block From To Value
0xcade207cb33badfa0592b1b68b12273bf3b0f0911e183160d4cdb4e937b9015a407937642023-03-26 15:46:3272 days 2 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x31ae6eacdd03cc7baba580cf20d99b28348be4e71cfc6c16718d6cdcd1e1ee56407929792023-03-26 15:06:1872 days 3 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x1698cf2676009d84cd5916ff0c3ced52543304f6ecab6d9940e010b2bd7ab80e407914942023-03-26 13:47:4672 days 4 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x0baa1e7d54d2ba25a593bf2f4c22293f10241e4b779a65d3bce6203569f3736a407914932023-03-26 13:47:4072 days 4 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x7dc31335f4acae4fb9fea30fb2af9532d5f8c828a5ab044d44d5abe3988967c1407910522023-03-26 13:23:5872 days 5 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x570947c299fd498059f58702a2a8636090e6d2a6c82cd2874eb3dd87abe51391407909962023-03-26 13:20:0472 days 5 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x1b72c26fa1ded216cf84ba6a8bbf92e4663aa91b3b715b06aa74ddffe2d3f9eb407909032023-03-26 13:15:4272 days 5 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x6a8702206d14255a6532bfb4dbcf6790c741839f36de27642f34e6619993cd86407908622023-03-26 13:12:3472 days 5 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
0x5fe3c1c705c641ebe6fb7103deb311d28a5454a6844df69863a40f26d572f415407907032023-03-26 13:04:5272 days 5 hrs ago 0xf78b989d3cf27efc309887501a749fe2aeaaa277  Contract Creation0 MATIC
[ Download CSV Export 
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:
Kimberlite

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

File 2 of 19 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

    // Mapping from account to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC1155).interfaceId ||
            interfaceId == type(IERC1155MetadataURI).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: address zero is not a valid owner");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC1155-isApprovedForAll}.
     */
    function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[account][operator];
    }

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner or approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner or approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `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 memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - 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[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * 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 _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `ids` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non-ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non-ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

File 3 of 19 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

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

File 4 of 19 : 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 5 of 19 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _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.
     *
     * NOTE: 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.
     *
     * NOTE: 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 6 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 7 of 19 : 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 8 of 19 : 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 9 of 19 : 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 10 of 19 : FacetRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "./interfaces/IRegistry.sol";

contract FacetRegistry is ERC1155, IRegistry {
    uint256 constant baseTokenDiamond = 1 << 250;
    uint256 constant baseTokenStorage = 2 << 250;
    uint256 constant baseTokenFacetAddress = 3 << 250;

    mapping(uint256 => bytes) public metadata;

    constructor() ERC1155("") {}

    function mintDiamond(address addr, address to, string memory meta) external {
        _mint(to, _diamondAddressToTokenId(addr), 1, bytes(meta));
    }

    function mintStorage(string memory storageSlot, string memory meta) external {
        //TODO nice to have, let's see how it goes
    }

    function createFacetAddress(address addr, string memory meta) external {
        uint256 id = _facetAddressToTokenId(addr);
        require(!_exists(id), "FacetRegistry: facet address already known");
        _mint(msg.sender, id, 1, bytes(meta));
        //mint one to the facet deployer
    }

    /**
        @notice mint to a Diamond to mark a particular facet as usable by a particular project
        @notice every pre-existing sample facet is minted to `FacetRegistry` itself
    */
    function mintFacet(address facetAddr, address to) external {
        uint256 id = _facetAddressToTokenId(facetAddr);
        require(!_exists(id), "FacetRegistry: facet address already known");
        _mint(to, id, 1, "0x");
    }


    function uri(uint256 tokenId) public view virtual override returns (string memory) {
        return string(metadata[tokenId]);
        //TODO switch to ERC1155URIStorage.sol
    }

    function tokenType(uint256 tokenId) external pure returns (TokenType){
        if (_isDiamond(tokenId)) {
            return TokenType.Diamond;
        }
        if (_isStorage(tokenId)) {
            return TokenType.DiamondStorage;
        }
        return TokenType.Facet;
    }

    function _beforeTokenTransfer(
        address,
        address from,
        address,
        uint256[] memory ids,
        uint256[] memory,
        bytes memory data
    ) internal virtual override {
        uint256 id = ids[0];
        //TODO update for multiple token transfers
        if (from == address(0) && metadata[id].length == 0 && data.length > 0) {
            metadata[id] = data;
        }
    }

    function _exists(uint256 tokenId) private view returns (bool){
        return metadata[tokenId].length > 0;
    }

    function _isDiamond(uint256 tokenId) private pure returns (bool){
        return tokenId >= baseTokenDiamond && tokenId < baseTokenStorage;
    }

    function _isStorage(uint256 tokenId) private pure returns (bool){
        return tokenId >= baseTokenStorage && tokenId < baseTokenFacetAddress;
    }

    function _isFacet(uint256 tokenId) private pure returns (bool){
        return tokenId >= baseTokenFacetAddress;
    }

    function _facetAddressToTokenId(address facetAddress) private pure returns (uint256){
        return baseTokenFacetAddress + uint256(uint160(facetAddress));
    }

    function _diamondAddressToTokenId(address diamondAddress) private pure returns (uint256){
        return baseTokenDiamond + uint256(uint160(diamondAddress));
    }

}

File 11 of 19 : IKimberlite.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/interfaces/IERC165.sol";
import "diamond-1-hardhat/contracts/Diamond.sol";

interface IKimberlite is IERC165 {
    function extractDiamond(string memory meta) external;
}

File 12 of 19 : IRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IRegistry {
    enum TokenType {Diamond, Facet, DiamondStorage}

    function createFacetAddress(address addr, string memory meta) external;

    function mintDiamond(address addr, address to, string memory meta) external;

    function mintStorage(string memory storageSlot, string memory metadata) external;

    function mintFacet(address addr, address to) external;

    function tokenType(uint256 tokenId) external returns(TokenType);
}

File 13 of 19 : Kimberlite.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/IKimberlite.sol";
import "diamond-1-hardhat/contracts/Diamond.sol";
import "./FacetRegistry.sol";

contract Kimberlite is IKimberlite {
    event DiamondExtracted(address diamond, address owner);

    IDiamondCut.FacetCut[] private facetCuts;
    DiamondArgs private diamondArgs;
    FacetRegistry immutable public facetRegistry;

    constructor(
        IDiamondCut.FacetCut[] memory _facetCuts,
        DiamondArgs memory _diamondArgs,
        FacetRegistry _facetRegistry
    ) {
        for (uint i = 0; i < _facetCuts.length; i++) {
            facetCuts.push(_facetCuts[i]);
        }
        diamondArgs = _diamondArgs;
        facetRegistry = _facetRegistry;
    }

    function extractDiamond(string memory meta) external {
        diamondArgs.owner = msg.sender;
        address diamond = address(new Diamond(facetCuts, diamondArgs));
        facetRegistry.mintDiamond(diamond, msg.sender, meta);
        emit DiamondExtracted(diamond, msg.sender);
    }

    function supportsInterface(bytes4 interfaceId) external pure returns (bool){
        return this.extractDiamond.selector == interfaceId;
    }
}

File 14 of 19 : Diamond.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]>, Twitter/Github: @mudgen
* EIP-2535 Diamonds
*
* Implementation of a diamond.
/******************************************************************************/

import { LibDiamond } from "./libraries/LibDiamond.sol";
import { IDiamondCut } from "./interfaces/IDiamondCut.sol";
import { IDiamondLoupe } from  "./interfaces/IDiamondLoupe.sol";
import { IERC173 } from "./interfaces/IERC173.sol";

// When no function exists for function called
error FunctionNotFound(bytes4 _functionSelector);

// This is used in diamond constructor
// more arguments are added to this struct
// this avoids stack too deep errors
struct DiamondArgs {
    address owner;
    address init;
    bytes initCalldata;
}

contract Diamond {    

    constructor(IDiamondCut.FacetCut[] memory _diamondCut, DiamondArgs memory _args) payable {
        LibDiamond.setContractOwner(_args.owner);
        LibDiamond.diamondCut(_diamondCut, _args.init, _args.initCalldata);

        // Code can be added here to perform actions and set state variables.
    }

    // Find facet for function that is called and execute the
    // function if a facet is found and return any value.
    fallback() external payable {
        LibDiamond.DiamondStorage storage ds;
        bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION;
        // get diamond storage
        assembly {
            ds.slot := position
        }
        // get facet from function selector
        address facet = ds.facetAddressAndSelectorPosition[msg.sig].facetAddress;
        if(facet == address(0)) {
            revert FunctionNotFound(msg.sig);
        }
        // Execute external function from facet using delegatecall and return any value.
        assembly {
            // copy function selector and any arguments
            calldatacopy(0, 0, calldatasize())
             // execute function call using the facet
            let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)
            // get any return value
            returndatacopy(0, 0, returndatasize())
            // return any return value or error back to the caller
            switch result
                case 0 {
                    revert(0, returndatasize())
                }
                default {
                    return(0, returndatasize())
                }
        }
    }

    receive() external payable {}
}

File 15 of 19 : IDiamond.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]>, Twitter/Github: @mudgen
* EIP-2535 Diamonds
/******************************************************************************/

interface IDiamond {
    enum FacetCutAction {Add, Replace, Remove}
    // Add=0, Replace=1, Remove=2

    struct FacetCut {
        address facetAddress;
        FacetCutAction action;
        bytes4[] functionSelectors;
    }

    event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}

File 16 of 19 : IDiamondCut.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]>, Twitter/Github: @mudgen
* EIP-2535 Diamonds
/******************************************************************************/

import { IDiamond } from "./IDiamond.sol";

interface IDiamondCut is IDiamond {    

    /// @notice Add/replace/remove any number of functions and optionally execute
    ///         a function with delegatecall
    /// @param _diamondCut Contains the facet addresses and function selectors
    /// @param _init The address of the contract or facet to execute _calldata
    /// @param _calldata A function call, including function selector and arguments
    ///                  _calldata is executed with delegatecall on _init
    function diamondCut(
        FacetCut[] calldata _diamondCut,
        address _init,
        bytes calldata _calldata
    ) external;    
}

File 17 of 19 : IDiamondLoupe.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]>, Twitter/Github: @mudgen
* EIP-2535 Diamonds
/******************************************************************************/

// A loupe is a small magnifying glass used to look at diamonds.
// These functions look at diamonds
interface IDiamondLoupe {
    /// These functions are expected to be called frequently
    /// by tools.

    struct Facet {
        address facetAddress;
        bytes4[] functionSelectors;
    }

    /// @notice Gets all facet addresses and their four byte function selectors.
    /// @return facets_ Facet
    function facets() external view returns (Facet[] memory facets_);

    /// @notice Gets all the function selectors supported by a specific facet.
    /// @param _facet The facet address.
    /// @return facetFunctionSelectors_
    function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);

    /// @notice Get all the facet addresses used by a diamond.
    /// @return facetAddresses_
    function facetAddresses() external view returns (address[] memory facetAddresses_);

    /// @notice Gets the facet that supports the given selector.
    /// @dev If facet is not found return address(0).
    /// @param _functionSelector The function selector.
    /// @return facetAddress_ The facet address.
    function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);
}

File 18 of 19 : IERC173.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

/// @title ERC-173 Contract Ownership Standard
///  Note: the ERC-165 identifier for this interface is 0x7f5828d0
/* is ERC165 */
interface IERC173 {
    /// @dev This emits when ownership of a contract changes.
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @notice Get the address of the owner
    /// @return owner_ The address of the owner.
    function owner() external view returns (address owner_);

    /// @notice Set the address of the new owner of the contract
    /// @dev Set _newOwner to address(0) to renounce any ownership.
    /// @param _newOwner The address of the new owner of the contract
    function transferOwnership(address _newOwner) external;
}

File 19 of 19 : LibDiamond.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]>, Twitter/Github: @mudgen
* EIP-2535 Diamonds
/******************************************************************************/
import { IDiamond } from "../interfaces/IDiamond.sol";
import { IDiamondCut } from "../interfaces/IDiamondCut.sol";

// Remember to add the loupe functions from DiamondLoupeFacet to the diamond.
// The loupe functions are required by the EIP2535 Diamonds standard

error NoSelectorsGivenToAdd();
error NotContractOwner(address _user, address _contractOwner);
error NoSelectorsProvidedForFacetForCut(address _facetAddress);
error CannotAddSelectorsToZeroAddress(bytes4[] _selectors);
error NoBytecodeAtAddress(address _contractAddress, string _message);
error IncorrectFacetCutAction(uint8 _action);
error CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);
error CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);
error CannotReplaceImmutableFunction(bytes4 _selector);
error CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);
error CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);
error RemoveFacetAddressMustBeZeroAddress(address _facetAddress);
error CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);
error CannotRemoveImmutableFunction(bytes4 _selector);
error InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);

library LibDiamond {
    bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");

    struct FacetAddressAndSelectorPosition {
        address facetAddress;
        uint16 selectorPosition;
    }

    struct DiamondStorage {
        // function selector => facet address and selector position in selectors array
        mapping(bytes4 => FacetAddressAndSelectorPosition) facetAddressAndSelectorPosition;
        bytes4[] selectors;
        mapping(bytes4 => bool) supportedInterfaces;
        // owner of the contract
        address contractOwner;
    }

    function diamondStorage() internal pure returns (DiamondStorage storage ds) {
        bytes32 position = DIAMOND_STORAGE_POSITION;
        assembly {
            ds.slot := position
        }
    }

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

    function setContractOwner(address _newOwner) internal {
        DiamondStorage storage ds = diamondStorage();
        address previousOwner = ds.contractOwner;
        ds.contractOwner = _newOwner;
        emit OwnershipTransferred(previousOwner, _newOwner);
    }

    function contractOwner() internal view returns (address contractOwner_) {
        contractOwner_ = diamondStorage().contractOwner;
    }

    function enforceIsContractOwner() internal view {
        if(msg.sender != diamondStorage().contractOwner) {
            revert NotContractOwner(msg.sender, diamondStorage().contractOwner);
        }        
    }

    event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);

    // Internal function version of diamondCut
    function diamondCut(
        IDiamondCut.FacetCut[] memory _diamondCut,
        address _init,
        bytes memory _calldata
    ) internal {
        for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
            bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;
            address facetAddress = _diamondCut[facetIndex].facetAddress;
            if(functionSelectors.length == 0) {
                revert NoSelectorsProvidedForFacetForCut(facetAddress);
            }
            IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;
            if (action == IDiamond.FacetCutAction.Add) {
                addFunctions(facetAddress, functionSelectors);
            } else if (action == IDiamond.FacetCutAction.Replace) {
                replaceFunctions(facetAddress, functionSelectors);
            } else if (action == IDiamond.FacetCutAction.Remove) {
                removeFunctions(facetAddress, functionSelectors);
            } else {
                revert IncorrectFacetCutAction(uint8(action));
            }
        }
        emit DiamondCut(_diamondCut, _init, _calldata);
        initializeDiamondCut(_init, _calldata);
    }

    function addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {        
        if(_facetAddress == address(0)) {
            revert CannotAddSelectorsToZeroAddress(_functionSelectors);
        }
        DiamondStorage storage ds = diamondStorage();
        uint16 selectorCount = uint16(ds.selectors.length);                
        enforceHasContractCode(_facetAddress, "LibDiamondCut: Add facet has no code");
        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            if(oldFacetAddress != address(0)) {
                revert CannotAddFunctionToDiamondThatAlreadyExists(selector);
            }            
            ds.facetAddressAndSelectorPosition[selector] = FacetAddressAndSelectorPosition(_facetAddress, selectorCount);
            ds.selectors.push(selector);
            selectorCount++;
        }
    }

    function replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {        
        DiamondStorage storage ds = diamondStorage();
        if(_facetAddress == address(0)) {
            revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);
        }
        enforceHasContractCode(_facetAddress, "LibDiamondCut: Replace facet has no code");
        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            // can't replace immutable functions -- functions defined directly in the diamond in this case
            if(oldFacetAddress == address(this)) {
                revert CannotReplaceImmutableFunction(selector);
            }
            if(oldFacetAddress == _facetAddress) {
                revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);
            }
            if(oldFacetAddress == address(0)) {
                revert CannotReplaceFunctionThatDoesNotExists(selector);
            }
            // replace old facet address
            ds.facetAddressAndSelectorPosition[selector].facetAddress = _facetAddress;
        }
    }

    function removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {        
        DiamondStorage storage ds = diamondStorage();
        uint256 selectorCount = ds.selectors.length;
        if(_facetAddress != address(0)) {
            revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);
        }        
        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {
            bytes4 selector = _functionSelectors[selectorIndex];
            FacetAddressAndSelectorPosition memory oldFacetAddressAndSelectorPosition = ds.facetAddressAndSelectorPosition[selector];
            if(oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {
                revert CannotRemoveFunctionThatDoesNotExist(selector);
            }
            
            
            // can't remove immutable functions -- functions defined directly in the diamond
            if(oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {
                revert CannotRemoveImmutableFunction(selector);
            }
            // replace selector with last selector
            selectorCount--;
            if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {
                bytes4 lastSelector = ds.selectors[selectorCount];
                ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;
                ds.facetAddressAndSelectorPosition[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;
            }
            // delete last selector
            ds.selectors.pop();
            delete ds.facetAddressAndSelectorPosition[selector];
        }
    }

    function initializeDiamondCut(address _init, bytes memory _calldata) internal {
        if (_init == address(0)) {
            return;
        }
        enforceHasContractCode(_init, "LibDiamondCut: _init address has no code");        
        (bool success, bytes memory error) = _init.delegatecall(_calldata);
        if (!success) {
            if (error.length > 0) {
                // bubble up error
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(error)
                    revert(add(32, error), returndata_size)
                }
            } else {
                revert InitializationFunctionReverted(_init, _calldata);
            }
        }        
    }

    function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {
        uint256 contractSize;
        assembly {
            contractSize := extcodesize(_contract)
        }
        if(contractSize == 0) {
            revert NoBytecodeAtAddress(_contract, _errorMessage);
        }        
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamond.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamond.FacetCut[]","name":"_facetCuts","type":"tuple[]"},{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"init","type":"address"},{"internalType":"bytes","name":"initCalldata","type":"bytes"}],"internalType":"struct DiamondArgs","name":"_diamondArgs","type":"tuple"},{"internalType":"contract FacetRegistry","name":"_facetRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"diamond","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"DiamondExtracted","type":"event"},{"inputs":[{"internalType":"string","name":"meta","type":"string"}],"name":"extractDiamond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"facetRegistry","outputs":[{"internalType":"contract FacetRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}]

60a06040523480156200001157600080fd5b5060405162001f6d38038062001f6d8339810160408190526200003491620003e4565b60005b835181101562000106576000848281518110620000585762000058620005bf565b60209081029190910181015182546001810184556000938452928290208151600294850290910180546001600160a01b039092166001600160a01b0319831681178255938301519294909384926001600160a81b0319161790600160a01b908490811115620000cb57620000cb620005d5565b021790555060408201518051620000ed91600184019160209091019062000169565b5050508080620000fd90620005eb565b91505062000037565b508151600180546001600160a01b039283166001600160a01b0319918216178255602085015160028054919094169116179091556040830151839190600390620001519082620006a2565b5050506001600160a01b0316608052506200076e9050565b828054828255906000526020600020906007016008900481019282156200020a5791602002820160005b83821115620001d657835183826101000a81548163ffffffff021916908360e01c0217905550926020019260040160208160030104928301926001030262000193565b8015620002085782816101000a81549063ffffffff0219169055600401602081600301049283019260010302620001d6565b505b50620002189291506200021c565b5090565b5b808211156200021857600081556001016200021d565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156200026e576200026e62000233565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200029f576200029f62000233565b604052919050565b60006001600160401b03821115620002c357620002c362000233565b5060051b60200190565b6001600160a01b0381168114620002e357600080fd5b50565b600060608284031215620002f957600080fd5b6200030362000249565b905081516200031281620002cd565b81526020828101516200032581620002cd565b8282015260408301516001600160401b03808211156200034457600080fd5b818501915085601f8301126200035957600080fd5b8151818111156200036e576200036e62000233565b62000382601f8201601f1916850162000274565b915080825286848285010111156200039957600080fd5b60005b81811015620003b95783810185015183820186015284016200039c565b5060008482840101525080604085015250505092915050565b8051620003df81620002cd565b919050565b600080600060608486031215620003fa57600080fd5b83516001600160401b03808211156200041257600080fd5b818601915086601f8301126200042757600080fd5b81516200043e6200043882620002a7565b62000274565b8082825260208201915060208360051b8601019250898311156200046157600080fd5b602085015b838110156200057b578051858111156200047f57600080fd5b86016060818d03601f190112156200049657600080fd5b620004a062000249565b6020820151620004b081620002cd565b8152604082015160038110620004c557600080fd5b6020820152606082015187811115620004dd57600080fd5b8083019250508c603f830112620004f357600080fd5b6020820151620005076200043882620002a7565b81815260059190911b83016040019060208101908f8311156200052957600080fd5b6040850194505b82851015620005645784516001600160e01b0319811681146200055257600080fd5b82526020948501949091019062000530565b604084015250508452506020928301920162000466565b50602089015190975093505050808211156200059657600080fd5b50620005a586828701620002e6565b925050620005b660408501620003d2565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6000600182016200060c57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806200062857607f821691505b6020821081036200064957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200069d57600081815260208120601f850160051c81016020861015620006785750805b601f850160051c820191505b81811015620006995782815560010162000684565b5050505b505050565b81516001600160401b03811115620006be57620006be62000233565b620006d681620006cf845462000613565b846200064f565b602080601f8311600181146200070e5760008415620006f55750858301515b600019600386901b1c1916600185901b17855562000699565b600085815260208120601f198616915b828110156200073f578886015182559484019460019091019084016200071e565b50858210156200075e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516117dd6200079060003960008181608d015261014b01526117dd6000f3fe60806040523480156200001157600080fd5b5060043610620000465760003560e01c806301ffc9a7146200004b5780630a1acd7314620000875780639896919314620000c8575b600080fd5b620000726200005c3660046200020e565b6001600160e01b031916639896919360e01b1490565b60405190151581526020015b60405180910390f35b620000af7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016200007e565b620000df620000d936600462000257565b620000e1565b005b600180546001600160a01b031916331781556040516000918291620001069062000200565b62000113929190620003fd565b604051809103906000f08015801562000130573d6000803e3d6000fd5b50604051632b95003f60e11b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063572a007e906200018690849033908790600401620006e9565b600060405180830381600087803b158015620001a157600080fd5b505af1158015620001b6573d6000803e3d6000fd5b5050604080516001600160a01b03851681523360208201527f5e59c87a812289c0bc0a310ac4d57cd43f197a706fb9ce76817bdd98754e0ad2935001905060405180910390a15050565b611052806200075683390190565b6000602082840312156200022157600080fd5b81356001600160e01b0319811681146200023a57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156200026a57600080fd5b813567ffffffffffffffff808211156200028357600080fd5b818401915084601f8301126200029857600080fd5b813581811115620002ad57620002ad62000241565b604051601f8201601f19908116603f01168101908382118183101715620002d857620002d862000241565b81604052828152876020848701011115620002f257600080fd5b826020860160208301376000928101602001929092525095945050505050565b6001600160e01b0319169052565b80546001600160a01b03908116835260018281015490911660208085019190915260606040850152600283018054600093919290849080841c818516806200036957607f821691505b84821081036200038757634e487b7160e01b84526022600452602484fd5b60608a0182905260808a01818015620003a95760018114620003c057620003ed565b60ff198516825283151560051b82019550620003ed565b60008981526020902060005b85811015620003e757815484820152908901908801620003cc565b83019650505b50939a9950505050505050505050565b6000604082016040835280855480835260608501915060608160051b86010192508660005260208060002060005b83811015620006c857878603605f1901855281546001600160a01b0381168752606087019060a01c60ff16600381106200047557634e487b7160e01b600052602160045260246000fd5b878501526060604088015260018381018054808452600091825260208083209401905b8060078401101562000560578454620004b5838260e01b62000312565b6001600160e01b0319620004d2848b0160c084901b831662000312565b620004e660408501828460a01b1662000312565b620004fa60608501828460801b1662000312565b6200050e60808501828460601b1662000312565b6200052260a08501828460401b1662000312565b6200053560c0850182848d1b1662000312565b6200054660e0850182841662000312565b505061010082019150838501945060088301925062000498565b9354938083101562000584576200057b828660e01b62000312565b91830191908701905b80831015620005b057620005a78260c087901b6001600160e01b03191662000312565b91830191908701905b80831015620005dc57620005d38260a087901b6001600160e01b03191662000312565b91830191908701905b808310156200060857620005ff82608087901b6001600160e01b03191662000312565b91830191908701905b8083101562000634576200062b82606087901b6001600160e01b03191662000312565b91830191908701905b8083101562000660576200065782604087901b6001600160e01b03191662000312565b91830191908701905b808310156200068a576200068182868a1b6001600160e01b03191662000312565b91830191908701905b80831015620006ae57620006a9826001600160e01b0319871662000312565b908701905b50985050509483019450600291909101906001016200042b565b505085840381870152505050620006e0818562000320565b95945050505050565b600060018060a01b038086168352602081861681850152606060408501528451915081606085015260005b82811015620007325785810182015185820160800152810162000714565b50506000608082850101526080601f19601f83011684010191505094935050505056fe608060405260405161105238038061105283398101604081905261002291610ad1565b805161002d9061004d565b61004682826020015183604001516100d060201b60201c565b5050610eb7565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f80546001600160a01b031981166001600160a01b03848116918217909355604051600080516020610f9e833981519152939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b835181101561023a5760008482815181106100f0576100f0610c72565b6020026020010151604001519050600085838151811061011257610112610c72565b602002602001015160000151905081516000036101525760405163e767f91f60e01b81526001600160a01b03821660048201526024015b60405180910390fd5b600086848151811061016657610166610c72565b60200260200101516020015190506000600281111561018757610187610c88565b81600281111561019957610199610c88565b036101ad576101a88284610285565b610224565b60018160028111156101c1576101c1610c88565b036101d0576101a88284610438565b60028160028111156101e4576101e4610c88565b036101f3576101a882846105cb565b80600281111561020557610205610c88565b604051633ff4d20f60e11b815260ff9091166004820152602401610149565b505050808061023290610cb4565b9150506100d3565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67383838360405161026e93929190610d3e565b60405180910390a16102808282610854565b505050565b6001600160a01b0382166102ae57806040516302b8da0760e21b81526004016101499190610e07565b60008051602061100a8339815191525460408051606081019091526024808252600080516020610f9e83398151915292916102f391869190610fbe602083013961091a565b60005b835181101561043157600084828151811061031357610313610c72565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b031680156103705760405163ebbf5d0760e01b81526001600160e01b031983166004820152602401610149565b6040805180820182526001600160a01b03808a16825261ffff80881660208085019182526001600160e01b0319881660009081528b8252958620945185549251909316600160a01b026001600160b01b0319909216929093169190911717909155600180880180549182018155835291206008820401805460e085901c60046007909416939093026101000a92830263ffffffff90930219169190911790558361041981610e21565b9450505050808061042990610cb4565b9150506102f6565b5050505050565b600080516020610f9e8339815191526001600160a01b038316610470578160405163cd98a96f60e01b81526004016101499190610e07565b6104928360405180606001604052806028815260200161102a6028913961091a565b60005b82518110156105c55760008382815181106104b2576104b2610c72565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b031630810361051057604051632901806d60e11b81526001600160e01b031983166004820152602401610149565b856001600160a01b0316816001600160a01b03160361054e57604051631ac6ce8d60e11b81526001600160e01b031983166004820152602401610149565b6001600160a01b03811661058157604051637479f93960e01b81526001600160e01b031983166004820152602401610149565b506001600160e01b031916600090815260208390526040902080546001600160a01b0319166001600160a01b038616179055806105bd81610cb4565b915050610495565b50505050565b60008051602061100a83398151915254600080516020610f9e833981519152906001600160a01b0384161561061e5760405163d091bc8160e01b81526001600160a01b0385166004820152602401610149565b60005b835181101561043157600084828151811061063e5761063e610c72565b6020908102919091018101516001600160e01b0319811660009081528683526040908190208151808301909252546001600160a01b038116808352600160a01b90910461ffff1693820193909352909250906106b957604051637a08a22d60e01b81526001600160e01b031983166004820152602401610149565b8051306001600160a01b03909116036106f157604051630df5fd6160e31b81526001600160e01b031983166004820152602401610149565b836106fb81610e42565b94505083816020015161ffff16146107d957600085600101858154811061072457610724610c72565b90600052602060002090600891828204019190066004029054906101000a900460e01b90508086600101836020015161ffff168154811061076757610767610c72565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c92909202939093179055838201516001600160e01b03199390931681529087905260409020805461ffff60a01b1916600160a01b61ffff909316929092029190911790555b846001018054806107ec576107ec610e59565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319909316815291859052506040902080546001600160b01b03191690558061084c81610cb4565b915050610621565b6001600160a01b038216610866575050565b61088882604051806060016040528060288152602001610fe26028913961091a565b600080836001600160a01b0316836040516108a39190610e6f565b600060405180830381855af49150503d80600081146108de576040519150601f19603f3d011682016040523d82523d6000602084013e6108e3565b606091505b5091509150816105c5578051156108fd5780518082602001fd5b838360405163192105d760e01b8152600401610149929190610e8b565b813b600081900361028057828260405163919834b960e01b8152600401610149929190610e8b565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b038111828210171561097a5761097a610942565b60405290565b604051601f8201601f191681016001600160401b03811182821017156109a8576109a8610942565b604052919050565b60006001600160401b038211156109c9576109c9610942565b5060051b60200190565b80516001600160a01b03811681146109ea57600080fd5b919050565b60005b83811015610a0a5781810151838201526020016109f2565b50506000910152565b600060608284031215610a2557600080fd5b610a2d610958565b9050610a38826109d3565b81526020610a478184016109d3565b8282015260408301516001600160401b0380821115610a6557600080fd5b818501915085601f830112610a7957600080fd5b815181811115610a8b57610a8b610942565b610a9d601f8201601f19168501610980565b91508082528684828501011115610ab357600080fd5b610ac2818584018686016109ef565b50604084015250909392505050565b60008060408385031215610ae457600080fd5b82516001600160401b0380821115610afb57600080fd5b818501915085601f830112610b0f57600080fd5b81516020610b24610b1f836109b0565b610980565b82815260059290921b84018101918181019089841115610b4357600080fd5b8286015b84811015610c4157805186811115610b5e57600080fd5b87016060818d03601f19011215610b7457600080fd5b610b7c610958565b610b878683016109d3565b8152604082015160038110610b9b57600080fd5b81870152606082015188811115610bb157600080fd5b8083019250508c603f830112610bc657600080fd5b85820151610bd6610b1f826109b0565b81815260059190911b830160400190878101908f831115610bf657600080fd5b6040850194505b82851015610c2c5784516001600160e01b031981168114610c1d57600080fd5b82529388019390880190610bfd565b60408401525050845250918301918301610b47565b5091880151919650909350505080821115610c5b57600080fd5b50610c6885828601610a13565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201610cc657610cc6610c9e565b5060010190565b600081518084526020808501945080840160005b83811015610d075781516001600160e01b03191687529582019590820190600101610ce1565b509495945050505050565b60008151808452610d2a8160208601602086016109ef565b601f01601f19169290920160200192915050565b6000606080830181845280875180835260808601915060808160051b87010192506020808a016000805b84811015610dd757898703607f19018652825180516001600160a01b031688528481015160038110610da857634e487b7160e01b84526021600452602484fd5b88860152604090810151908801899052610dc489890182610ccd565b9750509483019491830191600101610d68565b5050506001600160a01b0389169087015250508381036040850152610dfc8186610d12565b979650505050505050565b602081526000610e1a6020830184610ccd565b9392505050565b600061ffff808316818103610e3857610e38610c9e565b6001019392505050565b600081610e5157610e51610c9e565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60008251610e818184602087016109ef565b9190910192915050565b6001600160a01b0383168152604060208201819052600090610eaf90830184610d12565b949350505050565b60d980610ec56000396000f3fe608060405236600a57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602081905260409091205481906001600160a01b031680608057604051630a82dd7360e31b81526001600160e01b031960003516600482015260240160405180910390fd5b3660008037600080366000845af43d6000803e808015609e573d6000f35b3d6000fdfea2646970667358221220b79f8f6179a321aaf1c66c09648d20d42f9f1ba9bcb57508cf4830f74e7f3be364736f6c63430008130033c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f6465c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d4c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465a26469706673582212200484c6b862ae7928ec6f834eb225624d1bb15549a6b650703df9fa02a5fd837264736f6c6343000813003300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000360000000000000000000000000e056f64f06e8d0f7cd2a9501138d3afa0ef3ff32000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000022000000000000000000000000042a60e505b10a569c202ebeddd9b4eb37ae5fe2e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000011f931c1c000000000000000000000000000000000000000000000000000000000000000000000000000000001a3656eb593f256ce636dc616ab247606edc81a5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000005cdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed6270000000000000000000000000000000000000000000000000000000001ffc9a700000000000000000000000000000000000000000000000000000000000000000000000000000000d133845688bea941d9d9e9ab05f26b9d4e5f9e040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000028da5cb5b00000000000000000000000000000000000000000000000000000000f2fde38b0000000000000000000000000000000000000000000000000000000000000000000000000000000088c875606ae309172f89f231df5a9ffb5ad649940000000000000000000000007cf17bc0a7cd40f1cb5fb18bdc1e059f5a204c1f00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004e1c7392a00000000000000000000000000000000000000000000000000000000

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

00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000360000000000000000000000000e056f64f06e8d0f7cd2a9501138d3afa0ef3ff32000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000022000000000000000000000000042a60e505b10a569c202ebeddd9b4eb37ae5fe2e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000011f931c1c000000000000000000000000000000000000000000000000000000000000000000000000000000001a3656eb593f256ce636dc616ab247606edc81a5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000005cdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed6270000000000000000000000000000000000000000000000000000000001ffc9a700000000000000000000000000000000000000000000000000000000000000000000000000000000d133845688bea941d9d9e9ab05f26b9d4e5f9e040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000028da5cb5b00000000000000000000000000000000000000000000000000000000f2fde38b0000000000000000000000000000000000000000000000000000000000000000000000000000000088c875606ae309172f89f231df5a9ffb5ad649940000000000000000000000007cf17bc0a7cd40f1cb5fb18bdc1e059f5a204c1f00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004e1c7392a00000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _facetCuts (tuple[]): System.Object,System.Object,System.Object
Arg [1] : _diamondArgs (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [2] : _facetRegistry (address): 0xe056f64f06e8d0f7cd2a9501138d3afa0ef3ff32

-----Encoded View---------------
32 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000360
Arg [2] : 000000000000000000000000e056f64f06e8d0f7cd2a9501138d3afa0ef3ff32
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [7] : 00000000000000000000000042a60e505b10a569c202ebeddd9b4eb37ae5fe2e
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [11] : 1f931c1c00000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000001a3656eb593f256ce636dc616ab247606edc81a5
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [16] : cdffacc600000000000000000000000000000000000000000000000000000000
Arg [17] : 52ef6b2c00000000000000000000000000000000000000000000000000000000
Arg [18] : adfca15e00000000000000000000000000000000000000000000000000000000
Arg [19] : 7a0ed62700000000000000000000000000000000000000000000000000000000
Arg [20] : 01ffc9a700000000000000000000000000000000000000000000000000000000
Arg [21] : 000000000000000000000000d133845688bea941d9d9e9ab05f26b9d4e5f9e04
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [25] : 8da5cb5b00000000000000000000000000000000000000000000000000000000
Arg [26] : f2fde38b00000000000000000000000000000000000000000000000000000000
Arg [27] : 00000000000000000000000088c875606ae309172f89f231df5a9ffb5ad64994
Arg [28] : 0000000000000000000000007cf17bc0a7cd40f1cb5fb18bdc1e059f5a204c1f
Arg [29] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [30] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [31] : e1c7392a00000000000000000000000000000000000000000000000000000000


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.