From e6caa36cfbe8652f03ff38de0e339e321429faa8 Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Thu, 7 Apr 2022 15:27:26 -0400 Subject: [PATCH 1/9] feat: Initial basic implementation of current collect tracking events in limited collect modules. --- .../modules/collect/LimitedFeeCollectModule.sol | 8 +++++++- .../collect/LimitedTimedFeeCollectModule.sol | 8 +++++++- contracts/libraries/Events.sol | 13 +++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/contracts/core/modules/collect/LimitedFeeCollectModule.sol b/contracts/core/modules/collect/LimitedFeeCollectModule.sol index a18bead..38edb47 100644 --- a/contracts/core/modules/collect/LimitedFeeCollectModule.sol +++ b/contracts/core/modules/collect/LimitedFeeCollectModule.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.10; import {ICollectModule} from '../../../interfaces/ICollectModule.sol'; import {Errors} from '../../../libraries/Errors.sol'; +import {Events} from '../../../libraries/Events.sol'; import {FeeModuleBase} from '../FeeModuleBase.sol'; import {ModuleBase} from '../ModuleBase.sol'; import {FollowValidationModuleBase} from '../FollowValidationModuleBase.sol'; @@ -116,12 +117,17 @@ contract LimitedFeeCollectModule is FeeModuleBase, FollowValidationModuleBase, I ) { revert Errors.MintLimitExceeded(); } else { - ++_dataByPublicationByProfile[profileId][pubId].currentCollects; if (referrerProfileId == profileId) { _processCollect(collector, profileId, pubId, data); } else { _processCollectWithReferral(referrerProfileId, collector, profileId, pubId, data); } + // We can increment the currentCollects here since there are no external calls in the above processing functions + emit Events.LimitedPubCollected( + profileId, + pubId, + ++_dataByPublicationByProfile[profileId][pubId].currentCollects + ); } } diff --git a/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol b/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol index b1e2ac8..1e64286 100644 --- a/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol +++ b/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.10; import {ICollectModule} from '../../../interfaces/ICollectModule.sol'; import {Errors} from '../../../libraries/Errors.sol'; +import {Events} from '../../../libraries/Events.sol'; import {FeeModuleBase} from '../FeeModuleBase.sol'; import {ModuleBase} from '../ModuleBase.sol'; import {FollowValidationModuleBase} from '../FollowValidationModuleBase.sol'; @@ -139,12 +140,17 @@ contract LimitedTimedFeeCollectModule is FeeModuleBase, FollowValidationModuleBa ) { revert Errors.MintLimitExceeded(); } else { - ++_dataByPublicationByProfile[profileId][pubId].currentCollects; if (referrerProfileId == profileId) { _processCollect(collector, profileId, pubId, data); } else { _processCollectWithReferral(referrerProfileId, collector, profileId, pubId, data); } + // We can increment the currentCollects here since there are no external calls in the above processing functions + emit Events.LimitedPubCollected( + profileId, + pubId, + ++_dataByPublicationByProfile[profileId][pubId].currentCollects + ); } } diff --git a/contracts/libraries/Events.sol b/contracts/libraries/Events.sol index 234ee39..29c4052 100644 --- a/contracts/libraries/Events.sol +++ b/contracts/libraries/Events.sol @@ -476,6 +476,19 @@ library Events { uint256 timestamp ); + /** + * @notice Emitted when a collect is successfully processed in a limited collect module. + * + * @param profileId The profile ID of the collected publication. + * @param pubId The publication ID of the collected publication. + * @param remainingCollects The remaining collects for the collected publication. + */ + event LimitedPubCollected( + uint256 indexed profileId, + uint256 indexed pubId, + uint256 remainingCollects + ); + /** * @dev Emitted when the user wants to enable or disable follows in the `LensPeripheryDataProvider`. * From 7dd7dafc7513379bb30d9550e4fbf785c42ce7f3 Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Thu, 7 Apr 2022 17:22:19 -0400 Subject: [PATCH 2/9] Revert "feat: Initial basic implementation of current collect tracking events in limited collect modules." This reverts commit e6caa36cfbe8652f03ff38de0e339e321429faa8. --- .../modules/collect/LimitedFeeCollectModule.sol | 8 +------- .../collect/LimitedTimedFeeCollectModule.sol | 8 +------- contracts/libraries/Events.sol | 13 ------------- 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/contracts/core/modules/collect/LimitedFeeCollectModule.sol b/contracts/core/modules/collect/LimitedFeeCollectModule.sol index 38edb47..a18bead 100644 --- a/contracts/core/modules/collect/LimitedFeeCollectModule.sol +++ b/contracts/core/modules/collect/LimitedFeeCollectModule.sol @@ -4,7 +4,6 @@ pragma solidity 0.8.10; import {ICollectModule} from '../../../interfaces/ICollectModule.sol'; import {Errors} from '../../../libraries/Errors.sol'; -import {Events} from '../../../libraries/Events.sol'; import {FeeModuleBase} from '../FeeModuleBase.sol'; import {ModuleBase} from '../ModuleBase.sol'; import {FollowValidationModuleBase} from '../FollowValidationModuleBase.sol'; @@ -117,17 +116,12 @@ contract LimitedFeeCollectModule is FeeModuleBase, FollowValidationModuleBase, I ) { revert Errors.MintLimitExceeded(); } else { + ++_dataByPublicationByProfile[profileId][pubId].currentCollects; if (referrerProfileId == profileId) { _processCollect(collector, profileId, pubId, data); } else { _processCollectWithReferral(referrerProfileId, collector, profileId, pubId, data); } - // We can increment the currentCollects here since there are no external calls in the above processing functions - emit Events.LimitedPubCollected( - profileId, - pubId, - ++_dataByPublicationByProfile[profileId][pubId].currentCollects - ); } } diff --git a/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol b/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol index 1e64286..b1e2ac8 100644 --- a/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol +++ b/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol @@ -4,7 +4,6 @@ pragma solidity 0.8.10; import {ICollectModule} from '../../../interfaces/ICollectModule.sol'; import {Errors} from '../../../libraries/Errors.sol'; -import {Events} from '../../../libraries/Events.sol'; import {FeeModuleBase} from '../FeeModuleBase.sol'; import {ModuleBase} from '../ModuleBase.sol'; import {FollowValidationModuleBase} from '../FollowValidationModuleBase.sol'; @@ -140,17 +139,12 @@ contract LimitedTimedFeeCollectModule is FeeModuleBase, FollowValidationModuleBa ) { revert Errors.MintLimitExceeded(); } else { + ++_dataByPublicationByProfile[profileId][pubId].currentCollects; if (referrerProfileId == profileId) { _processCollect(collector, profileId, pubId, data); } else { _processCollectWithReferral(referrerProfileId, collector, profileId, pubId, data); } - // We can increment the currentCollects here since there are no external calls in the above processing functions - emit Events.LimitedPubCollected( - profileId, - pubId, - ++_dataByPublicationByProfile[profileId][pubId].currentCollects - ); } } diff --git a/contracts/libraries/Events.sol b/contracts/libraries/Events.sol index 29c4052..234ee39 100644 --- a/contracts/libraries/Events.sol +++ b/contracts/libraries/Events.sol @@ -476,19 +476,6 @@ library Events { uint256 timestamp ); - /** - * @notice Emitted when a collect is successfully processed in a limited collect module. - * - * @param profileId The profile ID of the collected publication. - * @param pubId The publication ID of the collected publication. - * @param remainingCollects The remaining collects for the collected publication. - */ - event LimitedPubCollected( - uint256 indexed profileId, - uint256 indexed pubId, - uint256 remainingCollects - ); - /** * @dev Emitted when the user wants to enable or disable follows in the `LensPeripheryDataProvider`. * From 76a753e8658717ce7bf3fafa8725df8637838d76 Mon Sep 17 00:00:00 2001 From: donosonaumczuk Date: Fri, 8 Apr 2022 13:59:44 +0100 Subject: [PATCH 3/9] feat: Collect module data added to Collected event --- contracts/libraries/Events.sol | 2 ++ contracts/libraries/InteractionLogic.sol | 14 ++++++++++++-- test/other/events.spec.ts | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/contracts/libraries/Events.sol b/contracts/libraries/Events.sol index 234ee39..5d2637b 100644 --- a/contracts/libraries/Events.sol +++ b/contracts/libraries/Events.sol @@ -303,6 +303,7 @@ library Events { * @param pubId The publication ID that the collect was initiated towards, useful to differentiate mirrors. * @param rootProfileId The profile token ID of the profile whose publication is being collected. * @param rootPubId The publication ID of the publication being collected. + * @param data The data passed to the collect module. * @param timestamp The current block timestamp. */ event Collected( @@ -311,6 +312,7 @@ library Events { uint256 indexed pubId, uint256 rootProfileId, uint256 rootPubId, + bytes data, uint256 timestamp ); diff --git a/contracts/libraries/InteractionLogic.sol b/contracts/libraries/InteractionLogic.sol index 04ff2bd..6a7febc 100644 --- a/contracts/libraries/InteractionLogic.sol +++ b/contracts/libraries/InteractionLogic.sol @@ -127,7 +127,14 @@ library InteractionLogic { rootPubId, collectModuleData ); - _emitCollectedEvent(collector, profileId, pubId, rootProfileId, rootPubId); + _emitCollectedEvent( + collector, + profileId, + pubId, + rootProfileId, + rootPubId, + collectModuleData + ); return tokenId; } @@ -206,13 +213,15 @@ library InteractionLogic { * @param pubId The publication ID that the collect was initiated towards, useful to differentiate mirrors. * @param rootProfileId The profile token ID of the profile whose publication is being collected. * @param rootPubId The publication ID of the publication being collected. + * @param data The data passed to the collect module. */ function _emitCollectedEvent( address collector, uint256 profileId, uint256 pubId, uint256 rootProfileId, - uint256 rootPubId + uint256 rootPubId, + bytes calldata data ) private { emit Events.Collected( collector, @@ -220,6 +229,7 @@ library InteractionLogic { pubId, rootProfileId, rootPubId, + data, block.timestamp ); } diff --git a/test/other/events.spec.ts b/test/other/events.spec.ts index 2ced278..cf3f164 100644 --- a/test/other/events.spec.ts +++ b/test/other/events.spec.ts @@ -503,6 +503,7 @@ makeSuiteCleanRoom('Events', function () { 1, FIRST_PROFILE_ID, 1, + [], await getTimestamp(), ]); matchEvent(receipt, 'BaseInitialized', [expectedName, expectedSymbol, await getTimestamp()]); @@ -578,6 +579,7 @@ makeSuiteCleanRoom('Events', function () { 1, FIRST_PROFILE_ID, 1, + [], await getTimestamp(), ]); matchEvent(receipt, 'BaseInitialized', [expectedName, expectedSymbol, await getTimestamp()]); From bae93a14046b74af137a7c057dec1948cd9f88b2 Mon Sep 17 00:00:00 2001 From: donosonaumczuk Date: Fri, 8 Apr 2022 15:11:05 +0100 Subject: [PATCH 4/9] test: Event tests updated to use a collect module that requires custom data --- test/other/events.spec.ts | 55 ++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/test/other/events.spec.ts b/test/other/events.spec.ts index cf3f164..4681784 100644 --- a/test/other/events.spec.ts +++ b/test/other/events.spec.ts @@ -2,7 +2,7 @@ import { TransactionReceipt } from '@ethersproject/providers'; import '@nomiclabs/hardhat-ethers'; import { expect } from 'chai'; import { TransparentUpgradeableProxy__factory } from '../../typechain-types'; -import { ZERO_ADDRESS } from '../helpers/constants'; +import { MAX_UINT256, ZERO_ADDRESS } from '../helpers/constants'; import { getAbbreviation, getTimestamp, @@ -35,6 +35,8 @@ import { userTwo, userTwoAddress, abiCoder, + feeCollectModule, + currency, } from '../__setup.spec'; /** @@ -469,15 +471,23 @@ makeSuiteCleanRoom('Events', function () { await createProfile(); await waitForTx( - lensHub.connect(governance).whitelistCollectModule(freeCollectModule.address, true) + lensHub.connect(governance).whitelistCollectModule(feeCollectModule.address, true) ); + await expect( + moduleGlobals.connect(governance).whitelistCurrency(currency.address, true) + ).to.not.be.reverted; + const collectPrice = 1; + const collectModuleData = abiCoder.encode( + ['uint256', 'address', 'address', 'uint16', 'bool'], + [collectPrice, currency.address, userAddress, 0, true] + ); await waitForTx( lensHub.post({ profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModule: feeCollectModule.address, + collectModuleData: collectModuleData, referenceModule: ZERO_ADDRESS, referenceModuleData: [], }) @@ -485,12 +495,17 @@ makeSuiteCleanRoom('Events', function () { await waitForTx(lensHub.connect(userTwo).follow([FIRST_PROFILE_ID], [[]])); - receipt = await waitForTx(lensHub.connect(userTwo).collect(FIRST_PROFILE_ID, 1, [])); + await expect(currency.mint(userTwoAddress, MAX_UINT256)).to.not.be.reverted; + await expect( + currency.connect(userTwo).approve(feeCollectModule.address, MAX_UINT256) + ).to.not.be.reverted; + const collectData = abiCoder.encode(['address', 'uint256'], [currency.address, collectPrice]); + receipt = await waitForTx(lensHub.connect(userTwo).collect(FIRST_PROFILE_ID, 1, collectData)); const collectNFT = await lensHub.getCollectNFT(FIRST_PROFILE_ID, 1); const expectedName = MOCK_PROFILE_HANDLE + '-Collect-' + '1'; const expectedSymbol = getAbbreviation(MOCK_PROFILE_HANDLE) + '-Cl-' + '1'; - expect(receipt.logs.length).to.eq(6); + expect(receipt.logs.length).to.eq(7); matchEvent(receipt, 'CollectNFTDeployed', [ FIRST_PROFILE_ID, 1, @@ -503,7 +518,7 @@ makeSuiteCleanRoom('Events', function () { 1, FIRST_PROFILE_ID, 1, - [], + collectData, await getTimestamp(), ]); matchEvent(receipt, 'BaseInitialized', [expectedName, expectedSymbol, await getTimestamp()]); @@ -524,15 +539,23 @@ makeSuiteCleanRoom('Events', function () { await createProfile(); await waitForTx( - lensHub.connect(governance).whitelistCollectModule(freeCollectModule.address, true) + lensHub.connect(governance).whitelistCollectModule(feeCollectModule.address, true) ); + await expect( + moduleGlobals.connect(governance).whitelistCurrency(currency.address, true) + ).to.not.be.reverted; + const collectPrice = 1; + const collectModuleData = abiCoder.encode( + ['uint256', 'address', 'address', 'uint16', 'bool'], + [collectPrice, currency.address, userAddress, 0, true] + ); await waitForTx( lensHub.post({ profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModule: feeCollectModule.address, + collectModuleData: collectModuleData, referenceModule: ZERO_ADDRESS, referenceModuleData: [], }) @@ -561,12 +584,18 @@ makeSuiteCleanRoom('Events', function () { }) ); - receipt = await waitForTx(lensHub.connect(userTwo).collect(secondProfileId, 1, [])); + await expect(currency.mint(userTwoAddress, MAX_UINT256)).to.not.be.reverted; + await expect( + currency.connect(userTwo).approve(feeCollectModule.address, MAX_UINT256) + ).to.not.be.reverted; + const collectData = abiCoder.encode(['address', 'uint256'], [currency.address, collectPrice]); + + receipt = await waitForTx(lensHub.connect(userTwo).collect(secondProfileId, 1, collectData)); const collectNFT = await lensHub.getCollectNFT(FIRST_PROFILE_ID, 1); const expectedName = MOCK_PROFILE_HANDLE + '-Collect-' + '1'; const expectedSymbol = getAbbreviation(MOCK_PROFILE_HANDLE) + '-Cl-' + '1'; - expect(receipt.logs.length).to.eq(6); + expect(receipt.logs.length).to.eq(7); matchEvent(receipt, 'CollectNFTDeployed', [ FIRST_PROFILE_ID, 1, @@ -579,7 +608,7 @@ makeSuiteCleanRoom('Events', function () { 1, FIRST_PROFILE_ID, 1, - [], + collectData, await getTimestamp(), ]); matchEvent(receipt, 'BaseInitialized', [expectedName, expectedSymbol, await getTimestamp()]); From 0abd2c138c5c8d24fcfb6bd1603da4397c03c30a Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Fri, 8 Apr 2022 10:44:11 -0400 Subject: [PATCH 5/9] fix: Fixed `matchEvent()` function to validate array parameter length. --- test/helpers/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/helpers/utils.ts b/test/helpers/utils.ts index 1290251..7b2377f 100644 --- a/test/helpers/utils.ts +++ b/test/helpers/utils.ts @@ -95,6 +95,10 @@ export function matchEvent( } else if (event.args[i].constructor == Array) { let params = event.args[i]; let expected = expectedArgs[i]; + if (expected != '0x' && params.length != expected.length) { + invalidParamsButExists = true; + break; + } for (let j = 0; j < params.length; j++) { if (BigNumber.isBigNumber(params[j])) { if (!params[j].eq(BigNumber.from(expected[j]))) { From fa32453ea76cf9cd21b924ec9abbd36627359e63 Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Fri, 8 Apr 2022 10:51:29 -0400 Subject: [PATCH 6/9] feat: Added `Followed()` event with passed follow module data emitted. --- contracts/libraries/Events.sol | 19 +++++++++++++++++-- contracts/libraries/InteractionLogic.sol | 1 + test/other/events.spec.ts | 11 +++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/contracts/libraries/Events.sol b/contracts/libraries/Events.sol index 5d2637b..cd01327 100644 --- a/contracts/libraries/Events.sol +++ b/contracts/libraries/Events.sol @@ -303,7 +303,7 @@ library Events { * @param pubId The publication ID that the collect was initiated towards, useful to differentiate mirrors. * @param rootProfileId The profile token ID of the profile whose publication is being collected. * @param rootPubId The publication ID of the publication being collected. - * @param data The data passed to the collect module. + * @param collectModuleData The data passed to the collect module. * @param timestamp The current block timestamp. */ event Collected( @@ -312,7 +312,22 @@ library Events { uint256 indexed pubId, uint256 rootProfileId, uint256 rootPubId, - bytes data, + bytes collectModuleData, + uint256 timestamp + ); + + /** + * @dev Emitted upon a successful follow action. + * + * @param follower The address following the given profiles. + * @param profileIds The token ID array of the profiles being followed. + * @param followModuleDatas The array of data parameters passed to each follow module. + * @param timestamp The current block timestamp. + */ + event Followed( + address indexed follower, + uint256[] profileIds, + bytes[] followModuleDatas, uint256 timestamp ); diff --git a/contracts/libraries/InteractionLogic.sol b/contracts/libraries/InteractionLogic.sol index 6a7febc..a72a806 100644 --- a/contracts/libraries/InteractionLogic.sol +++ b/contracts/libraries/InteractionLogic.sol @@ -74,6 +74,7 @@ library InteractionLogic { ++i; } } + emit Events.Followed(follower, profileIds, followModuleDatas, block.timestamp); return tokenIds; } diff --git a/test/other/events.spec.ts b/test/other/events.spec.ts index cf3f164..b0221b7 100644 --- a/test/other/events.spec.ts +++ b/test/other/events.spec.ts @@ -446,15 +446,22 @@ makeSuiteCleanRoom('Events', function () { lensHub.connect(governance).whitelistCollectModule(freeCollectModule.address, true) ); - receipt = await waitForTx(lensHub.connect(userTwo).follow([FIRST_PROFILE_ID], [[]])); + const mockData = abiCoder.encode(['uint256'], [123]); + receipt = await waitForTx(lensHub.connect(userTwo).follow([FIRST_PROFILE_ID], [mockData])); const followNFT = await lensHub.getFollowNFT(FIRST_PROFILE_ID); const expectedName = MOCK_PROFILE_HANDLE + '-Follower'; const expectedSymbol = getAbbreviation(MOCK_PROFILE_HANDLE) + '-Fl'; - expect(receipt.logs.length).to.eq(5); + expect(receipt.logs.length).to.eq(6); matchEvent(receipt, 'FollowNFTDeployed', [FIRST_PROFILE_ID, followNFT, await getTimestamp()]); matchEvent(receipt, 'BaseInitialized', [expectedName, expectedSymbol, await getTimestamp()]); + matchEvent(receipt, 'Followed', [ + userTwoAddress, + [FIRST_PROFILE_ID], + [mockData], + await getTimestamp(), + ]); matchEvent(receipt, 'Transfer', [ZERO_ADDRESS, userTwoAddress, 1], lensHubImpl); matchEvent(receipt, 'FollowNFTTransferred', [ FIRST_PROFILE_ID, From fe4d929fbf64b9ce7ad531ec6ab3081a3cb65030 Mon Sep 17 00:00:00 2001 From: donosonaumczuk Date: Fri, 8 Apr 2022 19:03:19 +0100 Subject: [PATCH 7/9] feat: Arbitrary custom data added to IReferenceModule and its operations' events --- contracts/core/LensHub.sol | 53 +++++++----------- .../reference/FollowerOnlyReferenceModule.sol | 6 +- contracts/interfaces/IReferenceModule.sol | 8 ++- contracts/libraries/DataTypes.sol | 38 ++++++++----- contracts/libraries/Events.sol | 4 ++ contracts/libraries/PublishingLogic.sol | 56 +++++++++---------- contracts/mocks/MockReferenceModule.sol | 6 +- 7 files changed, 88 insertions(+), 83 deletions(-) diff --git a/contracts/core/LensHub.sol b/contracts/core/LensHub.sol index d2b1eb7..1620630 100644 --- a/contracts/core/LensHub.sol +++ b/contracts/core/LensHub.sol @@ -435,10 +435,11 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub keccak256(bytes(vars.contentURI)), vars.profileIdPointed, vars.pubIdPointed, - vars.collectModule, - keccak256(vars.collectModuleData), - vars.referenceModule, keccak256(vars.referenceModuleData), + vars.collectModule, + keccak256(vars.collectModuleInitData), + vars.referenceModule, + keccak256(vars.referenceModuleInitData), sigNonces[owner]++, vars.sig.deadline ) @@ -455,10 +456,11 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub vars.contentURI, vars.profileIdPointed, vars.pubIdPointed, + vars.referenceModuleData, vars.collectModule, - vars.collectModuleData, + vars.collectModuleInitData, vars.referenceModule, - vars.referenceModuleData + vars.referenceModuleInitData ) ); } @@ -471,14 +473,7 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub returns (uint256) { _validateCallerIsProfileOwnerOrDispatcher(vars.profileId); - return - _createMirror( - vars.profileId, - vars.profileIdPointed, - vars.pubIdPointed, - vars.referenceModule, - vars.referenceModuleData - ); + return _createMirror(vars); } /// @inheritdoc ILensHub @@ -498,8 +493,9 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub vars.profileId, vars.profileIdPointed, vars.pubIdPointed, - vars.referenceModule, keccak256(vars.referenceModuleData), + vars.referenceModule, + keccak256(vars.referenceModuleInitData), sigNonces[owner]++, vars.sig.deadline ) @@ -511,11 +507,14 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub } return _createMirror( - vars.profileId, - vars.profileIdPointed, - vars.pubIdPointed, - vars.referenceModule, - vars.referenceModuleData + DataTypes.MirrorData( + vars.profileId, + vars.profileIdPointed, + vars.pubIdPointed, + vars.referenceModuleData, + vars.referenceModule, + vars.referenceModuleInitData + ) ); } @@ -958,21 +957,11 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub } } - function _createMirror( - uint256 profileId, - uint256 profileIdPointed, - uint256 pubIdPointed, - address referenceModule, - bytes calldata referenceModuleData - ) internal returns (uint256) { + function _createMirror(DataTypes.MirrorData memory vars) internal returns (uint256) { unchecked { - uint256 pubId = ++_profileById[profileId].pubCount; + uint256 pubId = ++_profileById[vars.profileId].pubCount; PublishingLogic.createMirror( - profileId, - profileIdPointed, - pubIdPointed, - referenceModule, - referenceModuleData, + vars, pubId, _pubByIdByProfile, _referenceModuleWhitelisted diff --git a/contracts/core/modules/reference/FollowerOnlyReferenceModule.sol b/contracts/core/modules/reference/FollowerOnlyReferenceModule.sol index 0d13d52..f42a78e 100644 --- a/contracts/core/modules/reference/FollowerOnlyReferenceModule.sol +++ b/contracts/core/modules/reference/FollowerOnlyReferenceModule.sol @@ -36,7 +36,8 @@ contract FollowerOnlyReferenceModule is FollowValidationModuleBase, IReferenceMo function processComment( uint256 profileId, uint256 profileIdPointed, - uint256 pubIdPointed + uint256 pubIdPointed, + bytes calldata data ) external view override { address commentCreator = IERC721(HUB).ownerOf(profileId); _checkFollowValidity(profileIdPointed, commentCreator); @@ -50,7 +51,8 @@ contract FollowerOnlyReferenceModule is FollowValidationModuleBase, IReferenceMo function processMirror( uint256 profileId, uint256 profileIdPointed, - uint256 pubIdPointed + uint256 pubIdPointed, + bytes calldata data ) external view override { address mirrorCreator = IERC721(HUB).ownerOf(profileId); _checkFollowValidity(profileIdPointed, mirrorCreator); diff --git a/contracts/interfaces/IReferenceModule.sol b/contracts/interfaces/IReferenceModule.sol index 50cda4d..cb529b8 100644 --- a/contracts/interfaces/IReferenceModule.sol +++ b/contracts/interfaces/IReferenceModule.sol @@ -30,11 +30,13 @@ interface IReferenceModule { * @param profileId The token ID of the profile associated with the publication being published. * @param profileIdPointed The profile ID of the profile associated the publication being referenced. * @param pubIdPointed The publication ID of the publication being referenced. + * @param data Arbitrary data __passed from the commenter!__ to be decoded. */ function processComment( uint256 profileId, uint256 profileIdPointed, - uint256 pubIdPointed + uint256 pubIdPointed, + bytes calldata data ) external; /** @@ -43,10 +45,12 @@ interface IReferenceModule { * @param profileId The token ID of the profile associated with the publication being published. * @param profileIdPointed The profile ID of the profile associated the publication being referenced. * @param pubIdPointed The publication ID of the publication being referenced. + * @param data Arbitrary data __passed from the mirrorer!__ to be decoded. */ function processMirror( uint256 profileId, uint256 profileIdPointed, - uint256 pubIdPointed + uint256 pubIdPointed, + bytes calldata data ) external; } diff --git a/contracts/libraries/DataTypes.sol b/contracts/libraries/DataTypes.sol index 83e5b37..58d11cf 100644 --- a/contracts/libraries/DataTypes.sol +++ b/contracts/libraries/DataTypes.sol @@ -229,20 +229,22 @@ library DataTypes { * @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 collectModuleData The data to pass to the collect module's initialization. + * @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 referenceModuleData The data to be passed to the reference module for initialization. + * @param referenceModuleInitData The data to be passed to the reference module for initialization. */ struct CommentData { uint256 profileId; string contentURI; uint256 profileIdPointed; uint256 pubIdPointed; - address collectModule; - bytes collectModuleData; - address referenceModule; bytes referenceModuleData; + address collectModule; + bytes collectModuleInitData; + address referenceModule; + bytes referenceModuleInitData; } /** @@ -253,10 +255,11 @@ library DataTypes { * @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 collectModuleData The data to pass to the collectModule's initialization. + * @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 referenceModuleData The data to be passed to the reference module for initialization. + * @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 { @@ -264,10 +267,11 @@ library DataTypes { string contentURI; uint256 profileIdPointed; uint256 pubIdPointed; - address collectModule; - bytes collectModuleData; - address referenceModule; bytes referenceModuleData; + address collectModule; + bytes collectModuleInitData; + address referenceModule; + bytes referenceModuleInitData; EIP712Signature sig; } @@ -277,15 +281,17 @@ library DataTypes { * @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 referenceModuleData The data to be passed to the reference module for initialization. + * @param referenceModuleInitData The data to be passed to the reference module for initialization. */ struct MirrorData { uint256 profileId; uint256 profileIdPointed; uint256 pubIdPointed; - address referenceModule; bytes referenceModuleData; + address referenceModule; + bytes referenceModuleInitData; } /** @@ -295,16 +301,18 @@ library DataTypes { * @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 referenceModuleData The data to be passed to the reference module for initialization. + * @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; - address referenceModule; bytes referenceModuleData; + address referenceModule; + bytes referenceModuleInitData; EIP712Signature sig; } @@ -342,7 +350,7 @@ library DataTypes { EIP712Signature sig; } - /** + /** * @notice A struct containing the parameters required for the `setProfileMetadataWithSig()` function. * * @param user The user which is the message signer. diff --git a/contracts/libraries/Events.sol b/contracts/libraries/Events.sol index cd01327..f4e868c 100644 --- a/contracts/libraries/Events.sol +++ b/contracts/libraries/Events.sol @@ -224,6 +224,7 @@ library Events { * @param contentURI The URI mapped to this new publication. * @param profileIdPointed The profile token ID that this comment points to. * @param pubIdPointed The publication ID that this comment points to. + * @param referenceModuleData The data passed to the reference module. * @param collectModule The collect module mapped to this new publication. This CANNOT be the zero address. * @param collectModuleReturnData The data returned from the collect module's initialization for this given * publication. This is abi encoded and totally depends on the collect module chosen. @@ -238,6 +239,7 @@ library Events { string contentURI, uint256 profileIdPointed, uint256 pubIdPointed, + bytes referenceModuleData, address collectModule, bytes collectModuleReturnData, address referenceModule, @@ -252,6 +254,7 @@ library Events { * @param pubId The new publication's ID. * @param profileIdPointed The profile token ID that this mirror points to. * @param pubIdPointed The publication ID that this mirror points to. + * @param referenceModuleData The data passed to the reference module. * @param referenceModule The reference module set for this publication. * @param referenceModuleReturnData The data returned from the reference module at initialization. This is abi * encoded and totally depends on the reference module chosen. @@ -262,6 +265,7 @@ library Events { uint256 indexed pubId, uint256 profileIdPointed, uint256 pubIdPointed, + bytes referenceModuleData, address referenceModule, bytes referenceModuleReturnData, uint256 timestamp diff --git a/contracts/libraries/PublishingLogic.sol b/contracts/libraries/PublishingLogic.sol index 0046bfa..7a7d6d7 100644 --- a/contracts/libraries/PublishingLogic.sol +++ b/contracts/libraries/PublishingLogic.sol @@ -112,9 +112,9 @@ library PublishingLogic { * @param profileId The profile ID to associate this publication to. * @param contentURI The URI to set for this publication. * @param collectModule The collect module to set for this publication. - * @param collectModuleData The data to pass to the collect module for publication initialization. + * @param collectModuleInitData The data to pass to the collect module for publication initialization. * @param referenceModule The reference module to set for this publication, if any. - * @param referenceModuleData The data to pass to the reference module for publication initialization. + * @param referenceModuleInitData The data to pass to the reference module for publication initialization. * @param pubId The publication ID to associate with this publication. * @param _pubByIdByProfile The storage reference to the mapping of publications by publication ID by profile ID. * @param _collectModuleWhitelisted The storage reference to the mapping of whitelist status by collect module address. @@ -124,9 +124,9 @@ library PublishingLogic { uint256 profileId, string memory contentURI, address collectModule, - bytes memory collectModuleData, + bytes memory collectModuleInitData, address referenceModule, - bytes memory referenceModuleData, + bytes memory referenceModuleInitData, uint256 pubId, mapping(uint256 => mapping(uint256 => DataTypes.PublicationStruct)) storage _pubByIdByProfile, @@ -140,7 +140,7 @@ library PublishingLogic { profileId, pubId, collectModule, - collectModuleData, + collectModuleInitData, _pubByIdByProfile, _collectModuleWhitelisted ); @@ -150,7 +150,7 @@ library PublishingLogic { profileId, pubId, referenceModule, - referenceModuleData, + referenceModuleInitData, _pubByIdByProfile, _referenceModuleWhitelisted ); @@ -207,7 +207,7 @@ library PublishingLogic { vars.profileId, pubId, vars.collectModule, - vars.collectModuleData, + vars.collectModuleInitData, _pubByIdByProfile, _collectModuleWhitelisted ); @@ -217,7 +217,7 @@ library PublishingLogic { vars.profileId, pubId, vars.referenceModule, - vars.referenceModuleData, + vars.referenceModuleInitData, _pubByIdByProfile, _referenceModuleWhitelisted ); @@ -229,7 +229,8 @@ library PublishingLogic { IReferenceModule(refModule).processComment( vars.profileId, vars.profileIdPointed, - vars.pubIdPointed + vars.pubIdPointed, + vars.referenceModuleData ); } @@ -240,41 +241,33 @@ library PublishingLogic { /** * @notice Creates a mirror publication mapped to the given profile. * - * @param profileId The profile ID to associate this publication to. - * @param profileIdPointed The profile ID of the pointed publication's publisher. - * @param pubIdPointed The pointed publication's publication ID. - * @param referenceModule The reference module to set for this publication, if any. - * @param referenceModuleData The data to pass to the reference module for publication initialization. + * @param vars The MirrorData struct to use to create the mirror. * @param pubId The publication ID to associate with this publication. * @param _pubByIdByProfile The storage reference to the mapping of publications by publication ID by profile ID. * @param _referenceModuleWhitelisted The storage reference to the mapping of whitelist status by reference module address. */ function createMirror( - uint256 profileId, - uint256 profileIdPointed, - uint256 pubIdPointed, - address referenceModule, - bytes calldata referenceModuleData, + DataTypes.MirrorData memory vars, uint256 pubId, mapping(uint256 => mapping(uint256 => DataTypes.PublicationStruct)) storage _pubByIdByProfile, mapping(address => bool) storage _referenceModuleWhitelisted ) external { (uint256 rootProfileIdPointed, uint256 rootPubIdPointed, ) = Helpers.getPointedIfMirror( - profileIdPointed, - pubIdPointed, + vars.profileIdPointed, + vars.pubIdPointed, _pubByIdByProfile ); - _pubByIdByProfile[profileId][pubId].profileIdPointed = rootProfileIdPointed; - _pubByIdByProfile[profileId][pubId].pubIdPointed = rootPubIdPointed; + _pubByIdByProfile[vars.profileId][pubId].profileIdPointed = rootProfileIdPointed; + _pubByIdByProfile[vars.profileId][pubId].pubIdPointed = rootPubIdPointed; // Reference module initialization bytes memory referenceModuleReturnData = _initPubReferenceModule( - profileId, + vars.profileId, pubId, - referenceModule, - referenceModuleData, + vars.referenceModule, + vars.referenceModuleInitData, _pubByIdByProfile, _referenceModuleWhitelisted ); @@ -284,18 +277,20 @@ library PublishingLogic { .referenceModule; if (refModule != address(0)) { IReferenceModule(refModule).processMirror( - profileId, + vars.profileId, rootProfileIdPointed, - rootPubIdPointed + rootPubIdPointed, + vars.referenceModuleData ); } emit Events.MirrorCreated( - profileId, + vars.profileId, pubId, rootProfileIdPointed, rootPubIdPointed, - referenceModule, + vars.referenceModuleData, + vars.referenceModule, referenceModuleReturnData, block.timestamp ); @@ -363,6 +358,7 @@ library PublishingLogic { vars.contentURI, vars.profileIdPointed, vars.pubIdPointed, + vars.referenceModuleData, vars.collectModule, collectModuleReturnData, vars.referenceModule, diff --git a/contracts/mocks/MockReferenceModule.sol b/contracts/mocks/MockReferenceModule.sol index 2552faf..ce13734 100644 --- a/contracts/mocks/MockReferenceModule.sol +++ b/contracts/mocks/MockReferenceModule.sol @@ -18,12 +18,14 @@ contract MockReferenceModule is IReferenceModule { function processComment( uint256 profileId, uint256 profileIdPointed, - uint256 pubIdPointed + uint256 pubIdPointed, + bytes calldata data ) external override {} function processMirror( uint256 profileId, uint256 profileIdPointed, - uint256 pubIdPointed + uint256 pubIdPointed, + bytes calldata data ) external override {} } From c969cf0bfff9b4d3dfe69f585c789225521a01ff Mon Sep 17 00:00:00 2001 From: donosonaumczuk Date: Fri, 8 Apr 2022 19:25:13 +0100 Subject: [PATCH 8/9] misc: Module data params used for initialization renamed to make them more explicit --- contracts/core/LensHub.sol | 20 ++++++++++---------- contracts/interfaces/ILensHub.sol | 6 +++--- contracts/libraries/DataTypes.sol | 24 ++++++++++++------------ contracts/libraries/PublishingLogic.sol | 22 +++++++++++----------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/contracts/core/LensHub.sol b/contracts/core/LensHub.sol index 1620630..5fed28a 100644 --- a/contracts/core/LensHub.sol +++ b/contracts/core/LensHub.sol @@ -194,13 +194,13 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub function setFollowModule( uint256 profileId, address followModule, - bytes calldata followModuleData + bytes calldata followModuleInitData ) external override whenNotPaused { _validateCallerIsProfileOwner(profileId); PublishingLogic.setFollowModule( profileId, followModule, - followModuleData, + followModuleInitData, _profileById[profileId], _followModuleWhitelisted ); @@ -221,7 +221,7 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub SET_FOLLOW_MODULE_WITH_SIG_TYPEHASH, vars.profileId, vars.followModule, - keccak256(vars.followModuleData), + keccak256(vars.followModuleInitData), sigNonces[owner]++, vars.sig.deadline ) @@ -234,7 +234,7 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub PublishingLogic.setFollowModule( vars.profileId, vars.followModule, - vars.followModuleData, + vars.followModuleInitData, _profileById[vars.profileId], _followModuleWhitelisted ); @@ -360,9 +360,9 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub vars.profileId, vars.contentURI, vars.collectModule, - vars.collectModuleData, + vars.collectModuleInitData, vars.referenceModule, - vars.referenceModuleData + vars.referenceModuleInitData ); } @@ -383,9 +383,9 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub vars.profileId, keccak256(bytes(vars.contentURI)), vars.collectModule, - keccak256(vars.collectModuleData), + keccak256(vars.collectModuleInitData), vars.referenceModule, - keccak256(vars.referenceModuleData), + keccak256(vars.referenceModuleInitData), sigNonces[owner]++, vars.sig.deadline ) @@ -400,9 +400,9 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub vars.profileId, vars.contentURI, vars.collectModule, - vars.collectModuleData, + vars.collectModuleInitData, vars.referenceModule, - vars.referenceModuleData + vars.referenceModuleInitData ); } diff --git a/contracts/interfaces/ILensHub.sol b/contracts/interfaces/ILensHub.sol index 98182dd..61f9bf6 100644 --- a/contracts/interfaces/ILensHub.sol +++ b/contracts/interfaces/ILensHub.sol @@ -95,7 +95,7 @@ interface ILensHub { * 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. - * followModuleData: The follow module initialization data, if any. + * followModuleInitData: The follow module initialization data, if any. */ function createProfile(DataTypes.CreateProfileData calldata vars) external returns (uint256); @@ -119,12 +119,12 @@ interface ILensHub { * * @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 followModuleData The data to be passed to the follow module for initialization. + * @param followModuleInitData The data to be passed to the follow module for initialization. */ function setFollowModule( uint256 profileId, address followModule, - bytes calldata followModuleData + bytes calldata followModuleInitData ) external; /** diff --git a/contracts/libraries/DataTypes.sol b/contracts/libraries/DataTypes.sol index 58d11cf..3ab6641 100644 --- a/contracts/libraries/DataTypes.sol +++ b/contracts/libraries/DataTypes.sol @@ -97,7 +97,7 @@ library DataTypes { * @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 followModuleData The follow module initialization data, if any. + * @param followModuleInitData The follow module initialization data, if any. * @param followNFTURI The URI to use for the follow NFT. */ struct CreateProfileData { @@ -105,7 +105,7 @@ library DataTypes { string handle; string imageURI; address followModule; - bytes followModuleData; + bytes followModuleInitData; string followNFTURI; } @@ -129,13 +129,13 @@ library DataTypes { * * @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 followModuleData The data to be passed to the followModule for initialization. + * @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 followModuleData; + bytes followModuleInitData; EIP712Signature sig; } @@ -187,17 +187,17 @@ library DataTypes { * @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 collectModuleData The data to pass to the collect module's initialization. + * @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 referenceModuleData The data to be passed to the reference module for initialization. + * @param referenceModuleInitData The data to be passed to the reference module for initialization. */ struct PostData { uint256 profileId; string contentURI; address collectModule; - bytes collectModuleData; + bytes collectModuleInitData; address referenceModule; - bytes referenceModuleData; + bytes referenceModuleInitData; } /** @@ -207,18 +207,18 @@ library DataTypes { * @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 collectModuleData The data to pass to the collectModule's initialization. + * @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 referenceModuleData The data to be passed to the reference module for initialization. + * @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 collectModuleData; + bytes collectModuleInitData; address referenceModule; - bytes referenceModuleData; + bytes referenceModuleInitData; EIP712Signature sig; } diff --git a/contracts/libraries/PublishingLogic.sol b/contracts/libraries/PublishingLogic.sol index 7a7d6d7..58ee67f 100644 --- a/contracts/libraries/PublishingLogic.sol +++ b/contracts/libraries/PublishingLogic.sol @@ -29,7 +29,7 @@ library PublishingLogic { * 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. - * followModuleData: The follow module initialization data, if any + * followModuleInitData: The follow module initialization data, if any * followNFTURI: The URI to set for the follow NFT. * @param profileId The profile ID to associate with this profile NFT (token ID). * @param _profileIdByHandleHash The storage reference to the mapping of profile IDs by handle hash. @@ -60,7 +60,7 @@ library PublishingLogic { followModuleReturnData = _initFollowModule( profileId, vars.followModule, - vars.followModuleData, + vars.followModuleInitData, _followModuleWhitelisted ); } @@ -73,14 +73,14 @@ library PublishingLogic { * * @param profileId The profile ID to set the follow module for. * @param followModule The follow module to set for the given profile, if any. - * @param followModuleData The data to pass to the follow module for profile initialization. + * @param followModuleInitData The data to pass to the follow module for profile initialization. * @param _profile The storage reference to the profile struct associated with the given profile ID. * @param _followModuleWhitelisted The storage reference to the mapping of whitelist status by follow module address. */ function setFollowModule( uint256 profileId, address followModule, - bytes calldata followModuleData, + bytes calldata followModuleInitData, DataTypes.ProfileStruct storage _profile, mapping(address => bool) storage _followModuleWhitelisted ) external { @@ -93,7 +93,7 @@ library PublishingLogic { followModuleReturnData = _initFollowModule( profileId, followModule, - followModuleData, + followModuleInitData, _followModuleWhitelisted ); emit Events.FollowModuleSet( @@ -300,7 +300,7 @@ library PublishingLogic { uint256 profileId, uint256 pubId, address collectModule, - bytes memory collectModuleData, + bytes memory collectModuleInitData, mapping(uint256 => mapping(uint256 => DataTypes.PublicationStruct)) storage _pubByIdByProfile, mapping(address => bool) storage _collectModuleWhitelisted @@ -311,7 +311,7 @@ library PublishingLogic { ICollectModule(collectModule).initializePublicationCollectModule( profileId, pubId, - collectModuleData + collectModuleInitData ); } @@ -319,7 +319,7 @@ library PublishingLogic { uint256 profileId, uint256 pubId, address referenceModule, - bytes memory referenceModuleData, + bytes memory referenceModuleInitData, mapping(uint256 => mapping(uint256 => DataTypes.PublicationStruct)) storage _pubByIdByProfile, mapping(address => bool) storage _referenceModuleWhitelisted @@ -332,18 +332,18 @@ library PublishingLogic { IReferenceModule(referenceModule).initializeReferenceModule( profileId, pubId, - referenceModuleData + referenceModuleInitData ); } function _initFollowModule( uint256 profileId, address followModule, - bytes memory followModuleData, + bytes memory followModuleInitData, mapping(address => bool) storage _followModuleWhitelisted ) private returns (bytes memory) { if (!_followModuleWhitelisted[followModule]) revert Errors.FollowModuleNotWhitelisted(); - return IFollowModule(followModule).initializeFollowModule(profileId, followModuleData); + return IFollowModule(followModule).initializeFollowModule(profileId, followModuleInitData); } function _emitCommentCreated( From 7a8a0576e6d539efe580e16ab2b7a1cd793320bf Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Fri, 8 Apr 2022 18:01:24 -0400 Subject: [PATCH 9/9] fix: Fixed tests and updated typehashes. --- contracts/core/storage/LensHubStorage.sol | 8 +- test/helpers/utils.ts | 80 ++--- test/hub/interactions/collecting.spec.ts | 24 +- test/hub/interactions/following.spec.ts | 2 +- test/hub/interactions/multi-state-hub.spec.ts | 290 ++++++++++-------- .../interactions/publishing-comments.spec.ts | 252 ++++++++------- .../interactions/publishing-mirrors.spec.ts | 123 +++++--- .../hub/interactions/publishing-posts.spec.ts | 143 ++++----- test/hub/profiles/default-profile.spec.ts | 8 +- test/hub/profiles/dispatcher.spec.ts | 32 +- test/hub/profiles/profile-creation.spec.ts | 36 +-- test/hub/profiles/profile-uri.spec.ts | 4 +- .../profiles/setting-follow-module.spec.ts | 32 +- .../collect/fee-collect-module.spec.ts | 108 ++++--- .../collect/free-collect-module.spec.ts | 36 ++- .../limited-fee-collect-module.spec.ts | 123 ++++---- .../limited-timed-fee-collect-module.spec.ts | 126 ++++---- .../collect/revert-collect-module.spec.ts | 16 +- .../collect/timed-fee-collect-module.spec.ts | 109 ++++--- .../follow/approval-follow-module.spec.ts | 4 +- test/modules/follow/fee-follow-module.spec.ts | 42 +-- .../follow/profile-follow-module.spec.ts | 26 +- .../follower-only-reference-module.spec.ts | 74 +++-- test/nft/collect-nft.spec.ts | 6 +- test/nft/follow-nft.spec.ts | 2 +- test/nft/lens-nft-base.spec.ts | 2 +- test/other/events.spec.ts | 47 +-- test/other/misc.spec.ts | 117 +++---- .../other/mock-profile-creation-proxy.spec.ts | 2 +- 29 files changed, 1030 insertions(+), 844 deletions(-) diff --git a/contracts/core/storage/LensHubStorage.sol b/contracts/core/storage/LensHubStorage.sol index 104305f..395e14f 100644 --- a/contracts/core/storage/LensHubStorage.sol +++ b/contracts/core/storage/LensHubStorage.sol @@ -19,7 +19,7 @@ abstract contract LensHubStorage { ); bytes32 internal constant SET_FOLLOW_MODULE_WITH_SIG_TYPEHASH = keccak256( - 'SetFollowModuleWithSig(uint256 profileId,address followModule,bytes followModuleData,uint256 nonce,uint256 deadline)' + 'SetFollowModuleWithSig(uint256 profileId,address followModule,bytes followModuleInitData,uint256 nonce,uint256 deadline)' ); bytes32 internal constant SET_FOLLOW_NFT_URI_WITH_SIG_TYPEHASH = keccak256( @@ -35,15 +35,15 @@ abstract contract LensHubStorage { ); bytes32 internal constant POST_WITH_SIG_TYPEHASH = keccak256( - 'PostWithSig(uint256 profileId,string contentURI,address collectModule,bytes collectModuleData,address referenceModule,bytes referenceModuleData,uint256 nonce,uint256 deadline)' + 'PostWithSig(uint256 profileId,string contentURI,address collectModule,bytes collectModuleInitData,address referenceModule,bytes referenceModuleInitData,uint256 nonce,uint256 deadline)' ); bytes32 internal constant COMMENT_WITH_SIG_TYPEHASH = keccak256( - 'CommentWithSig(uint256 profileId,string contentURI,uint256 profileIdPointed,uint256 pubIdPointed,address collectModule,bytes collectModuleData,address referenceModule,bytes referenceModuleData,uint256 nonce,uint256 deadline)' + 'CommentWithSig(uint256 profileId,string contentURI,uint256 profileIdPointed,uint256 pubIdPointed,bytes referenceModuleData,address collectModule,bytes collectModuleInitData,address referenceModule,bytes referenceModuleInitData,uint256 nonce,uint256 deadline)' ); bytes32 internal constant MIRROR_WITH_SIG_TYPEHASH = keccak256( - 'MirrorWithSig(uint256 profileId,uint256 profileIdPointed,uint256 pubIdPointed,address referenceModule,bytes referenceModuleData,uint256 nonce,uint256 deadline)' + 'MirrorWithSig(uint256 profileId,uint256 profileIdPointed,uint256 pubIdPointed,bytes referenceModuleData,address referenceModule,bytes referenceModuleInitData,uint256 nonce,uint256 deadline)' ); bytes32 internal constant FOLLOW_WITH_SIG_TYPEHASH = keccak256( diff --git a/test/helpers/utils.ts b/test/helpers/utils.ts index 7b2377f..dd71315 100644 --- a/test/helpers/utils.ts +++ b/test/helpers/utils.ts @@ -316,14 +316,14 @@ const buildDelegateBySigParams = ( export async function getSetFollowModuleWithSigParts( profileId: BigNumberish, followModule: string, - followModuleData: Bytes | string, + followModuleInitData: Bytes | string, nonce: number, deadline: string ): Promise<{ v: number; r: string; s: string }> { const msgParams = buildSetFollowModuleWithSigParams( profileId, followModule, - followModuleData, + followModuleInitData, nonce, deadline ); @@ -374,9 +374,9 @@ export async function getPostWithSigParts( profileId: BigNumberish, contentURI: string, collectModule: string, - collectModuleData: Bytes | string, + collectModuleInitData: Bytes | string, referenceModule: string, - referenceModuleData: Bytes | string, + referenceModuleInitData: Bytes | string, nonce: number, deadline: string ): Promise<{ v: number; r: string; s: string }> { @@ -384,9 +384,9 @@ export async function getPostWithSigParts( profileId, contentURI, collectModule, - collectModuleData, + collectModuleInitData, referenceModule, - referenceModuleData, + referenceModuleInitData, nonce, deadline ); @@ -398,10 +398,11 @@ export async function getCommentWithSigParts( contentURI: string, profileIdPointed: BigNumberish, pubIdPointed: string, - collectModule: string, - collectModuleData: Bytes | string, - referenceModule: string, referenceModuleData: Bytes | string, + collectModule: string, + collectModuleInitData: Bytes | string, + referenceModule: string, + referenceModuleInitData: Bytes | string, nonce: number, deadline: string ): Promise<{ v: number; r: string; s: string }> { @@ -410,10 +411,11 @@ export async function getCommentWithSigParts( contentURI, profileIdPointed, pubIdPointed, - collectModule, - collectModuleData, - referenceModule, referenceModuleData, + collectModule, + collectModuleInitData, + referenceModule, + referenceModuleInitData, nonce, deadline ); @@ -424,8 +426,9 @@ export async function getMirrorWithSigParts( profileId: BigNumberish, profileIdPointed: BigNumberish, pubIdPointed: string, - referenceModule: string, referenceModuleData: Bytes | string, + referenceModule: string, + referenceModuleInitData: Bytes | string, nonce: number, deadline: string ): Promise<{ v: number; r: string; s: string }> { @@ -433,8 +436,9 @@ export async function getMirrorWithSigParts( profileId, profileIdPointed, pubIdPointed, - referenceModule, referenceModuleData, + referenceModule, + referenceModuleInitData, nonce, deadline ); @@ -760,7 +764,7 @@ const buildBurnWithSigParams = ( const buildSetFollowModuleWithSigParams = ( profileId: BigNumberish, followModule: string, - followModuleData: Bytes | string, + followModuleInitData: Bytes | string, nonce: number, deadline: string ) => ({ @@ -768,7 +772,7 @@ const buildSetFollowModuleWithSigParams = ( SetFollowModuleWithSig: [ { name: 'profileId', type: 'uint256' }, { name: 'followModule', type: 'address' }, - { name: 'followModuleData', type: 'bytes' }, + { name: 'followModuleInitData', type: 'bytes' }, { name: 'nonce', type: 'uint256' }, { name: 'deadline', type: 'uint256' }, ], @@ -777,7 +781,7 @@ const buildSetFollowModuleWithSigParams = ( value: { profileId: profileId, followModule: followModule, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, nonce: nonce, deadline: deadline, }, @@ -879,9 +883,9 @@ const buildPostWithSigParams = ( profileId: BigNumberish, contentURI: string, collectModule: string, - collectModuleData: Bytes | string, + collectModuleInitData: Bytes | string, referenceModule: string, - referenceModuleData: Bytes | string, + referenceModuleInitData: Bytes | string, nonce: number, deadline: string ) => ({ @@ -890,9 +894,9 @@ const buildPostWithSigParams = ( { name: 'profileId', type: 'uint256' }, { name: 'contentURI', type: 'string' }, { name: 'collectModule', type: 'address' }, - { name: 'collectModuleData', type: 'bytes' }, + { name: 'collectModuleInitData', type: 'bytes' }, { name: 'referenceModule', type: 'address' }, - { name: 'referenceModuleData', type: 'bytes' }, + { name: 'referenceModuleInitData', type: 'bytes' }, { name: 'nonce', type: 'uint256' }, { name: 'deadline', type: 'uint256' }, ], @@ -902,9 +906,9 @@ const buildPostWithSigParams = ( profileId: profileId, contentURI: contentURI, collectModule: collectModule, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: referenceModule, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, nonce: nonce, deadline: deadline, }, @@ -915,10 +919,11 @@ const buildCommentWithSigParams = ( contentURI: string, profileIdPointed: BigNumberish, pubIdPointed: string, - collectModule: string, - collectModuleData: Bytes | string, - referenceModule: string, referenceModuleData: Bytes | string, + collectModule: string, + collectModuleInitData: Bytes | string, + referenceModule: string, + referenceModuleInitData: Bytes | string, nonce: number, deadline: string ) => ({ @@ -928,10 +933,11 @@ const buildCommentWithSigParams = ( { name: 'contentURI', type: 'string' }, { name: 'profileIdPointed', type: 'uint256' }, { name: 'pubIdPointed', type: 'uint256' }, - { name: 'collectModule', type: 'address' }, - { name: 'collectModuleData', type: 'bytes' }, - { name: 'referenceModule', type: 'address' }, { name: 'referenceModuleData', type: 'bytes' }, + { name: 'collectModule', type: 'address' }, + { name: 'collectModuleInitData', type: 'bytes' }, + { name: 'referenceModule', type: 'address' }, + { name: 'referenceModuleInitData', type: 'bytes' }, { name: 'nonce', type: 'uint256' }, { name: 'deadline', type: 'uint256' }, ], @@ -942,10 +948,11 @@ const buildCommentWithSigParams = ( contentURI: contentURI, profileIdPointed: profileIdPointed, pubIdPointed: pubIdPointed, - collectModule: collectModule, - collectModuleData: collectModuleData, - referenceModule: referenceModule, referenceModuleData: referenceModuleData, + collectModule: collectModule, + collectModuleInitData: collectModuleInitData, + referenceModule: referenceModule, + referenceModuleInitData: referenceModuleInitData, nonce: nonce, deadline: deadline, }, @@ -955,8 +962,9 @@ const buildMirrorWithSigParams = ( profileId: BigNumberish, profileIdPointed: BigNumberish, pubIdPointed: string, - referenceModule: string, referenceModuleData: Bytes | string, + referenceModule: string, + referenceModuleInitData: Bytes | string, nonce: number, deadline: string ) => ({ @@ -965,8 +973,9 @@ const buildMirrorWithSigParams = ( { name: 'profileId', type: 'uint256' }, { name: 'profileIdPointed', type: 'uint256' }, { name: 'pubIdPointed', type: 'uint256' }, - { name: 'referenceModule', type: 'address' }, { name: 'referenceModuleData', type: 'bytes' }, + { name: 'referenceModule', type: 'address' }, + { name: 'referenceModuleInitData', type: 'bytes' }, { name: 'nonce', type: 'uint256' }, { name: 'deadline', type: 'uint256' }, ], @@ -976,8 +985,9 @@ const buildMirrorWithSigParams = ( profileId: profileId, profileIdPointed: profileIdPointed, pubIdPointed: pubIdPointed, - referenceModule: referenceModule, referenceModuleData: referenceModuleData, + referenceModule: referenceModule, + referenceModuleInitData: referenceModuleInitData, nonce: nonce, deadline: deadline, }, diff --git a/test/hub/interactions/collecting.spec.ts b/test/hub/interactions/collecting.spec.ts index 20cd938..9ed6fe2 100644 --- a/test/hub/interactions/collecting.spec.ts +++ b/test/hub/interactions/collecting.spec.ts @@ -39,7 +39,7 @@ makeSuiteCleanRoom('Collecting', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -48,9 +48,9 @@ makeSuiteCleanRoom('Collecting', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -198,7 +198,7 @@ makeSuiteCleanRoom('Collecting', function () { handle: 'mockhandle', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -208,8 +208,9 @@ makeSuiteCleanRoom('Collecting', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -241,7 +242,7 @@ makeSuiteCleanRoom('Collecting', function () { handle: 'mockhandle', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -251,8 +252,9 @@ makeSuiteCleanRoom('Collecting', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -261,8 +263,9 @@ makeSuiteCleanRoom('Collecting', function () { profileId: secondProfileId, profileIdPointed: secondProfileId, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -478,7 +481,7 @@ makeSuiteCleanRoom('Collecting', function () { handle: 'mockhandle', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -488,8 +491,9 @@ makeSuiteCleanRoom('Collecting', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/hub/interactions/following.spec.ts b/test/hub/interactions/following.spec.ts index c1d0168..d7e494f 100644 --- a/test/hub/interactions/following.spec.ts +++ b/test/hub/interactions/following.spec.ts @@ -34,7 +34,7 @@ makeSuiteCleanRoom('Following', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/hub/interactions/multi-state-hub.spec.ts b/test/hub/interactions/multi-state-hub.spec.ts index cbbaadc..6e36cdc 100644 --- a/test/hub/interactions/multi-state-hub.spec.ts +++ b/test/hub/interactions/multi-state-hub.spec.ts @@ -104,7 +104,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -124,7 +124,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.PAUSED); @@ -139,7 +139,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -152,7 +152,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -179,7 +179,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -200,7 +200,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], sig: { v, r, @@ -218,7 +218,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], sig: { v, r, @@ -236,7 +236,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -261,7 +261,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -314,7 +314,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -339,7 +339,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -392,7 +392,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -417,7 +417,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -470,7 +470,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -486,9 +486,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED); @@ -501,9 +501,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -515,7 +515,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -527,16 +527,16 @@ makeSuiteCleanRoom('Multi-State Hub', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, freeCollectModule.address, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -546,9 +546,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -567,9 +567,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -587,7 +587,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -601,9 +601,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -615,10 +615,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED); @@ -632,10 +633,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -647,7 +649,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -661,16 +663,17 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; await expect(lensHub.connect(governance).setState(ProtocolState.Paused)).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -678,10 +681,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { MOCK_URI, FIRST_PROFILE_ID, '1', - freeCollectModule.address, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -692,10 +696,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -715,10 +720,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -736,7 +742,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -750,9 +756,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -763,8 +769,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED); @@ -777,8 +784,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -790,7 +798,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -804,23 +812,25 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; await expect(lensHub.connect(governance).setState(ProtocolState.Paused)).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -830,8 +840,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -850,8 +861,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -869,7 +881,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -892,7 +904,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -915,7 +927,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -971,7 +983,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -985,9 +997,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -1011,7 +1023,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1025,9 +1037,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -1097,7 +1109,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1110,7 +1122,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1131,7 +1143,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1154,7 +1166,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], sig: { v, r, @@ -1172,7 +1184,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1191,7 +1203,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1229,7 +1241,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1248,7 +1260,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1286,7 +1298,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1304,9 +1316,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED); @@ -1319,9 +1331,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -1333,7 +1345,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1347,16 +1359,16 @@ makeSuiteCleanRoom('Multi-State Hub', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, freeCollectModule.address, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -1366,9 +1378,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -1387,9 +1399,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -1407,7 +1419,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1421,9 +1433,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -1437,10 +1449,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED); @@ -1454,10 +1467,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -1469,7 +1483,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1483,9 +1497,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -1494,7 +1508,8 @@ makeSuiteCleanRoom('Multi-State Hub', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -1502,10 +1517,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { MOCK_URI, FIRST_PROFILE_ID, '1', - freeCollectModule.address, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -1516,10 +1532,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -1539,10 +1556,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -1560,7 +1578,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1574,9 +1592,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -1589,8 +1607,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED); @@ -1603,8 +1622,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -1616,7 +1636,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1630,9 +1650,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -1641,14 +1661,16 @@ makeSuiteCleanRoom('Multi-State Hub', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -1658,8 +1680,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -1678,8 +1701,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -1697,7 +1721,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1716,7 +1740,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1735,7 +1759,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1775,7 +1799,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1789,9 +1813,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -1811,7 +1835,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1825,9 +1849,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/hub/interactions/publishing-comments.spec.ts b/test/hub/interactions/publishing-comments.spec.ts index 94e517e..b8d671d 100644 --- a/test/hub/interactions/publishing-comments.spec.ts +++ b/test/hub/interactions/publishing-comments.spec.ts @@ -36,7 +36,7 @@ makeSuiteCleanRoom('Publishing Comments', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -58,9 +58,9 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -74,9 +74,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: ZERO_ADDRESS, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER); }); @@ -89,9 +90,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: ZERO_ADDRESS, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.COLLECT_MODULE_NOT_WHITELISTED); }); @@ -103,10 +105,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: userAddress, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: userAddress, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.REFERENCE_MODULE_NOT_WHITELISTED); }); @@ -119,9 +122,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: timedFeeCollectModule.address, - collectModuleData: [0x2, 0x12, 0x20], - referenceModule: ZERO_ADDRESS, + collectModuleInitData: [0x2, 0x12, 0x20], referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE); }); @@ -133,10 +137,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, + referenceModuleData: [], collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: mockReferenceModule.address, - referenceModuleData: [0x12, 0x23], + referenceModuleInitData: [0x12, 0x23], }) ).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE); }); @@ -149,9 +154,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 3, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLICATION_DOES_NOT_EXIST); }); @@ -164,9 +170,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 2, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.CANNOT_COMMENT_ON_SELF); }); @@ -180,10 +187,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -203,7 +211,7 @@ makeSuiteCleanRoom('Publishing Comments', function () { handle: 'testwallet', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -213,23 +221,26 @@ makeSuiteCleanRoom('Publishing Comments', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; + const { v, r, s } = await getCommentWithSigParts( FIRST_PROFILE_ID + 1, OTHER_MOCK_URI, FIRST_PROFILE_ID, '1', - freeCollectModule.address, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -241,9 +252,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -263,9 +275,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, }, }) ).to.eq(1); @@ -279,9 +292,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, }, }) ).to.eq(2); @@ -294,9 +308,10 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, }, }) ).to.eq(2); @@ -309,9 +324,9 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: mockReferenceModule.address, - referenceModuleData: data, + referenceModuleInitData: data, }) ).to.not.be.reverted; @@ -320,11 +335,12 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 2, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -339,7 +355,7 @@ makeSuiteCleanRoom('Publishing Comments', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -353,9 +369,9 @@ makeSuiteCleanRoom('Publishing Comments', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -363,7 +379,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { context('Negatives', function () { it('Testwallet should fail to comment with sig with signature deadline mismatch', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -371,10 +388,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { MOCK_URI, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, '0' ); @@ -385,10 +403,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: ZERO_ADDRESS, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: ZERO_ADDRESS, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -401,7 +420,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { it('Testwallet should fail to comment with sig with invalid deadline', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -409,10 +429,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { MOCK_URI, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, '0' ); @@ -423,10 +444,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: ZERO_ADDRESS, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: ZERO_ADDRESS, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -439,7 +461,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { it('Testwallet should fail to comment with sig with invalid nonce', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -447,10 +470,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { MOCK_URI, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce + 1, MAX_UINT256 ); @@ -461,10 +485,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: ZERO_ADDRESS, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: ZERO_ADDRESS, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -477,7 +502,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { it('Testwallet should fail to comment with sig with unwhitelisted collect module', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -485,10 +511,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { MOCK_URI, FIRST_PROFILE_ID, '1', - userAddress, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + userAddress, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -499,10 +526,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: userAddress, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: userAddress, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -519,7 +547,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -527,10 +556,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { MOCK_URI, FIRST_PROFILE_ID, '1', - freeCollectModule.address, - collectModuleData, - mockReferenceModule.address, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + mockReferenceModule.address, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -541,10 +571,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: mockReferenceModule.address, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -561,7 +592,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -569,10 +601,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { OTHER_MOCK_URI, FIRST_PROFILE_ID, '3', - freeCollectModule.address, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -583,10 +616,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: OTHER_MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '3', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -603,18 +637,19 @@ makeSuiteCleanRoom('Publishing Comments', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getCommentWithSigParts( FIRST_PROFILE_ID, OTHER_MOCK_URI, FIRST_PROFILE_ID, '2', - freeCollectModule.address, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -625,10 +660,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: OTHER_MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '2', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -645,7 +681,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -653,10 +690,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { OTHER_MOCK_URI, FIRST_PROFILE_ID, '1', - freeCollectModule.address, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -669,10 +707,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: OTHER_MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -691,7 +730,8 @@ makeSuiteCleanRoom('Publishing Comments', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getCommentWithSigParts( @@ -699,10 +739,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { OTHER_MOCK_URI, FIRST_PROFILE_ID, '1', - freeCollectModule.address, - collectModuleData, - ZERO_ADDRESS, referenceModuleData, + freeCollectModule.address, + collectModuleInitData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -713,10 +754,11 @@ makeSuiteCleanRoom('Publishing Comments', function () { contentURI: OTHER_MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', - collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, - referenceModule: ZERO_ADDRESS, referenceModuleData: referenceModuleData, + collectModule: freeCollectModule.address, + collectModuleInitData: collectModuleInitData, + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, diff --git a/test/hub/interactions/publishing-mirrors.spec.ts b/test/hub/interactions/publishing-mirrors.spec.ts index 6327720..294a778 100644 --- a/test/hub/interactions/publishing-mirrors.spec.ts +++ b/test/hub/interactions/publishing-mirrors.spec.ts @@ -34,7 +34,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -52,9 +52,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -66,8 +66,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER); }); @@ -78,8 +79,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: userAddress, referenceModuleData: [], + referenceModule: userAddress, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.REFERENCE_MODULE_NOT_WHITELISTED); }); @@ -90,8 +92,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, + referenceModuleData: [], referenceModule: mockReferenceModule.address, - referenceModuleData: [0x12, 0x23], + referenceModuleInitData: [0x12, 0x23], }) ).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE); }); @@ -102,8 +105,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 2, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.PUBLICATION_DOES_NOT_EXIST); }); @@ -117,7 +121,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () { handle: 'testwallet', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -127,7 +131,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -138,8 +142,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }, }) ).to.eq(2); @@ -151,20 +156,24 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID + 2, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 2, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }, }) ).to.eq(1); const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; + const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID + 1, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -174,8 +183,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID + 1, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -192,8 +202,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID + 1, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }, }) ).to.eq(3); @@ -205,8 +216,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -225,8 +237,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -235,8 +248,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 2, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -256,9 +270,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: mockReferenceModule.address, - referenceModuleData: data, + referenceModuleInitData: data, }) ).to.not.be.reverted; @@ -267,8 +281,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 2, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -283,7 +298,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -297,9 +312,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -307,14 +322,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () { context('Negatives', function () { it('Testwallet should fail to mirror with sig with signature deadline mismatch', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, '0' ); @@ -324,8 +341,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -338,14 +356,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () { it('Testwallet should fail to mirror with sig with invalid deadline', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, '0' ); @@ -355,8 +375,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -369,14 +390,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () { it('Testwallet should fail to mirror with sig with invalid deadline', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce + 1, MAX_UINT256 ); @@ -386,8 +409,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -400,14 +424,15 @@ makeSuiteCleanRoom('Publishing mirrors', function () { it('Testwallet should fail to mirror with sig with unwhitelisted reference module', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - userAddress, referenceModuleData, + userAddress, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -417,8 +442,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: userAddress, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -431,14 +457,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () { it('TestWallet should fail to mirror a publication with sig that does not exist yet', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '2', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -448,8 +476,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '2', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -462,14 +491,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () { it('TestWallet should sign attempt to mirror with sig, cancel via empty permitForAll, then fail to mirror with sig', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -481,8 +512,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -497,14 +529,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () { context('Scenarios', function () { it('Testwallet should mirror with sig, fetched mirror data should be accurate', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '1', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -514,8 +548,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '1', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -540,20 +575,23 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); + const referenceModuleInitData = []; const referenceModuleData = []; - + const { v, r, s } = await getMirrorWithSigParts( FIRST_PROFILE_ID, FIRST_PROFILE_ID, '2', - ZERO_ADDRESS, referenceModuleData, + ZERO_ADDRESS, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -563,8 +601,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: '2', + referenceModuleData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, diff --git a/test/hub/interactions/publishing-posts.spec.ts b/test/hub/interactions/publishing-posts.spec.ts index 91e3673..bdb748a 100644 --- a/test/hub/interactions/publishing-posts.spec.ts +++ b/test/hub/interactions/publishing-posts.spec.ts @@ -36,7 +36,7 @@ makeSuiteCleanRoom('Publishing Posts', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -49,9 +49,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER); }); @@ -62,9 +62,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.COLLECT_MODULE_NOT_WHITELISTED); }); @@ -79,9 +79,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: userAddress, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.REFERENCE_MODULE_NOT_WHITELISTED); }); @@ -96,9 +96,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: [0x12, 0x34], + collectModuleInitData: [0x12, 0x34], referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE); }); @@ -117,9 +117,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: mockReferenceModule.address, - referenceModuleData: [0x12, 0x23], + referenceModuleInitData: [0x12, 0x23], }) ).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE); }); @@ -137,7 +137,7 @@ makeSuiteCleanRoom('Publishing Posts', function () { handle: 'testwallet', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -147,7 +147,7 @@ makeSuiteCleanRoom('Publishing Posts', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -158,9 +158,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }, }) ).to.eq(1); @@ -172,23 +172,24 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID + 2, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }, }) ).to.eq(1); const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID + 1, MOCK_URI, freeCollectModule.address, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -198,9 +199,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID + 1, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -217,9 +218,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }, }) ).to.eq(2); @@ -235,9 +236,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -263,9 +264,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: mockReferenceModule.address, - referenceModuleData: mockModuleData, + referenceModuleInitData: mockModuleData, }) ).to.not.be.reverted; }); @@ -280,7 +281,7 @@ makeSuiteCleanRoom('Publishing Posts', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -293,16 +294,16 @@ makeSuiteCleanRoom('Publishing Posts', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, ZERO_ADDRESS, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, '0' ); @@ -312,9 +313,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: ZERO_ADDRESS, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -331,16 +332,16 @@ makeSuiteCleanRoom('Publishing Posts', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, ZERO_ADDRESS, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, '0' ); @@ -350,9 +351,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: ZERO_ADDRESS, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -369,16 +370,16 @@ makeSuiteCleanRoom('Publishing Posts', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, ZERO_ADDRESS, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce + 1, MAX_UINT256 ); @@ -388,9 +389,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: ZERO_ADDRESS, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -403,16 +404,16 @@ makeSuiteCleanRoom('Publishing Posts', function () { it('Testwallet should fail to post with sig with an unwhitelisted collect module', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = []; + const collectModuleInitData = []; + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, userAddress, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -422,9 +423,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: userAddress, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -441,16 +442,16 @@ makeSuiteCleanRoom('Publishing Posts', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, freeCollectModule.address, - collectModuleData, + collectModuleInitData, userAddress, - referenceModuleData, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -460,9 +461,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: userAddress, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -479,16 +480,16 @@ makeSuiteCleanRoom('Publishing Posts', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, freeCollectModule.address, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -500,9 +501,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, @@ -521,16 +522,16 @@ makeSuiteCleanRoom('Publishing Posts', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const collectModuleData = abiCoder.encode(['bool'], [true]); + const collectModuleInitData = abiCoder.encode(['bool'], [true]); + const referenceModuleInitData = []; const referenceModuleData = []; - const { v, r, s } = await getPostWithSigParts( FIRST_PROFILE_ID, MOCK_URI, freeCollectModule.address, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, - referenceModuleData, + referenceModuleInitData, nonce, MAX_UINT256 ); @@ -540,9 +541,9 @@ makeSuiteCleanRoom('Publishing Posts', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: referenceModuleData, + referenceModuleInitData: referenceModuleInitData, sig: { v, r, diff --git a/test/hub/profiles/default-profile.spec.ts b/test/hub/profiles/default-profile.spec.ts index 7ad195a..317c565 100644 --- a/test/hub/profiles/default-profile.spec.ts +++ b/test/hub/profiles/default-profile.spec.ts @@ -25,7 +25,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -63,7 +63,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () { handle: new Date().getTime().toString(), imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -92,7 +92,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -318,7 +318,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () { handle: new Date().getTime().toString(), imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/hub/profiles/dispatcher.spec.ts b/test/hub/profiles/dispatcher.spec.ts index d0d255b..f8f669b 100644 --- a/test/hub/profiles/dispatcher.spec.ts +++ b/test/hub/profiles/dispatcher.spec.ts @@ -29,7 +29,7 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -51,9 +51,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER); }); @@ -75,9 +75,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -88,9 +88,10 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -99,8 +100,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -115,7 +117,7 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -248,9 +250,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -261,9 +263,10 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -272,8 +275,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); diff --git a/test/hub/profiles/profile-creation.spec.ts b/test/hub/profiles/profile-creation.spec.ts index 3c5da08..e033a17 100644 --- a/test/hub/profiles/profile-creation.spec.ts +++ b/test/hub/profiles/profile-creation.spec.ts @@ -32,7 +32,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: val, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.INVALID_HANDLE_LENGTH); @@ -45,7 +45,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: '', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.INVALID_HANDLE_LENGTH); @@ -58,7 +58,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: 'Egg', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.HANDLE_CONTAINS_INVALID_CHARACTERS); @@ -71,7 +71,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: 'egg?', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.HANDLE_CONTAINS_INVALID_CHARACTERS); @@ -84,7 +84,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: userAddress, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.FOLLOW_MODULE_NOT_WHITELISTED); @@ -101,7 +101,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: mockFollowModule.address, - followModuleData: [0x12, 0x34], + followModuleInitData: [0x12, 0x34], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE); @@ -118,7 +118,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.PROFILE_CREATOR_NOT_WHITELISTED); @@ -141,7 +141,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }, }) @@ -170,7 +170,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: secondProfileHandle, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }, }) @@ -198,7 +198,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: 'token.id_1', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }, }) @@ -213,7 +213,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: 'token.id_2', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }, }) @@ -227,7 +227,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: 'token.id_3', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }, }) @@ -241,7 +241,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: 'morse--__-_--code', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -254,7 +254,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: '123456789012345', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -264,7 +264,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: '123456789012345', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.PROFILE_HANDLE_TAKEN); @@ -274,7 +274,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: 'abcdefghijklmno', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -291,7 +291,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: mockFollowModule.address, - followModuleData: mockModuleData, + followModuleInitData: mockModuleData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -304,7 +304,7 @@ makeSuiteCleanRoom('Profile Creation', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/hub/profiles/profile-uri.spec.ts b/test/hub/profiles/profile-uri.spec.ts index 5138e6f..994c8d9 100644 --- a/test/hub/profiles/profile-uri.spec.ts +++ b/test/hub/profiles/profile-uri.spec.ts @@ -38,7 +38,7 @@ makeSuiteCleanRoom('Profile URI Functionality', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -240,7 +240,7 @@ makeSuiteCleanRoom('Profile URI Functionality', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/hub/profiles/setting-follow-module.spec.ts b/test/hub/profiles/setting-follow-module.spec.ts index b7fff2c..fdf780f 100644 --- a/test/hub/profiles/setting-follow-module.spec.ts +++ b/test/hub/profiles/setting-follow-module.spec.ts @@ -27,7 +27,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -84,7 +84,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -97,12 +97,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const followModuleData = []; + const followModuleInitData = []; const { v, r, s } = await getSetFollowModuleWithSigParts( FIRST_PROFILE_ID, mockFollowModule.address, - followModuleData, + followModuleInitData, nonce, '0' ); @@ -111,7 +111,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: mockFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, sig: { v, r, @@ -128,12 +128,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const followModuleData = []; + const followModuleInitData = []; const { v, r, s } = await getSetFollowModuleWithSigParts( FIRST_PROFILE_ID, mockFollowModule.address, - followModuleData, + followModuleInitData, nonce, '0' ); @@ -142,7 +142,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: mockFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, sig: { v, r, @@ -159,12 +159,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () { ).to.not.be.reverted; const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const followModuleData = []; + const followModuleInitData = []; const { v, r, s } = await getSetFollowModuleWithSigParts( FIRST_PROFILE_ID, mockFollowModule.address, - followModuleData, + followModuleInitData, nonce + 1, MAX_UINT256 ); @@ -173,7 +173,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: mockFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, sig: { v, r, @@ -186,12 +186,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () { it('TestWallet should fail to set a follow module with sig with an unwhitelisted follow module', async function () { const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber(); - const followModuleData = []; + const followModuleInitData = []; const { v, r, s } = await getSetFollowModuleWithSigParts( FIRST_PROFILE_ID, mockFollowModule.address, - followModuleData, + followModuleInitData, nonce, MAX_UINT256 ); @@ -200,7 +200,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: mockFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, sig: { v, r, @@ -232,7 +232,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: mockFollowModule.address, - followModuleData: mockModuleData, + followModuleInitData: mockModuleData, sig: { v, r, @@ -264,7 +264,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () { lensHub.setFollowModuleWithSig({ profileId: FIRST_PROFILE_ID, followModule: mockFollowModule.address, - followModuleData: mockModuleData, + followModuleInitData: mockModuleData, sig: { v, r, diff --git a/test/modules/collect/fee-collect-module.spec.ts b/test/modules/collect/fee-collect-module.spec.ts index 92fb718..e00a5ca 100644 --- a/test/modules/collect/fee-collect-module.spec.ts +++ b/test/modules/collect/fee-collect-module.spec.ts @@ -40,7 +40,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -55,7 +55,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { context('Negatives', function () { context('Publication Creation', function () { it('user should fail to post with fee collect module using unwhitelisted currency', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, userTwoAddress, userAddress, REFERRAL_FEE_BPS, true] ); @@ -64,15 +64,15 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with fee collect module using zero recipient', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, ZERO_ADDRESS, REFERRAL_FEE_BPS, true] ); @@ -81,15 +81,15 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with fee collect module using referral fee greater than max BPS', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true] ); @@ -98,15 +98,15 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with fee collect module using zero amount', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [0, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -115,9 +115,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); @@ -125,7 +125,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { context('Collecting', function () { beforeEach(async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -134,9 +134,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -189,7 +189,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -198,8 +198,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -301,7 +302,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -310,8 +311,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -329,7 +331,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -338,8 +340,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -362,7 +365,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -371,8 +374,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -388,7 +392,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { context('Scenarios', function () { it('User should post with fee collect module as the collect module and data, correct events should be emitted', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -396,9 +400,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }); const receipt = await waitForTx(tx); @@ -409,7 +413,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { 1, MOCK_URI, feeCollectModule.address, - [collectModuleData], + [collectModuleInitData], ZERO_ADDRESS, [], await getTimestamp(), @@ -417,7 +421,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { }); it('User should post with the fee collect module as the collect module and data, fetched publication data should be accurate', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -426,9 +430,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; const postTimestamp = await getTimestamp(); @@ -442,7 +446,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { }); it('User should post with the fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, false] ); @@ -451,9 +455,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -481,7 +485,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { }); it('User should post with the fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -490,9 +494,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -521,7 +525,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { }); it('User should post with the fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -530,9 +534,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -563,18 +567,19 @@ makeSuiteCleanRoom('Fee Collect Module', function () { it('User should post with the fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); + await expect( lensHub.post({ profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -584,7 +589,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -593,8 +598,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -630,18 +636,19 @@ makeSuiteCleanRoom('Fee Collect Module', function () { it('User should post with the fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true] ); + await expect( lensHub.post({ profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -651,7 +658,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -660,8 +667,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/modules/collect/free-collect-module.spec.ts b/test/modules/collect/free-collect-module.spec.ts index 7c0b2bf..6bd22ed 100644 --- a/test/modules/collect/free-collect-module.spec.ts +++ b/test/modules/collect/free-collect-module.spec.ts @@ -28,7 +28,7 @@ makeSuiteCleanRoom('Free Collect Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -45,9 +45,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; await expect(lensHub.connect(userTwo).collect(FIRST_PROFILE_ID, 1, [])).to.be.revertedWith( @@ -61,9 +61,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; const secondProfileId = FIRST_PROFILE_ID + 1; @@ -73,7 +73,7 @@ makeSuiteCleanRoom('Free Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -82,8 +82,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -101,9 +102,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [false]), + collectModuleInitData: abiCoder.encode(['bool'], [false]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; await expect(lensHub.connect(userTwo).collect(FIRST_PROFILE_ID, 1, [])).to.not.be.reverted; @@ -115,9 +116,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; await expect(lensHub.connect(userTwo).follow([FIRST_PROFILE_ID], [[]])).to.not.be.reverted; @@ -130,9 +131,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; await expect( @@ -154,9 +155,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; const secondProfileId = FIRST_PROFILE_ID + 1; @@ -167,7 +168,7 @@ makeSuiteCleanRoom('Free Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -176,8 +177,9 @@ makeSuiteCleanRoom('Free Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/modules/collect/limited-fee-collect-module.spec.ts b/test/modules/collect/limited-fee-collect-module.spec.ts index af8b2d6..d119923 100644 --- a/test/modules/collect/limited-fee-collect-module.spec.ts +++ b/test/modules/collect/limited-fee-collect-module.spec.ts @@ -38,7 +38,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -53,7 +53,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { context('Negatives', function () { context('Publication Creation', function () { it('user should fail to post with limited fee collect module using zero collect limit', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [0, DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -62,15 +62,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited fee collect module using unwhitelisted currency', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -86,15 +86,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited fee collect module using zero recipient', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -110,15 +110,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited fee collect module using referral fee greater than max BPS', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true] ); @@ -127,15 +127,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited fee collect module using zero amount', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_LIMIT, 0, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -144,9 +144,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); @@ -154,7 +154,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { context('Collecting', function () { beforeEach(async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -170,9 +170,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -225,7 +225,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -234,8 +234,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -337,7 +338,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -346,8 +347,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -368,7 +370,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -377,8 +379,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -400,7 +403,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -409,8 +412,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -425,7 +429,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { context('Scenarios', function () { it('User should post with limited fee collect module as the collect module and data, correct events should be emitted', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -440,9 +444,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }); const receipt = await waitForTx(tx); @@ -453,7 +457,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { 1, MOCK_URI, limitedFeeCollectModule.address, - collectModuleData, + collectModuleInitData, ZERO_ADDRESS, [], await getTimestamp(), @@ -461,7 +465,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { }); it('User should post with limited fee collect module as the collect module and data, fetched publication data should be accurate', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -477,9 +481,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -493,7 +497,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { }); it('User should post with limited fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following and pays fee, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -509,9 +513,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -539,7 +543,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { }); it('User should post with limited fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -555,9 +559,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -586,7 +590,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { }); it('User should post with limited fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -602,9 +606,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -635,7 +639,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { it('User should post with limited fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -651,9 +655,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -663,7 +667,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -672,8 +676,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -709,7 +714,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { it('User should post with limited fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true] ); @@ -718,9 +723,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -730,7 +735,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -739,8 +744,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -770,7 +776,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { it('User should post with limited fee collect module as the collect module and data, user two mirrors, follows, then collects once from the original, twice from the mirror, and fails to collect a third time from either the mirror or the original', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -786,9 +792,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -798,7 +804,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -807,8 +813,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/modules/collect/limited-timed-fee-collect-module.spec.ts b/test/modules/collect/limited-timed-fee-collect-module.spec.ts index 12b1bca..93c89cc 100644 --- a/test/modules/collect/limited-timed-fee-collect-module.spec.ts +++ b/test/modules/collect/limited-timed-fee-collect-module.spec.ts @@ -38,7 +38,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -53,7 +53,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { context('Negatives', function () { context('Publication Creation', function () { it('user should fail to post with limited timed fee collect module using zero collect limit', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [0, DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -62,15 +62,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited timed fee collect module using unwhitelisted currency', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -86,15 +86,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited timed fee collect module using zero recipient', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -110,15 +110,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited timed fee collect module using referral fee greater than max BPS', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true] ); @@ -127,15 +127,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with limited timed fee collect module using zero amount', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_LIMIT, 0, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -144,9 +144,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); @@ -154,7 +154,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { context('Collecting', function () { beforeEach(async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -170,9 +170,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -225,7 +225,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -234,8 +234,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -352,7 +353,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -361,8 +362,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -383,7 +385,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -392,8 +394,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -419,7 +422,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -428,8 +431,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -452,7 +456,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -461,8 +465,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -478,7 +483,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { context('Scenarios', function () { it('User should post with limited timed fee collect module as the collect module and data, correct events should be emitted', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -493,9 +498,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }); const receipt = await waitForTx(tx); @@ -529,7 +534,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { }); it('User should post with limited timed fee collect module as the collect module and data, fetched publication data should be accurate', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -545,9 +550,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; const postTimestamp = await getTimestamp(); @@ -566,7 +571,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { }); it('User should post with limited timed fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -582,9 +587,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -612,7 +617,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { }); it('User should post with limited timed fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -628,9 +633,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -659,7 +664,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { }); it('User should post with limited timed fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -675,9 +680,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -708,7 +713,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { it('User should post with limited timed fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -724,9 +729,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -736,7 +741,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -745,8 +750,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -782,7 +788,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { it('User should post with limited timed fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true] ); @@ -791,9 +797,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -803,7 +809,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -812,8 +818,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -843,7 +850,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { it('User should post with limited timed fee collect module as the collect module and data, user two mirrors, follows, then collects once from the original, twice from the mirror, and fails to collect a third time from either the mirror or the original', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'], [ DEFAULT_COLLECT_LIMIT, @@ -859,9 +866,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: limitedTimedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -871,7 +878,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -880,8 +887,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/modules/collect/revert-collect-module.spec.ts b/test/modules/collect/revert-collect-module.spec.ts index 69e7f27..803b685 100644 --- a/test/modules/collect/revert-collect-module.spec.ts +++ b/test/modules/collect/revert-collect-module.spec.ts @@ -25,7 +25,7 @@ makeSuiteCleanRoom('Revert Collect Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -37,9 +37,9 @@ makeSuiteCleanRoom('Revert Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: revertCollectModule.address, - collectModuleData: [], + collectModuleInitData: [], referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -59,7 +59,7 @@ makeSuiteCleanRoom('Revert Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -68,8 +68,9 @@ makeSuiteCleanRoom('Revert Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -93,7 +94,7 @@ makeSuiteCleanRoom('Revert Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -102,8 +103,9 @@ makeSuiteCleanRoom('Revert Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/modules/collect/timed-fee-collect-module.spec.ts b/test/modules/collect/timed-fee-collect-module.spec.ts index 327b31d..20ded90 100644 --- a/test/modules/collect/timed-fee-collect-module.spec.ts +++ b/test/modules/collect/timed-fee-collect-module.spec.ts @@ -37,7 +37,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -52,7 +52,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { context('Negatives', function () { context('Publication Creation', function () { it('user should fail to post with timed fee collect module using unwhitelisted currency', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, userTwoAddress, userAddress, REFERRAL_FEE_BPS, true] ); @@ -61,15 +61,15 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with timed fee collect module using zero recipient', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, ZERO_ADDRESS, REFERRAL_FEE_BPS, true] ); @@ -78,15 +78,15 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with timed fee collect module using referral fee greater than max BPS', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true] ); @@ -95,15 +95,15 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to post with timed fee collect module using zero amount', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [0, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -112,9 +112,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); @@ -122,7 +122,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { context('Collecting', function () { beforeEach(async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -131,9 +131,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -186,7 +186,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -195,8 +195,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -313,7 +314,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -322,8 +323,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -344,7 +346,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -353,8 +355,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -380,7 +383,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -389,8 +392,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -413,7 +417,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -422,8 +426,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -439,7 +444,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { context('Scenarios', function () { it('User should post with timed fee collect module as the collect module and data, correct events should be emitted', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -448,9 +453,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }); const receipt = await waitForTx(tx); @@ -476,7 +481,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { }); it('User should post with timed fee collect module as the collect module and data, fetched publication data should be accurate', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -485,9 +490,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; const postTimestamp = await getTimestamp(); @@ -502,7 +507,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { }); it('User should post with timed fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, false] ); @@ -511,9 +516,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -541,7 +546,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { }); it('User should post with timed fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -550,9 +555,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -581,7 +586,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { }); it('User should post with timed fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () { - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -590,9 +595,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -623,7 +628,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { it('User should post with timed fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true] ); @@ -632,9 +637,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -644,7 +649,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -653,8 +658,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -690,7 +696,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { it('User should post with timed fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () { const secondProfileId = FIRST_PROFILE_ID + 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true] ); @@ -699,9 +705,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: timedFeeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -711,7 +717,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -720,8 +726,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; diff --git a/test/modules/follow/approval-follow-module.spec.ts b/test/modules/follow/approval-follow-module.spec.ts index 0b536c6..c6f4178 100644 --- a/test/modules/follow/approval-follow-module.spec.ts +++ b/test/modules/follow/approval-follow-module.spec.ts @@ -28,7 +28,7 @@ makeSuiteCleanRoom('Approval Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -117,7 +117,7 @@ makeSuiteCleanRoom('Approval Follow Module', function () { handle: 'secondhandle', imageURI: MOCK_PROFILE_URI, followModule: approvalFollowModule.address, - followModuleData: data, + followModuleInitData: data, followNFTURI: MOCK_FOLLOW_NFT_URI, }); diff --git a/test/modules/follow/fee-follow-module.spec.ts b/test/modules/follow/fee-follow-module.spec.ts index aa77fc6..e68b169 100644 --- a/test/modules/follow/fee-follow-module.spec.ts +++ b/test/modules/follow/fee-follow-module.spec.ts @@ -41,7 +41,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { context('Negatives', function () { context('Initialization', function () { it('user should fail to create a profile with fee follow module using unwhitelisted currency', async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, userTwoAddress, userAddress] ); @@ -52,14 +52,14 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to create a profile with fee follow module using zero recipient', async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, currency.address, ZERO_ADDRESS] ); @@ -70,14 +70,14 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); }); it('user should fail to create a profile with fee follow module using zero amount', async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [0, currency.address, userAddress] ); @@ -88,7 +88,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID); @@ -97,7 +97,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { context('Following', function () { beforeEach(async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, currency.address, userAddress] ); @@ -107,7 +107,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -182,7 +182,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { context('Scenarios', function () { it('User should create a profile with the fee follow module as the follow module and data, correct events should be emitted', async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, currency.address, userAddress] ); @@ -191,7 +191,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }); @@ -206,7 +206,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { MOCK_PROFILE_HANDLE, MOCK_PROFILE_URI, feeFollowModule.address, - followModuleData, + followModuleInitData, MOCK_FOLLOW_NFT_URI, await getTimestamp(), ]); @@ -219,19 +219,19 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, currency.address, userAddress] ); const tx = lensHub.setFollowModule( FIRST_PROFILE_ID, feeFollowModule.address, - followModuleData + followModuleInitData ); const receipt = await waitForTx(tx); @@ -240,13 +240,13 @@ makeSuiteCleanRoom('Fee Follow Module', function () { matchEvent(receipt, 'FollowModuleSet', [ FIRST_PROFILE_ID, feeFollowModule.address, - followModuleData, + followModuleInitData, await getTimestamp(), ]); }); it('User should create a profile with the fee follow module as the follow module and data, fetched profile data should be accurate', async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, currency.address, userAddress] ); @@ -256,7 +256,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -268,7 +268,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { }); it('User should create a profile with the fee follow module as the follow module and data, user two follows, fee distribution is valid', async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, currency.address, userAddress] ); @@ -278,7 +278,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -307,7 +307,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { }); it('User should create a profile with the fee follow module as the follow module and data, user two follows twice, fee distribution is valid', async function () { - const followModuleData = abiCoder.encode( + const followModuleInitData = abiCoder.encode( ['uint256', 'address', 'address'], [DEFAULT_FOLLOW_PRICE, currency.address, userAddress] ); @@ -317,7 +317,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: feeFollowModule.address, - followModuleData: followModuleData, + followModuleInitData: followModuleInitData, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/modules/follow/profile-follow-module.spec.ts b/test/modules/follow/profile-follow-module.spec.ts index 3b2f3b4..fa52f54 100644 --- a/test/modules/follow/profile-follow-module.spec.ts +++ b/test/modules/follow/profile-follow-module.spec.ts @@ -56,7 +56,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: profileFollowModule.address, - followModuleData: DEFAULT_INIT_DATA, + followModuleInitData: DEFAULT_INIT_DATA, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -89,7 +89,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -108,7 +108,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'user', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -125,7 +125,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -144,7 +144,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -178,7 +178,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -212,7 +212,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: profileFollowModule.address, - followModuleData: DEFAULT_INIT_DATA, + followModuleInitData: DEFAULT_INIT_DATA, followNFTURI: MOCK_FOLLOW_NFT_URI, }); @@ -240,7 +240,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -271,7 +271,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: profileFollowModule.address, - followModuleData: DEFAULT_INIT_DATA, + followModuleInitData: DEFAULT_INIT_DATA, followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -284,7 +284,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -300,7 +300,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -324,7 +324,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -334,7 +334,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () { handle: 'usertwo2', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/modules/reference/follower-only-reference-module.spec.ts b/test/modules/reference/follower-only-reference-module.spec.ts index 6c383ec..27aec47 100644 --- a/test/modules/reference/follower-only-reference-module.spec.ts +++ b/test/modules/reference/follower-only-reference-module.spec.ts @@ -33,7 +33,7 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -43,7 +43,7 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { handle: 'user2', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -60,9 +60,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: followerOnlyReferenceModule.address, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -78,9 +78,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.FOLLOW_INVALID); }); @@ -103,9 +104,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.FOLLOW_INVALID); }); @@ -118,8 +120,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: SECOND_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.FOLLOW_INVALID); }); @@ -140,8 +143,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: SECOND_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.be.revertedWith(ERRORS.FOLLOW_INVALID); }); @@ -155,9 +159,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: followerOnlyReferenceModule.address, - referenceModuleData: [], + referenceModuleInitData: [], }); const receipt = await waitForTx(tx); @@ -190,9 +194,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -210,10 +215,11 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -225,10 +231,11 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -248,10 +255,11 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -276,9 +284,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -297,8 +306,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: SECOND_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -321,8 +331,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: SECOND_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -339,8 +350,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -351,8 +363,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); @@ -371,8 +384,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; }); diff --git a/test/nft/collect-nft.spec.ts b/test/nft/collect-nft.spec.ts index 9e2fe6d..da96a93 100644 --- a/test/nft/collect-nft.spec.ts +++ b/test/nft/collect-nft.spec.ts @@ -31,7 +31,7 @@ makeSuiteCleanRoom('Collect NFT', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -40,9 +40,9 @@ makeSuiteCleanRoom('Collect NFT', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; await expect(lensHub.follow([FIRST_PROFILE_ID], [[]])).to.not.be.reverted; diff --git a/test/nft/follow-nft.spec.ts b/test/nft/follow-nft.spec.ts index 8d5728b..36837ff 100644 --- a/test/nft/follow-nft.spec.ts +++ b/test/nft/follow-nft.spec.ts @@ -34,7 +34,7 @@ makeSuiteCleanRoom('Follow NFT', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/nft/lens-nft-base.spec.ts b/test/nft/lens-nft-base.spec.ts index 4facfcd..c21ca66 100644 --- a/test/nft/lens-nft-base.spec.ts +++ b/test/nft/lens-nft-base.spec.ts @@ -56,7 +56,7 @@ makeSuiteCleanRoom('Lens NFT Base Functionality', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/other/events.spec.ts b/test/other/events.spec.ts index b20c17d..3c98d85 100644 --- a/test/other/events.spec.ts +++ b/test/other/events.spec.ts @@ -230,7 +230,7 @@ makeSuiteCleanRoom('Events', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ); @@ -243,7 +243,7 @@ makeSuiteCleanRoom('Events', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ); @@ -275,7 +275,7 @@ makeSuiteCleanRoom('Events', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ); @@ -336,9 +336,9 @@ makeSuiteCleanRoom('Events', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ); @@ -366,9 +366,9 @@ makeSuiteCleanRoom('Events', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ); @@ -378,10 +378,11 @@ makeSuiteCleanRoom('Events', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ); @@ -393,6 +394,7 @@ makeSuiteCleanRoom('Events', function () { MOCK_URI, FIRST_PROFILE_ID, 1, + [], freeCollectModule.address, abiCoder.encode(['bool'], [true]), ZERO_ADDRESS, @@ -412,9 +414,9 @@ makeSuiteCleanRoom('Events', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ); @@ -423,8 +425,9 @@ makeSuiteCleanRoom('Events', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ); @@ -435,6 +438,7 @@ makeSuiteCleanRoom('Events', function () { 2, FIRST_PROFILE_ID, 1, + [], ZERO_ADDRESS, [], await getTimestamp(), @@ -485,7 +489,7 @@ makeSuiteCleanRoom('Events', function () { ).to.not.be.reverted; const collectPrice = 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [collectPrice, currency.address, userAddress, 0, true] ); @@ -494,9 +498,9 @@ makeSuiteCleanRoom('Events', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ); @@ -553,7 +557,7 @@ makeSuiteCleanRoom('Events', function () { ).to.not.be.reverted; const collectPrice = 1; - const collectModuleData = abiCoder.encode( + const collectModuleInitData = abiCoder.encode( ['uint256', 'address', 'address', 'uint16', 'bool'], [collectPrice, currency.address, userAddress, 0, true] ); @@ -562,9 +566,9 @@ makeSuiteCleanRoom('Events', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: feeCollectModule.address, - collectModuleData: collectModuleData, + collectModuleInitData: collectModuleInitData, referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ); @@ -576,7 +580,7 @@ makeSuiteCleanRoom('Events', function () { handle: 'usertwo', imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ); @@ -586,8 +590,9 @@ makeSuiteCleanRoom('Events', function () { profileId: secondProfileId, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ); diff --git a/test/other/misc.spec.ts b/test/other/misc.spec.ts index 88730ed..9382f20 100644 --- a/test/other/misc.spec.ts +++ b/test/other/misc.spec.ts @@ -72,7 +72,7 @@ makeSuiteCleanRoom('Misc', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -158,9 +158,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; } @@ -200,9 +200,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; expect(await lensHub.getReferenceModule(FIRST_PROFILE_ID, 1)).to.eq(ZERO_ADDRESS); @@ -212,9 +212,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: followerOnlyReferenceModule.address, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; expect(await lensHub.getReferenceModule(FIRST_PROFILE_ID, 2)).to.eq( @@ -232,9 +232,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -253,9 +253,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -265,10 +265,11 @@ makeSuiteCleanRoom('Misc', function () { contentURI: MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -287,9 +288,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -298,8 +299,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -318,9 +320,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -337,9 +339,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -349,10 +351,11 @@ makeSuiteCleanRoom('Misc', function () { contentURI: OTHER_MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -369,9 +372,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -380,8 +383,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; expect(await lensHub.getContentURI(FIRST_PROFILE_ID, 2)).to.eq(MOCK_URI); @@ -397,9 +401,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -416,9 +420,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -427,8 +431,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -438,10 +443,11 @@ makeSuiteCleanRoom('Misc', function () { contentURI: OTHER_MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 2, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -458,9 +464,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -469,8 +475,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -487,9 +494,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: MOCK_URI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -499,10 +506,11 @@ makeSuiteCleanRoom('Misc', function () { contentURI: OTHER_MOCK_URI, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + collectModule: freeCollectModule.address, + collectModuleInitData: abiCoder.encode(['bool'], [true]), + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -511,8 +519,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, profileIdPointed: FIRST_PROFILE_ID, pubIdPointed: 1, - referenceModule: ZERO_ADDRESS, referenceModuleData: [], + referenceModule: ZERO_ADDRESS, + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -543,7 +552,7 @@ makeSuiteCleanRoom('Misc', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: approvalFollowModule.address, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -677,7 +686,7 @@ makeSuiteCleanRoom('Misc', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -695,9 +704,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: firstURI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -706,9 +715,9 @@ makeSuiteCleanRoom('Misc', function () { profileId: FIRST_PROFILE_ID, contentURI: secondURI, collectModule: freeCollectModule.address, - collectModuleData: abiCoder.encode(['bool'], [true]), + collectModuleInitData: abiCoder.encode(['bool'], [true]), referenceModule: ZERO_ADDRESS, - referenceModuleData: [], + referenceModuleInitData: [], }) ).to.not.be.reverted; @@ -764,7 +773,7 @@ makeSuiteCleanRoom('Misc', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -834,7 +843,7 @@ makeSuiteCleanRoom('Misc', function () { handle: 'otherhandle', imageURI: OTHER_MOCK_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1055,7 +1064,7 @@ makeSuiteCleanRoom('Misc', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; @@ -1148,7 +1157,7 @@ makeSuiteCleanRoom('Misc', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted; diff --git a/test/other/mock-profile-creation-proxy.spec.ts b/test/other/mock-profile-creation-proxy.spec.ts index 6ab5fca..bd56fea 100644 --- a/test/other/mock-profile-creation-proxy.spec.ts +++ b/test/other/mock-profile-creation-proxy.spec.ts @@ -58,7 +58,7 @@ makeSuiteCleanRoom('Mock Profile Creation Proxy', function () { handle: MOCK_PROFILE_HANDLE, imageURI: MOCK_PROFILE_URI, followModule: ZERO_ADDRESS, - followModuleData: [], + followModuleInitData: [], followNFTURI: MOCK_FOLLOW_NFT_URI, }) ).to.not.be.reverted;