Mumbai Testnet

Contract

0x61Bb02795b4fF5248169A54D9f149C4557B0B7de

Overview

MATIC Balance

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Multicall261949802022-05-04 4:34:31748 days ago1651638871IN
0x61Bb0279...557B0B7de
0 MATIC0.000497292.42500001
Multicall261948902022-05-04 4:23:55748 days ago1651638235IN
0x61Bb0279...557B0B7de
0 MATIC0.001989199.7
Multicall261947152022-05-04 4:09:13748 days ago1651637353IN
0x61Bb0279...557B0B7de
0 MATIC0.0074478519.4
Multicall261872992022-05-03 16:05:15748 days ago1651593915IN
0x61Bb0279...557B0B7de
0 MATIC0.000875762.28168251
Multicall261850072022-05-03 12:36:59749 days ago1651581419IN
0x61Bb0279...557B0B7de
0 MATIC0.000845654.12250001
Multicall261672082022-05-02 4:43:18750 days ago1651466598IN
0x61Bb0279...557B0B7de
0 MATIC0.000778071.94
Multicall261618602022-05-01 18:57:58750 days ago1651431478IN
0x61Bb0279...557B0B7de
0 MATIC0.0034130815.99294484
Multicall261370402022-04-29 20:51:09752 days ago1651265469IN
0x61Bb0279...557B0B7de
0 MATIC0.0062875916.37505715
Multicall261355802022-04-29 18:37:54752 days ago1651257474IN
0x61Bb0279...557B0B7de
0 MATIC0.0107490618.818
Multicall261335462022-04-29 15:31:08752 days ago1651246268IN
0x61Bb0279...557B0B7de
0 MATIC0.00193085.02848001
Multicall261334422022-04-29 15:22:23752 days ago1651245743IN
0x61Bb0279...557B0B7de
0 MATIC0.005850657.75999999
Multicall261330882022-04-29 14:47:15752 days ago1651243635IN
0x61Bb0279...557B0B7de
0 MATIC0.0094012712.75873333
Multicall261227632022-04-28 20:37:00753 days ago1651178220IN
0x61Bb0279...557B0B7de
0 MATIC0.00372459.69999999
Multicall261224002022-04-28 19:53:12753 days ago1651175592IN
0x61Bb0279...557B0B7de
0 MATIC0.0074473819.39999999
Multicall261219112022-04-28 18:57:57753 days ago1651172277IN
0x61Bb0279...557B0B7de
0 MATIC0.000943162.35225001
Multicall261199852022-04-28 15:18:33753 days ago1651159113IN
0x61Bb0279...557B0B7de
0 MATIC0.003723699.7
Multicall261154442022-04-28 6:38:59754 days ago1651127939IN
0x61Bb0279...557B0B7de
0 MATIC0.0077788919.39999999
Multicall261093602022-04-27 19:00:11754 days ago1651086011IN
0x61Bb0279...557B0B7de
0 MATIC0.001166862.91000001
Multicall261088662022-04-27 18:03:09754 days ago1651082589IN
0x61Bb0279...557B0B7de
0 MATIC0.0024017211.25329333
Multicall261087592022-04-27 17:53:57754 days ago1651082037IN
0x61Bb0279...557B0B7de
0 MATIC0.002927577.30138399
Multicall261065662022-04-27 13:41:41755 days ago1651066901IN
0x61Bb0279...557B0B7de
0 MATIC0.0160394440
Multicall261062652022-04-27 13:07:22755 days ago1651064842IN
0x61Bb0279...557B0B7de
0 MATIC0.000316091.50074075
Multicall261061372022-04-27 12:54:30755 days ago1651064070IN
0x61Bb0279...557B0B7de
0 MATIC0.00060531.50961968
Multicall260984582022-04-26 22:22:42755 days ago1651011762IN
0x61Bb0279...557B0B7de
0 MATIC0.000575791.50000001
Multicall260977452022-04-26 21:06:05755 days ago1651007165IN
0x61Bb0279...557B0B7de
0 MATIC0.000807841.50000002
View all transactions

Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ByocRegistry

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 14 : ByocRegistry.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;

//  ==========  External imports    ==========
import "./openzeppelin-presets/metatx/ERC2771Context.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Multicall.sol";

//  ==========  Internal imports    ==========
import { IByocRegistry } from "./interfaces/IByocRegistry.sol";

contract ByocRegistry is
    IByocRegistry,
    ERC2771Context,
    AccessControlEnumerable,
    Multicall
{

    using EnumerableSet for EnumerableSet.Bytes32Set;

    /*///////////////////////////////////////////////////////////////
                            State variables
    //////////////////////////////////////////////////////////////*/

    /// @dev The global Id for publicly published contracts.
    uint256 public nextPublicId = 1;

    /// @dev Whether the registry is paused.
    bool public isPaused;

    /*///////////////////////////////////////////////////////////////
                                Mappings
    //////////////////////////////////////////////////////////////*/

    /**
     *  @dev Mapping from publisher address => operator address => whether publisher has approved operator
     *       to publish / unpublish contracts on their behalf.
     */
    mapping(address => mapping(address => bool)) public isApprovedByPublisher;

    /// @dev Mapping from public Id => publicly published contract.
    mapping(uint256 => PublicContract) private publicContracts;

    /// @dev Mapping from publisher address => set of published contracts.
    mapping(address => CustomContractSet) private contractsOfPublisher;

    /*///////////////////////////////////////////////////////////////
                    Constructor + modifiers
    //////////////////////////////////////////////////////////////*/

    /// @dev Checks whether caller is publisher or approved by publisher.
    modifier onlyApprovedOrPublisher(address _publisher) {
        require(_msgSender() == _publisher || isApprovedByPublisher[_publisher][_msgSender()], "unapproved caller");

        _;
    }

    /// @dev Checks whether contract is unpaused or the caller is a contract admin.
    modifier onlyUnpausedOrAdmin() {
        require(!isPaused || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "registry paused");

        _;
    }

    constructor(address[] memory _trustedForwarders) ERC2771Context(_trustedForwarders) {
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    }

    /*///////////////////////////////////////////////////////////////
                            Getter logic
    //////////////////////////////////////////////////////////////*/

    /// @notice Returns the latest version of all contracts published by a publisher.
    function getAllPublicPublishedContracts() external view returns (CustomContractInstance[] memory published) {
        
        uint256 net;

        for(uint256 i = 0; i < nextPublicId; i += 1) {
            PublicContract memory publicContract = publicContracts[i];
            if(publicContract.publisher != address(0)) {
                net += 1;
            }
        }
        
        published = new CustomContractInstance[](net);

        for(uint256 i = 0; i < net; i += 1) {
            PublicContract memory publicContract = publicContracts[i];
            if(publicContract.publisher != address(0)) {
                published[i] = contractsOfPublisher[publicContract.publisher].contracts[keccak256(bytes(publicContract.contractId))].latest;
            }
        }
    }

    /// @notice Returns the latest version of all contracts published by a publisher.
    function getAllPublishedContracts(address _publisher) external view returns (CustomContractInstance[] memory published) {
        uint256 total = EnumerableSet.length(contractsOfPublisher[_publisher].contractIds);

        published = new CustomContractInstance[](total);

        for(uint256 i = 0; i < total; i += 1) {
            bytes32 contractId = EnumerableSet.at(contractsOfPublisher[_publisher].contractIds, i);
            published[i] = contractsOfPublisher[_publisher].contracts[contractId].latest;
        }
    }

    /// @notice Returns all versions of a published contract.
    function getPublishedContractVersions(address _publisher, string memory _contractId)
        external
        view
        returns (CustomContractInstance[] memory published) 
    {
        
        bytes32 id = keccak256(bytes(_contractId));
        uint256 total = contractsOfPublisher[_publisher].contracts[id].total;

        published = new CustomContractInstance[](total);

        for(uint256 i = 0; i < total; i += 1) {
            published[i] = contractsOfPublisher[_publisher].contracts[id].instances[i];
        }
    }

   /// @notice Returns the latest version of a contract published by a publisher.
    function getPublishedContract(address _publisher, string memory _contractId)
        external
        view
        returns (CustomContractInstance memory published)
    {
        published = contractsOfPublisher[_publisher].contracts[keccak256(bytes(_contractId))].latest;
    }

    /// @notice Returns the public id of a published contract, if it is public.
    function getPublicId(address _publisher, string memory _contractId) external view returns(uint256 publicId) {
        bytes32 contractIdInBytes = keccak256(bytes(_contractId));
        publicId = contractsOfPublisher[_publisher].contracts[contractIdInBytes].publicId;
    }

    /*///////////////////////////////////////////////////////////////
                            Publish logic
    //////////////////////////////////////////////////////////////*/

    /// @notice Lets a publisher (caller) approve an operator to publish / unpublish contracts on their behalf.
    function approveOperator(address _operator, bool _toApprove) external {
        isApprovedByPublisher[_msgSender()][_operator] = _toApprove;
        emit Approved(_msgSender(), _operator, _toApprove);
    }

    /// @notice Let's an account publish a contract. The account must be approved by the publisher, or be the publisher.
    function publishContract(
        address _publisher,
        string memory _publishMetadataUri,
        bytes32 _bytecodeHash,
        address _implementation,
        string memory _contractId
    ) 
        external
        onlyApprovedOrPublisher(_publisher)
        onlyUnpausedOrAdmin
    {

        CustomContractInstance memory publishedContract = CustomContractInstance({
            contractId: _contractId,
            publishTimestamp: block.timestamp,

            publishMetadataUri: _publishMetadataUri,
            bytecodeHash: _bytecodeHash,
            implementation: _implementation
        });

        bytes32 contractIdInBytes = keccak256(bytes(_contractId));
        EnumerableSet.add(contractsOfPublisher[_publisher].contractIds, contractIdInBytes);

        contractsOfPublisher[_publisher].contracts[contractIdInBytes].latest = publishedContract;

        uint256 index = contractsOfPublisher[_publisher].contracts[contractIdInBytes].total;
        contractsOfPublisher[_publisher].contracts[contractIdInBytes].total += 1;

        contractsOfPublisher[_publisher].contracts[contractIdInBytes].instances[index] = publishedContract;

        emit ContractPublished(_msgSender(), _publisher, publishedContract);
    }

    /// @notice Lets an account unpublish a contract and all its versions. The account must be approved by the publisher, or be the publisher.
    function unpublishContract(address _publisher, string memory _contractId) external onlyApprovedOrPublisher(_publisher) onlyUnpausedOrAdmin {

        bytes32 contractIdInBytes = keccak256(bytes(_contractId));
        
        bool removed = EnumerableSet.remove(contractsOfPublisher[_publisher].contractIds, contractIdInBytes);
        require(removed, "given contractId DNE");

        delete contractsOfPublisher[_publisher].contracts[contractIdInBytes];

        emit ContractUnpublished(_msgSender(), _publisher, _contractId);
    }

    /// @notice Lets an account add a published contract (and all its versions). The account must be approved by the publisher, or be the publisher.
    function addToPublicList(address _publisher, string memory _contractId) external {
        uint256 publicId = nextPublicId;
        nextPublicId += 1;

        bytes32 contractIdInBytes = keccak256(bytes(_contractId));

        PublicContract memory publicContract = PublicContract({
            publisher: _publisher,
            contractId: _contractId
        });

        contractsOfPublisher[_publisher].contracts[contractIdInBytes].publicId = publicId;
        publicContracts[publicId] = publicContract;

        emit AddedContractToPublicList(_publisher, _contractId);
    }
    
    /// @notice Lets an account remove a published contract (and all its versions). The account must be approved by the publisher, or be the publisher.
    function removeFromPublicList(address _publisher, string memory _contractId) external {

        bytes32 contractIdInBytes = keccak256(bytes(_contractId));
        uint256 publicId = contractsOfPublisher[_publisher].contracts[contractIdInBytes].publicId;

        delete contractsOfPublisher[_publisher].contracts[contractIdInBytes].publicId;

        delete publicContracts[publicId];
        
        emit RemovedContractToPublicList(_publisher, _contractId);
    }

    /*///////////////////////////////////////////////////////////////
                            Miscellaneous 
    //////////////////////////////////////////////////////////////*/

    /// @dev Lets a contract admin pause the registry.
    function setPause(bool _pause) external {
        require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "unapproved caller");
        isPaused = _pause;
        emit Paused(_pause); 
    }

    function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address sender) {
        return ERC2771Context._msgSender();
    }

    function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) {
        return ERC2771Context._msgData();
    }
}

File 2 of 14 : ERC2771Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (metatx/ERC2771Context.sol)

pragma solidity ^0.8.11;

import "@openzeppelin/contracts/utils/Context.sol";

/**
 * @dev Context variant with ERC2771 support.
 */
abstract contract ERC2771Context is Context {
    mapping(address => bool) private _trustedForwarder;

    constructor(address[] memory trustedForwarder) {
        for (uint256 i = 0; i < trustedForwarder.length; i++) {
            _trustedForwarder[trustedForwarder[i]] = true;
        }
    }

    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
        return _trustedForwarder[forwarder];
    }

    function _msgSender() internal view virtual override returns (address sender) {
        if (isTrustedForwarder(msg.sender)) {
            // The assembly code is more direct than the Solidity version using `abi.decode`.
            assembly {
                sender := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return super._msgSender();
        }
    }

    function _msgData() internal view virtual override returns (bytes calldata) {
        if (isTrustedForwarder(msg.sender)) {
            return msg.data[:msg.data.length - 20];
        } else {
            return super._msgData();
        }
    }
}

File 2 of 14 : AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

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

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}

File 2 of 14 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 2 of 14 : Multicall.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)

pragma solidity ^0.8.0;

import "./Address.sol";

/**
 * @dev Provides a function to batch together multiple calls in a single external call.
 *
 * _Available since v4.1._
 */
abstract contract Multicall {
    /**
     * @dev Receives and executes a batch of function calls on this contract.
     */
    function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            results[i] = Address.functionDelegateCall(address(this), data[i]);
        }
        return results;
    }
}

File 2 of 14 : IByocRegistry.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

interface IByocRegistry {
    
    struct CustomContractInstance {  
        string contractId;
        uint256 publishTimestamp;
        
        string publishMetadataUri;
        bytes32 bytecodeHash;
        address implementation;
    }

    struct CustomContract {
        
        uint256 publicId;
        uint256 total;
        CustomContractInstance latest;
        
        mapping(uint256 => CustomContractInstance) instances;
    }

    struct CustomContractSet {
        EnumerableSet.Bytes32Set contractIds;
        mapping(bytes32 => CustomContract) contracts;
    }

    struct PublicContract {
        address publisher;
        string contractId;
    }

    /// @dev Emitted when the registry is paused.
    event Paused(bool isPaused);

    /// @dev Emitted when a publisher's approval of an operator is updated.
    event Approved(address indexed publisher, address indexed operator, bool isApproved);

    /// @dev Emitted when a contract is published.
    event ContractPublished(
        address indexed operator,
        address indexed publisher,
        CustomContractInstance publishedContract
    );

    /// @dev Emitted when a contract is unpublished.
    event ContractUnpublished(address indexed operator, address indexed publisher, string indexed contractId);

    /// @dev Emitted when a published contract is added to the public list.
    event AddedContractToPublicList(address indexed publisher, string indexed contractId);

    /// @dev Emitted when a published contract is removed from the public list.
    event RemovedContractToPublicList(address indexed publisher, string indexed contractId);

    /**
     *  @notice Returns whether a publisher has approved an operator to publish / unpublish contracts on their behalf.
     *
     *  @param publisher The address of the publisher.
     *  @param operator  The address of the operator who publishes/unpublishes on behalf of the publisher.
     *
     *  @return isApproved Whether the publisher has approved the operator to publish / unpublish contracts on their behalf.
     */
    function isApprovedByPublisher(address publisher, address operator) external view returns (bool isApproved);

    /**
     *  @notice Lets a publisher (caller) approve an operator to publish / unpublish contracts on their behalf.
     *
     *  @param operator  The address of the operator who publishes/unpublishes on behalf of the publisher.
     *  @param toApprove whether to an operator to publish / unpublish contracts on the publisher's behalf.
     */
    function approveOperator(address operator, bool toApprove) external;

    /**
     *  @notice Returns the latest version of all contracts published by a publisher.
     *
     *  @return published An array of all contracts published by the publisher.
     */
    function getAllPublicPublishedContracts() external view returns (CustomContractInstance[] memory published);

    /**
     *  @notice Returns the latest version of all contracts published by a publisher.
     *
     *  @param publisher  The address of the publisher.
     *
     *  @return published An array of all contracts published by the publisher.
     */
    function getAllPublishedContracts(address publisher) external view returns (CustomContractInstance[] memory published);

    /**
     *  @notice Returns all versions of a published contract.
     *
     *  @param publisher  The address of the publisher.
     *  @param contractId The identifier for a published contract (that can have multiple verisons).
     *
     *  @return published The desired contracts published by the publisher.
     */
    function getPublishedContractVersions(address publisher, string memory contractId)
        external
        view
        returns (CustomContractInstance[] memory published);

    /**
     *  @notice Returns the latest version of a contract published by a publisher.
     *
     *  @param publisher  The address of the publisher.
     *  @param contractId The identifier for a published contract (that can have multiple verisons).
     *
     *  @return published The desired contract published by the publisher.
     */
    function getPublishedContract(address publisher, string memory contractId)
        external
        view
        returns (CustomContractInstance memory published);
    
    /**
     *  @notice Returns the public id of a published contract, if it is public.
     *
     *  @param publisher  The address of the publisher.
     *  @param contractId The identifier for a published contract (that can have multiple verisons).
     *
     *  @return publicId the public id of a published contract.
     */
    function getPublicId(address publisher, string memory contractId) external returns(uint256 publicId);

    /**
     *  @notice Let's an account publish a contract. The account must be approved by the publisher, or be the publisher.
     *
     *  @param publisher          The address of the publisher.
     *  @param publishMetadataUri The IPFS URI of the publish metadata.
     *  @param bytecodeHash       The keccak256 hash of the contract bytecode.
     *  @param implementation     (Optional) An implementation address that proxy contracts / clones can point to. Default value
     *                            if such an implementation does not exist - address(0);
     *  @param  contractId        The identifier for a published contract (that can have multiple verisons).
     *
     */
    function publishContract(
        address publisher,
        string memory publishMetadataUri,
        bytes32 bytecodeHash,
        address implementation,
        string memory contractId
    ) external;

    /**
     *  @notice Lets an account unpublish a contract and all its versions. The account must be approved by the publisher, or be the publisher.
     *
     *  @param publisher  The address of the publisher.
     *  @param contractId The identifier for a published contract (that can have multiple verisons).
     */
    function unpublishContract(address publisher, string memory contractId) external;

    /**
     *  @notice Lets an account add a published contract (and all its versions). The account must be approved by the publisher, or be the publisher.
     *
     *  @param publisher  The address of the publisher.
     *  @param contractId The identifier for a published contract (that can have multiple verisons).
     */
    function addToPublicList(address publisher, string memory contractId) external;
    
    /**
     *  @notice Lets an account remove a published contract (and all its versions). The account must be approved by the publisher, or be the publisher.
     *
     *  @param publisher  The address of the publisher.
     *  @param contractId The identifier for a published contract (that can have multiple verisons).
     */
    function removeFromPublicList(address publisher, string memory contractId) external;
}

File 2 of 14 : 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 2 of 14 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 2 of 14 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 2 of 14 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 2 of 14 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 2 of 14 : 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 2 of 14 : 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 2 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, "Address: low-level call failed");
    }

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address[]","name":"_trustedForwarders","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"publisher","type":"address"},{"indexed":true,"internalType":"string","name":"contractId","type":"string"}],"name":"AddedContractToPublicList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"publisher","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"isApproved","type":"bool"}],"name":"Approved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"publisher","type":"address"},{"components":[{"internalType":"string","name":"contractId","type":"string"},{"internalType":"uint256","name":"publishTimestamp","type":"uint256"},{"internalType":"string","name":"publishMetadataUri","type":"string"},{"internalType":"bytes32","name":"bytecodeHash","type":"bytes32"},{"internalType":"address","name":"implementation","type":"address"}],"indexed":false,"internalType":"struct IByocRegistry.CustomContractInstance","name":"publishedContract","type":"tuple"}],"name":"ContractPublished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"publisher","type":"address"},{"indexed":true,"internalType":"string","name":"contractId","type":"string"}],"name":"ContractUnpublished","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"publisher","type":"address"},{"indexed":true,"internalType":"string","name":"contractId","type":"string"}],"name":"RemovedContractToPublicList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"},{"internalType":"string","name":"_contractId","type":"string"}],"name":"addToPublicList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_toApprove","type":"bool"}],"name":"approveOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllPublicPublishedContracts","outputs":[{"components":[{"internalType":"string","name":"contractId","type":"string"},{"internalType":"uint256","name":"publishTimestamp","type":"uint256"},{"internalType":"string","name":"publishMetadataUri","type":"string"},{"internalType":"bytes32","name":"bytecodeHash","type":"bytes32"},{"internalType":"address","name":"implementation","type":"address"}],"internalType":"struct IByocRegistry.CustomContractInstance[]","name":"published","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"}],"name":"getAllPublishedContracts","outputs":[{"components":[{"internalType":"string","name":"contractId","type":"string"},{"internalType":"uint256","name":"publishTimestamp","type":"uint256"},{"internalType":"string","name":"publishMetadataUri","type":"string"},{"internalType":"bytes32","name":"bytecodeHash","type":"bytes32"},{"internalType":"address","name":"implementation","type":"address"}],"internalType":"struct IByocRegistry.CustomContractInstance[]","name":"published","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"},{"internalType":"string","name":"_contractId","type":"string"}],"name":"getPublicId","outputs":[{"internalType":"uint256","name":"publicId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"},{"internalType":"string","name":"_contractId","type":"string"}],"name":"getPublishedContract","outputs":[{"components":[{"internalType":"string","name":"contractId","type":"string"},{"internalType":"uint256","name":"publishTimestamp","type":"uint256"},{"internalType":"string","name":"publishMetadataUri","type":"string"},{"internalType":"bytes32","name":"bytecodeHash","type":"bytes32"},{"internalType":"address","name":"implementation","type":"address"}],"internalType":"struct IByocRegistry.CustomContractInstance","name":"published","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"},{"internalType":"string","name":"_contractId","type":"string"}],"name":"getPublishedContractVersions","outputs":[{"components":[{"internalType":"string","name":"contractId","type":"string"},{"internalType":"uint256","name":"publishTimestamp","type":"uint256"},{"internalType":"string","name":"publishMetadataUri","type":"string"},{"internalType":"bytes32","name":"bytecodeHash","type":"bytes32"},{"internalType":"address","name":"implementation","type":"address"}],"internalType":"struct IByocRegistry.CustomContractInstance[]","name":"published","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedByPublisher","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextPublicId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"},{"internalType":"string","name":"_publishMetadataUri","type":"string"},{"internalType":"bytes32","name":"_bytecodeHash","type":"bytes32"},{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"string","name":"_contractId","type":"string"}],"name":"publishContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"},{"internalType":"string","name":"_contractId","type":"string"}],"name":"removeFromPublicList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_pause","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_publisher","type":"address"},{"internalType":"string","name":"_contractId","type":"string"}],"name":"unpublishContract","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260016003553480156200001657600080fd5b5060405162002c7f38038062002c7f8339810160408190526200003991620002c2565b8060005b8151811015620000a857600160008084848151811062000061576200006162000394565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806200009f81620003aa565b9150506200003d565b50620000c190506000620000bb620000c8565b620000e4565b50620003d4565b6000620000df620000f460201b620019981760201c565b905090565b620000f082826200012f565b5050565b3360009081526020819052604081205460ff16156200011a575060131936013560601c90565b620000df6200017260201b620019c71760201c565b6200014682826200017660201b620019cb1760201c565b60008281526002602090815260409091206200016d91839062001a6f6200021d821b17901c565b505050565b3390565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16620000f05760008281526001602081815260408084206001600160a01b0386168552909152909120805460ff19169091179055620001d9620000c8565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000234836001600160a01b0384166200023d565b90505b92915050565b6000818152600183016020526040812054620002865750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000237565b50600062000237565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620002bd57600080fd5b919050565b60006020808385031215620002d657600080fd5b82516001600160401b0380821115620002ee57600080fd5b818501915085601f8301126200030357600080fd5b8151818111156200031857620003186200028f565b8060051b604051601f19603f830116810181811085821117156200034057620003406200028f565b6040529182528482019250838101850191888311156200035f57600080fd5b938501935b8285101562000388576200037885620002a5565b8452938501939285019262000364565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415620003cd57634e487b7160e01b600052601160045260246000fd5b5060010190565b61289b80620003e46000396000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80639010d07c116100ee578063af8db69011610097578063bedb86fb11610071578063bedb86fb1461040c578063ca15c8731461041f578063d547741f14610432578063ed4b98ff1461044557600080fd5b8063af8db690146103e4578063b187bd26146103f7578063baee20211461040457600080fd5b8063a2620c89116100c8578063a2620c89146103a8578063a5d28bda146103b1578063ac9650d8146103c457600080fd5b80639010d07c1461033c57806391d1485414610367578063a217fddf146103a057600080fd5b80632f2ff15d116101505780637468a5d01161012a5780637468a5d0146102ce5780637ec047fa146102fc57806380251dac1461031c57600080fd5b80632f2ff15d1461027c57806336568abe1461028f578063572b6c05146102a257600080fd5b8063248a9ca311610181578063248a9ca3146101f85780632866e4b21461022a57806329b35ab61461026957600080fd5b806301ffc9a7146101a857806306eb56cc146101d057806309e5d614146101e5575b600080fd5b6101bb6101b63660046121a8565b610458565b60405190151581526020015b60405180910390f35b6101e36101de366004612291565b610483565b005b6101e36101f33660046122df565b6106d9565b61021c61020636600461236e565b6000908152600160208190526040909120015490565b6040519081526020016101c7565b61021c610238366004612291565b80516020918201206001600160a01b0390921660009081526007825260408082209382526002909301909152205490565b6101e3610277366004612397565b6109e0565b6101e361028a3660046123ca565b610a79565b6101e361029d3660046123ca565b610aac565b6101bb6102b03660046123ed565b6001600160a01b031660009081526020819052604090205460ff1690565b6101bb6102dc366004612408565b600560209081526000928352604080842090915290825290205460ff1681565b61030f61030a366004612291565b610b48565b6040516101c791906124f0565b61032f61032a366004612291565b610cfe565b6040516101c79190612503565b61034f61034a366004612565565b610f77565b6040516001600160a01b0390911681526020016101c7565b6101bb6103753660046123ca565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61021c600081565b61021c60035481565b6101e36103bf366004612291565b610f96565b6103d76103d2366004612587565b611044565b6040516101c791906125fc565b61032f6103f23660046123ed565b611139565b6004546101bb9060ff1681565b61032f6113c0565b6101e361041a366004612651565b6117da565b61021c61042d36600461236e565b61186e565b6101e36104403660046123ca565b611885565b6101e3610453366004612291565b6118ae565b60006001600160e01b03198216635a05180f60e01b148061047d575061047d82611a84565b92915050565b81806001600160a01b0316610496611ab9565b6001600160a01b031614806104e557506001600160a01b0381166000908152600560205260408120906104c7611ab9565b6001600160a01b0316815260208101919091526040016000205460ff165b61052a5760405162461bcd60e51b81526020600482015260116024820152703ab730b8383937bb32b21031b0b63632b960791b60448201526064015b60405180910390fd5b60045460ff16158061054457506105446000610375611ab9565b6105825760405162461bcd60e51b815260206004820152600f60248201526e1c9959da5cdd1c9e481c185d5cd959608a1b6044820152606401610521565b81516020808401919091206001600160a01b03851660009081526007909252604082209091906105b29083611ac3565b9050806106015760405162461bcd60e51b815260206004820152601460248201527f676976656e20636f6e7472616374496420444e450000000000000000000000006044820152606401610521565b6001600160a01b03851660009081526007602090815260408083208584526002908101909252822082815560018101839055919082018161064282826120d2565b600182016000905560028201600061065a91906120d2565b506000600382015560040180546001600160a01b0319169055505060405161068390859061266c565b6040518091039020856001600160a01b031661069d611ab9565b6001600160a01b03167f4c934c8014c81bef7c9b5296daec96b8a63f02365b7dd6eb15ff0f231728a8d560405160405180910390a45050505050565b84806001600160a01b03166106ec611ab9565b6001600160a01b0316148061073b57506001600160a01b03811660009081526005602052604081209061071d611ab9565b6001600160a01b0316815260208101919091526040016000205460ff165b61077b5760405162461bcd60e51b81526020600482015260116024820152703ab730b8383937bb32b21031b0b63632b960791b6044820152606401610521565b60045460ff16158061079557506107956000610375611ab9565b6107d35760405162461bcd60e51b815260206004820152600f60248201526e1c9959da5cdd1c9e481c185d5cd959608a1b6044820152606401610521565b6040805160a08101825283815242602080830191909152818301889052606082018790526001600160a01b038087166080840152855182870120908a166000908152600790925292902090919061082a9082611acf565b506001600160a01b0388166000908152600760209081526040808320848452600290810183529220845180518694929092019261086c9284929091019061210f565b5060208281015160018301556040830151805161088f926002850192019061210f565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0392831617905588166000908152600760209081526040808320848452600201909152812060019081018054926108ef838561269e565b90915550506001600160a01b038916600090815260076020818152604080842086855260020182528084208585529092018152912084518051869361093892849291019061210f565b5060208281015160018301556040830151805161095b926002850192019061210f565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b039283161790558916610995611ab9565b6001600160a01b03167f4c0484c23e4ea73b4cb562e1868ba93ccba2c9151ac4148fa1b91d9cb17b4581856040516109cd91906124f0565b60405180910390a3505050505050505050565b80600560006109ed611ab9565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610a31611ab9565b6001600160a01b03167f1299be4ab334acdc5747f03ba508209acf422601c7ee3040dc8ff385b0aca98983604051610a6d911515815260200190565b60405180910390a35050565b60008281526001602081905260409091200154610a9d81610a98611ab9565b611adb565b610aa78383611b5b565b505050565b610ab4611ab9565b6001600160a01b0316816001600160a01b031614610b3a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610521565b610b448282611b7d565b5050565b6040805160a0810182526060808252600060208301819052928201819052810182905260808101919091526001600160a01b03831660009081526007602090815260408083208551868401208452600290810190925291829020825160a0810190935201805482908290610bbb906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610be7906126b6565b8015610c345780601f10610c0957610100808354040283529160200191610c34565b820191906000526020600020905b815481529060010190602001808311610c1757829003601f168201915b5050505050815260200160018201548152602001600282018054610c57906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610c83906126b6565b8015610cd05780601f10610ca557610100808354040283529160200191610cd0565b820191906000526020600020905b815481529060010190602001808311610cb357829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b03166040909101529392505050565b80516020808301919091206001600160a01b03841660009081526007835260408082208383526002019093529190912060010154606091908067ffffffffffffffff811115610d4f57610d4f6121ee565b604051908082528060200260200182016040528015610da957816020015b6040805160a08101825260608082526000602080840182905293830182905290820181905260808201528252600019909201910181610d6d5790505b50925060005b81811015610f6e576001600160a01b03861660009081526007602081815260408084208785526002018252808420858552909201905290819020815160a08101909252805482908290610e01906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2d906126b6565b8015610e7a5780601f10610e4f57610100808354040283529160200191610e7a565b820191906000526020600020905b815481529060010190602001808311610e5d57829003601f168201915b5050505050815260200160018201548152602001600282018054610e9d906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec9906126b6565b8015610f165780601f10610eeb57610100808354040283529160200191610f16565b820191906000526020600020905b815481529060010190602001808311610ef957829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b03166040909101528451859083908110610f5157610f516126f1565b6020908102919091010152610f6760018261269e565b9050610daf565b50505092915050565b6000828152600260205260408120610f8f9083611b9f565b9392505050565b80516020808301919091206001600160a01b038416600090815260078352604080822083835260020184528082208054908390558083526006909452812080546001600160a01b031916815591929190610ff360018301826120d2565b505082604051611003919061266c565b604051908190038120906001600160a01b038616907fa6dc3dd821b921fabed8dda809ab13ff41ade49a18cdb6510f95ac6a324fffab90600090a350505050565b60608167ffffffffffffffff81111561105f5761105f6121ee565b60405190808252806020026020018201604052801561109257816020015b606081526020019060019003908161107d5790505b50905060005b8281101561113257611102308585848181106110b6576110b66126f1565b90506020028101906110c89190612707565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611bab92505050565b828281518110611114576111146126f1565b6020026020010181905250808061112a90612755565b915050611098565b5092915050565b6001600160a01b03811660009081526007602052604081206060919061115e90611bd0565b90508067ffffffffffffffff811115611179576111796121ee565b6040519080825280602002602001820160405280156111d357816020015b6040805160a081018252606080825260006020808401829052938301829052908201819052608082015282526000199092019101816111975790505b50915060005b818110156113b9576001600160a01b03841660009081526007602052604081206112039083611b9f565b6001600160a01b0386166000908152600760209081526040808320848452600290810190925291829020825160a0810190935201805492935090918290829061124b906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611277906126b6565b80156112c45780601f10611299576101008083540402835291602001916112c4565b820191906000526020600020905b8154815290600101906020018083116112a757829003601f168201915b50505050508152602001600182015481526020016002820180546112e7906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611313906126b6565b80156113605780601f1061133557610100808354040283529160200191611360565b820191906000526020600020905b81548152906001019060200180831161134357829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b0316604090910152845185908490811061139b5761139b6126f1565b6020908102919091010152506113b260018261269e565b90506111d9565b5050919050565b60606000805b6003548110156114c4576000818152600660209081526040808320815180830190925280546001600160a01b03168252600181018054929391929184019161140d906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611439906126b6565b80156114865780601f1061145b57610100808354040283529160200191611486565b820191906000526020600020905b81548152906001019060200180831161146957829003601f168201915b5050509190925250508151919250506001600160a01b0316156114b1576114ae60018461269e565b92505b506114bd60018261269e565b90506113c6565b508067ffffffffffffffff8111156114de576114de6121ee565b60405190808252806020026020018201604052801561153857816020015b6040805160a081018252606080825260006020808401829052938301829052908201819052608082015282526000199092019101816114fc5790505b50915060005b818110156117d5576000818152600660209081526040808320815180830190925280546001600160a01b031682526001810180549293919291840191611583906126b6565b80601f01602080910402602001604051908101604052809291908181526020018280546115af906126b6565b80156115fc5780601f106115d1576101008083540402835291602001916115fc565b820191906000526020600020905b8154815290600101906020018083116115df57829003601f168201915b5050509190925250508151919250506001600160a01b0316156117c25780516001600160a01b03166000908152600760209081526040808320828501518051908401208452600290810190925291829020825160a0810190935201805482908290611666906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611692906126b6565b80156116df5780601f106116b4576101008083540402835291602001916116df565b820191906000526020600020905b8154815290600101906020018083116116c257829003601f168201915b5050505050815260200160018201548152602001600282018054611702906126b6565b80601f016020809104026020016040519081016040528092919081815260200182805461172e906126b6565b801561177b5780601f106117505761010080835404028352916020019161177b565b820191906000526020600020905b81548152906001019060200180831161175e57829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b031660409091015284518590849081106117b6576117b66126f1565b60200260200101819052505b506117ce60018261269e565b905061153e565b505090565b6117e76000610375611ab9565b6118275760405162461bcd60e51b81526020600482015260116024820152703ab730b8383937bb32b21031b0b63632b960791b6044820152606401610521565b6004805460ff19168215159081179091556040519081527f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd29060200160405180910390a150565b600081815260026020526040812061047d90611bd0565b600082815260016020819052604090912001546118a481610a98611ab9565b610aa78383611b7d565b600380549060019060006118c2838561269e565b909155505081516020808401919091206040805180820182526001600160a01b03878116808352828601888152600091825260078752848220868352600201875284822088905587825260068752939020825181546001600160a01b0319169216919091178155915180519394919384939261194592600185019291019061210f565b50506040516119569150859061266c565b604051908190038120906001600160a01b038716907f67c52f1a5ffa258663904eb8850e0dc217b6532579cd12cc3e3c9d167ff68d1190600090a35050505050565b3360009081526020819052604081205460ff16156119bd575060131936013560601c90565b503390565b905090565b3390565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16610b445760008281526001602081815260408084206001600160a01b0386168552909152909120805460ff19169091179055611a2b611ab9565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f8f836001600160a01b038416611bda565b60006001600160e01b03198216637965db0b60e01b148061047d57506301ffc9a760e01b6001600160e01b031983161461047d565b60006119c2611998565b6000610f8f8383611c29565b6000610f8f8383611bda565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16610b4457611b19816001600160a01b03166014611d1c565b611b24836020611d1c565b604051602001611b35929190612770565b60408051601f198184030181529082905262461bcd60e51b8252610521916004016127f1565b611b6582826119cb565b6000828152600260205260409020610aa79082611a6f565b611b878282611ec5565b6000828152600260205260409020610aa79082611f66565b6000610f8f8383611f7b565b6060610f8f838360405180606001604052806027815260200161286860279139611fa5565b600061047d825490565b6000818152600183016020526040812054611c215750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561047d565b50600061047d565b60008181526001830160205260408120548015611d12576000611c4d600183612804565b8554909150600090611c6190600190612804565b9050818114611cc6576000866000018281548110611c8157611c816126f1565b9060005260206000200154905080876000018481548110611ca457611ca46126f1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611cd757611cd761281b565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061047d565b600091505061047d565b60606000611d2b836002612831565b611d3690600261269e565b67ffffffffffffffff811115611d4e57611d4e6121ee565b6040519080825280601f01601f191660200182016040528015611d78576020820181803683370190505b509050600360fc1b81600081518110611d9357611d936126f1565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611dc257611dc26126f1565b60200101906001600160f81b031916908160001a9053506000611de6846002612831565b611df190600161269e565b90505b6001811115611e76577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611e3257611e326126f1565b1a60f81b828281518110611e4857611e486126f1565b60200101906001600160f81b031916908160001a90535060049490941c93611e6f81612850565b9050611df4565b508315610f8f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610521565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff1615610b445760008281526001602090815260408083206001600160a01b03851684529091529020805460ff19169055611f22611ab9565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000610f8f836001600160a01b038416611c29565b6000826000018281548110611f9257611f926126f1565b9060005260206000200154905092915050565b60606001600160a01b0384163b6120245760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610521565b600080856001600160a01b03168560405161203f919061266c565b600060405180830381855af49150503d806000811461207a576040519150601f19603f3d011682016040523d82523d6000602084013e61207f565b606091505b509150915061208f828286612099565b9695505050505050565b606083156120a8575081610f8f565b8251156120b85782518084602001fd5b8160405162461bcd60e51b815260040161052191906127f1565b5080546120de906126b6565b6000825580601f106120ee575050565b601f01602090049060005260206000209081019061210c9190612193565b50565b82805461211b906126b6565b90600052602060002090601f01602090048101928261213d5760008555612183565b82601f1061215657805160ff1916838001178555612183565b82800160010185558215612183579182015b82811115612183578251825591602001919060010190612168565b5061218f929150612193565b5090565b5b8082111561218f5760008155600101612194565b6000602082840312156121ba57600080fd5b81356001600160e01b031981168114610f8f57600080fd5b80356001600160a01b03811681146121e957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261221557600080fd5b813567ffffffffffffffff80821115612230576122306121ee565b604051601f8301601f19908116603f01168101908282118183101715612258576122586121ee565b8160405283815286602085880101111561227157600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156122a457600080fd5b6122ad836121d2565b9150602083013567ffffffffffffffff8111156122c957600080fd5b6122d585828601612204565b9150509250929050565b600080600080600060a086880312156122f757600080fd5b612300866121d2565b9450602086013567ffffffffffffffff8082111561231d57600080fd5b61232989838a01612204565b95506040880135945061233e606089016121d2565b9350608088013591508082111561235457600080fd5b5061236188828901612204565b9150509295509295909350565b60006020828403121561238057600080fd5b5035919050565b803580151581146121e957600080fd5b600080604083850312156123aa57600080fd5b6123b3836121d2565b91506123c160208401612387565b90509250929050565b600080604083850312156123dd57600080fd5b823591506123c1602084016121d2565b6000602082840312156123ff57600080fd5b610f8f826121d2565b6000806040838503121561241b57600080fd5b612424836121d2565b91506123c1602084016121d2565b60005b8381101561244d578181015183820152602001612435565b8381111561245c576000848401525b50505050565b6000815180845261247a816020860160208601612432565b601f01601f19169290920160200192915050565b6000815160a084526124a360a0850182612462565b905060208301516020850152604083015184820360408601526124c68282612462565b915050606083015160608501526001600160a01b0360808401511660808501528091505092915050565b602081526000610f8f602083018461248e565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561255857603f1988860301845261254685835161248e565b9450928501929085019060010161252a565b5092979650505050505050565b6000806040838503121561257857600080fd5b50508035926020909101359150565b6000806020838503121561259a57600080fd5b823567ffffffffffffffff808211156125b257600080fd5b818501915085601f8301126125c657600080fd5b8135818111156125d557600080fd5b8660208260051b85010111156125ea57600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561255857603f1988860301845261263f858351612462565b94509285019290850190600101612623565b60006020828403121561266357600080fd5b610f8f82612387565b6000825161267e818460208701612432565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600082198211156126b1576126b1612688565b500190565b600181811c908216806126ca57607f821691505b602082108114156126eb57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261271e57600080fd5b83018035915067ffffffffffffffff82111561273957600080fd5b60200191503681900382131561274e57600080fd5b9250929050565b600060001982141561276957612769612688565b5060010190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516127a8816017850160208801612432565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516127e5816028840160208801612432565b01602801949350505050565b602081526000610f8f6020830184612462565b60008282101561281657612816612688565b500390565b634e487b7160e01b600052603160045260246000fd5b600081600019048311821515161561284b5761284b612688565b500290565b60008161285f5761285f612688565b50600019019056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c634300080c000a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c82bbe41f2cf04e3a8efa18f7032bdd7f6d98a81

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80639010d07c116100ee578063af8db69011610097578063bedb86fb11610071578063bedb86fb1461040c578063ca15c8731461041f578063d547741f14610432578063ed4b98ff1461044557600080fd5b8063af8db690146103e4578063b187bd26146103f7578063baee20211461040457600080fd5b8063a2620c89116100c8578063a2620c89146103a8578063a5d28bda146103b1578063ac9650d8146103c457600080fd5b80639010d07c1461033c57806391d1485414610367578063a217fddf146103a057600080fd5b80632f2ff15d116101505780637468a5d01161012a5780637468a5d0146102ce5780637ec047fa146102fc57806380251dac1461031c57600080fd5b80632f2ff15d1461027c57806336568abe1461028f578063572b6c05146102a257600080fd5b8063248a9ca311610181578063248a9ca3146101f85780632866e4b21461022a57806329b35ab61461026957600080fd5b806301ffc9a7146101a857806306eb56cc146101d057806309e5d614146101e5575b600080fd5b6101bb6101b63660046121a8565b610458565b60405190151581526020015b60405180910390f35b6101e36101de366004612291565b610483565b005b6101e36101f33660046122df565b6106d9565b61021c61020636600461236e565b6000908152600160208190526040909120015490565b6040519081526020016101c7565b61021c610238366004612291565b80516020918201206001600160a01b0390921660009081526007825260408082209382526002909301909152205490565b6101e3610277366004612397565b6109e0565b6101e361028a3660046123ca565b610a79565b6101e361029d3660046123ca565b610aac565b6101bb6102b03660046123ed565b6001600160a01b031660009081526020819052604090205460ff1690565b6101bb6102dc366004612408565b600560209081526000928352604080842090915290825290205460ff1681565b61030f61030a366004612291565b610b48565b6040516101c791906124f0565b61032f61032a366004612291565b610cfe565b6040516101c79190612503565b61034f61034a366004612565565b610f77565b6040516001600160a01b0390911681526020016101c7565b6101bb6103753660046123ca565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61021c600081565b61021c60035481565b6101e36103bf366004612291565b610f96565b6103d76103d2366004612587565b611044565b6040516101c791906125fc565b61032f6103f23660046123ed565b611139565b6004546101bb9060ff1681565b61032f6113c0565b6101e361041a366004612651565b6117da565b61021c61042d36600461236e565b61186e565b6101e36104403660046123ca565b611885565b6101e3610453366004612291565b6118ae565b60006001600160e01b03198216635a05180f60e01b148061047d575061047d82611a84565b92915050565b81806001600160a01b0316610496611ab9565b6001600160a01b031614806104e557506001600160a01b0381166000908152600560205260408120906104c7611ab9565b6001600160a01b0316815260208101919091526040016000205460ff165b61052a5760405162461bcd60e51b81526020600482015260116024820152703ab730b8383937bb32b21031b0b63632b960791b60448201526064015b60405180910390fd5b60045460ff16158061054457506105446000610375611ab9565b6105825760405162461bcd60e51b815260206004820152600f60248201526e1c9959da5cdd1c9e481c185d5cd959608a1b6044820152606401610521565b81516020808401919091206001600160a01b03851660009081526007909252604082209091906105b29083611ac3565b9050806106015760405162461bcd60e51b815260206004820152601460248201527f676976656e20636f6e7472616374496420444e450000000000000000000000006044820152606401610521565b6001600160a01b03851660009081526007602090815260408083208584526002908101909252822082815560018101839055919082018161064282826120d2565b600182016000905560028201600061065a91906120d2565b506000600382015560040180546001600160a01b0319169055505060405161068390859061266c565b6040518091039020856001600160a01b031661069d611ab9565b6001600160a01b03167f4c934c8014c81bef7c9b5296daec96b8a63f02365b7dd6eb15ff0f231728a8d560405160405180910390a45050505050565b84806001600160a01b03166106ec611ab9565b6001600160a01b0316148061073b57506001600160a01b03811660009081526005602052604081209061071d611ab9565b6001600160a01b0316815260208101919091526040016000205460ff165b61077b5760405162461bcd60e51b81526020600482015260116024820152703ab730b8383937bb32b21031b0b63632b960791b6044820152606401610521565b60045460ff16158061079557506107956000610375611ab9565b6107d35760405162461bcd60e51b815260206004820152600f60248201526e1c9959da5cdd1c9e481c185d5cd959608a1b6044820152606401610521565b6040805160a08101825283815242602080830191909152818301889052606082018790526001600160a01b038087166080840152855182870120908a166000908152600790925292902090919061082a9082611acf565b506001600160a01b0388166000908152600760209081526040808320848452600290810183529220845180518694929092019261086c9284929091019061210f565b5060208281015160018301556040830151805161088f926002850192019061210f565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0392831617905588166000908152600760209081526040808320848452600201909152812060019081018054926108ef838561269e565b90915550506001600160a01b038916600090815260076020818152604080842086855260020182528084208585529092018152912084518051869361093892849291019061210f565b5060208281015160018301556040830151805161095b926002850192019061210f565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b039283161790558916610995611ab9565b6001600160a01b03167f4c0484c23e4ea73b4cb562e1868ba93ccba2c9151ac4148fa1b91d9cb17b4581856040516109cd91906124f0565b60405180910390a3505050505050505050565b80600560006109ed611ab9565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610a31611ab9565b6001600160a01b03167f1299be4ab334acdc5747f03ba508209acf422601c7ee3040dc8ff385b0aca98983604051610a6d911515815260200190565b60405180910390a35050565b60008281526001602081905260409091200154610a9d81610a98611ab9565b611adb565b610aa78383611b5b565b505050565b610ab4611ab9565b6001600160a01b0316816001600160a01b031614610b3a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610521565b610b448282611b7d565b5050565b6040805160a0810182526060808252600060208301819052928201819052810182905260808101919091526001600160a01b03831660009081526007602090815260408083208551868401208452600290810190925291829020825160a0810190935201805482908290610bbb906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610be7906126b6565b8015610c345780601f10610c0957610100808354040283529160200191610c34565b820191906000526020600020905b815481529060010190602001808311610c1757829003601f168201915b5050505050815260200160018201548152602001600282018054610c57906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610c83906126b6565b8015610cd05780601f10610ca557610100808354040283529160200191610cd0565b820191906000526020600020905b815481529060010190602001808311610cb357829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b03166040909101529392505050565b80516020808301919091206001600160a01b03841660009081526007835260408082208383526002019093529190912060010154606091908067ffffffffffffffff811115610d4f57610d4f6121ee565b604051908082528060200260200182016040528015610da957816020015b6040805160a08101825260608082526000602080840182905293830182905290820181905260808201528252600019909201910181610d6d5790505b50925060005b81811015610f6e576001600160a01b03861660009081526007602081815260408084208785526002018252808420858552909201905290819020815160a08101909252805482908290610e01906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2d906126b6565b8015610e7a5780601f10610e4f57610100808354040283529160200191610e7a565b820191906000526020600020905b815481529060010190602001808311610e5d57829003601f168201915b5050505050815260200160018201548152602001600282018054610e9d906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec9906126b6565b8015610f165780601f10610eeb57610100808354040283529160200191610f16565b820191906000526020600020905b815481529060010190602001808311610ef957829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b03166040909101528451859083908110610f5157610f516126f1565b6020908102919091010152610f6760018261269e565b9050610daf565b50505092915050565b6000828152600260205260408120610f8f9083611b9f565b9392505050565b80516020808301919091206001600160a01b038416600090815260078352604080822083835260020184528082208054908390558083526006909452812080546001600160a01b031916815591929190610ff360018301826120d2565b505082604051611003919061266c565b604051908190038120906001600160a01b038616907fa6dc3dd821b921fabed8dda809ab13ff41ade49a18cdb6510f95ac6a324fffab90600090a350505050565b60608167ffffffffffffffff81111561105f5761105f6121ee565b60405190808252806020026020018201604052801561109257816020015b606081526020019060019003908161107d5790505b50905060005b8281101561113257611102308585848181106110b6576110b66126f1565b90506020028101906110c89190612707565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611bab92505050565b828281518110611114576111146126f1565b6020026020010181905250808061112a90612755565b915050611098565b5092915050565b6001600160a01b03811660009081526007602052604081206060919061115e90611bd0565b90508067ffffffffffffffff811115611179576111796121ee565b6040519080825280602002602001820160405280156111d357816020015b6040805160a081018252606080825260006020808401829052938301829052908201819052608082015282526000199092019101816111975790505b50915060005b818110156113b9576001600160a01b03841660009081526007602052604081206112039083611b9f565b6001600160a01b0386166000908152600760209081526040808320848452600290810190925291829020825160a0810190935201805492935090918290829061124b906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611277906126b6565b80156112c45780601f10611299576101008083540402835291602001916112c4565b820191906000526020600020905b8154815290600101906020018083116112a757829003601f168201915b50505050508152602001600182015481526020016002820180546112e7906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611313906126b6565b80156113605780601f1061133557610100808354040283529160200191611360565b820191906000526020600020905b81548152906001019060200180831161134357829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b0316604090910152845185908490811061139b5761139b6126f1565b6020908102919091010152506113b260018261269e565b90506111d9565b5050919050565b60606000805b6003548110156114c4576000818152600660209081526040808320815180830190925280546001600160a01b03168252600181018054929391929184019161140d906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611439906126b6565b80156114865780601f1061145b57610100808354040283529160200191611486565b820191906000526020600020905b81548152906001019060200180831161146957829003601f168201915b5050509190925250508151919250506001600160a01b0316156114b1576114ae60018461269e565b92505b506114bd60018261269e565b90506113c6565b508067ffffffffffffffff8111156114de576114de6121ee565b60405190808252806020026020018201604052801561153857816020015b6040805160a081018252606080825260006020808401829052938301829052908201819052608082015282526000199092019101816114fc5790505b50915060005b818110156117d5576000818152600660209081526040808320815180830190925280546001600160a01b031682526001810180549293919291840191611583906126b6565b80601f01602080910402602001604051908101604052809291908181526020018280546115af906126b6565b80156115fc5780601f106115d1576101008083540402835291602001916115fc565b820191906000526020600020905b8154815290600101906020018083116115df57829003601f168201915b5050509190925250508151919250506001600160a01b0316156117c25780516001600160a01b03166000908152600760209081526040808320828501518051908401208452600290810190925291829020825160a0810190935201805482908290611666906126b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611692906126b6565b80156116df5780601f106116b4576101008083540402835291602001916116df565b820191906000526020600020905b8154815290600101906020018083116116c257829003601f168201915b5050505050815260200160018201548152602001600282018054611702906126b6565b80601f016020809104026020016040519081016040528092919081815260200182805461172e906126b6565b801561177b5780601f106117505761010080835404028352916020019161177b565b820191906000526020600020905b81548152906001019060200180831161175e57829003601f168201915b5050509183525050600382015460208201526004909101546001600160a01b031660409091015284518590849081106117b6576117b66126f1565b60200260200101819052505b506117ce60018261269e565b905061153e565b505090565b6117e76000610375611ab9565b6118275760405162461bcd60e51b81526020600482015260116024820152703ab730b8383937bb32b21031b0b63632b960791b6044820152606401610521565b6004805460ff19168215159081179091556040519081527f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd29060200160405180910390a150565b600081815260026020526040812061047d90611bd0565b600082815260016020819052604090912001546118a481610a98611ab9565b610aa78383611b7d565b600380549060019060006118c2838561269e565b909155505081516020808401919091206040805180820182526001600160a01b03878116808352828601888152600091825260078752848220868352600201875284822088905587825260068752939020825181546001600160a01b0319169216919091178155915180519394919384939261194592600185019291019061210f565b50506040516119569150859061266c565b604051908190038120906001600160a01b038716907f67c52f1a5ffa258663904eb8850e0dc217b6532579cd12cc3e3c9d167ff68d1190600090a35050505050565b3360009081526020819052604081205460ff16156119bd575060131936013560601c90565b503390565b905090565b3390565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16610b445760008281526001602081815260408084206001600160a01b0386168552909152909120805460ff19169091179055611a2b611ab9565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f8f836001600160a01b038416611bda565b60006001600160e01b03198216637965db0b60e01b148061047d57506301ffc9a760e01b6001600160e01b031983161461047d565b60006119c2611998565b6000610f8f8383611c29565b6000610f8f8383611bda565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16610b4457611b19816001600160a01b03166014611d1c565b611b24836020611d1c565b604051602001611b35929190612770565b60408051601f198184030181529082905262461bcd60e51b8252610521916004016127f1565b611b6582826119cb565b6000828152600260205260409020610aa79082611a6f565b611b878282611ec5565b6000828152600260205260409020610aa79082611f66565b6000610f8f8383611f7b565b6060610f8f838360405180606001604052806027815260200161286860279139611fa5565b600061047d825490565b6000818152600183016020526040812054611c215750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561047d565b50600061047d565b60008181526001830160205260408120548015611d12576000611c4d600183612804565b8554909150600090611c6190600190612804565b9050818114611cc6576000866000018281548110611c8157611c816126f1565b9060005260206000200154905080876000018481548110611ca457611ca46126f1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611cd757611cd761281b565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061047d565b600091505061047d565b60606000611d2b836002612831565b611d3690600261269e565b67ffffffffffffffff811115611d4e57611d4e6121ee565b6040519080825280601f01601f191660200182016040528015611d78576020820181803683370190505b509050600360fc1b81600081518110611d9357611d936126f1565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611dc257611dc26126f1565b60200101906001600160f81b031916908160001a9053506000611de6846002612831565b611df190600161269e565b90505b6001811115611e76577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611e3257611e326126f1565b1a60f81b828281518110611e4857611e486126f1565b60200101906001600160f81b031916908160001a90535060049490941c93611e6f81612850565b9050611df4565b508315610f8f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610521565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff1615610b445760008281526001602090815260408083206001600160a01b03851684529091529020805460ff19169055611f22611ab9565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000610f8f836001600160a01b038416611c29565b6000826000018281548110611f9257611f926126f1565b9060005260206000200154905092915050565b60606001600160a01b0384163b6120245760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610521565b600080856001600160a01b03168560405161203f919061266c565b600060405180830381855af49150503d806000811461207a576040519150601f19603f3d011682016040523d82523d6000602084013e61207f565b606091505b509150915061208f828286612099565b9695505050505050565b606083156120a8575081610f8f565b8251156120b85782518084602001fd5b8160405162461bcd60e51b815260040161052191906127f1565b5080546120de906126b6565b6000825580601f106120ee575050565b601f01602090049060005260206000209081019061210c9190612193565b50565b82805461211b906126b6565b90600052602060002090601f01602090048101928261213d5760008555612183565b82601f1061215657805160ff1916838001178555612183565b82800160010185558215612183579182015b82811115612183578251825591602001919060010190612168565b5061218f929150612193565b5090565b5b8082111561218f5760008155600101612194565b6000602082840312156121ba57600080fd5b81356001600160e01b031981168114610f8f57600080fd5b80356001600160a01b03811681146121e957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261221557600080fd5b813567ffffffffffffffff80821115612230576122306121ee565b604051601f8301601f19908116603f01168101908282118183101715612258576122586121ee565b8160405283815286602085880101111561227157600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156122a457600080fd5b6122ad836121d2565b9150602083013567ffffffffffffffff8111156122c957600080fd5b6122d585828601612204565b9150509250929050565b600080600080600060a086880312156122f757600080fd5b612300866121d2565b9450602086013567ffffffffffffffff8082111561231d57600080fd5b61232989838a01612204565b95506040880135945061233e606089016121d2565b9350608088013591508082111561235457600080fd5b5061236188828901612204565b9150509295509295909350565b60006020828403121561238057600080fd5b5035919050565b803580151581146121e957600080fd5b600080604083850312156123aa57600080fd5b6123b3836121d2565b91506123c160208401612387565b90509250929050565b600080604083850312156123dd57600080fd5b823591506123c1602084016121d2565b6000602082840312156123ff57600080fd5b610f8f826121d2565b6000806040838503121561241b57600080fd5b612424836121d2565b91506123c1602084016121d2565b60005b8381101561244d578181015183820152602001612435565b8381111561245c576000848401525b50505050565b6000815180845261247a816020860160208601612432565b601f01601f19169290920160200192915050565b6000815160a084526124a360a0850182612462565b905060208301516020850152604083015184820360408601526124c68282612462565b915050606083015160608501526001600160a01b0360808401511660808501528091505092915050565b602081526000610f8f602083018461248e565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561255857603f1988860301845261254685835161248e565b9450928501929085019060010161252a565b5092979650505050505050565b6000806040838503121561257857600080fd5b50508035926020909101359150565b6000806020838503121561259a57600080fd5b823567ffffffffffffffff808211156125b257600080fd5b818501915085601f8301126125c657600080fd5b8135818111156125d557600080fd5b8660208260051b85010111156125ea57600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561255857603f1988860301845261263f858351612462565b94509285019290850190600101612623565b60006020828403121561266357600080fd5b610f8f82612387565b6000825161267e818460208701612432565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600082198211156126b1576126b1612688565b500190565b600181811c908216806126ca57607f821691505b602082108114156126eb57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261271e57600080fd5b83018035915067ffffffffffffffff82111561273957600080fd5b60200191503681900382131561274e57600080fd5b9250929050565b600060001982141561276957612769612688565b5060010190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516127a8816017850160208801612432565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516127e5816028840160208801612432565b01602801949350505050565b602081526000610f8f6020830184612462565b60008282101561281657612816612688565b500390565b634e487b7160e01b600052603160045260246000fd5b600081600019048311821515161561284b5761284b612688565b500290565b60008161285f5761285f612688565b50600019019056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c634300080c000a

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

00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c82bbe41f2cf04e3a8efa18f7032bdd7f6d98a81

-----Decoded View---------------
Arg [0] : _trustedForwarders (address[]): 0xc82BbE41f2cF04e3a8efA18F7032BDD7f6d98a81

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [2] : 000000000000000000000000c82bbe41f2cf04e3a8efa18f7032bdd7f6d98a81


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

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.