Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporarily Comment Out Unused Modules for Alpha Release Preparation
Browse files Browse the repository at this point in the history
We have temporarily commented out the Collect and Royalty
modules to streamline the codebase for the alpha release.

These changes are not permanent and these modules will
be reintroduced in future releases.
kingster-will committed Nov 27, 2023
1 parent f6d9079 commit 2d28a5c
Showing 30 changed files with 1,172 additions and 1,160 deletions.
2,267 changes: 1,141 additions & 1,126 deletions lcov.info

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ 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";
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) {
Original file line number Diff line number Diff line change
@@ -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";
Original file line number Diff line number Diff line change
@@ -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";

Original file line number Diff line number Diff line change
@@ -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";
Original file line number Diff line number Diff line change
@@ -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";
Original file line number Diff line number Diff line change
@@ -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
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;
}

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.
File renamed without changes.
7 changes: 0 additions & 7 deletions script/foundry/deployment/Main.s.sol
Original file line number Diff line number Diff line change
@@ -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";
2 changes: 0 additions & 2 deletions test/foundry/IPOrgControllerTest.t.sol
Original file line number Diff line number Diff line change
@@ -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";
22 changes: 12 additions & 10 deletions test/foundry/utils/BaseTest.sol
Original file line number Diff line number Diff line change
@@ -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";
@@ -149,17 +147,21 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper {
}

function _deployCollectNFTImpl() internal virtual returns (address) {
return address(new MockCollectNFT());
// TODO: temporarily commented out for alpha
// return address(new MockCollectNFT());
return address(0);
}

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)
)
);
// TODO: temporarily commented out for alpha
// collectModuleImpl = address(new MockCollectModule(address(registry), collectNftImpl));
// return _deployUUPSProxy(
// collectModuleImpl,
// abi.encodeWithSelector(
// bytes4(keccak256(bytes("initialize(address)"))), address(accessControl)
// )
// );
return address(0);
}

/// @dev Helper function for creating an IP asset for an owner and IP type.

0 comments on commit 2d28a5c

Please sign in to comment.