diff --git a/test/CollectNFTTest.t.sol b/test/CollectNFTTest.t.sol index cda0069..29fe8fb 100644 --- a/test/CollectNFTTest.t.sol +++ b/test/CollectNFTTest.t.sol @@ -2,14 +2,14 @@ pragma solidity ^0.8.13; import 'test/base/BaseTest.t.sol'; -import 'test/ERC721Test.t.sol'; +import 'test/LensBaseERC721Test.t.sol'; import {CollectPublicationAction} from 'contracts/modules/act/collect/CollectPublicationAction.sol'; import {CollectNFT} from 'contracts/CollectNFT.sol'; import {MockCollectModule} from 'test/mocks/MockCollectModule.sol'; import {Clones} from '@openzeppelin/contracts/proxy/Clones.sol'; import {Errors as ModulesErrors} from 'contracts/modules/constants/Errors.sol'; -contract CollectNFTTest is BaseTest, ERC721Test { +contract CollectNFTTest is BaseTest, LensBaseERC721Test { using stdJson for string; function testCollectNFTTest() public { @@ -111,6 +111,7 @@ contract CollectNFTTest is BaseTest, ERC721Test { } function _mintERC721(address to) internal virtual override returns (uint256) { + vm.assume(!_isLensHubProxyAdmin(to)); collectActionParams.actorProfileId = _createProfile(to); vm.prank(to); bytes memory actResult = hub.act(collectActionParams); @@ -126,6 +127,11 @@ contract CollectNFTTest is BaseTest, ERC721Test { return address(collectNFT); } + function testDoesNotSupportOtherThanTheExpectedInterfaces(uint32 interfaceId) public override { + vm.assume(bytes4(interfaceId) != bytes4(keccak256('royaltyInfo(uint256,uint256)'))); + super.testDoesNotSupportOtherThanTheExpectedInterfaces(interfaceId); + } + ////////////////////////////////////////////////////////// // ERC-2981 Royalties - Scenarios ////////////////////////////////////////////////////////// diff --git a/test/FollowNFTTest.t.sol b/test/FollowNFTTest.t.sol index bd1a642..592c2d0 100644 --- a/test/FollowNFTTest.t.sol +++ b/test/FollowNFTTest.t.sol @@ -2,13 +2,13 @@ pragma solidity ^0.8.13; import 'test/base/BaseTest.t.sol'; -import 'test/ERC721Test.t.sol'; +import 'test/LensBaseERC721Test.t.sol'; import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import {IFollowNFT} from 'contracts/interfaces/IFollowNFT.sol'; import {FollowNFT} from 'contracts/FollowNFT.sol'; import {Types} from 'contracts/libraries/constants/Types.sol'; -contract FollowNFTTest is BaseTest, ERC721Test { +contract FollowNFTTest is BaseTest, LensBaseERC721Test { uint256 constant MINT_NEW_TOKEN = 0; address targetProfileOwner; uint256 targetProfileId; @@ -45,6 +45,7 @@ contract FollowNFTTest is BaseTest, ERC721Test { } function _mintERC721(address to) internal virtual override returns (uint256) { + vm.assume(!_isLensHubProxyAdmin(to)); followerProfileId = _createProfile(to); vm.prank(to); uint256 tokenId = hub.follow( @@ -67,6 +68,11 @@ contract FollowNFTTest is BaseTest, ERC721Test { return targetFollowNFT; } + function testDoesNotSupportOtherThanTheExpectedInterfaces(uint32 interfaceId) public override { + vm.assume(bytes4(interfaceId) != bytes4(keccak256('royaltyInfo(uint256,uint256)'))); + super.testDoesNotSupportOtherThanTheExpectedInterfaces(interfaceId); + } + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// diff --git a/test/LegacyCollectNFTTest.t.sol b/test/LegacyCollectNFTTest.t.sol index 4c30ec3..ddfd28f 100644 --- a/test/LegacyCollectNFTTest.t.sol +++ b/test/LegacyCollectNFTTest.t.sol @@ -2,12 +2,12 @@ pragma solidity ^0.8.13; import 'test/base/BaseTest.t.sol'; -import 'test/ERC721Test.t.sol'; +import 'test/LensBaseERC721Test.t.sol'; import {LegacyCollectNFT} from 'contracts/misc/LegacyCollectNFT.sol'; import {MockDeprecatedCollectModule} from 'test/mocks/MockDeprecatedCollectModule.sol'; import {Clones} from '@openzeppelin/contracts/proxy/Clones.sol'; -contract LegacyCollectNFTTest is BaseTest, ERC721Test { +contract LegacyCollectNFTTest is BaseTest, LensBaseERC721Test { using stdJson for string; function testLegacyCollectNFTTest() public { @@ -50,6 +50,7 @@ contract LegacyCollectNFTTest is BaseTest, ERC721Test { } function _mintERC721(address to) internal virtual override returns (uint256) { + vm.assume(!_isLensHubProxyAdmin(to)); defaultCollectParams.collectorProfileId = _createProfile(to); vm.prank(to); uint256 tokenId = hub.collect(defaultCollectParams); @@ -64,6 +65,11 @@ contract LegacyCollectNFTTest is BaseTest, ERC721Test { return address(collectNFT); } + function testDoesNotSupportOtherThanTheExpectedInterfaces(uint32 interfaceId) public override { + vm.assume(bytes4(interfaceId) != bytes4(keccak256('royaltyInfo(uint256,uint256)'))); + super.testDoesNotSupportOtherThanTheExpectedInterfaces(interfaceId); + } + ////////////////////////////////////////////////////////// // ERC-2981 Royalties - Scenarios ////////////////////////////////////////////////////////// diff --git a/test/ProfileNFTTest.t.sol b/test/ProfileNFTTest.t.sol index 93029d8..1e25899 100644 --- a/test/ProfileNFTTest.t.sol +++ b/test/ProfileNFTTest.t.sol @@ -2,11 +2,11 @@ pragma solidity ^0.8.13; import 'test/base/BaseTest.t.sol'; -import 'test/ERC721Test.t.sol'; +import 'test/LensBaseERC721Test.t.sol'; import {Base64} from 'solady/utils/Base64.sol'; import {LibString} from 'solady/utils/LibString.sol'; -contract ProfileNFTTest is BaseTest, ERC721Test { +contract ProfileNFTTest is BaseTest, LensBaseERC721Test { using stdJson for string; using Strings for uint256; @@ -69,6 +69,7 @@ contract ProfileNFTTest is BaseTest, ERC721Test { } function _mintERC721(address to) internal virtual override returns (uint256) { + vm.assume(!_isLensHubProxyAdmin(to)); return _createProfile(to); } @@ -80,6 +81,19 @@ contract ProfileNFTTest is BaseTest, ERC721Test { return address(hub); } + function _getNotOwnerError() internal virtual override returns (bytes4) { + return Errors.NotProfileOwner.selector; + } + + function _assumeNotProxyAdmin(address account) internal view virtual override { + vm.assume(!_isLensHubProxyAdmin(account)); + } + + function testDoesNotSupportOtherThanTheExpectedInterfaces(uint32 interfaceId) public override { + vm.assume(bytes4(interfaceId) != bytes4(keccak256('royaltyInfo(uint256,uint256)'))); + super.testDoesNotSupportOtherThanTheExpectedInterfaces(interfaceId); + } + ////////////////////////////////////////////////////////// // ERC-2981 Royalties - Scenarios //////////////////////////////////////////////////////////