From f88d23b4de2bf25a4e220af8a2ab7aaffdbce397 Mon Sep 17 00:00:00 2001 From: vicnaum Date: Fri, 24 Mar 2023 16:09:34 +0100 Subject: [PATCH] misc: Grammar fixes Co-authored-by: Alan --- contracts/CollectPublicationAction.sol | 4 +- contracts/FollowNFT.sol | 10 +-- contracts/LensHub.sol | 6 +- contracts/LensSeaDropCollection.sol | 16 ++--- contracts/SeaDropMintPublicationAction.sol | 12 ++-- contracts/base/ERC2981CollectionRoyalties.sol | 9 +-- contracts/base/LensBaseERC721.sol | 6 +- contracts/base/LensHubStorage.sol | 8 +-- contracts/interfaces/ICollectModule.sol | 2 +- contracts/interfaces/ICollectNFT.sol | 11 +--- .../interfaces/IDeprecatedCollectModule.sol | 2 +- .../interfaces/IDeprecatedFollowModule.sol | 21 ++----- .../interfaces/IDeprecatedReferenceModule.sol | 6 +- contracts/interfaces/IFollowModuleLegacy.sol | 2 +- contracts/interfaces/IFollowNFT.sol | 14 ++--- contracts/interfaces/ILensHandles.sol | 6 +- contracts/interfaces/ILensHub.sol | 62 +++++++++---------- contracts/interfaces/IModuleGlobals.sol | 4 +- contracts/interfaces/IReferenceModule.sol | 2 +- contracts/libraries/CollectLib.sol | 2 +- contracts/libraries/GovernanceLib.sol | 2 +- contracts/libraries/MetaTxLib.sol | 2 +- contracts/libraries/MigrationLib.sol | 8 +-- contracts/libraries/ProfileTokenURILib.sol | 18 +++--- contracts/libraries/PublicationLib.sol | 2 +- contracts/libraries/StorageLib.sol | 2 +- contracts/libraries/ValidationLib.sol | 8 +-- contracts/misc/access/Governance.sol | 2 +- contracts/misc/namespaces/LensHandles.sol | 2 +- .../misc/namespaces/TokenHandleRegistry.sol | 14 ++--- .../ChangeDelegatedExecutorsConfigTest.t.sol | 4 +- test/foundry/FollowNFTTest.t.sol | 2 +- test/foundry/PublicationActions.t.sol | 2 +- test/foundry/PublicationType.t.sol | 2 +- test/foundry/UnfollowTest.t.sol | 2 +- test/foundry/base/TestSetup.t.sol | 4 +- test/foundry/fork/UpgradeForkTest.t.sol | 4 +- test/foundry/migrations/Migrations.t.sol | 2 +- 38 files changed, 134 insertions(+), 153 deletions(-) diff --git a/contracts/CollectPublicationAction.sol b/contracts/CollectPublicationAction.sol index e9760bf..a2c1fb3 100644 --- a/contracts/CollectPublicationAction.sol +++ b/contracts/CollectPublicationAction.sol @@ -16,10 +16,10 @@ import {VersionedInitializable} from 'contracts/base/upgradeability/VersionedIni contract CollectPublicationAction is HubRestricted, VersionedInitializable, IPublicationActionModule { using Strings for uint256; - // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse with EIP-712 version number. + // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse it with the EIP-712 version number. uint256 internal constant REVISION = 1; - // TODO: Should we move this to some Types file when in Modules repo + // TODO: Should we move this to some Types file when in the Modules repo struct CollectData { address collectModule; address collectNFT; diff --git a/contracts/FollowNFT.sol b/contracts/FollowNFT.sol index 0be5fb9..fb75481 100644 --- a/contracts/FollowNFT.sol +++ b/contracts/FollowNFT.sol @@ -90,7 +90,7 @@ contract FollowNFT is HubRestricted, LensBaseERC721, ERC2981CollectionRoyalties, }); } - // Provided follow token does not exist anymore, it can only be used if profile attempting to follow is + // Provided follow token does not exist anymore, it can only be used if the profile attempting to follow is // allowed to recover it. return _followByRecoveringToken({followerProfileId: followerProfileId, followTokenId: followTokenId}); } @@ -304,7 +304,7 @@ contract FollowNFT is HubRestricted, LensBaseERC721, ERC2981CollectionRoyalties, } // The transactionExecutor is allowed to write the follower in that wrapped token. if (isFollowApproved) { - // The `_followApprovalByFollowTokenId` was used, now needs to be cleared. + // The `_followApprovalByFollowTokenId` was used, and now it needs to be cleared. _approveFollow(0, followTokenId); } _replaceFollower({ @@ -348,7 +348,7 @@ contract FollowNFT is HubRestricted, LensBaseERC721, ERC2981CollectionRoyalties, uint256 followTokenId ) internal { if (currentFollowerProfileId != 0) { - // As it has a follower, unfollow first, removing current follower. + // As it has a follower, unfollow first, removing the current follower. delete _followTokenIdByFollowerProfileId[currentFollowerProfileId]; ILensHub(HUB).emitUnfollowedEvent(currentFollowerProfileId, _followedProfileId); } else { @@ -356,7 +356,7 @@ contract FollowNFT is HubRestricted, LensBaseERC721, ERC2981CollectionRoyalties, _followerCount++; } } - // Perform the follow, setting new follower. + // Perform the follow, setting a new follower. _baseFollow({followerProfileId: newFollowerProfileId, followTokenId: followTokenId, isOriginalFollow: false}); } @@ -404,7 +404,7 @@ contract FollowNFT is HubRestricted, LensBaseERC721, ERC2981CollectionRoyalties, } /** - * @dev Upon transfers, we clear follow approvals, and emit the transfer event in the hub. + * @dev Upon transfers, we clear follow approvals and emit the transfer event in the hub. */ function _beforeTokenTransfer(address from, address to, uint256 followTokenId) internal override { if (from != address(0)) { diff --git a/contracts/LensHub.sol b/contracts/LensHub.sol index 35c3742..5f5e7b0 100644 --- a/contracts/LensHub.sol +++ b/contracts/LensHub.sol @@ -33,16 +33,16 @@ import {TokenHandleRegistry} from 'contracts/misc/namespaces/TokenHandleRegistry * @title LensHub * @author Lens Protocol * - * @notice This is the main entrypoint of the Lens Protocol. It contains governance functionality as well as + * @notice This is the main entry point of the Lens Protocol. It contains governance functionality as well as * publishing and profile interaction functionality. * * NOTE: The Lens Protocol is unique in that frontend operators need to track a potentially overwhelming * number of NFT contracts and interactions at once. For that reason, we've made two quirky design decisions: - * 1. Both Follow & Collect NFTs invoke an LensHub callback on transfer with the sole purpose of emitting an event. + * 1. Both Follow & Collect NFTs invoke a LensHub callback on transfer with the sole purpose of emitting an event. * 2. Almost every event in the protocol emits the current block timestamp, reducing the need to fetch it manually. */ contract LensHub is LensBaseERC721, VersionedInitializable, LensMultiState, LensHubStorage, ILensHub { - // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse with EIP-712 version number. + // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse it with the EIP-712 version number. uint256 internal constant REVISION = 1; address internal immutable FOLLOW_NFT_IMPL; diff --git a/contracts/LensSeaDropCollection.sol b/contracts/LensSeaDropCollection.sol index d2231e3..7cbace1 100644 --- a/contracts/LensSeaDropCollection.sol +++ b/contracts/LensSeaDropCollection.sol @@ -67,8 +67,8 @@ contract LensSeaDropCollection is ERC721SeaDropCloneable { if (config.allowedPayers.length == 0 || config.allowedPayers[0] != SEADROP_ACTION_MODULE) { revert InvalidParams(); } - // NOTE: Validations of fee BPS, disallowed fee recipients or payers are done in the respective overriden - // functions that will be called by the `multiConfigure` function afterwards. + // NOTE: Validations of fee BPS, disallowed fee recipients or payers are done in the respective overridden + // functions that will be called by the `multiConfigure` function afterward. } /** @@ -86,7 +86,7 @@ contract LensSeaDropCollection is ERC721SeaDropCloneable { } /** - * @notice Update the public drop data for this nft contract on SeaDrop. + * @notice Update the public drop data for this NFT contract on SeaDrop. * Only the owner can use this function. * * @param seaDropImpl The allowed SeaDrop contract. @@ -98,7 +98,7 @@ contract LensSeaDropCollection is ERC721SeaDropCloneable { if (seaDropImpl == DEFAULT_SEADROP && publicDrop.feeBps < MODULE_GLOBALS.getTreasuryFee()) { revert FeesDoNotCoverLensTreasury(); } - // Ensure the sender is only the owner or contract itself. + // Ensure the sender is only the owner or this contract itself. _onlyOwnerOrSelf(); // Ensure the SeaDrop is allowed. @@ -109,7 +109,7 @@ contract LensSeaDropCollection is ERC721SeaDropCloneable { } /** - * @notice Update the allowed fee recipient for this nft contract + * @notice Update the allowed fee recipient for this NFT contract * on SeaDrop. * Only the owner can set the allowed fee recipient. * @@ -126,7 +126,7 @@ contract LensSeaDropCollection is ERC721SeaDropCloneable { if (seaDropImpl == DEFAULT_SEADROP && !allowed && feeRecipient == SEADROP_ACTION_MODULE) { revert InvalidParams(); } - // Ensure the sender is only the owner or contract itself. + // Ensure the sender is only the owner or this contract itself. _onlyOwnerOrSelf(); // Ensure the SeaDrop is allowed. @@ -137,7 +137,7 @@ contract LensSeaDropCollection is ERC721SeaDropCloneable { } /** - * @notice Update the allowed payers for this nft contract on SeaDrop. + * @notice Update the allowed payers for this NFT contract on SeaDrop. * Only the owner can use this function. * * @param seaDropImpl The allowed SeaDrop contract. @@ -149,7 +149,7 @@ contract LensSeaDropCollection is ERC721SeaDropCloneable { if (seaDropImpl == DEFAULT_SEADROP && !allowed && payer == SEADROP_ACTION_MODULE) { revert InvalidParams(); } - // Ensure the sender is only the owner or contract itself. + // Ensure the sender is only the owner or this contract itself. _onlyOwnerOrSelf(); // Ensure the SeaDrop is allowed. diff --git a/contracts/SeaDropMintPublicationAction.sol b/contracts/SeaDropMintPublicationAction.sol index 50fa3ff..5bedeff 100644 --- a/contracts/SeaDropMintPublicationAction.sol +++ b/contracts/SeaDropMintPublicationAction.sol @@ -16,7 +16,7 @@ import {Clones} from 'openzeppelin-contracts/proxy/Clones.sol'; import {PublicDrop} from '@seadrop/lib/SeaDropStructs.sol'; import {LensSeaDropCollection} from 'contracts/LensSeaDropCollection.sol'; -// TODO: Move this to Interface file +// TODO: Move this to the Interface file interface IWMATIC is IERC20 { function withdraw(uint amountToUnwrap) external; @@ -24,7 +24,8 @@ interface IWMATIC is IERC20 { } contract SeaDropMintPublicationAction is VersionedInitializable, HubRestricted, IPublicationActionModule { - // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse with EIP-712 version number. + // Constant for upgradeability purposes, see VersionedInitializable, + // do not confuse it with the EIP-712 version number. uint256 internal constant REVISION = 1; uint256 constant MAX_BPS = 10_000; @@ -34,13 +35,13 @@ contract SeaDropMintPublicationAction is VersionedInitializable, HubRestricted, IModuleGlobals public immutable MODULE_GLOBALS; - // TODO: Move this to `Types` when this action is moved to modules repository. + // TODO: Move this to `Types` when this action is moved to the Modules repository. struct CollectionData { address nftCollectionAddress; uint16 referrersFeeBps; } - // TODO: Move these to `Errors` when this action is moved to modules repository. + // TODO: Move these to `Errors` when this action is moved to the Modules repository. error WrongMintPaymentAmount(); error SeaDropFeesNotReceived(); error ActionModuleNotAllowedAsPayer(); @@ -132,7 +133,8 @@ contract SeaDropMintPublicationAction is VersionedInitializable, HubRestricted, // Function to allow receiving MATIC native currency while minting (as a fee recipient). receive() external payable {} - // A function to allow withdrawing dust and rogue native currency and ERC20 tokens left in this contract to treasury. + // A function to allow withdrawing dust, and rogue native currency, + // and ERC20 tokens left in this contract to the treasury. function withdrawToTreasury(address currency) external { address lensTreasuryAddress = MODULE_GLOBALS.getTreasury(); if (currency == address(0)) { diff --git a/contracts/base/ERC2981CollectionRoyalties.sol b/contracts/base/ERC2981CollectionRoyalties.sol index 19a056f..767d00d 100644 --- a/contracts/base/ERC2981CollectionRoyalties.sol +++ b/contracts/base/ERC2981CollectionRoyalties.sol @@ -21,7 +21,7 @@ abstract contract ERC2981CollectionRoyalties is IERC2981 { /** * @notice Changes the royalty percentage for secondary sales. * - * @param royaltiesInBasisPoints The royalty percentage meassured in basis points. + * @param royaltiesInBasisPoints The royalty percentage (measured in basis points). */ function setRoyalty(uint256 royaltiesInBasisPoints) external { _beforeRoyaltiesSet(royaltiesInBasisPoints); @@ -33,7 +33,7 @@ abstract contract ERC2981CollectionRoyalties is IERC2981 { * * @param tokenId The ID of the token queried for royalty information. * @param salePrice The sale price of the token specified. - * @return A tuple with the address who should receive the royalties and the royalty + * @return A tuple with the address that should receive the royalties and the royalty * payment amount for the given sale price. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address, uint256) { @@ -48,10 +48,7 @@ abstract contract ERC2981CollectionRoyalties is IERC2981 { } } - function _getRoyaltyAmount( - uint256, /* tokenId */ - uint256 salePrice - ) internal view virtual returns (uint256) { + function _getRoyaltyAmount(uint256 /* tokenId */, uint256 salePrice) internal view virtual returns (uint256) { return (salePrice * _loadRoyaltiesInBasisPoints()) / BASIS_POINTS; } diff --git a/contracts/base/LensBaseERC721.sol b/contracts/base/LensBaseERC721.sol index 29d60b6..7efcf87 100644 --- a/contracts/base/LensBaseERC721.sol +++ b/contracts/base/LensBaseERC721.sol @@ -172,7 +172,7 @@ abstract contract LensBaseERC721 is /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty - * by default, can be overriden in child contracts. + * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; @@ -258,7 +258,7 @@ abstract contract LensBaseERC721 is * * @dev It is prefixed as `unsafe` as it does not revert when the token does not exist. * - * @param tokenId The token which owner is being queried. + * @param tokenId The token whose owner is being queried. * * @return address The address owning the given token, zero address if the token does not exist. */ @@ -273,7 +273,7 @@ abstract contract LensBaseERC721 is * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. - * implement alternative mechanisms to perform token transfer, such as signature-based. + * implement alternative mechanisms to perform a token transfer, such as signature-based. * * Requirements: * diff --git a/contracts/base/LensHubStorage.sol b/contracts/base/LensHubStorage.sol index f7d8de0..ea1eab4 100644 --- a/contracts/base/LensHubStorage.sol +++ b/contracts/base/LensHubStorage.sol @@ -9,7 +9,7 @@ import {Types} from 'contracts/libraries/constants/Types.sol'; * @author Lens Protocol * * @notice This is an abstract contract that *only* contains storage for the LensHub contract. This - * *must* be inherited last (bar interfaces) in order to preserve the LensHub storage layout. Adding + * *must* be inherited last (bar interfaces) to preserve the LensHub storage layout. Adding * storage variables should be done solely at the bottom of this contract. */ abstract contract LensHubStorage { @@ -17,8 +17,8 @@ abstract contract LensHubStorage { mapping(address => bool) internal _followModuleWhitelisted; // Slot 14 // `_collectModuleWhitelisted` slot replaced by `_actionModuleWhitelistedId` in Lens V2. - // We will need to unwhitelist all the old modules before V2 upgrade so they don't conflict with new bitmap. - // e.g. any address that was True as bool will be mapped to new ID of 1. + // We will need to unwhitelist all the old modules before V2 upgrade so they don't conflict with the new bitmap. + // e.g. any address that was True as bool will be mapped to a new ID of 1. // mapping(address => bool) internal __DEPRECATED__collectModuleWhitelisted; mapping(address => uint256) internal _actionModuleWhitelistedId; // Slot 15 @@ -31,7 +31,7 @@ abstract contract LensHubStorage { mapping(address => uint256) internal _defaultProfileByAddress; // Slot 21, deprecated but needed for V2 migration - uint256 internal _profileCounter; // Slot 22 - this is different to TotalSupply, as TotalSupply is decreased when the Profile is burned + uint256 internal _profileCounter; // Slot 22 - this is different from TotalSupply, as TotalSupply is decreased when the Profile is burned address internal _governance; // Slot 23 address internal _emergencyAdmin; // Slot 24 diff --git a/contracts/interfaces/ICollectModule.sol b/contracts/interfaces/ICollectModule.sol index 7b7f4c9..ab50b01 100644 --- a/contracts/interfaces/ICollectModule.sol +++ b/contracts/interfaces/ICollectModule.sol @@ -19,7 +19,7 @@ interface ICollectModule { * @param transactionExecutor The owner or an approved delegated executor. * @param data Arbitrary data __passed from the user!__ to be decoded. * - * @return bytes An abi encoded byte array encapsulating the execution's state changes. This will be emitted by the + * @return bytes An abi-encoded byte array encapsulating the execution's state changes. This will be emitted by the * hub alongside the collect module's address and should be consumed by front ends. */ function initializePublicationCollectModule( diff --git a/contracts/interfaces/ICollectNFT.sol b/contracts/interfaces/ICollectNFT.sol index d4ed2c2..cdbb182 100644 --- a/contracts/interfaces/ICollectNFT.sol +++ b/contracts/interfaces/ICollectNFT.sol @@ -19,20 +19,15 @@ interface ICollectNFT { * @param name The name to set for this NFT. * @param symbol The symbol to set for this NFT. */ - function initialize( - uint256 profileId, - uint256 pubId, - string calldata name, - string calldata symbol - ) external; + function initialize(uint256 profileId, uint256 pubId, string calldata name, string calldata symbol) external; /** - * @notice Mints a collect NFT to the specified address. This can only be called by the hub, and is called + * @notice Mints a collect NFT to the specified address. This can only be called by the hub and is called * upon collection. * * @param to The address to mint the NFT to. * - * @return uint256 An interger representing the minted token ID. + * @return uint256 An integer representing the minted token ID. */ function mint(address to) external returns (uint256); diff --git a/contracts/interfaces/IDeprecatedCollectModule.sol b/contracts/interfaces/IDeprecatedCollectModule.sol index d1a2edd..81d1d38 100644 --- a/contracts/interfaces/IDeprecatedCollectModule.sol +++ b/contracts/interfaces/IDeprecatedCollectModule.sol @@ -16,7 +16,7 @@ interface IDeprecatedCollectModule { * @param pubId The associated publication's LensHub publication ID. * @param data Arbitrary data __passed from the user!__ to be decoded. * - * @return bytes An abi encoded byte array encapsulating the execution's state changes. This will be emitted by the + * @return bytes An abi-encoded byte array encapsulating the execution's state changes. This will be emitted by the * hub alongside the collect module's address and should be consumed by front ends. */ function initializePublicationCollectModule( diff --git a/contracts/interfaces/IDeprecatedFollowModule.sol b/contracts/interfaces/IDeprecatedFollowModule.sol index ef6640c..d12ebc6 100644 --- a/contracts/interfaces/IDeprecatedFollowModule.sol +++ b/contracts/interfaces/IDeprecatedFollowModule.sol @@ -26,11 +26,7 @@ interface IDeprecatedFollowModule { * @param profileId The token ID of the profile being followed. * @param data Arbitrary data passed by the follower. */ - function processFollow( - address follower, - uint256 profileId, - bytes calldata data - ) external; + function processFollow(address follower, uint256 profileId, bytes calldata data) external; /** * @notice This is a transfer hook that is called upon follow NFT transfer in `beforeTokenTransfer. This can @@ -38,19 +34,14 @@ interface IDeprecatedFollowModule { * * NOTE: Special care needs to be taken here: It is possible that follow NFTs were issued before this module * was initialized if the profile's follow module was previously different. This transfer hook should take this - * into consideration, especially when the module holds state associated with individual follow NFTs. + * into consideration, especially when the module holds a state associated with individual follow NFTs. * * @param profileId The token ID of the profile associated with the follow NFT being transferred. * @param from The address sending the follow NFT. * @param to The address receiving the follow NFT. * @param followNFTTokenId The token ID of the follow NFT being transferred. */ - function followModuleTransferHook( - uint256 profileId, - address from, - address to, - uint256 followNFTTokenId - ) external; + function followModuleTransferHook(uint256 profileId, address from, address to, uint256 followNFTTokenId) external; /** * @notice This is a helper function that could be used in conjunction with specific collect modules. @@ -74,9 +65,5 @@ interface IDeprecatedFollowModule { * * @return true if the given address is following the given profile ID, false otherwise. */ - function isFollowing( - uint256 profileId, - address follower, - uint256 followNFTTokenId - ) external view returns (bool); + function isFollowing(uint256 profileId, address follower, uint256 followNFTTokenId) external view returns (bool); } diff --git a/contracts/interfaces/IDeprecatedReferenceModule.sol b/contracts/interfaces/IDeprecatedReferenceModule.sol index 19317ad..ab3a6c6 100644 --- a/contracts/interfaces/IDeprecatedReferenceModule.sol +++ b/contracts/interfaces/IDeprecatedReferenceModule.sol @@ -16,7 +16,7 @@ interface IDeprecatedReferenceModule { * @param pubId The associated publication's LensHub publication ID. * @param data Arbitrary data passed from the user to be decoded. * - * @return bytes An abi encoded byte array encapsulating the execution's state changes. This will be emitted by the + * @return bytes An abi-encoded byte array encapsulating the execution's state changes. This will be emitted by the * hub alongside the collect module's address and should be consumed by front ends. */ function initializeReferenceModule( @@ -29,7 +29,7 @@ interface IDeprecatedReferenceModule { * @notice Processes a comment action referencing a given publication. This can only be called by the hub. * * @param profileId The token ID of the profile associated with the publication being published. - * @param pointedProfileId The profile ID of the profile associated the publication being referenced. + * @param pointedProfileId The profile ID of the profile associated with the publication being referenced. * @param pointedPubId The publication ID of the publication being referenced. * @param data Arbitrary data __passed from the commenter!__ to be decoded. */ @@ -44,7 +44,7 @@ interface IDeprecatedReferenceModule { * @notice Processes a mirror action referencing a given publication. This can only be called by the hub. * * @param profileId The token ID of the profile associated with the publication being published. - * @param pointedProfileId The profile ID of the profile associated the publication being referenced. + * @param pointedProfileId The profile ID of the profile associated with the publication being referenced. * @param pointedPubId The publication ID of the publication being referenced. * @param data Arbitrary data __passed from the mirrorer!__ to be decoded. */ diff --git a/contracts/interfaces/IFollowModuleLegacy.sol b/contracts/interfaces/IFollowModuleLegacy.sol index d57f8be..0d91ebd 100644 --- a/contracts/interfaces/IFollowModuleLegacy.sol +++ b/contracts/interfaces/IFollowModuleLegacy.sol @@ -47,7 +47,7 @@ interface IFollowModuleLegacy { * * NOTE: Special care needs to be taken here: It is possible that follow NFTs were issued before this module * was initialized if the profile's follow module was previously different. This transfer hook should take this - * into consideration, especially when the module holds state associated with individual follow NFTs. + * into consideration, especially when the module holds a state associated with individual follow NFTs. * * @param profileId The token ID of the profile associated with the follow NFT being transferred. * @param from The address sending the follow NFT. diff --git a/contracts/interfaces/IFollowNFT.sol b/contracts/interfaces/IFollowNFT.sol index 99940be..3038e0a 100644 --- a/contracts/interfaces/IFollowNFT.sol +++ b/contracts/interfaces/IFollowNFT.sol @@ -21,14 +21,14 @@ interface IFollowNFT { /** * @notice Initializes the follow NFT. * - * @dev Sets the hub as priviliged sender, the targeted profile, and the token royalties. + * @dev Sets the hub as privileged sender, the targeted profile, and the token royalties. * * @param profileId The ID of the profile targeted by the follow tokens minted by this collection. */ function initialize(uint256 profileId) external; /** - * @notice Makes the passed profile to follow the profile targeted in this contract. + * @notice Makes the passed profile follow the profile targeted in this contract. * * @dev This must be only callable by the LensHub contract. * @@ -47,11 +47,11 @@ interface IFollowNFT { ) external returns (uint256); /** - * @notice Makes the passed profile to unfollow the profile targeted in this contract. + * @notice Makes the passed profile unfollow the profile targeted in this contract. * * @dev This must be only callable by the LensHub contract. * - * @param unfollowerProfileId The ID of the profile that is perfrorming the unfollow operation. + * @param unfollowerProfileId The ID of the profile that is performing the unfollow operation. * @param transactionExecutor The address executing the operation, which is the signer in case of using meta-transactions or * the sender otherwise. */ @@ -60,7 +60,7 @@ interface IFollowNFT { /** * @notice Removes the follower from the given follow NFT. * - * @dev It can only be called over wrapped tokens, by their owner or an approved-for-all address. + * @dev It can only be called on wrapped tokens, by their owner or an approved-for-all address. * * @param followTokenId The ID of the follow token to remove the follower from. */ @@ -96,7 +96,7 @@ interface IFollowNFT { /** * @notice Processes logic when the given profile is being blocked. If it was following the targeted profile, - * this will make it to unfollow. + * this will make it unfollow. * * @dev This must be only callable by the LensHub contract. * @@ -156,7 +156,7 @@ interface IFollowNFT { * * @param followerProfileId The ID of the profile whose following state should be queried. * - * @return uint256 The ID of the profile set as follower in the given token, zero if it is not being used to follow. + * @return uint256 The ID of the profile set as a follower in the given token, zero if it is not being used to follow. */ function isFollowing(uint256 followerProfileId) external view returns (bool); diff --git a/contracts/interfaces/ILensHandles.sol b/contracts/interfaces/ILensHandles.sol index bba8e43..b2ba6eb 100644 --- a/contracts/interfaces/ILensHandles.sol +++ b/contracts/interfaces/ILensHandles.sol @@ -5,12 +5,12 @@ pragma solidity ^0.8.19; import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol'; interface ILensHandles is IERC721 { - // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse with EIP-712 revision number. + // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse it with the EIP-712 revision number. /** * @notice Mints a handle in the given namespace. - * @notice A handle is composed by a local name and a namespace, separated by dot. - * @notice Example: `john.lens` is a handle composed by the local name `john` and the namespace `lens`. + * @notice A handle is composed of a local name and a namespace, separated by a dot. + * @notice Example: `john.lens` is a handle composed of the local name `john` and the namespace `lens`. * * @param to The address where the handle is being minted to. * @param localName The local name of the handle. diff --git a/contracts/interfaces/ILensHub.sol b/contracts/interfaces/ILensHub.sol index 0ed13c6..b2a901f 100644 --- a/contracts/interfaces/ILensHub.sol +++ b/contracts/interfaces/ILensHub.sol @@ -78,7 +78,7 @@ interface ILensHub { function whitelistReferenceModule(address referenceModule, bool whitelist) external; /** - * @notice Adds or removes a action module from the whitelist. This function can only be called by the current + * @notice Adds or removes an action module from the whitelist. This function can only be called by the current * governance address. * * @param actionModule The action module contract address to add or remove from the whitelist. @@ -147,16 +147,16 @@ interface ILensHub { ) external; /** - * @notice Changes the delegated executors configuration for the given profile. It allows to set the approvals for + * @notice Changes the delegated executors configuration for the given profile. It allows setting the approvals for * delegated executors in the specified configuration, as well as switching to it. * * @dev The message sender must be the owner of the delegator profile. * * @param delegatorProfileId The ID of the profile to which the delegated executor is being changed for. * @param delegatedExecutors The array of delegated executors to set the approval for. - * @param approvals The array of booleans indicating the corresponding executor new approval status. + * @param approvals The array of booleans indicating the corresponding executor's new approval status. * @param configNumber The number of the configuration where the executor approval state is being set. - * @param switchToGivenConfig A boolean indicanting if the configuration must be switched to the one with the given + * @param switchToGivenConfig A boolean indicating if the configuration must be switched to the one with the given * number. */ function changeDelegatedExecutorsConfig( @@ -174,7 +174,7 @@ interface ILensHub { * * @param delegatorProfileId The ID of the profile to which the delegated executor is being changed for. * @param delegatedExecutors The array of delegated executors to set the approval for. - * @param approvals The array of booleans indicating the corresponding executor new approval status. + * @param approvals The array of booleans indicating the corresponding executor's new approval status. */ function changeCurrentDelegatedExecutorsConfig( uint256 delegatorProfileId, @@ -183,17 +183,17 @@ interface ILensHub { ) external; /** - * @notice Changes the delegated executors configuration for the given profile. It allows to set the approvals for + * @notice Changes the delegated executors configuration for the given profile. It allows setting the approvals for * delegated executors in the specified configuration, as well as switching to it. * - * @dev The signer must be the owner of the delegator profile. The meta-tx function only exists in the flavour where + * @dev The signer must be the owner of the delegator profile. The meta-tx function only exists in the flavor where * the `configNumber` and `switchToGivenConfig` params are required to be passed explicitly. * * @param delegatorProfileId The ID of the profile to which the delegated executor is being changed for. * @param delegatedExecutors The array of delegated executors to set the approval for. - * @param approvals The array of booleans indicating the corresponding executor new approval status. + * @param approvals The array of booleans indicating the corresponding executor's new approval status. * @param configNumber The number of the configuration where the executor approval state is being set. - * @param switchToGivenConfig A boolean indicanting if the configuration must be switched to the one with the given + * @param switchToGivenConfig A boolean indicating if the configuration must be switched to the one with the given * number. * @param signature The signature for the post. */ @@ -209,7 +209,7 @@ interface ILensHub { /** * @notice Sets a profile's image 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 profileId The token ID 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; @@ -218,7 +218,7 @@ interface ILensHub { * @notice Sets the image URI via signature for the given profile with the specified parameters. The signer must * either be the profile owner or a delegated executor. * - * @param profileId The token ID of the profile of the profile to set the URI for. + * @param profileId The token ID of the profile to set the URI for. * @param imageURI The URI to set for the given profile. * @param signature The signature for the post. */ @@ -229,7 +229,7 @@ interface ILensHub { ) external; /** - * @notice Publishes a post to a given profile, must be called by the profile owner. + * @notice Publishes a post to a given profile. Must be called by the profile owner. * * @param postParams A PostParams struct containing the needed parameters. * @@ -252,7 +252,7 @@ interface ILensHub { ) external returns (uint256); /** - * @notice Publishes a comment to a given profile, must be called by the profile owner. + * @notice Publishes a comment to a given profile. Must be called by the profile owner. * * @param commentParams A CommentParams struct containing the needed parameters. * @@ -275,7 +275,7 @@ interface ILensHub { ) external returns (uint256); /** - * @notice Publishes a mirror to a given profile, must be called by the profile owner. + * @notice Publishes a mirror to a given profile. Must be called by the profile owner. * * @param mirrorParams A MirrorParams struct containing the necessary parameters. * @@ -298,7 +298,7 @@ interface ILensHub { ) external returns (uint256); /** - * @notice Publishes a quote to a given profile, must be called by the profile owner. + * @notice Publishes a quote to a given profile. Must be called by the profile owner. * * @param quoteParams A QuoteParams struct containing the needed parameters. * @@ -417,8 +417,8 @@ interface ILensHub { ) external; /** - * @notice Collects a given publication via signature with the specified parameters. The caller must either be the collector - * or a delegated executor. + * @notice Collects a given publication via signature with the specified parameters. + * The caller must either be the collector or a delegated executor. * * @param collectParams A CollectParams struct containing the parameters. * @@ -427,8 +427,8 @@ interface ILensHub { function collect(Types.CollectParams calldata collectParams) external returns (uint256); /** - * @notice Collects a given publication via signature with the specified parameters. The signer must either be the collector - * or a delegated executor. + * @notice Collects a given publication via signature with the specified parameters. + * The signer must either be the collector or a delegated executor. * * @param collectParams A CollectParams struct containing the parameters. * @param signature The signature for the collect. @@ -451,8 +451,8 @@ interface ILensHub { function act(Types.PublicationActionParams calldata publicationActionParams) external returns (bytes memory); /** - * @notice Acts on a given publication via signature with the specified parameters. The signer must either be the profile owner - * or a delegated executor. + * @notice Acts on a given publication via signature with the specified parameters. + * The signer must either be the profile owner or a delegated executor. * * @param publicationActionParams A PublicationActionParams struct containing the parameters. * @param signature The signature for the collect. @@ -477,7 +477,7 @@ interface ILensHub { /// ************************ /** - * @notice Returns whether or not `followerProfileId` is following `followedProfileId`. + * @notice Returns whether or not `followerProfileId` is following `followedProfileId`. * * @param followerProfileId The ID of the profile whose following state should be queried. * @param followedProfileId The ID of the profile whose followed state should be queried. @@ -500,7 +500,7 @@ interface ILensHub { * * @param followModule The address of the follow module to check. * - * @return bool True if the the follow module is whitelisted, false otherwise. + * @return bool True if the follow module is whitelisted, false otherwise. */ function isFollowModuleWhitelisted(address followModule) external view returns (bool); @@ -509,16 +509,16 @@ interface ILensHub { * * @param referenceModule The address of the reference module to check. * - * @return bool True if the the reference module is whitelisted, false otherwise. + * @return bool True if the reference module is whitelisted, false otherwise. */ function isReferenceModuleWhitelisted(address referenceModule) external view returns (bool); /** - * @notice Returns whether or not a action module is whitelisted. + * @notice Returns whether or not an action module is whitelisted. * * @param actionModule The address of the action module to check. * - * @return bool True if the the action module is whitelisted, false otherwise. + * @return bool True if the action module is whitelisted, false otherwise. */ function isActionModuleWhitelisted(address actionModule) external view returns (bool); @@ -570,7 +570,7 @@ interface ILensHub { function getDelegatedExecutorsConfigNumber(uint256 delegatorProfileId) external view returns (uint64); /** - * @param delegatorProfileId The ID of the profile from which the delegated executors previous configuration number + * @param delegatorProfileId The ID of the profile from which the delegated executors' previous configuration number * set is being queried. * * @return uint256 The delegated executor configuration number previously set. It will coincide with the current @@ -579,7 +579,7 @@ interface ILensHub { function getDelegatedExecutorsPrevConfigNumber(uint256 delegatorProfileId) external view returns (uint64); /** - * @param delegatorProfileId The ID of the profile from which the delegated executors maximum configuration number + * @param delegatorProfileId The ID of the profile from which the delegated executors' maximum configuration number * set is being queried. * * @return uint256 The delegated executor maximum configuration number set. @@ -643,7 +643,7 @@ interface ILensHub { function getCollectNFT(uint256 profileId, uint256 pubId) external view returns (address); /** - * @notice Returns the follow module associated witha given profile, if any. + * @notice Returns the follow module associated with a given profile, if any. * * @param profileId The token ID of the profile to query the follow module for. * @@ -662,9 +662,9 @@ interface ILensHub { function getCollectModule(uint256 profileId, uint256 pubId) external view returns (address); /** - * @notice Returns the reference module associated witha given profile, if any. + * @notice Returns the reference module associated with a given profile, if any. * - * @param profileId The token ID of the profile that published the publication to querythe reference module for. + * @param profileId The token ID of the profile that published the publication to query the 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. diff --git a/contracts/interfaces/IModuleGlobals.sol b/contracts/interfaces/IModuleGlobals.sol index 5ff4af9..b524f82 100644 --- a/contracts/interfaces/IModuleGlobals.sol +++ b/contracts/interfaces/IModuleGlobals.sol @@ -6,7 +6,7 @@ pragma solidity ^0.8.15; * @title IModuleGlobals * @author Lens Protocol * - * @notice This is the interface for the ModuleGlobals contract, a data providing contract to be queried by modules + * @notice This is the interface for the ModuleGlobals contract, a data-providing contract to be queried by modules * for the most up-to-date parameters. */ interface IModuleGlobals { @@ -76,7 +76,7 @@ interface IModuleGlobals { /** * @notice Returns the treasury address and treasury fee in a single call. * - * @return tuplee First, the treasury address, second, the treasury fee. + * @return tuple First, the treasury address, second, the treasury fee. */ function getTreasuryData() external view returns (address, uint16); } diff --git a/contracts/interfaces/IReferenceModule.sol b/contracts/interfaces/IReferenceModule.sol index c5b9b76..2f43c7f 100644 --- a/contracts/interfaces/IReferenceModule.sol +++ b/contracts/interfaces/IReferenceModule.sol @@ -19,7 +19,7 @@ interface IReferenceModule { * @param pubId The associated publication's LensHub publication ID. * @param data Arbitrary data passed from the user to be decoded. * - * @return bytes An abi encoded byte array encapsulating the execution's state changes. This will be emitted by the + * @return bytes An abi-encoded byte array encapsulating the execution's state changes. This will be emitted by the * hub alongside the collect module's address and should be consumed by front ends. */ function initializeReferenceModule( diff --git a/contracts/libraries/CollectLib.sol b/contracts/libraries/CollectLib.sol index fd97b22..07ceeed 100644 --- a/contracts/libraries/CollectLib.sol +++ b/contracts/libraries/CollectLib.sol @@ -45,7 +45,7 @@ library CollectLib { ); collectModule = _collectedPublication.__DEPRECATED__collectModule; if (collectModule == address(0)) { - // Doesn't have collectModule, thus it cannot be a collected (a mirror or non-existent). + // Doesn't have collectModule, thus it cannot be collected (a mirror or non-existent). revert Errors.CollectNotAllowed(); } diff --git a/contracts/libraries/GovernanceLib.sol b/contracts/libraries/GovernanceLib.sol index d279144..5004ee1 100644 --- a/contracts/libraries/GovernanceLib.sol +++ b/contracts/libraries/GovernanceLib.sol @@ -48,7 +48,7 @@ library GovernanceLib { * @param newState The new protocol state to set. */ function setState(Types.ProtocolState newState) external { - // NOTE: This does not follow CEI-pattern, but there is no interaction and allows to abstract `_setState` logic. + // NOTE: This does not follow the CEI-pattern, but there is no interaction and this allows to abstract `_setState` logic. Types.ProtocolState prevState = _setState(newState); // If the sender is the emergency admin, prevent them from reducing restrictions. if (msg.sender == StorageLib.getEmergencyAdmin()) { diff --git a/contracts/libraries/MetaTxLib.sol b/contracts/libraries/MetaTxLib.sol index 957d6c7..2d7e1aa 100644 --- a/contracts/libraries/MetaTxLib.sol +++ b/contracts/libraries/MetaTxLib.sol @@ -11,7 +11,7 @@ import {StorageLib} from 'contracts/libraries/StorageLib.sol'; * @title MetaTxLib * @author Lens Protocol * - * NOTE: the baseFunctions in this contract operate under the assumption that the passed signer is already validated + * NOTE: the functions in this contract operate under the assumption that the passed signer is already validated * to either be the originator or one of their delegated executors. * * @dev User nonces are incremented from this library as well. diff --git a/contracts/libraries/MigrationLib.sol b/contracts/libraries/MigrationLib.sol index b7aabe7..126606d 100644 --- a/contracts/libraries/MigrationLib.sol +++ b/contracts/libraries/MigrationLib.sol @@ -19,7 +19,7 @@ library MigrationLib { /** * @notice Migrates an array of profiles from V1 to V2. This function can be callable by anyone. - * We would still do the migration in batches by ourselves, but good to allow users to migrate on their own if they want to. + * We would still perform the migration in batches by ourselves, but good to allow users to migrate on their own if they want to. * * @param profileIds The array of profile IDs to migrate. */ @@ -44,9 +44,9 @@ library MigrationLib { * @dev We check if the profile has already been migrated by checking handleDeprecated != "". * @dev We check if the profile is the "lensprotocol" profile by checking profileId != 1. This is the only profile * without a .lens suffix. - * @dev We mint a new handle on LensHandles contract and link it to the profile in TokenHandleRegistry contract. + * @dev We mint a new handle on the LensHandles contract and link it to the profile in the TokenHandleRegistry contract. * @dev The resulting handle NFT is sent to the profile owner. - * @dev We emit ProfileMigrated event. + * @dev We emit the ProfileMigrated event. * @dev We do not revert in any case, as we want to allow the migration to continue even if one profile fails * (and it usually fails if already migrated or profileNFT moved). * @@ -66,7 +66,7 @@ library MigrationLib { return; // Already migrated } bytes32 handleHash = keccak256(bytes(handle)); - // "lensprotocol" is the only edge case without .lens suffix: + // "lensprotocol" is the only edge case without the .lens suffix: if (profileId != LENS_PROTOCOL_PROFILE_ID) { assembly { let handle_length := mload(handle) diff --git a/contracts/libraries/ProfileTokenURILib.sol b/contracts/libraries/ProfileTokenURILib.sol index 17d5465..8662ac7 100644 --- a/contracts/libraries/ProfileTokenURILib.sol +++ b/contracts/libraries/ProfileTokenURILib.sol @@ -19,7 +19,7 @@ library ProfileTokenURILib { * @param followers The number of profile's followers. * @param owner The address which owns the profile. * @param handle The profile's handle. - * @param imageURI The profile's picture URI. An empty string if has not been set. + * @param imageURI The profile's picture URI. An empty string if it has not been set. * * @return string The profile's token URI as a base64-encoded JSON string. */ @@ -65,7 +65,7 @@ library ProfileTokenURILib { * Otherwise, a default picture will be used. Handle font size is a function of handle length. * * @param handleWithAtSymbol The profile's handle beginning with "@" symbol. - * @param imageURI The profile's picture URI. An empty string if has not been set. + * @param imageURI The profile's picture URI. An empty string if it has not been set. * * @return string The profile token image as a base64-encoded SVG. */ @@ -88,14 +88,14 @@ library ProfileTokenURILib { } /** - * @notice Gets the fragment of the SVG correponding to the profile picture. + * @notice Gets the fragment of the SVG corresponding to the profile picture. * * @dev If the image URI was set and meets URI format conditions, this will return an image tag referencing it. * Otherwise, a group tag that renders the default picture will be returned. * - * @param imageURI The profile's picture URI. An empty string if has not been set. + * @param imageURI The profile's picture URI. An empty string if it has not been set. * - * @return string The fragment of the SVG token's image correspondending to the profile picture. + * @return string The fragment of the SVG token's image corresponding to the profile picture. */ function _getSVGProfilePicture(string memory imageURI) private pure returns (string memory) { if (_shouldUseCustomPicture(imageURI)) { @@ -114,7 +114,7 @@ library ProfileTokenURILib { } /** - * @notice Maps the handle length to a font size. + * @notice Maps the handle length to font size. * * @dev Gives the font size as a function of handle length using the following formula: * @@ -134,12 +134,12 @@ library ProfileTokenURILib { /** * @notice Decides if Profile NFT should use user provided custom profile picture or the default one. * - * @dev It checks if there is a custom imageURI set and makes sure it does not contain double-quotes to prevent + * @dev It checks if there is a custom imageURI set and makes sure it does not contain double quotes to prevent * injection attacks through the generated SVG. * * @param imageURI The imageURI set by the profile owner. * - * @return bool A boolean indicating whether custom profile picture should be used or not. + * @return bool A boolean indicating whether a custom profile picture should be used or not. */ function _shouldUseCustomPicture(string memory imageURI) private pure returns (bool) { bytes memory imageURIBytes = bytes(imageURI); @@ -149,7 +149,7 @@ library ProfileTokenURILib { uint256 imageURIBytesLength = imageURIBytes.length; for (uint256 i = 0; i < imageURIBytesLength; ) { if (imageURIBytes[i] == '"') { - // Avoids embedding a user provided imageURI containing double-quotes to prevent injection attacks + // Avoids embedding a user-provided imageURI containing double quotes to prevent injection attacks return false; } unchecked { diff --git a/contracts/libraries/PublicationLib.sol b/contracts/libraries/PublicationLib.sol index 2e42a00..2f12cc6 100644 --- a/contracts/libraries/PublicationLib.sol +++ b/contracts/libraries/PublicationLib.sol @@ -156,7 +156,7 @@ library PublicationLib { Types.Publication storage _publication = StorageLib.getPublication(profileId, pubId); Types.PublicationType pubType = _publication.pubType; if (uint8(pubType) == 0) { - // Legacy V1: If publication type is 0, we check using the legacy rules. + // Legacy V1: If the publication type is 0, we check using the legacy rules. if (_publication.pointedProfileId != 0) { // It is pointing to a publication, so it can be either a comment or a mirror, depending on if it has a // collect module or not. diff --git a/contracts/libraries/StorageLib.sol b/contracts/libraries/StorageLib.sol index 36c92c3..dcb1857 100644 --- a/contracts/libraries/StorageLib.sol +++ b/contracts/libraries/StorageLib.sol @@ -15,7 +15,7 @@ library StorageLib { uint256 constant FOLLOW_MODULE_WHITELIST_MAPPING_SLOT = 14; uint256 constant ACTION_MODULE_WHITELIST_ID_MAPPING_SLOT = 15; uint256 constant REFERENCE_MODULE_WHITELIST_MAPPING_SLOT = 16; - // Slot 17 deprecated in Lens V2, it was used for dispatcher address by profile ID. + // Slot 17 is deprecated in Lens V2. In V1 it was used for the dispatcher address by profile ID. uint256 constant PROFILE_ID_BY_HANDLE_HASH_MAPPING_SLOT = 18; uint256 constant PROFILE_BY_ID_MAPPING_SLOT = 19; uint256 constant PUB_BY_ID_BY_PROFILE_MAPPING_SLOT = 20; diff --git a/contracts/libraries/ValidationLib.sol b/contracts/libraries/ValidationLib.sol index ea28446..124d57f 100644 --- a/contracts/libraries/ValidationLib.sol +++ b/contracts/libraries/ValidationLib.sol @@ -14,7 +14,7 @@ import {PublicationLib} from 'contracts/libraries/PublicationLib.sol'; */ library ValidationLib { function validatePointedPub(uint256 profileId, uint256 pubId) internal view { - // If it is pointing to itself it will fail because it will return non-existent type. + // If it is pointing to itself it will fail because it will return a non-existent type. Types.PublicationType pointedPubType = PublicationLib.getPublicationType(profileId, pubId); if (pointedPubType == Types.PublicationType.Nonexistent || pointedPubType == Types.PublicationType.Mirror) { revert Errors.InvalidPointedPub(); @@ -161,7 +161,7 @@ library ValidationLib { if ( // Publication being collected/referenced is not pointing to the referrer post and... (_publication.pointedProfileId != referrerProfileId || _publication.pointedPubId != referrerPubId) && - // ...publication being collected/referenced has not the referrer post as a root. + // ...publication being collected/referenced does not have the referrer post as the root. (_publication.rootProfileId != referrerProfileId || _publication.rootPubId != referrerPubId) ) { revert Errors.InvalidReferrer(); @@ -184,7 +184,7 @@ library ValidationLib { } /** - * @dev Validates that the referrer publication and the interacted publilcation are linked. + * @dev Validates that the referrer publication and the interacted publication are linked. * * @param referrerProfileId The profile id of the referrer. * @param referrerPubId The publication id of the referrer. @@ -201,7 +201,7 @@ library ValidationLib { Types.PublicationType typeOfPubPointedByReferrer = PublicationLib.getPublicationType(profileId, pubId); // We already know that the publication being collected/referenced is not a mirror nor a non-existent one. if (typeOfPubPointedByReferrer == Types.PublicationType.Post) { - // If the publication collected/referenced is a post, the referrer comment/quote must have it as root. + // If the publication collected/referenced is a post, the referrer comment/quote must have it as the root. if (_referrerPub.rootProfileId != profileId || _referrerPub.rootPubId != pubId) { revert Errors.InvalidReferrer(); } diff --git a/contracts/misc/access/Governance.sol b/contracts/misc/access/Governance.sol index e33669d..854d776 100644 --- a/contracts/misc/access/Governance.sol +++ b/contracts/misc/access/Governance.sol @@ -68,7 +68,7 @@ contract Governance is ControllableByContract { ILensHub_V1(address(LENS_HUB)).whitelistCollectModule(collectModule, whitelist); } - // This allows the governance to call anything on-behalf of itself. + // This allows the governance to call anything on behalf of itself. // And also allows the Upgradable contract to call anything, except the LensHub with Governance permissions. function executeAsGovernance( address target, diff --git a/contracts/misc/namespaces/LensHandles.sol b/contracts/misc/namespaces/LensHandles.sol index 374df33..c586bbf 100644 --- a/contracts/misc/namespaces/LensHandles.sol +++ b/contracts/misc/namespaces/LensHandles.sol @@ -13,7 +13,7 @@ library HandlesEvents { } contract LensHandles is ILensHandles, ERC721, VersionedInitializable, ImmutableOwnable { - // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse with EIP-712 revision number. + // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse it with the EIP-712 revision number. uint256 internal constant REVISION = 1; string constant NAMESPACE = 'lens'; diff --git a/contracts/misc/namespaces/TokenHandleRegistry.sol b/contracts/misc/namespaces/TokenHandleRegistry.sol index 4efc2cf..57d0c5a 100644 --- a/contracts/misc/namespaces/TokenHandleRegistry.sol +++ b/contracts/misc/namespaces/TokenHandleRegistry.sol @@ -6,14 +6,14 @@ import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import {VersionedInitializable} from 'contracts/base/upgradeability/VersionedInitializable.sol'; import {ITokenHandleRegistry} from 'contracts/interfaces/ITokenHandleRegistry.sol'; -// TODO: Move to Errors file +// TODO: Move to the Errors file library RegistryErrors { error NotHandleOwner(); error NotTokenOwner(); error NotHandleOrTokenOwner(); } -// TODO: Move to Types file +// TODO: Move to the Types file struct Token { uint256 id; // SLOT 0 address collection; // SLOT 1 - end @@ -26,7 +26,7 @@ struct Handle { // uint96 _gap; // SLOT 1 - start } -// TODO: Move to Events file +// TODO: Move to the Events file library RegistryEvents { event HandleLinked(Handle handle, Token token); event HandleUnlinked(Handle handle, Token token); @@ -38,13 +38,13 @@ library RegistryEvents { /// myname.lens <-> Cryptopunk #69 /// vitalik.eth <-> BAYC #234 contract TokenHandleRegistry is ITokenHandleRegistry, VersionedInitializable { - // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse with EIP-712 revision number. + // Constant for upgradeability purposes, see VersionedInitializable. Do not confuse it with the EIP-712 revision number. uint256 internal constant REVISION = 1; address immutable LENS_HUB; address immutable LENS_HANDLES; - /// 1to1 mapping for now, can be replaced to support multiple handles per token if using mappings + /// 1to1 mapping for now. Can be replaced to support multiple handles per token if using mappings /// NOTE: Using bytes32 _handleHash(Handle) and _tokenHash(Token) as keys because solidity doesn't support structs as keys. mapping(bytes32 handle => Token token) handleToToken; mapping(bytes32 token => Handle handle) tokenToHandle; @@ -112,14 +112,14 @@ contract TokenHandleRegistry is ITokenHandleRegistry, VersionedInitializable { ); } - // TODO: Think of better name? + // TODO: Think of a better name? // handleToToken(handleId)? // resolveTokenByHandle(handleId)? function resolveHandle(uint256 handleId) external view returns (uint256) { return _resolveHandle(Handle({collection: LENS_HANDLES, id: handleId})).id; } - // TODO: Same here - think of better name? + // TODO: Same here - think of a better name? // tokenToHandle(tokenId)? // resolveHandleByToken(tokenId)? function resolveToken(uint256 tokenId) external view returns (uint256) { diff --git a/test/foundry/ChangeDelegatedExecutorsConfigTest.t.sol b/test/foundry/ChangeDelegatedExecutorsConfigTest.t.sol index bbb3927..717bf1e 100644 --- a/test/foundry/ChangeDelegatedExecutorsConfigTest.t.sol +++ b/test/foundry/ChangeDelegatedExecutorsConfigTest.t.sol @@ -151,7 +151,7 @@ contract ChangeDelegatedExecutorsConfigTest_CurrentConfig is BaseTest { ////////////////////////////////////////////////////////////////////// function _refreshCachedNonce(address signer) internal virtual { - // Nothing to do here, this is meant to be overriden by the meta-tx tests. + // Nothing to do here, this is meant to be overridden by the meta-tx tests. } function _changeCurrentDelegatedExecutorsConfig( @@ -330,7 +330,7 @@ contract ChangeDelegatedExecutorsConfigTest_GivenConfig is ChangeDelegatedExecut assertFalse(hub.isDelegatedExecutorApproved(testDelegatorProfileId, address(3))); assertFalse(hub.isDelegatedExecutorApproved(testDelegatorProfileId, address(4))); - // Switch to fourth configuration, now the previous configuration is the second one. + // Switch to the fourth configuration, now the previous configuration is the second one. _refreshCachedNonce(testDelegatorProfileOwner); _changeDelegatedExecutorsConfig({ pk: testDelegatorProfileOwnerPk, diff --git a/test/foundry/FollowNFTTest.t.sol b/test/foundry/FollowNFTTest.t.sol index 582dba4..d08fdbc 100644 --- a/test/foundry/FollowNFTTest.t.sol +++ b/test/foundry/FollowNFTTest.t.sol @@ -1178,7 +1178,7 @@ contract FollowNFTTest is BaseTest, ERC721Test { assertEq(followNFT.getFollowApproved(followTokenId), 0); - // Transfers back to previous owner and checks that it keeps being clear. + // Transfers back to the previous owner and checks that it keeps being clear. vm.prank(followerProfileOwner); followNFT.transferFrom(followerProfileOwner, alreadyFollowingProfileOwner, followTokenId); diff --git a/test/foundry/PublicationActions.t.sol b/test/foundry/PublicationActions.t.sol index 3be2907..700639f 100644 --- a/test/foundry/PublicationActions.t.sol +++ b/test/foundry/PublicationActions.t.sol @@ -6,7 +6,7 @@ import 'test/foundry/helpers/SignatureHelpers.sol'; import 'test/foundry/helpers/CollectingHelpers.sol'; import 'test/foundry/MetaTxNegatives.t.sol'; -// TODO add check for _initialize() called for fork tests - check name and symbol set +// TODO add check for _initialize() called for fork tests - check that the name and symbol are set // contract PublicationActionsTest is BaseTest, SigSetup { // } diff --git a/test/foundry/PublicationType.t.sol b/test/foundry/PublicationType.t.sol index a73a4a0..35e04ca 100644 --- a/test/foundry/PublicationType.t.sol +++ b/test/foundry/PublicationType.t.sol @@ -6,7 +6,7 @@ import 'test/foundry/base/BaseTest.t.sol'; /* Test plan: * * Test New V2 Publications: - * - Test that non-existent publication returns type PublicationType.Noneexistent (0) + * - Test that non-existent publication returns type PublicationType.Nonexistent (0) * - Create a Post and test that a Post returns type PublicationType.Post (1) * - Create a Comment and test that a Comment returns type PublicationType.Comment (2) * - Create a Mirror and test that a Mirror returns type PublicationType.Mirror (3) diff --git a/test/foundry/UnfollowTest.t.sol b/test/foundry/UnfollowTest.t.sol index 83aac4c..a752758 100644 --- a/test/foundry/UnfollowTest.t.sol +++ b/test/foundry/UnfollowTest.t.sol @@ -78,7 +78,7 @@ contract UnfollowTest is BaseTest { idsOfProfilesToUnfollow: _toUint256Array(targetProfileId, unexistentProfileId) }); - // Asserts that the unfollow operation has been completely reverted after one of the unfollow's failed. + // Asserts that the unfollow operation has been completely reverted after one of the unfollows failed. assertTrue(hub.isFollowing(testUnfollowerProfileId, targetProfileId)); } diff --git a/test/foundry/base/TestSetup.t.sol b/test/foundry/base/TestSetup.t.sol index 76789bc..0c9e8a8 100644 --- a/test/foundry/base/TestSetup.t.sol +++ b/test/foundry/base/TestSetup.t.sol @@ -128,7 +128,7 @@ contract TestSetup is Test, ForkManagement, ArrayHelpers { ///////////////////////////////////////// Start deployments. vm.startPrank(deployer); - // Precompute needed addresss. + // Precompute needed addresses. address followNFTAddr = computeCreateAddress(deployer, 1); address collectNFTAddr = computeCreateAddress(deployer, 2); hubProxyAddr = computeCreateAddress(deployer, 3); @@ -181,7 +181,7 @@ contract TestSetup is Test, ForkManagement, ArrayHelpers { ) ); - // precompute basic profile creaton data. + // precompute basic profile creation data. mockCreateProfileParams = Types.CreateProfileParams({ to: profileOwner, imageURI: MOCK_URI, diff --git a/test/foundry/fork/UpgradeForkTest.t.sol b/test/foundry/fork/UpgradeForkTest.t.sol index b693528..6c0ff9a 100644 --- a/test/foundry/fork/UpgradeForkTest.t.sol +++ b/test/foundry/fork/UpgradeForkTest.t.sol @@ -81,7 +81,7 @@ contract UpgradeForkTest is BaseTest { address proxyAdmin = address(uint160(uint256(vm.load(hubProxyAddr, ADMIN_SLOT)))); address gov = hub.getGovernance(); - // Setup the new deployment and helper memory structs. + // Set up the new deployment and helper memory structs. _forkSetup(hubProxyAddr, gov); // Create a profile on the old hub, set the default profile. @@ -126,7 +126,7 @@ contract UpgradeForkTest is BaseTest { } function _fullCreateProfileSequence(address gov, ILensHub hub) private returns (uint256) { - // In order to make this test suite evergreen, we must try setting a modern follow module since we don't know + // To make this test suite evergreen, we must try setting a modern follow module since we don't know // which version of the hub we're working with, if this fails, then we should use a deprecated one. // mockCreateProfileParams.handle = vm.toString(IERC721Enumerable(address(hub)).totalSupply()); diff --git a/test/foundry/migrations/Migrations.t.sol b/test/foundry/migrations/Migrations.t.sol index afb15f0..d9630d5 100644 --- a/test/foundry/migrations/Migrations.t.sol +++ b/test/foundry/migrations/Migrations.t.sol @@ -71,7 +71,7 @@ contract MigrationsTest is Test, ForkManagement { function setUp() public onlyFork { loadBaseAddresses(forkEnv); - // Precompute needed addresss. + // Precompute needed addresses. address lensHandlesAddress = computeCreateAddress(deployer, 0); address tokenHandleRegistryAddress = computeCreateAddress(deployer, 1);