MATIC Price: $0.718844 (-0.94%)
Gas: 30 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Set Prompt443890812023-06-27 6:30:55330 days ago1687847455IN
0x22c66b7b...1b8e7e64F
0 MATIC0.00513216134.59291553
Set Prompt443890642023-06-27 6:30:16330 days ago1687847416IN
0x22c66b7b...1b8e7e64F
0 MATIC0.00509683134.45636593
Set Prompt443890092023-06-27 6:28:18330 days ago1687847298IN
0x22c66b7b...1b8e7e64F
0 MATIC0.00522882137.12800115
Set Prompt443889832023-06-27 6:27:22330 days ago1687847242IN
0x22c66b7b...1b8e7e64F
0 MATIC0.00550339144.32870185
Set Prompt443889552023-06-27 6:26:22330 days ago1687847182IN
0x22c66b7b...1b8e7e64F
0 MATIC0.00583269152.96468732
0x60c06040431764462023-05-26 16:15:24362 days ago1685117724IN
 Create: LensGelatoGPT
0 MATIC0.26710709193.62012457

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

Contract Source Code Verified (Exact Match)

Contract Name:
LensGelatoGPT

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 6 : LensGelatoGPT.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import {Proxied} from "./vendor/hardhat-deploy/Proxied.sol";
import {ILensHub} from "./vendor/lens/ILensHub.sol";
import {
    AddressUpgradeable
} from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import {
    EnumerableSetUpgradeable
} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";

struct Prompt {
    uint256 profileId;
    string prompt;
}

contract LensGelatoGPT is Proxied {
    using AddressUpgradeable for address payable;
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;

    ILensHub public immutable lensHub;

    address public immutable dedicatedMsgSender;

    uint256 public fee = 5 ether;

    mapping(uint256 => string) public promptByProfileId;

    EnumerableSetUpgradeable.UintSet private _profileIds;
    EnumerableSetUpgradeable.UintSet private _newProfileIds;

    constructor(ILensHub _lensHub, address _dedicatedMsgSender) {
        lensHub = _lensHub;
        dedicatedMsgSender = _dedicatedMsgSender;
    }

    modifier onlyProfileOwner(uint256 _profileId) {
        require(
            msg.sender == lensHub.ownerOf(_profileId),
            "LensGelatoGPT.onlyProfileOwner"
        );
        _;
    }

    modifier onlyDedicatedMsgSender() {
        require(
            msg.sender == dedicatedMsgSender,
            "LensGelatoGPT.onlyDedicatedMsgSender"
        );
        _;
    }

    function setFee(uint256 _fee) external onlyProxyAdmin {
        fee = _fee;
    }

    function collectFee(address payable _to) external onlyProxyAdmin {
        _to.sendValue(address(this).balance);
    }

    function setPrompt(
        uint256 _profileId,
        string calldata _prompt
    ) external payable onlyProfileOwner(_profileId) {
        require(msg.value == fee, "LensGelatoGPT.setPrompt: fee");
        require(
            bytes(_prompt).length <= 160,
            "LensGelatoGPT.setPrompt: length"
        );
        require(
            lensHub.getDispatcher(_profileId) == dedicatedMsgSender,
            "LensGelatoGPT.setPrompt: dispatcher"
        );

        _newProfileIds.add(_profileId);
        _profileIds.add(_profileId);

        promptByProfileId[_profileId] = _prompt;
    }

    function stopPrompt(
        uint256 _profileId
    ) external onlyProfileOwner(_profileId) {
        require(
            _profileIds.contains(_profileId),
            "LensGelatoGPT.stopPrompt: 404"
        );
        _newProfileIds.remove(_profileId);
        _profileIds.remove(_profileId);
        delete promptByProfileId[_profileId];
    }

    function removeNewProfileIds(
        uint256[] calldata __profileIds
    ) external onlyDedicatedMsgSender {
        for (uint256 i = 0; i < __profileIds.length; i++) {
            _newProfileIds.remove(__profileIds[i]);
        }
    }

    function getPaginatedPrompts(
        uint256 _from,
        uint256 _to
    ) external view returns (Prompt[] memory prompts) {
        require(_from < _to, "LensGelatoGPT.getPaginatedPrompts: _to");
        require(
            _from <= _profileIds.length(),
            "LensGelatoGPT.getPaginatedPrompts: _from"
        );

        if (_to >= _profileIds.length()) _to = _profileIds.length();

        prompts = new Prompt[](_to - _from);

        for (uint256 i = _from; i < _to; i++) {
            uint256 profileId = _profileIds.at(i);

            // Filter out users with wrong Dispatcher on Lens
            if (lensHub.getDispatcher(profileId) != dedicatedMsgSender)
                continue;

            prompts[i - _from] = Prompt(
                profileId,
                promptByProfileId[profileId]
            );
        }
    }

    function getNewPrompts() external view returns (Prompt[] memory prompts) {
        uint256 length = _newProfileIds.length();

        prompts = new Prompt[](length);

        for (uint256 i = 0; i < length; i++) {
            uint256 newProfileId = _newProfileIds.at(i);

            // Filter out users with wrong Dispatcher on Lens
            if (lensHub.getDispatcher(newProfileId) != dedicatedMsgSender)
                continue;

            prompts[i] = Prompt(newProfileId, promptByProfileId[newProfileId]);
        }
    }

    function getProfileIds() external view returns (uint256[] memory) {
        return _profileIds.values();
    }

    function getNewProfileIds() external view returns (uint256[] memory) {
        return _newProfileIds.values();
    }

    function getTotalNumberOfProfiles() external view returns (uint256) {
        return _profileIds.length();
    }

    function areThereNewProfileIds() external view returns (bool) {
        return _newProfileIds.length() > 0;
    }
}

File 1 of 6 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

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

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

File 1 of 6 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSetUpgradeable {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 2 of 6 : Proxied.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

abstract contract Proxied {
    /// @notice to be used by initialisation / postUpgrade function so that only the proxy's admin can execute them
    /// It also allows these functions to be called inside a contructor
    /// even if the contract is meant to be used without proxy
    modifier proxied() {
        address proxyAdminAddress = _proxyAdmin();
        // With hardhat-deploy proxies
        // the proxyAdminAddress is zero only for the implementation contract
        // if the implementation contract want to be used as a standalone/immutable contract
        // it simply has to execute the `proxied` function
        // This ensure the proxyAdminAddress is never zero post deployment
        // And allow you to keep the same code for both proxied contract and immutable contract
        if (proxyAdminAddress == address(0)) {
            // ensure can not be called twice when used outside of proxy : no admin
            // solhint-disable-next-line security/no-inline-assembly
            assembly {
                sstore(
                    0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,
                    0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
                )
            }
        } else {
            require(msg.sender == proxyAdminAddress);
        }
        _;
    }

    modifier onlyProxyAdmin() {
        require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED");
        _;
    }

    function _proxyAdmin() internal view returns (address ownerAddress) {
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            ownerAddress := sload(
                0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
            )
        }
    }
}

File 2 of 6 : DataTypes.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

/**
 * @title DataTypes
 * @author Lens Protocol
 *
 * @notice A standard library of data types used throughout the Lens Protocol.
 */
library DataTypes {
    /**
     * @notice An enum containing the different states the protocol can be in, limiting certain actions.
     *
     * @param Unpaused The fully unpaused state.
     * @param PublishingPaused The state where only publication creation functions are paused.
     * @param Paused The fully paused state.
     */
    enum ProtocolState {
        Unpaused,
        PublishingPaused,
        Paused
    }

    /**
     * @notice An enum specifically used in a helper function to easily retrieve the publication type for integrations.
     *
     * @param Post A standard post, having a URI, a collect module but no pointer to another publication.
     * @param Comment A comment, having a URI, a collect module and a pointer to another publication.
     * @param Mirror A mirror, having a pointer to another publication, but no URI or collect module.
     * @param Nonexistent An indicator showing the queried publication does not exist.
     */
    enum PubType {
        Post,
        Comment,
        Mirror,
        Nonexistent
    }

    /**
     * @notice A struct containing the necessary information to reconstruct an EIP-712 typed data signature.
     *
     * @param v The signature's recovery parameter.
     * @param r The signature's r parameter.
     * @param s The signature's s parameter
     * @param deadline The signature's deadline
     */
    struct EIP712Signature {
        uint8 v;
        bytes32 r;
        bytes32 s;
        uint256 deadline;
    }

    /**
     * @notice A struct containing profile data.
     *
     * @param pubCount The number of publications made to this profile.
     * @param followModule The address of the current follow module in use by this profile, can be empty.
     * @param followNFT The address of the followNFT associated with this profile, can be empty..
     * @param handle The profile's associated handle.
     * @param imageURI The URI to be used for the profile's image.
     * @param followNFTURI The URI to be used for the follow NFT.
     */
    struct ProfileStruct {
        uint256 pubCount;
        address followModule;
        address followNFT;
        string handle;
        string imageURI;
        string followNFTURI;
    }

    /**
     * @notice A struct containing data associated with each new publication.
     *
     * @param profileIdPointed The profile token ID this publication points to, for mirrors and comments.
     * @param pubIdPointed The publication ID this publication points to, for mirrors and comments.
     * @param contentURI The URI associated with this publication.
     * @param referenceModule The address of the current reference module in use by this publication, can be empty.
     * @param collectModule The address of the collect module associated with this publication, this exists for all publication.
     * @param collectNFT The address of the collectNFT associated with this publication, if any.
     */
    struct PublicationStruct {
        uint256 profileIdPointed;
        uint256 pubIdPointed;
        string contentURI;
        address referenceModule;
        address collectModule;
        address collectNFT;
    }

    /**
     * @notice A struct containing the parameters required for the `createProfile()` function.
     *
     * @param to The address receiving the profile.
     * @param handle The handle to set for the profile, must be unique and non-empty.
     * @param imageURI The URI to set for the profile image.
     * @param followModule The follow module to use, can be the zero address.
     * @param followModuleInitData The follow module initialization data, if any.
     * @param followNFTURI The URI to use for the follow NFT.
     */
    struct CreateProfileData {
        address to;
        string handle;
        string imageURI;
        address followModule;
        bytes followModuleInitData;
        string followNFTURI;
    }

    /**
     * @notice A struct containing the parameters required for the `setDefaultProfileWithSig()` function. Parameters are
     * the same as the regular `setDefaultProfile()` function, with an added EIP712Signature.
     *
     * @param wallet The address of the wallet setting the default profile.
     * @param profileId The token ID of the profile which will be set as default, or zero.
     * @param sig The EIP712Signature struct containing the profile owner's signature.
     */
    struct SetDefaultProfileWithSigData {
        address wallet;
        uint256 profileId;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `setFollowModuleWithSig()` function. Parameters are
     * the same as the regular `setFollowModule()` function, with an added EIP712Signature.
     *
     * @param profileId The token ID of the profile to change the followModule for.
     * @param followModule The followModule to set for the given profile, must be whitelisted.
     * @param followModuleInitData The data to be passed to the followModule for initialization.
     * @param sig The EIP712Signature struct containing the profile owner's signature.
     */
    struct SetFollowModuleWithSigData {
        uint256 profileId;
        address followModule;
        bytes followModuleInitData;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `setDispatcherWithSig()` function. Parameters are the same
     * as the regular `setDispatcher()` function, with an added EIP712Signature.
     *
     * @param profileId The token ID of the profile to set the dispatcher for.
     * @param dispatcher The dispatcher address to set for the profile.
     * @param sig The EIP712Signature struct containing the profile owner's signature.
     */
    struct SetDispatcherWithSigData {
        uint256 profileId;
        address dispatcher;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `setProfileImageURIWithSig()` function. Parameters are the same
     * as the regular `setProfileImageURI()` function, with an added EIP712Signature.
     *
     * @param profileId The token ID of the profile to set the URI for.
     * @param imageURI The URI to set for the given profile image.
     * @param sig The EIP712Signature struct containing the profile owner's signature.
     */
    struct SetProfileImageURIWithSigData {
        uint256 profileId;
        string imageURI;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `setFollowNFTURIWithSig()` function. Parameters are the same
     * as the regular `setFollowNFTURI()` function, with an added EIP712Signature.
     *
     * @param profileId The token ID of the profile for which to set the followNFT URI.
     * @param followNFTURI The follow NFT URI to set.
     * @param sig The EIP712Signature struct containing the followNFT's associated profile owner's signature.
     */
    struct SetFollowNFTURIWithSigData {
        uint256 profileId;
        string followNFTURI;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `post()` function.
     *
     * @param profileId The token ID of the profile to publish to.
     * @param contentURI The URI to set for this new publication.
     * @param collectModule The collect module to set for this new publication.
     * @param collectModuleInitData The data to pass to the collect module's initialization.
     * @param referenceModule The reference module to set for the given publication, must be whitelisted.
     * @param referenceModuleInitData The data to be passed to the reference module for initialization.
     */
    struct PostData {
        uint256 profileId;
        string contentURI;
        address collectModule;
        bytes collectModuleInitData;
        address referenceModule;
        bytes referenceModuleInitData;
    }

    /**
     * @notice A struct containing the parameters required for the `postWithSig()` function. Parameters are the same as
     * the regular `post()` function, with an added EIP712Signature.
     *
     * @param profileId The token ID of the profile to publish to.
     * @param contentURI The URI to set for this new publication.
     * @param collectModule The collectModule to set for this new publication.
     * @param collectModuleInitData The data to pass to the collectModule's initialization.
     * @param referenceModule The reference module to set for the given publication, must be whitelisted.
     * @param referenceModuleInitData The data to be passed to the reference module for initialization.
     * @param sig The EIP712Signature struct containing the profile owner's signature.
     */
    struct PostWithSigData {
        uint256 profileId;
        string contentURI;
        address collectModule;
        bytes collectModuleInitData;
        address referenceModule;
        bytes referenceModuleInitData;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `comment()` function.
     *
     * @param profileId The token ID of the profile to publish to.
     * @param contentURI The URI to set for this new publication.
     * @param profileIdPointed The profile token ID to point the comment to.
     * @param pubIdPointed The publication ID to point the comment to.
     * @param referenceModuleData The data passed to the reference module.
     * @param collectModule The collect module to set for this new publication.
     * @param collectModuleInitData The data to pass to the collect module's initialization.
     * @param referenceModule The reference module to set for the given publication, must be whitelisted.
     * @param referenceModuleInitData The data to be passed to the reference module for initialization.
     */
    struct CommentData {
        uint256 profileId;
        string contentURI;
        uint256 profileIdPointed;
        uint256 pubIdPointed;
        bytes referenceModuleData;
        address collectModule;
        bytes collectModuleInitData;
        address referenceModule;
        bytes referenceModuleInitData;
    }

    /**
     * @notice A struct containing the parameters required for the `commentWithSig()` function. Parameters are the same as
     * the regular `comment()` function, with an added EIP712Signature.
     *
     * @param profileId The token ID of the profile to publish to.
     * @param contentURI The URI to set for this new publication.
     * @param profileIdPointed The profile token ID to point the comment to.
     * @param pubIdPointed The publication ID to point the comment to.
     * @param referenceModuleData The data passed to the reference module.
     * @param collectModule The collectModule to set for this new publication.
     * @param collectModuleInitData The data to pass to the collectModule's initialization.
     * @param referenceModule The reference module to set for the given publication, must be whitelisted.
     * @param referenceModuleInitData The data to be passed to the reference module for initialization.
     * @param sig The EIP712Signature struct containing the profile owner's signature.
     */
    struct CommentWithSigData {
        uint256 profileId;
        string contentURI;
        uint256 profileIdPointed;
        uint256 pubIdPointed;
        bytes referenceModuleData;
        address collectModule;
        bytes collectModuleInitData;
        address referenceModule;
        bytes referenceModuleInitData;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `mirror()` function.
     *
     * @param profileId The token ID of the profile to publish to.
     * @param profileIdPointed The profile token ID to point the mirror to.
     * @param pubIdPointed The publication ID to point the mirror to.
     * @param referenceModuleData The data passed to the reference module.
     * @param referenceModule The reference module to set for the given publication, must be whitelisted.
     * @param referenceModuleInitData The data to be passed to the reference module for initialization.
     */
    struct MirrorData {
        uint256 profileId;
        uint256 profileIdPointed;
        uint256 pubIdPointed;
        bytes referenceModuleData;
        address referenceModule;
        bytes referenceModuleInitData;
    }

    /**
     * @notice A struct containing the parameters required for the `mirrorWithSig()` function. Parameters are the same as
     * the regular `mirror()` function, with an added EIP712Signature.
     *
     * @param profileId The token ID of the profile to publish to.
     * @param profileIdPointed The profile token ID to point the mirror to.
     * @param pubIdPointed The publication ID to point the mirror to.
     * @param referenceModuleData The data passed to the reference module.
     * @param referenceModule The reference module to set for the given publication, must be whitelisted.
     * @param referenceModuleInitData The data to be passed to the reference module for initialization.
     * @param sig The EIP712Signature struct containing the profile owner's signature.
     */
    struct MirrorWithSigData {
        uint256 profileId;
        uint256 profileIdPointed;
        uint256 pubIdPointed;
        bytes referenceModuleData;
        address referenceModule;
        bytes referenceModuleInitData;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `followWithSig()` function. Parameters are the same
     * as the regular `follow()` function, with the follower's (signer) address and an EIP712Signature added.
     *
     * @param follower The follower which is the message signer.
     * @param profileIds The array of token IDs of the profiles to follow.
     * @param datas The array of arbitrary data to pass to the followModules if needed.
     * @param sig The EIP712Signature struct containing the follower's signature.
     */
    struct FollowWithSigData {
        address follower;
        uint256[] profileIds;
        bytes[] datas;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `collectWithSig()` function. Parameters are the same as
     * the regular `collect()` function, with the collector's (signer) address and an EIP712Signature added.
     *
     * @param collector The collector which is the message signer.
     * @param profileId The token ID of the profile that published the publication to collect.
     * @param pubId The publication to collect's publication ID.
     * @param data The arbitrary data to pass to the collectModule if needed.
     * @param sig The EIP712Signature struct containing the collector's signature.
     */
    struct CollectWithSigData {
        address collector;
        uint256 profileId;
        uint256 pubId;
        bytes data;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `setProfileMetadataWithSig()` function.
     *
     * @param profileId The profile ID for which to set the metadata.
     * @param metadata The metadata string to set for the profile and user.
     * @param sig The EIP712Signature struct containing the user's signature.
     */
    struct SetProfileMetadataWithSigData {
        uint256 profileId;
        string metadata;
        EIP712Signature sig;
    }

    /**
     * @notice A struct containing the parameters required for the `toggleFollowWithSig()` function.
     *
     * @param follower The follower which is the message signer.
     * @param profileIds The token ID array of the profiles.
     * @param enables The array of booleans to enable/disable follows.
     * @param sig The EIP712Signature struct containing the follower's signature.
     */
    struct ToggleFollowWithSigData {
        address follower;
        uint256[] profileIds;
        bool[] enables;
        EIP712Signature sig;
    }
}

File 2 of 6 : ILensHub.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

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

/**
 * @title ILensHub
 * @author Lens Protocol
 *
 * @notice This is the interface for the LensHub contract, the main entry point for the Lens Protocol.
 * You'll find all the events and external functions, as well as the reasoning behind them here.
 */
interface ILensHub {
    /**
     * @notice Initializes the LensHub NFT, setting the initial governance address as well as the name and symbol in
     * the LensNFTBase contract.
     *
     * @param name The name to set for the hub NFT.
     * @param symbol The symbol to set for the hub NFT.
     * @param newGovernance The governance address to set.
     */
    function initialize(
        string calldata name,
        string calldata symbol,
        address newGovernance
    ) external;

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

    /**
     * @notice Sets the privileged governance role. This function can only be called by the current governance
     * address.
     *
     * @param newGovernance The new governance address to set.
     */
    function setGovernance(address newGovernance) external;

    /**
     * @notice Sets the emergency admin, which is a permissioned role able to set the protocol state. This function
     * can only be called by the governance address.
     *
     * @param newEmergencyAdmin The new emergency admin address to set.
     */
    function setEmergencyAdmin(address newEmergencyAdmin) external;

    /**
     * @notice Sets the protocol state to either a global pause, a publishing pause or an unpaused state. This function
     * can only be called by the governance address or the emergency admin address.
     *
     * Note that this reverts if the emergency admin calls it if:
     *      1. The emergency admin is attempting to unpause.
     *      2. The emergency admin is calling while the protocol is already paused.
     *
     * @param newState The state to set, as a member of the ProtocolState enum.
     */
    function setState(DataTypes.ProtocolState newState) external;

    /**
     * @notice Adds or removes a profile creator from the whitelist. This function can only be called by the current
     * governance address.
     *
     * @param profileCreator The profile creator address to add or remove from the whitelist.
     * @param whitelist Whether or not the profile creator should be whitelisted.
     */
    function whitelistProfileCreator(
        address profileCreator,
        bool whitelist
    ) external;

    /**
     * @notice Adds or removes a follow module from the whitelist. This function can only be called by the current
     * governance address.
     *
     * @param followModule The follow module contract address to add or remove from the whitelist.
     * @param whitelist Whether or not the follow module should be whitelisted.
     */
    function whitelistFollowModule(
        address followModule,
        bool whitelist
    ) external;

    /**
     * @notice Adds or removes a reference module from the whitelist. This function can only be called by the current
     * governance address.
     *
     * @param referenceModule The reference module contract to add or remove from the whitelist.
     * @param whitelist Whether or not the reference module should be whitelisted.
     */
    function whitelistReferenceModule(
        address referenceModule,
        bool whitelist
    ) external;

    /**
     * @notice Adds or removes a collect module from the whitelist. This function can only be called by the current
     * governance address.
     *
     * @param collectModule The collect module contract address to add or remove from the whitelist.
     * @param whitelist Whether or not the collect module should be whitelisted.
     */
    function whitelistCollectModule(
        address collectModule,
        bool whitelist
    ) external;

    /**
     * @notice Creates a profile with the specified parameters, minting a profile NFT to the given recipient. This
     * function must be called by a whitelisted profile creator.
     *
     * @param vars A CreateProfileData struct containing the following params:
     *      to: The address receiving the profile.
     *      handle: The handle to set for the profile, must be unique and non-empty.
     *      imageURI: The URI to set for the profile image.
     *      followModule: The follow module to use, can be the zero address.
     *      followModuleInitData: The follow module initialization data, if any.
     */
    function createProfile(
        DataTypes.CreateProfileData calldata vars
    ) external returns (uint256);

    /**
     * @notice Sets the mapping between wallet and its main profile identity.
     *
     * @param profileId The token ID of the profile to set as the main profile identity.
     */
    function setDefaultProfile(uint256 profileId) external;

    /**
     * @notice Sets the mapping between wallet and its main profile identity via signature with the specified parameters.
     *
     * @param vars A SetDefaultProfileWithSigData struct, including the regular parameters and an EIP712Signature struct.
     */
    function setDefaultProfileWithSig(
        DataTypes.SetDefaultProfileWithSigData calldata vars
    ) external;

    /**
     * @notice Sets a profile's follow module, must be called by the profile owner.
     *
     * @param profileId The token ID of the profile to set the follow module for.
     * @param followModule The follow module to set for the given profile, must be whitelisted.
     * @param followModuleInitData The data to be passed to the follow module for initialization.
     */
    function setFollowModule(
        uint256 profileId,
        address followModule,
        bytes calldata followModuleInitData
    ) external;

    /**
     * @notice Sets a profile's follow module via signature with the specified parameters.
     *
     * @param vars A SetFollowModuleWithSigData struct, including the regular parameters and an EIP712Signature struct.
     */
    function setFollowModuleWithSig(
        DataTypes.SetFollowModuleWithSigData calldata vars
    ) external;

    /**
     * @notice Sets a profile's dispatcher, giving that dispatcher rights to publish to that profile.
     *
     * @param profileId The token ID of the profile of the profile to set the dispatcher for.
     * @param dispatcher The dispatcher address to set for the given profile ID.
     */
    function setDispatcher(uint256 profileId, address dispatcher) external;

    /**
     * @notice Sets a profile's dispatcher via signature with the specified parameters.
     *
     * @param vars A SetDispatcherWithSigData struct, including the regular parameters and an EIP712Signature struct.
     */
    function setDispatcherWithSig(
        DataTypes.SetDispatcherWithSigData calldata vars
    ) external;

    /**
     * @notice Sets a profile's URI, which is reflected in the `tokenURI()` function.
     *
     * @param profileId The token ID of the profile of the profile to set the URI for.
     * @param imageURI The URI to set for the given profile.
     */
    function setProfileImageURI(
        uint256 profileId,
        string calldata imageURI
    ) external;

    /**
     * @notice Sets a profile's URI via signature with the specified parameters.
     *
     * @param vars A SetProfileImageURIWithSigData struct, including the regular parameters and an EIP712Signature struct.
     */
    function setProfileImageURIWithSig(
        DataTypes.SetProfileImageURIWithSigData calldata vars
    ) external;

    /**
     * @notice Sets a followNFT URI for a given profile's follow NFT.
     *
     * @param profileId The token ID of the profile for which to set the followNFT URI.
     * @param followNFTURI The follow NFT URI to set.
     */
    function setFollowNFTURI(
        uint256 profileId,
        string calldata followNFTURI
    ) external;

    /**
     * @notice Sets a followNFT URI via signature with the specified parameters.
     *
     * @param vars A SetFollowNFTURIWithSigData struct, including the regular parameters and an EIP712Signature struct.
     */
    function setFollowNFTURIWithSig(
        DataTypes.SetFollowNFTURIWithSigData calldata vars
    ) external;

    /**
     * @notice Publishes a post to a given profile, must be called by the profile owner.
     *
     * @param vars A PostData struct containing the needed parameters.
     *
     * @return uint256 An integer representing the post's publication ID.
     */
    function post(DataTypes.PostData calldata vars) external returns (uint256);

    /**
     * @notice Publishes a post to a given profile via signature with the specified parameters.
     *
     * @param vars A PostWithSigData struct containing the regular parameters and an EIP712Signature struct.
     *
     * @return uint256 An integer representing the post's publication ID.
     */
    function postWithSig(
        DataTypes.PostWithSigData calldata vars
    ) external returns (uint256);

    /**
     * @notice Publishes a comment to a given profile, must be called by the profile owner.
     *
     * @param vars A CommentData struct containing the needed parameters.
     *
     * @return uint256 An integer representing the comment's publication ID.
     */
    function comment(
        DataTypes.CommentData calldata vars
    ) external returns (uint256);

    /**
     * @notice Publishes a comment to a given profile via signature with the specified parameters.
     *
     * @param vars A CommentWithSigData struct containing the regular parameters and an EIP712Signature struct.
     *
     * @return uint256 An integer representing the comment's publication ID.
     */
    function commentWithSig(
        DataTypes.CommentWithSigData calldata vars
    ) external returns (uint256);

    /**
     * @notice Publishes a mirror to a given profile, must be called by the profile owner.
     *
     * @param vars A MirrorData struct containing the necessary parameters.
     *
     * @return uint256 An integer representing the mirror's publication ID.
     */
    function mirror(
        DataTypes.MirrorData calldata vars
    ) external returns (uint256);

    /**
     * @notice Publishes a mirror to a given profile via signature with the specified parameters.
     *
     * @param vars A MirrorWithSigData struct containing the regular parameters and an EIP712Signature struct.
     *
     * @return uint256 An integer representing the mirror's publication ID.
     */
    function mirrorWithSig(
        DataTypes.MirrorWithSigData calldata vars
    ) external returns (uint256);

    /**
     * @notice Follows the given profiles, executing each profile's follow module logic (if any) and minting followNFTs to the caller.
     *
     * NOTE: Both the `profileIds` and `datas` arrays must be of the same length, regardless if the profiles do not have a follow module set.
     *
     * @param profileIds The token ID array of the profiles to follow.
     * @param datas The arbitrary data array to pass to the follow module for each profile if needed.
     *
     * @return uint256[] An array of integers representing the minted follow NFTs token IDs.
     */
    function follow(
        uint256[] calldata profileIds,
        bytes[] calldata datas
    ) external returns (uint256[] memory);

    /**
     * @notice Follows a given profile via signature with the specified parameters.
     *
     * @param vars A FollowWithSigData struct containing the regular parameters as well as the signing follower's address
     * and an EIP712Signature struct.
     *
     * @return uint256[] An array of integers representing the minted follow NFTs token IDs.
     */
    function followWithSig(
        DataTypes.FollowWithSigData calldata vars
    ) external returns (uint256[] memory);

    /**
     * @notice Collects a given publication, executing collect module logic and minting a collectNFT to the caller.
     *
     * @param profileId The token ID of the profile that published the publication to collect.
     * @param pubId The publication to collect's publication ID.
     * @param data The arbitrary data to pass to the collect module if needed.
     *
     * @return uint256 An integer representing the minted token ID.
     */
    function collect(
        uint256 profileId,
        uint256 pubId,
        bytes calldata data
    ) external returns (uint256);

    /**
     * @notice Collects a given publication via signature with the specified parameters.
     *
     * @param vars A CollectWithSigData struct containing the regular parameters as well as the collector's address and
     * an EIP712Signature struct.
     *
     * @return uint256 An integer representing the minted token ID.
     */
    function collectWithSig(
        DataTypes.CollectWithSigData calldata vars
    ) external returns (uint256);

    /**
     * @dev Helper function to emit a detailed followNFT transfer event from the hub, to be consumed by frontends to track
     * followNFT transfers.
     *
     * @param profileId The token ID of the profile associated with the followNFT being transferred.
     * @param followNFTId The followNFT being transferred's token ID.
     * @param from The address the followNFT is being transferred from.
     * @param to The address the followNFT is being transferred to.
     */
    function emitFollowNFTTransferEvent(
        uint256 profileId,
        uint256 followNFTId,
        address from,
        address to
    ) external;

    /**
     * @dev Helper function to emit a detailed collectNFT transfer event from the hub, to be consumed by frontends to track
     * collectNFT transfers.
     *
     * @param profileId The token ID of the profile associated with the collect NFT being transferred.
     * @param pubId The publication ID associated with the collect NFT being transferred.
     * @param collectNFTId The collectNFT being transferred's token ID.
     * @param from The address the collectNFT is being transferred from.
     * @param to The address the collectNFT is being transferred to.
     */
    function emitCollectNFTTransferEvent(
        uint256 profileId,
        uint256 pubId,
        uint256 collectNFTId,
        address from,
        address to
    ) external;

    /// ************************
    /// *****VIEW FUNCTIONS*****
    /// ************************

    /**
     * @notice Returns whether or not a profile creator is whitelisted.
     *
     * @param profileCreator The address of the profile creator to check.
     *
     * @return bool True if the profile creator is whitelisted, false otherwise.
     */
    function isProfileCreatorWhitelisted(
        address profileCreator
    ) external view returns (bool);

    /**
     * @notice Returns default profile for a given wallet address
     *
     * @param wallet The address to find the default mapping
     *
     * @return uint256 The default profile id, which will be 0 if not mapped.
     */
    function defaultProfile(address wallet) external view returns (uint256);

    /**
     * @notice Returns whether or not a follow module is whitelisted.
     *
     * @param followModule The address of the follow module to check.
     *
     * @return bool True if the the follow module is whitelisted, false otherwise.
     */
    function isFollowModuleWhitelisted(
        address followModule
    ) external view returns (bool);

    /**
     * @notice Returns whether or not a reference module is whitelisted.
     *
     * @param referenceModule The address of the reference module to check.
     *
     * @return bool True if the the reference module is whitelisted, false otherwise.
     */
    function isReferenceModuleWhitelisted(
        address referenceModule
    ) external view returns (bool);

    /**
     * @notice Returns whether or not a collect module is whitelisted.
     *
     * @param collectModule The address of the collect module to check.
     *
     * @return bool True if the the collect module is whitelisted, false otherwise.
     */
    function isCollectModuleWhitelisted(
        address collectModule
    ) external view returns (bool);

    /**
     * @notice Returns the currently configured governance address.
     *
     * @return address The address of the currently configured governance.
     */
    function getGovernance() external view returns (address);

    /**
     * @notice Returns the dispatcher associated with a profile.
     *
     * @param profileId The token ID of the profile to query the dispatcher for.
     *
     * @return address The dispatcher address associated with the profile.
     */
    function getDispatcher(uint256 profileId) external view returns (address);

    /**
     * @notice Returns the publication count for a given profile.
     *
     * @param profileId The token ID of the profile to query.
     *
     * @return uint256 The number of publications associated with the queried profile.
     */
    function getPubCount(uint256 profileId) external view returns (uint256);

    /**
     * @notice Returns the followNFT associated with a given profile, if any.
     *
     * @param profileId The token ID of the profile to query the followNFT for.
     *
     * @return address The followNFT associated with the given profile.
     */
    function getFollowNFT(uint256 profileId) external view returns (address);

    /**
     * @notice Returns the followNFT URI associated with a given profile.
     *
     * @param profileId The token ID of the profile to query the followNFT URI for.
     *
     * @return string The followNFT URI associated with the given profile.
     */
    function getFollowNFTURI(
        uint256 profileId
    ) external view returns (string memory);

    /**
     * @notice Returns the collectNFT associated with a given publication, if any.
     *
     * @param profileId The token ID of the profile that published the publication to query.
     * @param pubId The publication ID of the publication to query.
     *
     * @return address The address of the collectNFT associated with the queried publication.
     */
    function getCollectNFT(
        uint256 profileId,
        uint256 pubId
    ) external view returns (address);

    /**
     * @notice Returns the follow module associated witha  given profile, if any.
     *
     * @param profileId The token ID of the profile to query the follow module for.
     *
     * @return address The address of the follow module associated with the given profile.
     */
    function getFollowModule(uint256 profileId) external view returns (address);

    /**
     * @notice Returns the collect module associated with a given publication.
     *
     * @param profileId The token ID of the profile that published the publication to query.
     * @param pubId The publication ID of the publication to query.
     *
     * @return address The address of the collect module associated with the queried publication.
     */
    function getCollectModule(
        uint256 profileId,
        uint256 pubId
    ) external view returns (address);

    /**
     * @notice Returns the reference module associated witha  given profile, if any.
     *
     * @param profileId The token ID of the profile that published the publication to querythe reference module for.
     * @param pubId The publication ID of the publication to query the reference module for.
     *
     * @return address The address of the reference module associated with the given profile.
     */
    function getReferenceModule(
        uint256 profileId,
        uint256 pubId
    ) external view returns (address);

    /**
     * @notice Returns the handle associated with a profile.
     *
     * @param profileId The token ID of the profile to query the handle for.
     *
     * @return string The handle associated with the profile.
     */
    function getHandle(uint256 profileId) external view returns (string memory);

    /**
     * @notice Returns the publication pointer (profileId & pubId) associated with a given publication.
     *
     * @param profileId The token ID of the profile that published the publication to query the pointer for.
     * @param pubId The publication ID of the publication to query the pointer for.
     *
     * @return tuple First, the profile ID of the profile the current publication is pointing to, second, the
     * publication ID of the publication the current publication is pointing to.
     */
    function getPubPointer(
        uint256 profileId,
        uint256 pubId
    ) external view returns (uint256, uint256);

    /**
     * @notice Returns the URI associated with a given publication.
     *
     * @param profileId The token ID of the profile that published the publication to query.
     * @param pubId The publication ID of the publication to query.
     *
     * @return string The URI associated with a given publication.
     */
    function getContentURI(
        uint256 profileId,
        uint256 pubId
    ) external view returns (string memory);

    /**
     * @notice Returns the profile token ID according to a given handle.
     *
     * @param handle The handle to resolve the profile token ID with.
     *
     * @return uint256 The profile ID the passed handle points to.
     */
    function getProfileIdByHandle(
        string calldata handle
    ) external view returns (uint256);

    /**
     * @notice Returns the full profile struct associated with a given profile token ID.
     *
     * @param profileId The token ID of the profile to query.
     *
     * @return ProfileStruct The profile struct of the given profile.
     */
    function getProfile(
        uint256 profileId
    ) external view returns (DataTypes.ProfileStruct memory);

    /**
     * @notice Returns the full publication struct for a given publication.
     *
     * @param profileId The token ID of the profile that published the publication to query.
     * @param pubId The publication ID of the publication to query.
     *
     * @return PublicationStruct The publication struct associated with the queried publication.
     */
    function getPub(
        uint256 profileId,
        uint256 pubId
    ) external view returns (DataTypes.PublicationStruct memory);

    /**
     * @notice Returns the publication type associated with a given publication.
     *
     * @param profileId The token ID of the profile that published the publication to query.
     * @param pubId The publication ID of the publication to query.
     *
     * @return PubType The publication type, as a member of an enum (either "post," "comment" or "mirror").
     */
    function getPubType(
        uint256 profileId,
        uint256 pubId
    ) external view returns (DataTypes.PubType);

    /**
     * @notice Returns the follow NFT implementation address.
     *
     * @return address The follow NFT implementation address.
     */
    function getFollowNFTImpl() external view returns (address);

    /**
     * @notice Returns the collect NFT implementation address.
     *
     * @return address The collect NFT implementation address.
     */
    function getCollectNFTImpl() external view returns (address);

    struct TokenData {
        address owner;
        uint96 mintTimestamp;
    }

    /**
     * @notice Returns the token data associated with a given NFT. This allows fetching the token owner and
     * mint timestamp in a single call.
     *
     * @param tokenId The token ID of the NFT to query the token data for.
     *
     * @return TokenData token data struct containing both the owner address and the mint timestamp.
     */
    function tokenDataOf(
        uint256 tokenId
    ) external view returns (TokenData memory);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(
        address owner,
        uint256 index
    ) external view returns (uint256);

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ILensHub","name":"_lensHub","type":"address"},{"internalType":"address","name":"_dedicatedMsgSender","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"areThereNewProfileIds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"collectFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dedicatedMsgSender","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewProfileIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewPrompts","outputs":[{"components":[{"internalType":"uint256","name":"profileId","type":"uint256"},{"internalType":"string","name":"prompt","type":"string"}],"internalType":"struct Prompt[]","name":"prompts","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getPaginatedPrompts","outputs":[{"components":[{"internalType":"uint256","name":"profileId","type":"uint256"},{"internalType":"string","name":"prompt","type":"string"}],"internalType":"struct Prompt[]","name":"prompts","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProfileIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalNumberOfProfiles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lensHub","outputs":[{"internalType":"contract ILensHub","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"promptByProfileId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"__profileIds","type":"uint256[]"}],"name":"removeNewProfileIds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_profileId","type":"uint256"},{"internalType":"string","name":"_prompt","type":"string"}],"name":"setPrompt","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_profileId","type":"uint256"}],"name":"stopPrompt","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052674563918244f400006000553480156200001d57600080fd5b50604051620018ab380380620018ab833981016040819052620000409162000071565b6001600160a01b039182166080521660a052620000b0565b6001600160a01b03811681146200006e57600080fd5b50565b600080604083850312156200008557600080fd5b8251620000928162000058565b6020840151909250620000a58162000058565b809150509250929050565b60805160a0516117966200011560003960008181610129015281816104570152818161088701528181610bc50152610e280152600081816102ab01528181610481015281816108b101528181610a5d01528181610cb10152610e5201526117966000f3fe6080604052600436106100e85760003560e01c806370455b7f1161008a578063b02cfdc311610059578063b02cfdc314610299578063ddca3f43146102cd578063f65d7234146102e3578063f7f7a5a7146102f857600080fd5b806370455b7f14610216578063738eaf12146102395780637b2d9e40146102595780639019f8b01461027957600080fd5b80634f103884116100c65780634f103884146101855780635d343dbf146101b257806369b59e75146101d457806369fe0e2d146101f657600080fd5b806323df61a4146100ed57806328f150eb14610117578063470c477b14610163575b600080fd5b3480156100f957600080fd5b5061010261030b565b60405190151581526020015b60405180910390f35b34801561012357600080fd5b5061014b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010e565b34801561016f57600080fd5b5061017861031e565b60405161010e9190611308565b34801561019157600080fd5b506101a56101a036600461134c565b61032f565b60405161010e91906113ab565b3480156101be57600080fd5b506101c76103c9565b60405161010e91906113be565b3480156101e057600080fd5b506101f46101ef366004611447565b610608565b005b34801561020257600080fd5b506101f461021136600461134c565b610696565b34801561022257600080fd5b5061022b61070e565b60405190815260200161010e565b34801561024557600080fd5b506101c7610254366004611464565b61071a565b34801561026557600080fd5b506101f461027436600461134c565b610a45565b34801561028557600080fd5b506101f4610294366004611486565b610bba565b3480156102a557600080fd5b5061014b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102d957600080fd5b5061022b60005481565b3480156102ef57600080fd5b50610178610c8d565b6101f46103063660046114fb565b610c99565b6000806103186004610f79565b11905090565b606061032a6002610f89565b905090565b6001602052600090815260409020805461034890611577565b80601f016020809104026020016040519081016040528092919081815260200182805461037490611577565b80156103c15780601f10610396576101008083540402835291602001916103c1565b820191906000526020600020905b8154815290600101906020018083116103a457829003601f168201915b505050505081565b606060006103d76004610f79565b90508067ffffffffffffffff8111156103f2576103f26115b1565b60405190808252806020026020018201604052801561043857816020015b6040805180820190915260008152606060208201528152602001906001900390816104105790505b50915060005b81811015610603576000610453600483610f9d565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663540528b9836040518263ffffffff1660e01b81526004016104cd91815260200190565b602060405180830381865afa1580156104ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050e91906115c7565b6001600160a01b03161461052257506105f1565b604051806040016040528082815260200160016000848152602001908152602001600020805461055190611577565b80601f016020809104026020016040519081016040528092919081815260200182805461057d90611577565b80156105ca5780601f1061059f576101008083540402835291602001916105ca565b820191906000526020600020905b8154815290600101906020018083116105ad57829003601f168201915b50505050508152508483815181106105e4576105e46115e4565b6020026020010181905250505b806105fb81611610565b91505061043e565b505090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316336001600160a01b0316146106805760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b6106936001600160a01b03821647610fa9565b50565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316336001600160a01b0316146107095760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610677565b600055565b600061032a6002610f79565b606081831061077a5760405162461bcd60e51b815260206004820152602660248201527f4c656e7347656c61746f4750542e676574506167696e6174656450726f6d7074604482015265733a205f746f60d01b6064820152608401610677565b6107846002610f79565b8311156107e45760405162461bcd60e51b815260206004820152602860248201527f4c656e7347656c61746f4750542e676574506167696e6174656450726f6d7074604482015267733a205f66726f6d60c01b6064820152608401610677565b6107ee6002610f79565b8210610801576107fe6002610f79565b91505b61080b8383611629565b67ffffffffffffffff811115610823576108236115b1565b60405190808252806020026020018201604052801561086957816020015b6040805180820190915260008152606060208201528152602001906001900390816108415790505b509050825b82811015610a3e576000610883600283610f9d565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663540528b9836040518263ffffffff1660e01b81526004016108fd91815260200190565b602060405180830381865afa15801561091a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093e91906115c7565b6001600160a01b0316146109525750610a2c565b604051806040016040528082815260200160016000848152602001908152602001600020805461098190611577565b80601f01602080910402602001604051908101604052809291908181526020018280546109ad90611577565b80156109fa5780601f106109cf576101008083540402835291602001916109fa565b820191906000526020600020905b8154815290600101906020018083116109dd57829003601f168201915b5050505050815250838684610a0f9190611629565b81518110610a1f57610a1f6115e4565b6020026020010181905250505b80610a3681611610565b91505061086e565b5092915050565b6040516331a9108f60e11b81526004810182905281907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad091906115c7565b6001600160a01b0316336001600160a01b031614610b305760405162461bcd60e51b815260206004820152601e60248201527f4c656e7347656c61746f4750542e6f6e6c7950726f66696c654f776e657200006044820152606401610677565b610b3b6002836110c2565b610b875760405162461bcd60e51b815260206004820152601d60248201527f4c656e7347656c61746f4750542e73746f7050726f6d70743a203430340000006044820152606401610677565b610b926004836110da565b50610b9e6002836110da565b506000828152600160205260408120610bb6916112ba565b5050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c3e5760405162461bcd60e51b8152602060048201526024808201527f4c656e7347656c61746f4750542e6f6e6c794465646963617465644d73675365604482015263373232b960e11b6064820152608401610677565b60005b81811015610c8857610c75838383818110610c5e57610c5e6115e4565b9050602002013560046110da90919063ffffffff16565b5080610c8081611610565b915050610c41565b505050565b606061032a6004610f89565b6040516331a9108f60e11b81526004810184905283907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2491906115c7565b6001600160a01b0316336001600160a01b031614610d845760405162461bcd60e51b815260206004820152601e60248201527f4c656e7347656c61746f4750542e6f6e6c7950726f66696c654f776e657200006044820152606401610677565b6000543414610dd55760405162461bcd60e51b815260206004820152601c60248201527f4c656e7347656c61746f4750542e73657450726f6d70743a20666565000000006044820152606401610677565b60a0821115610e265760405162461bcd60e51b815260206004820152601f60248201527f4c656e7347656c61746f4750542e73657450726f6d70743a206c656e677468006044820152606401610677565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663540528b9866040518263ffffffff1660e01b8152600401610e9e91815260200190565b602060405180830381865afa158015610ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edf91906115c7565b6001600160a01b031614610f415760405162461bcd60e51b815260206004820152602360248201527f4c656e7347656c61746f4750542e73657450726f6d70743a20646973706174636044820152623432b960e91b6064820152608401610677565b610f4c6004856110e6565b50610f586002856110e6565b506000848152600160205260409020610f7283858361168a565b5050505050565b6000610f83825490565b92915050565b60606000610f96836110f2565b9392505050565b6000610f96838361114e565b80471015610ff95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610677565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611046576040519150601f19603f3d011682016040523d82523d6000602084013e61104b565b606091505b5050905080610c885760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610677565b60008181526001830160205260408120541515610f96565b6000610f968383611178565b6000610f96838361126b565b60608160000180548060200260200160405190810160405280929190818152602001828054801561114257602002820191906000526020600020905b81548152602001906001019080831161112e575b50505050509050919050565b6000826000018281548110611165576111656115e4565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561126157600061119c600183611629565b85549091506000906111b090600190611629565b90508181146112155760008660000182815481106111d0576111d06115e4565b90600052602060002001549050808760000184815481106111f3576111f36115e4565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806112265761122661174a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610f83565b6000915050610f83565b60008181526001830160205260408120546112b257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f83565b506000610f83565b5080546112c690611577565b6000825580601f106112d6575050565b601f01602090049060005260206000209081019061069391905b8082111561130457600081556001016112f0565b5090565b6020808252825182820181905260009190848201906040850190845b8181101561134057835183529284019291840191600101611324565b50909695505050505050565b60006020828403121561135e57600080fd5b5035919050565b6000815180845260005b8181101561138b5760208185018101518683018201520161136f565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610f966020830184611365565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561142457888303603f1901855281518051845287015187840187905261141187850182611365565b95880195935050908601906001016113e5565b509098975050505050505050565b6001600160a01b038116811461069357600080fd5b60006020828403121561145957600080fd5b8135610f9681611432565b6000806040838503121561147757600080fd5b50508035926020909101359150565b6000806020838503121561149957600080fd5b823567ffffffffffffffff808211156114b157600080fd5b818501915085601f8301126114c557600080fd5b8135818111156114d457600080fd5b8660208260051b85010111156114e957600080fd5b60209290920196919550909350505050565b60008060006040848603121561151057600080fd5b83359250602084013567ffffffffffffffff8082111561152f57600080fd5b818601915086601f83011261154357600080fd5b81358181111561155257600080fd5b87602082850101111561156457600080fd5b6020830194508093505050509250925092565b600181811c9082168061158b57607f821691505b6020821081036115ab57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156115d957600080fd5b8151610f9681611432565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611622576116226115fa565b5060010190565b81810381811115610f8357610f836115fa565b601f821115610c8857600081815260208120601f850160051c810160208610156116635750805b601f850160051c820191505b818110156116825782815560010161166f565b505050505050565b67ffffffffffffffff8311156116a2576116a26115b1565b6116b6836116b08354611577565b8361163c565b6000601f8411600181146116ea57600085156116d25750838201355b600019600387901b1c1916600186901b178355610f72565b600083815260209020601f19861690835b8281101561171b57868501358255602094850194600190920191016116fb565b50868210156117385760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212201d3f44022457a481e3ab0767f738f59933739a01a82056a6e56fe5bc94b1108864736f6c63430008120033000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd225

Deployed Bytecode

0x6080604052600436106100e85760003560e01c806370455b7f1161008a578063b02cfdc311610059578063b02cfdc314610299578063ddca3f43146102cd578063f65d7234146102e3578063f7f7a5a7146102f857600080fd5b806370455b7f14610216578063738eaf12146102395780637b2d9e40146102595780639019f8b01461027957600080fd5b80634f103884116100c65780634f103884146101855780635d343dbf146101b257806369b59e75146101d457806369fe0e2d146101f657600080fd5b806323df61a4146100ed57806328f150eb14610117578063470c477b14610163575b600080fd5b3480156100f957600080fd5b5061010261030b565b60405190151581526020015b60405180910390f35b34801561012357600080fd5b5061014b7f000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd22581565b6040516001600160a01b03909116815260200161010e565b34801561016f57600080fd5b5061017861031e565b60405161010e9190611308565b34801561019157600080fd5b506101a56101a036600461134c565b61032f565b60405161010e91906113ab565b3480156101be57600080fd5b506101c76103c9565b60405161010e91906113be565b3480156101e057600080fd5b506101f46101ef366004611447565b610608565b005b34801561020257600080fd5b506101f461021136600461134c565b610696565b34801561022257600080fd5b5061022b61070e565b60405190815260200161010e565b34801561024557600080fd5b506101c7610254366004611464565b61071a565b34801561026557600080fd5b506101f461027436600461134c565b610a45565b34801561028557600080fd5b506101f4610294366004611486565b610bba565b3480156102a557600080fd5b5061014b7f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d81565b3480156102d957600080fd5b5061022b60005481565b3480156102ef57600080fd5b50610178610c8d565b6101f46103063660046114fb565b610c99565b6000806103186004610f79565b11905090565b606061032a6002610f89565b905090565b6001602052600090815260409020805461034890611577565b80601f016020809104026020016040519081016040528092919081815260200182805461037490611577565b80156103c15780601f10610396576101008083540402835291602001916103c1565b820191906000526020600020905b8154815290600101906020018083116103a457829003601f168201915b505050505081565b606060006103d76004610f79565b90508067ffffffffffffffff8111156103f2576103f26115b1565b60405190808252806020026020018201604052801561043857816020015b6040805180820190915260008152606060208201528152602001906001900390816104105790505b50915060005b81811015610603576000610453600483610f9d565b90507f000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd2256001600160a01b03167f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d6001600160a01b031663540528b9836040518263ffffffff1660e01b81526004016104cd91815260200190565b602060405180830381865afa1580156104ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050e91906115c7565b6001600160a01b03161461052257506105f1565b604051806040016040528082815260200160016000848152602001908152602001600020805461055190611577565b80601f016020809104026020016040519081016040528092919081815260200182805461057d90611577565b80156105ca5780601f1061059f576101008083540402835291602001916105ca565b820191906000526020600020905b8154815290600101906020018083116105ad57829003601f168201915b50505050508152508483815181106105e4576105e46115e4565b6020026020010181905250505b806105fb81611610565b91505061043e565b505090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316336001600160a01b0316146106805760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b6106936001600160a01b03821647610fa9565b50565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316336001600160a01b0316146107095760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610677565b600055565b600061032a6002610f79565b606081831061077a5760405162461bcd60e51b815260206004820152602660248201527f4c656e7347656c61746f4750542e676574506167696e6174656450726f6d7074604482015265733a205f746f60d01b6064820152608401610677565b6107846002610f79565b8311156107e45760405162461bcd60e51b815260206004820152602860248201527f4c656e7347656c61746f4750542e676574506167696e6174656450726f6d7074604482015267733a205f66726f6d60c01b6064820152608401610677565b6107ee6002610f79565b8210610801576107fe6002610f79565b91505b61080b8383611629565b67ffffffffffffffff811115610823576108236115b1565b60405190808252806020026020018201604052801561086957816020015b6040805180820190915260008152606060208201528152602001906001900390816108415790505b509050825b82811015610a3e576000610883600283610f9d565b90507f000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd2256001600160a01b03167f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d6001600160a01b031663540528b9836040518263ffffffff1660e01b81526004016108fd91815260200190565b602060405180830381865afa15801561091a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093e91906115c7565b6001600160a01b0316146109525750610a2c565b604051806040016040528082815260200160016000848152602001908152602001600020805461098190611577565b80601f01602080910402602001604051908101604052809291908181526020018280546109ad90611577565b80156109fa5780601f106109cf576101008083540402835291602001916109fa565b820191906000526020600020905b8154815290600101906020018083116109dd57829003601f168201915b5050505050815250838684610a0f9190611629565b81518110610a1f57610a1f6115e4565b6020026020010181905250505b80610a3681611610565b91505061086e565b5092915050565b6040516331a9108f60e11b81526004810182905281907f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d6001600160a01b031690636352211e90602401602060405180830381865afa158015610aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad091906115c7565b6001600160a01b0316336001600160a01b031614610b305760405162461bcd60e51b815260206004820152601e60248201527f4c656e7347656c61746f4750542e6f6e6c7950726f66696c654f776e657200006044820152606401610677565b610b3b6002836110c2565b610b875760405162461bcd60e51b815260206004820152601d60248201527f4c656e7347656c61746f4750542e73746f7050726f6d70743a203430340000006044820152606401610677565b610b926004836110da565b50610b9e6002836110da565b506000828152600160205260408120610bb6916112ba565b5050565b336001600160a01b037f000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd2251614610c3e5760405162461bcd60e51b8152602060048201526024808201527f4c656e7347656c61746f4750542e6f6e6c794465646963617465644d73675365604482015263373232b960e11b6064820152608401610677565b60005b81811015610c8857610c75838383818110610c5e57610c5e6115e4565b9050602002013560046110da90919063ffffffff16565b5080610c8081611610565b915050610c41565b505050565b606061032a6004610f89565b6040516331a9108f60e11b81526004810184905283907f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d6001600160a01b031690636352211e90602401602060405180830381865afa158015610d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2491906115c7565b6001600160a01b0316336001600160a01b031614610d845760405162461bcd60e51b815260206004820152601e60248201527f4c656e7347656c61746f4750542e6f6e6c7950726f66696c654f776e657200006044820152606401610677565b6000543414610dd55760405162461bcd60e51b815260206004820152601c60248201527f4c656e7347656c61746f4750542e73657450726f6d70743a20666565000000006044820152606401610677565b60a0821115610e265760405162461bcd60e51b815260206004820152601f60248201527f4c656e7347656c61746f4750542e73657450726f6d70743a206c656e677468006044820152606401610677565b7f000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd2256001600160a01b03167f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d6001600160a01b031663540528b9866040518263ffffffff1660e01b8152600401610e9e91815260200190565b602060405180830381865afa158015610ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edf91906115c7565b6001600160a01b031614610f415760405162461bcd60e51b815260206004820152602360248201527f4c656e7347656c61746f4750542e73657450726f6d70743a20646973706174636044820152623432b960e91b6064820152608401610677565b610f4c6004856110e6565b50610f586002856110e6565b506000848152600160205260409020610f7283858361168a565b5050505050565b6000610f83825490565b92915050565b60606000610f96836110f2565b9392505050565b6000610f96838361114e565b80471015610ff95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610677565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611046576040519150601f19603f3d011682016040523d82523d6000602084013e61104b565b606091505b5050905080610c885760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610677565b60008181526001830160205260408120541515610f96565b6000610f968383611178565b6000610f96838361126b565b60608160000180548060200260200160405190810160405280929190818152602001828054801561114257602002820191906000526020600020905b81548152602001906001019080831161112e575b50505050509050919050565b6000826000018281548110611165576111656115e4565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561126157600061119c600183611629565b85549091506000906111b090600190611629565b90508181146112155760008660000182815481106111d0576111d06115e4565b90600052602060002001549050808760000184815481106111f3576111f36115e4565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806112265761122661174a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610f83565b6000915050610f83565b60008181526001830160205260408120546112b257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f83565b506000610f83565b5080546112c690611577565b6000825580601f106112d6575050565b601f01602090049060005260206000209081019061069391905b8082111561130457600081556001016112f0565b5090565b6020808252825182820181905260009190848201906040850190845b8181101561134057835183529284019291840191600101611324565b50909695505050505050565b60006020828403121561135e57600080fd5b5035919050565b6000815180845260005b8181101561138b5760208185018101518683018201520161136f565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610f966020830184611365565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561142457888303603f1901855281518051845287015187840187905261141187850182611365565b95880195935050908601906001016113e5565b509098975050505050505050565b6001600160a01b038116811461069357600080fd5b60006020828403121561145957600080fd5b8135610f9681611432565b6000806040838503121561147757600080fd5b50508035926020909101359150565b6000806020838503121561149957600080fd5b823567ffffffffffffffff808211156114b157600080fd5b818501915085601f8301126114c557600080fd5b8135818111156114d457600080fd5b8660208260051b85010111156114e957600080fd5b60209290920196919550909350505050565b60008060006040848603121561151057600080fd5b83359250602084013567ffffffffffffffff8082111561152f57600080fd5b818601915086601f83011261154357600080fd5b81358181111561155257600080fd5b87602082850101111561156457600080fd5b6020830194508093505050509250925092565b600181811c9082168061158b57607f821691505b6020821081036115ab57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156115d957600080fd5b8151610f9681611432565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611622576116226115fa565b5060010190565b81810381811115610f8357610f836115fa565b601f821115610c8857600081815260208120601f850160051c810160208610156116635750805b601f850160051c820191505b818110156116825782815560010161166f565b505050505050565b67ffffffffffffffff8311156116a2576116a26115b1565b6116b6836116b08354611577565b8361163c565b6000601f8411600181146116ea57600085156116d25750838201355b600019600387901b1c1916600186901b178355610f72565b600083815260209020601f19861690835b8281101561171b57868501358255602094850194600190920191016116fb565b50868210156117385760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212201d3f44022457a481e3ab0767f738f59933739a01a82056a6e56fe5bc94b1108864736f6c63430008120033

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

000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd225

-----Decoded View---------------
Arg [0] : _lensHub (address): 0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d
Arg [1] : _dedicatedMsgSender (address): 0xbB97656cd5fECe3a643335d03C8919D5E7DcD225

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d
Arg [1] : 000000000000000000000000bb97656cd5fece3a643335d03c8919d5e7dcd225


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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