Contract Address Details

0xeF5a561Bd19D8838306CAe855C74136B9cA4713B

Contract Name
Periphery
Creator
0xe01c8d–e085f7 at 0x94ed8e–598a5a
Balance
0 CSB
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
84440158
Contract name:
Periphery




Optimization enabled
true
Compiler version
v0.8.10+commit.fc410830




Optimization runs
200
EVM Version
default




Verified at
2022-07-26T12:58:22.151272Z

Contract source code

// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;

library DataTypes {
    struct MigrateData {
        address account;
        string handle;
        string uri;
        address[] toAddresses;
        bytes32 linkType;
    }

    struct CreateCharacterData {
        address to;
        string handle;
        string uri;
        address linkModule;
        bytes linkModuleInitData;
    }

    struct createThenLinkCharacterData {
        uint256 fromCharacterId;
        address to;
        bytes32 linkType;
    }

    struct linkNoteData {
        uint256 fromCharacterId;
        uint256 toCharacterId;
        uint256 toNoteId;
        bytes32 linkType;
        bytes data;
    }

    struct unlinkNoteData {
        uint256 fromCharacterId;
        uint256 toCharacterId;
        uint256 toNoteId;
        bytes32 linkType;
    }

    struct linkCharacterData {
        uint256 fromCharacterId;
        uint256 toCharacterId;
        bytes32 linkType;
        bytes data;
    }

    struct unlinkCharacterData {
        uint256 fromCharacterId;
        uint256 toCharacterId;
        bytes32 linkType;
    }

    struct linkERC721Data {
        uint256 fromCharacterId;
        address tokenAddress;
        uint256 tokenId;
        bytes32 linkType;
        bytes data;
    }

    struct unlinkERC721Data {
        uint256 fromCharacterId;
        address tokenAddress;
        uint256 tokenId;
        bytes32 linkType;
    }

    struct linkAddressData {
        uint256 fromCharacterId;
        address ethAddress;
        bytes32 linkType;
        bytes data;
    }

    struct unlinkAddressData {
        uint256 fromCharacterId;
        address ethAddress;
        bytes32 linkType;
    }

    struct linkAnyUriData {
        uint256 fromCharacterId;
        string toUri;
        bytes32 linkType;
        bytes data;
    }

    struct unlinkAnyUriData {
        uint256 fromCharacterId;
        string toUri;
        bytes32 linkType;
    }

    struct linkLinklistData {
        uint256 fromCharacterId;
        uint256 toLinkListId;
        bytes32 linkType;
        bytes data;
    }

    struct unlinkLinklistData {
        uint256 fromCharacterId;
        uint256 toLinkListId;
        bytes32 linkType;
    }

    struct setLinkModule4CharacterData {
        uint256 characterId;
        address linkModule;
        bytes linkModuleInitData;
    }

    struct setLinkModule4NoteData {
        uint256 characterId;
        uint256 noteId;
        address linkModule;
        bytes linkModuleInitData;
    }

    struct setLinkModule4LinklistData {
        uint256 linklistId;
        address linkModule;
        bytes linkModuleInitData;
    }

    struct setLinkModule4ERC721Data {
        address tokenAddress;
        uint256 tokenId;
        address linkModule;
        bytes linkModuleInitData;
    }

    struct setLinkModule4AddressData {
        address account;
        address linkModule;
        bytes linkModuleInitData;
    }

    struct setMintModule4NoteData {
        uint256 characterId;
        uint256 noteId;
        address mintModule;
        bytes mintModuleInitData;
    }

    struct linkCharactersInBatchData {
        uint256 fromCharacterId;
        uint256[] toCharacterIds;
        bytes[] data;
        address[] toAddresses;
        bytes32 linkType;
    }

    struct LinkData {
        uint256 linklistId;
        uint256 linkItemType;
        uint256 linkingCharacterId;
        address linkingAddress;
        uint256 linkingLinklistId;
        bytes32 linkKey;
    }

    struct PostNoteData {
        uint256 characterId;
        string contentUri;
        address linkModule;
        bytes linkModuleInitData;
        address mintModule;
        bytes mintModuleInitData;
        bool locked;
    }

    struct MintNoteData {
        uint256 characterId;
        uint256 noteId;
        address to;
        bytes mintModuleData;
    }

    // character struct
    struct Character {
        uint256 characterId;
        string handle;
        string uri;
        uint256 noteCount;
        address socialToken;
        address linkModule;
    }

    // note struct
    struct Note {
        bytes32 linkItemType; // type of note with link
        bytes32 linkKey; // if linkKey is not empty, it is a note with link
        string contentUri;
        address linkModule;
        address mintModule;
        address mintNFT;
        bool deleted;
        bool locked;
    }

    struct CharacterLinkStruct {
        uint256 fromCharacterId;
        uint256 toCharacterId;
        bytes32 linkType;
    }

    struct NoteStruct {
        uint256 characterId;
        uint256 noteId;
    }

    struct ERC721Struct {
        address tokenAddress;
        uint256 erc721TokenId;
    }
}

interface IWeb3Entry {
    function initialize(
        string calldata _name,
        string calldata _symbol,
        address _linklistContract,
        address _mintNFTImpl,
        address _periphery,
        address resolver
    ) external;

    function createCharacter(DataTypes.CreateCharacterData calldata vars) external;

    function setHandle(uint256 characterId, string calldata newHandle) external;

    function setSocialToken(uint256 characterId, address tokenAddress) external;

    function setCharacterUri(uint256 characterId, string calldata newUri) external;

    function setPrimaryCharacterId(uint256 characterId) external;

    function setOperator(uint256 characterId, address operator) external;

    function setLinklistUri(uint256 linkListId, string calldata uri) external;

    function linkAddress(DataTypes.linkAddressData calldata vars) external;

    function unlinkAddress(DataTypes.unlinkAddressData calldata vars) external;

    function linkCharacter(DataTypes.linkCharacterData calldata vars) external;

    function unlinkCharacter(DataTypes.unlinkCharacterData calldata vars) external;

    function createThenLinkCharacter(DataTypes.createThenLinkCharacterData calldata vars) external;

    function linkNote(DataTypes.linkNoteData calldata vars) external;

    function unlinkNote(DataTypes.unlinkNoteData calldata vars) external;

    function linkERC721(DataTypes.linkERC721Data calldata vars) external;

    function unlinkERC721(DataTypes.unlinkERC721Data calldata vars) external;

    function linkAnyUri(DataTypes.linkAnyUriData calldata vars) external;

    function unlinkAnyUri(DataTypes.unlinkAnyUriData calldata vars) external;

    /*
    function linkCharacterLink(
        uint256 fromCharacterId,
        DataTypes.CharacterLinkStruct calldata linkData,
        bytes32 linkType
    ) external;

    function unlinkCharacterLink(
        uint256 fromCharacterId,
        DataTypes.CharacterLinkStruct calldata linkData,
        bytes32 linkType
    ) external;
    */

    function linkLinklist(DataTypes.linkLinklistData calldata vars) external;

    function unlinkLinklist(DataTypes.unlinkLinklistData calldata vars) external;

    function setLinkModule4Character(DataTypes.setLinkModule4CharacterData calldata vars) external;

    function setLinkModule4Note(DataTypes.setLinkModule4NoteData calldata vars) external;

    function setLinkModule4Linklist(DataTypes.setLinkModule4LinklistData calldata vars) external;

    function setLinkModule4ERC721(DataTypes.setLinkModule4ERC721Data calldata vars) external;

    function setLinkModule4Address(DataTypes.setLinkModule4AddressData calldata vars) external;

    function mintNote(DataTypes.MintNoteData calldata vars) external returns (uint256);

    function setMintModule4Note(DataTypes.setMintModule4NoteData calldata vars) external;

    function postNote(DataTypes.PostNoteData calldata vars) external returns (uint256);

    function setNoteUri(
        uint256 characterId,
        uint256 noteId,
        string calldata newUri
    ) external;

    function lockNote(uint256 characterId, uint256 noteId) external;

    function deleteNote(uint256 characterId, uint256 noteId) external;

    function postNote4Character(DataTypes.PostNoteData calldata postNoteData, uint256 toCharacterId)
        external
        returns (uint256);

    function postNote4Address(DataTypes.PostNoteData calldata noteData, address ethAddress)
        external
        returns (uint256);

    function postNote4Linklist(DataTypes.PostNoteData calldata noteData, uint256 toLinklistId)
        external
        returns (uint256);

    function postNote4Note(
        DataTypes.PostNoteData calldata postNoteData,
        DataTypes.NoteStruct calldata note
    ) external returns (uint256);

    function postNote4ERC721(
        DataTypes.PostNoteData calldata postNoteData,
        DataTypes.ERC721Struct calldata erc721
    ) external returns (uint256);

    function postNote4AnyUri(DataTypes.PostNoteData calldata postNoteData, string calldata uri)
        external
        returns (uint256);

    function getPrimaryCharacterId(address account) external view returns (uint256);

    function isPrimaryCharacter(uint256 characterId) external view returns (bool);

    function getCharacter(uint256 characterId) external view returns (DataTypes.Character memory);

    function getCharacterByHandle(string calldata handle)
        external
        view
        returns (DataTypes.Character memory);

    function getHandle(uint256 characterId) external view returns (string memory);

    function getCharacterUri(uint256 characterId) external view returns (string memory);

    function getOperator(uint256 characterId) external view returns (address);

    function getNote(uint256 characterId, uint256 noteId)
        external
        view
        returns (DataTypes.Note memory);

    function getLinkModule4Address(address account) external view returns (address);

    function getLinkModule4Linklist(uint256 tokenId) external view returns (address);

    function getLinkModule4ERC721(address tokenAddress, uint256 tokenId)
        external
        view
        returns (address);

    function getLinklistUri(uint256 tokenId) external view returns (string memory);

    function getLinklistId(uint256 characterId, bytes32 linkType) external view returns (uint256);

    function getLinklistType(uint256 linkListId) external view returns (bytes32);

    function getLinklistContract() external view returns (address);

    function getRevision() external pure returns (uint256);
}

interface ILinklist {
    function mint(
        address to,
        bytes32 linkType,
        uint256 tokenId
    ) external;

    function setTakeOver(
        uint256 tokenId,
        address to,
        uint256 characterId
    ) external;

    function setUri(uint256 tokenId, string memory uri) external;

    /////////////////////////////////
    // linking Character
    /////////////////////////////////
    function addLinkingCharacterId(uint256 tokenId, uint256 toCharacterId) external;

    function removeLinkingCharacterId(uint256 tokenId, uint256 toCharacterId) external;

    function getLinkingCharacterIds(uint256 tokenId) external view returns (uint256[] memory);

    function getLinkingCharacterListLength(uint256 tokenId) external view returns (uint256);

    /////////////////////////////////
    // linking Note
    /////////////////////////////////
    function addLinkingNote(
        uint256 tokenId,
        uint256 toCharacterId,
        uint256 toNoteId
    ) external returns (bytes32);

    function removeLinkingNote(
        uint256 tokenId,
        uint256 toCharacterId,
        uint256 toNoteId
    ) external;

    function getLinkingNotes(uint256 tokenId)
        external
        view
        returns (DataTypes.NoteStruct[] memory results);

    function getLinkingNote(bytes32 linkKey) external view returns (DataTypes.NoteStruct memory);

    function getLinkingNoteListLength(uint256 tokenId) external view returns (uint256);

    function addLinkingCharacterLink(
        uint256 tokenId,
        DataTypes.CharacterLinkStruct calldata linkData
    ) external;

    function removeLinkingCharacterLink(
        uint256 tokenId,
        DataTypes.CharacterLinkStruct calldata linkData
    ) external;

    function getLinkingCharacterLinks(uint256 tokenId)
        external
        view
        returns (DataTypes.CharacterLinkStruct[] memory results);

    function getLinkingCharacterLink(bytes32 linkKey)
        external
        view
        returns (DataTypes.CharacterLinkStruct memory);

    function getLinkingCharacterLinkListLength(uint256 tokenId) external view returns (uint256);

    /////////////////////////////////
    // linking ERC721
    /////////////////////////////////
    function addLinkingERC721(
        uint256 tokenId,
        address tokenAddress,
        uint256 erc721TokenId
    ) external returns (bytes32);

    function removeLinkingERC721(
        uint256 tokenId,
        address tokenAddress,
        uint256 erc721TokenId
    ) external;

    function getLinkingERC721s(uint256 tokenId)
        external
        view
        returns (DataTypes.ERC721Struct[] memory results);

    function getLinkingERC721(bytes32 linkKey)
        external
        view
        returns (DataTypes.ERC721Struct memory);

    function getLinkingERC721ListLength(uint256 tokenId) external view returns (uint256);

    /////////////////////////////////
    // linking Address
    /////////////////////////////////
    function addLinkingAddress(uint256 tokenId, address ethAddress) external;

    function removeLinkingAddress(uint256 tokenId, address ethAddress) external;

    function getLinkingAddresses(uint256 tokenId) external view returns (address[] memory);

    function getLinkingAddressListLength(uint256 tokenId) external view returns (uint256);

    /////////////////////////////////
    // linking Any
    /////////////////////////////////
    function addLinkingAnyUri(uint256 tokenId, string memory toUri) external returns (bytes32);

    function removeLinkingAnyUri(uint256 tokenId, string memory toUri) external;

    function getLinkingAnyUris(uint256 tokenId) external view returns (string[] memory results);

    function getLinkingAnyUri(bytes32 linkKey) external view returns (string memory);

    function getLinkingAnyListLength(uint256 tokenId) external view returns (uint256);

    /////////////////////////////////
    // linking Linklist
    /////////////////////////////////
    function addLinkingLinklistId(uint256 tokenId, uint256 linklistId) external;

    function removeLinkingLinklistId(uint256 tokenId, uint256 linklistId) external;

    function getLinkingLinklistIds(uint256 tokenId) external view returns (uint256[] memory);

    function getLinkingLinklistLength(uint256 tokenId) external view returns (uint256);

    function getCurrentTakeOver(uint256 tokenId) external view returns (uint256);

    function getLinkType(uint256 tokenId) external view returns (bytes32);

    function Uri(uint256 tokenId) external view returns (string memory);
}

// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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

/**
 * @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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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);
}

// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`.
        // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`.
        // This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`.
        // Using an algorithm similar to the msb computation, we are able to compute `result = 2**(k/2)` which is a
        // good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1;
        uint256 x = a;
        if (x >> 128 > 0) {
            x >>= 128;
            result <<= 64;
        }
        if (x >> 64 > 0) {
            x >>= 64;
            result <<= 32;
        }
        if (x >> 32 > 0) {
            x >>= 32;
            result <<= 16;
        }
        if (x >> 16 > 0) {
            x >>= 16;
            result <<= 8;
        }
        if (x >> 8 > 0) {
            x >>= 8;
            result <<= 4;
        }
        if (x >> 4 > 0) {
            x >>= 4;
            result <<= 2;
        }
        if (x >> 2 > 0) {
            result <<= 1;
        }

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        uint256 result = sqrt(a);
        if (rounding == Rounding.Up && result * result < a) {
            result += 1;
        }
        return result;
    }
}

contract Periphery is Initializable {
    address public web3Entry;

    bool private linklistInitialized;
    address public linklist;

    function initialize(address _web3Entry, address _linklist) external initializer {
        web3Entry = _web3Entry;
        linklist = _linklist;
    }

    function getNotesByCharacterId(
        uint256 characterId,
        uint256 offset,
        uint256 limit
    ) external view returns (DataTypes.Note[] memory results) {
        uint256 count = IWeb3Entry(web3Entry).getCharacter(characterId).noteCount;
        limit = Math.min(limit, count - offset);

        results = new DataTypes.Note[](limit);
        if (offset >= count) return results;

        for (uint256 i = offset; i < offset + limit; i++) {
            results[i - offset] = IWeb3Entry(web3Entry).getNote(characterId, i);
        }
    }

    function getLinkingCharacterIds(uint256 fromCharacterId, bytes32 linkType)
        external
        view
        returns (uint256[] memory results)
    {
        uint256 linklistId = IWeb3Entry(web3Entry).getLinklistId(fromCharacterId, linkType);
        uint256[] memory linkingCharacterIds = ILinklist(linklist).getLinkingCharacterIds(
            linklistId
        );

        uint256 len = linkingCharacterIds.length;

        uint256 count;
        for (uint256 i = 0; i < len; i++) {
            if (characterExists(linkingCharacterIds[i])) {
                count++;
            }
        }

        results = new uint256[](count);
        uint256 j;
        for (uint256 i = 0; i < len; i++) {
            if (characterExists(linkingCharacterIds[i])) {
                results[j] = linkingCharacterIds[i];
                j++;
            }
        }
    }

    function getLinkingCharacterId(bytes32 linkKey) external pure returns (uint256 characterId) {
        characterId = uint256(linkKey);
    }

    function getLinkingNotes(uint256 fromCharacterId, bytes32 linkType)
        external
        view
        returns (DataTypes.Note[] memory results)
    {
        uint256 linklistId = IWeb3Entry(web3Entry).getLinklistId(fromCharacterId, linkType);
        DataTypes.NoteStruct[] memory notes = ILinklist(linklist).getLinkingNotes(linklistId);
        results = new DataTypes.Note[](notes.length);
        for (uint256 i = 0; i < notes.length; i++) {
            results[i] = IWeb3Entry(web3Entry).getNote(notes[i].characterId, notes[i].noteId);
        }
    }

    function getLinkingNote(bytes32 linkKey) external view returns (DataTypes.NoteStruct memory) {
        return ILinklist(linklist).getLinkingNote(linkKey);
    }

    function getLinkingERC721s(uint256 fromCharacterId, bytes32 linkType)
        external
        view
        returns (DataTypes.ERC721Struct[] memory results)
    {
        uint256 linklistId = IWeb3Entry(web3Entry).getLinklistId(fromCharacterId, linkType);
        return ILinklist(linklist).getLinkingERC721s(linklistId);
    }

    function getLinkingERC721(bytes32 linkKey)
        external
        view
        returns (DataTypes.ERC721Struct memory)
    {
        return ILinklist(linklist).getLinkingERC721(linkKey);
    }

    function getLinkingAnyUris(uint256 fromCharacterId, bytes32 linkType)
        external
        view
        returns (string[] memory results)
    {
        uint256 linklistId = IWeb3Entry(web3Entry).getLinklistId(fromCharacterId, linkType);
        return ILinklist(linklist).getLinkingAnyUris(linklistId);
    }

    function getLinkingAnyUri(bytes32 linkKey) external view returns (string memory) {
        return ILinklist(linklist).getLinkingAnyUri(linkKey);
    }

    function getLinkingAddresses(uint256 fromCharacterId, bytes32 linkType)
        external
        view
        returns (address[] memory)
    {
        uint256 linklistId = IWeb3Entry(web3Entry).getLinklistId(fromCharacterId, linkType);
        return ILinklist(linklist).getLinkingAddresses(linklistId);
    }

    function getLinkingAddress(bytes32 linkKey) external pure returns (address) {
        return address(uint160(uint256(linkKey)));
    }

    function getLinkingLinklistIds(uint256 fromCharacterId, bytes32 linkType)
        external
        view
        returns (uint256[] memory linklistIds)
    {
        uint256 linklistId = IWeb3Entry(web3Entry).getLinklistId(fromCharacterId, linkType);
        return ILinklist(linklist).getLinkingLinklistIds(linklistId);
    }

    function getLinkingLinklistId(bytes32 linkKey) external pure returns (uint256 linklistId) {
        linklistId = uint256(linkKey);
    }

    function characterExists(uint256 characterId) internal view returns (bool) {
        return IWeb3Entry(web3Entry).getCharacter(characterId).characterId != 0;
    }

    function linkCharactersInBatch(DataTypes.linkCharactersInBatchData calldata vars) external {
        require(vars.toCharacterIds.length == vars.data.length, "ArrayLengthMismatch");

        for (uint256 i = 0; i < vars.toCharacterIds.length; i++) {
            IWeb3Entry(web3Entry).linkCharacter(
                DataTypes.linkCharacterData({
                    fromCharacterId: vars.fromCharacterId,
                    toCharacterId: vars.toCharacterIds[i],
                    linkType: vars.linkType,
                    data: vars.data[i]
                })
            );
        }

        for (uint256 i = 0; i < vars.toAddresses.length; i++) {
            IWeb3Entry(web3Entry).createThenLinkCharacter(
                DataTypes.createThenLinkCharacterData({
                    fromCharacterId: vars.fromCharacterId,
                    to: vars.toAddresses[i],
                    linkType: vars.linkType
                })
            );
        }
    }

    function sync(
        address account,
        string calldata handle,
        string calldata uri,
        address[] calldata toAddresses,
        bytes32 linkType
    ) external {
        _migrate(account, handle, uri, toAddresses, linkType);
    }

    function migrate(DataTypes.MigrateData calldata vars) external {
        _migrate(vars.account, vars.handle, vars.uri, vars.toAddresses, vars.linkType);
    }

    function _migrate(
        address account,
        string memory handle,
        string memory uri,
        address[] memory toAddresses,
        bytes32 linkType
    ) internal {
        uint256 fromProfileId = IWeb3Entry(web3Entry).getPrimaryCharacterId(account);
        if (fromProfileId == 0) {
            // create character first
            IWeb3Entry(web3Entry).createCharacter(
                DataTypes.CreateCharacterData({
                    to: account,
                    handle: handle,
                    uri: uri,
                    linkModule: address(0),
                    linkModuleInitData: ""
                })
            );
            // get primary character id
            fromProfileId = IWeb3Entry(web3Entry).getPrimaryCharacterId(account);
        } else {
            //            if (bytes(handle).length > 0) {
            //                // set handle
            //                IWeb3Entry(web3Entry).setHandle(fromProfileId, handle);
            //            }

            if (bytes(uri).length > 0) {
                // set character uri
                IWeb3Entry(web3Entry).setCharacterUri(fromProfileId, uri);
            }
        }

        // link
        for (uint256 i = 0; i < toAddresses.length; i++) {
            uint256 toProfileId = IWeb3Entry(web3Entry).getPrimaryCharacterId(toAddresses[i]);
            if (toProfileId == 0) {
                IWeb3Entry(web3Entry).createThenLinkCharacter(
                    DataTypes.createThenLinkCharacterData({
                        fromCharacterId: fromProfileId,
                        to: toAddresses[i],
                        linkType: linkType
                    })
                );
            } else {
                IWeb3Entry(web3Entry).linkCharacter(
                    DataTypes.linkCharacterData({
                        fromCharacterId: fromProfileId,
                        toCharacterId: toProfileId,
                        linkType: linkType,
                        data: ""
                    })
                );
            }
        }
    }
}

        

Contract ABI

[{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"pure","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getLinkingAddress","inputs":[{"type":"bytes32","name":"linkKey","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getLinkingAddresses","inputs":[{"type":"uint256","name":"fromCharacterId","internalType":"uint256"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getLinkingAnyUri","inputs":[{"type":"bytes32","name":"linkKey","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string[]","name":"results","internalType":"string[]"}],"name":"getLinkingAnyUris","inputs":[{"type":"uint256","name":"fromCharacterId","internalType":"uint256"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"characterId","internalType":"uint256"}],"name":"getLinkingCharacterId","inputs":[{"type":"bytes32","name":"linkKey","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"results","internalType":"uint256[]"}],"name":"getLinkingCharacterIds","inputs":[{"type":"uint256","name":"fromCharacterId","internalType":"uint256"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct DataTypes.ERC721Struct","components":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"erc721TokenId","internalType":"uint256"}]}],"name":"getLinkingERC721","inputs":[{"type":"bytes32","name":"linkKey","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"results","internalType":"struct DataTypes.ERC721Struct[]","components":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"erc721TokenId","internalType":"uint256"}]}],"name":"getLinkingERC721s","inputs":[{"type":"uint256","name":"fromCharacterId","internalType":"uint256"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"linklistId","internalType":"uint256"}],"name":"getLinkingLinklistId","inputs":[{"type":"bytes32","name":"linkKey","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"linklistIds","internalType":"uint256[]"}],"name":"getLinkingLinklistIds","inputs":[{"type":"uint256","name":"fromCharacterId","internalType":"uint256"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct DataTypes.NoteStruct","components":[{"type":"uint256","name":"characterId","internalType":"uint256"},{"type":"uint256","name":"noteId","internalType":"uint256"}]}],"name":"getLinkingNote","inputs":[{"type":"bytes32","name":"linkKey","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"results","internalType":"struct DataTypes.Note[]","components":[{"type":"bytes32","name":"linkItemType","internalType":"bytes32"},{"type":"bytes32","name":"linkKey","internalType":"bytes32"},{"type":"string","name":"contentUri","internalType":"string"},{"type":"address","name":"linkModule","internalType":"address"},{"type":"address","name":"mintModule","internalType":"address"},{"type":"address","name":"mintNFT","internalType":"address"},{"type":"bool","name":"deleted","internalType":"bool"},{"type":"bool","name":"locked","internalType":"bool"}]}],"name":"getLinkingNotes","inputs":[{"type":"uint256","name":"fromCharacterId","internalType":"uint256"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"results","internalType":"struct DataTypes.Note[]","components":[{"type":"bytes32","name":"linkItemType","internalType":"bytes32"},{"type":"bytes32","name":"linkKey","internalType":"bytes32"},{"type":"string","name":"contentUri","internalType":"string"},{"type":"address","name":"linkModule","internalType":"address"},{"type":"address","name":"mintModule","internalType":"address"},{"type":"address","name":"mintNFT","internalType":"address"},{"type":"bool","name":"deleted","internalType":"bool"},{"type":"bool","name":"locked","internalType":"bool"}]}],"name":"getNotesByCharacterId","inputs":[{"type":"uint256","name":"characterId","internalType":"uint256"},{"type":"uint256","name":"offset","internalType":"uint256"},{"type":"uint256","name":"limit","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_web3Entry","internalType":"address"},{"type":"address","name":"_linklist","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"linkCharactersInBatch","inputs":[{"type":"tuple","name":"vars","internalType":"struct DataTypes.linkCharactersInBatchData","components":[{"type":"uint256","name":"fromCharacterId","internalType":"uint256"},{"type":"uint256[]","name":"toCharacterIds","internalType":"uint256[]"},{"type":"bytes[]","name":"data","internalType":"bytes[]"},{"type":"address[]","name":"toAddresses","internalType":"address[]"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"linklist","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrate","inputs":[{"type":"tuple","name":"vars","internalType":"struct DataTypes.MigrateData","components":[{"type":"address","name":"account","internalType":"address"},{"type":"string","name":"handle","internalType":"string"},{"type":"string","name":"uri","internalType":"string"},{"type":"address[]","name":"toAddresses","internalType":"address[]"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"sync","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"string","name":"handle","internalType":"string"},{"type":"string","name":"uri","internalType":"string"},{"type":"address[]","name":"toAddresses","internalType":"address[]"},{"type":"bytes32","name":"linkType","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"web3Entry","inputs":[]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b5061272d806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80635f799cc6116100ad578063d55a006011610071578063d55a0060146102cc578063d85d04f4146102b0578063dfc1e2bf146102df578063e1332272146102f2578063e3d244281461030b57600080fd5b80635f799cc61461023d5780635fb8652e1461025d57806362c3ed301461027057806376ae90ef146102905780638654af27146102b057600080fd5b80632c422599116100f45780632c422599146101b65780633e7cb539146101c9578063485cc955146101da5780634a7906b9146101ef5780635440522b1461021d57600080fd5b806306bee8d4146101265780630f9b729c146101565780631964a421146101765780632260c7d214610196575b600080fd5b600154610139906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610169610164366004611953565b61031e565b60405161014d91906119db565b610189610184366004611aa6565b6104e7565b60405161014d9190611ac8565b6101a96101a4366004611aa6565b6105e0565b60405161014d9190611b2a565b6101696101c4366004611aa6565b6106cf565b6101396101d7366004611b6e565b90565b6101ed6101e8366004611b9c565b61092a565b005b6102026101fd366004611b6e565b610a7b565b6040805182518152602092830151928101929092520161014d565b61023061022b366004611b6e565b610af9565b60405161014d9190611bd5565b61025061024b366004611b6e565b610b77565b60405161014d9190611bf5565b6101ed61026b366004611c50565b610be9565b61028361027e366004611aa6565b610c9a565b60405161014d9190611d35565b6102a361029e366004611aa6565b610d89565b60405161014d9190611d95565b6102be6101d7366004611b6e565b60405190815260200161014d565b6101ed6102da366004611dee565b610e78565b6101a96102ed366004611aa6565b611131565b600054610139906201000090046001600160a01b031681565b6101ed610319366004611dee565b61134b565b6000805460405163dabb053160e01b815260048101869052606092916201000090046001600160a01b03169063dabb053190602401600060405180830381865afa158015610370573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103989190810190611f50565b6060015190506103b1836103ac868461202c565b61142a565b9250826001600160401b038111156103cb576103cb611e22565b60405190808252806020026020018201604052801561040457816020015b6103f161190e565b8152602001906001900390816103e95790505b50915080841061041457506104e0565b835b6104208486612043565b8110156104dd576000546040516301b6923d60e71b81526004810188905260248101839052620100009091046001600160a01b03169063db491e8090604401600060405180830381865afa15801561047c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104a4919081019061206b565b836104af878461202c565b815181106104bf576104bf612141565b602002602001018190525080806104d590612157565b915050610416565b50505b9392505050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105649190612172565b60015460405163732795d560e11b8152600481018390529192506001600160a01b03169063e64f2baa90602401600060405180830381865afa1580156105ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d691908101906121ae565b9150505b92915050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610639573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065d9190612172565b60015460405163ed6223cf60e01b8152600481018390529192506001600160a01b03169063ed6223cf90602401600060405180830381865afa1580156106a7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d69190810190612263565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074c9190612172565b600154604051635e9f678b60e01b8152600481018390529192506000916001600160a01b0390911690635e9f678b90602401600060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107c39190810190612323565b905080516001600160401b038111156107de576107de611e22565b60405190808252806020026020018201604052801561081757816020015b61080461190e565b8152602001906001900390816107fc5790505b50925060005b815181101561092157600060029054906101000a90046001600160a01b03166001600160a01b031663db491e8083838151811061085c5761085c612141565b60200260200101516000015184848151811061087a5761087a612141565b6020026020010151602001516040518363ffffffff1660e01b81526004016108ac929190918252602082015260400190565b600060405180830381865afa1580156108c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108f1919081019061206b565b84828151811061090357610903612141565b6020026020010181905250808061091990612157565b91505061081d565b50505092915050565b600054610100900460ff161580801561094a5750600054600160ff909116105b806109645750303b158015610964575060005460ff166001145b6109cc5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156109ef576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038681169190910291909117909155600180546001600160a01b0319169184169190911790558015610a76576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b604080518082018252600080825260208201526001549151634a7906b960e01b81526004810184905290916001600160a01b031690634a7906b9906024016040805180830381865afa158015610ad5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105da91906123b3565b604080518082018252600080825260208201526001549151635440522b60e01b81526004810184905290916001600160a01b031690635440522b906024016040805180830381865afa158015610b53573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105da919061240a565b600154604051632fbcce6360e11b8152600481018390526060916001600160a01b031690635f799cc690602401600060405180830381865afa158015610bc1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105da9190810190612426565b610c908888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a915089908190840183828082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250611440915050565b5050505050505050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d179190612172565b600154604051639037c0f960e01b8152600481018390529192506001600160a01b031690639037c0f990602401600060405180830381865afa158015610d61573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d6919081019061245a565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e069190612172565b600154604051635c369ec360e01b8152600481018390529192506001600160a01b031690635c369ec390602401600060405180830381865afa158015610e50573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d691908101906124ea565b610e856040820182612578565b9050610e946020830183612578565b905014610ed95760405162461bcd60e51b8152602060048201526013602482015272082e4e4c2f298cadccee8d09ad2e6dac2e8c6d606b1b60448201526064016109c3565b60005b610ee96020830183612578565b905081101561102157600054604080516080810190915283358152620100009091046001600160a01b03169063188b04b390602080820190610f2d90870187612578565b86818110610f3d57610f3d612141565b90506020020135815260200185608001358152602001858060400190610f639190612578565b86818110610f7357610f73612141565b9050602002810190610f8591906125c1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b168152610fdc9190600401612607565b600060405180830381600087803b158015610ff657600080fd5b505af115801561100a573d6000803e3d6000fd5b50505050808061101990612157565b915050610edc565b5060005b6110326060830183612578565b905081101561112d5760005460408051606080820190925284358152620100009092046001600160a01b03169163f6479d7791602082019061107690870187612578565b8681811061108657611086612141565b905060200201602081019061109b9190612640565b6001600160a01b0390811682526080870135602092830152604080516001600160e01b031960e087901b1681528451600482015292840151909116602483015291909101516044820152606401600060405180830381600087803b15801561110257600080fd5b505af1158015611116573d6000803e3d6000fd5b50505050808061112590612157565b915050611025565b5050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa15801561118a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ae9190612172565b60015460405163ba27f58d60e01b8152600481018390529192506000916001600160a01b039091169063ba27f58d90602401600060405180830381865afa1580156111fd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112259190810190612263565b80519091506000805b8281101561127d5761125884828151811061124b5761124b612141565b602002602001015161188e565b1561126b578161126781612157565b9250505b8061127581612157565b91505061122e565b50806001600160401b0381111561129657611296611e22565b6040519080825280602002602001820160405280156112bf578160200160208202803683370190505b5094506000805b8381101561133f576112e385828151811061124b5761124b612141565b1561132d578481815181106112fa576112fa612141565b602002602001015187838151811061131457611314612141565b60209081029190910101528161132981612157565b9250505b8061133781612157565b9150506112c6565b50505050505092915050565b61142761135b6020830183612640565b61136860208401846125c1565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113aa9250505060408501856125c1565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113ec925050506060860186612578565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050506080860135611440565b50565b600081831061143957816104e0565b5090919050565b6000805460405163155e35fb60e11b81526001600160a01b0388811660048301526201000090920490911690632abc6bf690602401602060405180830381865afa158015611492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b69190612172565b9050806115d757600080546040805160a0810182526001600160a01b038a8116825260208083018b90528284018a905260608301869052835190810184529485526080820194909452905163cd69fe6160e01b8152620100009092049092169163cd69fe6191611529919060040161265d565b600060405180830381600087803b15801561154357600080fd5b505af1158015611557573d6000803e3d6000fd5b505060005460405163155e35fb60e11b81526001600160a01b038a81166004830152620100009092049091169250632abc6bf69150602401602060405180830381865afa1580156115ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d09190612172565b9050611648565b835115611648576000546040516347f94de760e01b8152620100009091046001600160a01b0316906347f94de79061161590849088906004016126de565b600060405180830381600087803b15801561162f57600080fd5b505af1158015611643573d6000803e3d6000fd5b505050505b60005b83518110156118855760008060029054906101000a90046001600160a01b03166001600160a01b0316632abc6bf686848151811061168b5761168b612141565b60200260200101516040518263ffffffff1660e01b81526004016116be91906001600160a01b0391909116815260200190565b602060405180830381865afa1580156116db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ff9190612172565b9050806117df57600060029054906101000a90046001600160a01b03166001600160a01b031663f6479d77604051806060016040528086815260200188868151811061174d5761174d612141565b60200260200101516001600160a01b03168152602001878152506040518263ffffffff1660e01b81526004016117a89190815181526020808301516001600160a01b0316908201526040918201519181019190915260600190565b600060405180830381600087803b1580156117c257600080fd5b505af11580156117d6573d6000803e3d6000fd5b50505050611872565b600080546040805160808101825286815260208082018690528183018990528251908101835293845260608101939093525163188b04b360e01b8152620100009091046001600160a01b03169163188b04b39161183f9190600401612607565b600060405180830381600087803b15801561185957600080fd5b505af115801561186d573d6000803e3d6000fd5b505050505b508061187d81612157565b91505061164b565b50505050505050565b6000805460405163dabb053160e01b815260048101849052620100009091046001600160a01b03169063dabb053190602401600060405180830381865afa1580156118dd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119059190810190611f50565b51151592915050565b604080516101008101825260008082526020820181905260609282018390529181018290526080810182905260a0810182905260c0810182905260e081019190915290565b60008060006060848603121561196857600080fd5b505081359360208301359350604090920135919050565b60005b8381101561199a578181015183820152602001611982565b838111156119a9576000848401525b50505050565b600081518084526119c781602086016020860161197f565b601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015611a9857603f198984030185528151610100815185528882015189860152878201518189870152611a39828701826119af565b6060848101516001600160a01b039081169189019190915260808086015182169089015260a0808601519091169088015260c08085015115159088015260e0938401511515939096019290925250509386019390860190600101611a02565b509098975050505050505050565b60008060408385031215611ab957600080fd5b50508035926020909101359150565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611b1d57603f19888603018452611b0b8583516119af565b94509285019290850190600101611aef565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611b6257835183529284019291840191600101611b46565b50909695505050505050565b600060208284031215611b8057600080fd5b5035919050565b6001600160a01b038116811461142757600080fd5b60008060408385031215611baf57600080fd5b8235611bba81611b87565b91506020830135611bca81611b87565b809150509250929050565b81516001600160a01b0316815260208083015190820152604081016105da565b6020815260006104e060208301846119af565b60008083601f840112611c1a57600080fd5b5081356001600160401b03811115611c3157600080fd5b602083019150836020828501011115611c4957600080fd5b9250929050565b60008060008060008060008060a0898b031215611c6c57600080fd5b8835611c7781611b87565b975060208901356001600160401b0380821115611c9357600080fd5b611c9f8c838d01611c08565b909950975060408b0135915080821115611cb857600080fd5b611cc48c838d01611c08565b909750955060608b0135915080821115611cdd57600080fd5b818b0191508b601f830112611cf157600080fd5b813581811115611d0057600080fd5b8c60208260051b8501011115611d1557600080fd5b602083019550809450505050608089013590509295985092959890939650565b602080825282518282018190526000919060409081850190868401855b82811015611d8857611d7884835180516001600160a01b03168252602090810151910152565b9284019290850190600101611d52565b5091979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611b625783516001600160a01b031683529284019291840191600101611db1565b600060a08284031215611de857600080fd5b50919050565b600060208284031215611e0057600080fd5b81356001600160401b03811115611e1657600080fd5b6105d684828501611dd6565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715611e5a57611e5a611e22565b60405290565b60405161010081016001600160401b0381118282101715611e5a57611e5a611e22565b604080519081016001600160401b0381118282101715611e5a57611e5a611e22565b604051601f8201601f191681016001600160401b0381118282101715611ecd57611ecd611e22565b604052919050565b600082601f830112611ee657600080fd5b81516001600160401b03811115611eff57611eff611e22565b611f12601f8201601f1916602001611ea5565b818152846020838601011115611f2757600080fd5b611f3882602083016020870161197f565b949350505050565b8051611f4b81611b87565b919050565b600060208284031215611f6257600080fd5b81516001600160401b0380821115611f7957600080fd5b9083019060c08286031215611f8d57600080fd5b611f95611e38565b82518152602083015182811115611fab57600080fd5b611fb787828601611ed5565b602083015250604083015182811115611fcf57600080fd5b611fdb87828601611ed5565b60408301525060608301516060820152611ff760808401611f40565b608082015261200860a08401611f40565b60a082015295945050505050565b634e487b7160e01b600052601160045260246000fd5b60008282101561203e5761203e612016565b500390565b6000821982111561205657612056612016565b500190565b80518015158114611f4b57600080fd5b60006020828403121561207d57600080fd5b81516001600160401b038082111561209457600080fd5b9083019061010082860312156120a957600080fd5b6120b1611e60565b82518152602083015160208201526040830151828111156120d157600080fd5b6120dd87828601611ed5565b6040830152506120ef60608401611f40565b606082015261210060808401611f40565b608082015261211160a08401611f40565b60a082015261212260c0840161205b565b60c082015261213360e0840161205b565b60e082015295945050505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561216b5761216b612016565b5060010190565b60006020828403121561218457600080fd5b5051919050565b60006001600160401b038211156121a4576121a4611e22565b5060051b60200190565b600060208083850312156121c157600080fd5b82516001600160401b03808211156121d857600080fd5b818501915085601f8301126121ec57600080fd5b81516121ff6121fa8261218b565b611ea5565b81815260059190911b8301840190848101908883111561221e57600080fd5b8585015b838110156122565780518581111561223a5760008081fd5b6122488b89838a0101611ed5565b845250918601918601612222565b5098975050505050505050565b6000602080838503121561227657600080fd5b82516001600160401b0381111561228c57600080fd5b8301601f8101851361229d57600080fd5b80516122ab6121fa8261218b565b81815260059190911b820183019083810190878311156122ca57600080fd5b928401925b828410156122e8578351825292840192908401906122cf565b979650505050505050565b60006040828403121561230557600080fd5b61230d611e83565b9050815181526020820151602082015292915050565b6000602080838503121561233657600080fd5b82516001600160401b0381111561234c57600080fd5b8301601f8101851361235d57600080fd5b805161236b6121fa8261218b565b81815260069190911b8201830190838101908783111561238a57600080fd5b928401925b828410156122e8576123a188856122f3565b8252848201915060408401935061238f565b6000604082840312156123c557600080fd5b6104e083836122f3565b6000604082840312156123e157600080fd5b6123e9611e83565b905081516123f681611b87565b808252506020820151602082015292915050565b60006040828403121561241c57600080fd5b6104e083836123cf565b60006020828403121561243857600080fd5b81516001600160401b0381111561244e57600080fd5b6105d684828501611ed5565b6000602080838503121561246d57600080fd5b82516001600160401b0381111561248357600080fd5b8301601f8101851361249457600080fd5b80516124a26121fa8261218b565b81815260069190911b820183019083810190878311156124c157600080fd5b928401925b828410156122e8576124d888856123cf565b825284820191506040840193506124c6565b600060208083850312156124fd57600080fd5b82516001600160401b0381111561251357600080fd5b8301601f8101851361252457600080fd5b80516125326121fa8261218b565b81815260059190911b8201830190838101908783111561255157600080fd5b928401925b828410156122e857835161256981611b87565b82529284019290840190612556565b6000808335601e1984360301811261258f57600080fd5b8301803591506001600160401b038211156125a957600080fd5b6020019150600581901b3603821315611c4957600080fd5b6000808335601e198436030181126125d857600080fd5b8301803591506001600160401b038211156125f257600080fd5b602001915036819003821315611c4957600080fd5b60208152815160208201526020820151604082015260408201516060820152600060608301516080808401526105d660a08401826119af565b60006020828403121561265257600080fd5b81356104e081611b87565b60208152600060018060a01b03808451166020840152602084015160a0604085015261268c60c08501826119af565b90506040850151601f19808684030160608701526126aa83836119af565b925083606088015116608087015260808701519350808684030160a087015250506126d581836119af565b95945050505050565b828152604060208201526000611f3860408301846119af56fea26469706673582212206ea52e5a17cf71ccc53257d2ff8822276c2a9ccd329a60f6ce095f3a02b2011464736f6c634300080a0033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c80635f799cc6116100ad578063d55a006011610071578063d55a0060146102cc578063d85d04f4146102b0578063dfc1e2bf146102df578063e1332272146102f2578063e3d244281461030b57600080fd5b80635f799cc61461023d5780635fb8652e1461025d57806362c3ed301461027057806376ae90ef146102905780638654af27146102b057600080fd5b80632c422599116100f45780632c422599146101b65780633e7cb539146101c9578063485cc955146101da5780634a7906b9146101ef5780635440522b1461021d57600080fd5b806306bee8d4146101265780630f9b729c146101565780631964a421146101765780632260c7d214610196575b600080fd5b600154610139906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610169610164366004611953565b61031e565b60405161014d91906119db565b610189610184366004611aa6565b6104e7565b60405161014d9190611ac8565b6101a96101a4366004611aa6565b6105e0565b60405161014d9190611b2a565b6101696101c4366004611aa6565b6106cf565b6101396101d7366004611b6e565b90565b6101ed6101e8366004611b9c565b61092a565b005b6102026101fd366004611b6e565b610a7b565b6040805182518152602092830151928101929092520161014d565b61023061022b366004611b6e565b610af9565b60405161014d9190611bd5565b61025061024b366004611b6e565b610b77565b60405161014d9190611bf5565b6101ed61026b366004611c50565b610be9565b61028361027e366004611aa6565b610c9a565b60405161014d9190611d35565b6102a361029e366004611aa6565b610d89565b60405161014d9190611d95565b6102be6101d7366004611b6e565b60405190815260200161014d565b6101ed6102da366004611dee565b610e78565b6101a96102ed366004611aa6565b611131565b600054610139906201000090046001600160a01b031681565b6101ed610319366004611dee565b61134b565b6000805460405163dabb053160e01b815260048101869052606092916201000090046001600160a01b03169063dabb053190602401600060405180830381865afa158015610370573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103989190810190611f50565b6060015190506103b1836103ac868461202c565b61142a565b9250826001600160401b038111156103cb576103cb611e22565b60405190808252806020026020018201604052801561040457816020015b6103f161190e565b8152602001906001900390816103e95790505b50915080841061041457506104e0565b835b6104208486612043565b8110156104dd576000546040516301b6923d60e71b81526004810188905260248101839052620100009091046001600160a01b03169063db491e8090604401600060405180830381865afa15801561047c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104a4919081019061206b565b836104af878461202c565b815181106104bf576104bf612141565b602002602001018190525080806104d590612157565b915050610416565b50505b9392505050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105649190612172565b60015460405163732795d560e11b8152600481018390529192506001600160a01b03169063e64f2baa90602401600060405180830381865afa1580156105ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d691908101906121ae565b9150505b92915050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610639573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065d9190612172565b60015460405163ed6223cf60e01b8152600481018390529192506001600160a01b03169063ed6223cf90602401600060405180830381865afa1580156106a7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d69190810190612263565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074c9190612172565b600154604051635e9f678b60e01b8152600481018390529192506000916001600160a01b0390911690635e9f678b90602401600060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107c39190810190612323565b905080516001600160401b038111156107de576107de611e22565b60405190808252806020026020018201604052801561081757816020015b61080461190e565b8152602001906001900390816107fc5790505b50925060005b815181101561092157600060029054906101000a90046001600160a01b03166001600160a01b031663db491e8083838151811061085c5761085c612141565b60200260200101516000015184848151811061087a5761087a612141565b6020026020010151602001516040518363ffffffff1660e01b81526004016108ac929190918252602082015260400190565b600060405180830381865afa1580156108c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108f1919081019061206b565b84828151811061090357610903612141565b6020026020010181905250808061091990612157565b91505061081d565b50505092915050565b600054610100900460ff161580801561094a5750600054600160ff909116105b806109645750303b158015610964575060005460ff166001145b6109cc5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156109ef576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038681169190910291909117909155600180546001600160a01b0319169184169190911790558015610a76576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b604080518082018252600080825260208201526001549151634a7906b960e01b81526004810184905290916001600160a01b031690634a7906b9906024016040805180830381865afa158015610ad5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105da91906123b3565b604080518082018252600080825260208201526001549151635440522b60e01b81526004810184905290916001600160a01b031690635440522b906024016040805180830381865afa158015610b53573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105da919061240a565b600154604051632fbcce6360e11b8152600481018390526060916001600160a01b031690635f799cc690602401600060405180830381865afa158015610bc1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105da9190810190612426565b610c908888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a915089908190840183828082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250611440915050565b5050505050505050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d179190612172565b600154604051639037c0f960e01b8152600481018390529192506001600160a01b031690639037c0f990602401600060405180830381865afa158015610d61573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d6919081019061245a565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa158015610de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e069190612172565b600154604051635c369ec360e01b8152600481018390529192506001600160a01b031690635c369ec390602401600060405180830381865afa158015610e50573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105d691908101906124ea565b610e856040820182612578565b9050610e946020830183612578565b905014610ed95760405162461bcd60e51b8152602060048201526013602482015272082e4e4c2f298cadccee8d09ad2e6dac2e8c6d606b1b60448201526064016109c3565b60005b610ee96020830183612578565b905081101561102157600054604080516080810190915283358152620100009091046001600160a01b03169063188b04b390602080820190610f2d90870187612578565b86818110610f3d57610f3d612141565b90506020020135815260200185608001358152602001858060400190610f639190612578565b86818110610f7357610f73612141565b9050602002810190610f8591906125c1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b168152610fdc9190600401612607565b600060405180830381600087803b158015610ff657600080fd5b505af115801561100a573d6000803e3d6000fd5b50505050808061101990612157565b915050610edc565b5060005b6110326060830183612578565b905081101561112d5760005460408051606080820190925284358152620100009092046001600160a01b03169163f6479d7791602082019061107690870187612578565b8681811061108657611086612141565b905060200201602081019061109b9190612640565b6001600160a01b0390811682526080870135602092830152604080516001600160e01b031960e087901b1681528451600482015292840151909116602483015291909101516044820152606401600060405180830381600087803b15801561110257600080fd5b505af1158015611116573d6000803e3d6000fd5b50505050808061112590612157565b915050611025565b5050565b60008054604051636b87086360e11b81526004810185905260248101849052606092916201000090046001600160a01b03169063d70e10c690604401602060405180830381865afa15801561118a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ae9190612172565b60015460405163ba27f58d60e01b8152600481018390529192506000916001600160a01b039091169063ba27f58d90602401600060405180830381865afa1580156111fd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112259190810190612263565b80519091506000805b8281101561127d5761125884828151811061124b5761124b612141565b602002602001015161188e565b1561126b578161126781612157565b9250505b8061127581612157565b91505061122e565b50806001600160401b0381111561129657611296611e22565b6040519080825280602002602001820160405280156112bf578160200160208202803683370190505b5094506000805b8381101561133f576112e385828151811061124b5761124b612141565b1561132d578481815181106112fa576112fa612141565b602002602001015187838151811061131457611314612141565b60209081029190910101528161132981612157565b9250505b8061133781612157565b9150506112c6565b50505050505092915050565b61142761135b6020830183612640565b61136860208401846125c1565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113aa9250505060408501856125c1565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113ec925050506060860186612578565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050506080860135611440565b50565b600081831061143957816104e0565b5090919050565b6000805460405163155e35fb60e11b81526001600160a01b0388811660048301526201000090920490911690632abc6bf690602401602060405180830381865afa158015611492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b69190612172565b9050806115d757600080546040805160a0810182526001600160a01b038a8116825260208083018b90528284018a905260608301869052835190810184529485526080820194909452905163cd69fe6160e01b8152620100009092049092169163cd69fe6191611529919060040161265d565b600060405180830381600087803b15801561154357600080fd5b505af1158015611557573d6000803e3d6000fd5b505060005460405163155e35fb60e11b81526001600160a01b038a81166004830152620100009092049091169250632abc6bf69150602401602060405180830381865afa1580156115ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d09190612172565b9050611648565b835115611648576000546040516347f94de760e01b8152620100009091046001600160a01b0316906347f94de79061161590849088906004016126de565b600060405180830381600087803b15801561162f57600080fd5b505af1158015611643573d6000803e3d6000fd5b505050505b60005b83518110156118855760008060029054906101000a90046001600160a01b03166001600160a01b0316632abc6bf686848151811061168b5761168b612141565b60200260200101516040518263ffffffff1660e01b81526004016116be91906001600160a01b0391909116815260200190565b602060405180830381865afa1580156116db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ff9190612172565b9050806117df57600060029054906101000a90046001600160a01b03166001600160a01b031663f6479d77604051806060016040528086815260200188868151811061174d5761174d612141565b60200260200101516001600160a01b03168152602001878152506040518263ffffffff1660e01b81526004016117a89190815181526020808301516001600160a01b0316908201526040918201519181019190915260600190565b600060405180830381600087803b1580156117c257600080fd5b505af11580156117d6573d6000803e3d6000fd5b50505050611872565b600080546040805160808101825286815260208082018690528183018990528251908101835293845260608101939093525163188b04b360e01b8152620100009091046001600160a01b03169163188b04b39161183f9190600401612607565b600060405180830381600087803b15801561185957600080fd5b505af115801561186d573d6000803e3d6000fd5b505050505b508061187d81612157565b91505061164b565b50505050505050565b6000805460405163dabb053160e01b815260048101849052620100009091046001600160a01b03169063dabb053190602401600060405180830381865afa1580156118dd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119059190810190611f50565b51151592915050565b604080516101008101825260008082526020820181905260609282018390529181018290526080810182905260a0810182905260c0810182905260e081019190915290565b60008060006060848603121561196857600080fd5b505081359360208301359350604090920135919050565b60005b8381101561199a578181015183820152602001611982565b838111156119a9576000848401525b50505050565b600081518084526119c781602086016020860161197f565b601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015611a9857603f198984030185528151610100815185528882015189860152878201518189870152611a39828701826119af565b6060848101516001600160a01b039081169189019190915260808086015182169089015260a0808601519091169088015260c08085015115159088015260e0938401511515939096019290925250509386019390860190600101611a02565b509098975050505050505050565b60008060408385031215611ab957600080fd5b50508035926020909101359150565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611b1d57603f19888603018452611b0b8583516119af565b94509285019290850190600101611aef565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611b6257835183529284019291840191600101611b46565b50909695505050505050565b600060208284031215611b8057600080fd5b5035919050565b6001600160a01b038116811461142757600080fd5b60008060408385031215611baf57600080fd5b8235611bba81611b87565b91506020830135611bca81611b87565b809150509250929050565b81516001600160a01b0316815260208083015190820152604081016105da565b6020815260006104e060208301846119af565b60008083601f840112611c1a57600080fd5b5081356001600160401b03811115611c3157600080fd5b602083019150836020828501011115611c4957600080fd5b9250929050565b60008060008060008060008060a0898b031215611c6c57600080fd5b8835611c7781611b87565b975060208901356001600160401b0380821115611c9357600080fd5b611c9f8c838d01611c08565b909950975060408b0135915080821115611cb857600080fd5b611cc48c838d01611c08565b909750955060608b0135915080821115611cdd57600080fd5b818b0191508b601f830112611cf157600080fd5b813581811115611d0057600080fd5b8c60208260051b8501011115611d1557600080fd5b602083019550809450505050608089013590509295985092959890939650565b602080825282518282018190526000919060409081850190868401855b82811015611d8857611d7884835180516001600160a01b03168252602090810151910152565b9284019290850190600101611d52565b5091979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611b625783516001600160a01b031683529284019291840191600101611db1565b600060a08284031215611de857600080fd5b50919050565b600060208284031215611e0057600080fd5b81356001600160401b03811115611e1657600080fd5b6105d684828501611dd6565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715611e5a57611e5a611e22565b60405290565b60405161010081016001600160401b0381118282101715611e5a57611e5a611e22565b604080519081016001600160401b0381118282101715611e5a57611e5a611e22565b604051601f8201601f191681016001600160401b0381118282101715611ecd57611ecd611e22565b604052919050565b600082601f830112611ee657600080fd5b81516001600160401b03811115611eff57611eff611e22565b611f12601f8201601f1916602001611ea5565b818152846020838601011115611f2757600080fd5b611f3882602083016020870161197f565b949350505050565b8051611f4b81611b87565b919050565b600060208284031215611f6257600080fd5b81516001600160401b0380821115611f7957600080fd5b9083019060c08286031215611f8d57600080fd5b611f95611e38565b82518152602083015182811115611fab57600080fd5b611fb787828601611ed5565b602083015250604083015182811115611fcf57600080fd5b611fdb87828601611ed5565b60408301525060608301516060820152611ff760808401611f40565b608082015261200860a08401611f40565b60a082015295945050505050565b634e487b7160e01b600052601160045260246000fd5b60008282101561203e5761203e612016565b500390565b6000821982111561205657612056612016565b500190565b80518015158114611f4b57600080fd5b60006020828403121561207d57600080fd5b81516001600160401b038082111561209457600080fd5b9083019061010082860312156120a957600080fd5b6120b1611e60565b82518152602083015160208201526040830151828111156120d157600080fd5b6120dd87828601611ed5565b6040830152506120ef60608401611f40565b606082015261210060808401611f40565b608082015261211160a08401611f40565b60a082015261212260c0840161205b565b60c082015261213360e0840161205b565b60e082015295945050505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561216b5761216b612016565b5060010190565b60006020828403121561218457600080fd5b5051919050565b60006001600160401b038211156121a4576121a4611e22565b5060051b60200190565b600060208083850312156121c157600080fd5b82516001600160401b03808211156121d857600080fd5b818501915085601f8301126121ec57600080fd5b81516121ff6121fa8261218b565b611ea5565b81815260059190911b8301840190848101908883111561221e57600080fd5b8585015b838110156122565780518581111561223a5760008081fd5b6122488b89838a0101611ed5565b845250918601918601612222565b5098975050505050505050565b6000602080838503121561227657600080fd5b82516001600160401b0381111561228c57600080fd5b8301601f8101851361229d57600080fd5b80516122ab6121fa8261218b565b81815260059190911b820183019083810190878311156122ca57600080fd5b928401925b828410156122e8578351825292840192908401906122cf565b979650505050505050565b60006040828403121561230557600080fd5b61230d611e83565b9050815181526020820151602082015292915050565b6000602080838503121561233657600080fd5b82516001600160401b0381111561234c57600080fd5b8301601f8101851361235d57600080fd5b805161236b6121fa8261218b565b81815260069190911b8201830190838101908783111561238a57600080fd5b928401925b828410156122e8576123a188856122f3565b8252848201915060408401935061238f565b6000604082840312156123c557600080fd5b6104e083836122f3565b6000604082840312156123e157600080fd5b6123e9611e83565b905081516123f681611b87565b808252506020820151602082015292915050565b60006040828403121561241c57600080fd5b6104e083836123cf565b60006020828403121561243857600080fd5b81516001600160401b0381111561244e57600080fd5b6105d684828501611ed5565b6000602080838503121561246d57600080fd5b82516001600160401b0381111561248357600080fd5b8301601f8101851361249457600080fd5b80516124a26121fa8261218b565b81815260069190911b820183019083810190878311156124c157600080fd5b928401925b828410156122e8576124d888856123cf565b825284820191506040840193506124c6565b600060208083850312156124fd57600080fd5b82516001600160401b0381111561251357600080fd5b8301601f8101851361252457600080fd5b80516125326121fa8261218b565b81815260059190911b8201830190838101908783111561255157600080fd5b928401925b828410156122e857835161256981611b87565b82529284019290840190612556565b6000808335601e1984360301811261258f57600080fd5b8301803591506001600160401b038211156125a957600080fd5b6020019150600581901b3603821315611c4957600080fd5b6000808335601e198436030181126125d857600080fd5b8301803591506001600160401b038211156125f257600080fd5b602001915036819003821315611c4957600080fd5b60208152815160208201526020820151604082015260408201516060820152600060608301516080808401526105d660a08401826119af565b60006020828403121561265257600080fd5b81356104e081611b87565b60208152600060018060a01b03808451166020840152602084015160a0604085015261268c60c08501826119af565b90506040850151601f19808684030160608701526126aa83836119af565b925083606088015116608087015260808701519350808684030160a087015250506126d581836119af565b95945050505050565b828152604060208201526000611f3860408301846119af56fea26469706673582212206ea52e5a17cf71ccc53257d2ff8822276c2a9ccd329a60f6ce095f3a02b2011464736f6c634300080a0033