ETH Price: $2,372.27 (-4.01%)

Contract

0xdD2ec94890E2D92E131A89F73bFe124137E0C10E
 
Transaction Hash
Method
Block
From
To
Claim206825302024-09-05 6:15:2327 days ago1725516923IN
0xdD2ec948...137E0C10E
0 ETH0.000141271.98200193
Claim206825162024-09-05 6:12:3527 days ago1725516755IN
0xdD2ec948...137E0C10E
0 ETH0.000261492.37095054
Claim206824782024-09-05 6:04:5927 days ago1725516299IN
0xdD2ec948...137E0C10E
0 ETH0.000164972.16821868
Claim206676442024-09-03 4:24:4729 days ago1725337487IN
0xdD2ec948...137E0C10E
0 ETH0.000130181.18042591
Claim206676052024-09-03 4:16:5929 days ago1725337019IN
0xdD2ec948...137E0C10E
0 ETH0.00009141.20141602
Claim206675742024-09-03 4:10:4729 days ago1725336647IN
0xdD2ec948...137E0C10E
0 ETH0.000125071.13402293
Claim206675662024-09-03 4:09:1129 days ago1725336551IN
0xdD2ec948...137E0C10E
0 ETH0.00008821.15916561
Claim206467522024-08-31 6:26:2332 days ago1725085583IN
0xdD2ec948...137E0C10E
0 ETH0.00006010.645
Claim206455882024-08-31 2:32:2332 days ago1725071543IN
0xdD2ec948...137E0C10E
0 ETH0.000159971.45045791
Claim206455752024-08-31 2:29:3532 days ago1725071375IN
0xdD2ec948...137E0C10E
0 ETH0.000167311.51704423
Claim206455372024-08-31 2:21:5932 days ago1725070919IN
0xdD2ec948...137E0C10E
0 ETH0.000214261.94278355
Claim206442022024-08-30 21:53:1132 days ago1725054791IN
0xdD2ec948...137E0C10E
0 ETH0.000077360.70155156
Claim206441642024-08-30 21:44:5933 days ago1725054299IN
0xdD2ec948...137E0C10E
0 ETH0.000066890.71780691
Claim206441352024-08-30 21:39:1133 days ago1725053951IN
0xdD2ec948...137E0C10E
0 ETH0.000082490.74799366
Claim206394992024-08-30 6:07:4733 days ago1724998067IN
0xdD2ec948...137E0C10E
0 ETH0.000139651.26626557
Claim206385792024-08-30 3:02:3533 days ago1724986955IN
0xdD2ec948...137E0C10E
0 ETH0.000134231.21709786
Claim206384662024-08-30 2:39:4733 days ago1724985587IN
0xdD2ec948...137E0C10E
0 ETH0.000095960.87031789
Claim206325072024-08-29 6:39:4734 days ago1724913587IN
0xdD2ec948...137E0C10E
0 ETH0.000119351.55411375
Claim206324602024-08-29 6:30:1134 days ago1724913011IN
0xdD2ec948...137E0C10E
0 ETH0.000099231.29190819
Claim206324522024-08-29 6:28:3534 days ago1724912915IN
0xdD2ec948...137E0C10E
0 ETH0.000101611.32298066
Claim206324452024-08-29 6:27:1134 days ago1724912831IN
0xdD2ec948...137E0C10E
0 ETH0.000151051.36960069
Claim206323632024-08-29 6:10:4734 days ago1724911847IN
0xdD2ec948...137E0C10E
0 ETH0.000096821.27250653
Claim206306072024-08-29 0:16:2334 days ago1724890583IN
0xdD2ec948...137E0C10E
0 ETH0.000090470.82034938
Claim206302012024-08-28 22:54:3534 days ago1724885675IN
0xdD2ec948...137E0C10E
0 ETH0.000099670.90375091
Claim206301522024-08-28 22:44:4734 days ago1724885087IN
0xdD2ec948...137E0C10E
0 ETH0.00007130.93710495
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
156289712022-09-28 2:51:47735 days ago1664333507  Contract Creation0 ETH
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x15818FCE...D5D116302
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
CyberVault

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : CyberVault.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

import { Owned } from "../dependencies/solmate/Owned.sol";
import { IERC20 } from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import { IERC721 } from "openzeppelin-contracts/contracts/token/ERC721/IERC721.sol";
import { IERC1155 } from "openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol";
import { ERC721Holder } from "openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol";
import { ERC1155Holder } from "openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import { SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import { ReentrancyGuard } from "../dependencies/openzeppelin/ReentrancyGuard.sol";
import { Initializable } from "openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

import { Constants } from "../libraries/Constants.sol";
import { DataTypes } from "../libraries/DataTypes.sol";

import { EIP712 } from "../base/EIP712.sol";

/**
 * @title CyberVault
 * @author CyberConnect
 * @notice This contract is used to create CyberVault.
 */
contract CyberVault is
    Initializable,
    Owned,
    ReentrancyGuard,
    EIP712,
    ERC721Holder,
    ERC1155Holder
{
    using SafeERC20 for IERC20;

    event Initialize(address indexed owner);
    event Claim(
        string profileId,
        address indexed to,
        address indexed currency,
        uint256 amount
    );
    event Claim721(
        string profileId,
        address indexed to,
        address indexed currency,
        uint256 tokenId
    );
    event Claim1155(
        string profileId,
        address indexed to,
        address indexed currency,
        uint256 tokenId,
        uint256 amount
    );
    event Deposit(
        string profileId,
        address indexed currency,
        uint256 indexed amount
    );
    event Deposit721(
        string profileId,
        address indexed currency,
        uint256 indexed tokenId
    );
    event Deposit1155(
        string profileId,
        address indexed currency,
        uint256 indexed tokenId,
        uint256 indexed amount
    );
    event SetSigner(address indexed preSigner, address indexed newSigner);

    address internal _signer;
    mapping(address => int256) public nonces;
    mapping(string => mapping(address => uint256)) _balanceByProfileByCurrency;
    mapping(string => mapping(address => mapping(uint256 => uint256))) _balanceByProfileByCurrencyByTokenID;

    /*//////////////////////////////////////////////////////////////
                                 CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(address owner) initializer {
        _signer = owner;
        Owned.__Owned_Init(owner);
        ReentrancyGuard.__ReentrancyGuard_init();
        emit Initialize(owner);
    }

    /*//////////////////////////////////////////////////////////////
                                 EXTERNAL
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Claims ERC20 tokens from a profile's deposit.
     *
     * @param profileId The profile id.
     * @param to The claimer address.
     * @param currency The ERC20 address.
     * @param amount The amount to claim.
     * @param sig The EIP712 signature.
     */
    function claim(
        string calldata profileId,
        address to,
        address currency,
        uint256 amount,
        DataTypes.EIP712Signature calldata sig
    ) external nonReentrant {
        _requiresExpectedSigner(
            _hashTypedDataV4(
                keccak256(
                    abi.encode(
                        Constants._CLAIM_TYPEHASH,
                        keccak256(bytes(profileId)),
                        to,
                        currency,
                        amount,
                        nonces[to]++,
                        sig.deadline
                    )
                )
            ),
            _signer,
            sig
        );

        require(
            _balanceByProfileByCurrency[profileId][currency] >= amount,
            "INSUFFICIENT_BALANCE"
        );

        _balanceByProfileByCurrency[profileId][currency] -= amount;

        IERC20(currency).safeTransfer(to, amount);
        emit Claim(profileId, to, currency, amount);
    }

    /**
     * @notice Claims ERC721 tokens from a profile's deposit.
     *
     * @param profileId The profile id.
     * @param to The claimer address.
     * @param currency The ERC721 address.
     * @param tokenId The tokenId to claim.
     * @param sig The EIP712 signature.
     */
    function claim721(
        string calldata profileId,
        address to,
        address currency,
        uint256 tokenId,
        DataTypes.EIP712Signature calldata sig
    ) external nonReentrant {
        _requiresExpectedSigner(
            _hashTypedDataV4(
                keccak256(
                    abi.encode(
                        Constants._CLAIM721_TYPEHASH,
                        keccak256(bytes(profileId)),
                        to,
                        currency,
                        tokenId,
                        nonces[to]++,
                        sig.deadline
                    )
                )
            ),
            _signer,
            sig
        );

        require(
            _balanceByProfileByCurrencyByTokenID[profileId][currency][
                tokenId
            ] == 1,
            "INSUFFICIENT_BALANCE"
        );

        _balanceByProfileByCurrencyByTokenID[profileId][currency][tokenId] = 0;

        IERC721(currency).safeTransferFrom(address(this), to, tokenId);
        emit Claim721(profileId, to, currency, tokenId);
    }

    /**
     * @notice Claims ERC1155 tokens from a profile's deposit.
     *
     * @param profileId The profile id.
     * @param to The claimer address.
     * @param currency The ERC1155 address.
     * @param tokenId The tokenId to claim.
     * @param amount The amount to claim.
     * @param sig The EIP712 signature.
     */
    function claim1155(
        string calldata profileId,
        address to,
        address currency,
        uint256 tokenId,
        uint256 amount,
        DataTypes.EIP712Signature calldata sig
    ) external nonReentrant {
        _requiresExpectedSigner(
            _hashTypedDataV4(
                keccak256(
                    abi.encode(
                        Constants._CLAIM1155_TYPEHASH,
                        keccak256(bytes(profileId)),
                        to,
                        currency,
                        tokenId,
                        amount,
                        nonces[to]++,
                        sig.deadline
                    )
                )
            ),
            _signer,
            sig
        );

        require(
            _balanceByProfileByCurrencyByTokenID[profileId][currency][
                tokenId
            ] >= amount,
            "INSUFFICIENT_BALANCE"
        );

        _balanceByProfileByCurrencyByTokenID[profileId][currency][
            tokenId
        ] -= amount;

        IERC1155(currency).safeTransferFrom(
            address(this),
            to,
            tokenId,
            amount,
            ""
        );
        emit Claim1155(profileId, to, currency, tokenId, amount);
    }

    /**
     * @notice Deposit ERC20 tokens to a profile's balance.
     *
     * @param profileId The profile id.
     * @param currency The ERC20 address.
     * @param amount The amount to deposit.
     */
    function deposit(
        string calldata profileId,
        address currency,
        uint256 amount
    ) external nonReentrant {
        require(
            IERC20(currency).balanceOf(msg.sender) >= amount,
            "INSUFFICIENT_BALANCE"
        );
        IERC20(currency).safeTransferFrom(msg.sender, address(this), amount);

        _balanceByProfileByCurrency[profileId][currency] += amount;
        emit Deposit(profileId, currency, amount);
    }

    /**
     * @notice Deposit ERC721 tokens to a profile's balance.
     *
     * @param profileId The profile id.
     * @param currency The ERC721 address.
     * @param tokenId The tokenId to deposit.
     */
    function deposit721(
        string calldata profileId,
        address currency,
        uint256 tokenId
    ) external nonReentrant {
        require(
            IERC721(currency).ownerOf(tokenId) == msg.sender,
            "NOT_NFT_OWNER"
        );
        IERC721(currency).safeTransferFrom(msg.sender, address(this), tokenId);

        _balanceByProfileByCurrencyByTokenID[profileId][currency][tokenId] = 1;
        emit Deposit721(profileId, currency, tokenId);
    }

    /**
     * @notice Deposit ERC1155 tokens to a profile's balance.
     *
     * @param profileId The profile id.
     * @param currency The ERC1155 address.
     * @param tokenId The tokenId to deposit.
     * @param amount The amount to deposit.
     */
    function deposit1155(
        string calldata profileId,
        address currency,
        uint256 tokenId,
        uint256 amount
    ) external nonReentrant {
        require(
            IERC1155(currency).balanceOf(msg.sender, tokenId) >= amount,
            "INSUFFICIENT_NFT_BALANCE"
        );
        IERC1155(currency).safeTransferFrom(
            msg.sender,
            address(this),
            tokenId,
            amount,
            ""
        );

        _balanceByProfileByCurrencyByTokenID[profileId][currency][
            tokenId
        ] += amount;
        emit Deposit1155(profileId, currency, tokenId, amount);
    }

    /**
     * @notice Sets the new signer address.
     *
     * @param signer The signer address.
     * @dev The address can not be zero address.
     */
    function setSigner(address signer) external onlyOwner {
        require(signer != address(0), "zero address signer");
        address preSigner = _signer;
        _signer = signer;

        emit SetSigner(preSigner, signer);
    }

    /*//////////////////////////////////////////////////////////////
                         EXTERNAL VIEW
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Gets the signer address.
     *
     * @return address The signer address.
     */
    function getSigner() external view returns (address) {
        return _signer;
    }

    /**
     * @notice Gets the balance.
     *
     * @param profileId The profile id.
     * @param currency The ERC20 currency address.
     */
    function balanceOf(string calldata profileId, address currency)
        external
        view
        returns (uint256)
    {
        return _balanceByProfileByCurrency[profileId][currency];
    }

    /**
     * @notice Gets the nft balance.
     *
     * @param profileId The profile id.
     * @param currency The ERC20 currency address.
     */
    function nftBalanceOf(
        string calldata profileId,
        address currency,
        uint256 tokenId
    ) external view returns (uint256) {
        return
            _balanceByProfileByCurrencyByTokenID[profileId][currency][tokenId];
    }

    /*//////////////////////////////////////////////////////////////
                              INTERNAL
    //////////////////////////////////////////////////////////////*/

    function _domainSeparatorName()
        internal
        view
        virtual
        override
        returns (string memory)
    {
        return "CyberVault";
    }
}

File 2 of 20 : Owned.sol
// SPDX-License-Identifier: GPL-3.0-or-later

import { Initializable } from "openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

pragma solidity >=0.8.0;

/// @notice Adapted from Solmate's Owned.sol with initializer replacing the constructor.

/// @notice Simple single owner authorization mixin.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Owned.sol)
abstract contract Owned is Initializable {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event OwnerUpdated(address indexed user, address indexed newOwner);

    /*//////////////////////////////////////////////////////////////
                            OWNERSHIP STORAGE
    //////////////////////////////////////////////////////////////*/

    address public owner;

    modifier onlyOwner() virtual {
        require(msg.sender == owner, "UNAUTHORIZED");

        _;
    }

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    function __Owned_Init(address _owner) internal onlyInitializing {
        require(_owner != address(0), "ZERO_ADDRESS");
        owner = _owner;

        emit OwnerUpdated(address(0), _owner);
    }

    /*//////////////////////////////////////////////////////////////
                             OWNERSHIP LOGIC
    //////////////////////////////////////////////////////////////*/

    function setOwner(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "ZERO_ADDRESS");
        owner = newOwner;

        emit OwnerUpdated(msg.sender, newOwner);
    }
}

File 3 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 4 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

File 6 of 20 : ERC721Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

File 7 of 20 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

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

File 8 of 20 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 20 : ReentrancyGuard.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// OpenZeppelin Contracts v4.7.0 (security/ReentrancyGuard.sol)

import { Initializable } from "openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

pragma solidity ^0.8.0;

/**
 * @dev modified from OpenZeppelin ReentrancyGuard.sol adding initialize func
 *
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;


    function __ReentrancyGuard_init() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 10 of 20 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/Address.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 11 of 20 : Constants.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

library Constants {
    // Access Control for CyberEngine
    uint8 internal constant _ENGINE_GOV_ROLE = 1;
    bytes4 internal constant _AUTHORIZE_UPGRADE =
        bytes4(keccak256(bytes("_authorizeUpgrade(address)")));

    // EIP712 TypeHash
    bytes32 internal constant _PERMIT_TYPEHASH =
        keccak256(
            "permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _CREATE_PROFILE_TYPEHASH =
        keccak256(
            "createProfile(address to,string handle,string avatar,string metadata,address operator,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _SUBSCRIBE_TYPEHASH =
        keccak256(
            "subscribeWithSig(uint256[] profileIds,bytes[] preDatas,bytes[] postDatas,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _COLLECT_TYPEHASH =
        keccak256(
            "collectWithSig(address collector,uint256 profileId,uint256 essenceId,bytes data,bytes postDatas,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _REGISTER_ESSENCE_TYPEHASH =
        keccak256(
            "registerEssenceWithSig(uint256 profileId,string name,string symbol,string essenceTokenURI,address essenceMw,bool transferable,bytes initData,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _SET_METADATA_TYPEHASH =
        keccak256(
            "setMetadataWithSig(uint256 profileId,string metadata,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _SET_OPERATOR_APPROVAL_TYPEHASH =
        keccak256(
            "setOperatorApprovalWithSig(uint256 profileId,address operator,bool approved,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _SET_SUBSCRIBE_DATA_TYPEHASH =
        keccak256(
            "setSubscribeDataWithSig(uint256 profileId,string tokenURI,address mw,bytes data,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _SET_ESSENCE_DATA_TYPEHASH =
        keccak256(
            "setEssenceDataWithSig(uint256 profileId,uint256 essenceId,string tokenURI,address mw,bytes data,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _SET_AVATAR_TYPEHASH =
        keccak256(
            "setAvatarWithSig(uint256 profileId,string avatar,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _SET_PRIMARY_PROFILE_TYPEHASH =
        keccak256(
            "setPrimaryProfileWithSig(uint256 profileId,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _CLAIM_BOX_TYPEHASH =
        keccak256("claimBox(address to,uint256 nonce,uint256 deadline)");
    bytes32 internal constant _CLAIM_TYPEHASH =
        keccak256(
            "claim(string profileId,address to,address currency,uint256 amount,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _CLAIM721_TYPEHASH =
        keccak256(
            "claim(string profileId,address to,address currency,uint256 tokenId,uint256 nonce,uint256 deadline)"
        );
    bytes32 internal constant _CLAIM1155_TYPEHASH =
        keccak256(
            "claim(string profileId,address to,address currency,uint256 tokenId,uint256 amount,uint256 nonce,uint256 deadline)"
        );

    // Parameters
    uint8 internal constant _MAX_HANDLE_LENGTH = 20;
    uint8 internal constant _MAX_NAME_LENGTH = 20;
    uint8 internal constant _MAX_SYMBOL_LENGTH = 20;
    uint16 internal constant _MAX_URI_LENGTH = 2000;
    uint16 internal constant _MAX_BPS = 10000;

    // Access Control for UpgradeableBeacon
    bytes4 internal constant _BEACON_UPGRADE_TO =
        bytes4(keccak256(bytes("upgradeTo(address)")));

    // Subscribe NFT
    string internal constant _SUBSCRIBE_NFT_NAME_SUFFIX = "_subscriber";
    string internal constant _SUBSCRIBE_NFT_SYMBOL_SUFFIX = "_SUB";
}

File 12 of 20 : DataTypes.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

library DataTypes {
    struct EIP712Signature {
        uint8 v;
        bytes32 r;
        bytes32 s;
        uint256 deadline;
    }

    struct CreateProfileParams {
        address to;
        string handle;
        string avatar;
        string metadata;
        address operator;
    }

    struct CreateProfilePostProcessData {
        uint256 tokenID;
        bytes32 handleHash;
        address profileMw;
    }

    struct CreateNamespaceParams {
        string name;
        string symbol;
        address owner;
        ComputedAddresses addrs;
    }

    struct RegisterEssenceParams {
        uint256 profileId;
        string name;
        string symbol;
        string essenceTokenURI;
        address essenceMw;
        bool transferable;
        bool deployAtRegister;
    }

    struct SubscribeParams {
        uint256[] profileIds;
    }

    struct CollectParams {
        address collector;
        uint256 profileId;
        uint256 essenceId;
    }

    struct RegisterEssenceData {
        uint256 profileId;
        string name;
        string symbol;
        string essenceTokenURI;
        bytes initData;
        address essenceMw;
        bool transferable;
        bool deployAtRegister;
        address essBeacon;
    }

    struct SubscribeData {
        address sender;
        uint256[] profileIds;
        bytes[] preDatas;
        bytes[] postDatas;
        address subBeacon;
        address engine;
    }

    struct CollectData {
        address collector;
        uint256 profileId;
        uint256 essenceId;
        bytes preData;
        bytes postData;
        address essBeacon;
        address engine;
    }

    struct ProfileStruct {
        string handle;
        string avatar;
        uint256 essenceCount;
    }

    struct SubscribeStruct {
        string tokenURI;
        address subscribeNFT;
        address subscribeMw;
    }

    struct EssenceStruct {
        address essenceNFT;
        address essenceMw;
        string name;
        string symbol;
        string tokenURI;
        bool transferable;
    }

    struct NamespaceStruct {
        address profileMw;
        string name;
    }

    struct ConstructTokenURIParams {
        uint256 tokenId;
        string handle;
        uint256 subscribers;
    }

    struct ComputedAddresses {
        address profileProxy;
        address profileFactory;
        address subscribeFactory;
        address essenceFactory;
    }

    struct ProfileDeployParameters {
        address engine;
        address subBeacon;
        address essenceBeacon;
    }

    struct SubscribeDeployParameters {
        address profileProxy;
    }

    struct EssenceDeployParameters {
        address profileProxy;
    }
}

File 13 of 20 : EIP712.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.14;

import { DataTypes } from "../libraries/DataTypes.sol";

abstract contract EIP712 {
    /*//////////////////////////////////////////////////////////////
                                STATES
    //////////////////////////////////////////////////////////////*/
    bytes32 internal constant _HASHED_VERSION = keccak256("1");
    bytes32 private constant _TYPE_HASH =
        keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );

    /*//////////////////////////////////////////////////////////////
                            PUBLIC VIEW
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Returns the contract's {EIP712} domain separator.
     *
     * @return bytes32 the contract's {EIP712} domain separator.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() public view returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    _TYPE_HASH,
                    keccak256(bytes(_domainSeparatorName())),
                    _HASHED_VERSION,
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                              INTERNAL
    //////////////////////////////////////////////////////////////*/

    function _requiresExpectedSigner(
        bytes32 digest,
        address expectedSigner,
        uint8 v,
        bytes32 r,
        bytes32 s,
        uint256 deadline
    ) internal view {
        require(deadline >= block.timestamp, "DEADLINE_EXCEEDED");
        require(
            uint256(s) <=
                0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,
            "INVALID_SIGNATURE_S_VAULE"
        );

        address recoveredAddress = ecrecover(digest, v, r, s);
        require(recoveredAddress == expectedSigner, "INVALID_SIGNATURE");
    }

    function _requiresExpectedSigner(
        bytes32 digest,
        address expectedSigner,
        DataTypes.EIP712Signature calldata sig
    ) internal view {
        _requiresExpectedSigner(
            digest,
            expectedSigner,
            sig.v,
            sig.r,
            sig.s,
            sig.deadline
        );
    }

    function _hashTypedDataV4(bytes32 structHash)
        internal
        view
        virtual
        returns (bytes32)
    {
        return
            keccak256(
                abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), structHash)
            );
    }

    function _domainSeparatorName()
        internal
        view
        virtual
        returns (string memory);
}

File 14 of 20 : 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 15 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 16 of 20 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

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

File 17 of 20 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 18 of 20 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

File 20 of 20 : 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;
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {
    "src/libraries/Actions.sol": {
      "Actions": "0x8ccbe07f1e12a61e4fbb3a1895d35dce001ff73a"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"profileId","type":"string"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"profileId","type":"string"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim1155","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"profileId","type":"string"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Claim721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"profileId","type":"string"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"profileId","type":"string"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit1155","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"profileId","type":"string"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Deposit721","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"preSigner","type":"address"},{"indexed":true,"internalType":"address","name":"newSigner","type":"address"}],"name":"SetSigner","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"currency","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct DataTypes.EIP712Signature","name":"sig","type":"tuple"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct DataTypes.EIP712Signature","name":"sig","type":"tuple"}],"name":"claim1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct DataTypes.EIP712Signature","name":"sig","type":"tuple"}],"name":"claim721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"deposit721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"profileId","type":"string"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"nftBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101165760003560e01c80636cc13ad5116100a25780639df558f1116100715780639df558f114610275578063ac05e80e14610288578063bc197c811461029b578063f1b81c83146102ba578063f23a6e61146102cd57600080fd5b80636cc13ad5146102045780637ac3c02f146102175780637ecebe001461023c5780638da5cb5b1461025c57600080fd5b8063299aeaa0116100e9578063299aeaa0146101b05780632a48ac9a146101c35780633644e515146101d6578063518daf40146101de5780636c19e783146101f157600080fd5b806301ffc9a71461011b578063040318521461014357806313af403514610164578063150b7a0214610179575b600080fd5b61012e610129366004611773565b6102ec565b60405190151581526020015b60405180910390f35b6101566101513660046117fe565b610323565b60405190815260200161013a565b610177610172366004611855565b610366565b005b610197610187366004611929565b630a85bd0160e11b949350505050565b6040516001600160e01b0319909116815260200161013a565b6101776101be3660046119ad565b610454565b6101776101d1366004611a30565b6106c1565b61015661082d565b6101566101ec366004611a30565b6108e1565b6101776101ff366004611855565b61092d565b610177610212366004611a30565b610a1a565b6002546001600160a01b03165b6040516001600160a01b03909116815260200161013a565b61015661024a366004611855565b60036020526000908152604090205481565b600054610224906201000090046001600160a01b031681565b610177610283366004611a8d565b610bd1565b610177610296366004611b1b565b610e43565b6101976102a9366004611bf7565b63bc197c8160e01b95945050505050565b6101776102c83660046119ad565b611033565b6101976102db366004611ca5565b63f23a6e6160e01b95945050505050565b60006001600160e01b03198216630271189760e51b148061031d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600060048484604051610337929190611d0e565b90815260408051602092819003830190206001600160a01b0385166000908152925290205490505b9392505050565b6000546201000090046001600160a01b031633146103ba5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b6001600160a01b0381166103ff5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b60448201526064016103b1565b6000805462010000600160b01b031916620100006001600160a01b038416908102919091178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b6002600154036104765760405162461bcd60e51b81526004016103b190611d1e565b60026001819055506105646105527f5392ace56d98226da428c802e9a77aeed431ea769e6126189a38d5d822e8bfd088886040516104b5929190611d0e565b60408051918290039091206001600160a01b03891660009081526003602052918220805491928a928a928a926104ea83611d6b565b909155506040805160208101979097528601949094526001600160a01b0392831660608681019190915292909116608085015260a084015260c083019190915284013560e0820152610100015b6040516020818303038152906040528051906020012061129b565b6002546001600160a01b0316836112e2565b60058686604051610576929190611d0e565b90815260408051602092819003830190206001600160a01b03861660009081529083528181208582529092529020546001146105c45760405162461bcd60e51b81526004016103b190611d8a565b6000600587876040516105d8929190611d0e565b90815260408051602092819003830181206001600160a01b03888116600081815292865284832089845290955292902093909355632142170760e11b83523060048401528616602483015260448201849052906342842e0e90606401600060405180830381600087803b15801561064e57600080fd5b505af1158015610662573d6000803e3d6000fd5b50505050826001600160a01b0316846001600160a01b03167f526c84184412ab9283599ca963d15aa3452f3840696bdfe7f18f412abc4322c08888866040516106ad93929190611de1565b60405180910390a350506001805550505050565b6002600154036106e35760405162461bcd60e51b81526004016103b190611d1e565b60026001556040516370a0823160e01b815233600482015281906001600160a01b038416906370a0823190602401602060405180830381865afa15801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107529190611e05565b10156107705760405162461bcd60e51b81526004016103b190611d8a565b6107856001600160a01b03831633308461130d565b8060048585604051610798929190611d0e565b90815260200160405180910390206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008282546107d89190611e1e565b9250508190555080826001600160a01b03167fd327b35e36b3981157588978d60961f5c09dc2926008abb81dd77b1197a416ed868660405161081b929190611e36565b60405180910390a35050600180555050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61087760408051808201909152600a81526910de58995c95985d5b1d60b21b602082015290565b80516020918201206040805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000600585856040516108f5929190611d0e565b90815260408051602092819003830190206001600160a01b039590951660009081529482528085209385529290525090205492915050565b6000546201000090046001600160a01b0316331461097c5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064016103b1565b6001600160a01b0381166109c85760405162461bcd60e51b81526020600482015260136024820152723d32b9379030b2323932b9b99039b4b3b732b960691b60448201526064016103b1565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f3271c8694494a7cc76cd185c743e9ee6b515a043ea98c0db7f5ca112f694add490600090a35050565b600260015403610a3c5760405162461bcd60e51b81526004016103b190611d1e565b60026001556040516331a9108f60e11b81526004810182905233906001600160a01b03841690636352211e90602401602060405180830381865afa158015610a88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aac9190611e4a565b6001600160a01b031614610af25760405162461bcd60e51b815260206004820152600d60248201526c2727aa2fa7232a2fa7aba722a960991b60448201526064016103b1565b604051632142170760e11b8152336004820152306024820152604481018290526001600160a01b038316906342842e0e90606401600060405180830381600087803b158015610b4057600080fd5b505af1158015610b54573d6000803e3d6000fd5b50505050600160058585604051610b6c929190611d0e565b90815260408051602092819003830181206001600160a01b0387166000818152918552838220878352909452919091209290925582917fd84bb2a0262bdc1cb06cbb1d695cb25ddac5d1df521db34ff90c82830b3d2f279061081b9088908890611e36565b600260015403610bf35760405162461bcd60e51b81526004016103b190611d1e565b6002600181905550610ccb6105527f8f7e00a8b308462e36c6afe99c150bbceb16ea6f707d605e4665ef87ac3e85ae8989604051610c32929190611d0e565b604051809103902088888888600360008e6001600160a01b03166001600160a01b031681526020019081526020016000206000815480929190610c7490611d6b565b909155506040805160208101989098528701959095526001600160a01b0393841660608781019190915293909216608086015260a085015260c084015260e083019190915284013561010082015261012001610537565b8160058888604051610cde929190611d0e565b90815260408051602092819003830190206001600160a01b03881660009081529083528181208782529092529020541015610d2b5760405162461bcd60e51b81526004016103b190611d8a565b8160058888604051610d3e929190611d0e565b90815260408051602092819003830190206001600160a01b038816600090815290835281812087825290925281208054909190610d7c908490611e67565b9091555050604051637921219560e11b81526001600160a01b0385169063f242432a90610db3903090899088908890600401611e7e565b600060405180830381600087803b158015610dcd57600080fd5b505af1158015610de1573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b03167fc5e2804d861e57f4456eb96140e3ff0fb0575ca3c01e400cfd977c49f5b3985689898787604051610e2e9493929190611eb6565b60405180910390a35050600180555050505050565b600260015403610e655760405162461bcd60e51b81526004016103b190611d1e565b6002600155604051627eeac760e11b81523360048201526024810183905281906001600160a01b0385169062fdd58e90604401602060405180830381865afa158015610eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed99190611e05565b1015610f275760405162461bcd60e51b815260206004820152601860248201527f494e53554646494349454e545f4e46545f42414c414e4345000000000000000060448201526064016103b1565b604051637921219560e11b81526001600160a01b0384169063f242432a90610f59903390309087908790600401611e7e565b600060405180830381600087803b158015610f7357600080fd5b505af1158015610f87573d6000803e3d6000fd5b505050508060058686604051610f9e929190611d0e565b90815260408051602092819003830190206001600160a01b038716600090815290835281812086825290925281208054909190610fdc908490611e1e565b925050819055508082846001600160a01b03167f170b18413ecb511b6a3640cc3dcc6be16d3aeba6bbac666482aa5227122f21b78888604051611020929190611e36565b60405180910390a4505060018055505050565b6002600154036110555760405162461bcd60e51b81526004016103b190611d1e565b60026001819055506110946105527f42fc83b3b29058e482c39113a19a743909b5da350eb79c46d136721e523359e088886040516104b5929190611d0e565b81600487876040516110a7929190611d0e565b90815260408051602092819003830190206001600160a01b0387166000908152925290205410156110ea5760405162461bcd60e51b81526004016103b190611d8a565b81600487876040516110fd929190611d0e565b90815260200160405180910390206000856001600160a01b03166001600160a01b03168152602001908152602001600020600082825461113d9190611e67565b9091555061115790506001600160a01b038416858461137e565b826001600160a01b0316846001600160a01b03167fec7a840e89899a7c322d43fd84de1d0461756edd0bc7150e5a3d4430c1e86b308888866040516106ad93929190611de1565b6001600160a01b03163b151590565b600054610100900460ff166111d45760405162461bcd60e51b81526004016103b190611edd565b6001600160a01b0381166112195760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b60448201526064016103b1565b6000805462010000600160b01b031916620100006001600160a01b0384169081029190911782556040519091907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a350565b600054610100900460ff166112955760405162461bcd60e51b81526004016103b190611edd565b60018055565b60006112a561082d565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050919050565b61130883836112f46020850185611f28565b8460200135856040013586606001356113ae565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526113789085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611520565b50505050565b6040516001600160a01b03831660248201526044810182905261130890849063a9059cbb60e01b90606401611341565b428110156113f25760405162461bcd60e51b8152602060048201526011602482015270111150511312539157d15610d151511151607a1b60448201526064016103b1565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156114625760405162461bcd60e51b815260206004820152601960248201527f494e56414c49445f5349474e41545552455f535f5641554c450000000000000060448201526064016103b1565b6040805160008082526020820180845289905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa1580156114b6573d6000803e3d6000fd5b505050602060405103519050856001600160a01b0316816001600160a01b0316146115175760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b60448201526064016103b1565b50505050505050565b6000611575826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115f29092919063ffffffff16565b80519091501561130857808060200190518101906115939190611f4b565b6113085760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103b1565b60606116018484600085611609565b949350505050565b60608247101561166a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103b1565b6001600160a01b0385163b6116c15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103b1565b600080866001600160a01b031685876040516116dd9190611f99565b60006040518083038185875af1925050503d806000811461171a576040519150601f19603f3d011682016040523d82523d6000602084013e61171f565b606091505b509150915061172f82828661173a565b979650505050505050565b6060831561174957508161035f565b8251156117595782518084602001fd5b8160405162461bcd60e51b81526004016103b19190611fb5565b60006020828403121561178557600080fd5b81356001600160e01b03198116811461035f57600080fd5b60008083601f8401126117af57600080fd5b50813567ffffffffffffffff8111156117c757600080fd5b6020830191508360208285010111156117df57600080fd5b9250929050565b6001600160a01b03811681146117fb57600080fd5b50565b60008060006040848603121561181357600080fd5b833567ffffffffffffffff81111561182a57600080fd5b6118368682870161179d565b909450925050602084013561184a816117e6565b809150509250925092565b60006020828403121561186757600080fd5b813561035f816117e6565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156118b1576118b1611872565b604052919050565b600082601f8301126118ca57600080fd5b813567ffffffffffffffff8111156118e4576118e4611872565b6118f7601f8201601f1916602001611888565b81815284602083860101111561190c57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561193f57600080fd5b843561194a816117e6565b9350602085013561195a816117e6565b925060408501359150606085013567ffffffffffffffff81111561197d57600080fd5b611989878288016118b9565b91505092959194509250565b6000608082840312156119a757600080fd5b50919050565b60008060008060008061010087890312156119c757600080fd5b863567ffffffffffffffff8111156119de57600080fd5b6119ea89828a0161179d565b90975095505060208701356119fe816117e6565b93506040870135611a0e816117e6565b925060608701359150611a248860808901611995565b90509295509295509295565b60008060008060608587031215611a4657600080fd5b843567ffffffffffffffff811115611a5d57600080fd5b611a698782880161179d565b9095509350506020850135611a7d816117e6565b9396929550929360400135925050565b6000806000806000806000610120888a031215611aa957600080fd5b873567ffffffffffffffff811115611ac057600080fd5b611acc8a828b0161179d565b9098509650506020880135611ae0816117e6565b94506040880135611af0816117e6565b93506060880135925060808801359150611b0d8960a08a01611995565b905092959891949750929550565b600080600080600060808688031215611b3357600080fd5b853567ffffffffffffffff811115611b4a57600080fd5b611b568882890161179d565b9096509450506020860135611b6a816117e6565b94979396509394604081013594506060013592915050565b600082601f830112611b9357600080fd5b8135602067ffffffffffffffff821115611baf57611baf611872565b8160051b611bbe828201611888565b9283528481018201928281019087851115611bd857600080fd5b83870192505b8483101561172f57823582529183019190830190611bde565b600080600080600060a08688031215611c0f57600080fd5b8535611c1a816117e6565b94506020860135611c2a816117e6565b9350604086013567ffffffffffffffff80821115611c4757600080fd5b611c5389838a01611b82565b94506060880135915080821115611c6957600080fd5b611c7589838a01611b82565b93506080880135915080821115611c8b57600080fd5b50611c98888289016118b9565b9150509295509295909350565b600080600080600060a08688031215611cbd57600080fd5b8535611cc8816117e6565b94506020860135611cd8816117e6565b93506040860135925060608601359150608086013567ffffffffffffffff811115611d0257600080fd5b611c98888289016118b9565b8183823760009101908152919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b018201611d8357611d83611d55565b5060010190565b602080825260149082015273494e53554646494349454e545f42414c414e434560601b604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000611df5604083018587611db8565b9050826020830152949350505050565b600060208284031215611e1757600080fd5b5051919050565b60008219821115611e3157611e31611d55565b500190565b602081526000611601602083018486611db8565b600060208284031215611e5c57600080fd5b815161035f816117e6565b600082821015611e7957611e79611d55565b500390565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b606081526000611eca606083018688611db8565b6020830194909452506040015292915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060208284031215611f3a57600080fd5b813560ff8116811461035f57600080fd5b600060208284031215611f5d57600080fd5b8151801515811461035f57600080fd5b60005b83811015611f88578181015183820152602001611f70565b838111156113785750506000910152565b60008251611fab818460208701611f6d565b9190910192915050565b6020815260008251806020840152611fd4816040850160208701611f6d565b601f01601f1916919091016040019291505056fea264697066735822122010f41187722cd2d4fb07f535b4d61169dfd75e1b0fb510b2e78c8f288fb370e564736f6c634300080e0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.