Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily Comment Out Unused Modules for Alpha Release Preparation #191

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,267 changes: 1,141 additions & 1,126 deletions lcov.info

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "forge-std/Test.sol";

import { Errors } from "contracts/lib/Errors.sol";
import "contracts/ip-accounts/IPAccountRegistry.sol";
import "test/foundry/mocks/MockIPAccount.sol";
import "mvp/test/foundry/mocks/MockIPAccount.sol";

contract RegistryTest is Test {
IPAccountRegistry public registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ pragma solidity ^0.8.13;
import "forge-std/Test.sol";

import "contracts/ip-accounts/IPAccountRegistry.sol";
import "test/foundry/mocks/MockIPAccount.sol";
import "mvp/test/foundry/mocks/MockIPAccount.sol";
import "contracts/modules/royalties/RoyaltyDistributor.sol";
import "contracts/modules/royalties/RoyaltyNFT.sol";
import "contracts/interfaces/modules/royalties/ISplitMain.sol";
import "./mocks/MockSplitMain.sol";
import "./mocks/MockERC20.sol";
import "test/foundry/mocks/MockSplitMain.sol";
import "./mocks/MockSplitMain.sol";
import "contracts/modules/royalties/policies/MutableRoyaltyProportionPolicy.sol";
import "contracts/modules/royalties/RoyaltyNFTFactory.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSDL-1.1
pragma solidity ^0.8.13;

import "test/foundry/RoyaltyDistributor.t.sol";
import "mvp/test/foundry/RoyaltyDistributor.t.sol";

contract RoyaltyDistributorForkTest is RoyaltyDistributorTest {
function _getSplitMain() internal virtual override returns(ISplitMain) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { ICollectNFT } from "contracts/interfaces/modules/collect/ICollectNFT.so
import { BaseTestUtils } from "test/foundry/utils/BaseTestUtils.sol";
import { BaseTest } from "test/foundry/utils/BaseTest.sol";
import { CollectNFTBaseTest } from "./nft/CollectNFTBase.t.sol";
import { MockCollectModule } from "test/foundry/mocks/MockCollectModule.sol";
import { MockCollectNFT } from "test/foundry/mocks/MockCollectNFT.sol";
import { MockCollectModule } from "mvp/test/foundry/mocks/MockCollectModule.sol";
import { MockCollectNFT } from "mvp/test/foundry/mocks/MockCollectNFT.sol";

import { IPAsset } from "contracts/lib/IPAsset.sol";
import { Collect } from "contracts/lib/modules/Collect.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { ICollectNFT } from "contracts/interfaces/modules/collect/ICollectNFT.so

import { BaseCollectModuleTest } from "./BaseCollectModuleTest.sol";
import { BaseTest } from "test/foundry/utils/BaseTest.sol";
import { MockCollectPaymentModule } from "test/foundry/mocks/MockCollectPaymentModule.sol";
import { MockCollectPaymentModule } from "mvp/test/foundry/mocks/MockCollectPaymentModule.sol";
import { MockNativeTokenNonReceiver } from "test/foundry/mocks/MockNativeTokenNonReceiver.sol";
import { MockThrowingERC20 } from "test/foundry/mocks/MockThrowingERC20.sol";
import { MockCollectNFT } from "test/foundry/mocks/MockCollectNFT.sol";
import { MockCollectNFT } from "mvp/test/foundry/mocks/MockCollectNFT.sol";
import { MockERC20 } from "test/foundry/mocks/MockERC20.sol";
import { MockWETH } from "test/foundry/mocks/MockWETH.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { IERC721Events } from "../../../interfaces/IERC721Events.sol";
import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

import { MockCollectModuleERC721 } from "test/foundry/mocks/MockCollectModuleERC721.sol";
import { MockCollectModuleERC721 } from "mvp/test/foundry/mocks/MockCollectModuleERC721.sol";
import { BaseTestUtils } from "test/foundry/utils/BaseTestUtils.sol";
import { MockERC721Receiver } from "test/foundry/mocks/MockERC721Receiver.sol";
import { Errors } from "contracts/lib/Errors.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ICollectNFT } from "contracts/interfaces/modules/collect/ICollectNFT.so

import { BaseTest } from "test/foundry/utils/BaseTest.sol";
import { BaseERC721Test } from "./BaseERC721Test.sol";
import { MockCollectNFT } from "test/foundry/mocks/MockCollectNFT.sol";
import { MockCollectNFT } from "mvp/test/foundry/mocks/MockCollectNFT.sol";
import { ERC721Test } from "./ERC721.t.sol";

import { IPAsset } from "contracts/lib/IPAsset.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.18;

import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { BaseERC721Test } from "./BaseERC721Test.sol";
import { MockCollectModuleERC721 } from "test/foundry/mocks/MockCollectModuleERC721.sol";
import { MockCollectModuleERC721 } from "mvp/test/foundry/mocks/MockCollectModuleERC721.sol";
import { Errors } from "contracts/lib/Errors.sol";

/// @title ERC-721 Testing Contract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import { CollectModuleBase } from "contracts/modules/collect/CollectModuleBase.sol";
import { CollectModuleBase } from "mvp/contracts/modules/collect/CollectModuleBase.sol";

/// @title Mock Collect Module
/// @notice This mock contract is used for testing the base collect module.
contract MockCollectModule is CollectModuleBase {

// Whether the collect module is enabled for a specific IP asset.
mapping(uint256 => mapping(uint256 => bool)) collectEnabled;

/// @notice Initializes a mock collect module.
/// @param registry_ The protocol-wide franchise registry address.
/// @param defaultCollectNftImpl_ The default collect NFT impl address.
constructor(address registry_, address defaultCollectNftImpl_) CollectModuleBase(registry_, defaultCollectNftImpl_) {}
constructor(
address registry_,
address defaultCollectNftImpl_
) CollectModuleBase(registry_, defaultCollectNftImpl_) {}

/// @notice Initializes the collect module via UUPS proxying.
/// @param accessControl_ The address utilized for contract access control.
function initialize(address accessControl_) public initializer {}

/// @dev Checks whether the collect action is authorized for an IP asset.
function _isCollectAuthorized(uint256) internal pure virtual override returns (bool) {
function _isCollectAuthorized(
uint256
) internal pure virtual override returns (bool) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import { CollectNFTBase } from "contracts/modules/collect/nft/CollectNFTBase.sol";
import { CollectNFTBase } from "mvp/contracts/modules/collect/nft/CollectNFTBase.sol";

/// @title Mock Collect NFT
/// @notice This contract is used for testing base collect NFT functionality.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.13;

import "contracts/interfaces/modules/royalties/ISplitMain.sol";
import "test/foundry/mocks/MockSplit.sol";
import "./MockSplit.sol";
import "test/foundry/mocks/MockERC20.sol";

contract MockSplitMain is ISplitMain {
Expand Down
7 changes: 0 additions & 7 deletions script/foundry/deployment/Main.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import "script/foundry/utils/JsonDeploymentHandler.s.sol";
import "contracts/ip-org/IPOrg.sol";
import "contracts/ip-org/IPOrgController.sol";
import "contracts/access-control/AccessControlSingleton.sol";
import "test/foundry/mocks/MockCollectNFT.sol";
import "test/foundry/mocks/MockCollectModule.sol";
import "contracts/modules/royalties/RoyaltyDistributor.sol";
import "contracts/modules/royalties/policies/MutableRoyaltyProportionPolicy.sol";
import "contracts/modules/royalties/RoyaltyNFT.sol";
import "contracts/ip-accounts/IPAccountImpl.sol";
import "contracts/ip-accounts/IPAccountRegistry.sol";
import { AccessControl } from "contracts/lib/AccessControl.sol";
import "contracts/modules/ModuleRegistry.sol";
import "contracts/IPAssetRegistry.sol";
Expand Down
2 changes: 0 additions & 2 deletions test/foundry/IPOrgControllerTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { LicenseRegistry } from "contracts/modules/licensing/LicenseRegistry.sol
import { AccessControlSingleton } from "contracts/access-control/AccessControlSingleton.sol";
import { IPAssetRegistry } from "contracts/IPAssetRegistry.sol";
import { AccessControlHelper } from "./utils/AccessControlHelper.sol";
import { MockCollectNFT } from "./mocks/MockCollectNFT.sol";
import { MockCollectModule } from "./mocks/MockCollectModule.sol";
import { MockIPOrgController } from "./mocks/MockIPOrgController.sol";
import { BaseModule } from "contracts/modules/base/BaseModule.sol";
import { RegistrationModule } from "contracts/modules/registration/RegistrationModule.sol";
Expand Down
10 changes: 4 additions & 6 deletions test/foundry/e2e/e2e.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ contract E2ETest is BaseTest {
memory registerIpAssetParamsCharacter = Registration
.RegisterIPAssetParams({
owner: ipAssetOwner1,
ipOrgAssetType: 0,
name: "Character IPA",
ipAssetType: 0,
hash: 0x558b44f88e5959cec9c7836078a53ff4d6432142a9d5caa6f3a6eb7c83930000,
mediaUrl: "https://arweave.net/chracter"
});
Expand All @@ -236,8 +236,8 @@ contract E2ETest is BaseTest {
memory registerIpAssetParamsStory = Registration
.RegisterIPAssetParams({
owner: ipAssetOwner2,
ipOrgAssetType: 1,
name: "Story IPA",
ipAssetType: 1,
hash: 0x558b44f88e5959cec9c7836078a53ff4d6432142a9d5caa6f3a6eb7c83931111,
mediaUrl: "https://arweave.net/story"
});
Expand All @@ -260,8 +260,8 @@ contract E2ETest is BaseTest {
memory registerIpAssetParamsOrg2 = Registration
.RegisterIPAssetParams({
owner: ipAssetOwner3,
ipOrgAssetType: 1,
name: "Story IPA Org2",
ipAssetType: 1,
hash: 0x558b44f88e5959cec9c7836078a53ff4d6432142a9d5caa6f3a6eb7c83933333,
mediaUrl: "https://arweave.net/story2"
});
Expand All @@ -282,10 +282,8 @@ contract E2ETest is BaseTest {
relType: "APPEAR_IN",
srcAddress: ipOrg1,
srcId: 1,
srcType: 0,
dstAddress: ipOrg1,
dstId: 2,
dstType: 0
dstId: 2
});
bytes[] memory preHooksDataRel = new bytes[](0);
bytes[] memory postHooksDataRel = new bytes[](0);
Expand Down
25 changes: 0 additions & 25 deletions test/foundry/utils/BaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ pragma solidity ^0.8.19;
import 'test/foundry/utils/ProxyHelper.sol';
import 'test/foundry/utils/BaseTestUtils.sol';
import 'test/foundry/utils/AccessControlHelper.sol';
import "test/foundry/mocks/MockCollectNFT.sol";
import "test/foundry/mocks/MockCollectModule.sol";
import "contracts/StoryProtocol.sol";
import "contracts/ip-org/IPOrgController.sol";
import "contracts/ip-org/IPOrg.sol";
Expand All @@ -14,7 +12,6 @@ import "contracts/IPAssetRegistry.sol";
import "contracts/lib/modules/Registration.sol";
import "contracts/access-control/AccessControlSingleton.sol";
import "contracts/IPAssetRegistry.sol";
import "contracts/interfaces/modules/collect/ICollectModule.sol";
import "contracts/modules/relationships/RelationshipModule.sol";
import "contracts/modules/licensing/LicenseRegistry.sol";
import "contracts/modules/licensing/LicensingModule.sol";
Expand All @@ -31,7 +28,6 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper {
IPOrg public ipOrg;
IPOrgController public ipOrgController;
ModuleRegistry public moduleRegistry;
ICollectModule public collectModule;
RelationshipModule public relationshipModule;
IPAssetRegistry public registry;
StoryProtocol public spg;
Expand All @@ -40,9 +36,6 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper {
RegistrationModule public registrationModule;
TermsRepository public termsRepository;

address public defaultCollectNftImpl;
address public collectModuleImpl;

address constant upgrader = address(6969);
address constant ipOrgOwner = address(456);
address constant relManager = address(9999);
Expand Down Expand Up @@ -119,10 +112,6 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper {
);
moduleRegistry.registerProtocolModule(ModuleRegistryKeys.RELATIONSHIP_MODULE, relationshipModule);


defaultCollectNftImpl = _deployCollectNFTImpl();
collectModule = ICollectModule(_deployCollectModule(defaultCollectNftImpl));

IPOrgParams.RegisterIPOrgParams memory ipAssetOrgParams = IPOrgParams.RegisterIPOrgParams(
address(registry),
"IPOrgName",
Expand All @@ -148,20 +137,6 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper {

}

function _deployCollectNFTImpl() internal virtual returns (address) {
return address(new MockCollectNFT());
}

function _deployCollectModule(address collectNftImpl) internal virtual returns (address) {
collectModuleImpl = address(new MockCollectModule(address(registry), collectNftImpl));
return _deployUUPSProxy(
collectModuleImpl,
abi.encodeWithSelector(
bytes4(keccak256(bytes("initialize(address)"))), address(accessControl)
)
);
}

/// @dev Helper function for creating an IP asset for an owner and IP type.
/// TO-DO: Replace this with a simpler set of default owners that get
/// tested against. The reason this is currently added is that during
Expand Down