From b4a2a36c4ec82866e6ac557d6f705c077c75ccfb Mon Sep 17 00:00:00 2001 From: Kingster Date: Tue, 21 Nov 2023 13:24:40 -0800 Subject: [PATCH 1/3] Fix following issues - remove underscore postfix from event field - rename event field `ipaId` to `ipAssetId` - fix wrong `owner` in IPOrgRegistered event - add ipAssetTypes into IPOrgRegistered event - remove `indexed` from string or array event fields --- .../interfaces/ip-org/IIPOrgController.sol | 38 ++++++++++--------- contracts/interfaces/ip-org/IIPOrgFactory.sol | 11 +++--- .../interfaces/modules/IModuleRegistry.sol | 8 ++-- contracts/ip-org/IPOrgController.sol | 5 ++- contracts/modules/base/HookRegistry.sol | 2 +- .../modules/licensing/LicenseRegistry.sol | 2 +- .../modules/base/HookRegistryTest.t.sol | 2 +- 7 files changed, 36 insertions(+), 32 deletions(-) diff --git a/contracts/interfaces/ip-org/IIPOrgController.sol b/contracts/interfaces/ip-org/IIPOrgController.sol index 35808d4a..dbc325e0 100644 --- a/contracts/interfaces/ip-org/IIPOrgController.sol +++ b/contracts/interfaces/ip-org/IIPOrgController.sol @@ -8,33 +8,35 @@ import { IPOrgParams } from "contracts/lib/IPOrgParams.sol"; interface IIPOrgController { /// @notice Emits when a new IP Org is registered. - /// @param owner_ The address of the IP Org owner. - /// @param ipAssetOrg_ The address of the new IP Org contract. - /// @param name_ Descriptive name for the new IP Org contract. - /// @param symbol_ A describe symbol for the new IP Org contract. + /// @param owner The address of the IP Org owner. + /// @param ipAssetOrg The address of the new IP Org contract. + /// @param name Descriptive name for the new IP Org contract. + /// @param symbol A describe symbol for the new IP Org contract. + /// @param ipAssetTypes String descriptors of the IP asset types available. event IPOrgRegistered( - address owner_, - address ipAssetOrg_, - string name_, - string symbol_ + address owner, + address ipAssetOrg, + string name, + string symbol, + string[] ipAssetTypes ); /// @notice Emits when an IP Org is transferred to a new owner. - /// @param ipOrg_ The address of the IP Org. - /// @param prevOwner_ The address of the previous owner of the IP Org. - /// @param newOwner_ The address of the new owner of the IP Org. + /// @param ipOrg The address of the IP Org. + /// @param prevOwner The address of the previous owner of the IP Org. + /// @param newOwner The address of the new owner of the IP Org. event IPOrgTransferred( - address ipOrg_, - address prevOwner_, - address newOwner_ + address ipOrg, + address prevOwner, + address newOwner ); /// @notice Emits when an ownership transfer is initialized for a new owner. - /// @param ipOrg_ The address of the IP Org. - /// @param pendingOwner_ The pending owner to set for the IP Org. + /// @param ipOrg The address of the IP Org. + /// @param pendingOwner The pending owner to set for the IP Org. event IPOrgPendingOwnerSet( - address ipOrg_, - address pendingOwner_ + address ipOrg, + address pendingOwner ); /// @notice Registers a new IP Org. diff --git a/contracts/interfaces/ip-org/IIPOrgFactory.sol b/contracts/interfaces/ip-org/IIPOrgFactory.sol index e3fb8dc0..0ba0dd7a 100644 --- a/contracts/interfaces/ip-org/IIPOrgFactory.sol +++ b/contracts/interfaces/ip-org/IIPOrgFactory.sol @@ -7,11 +7,12 @@ import { IPOrgParams } from "contracts/lib/IPOrgParams.sol"; interface IIPOrgController is IVersioned { event IPOrgRegistered( - address owner_, - address ipAssetOrg_, - string name_, - string symbol_, - string tokenURI_ + address owner, + address ipAssetOrg, + string name, + string symbol, + string tokenURI, + string[] ipAssetTypes ); function registerIpOrg(IPOrgParams.RegisterIPOrgParams calldata params_) external returns(address); diff --git a/contracts/interfaces/modules/IModuleRegistry.sol b/contracts/interfaces/modules/IModuleRegistry.sol index 9ced5dfd..dbc9aa44 100644 --- a/contracts/interfaces/modules/IModuleRegistry.sol +++ b/contracts/interfaces/modules/IModuleRegistry.sol @@ -8,21 +8,21 @@ interface IModuleRegistry { /// @notice Emits when a new module is added for a specific IP Org. event ModuleAdded( address indexed ipOrg, - string indexed moduleKey, + string moduleKey, address indexed module ); /// @notice Emits when a module is removed for an IP Org. event ModuleRemoved( address indexed ipOrg, - string indexed moduleKey, + string moduleKey, address indexed module ); /// @notice Emits when a module is executed for an IP Org. event ModuleExecuted ( address indexed ipOrg, - string indexed moduleKey, + string moduleKey, address indexed caller, bytes selfParams, bytes[] preHookParams, @@ -32,7 +32,7 @@ interface IModuleRegistry { /// @notice Emits when a module is configured for an IP Org. event ModuleConfigured( address indexed ipOrg, - string indexed moduleKey, + string moduleKey, address indexed caller, bytes params ); diff --git a/contracts/ip-org/IPOrgController.sol b/contracts/ip-org/IPOrgController.sol index 2de3545a..6fccb1fd 100644 --- a/contracts/ip-org/IPOrgController.sol +++ b/contracts/ip-org/IPOrgController.sol @@ -188,10 +188,11 @@ contract IPOrgController is ); emit IPOrgRegistered( - msg.sender, + owner_, ipOrg_, name_, - symbol_ + symbol_, + ipAssetTypes_ ); } diff --git a/contracts/modules/base/HookRegistry.sol b/contracts/modules/base/HookRegistry.sol index 706106ab..919d9a42 100644 --- a/contracts/modules/base/HookRegistry.sol +++ b/contracts/modules/base/HookRegistry.sol @@ -27,7 +27,7 @@ abstract contract HookRegistry { uint256 public constant INDEX_NOT_FOUND = type(uint256).max; uint256 public constant MAX_HOOKS = 10; - event HooksRegistered(HookType indexed hType, bytes32 indexed registryKey, address[] indexed hook); + event HooksRegistered(HookType indexed hType, bytes32 indexed registryKey, address[] hook); event HooksCleared(HookType indexed hType, bytes32 indexed registryKey); /// @dev Modifier to check if the caller is the IPOrg owner. diff --git a/contracts/modules/licensing/LicenseRegistry.sol b/contracts/modules/licensing/LicenseRegistry.sol index 81896b45..5aa5d3fd 100644 --- a/contracts/modules/licensing/LicenseRegistry.sol +++ b/contracts/modules/licensing/LicenseRegistry.sol @@ -18,7 +18,7 @@ contract LicenseRegistry is ERC721 { event LicenseRegistered(uint256 indexed id); event LicenseNftBoundedToIpa( uint256 indexed licenseId, - uint256 indexed ipaId + uint256 indexed ipAssetId ); event LicenseActivated(uint256 indexed licenseId); event LicenseRevoked(uint256 indexed licenseId); diff --git a/test/foundry/modules/base/HookRegistryTest.t.sol b/test/foundry/modules/base/HookRegistryTest.t.sol index d6a938e7..db8b7478 100644 --- a/test/foundry/modules/base/HookRegistryTest.t.sol +++ b/test/foundry/modules/base/HookRegistryTest.t.sol @@ -15,7 +15,7 @@ import { MockIPOrg } from "test/foundry/mocks/MockIPOrg.sol"; contract HookRegistryTest is BaseTest { MockHookRegistry hookRegistry; - event HooksRegistered(HookRegistry.HookType indexed hType, bytes32 indexed registryKey, address[] indexed hook); + event HooksRegistered(HookRegistry.HookType indexed hType, bytes32 indexed registryKey, address[] hook); event HooksCleared(HookRegistry.HookType indexed hType, bytes32 indexed registryKey); function setUp() public override { From 17f52d7279ea8416eee93424cc320a2df5b0466b Mon Sep 17 00:00:00 2001 From: kingster-will <83567446+kingster-will@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:23:38 -0800 Subject: [PATCH 2/3] Rename event field name from `hook` to `hooks` Co-authored-by: Ramarti --- contracts/modules/base/HookRegistry.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/modules/base/HookRegistry.sol b/contracts/modules/base/HookRegistry.sol index 919d9a42..36c99fae 100644 --- a/contracts/modules/base/HookRegistry.sol +++ b/contracts/modules/base/HookRegistry.sol @@ -27,7 +27,7 @@ abstract contract HookRegistry { uint256 public constant INDEX_NOT_FOUND = type(uint256).max; uint256 public constant MAX_HOOKS = 10; - event HooksRegistered(HookType indexed hType, bytes32 indexed registryKey, address[] hook); + event HooksRegistered(HookType indexed hType, bytes32 indexed registryKey, address[] hooks); event HooksCleared(HookType indexed hType, bytes32 indexed registryKey); /// @dev Modifier to check if the caller is the IPOrg owner. From 8c862de3b925118fc80393820445453457879550 Mon Sep 17 00:00:00 2001 From: kingster-will <83567446+kingster-will@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:23:58 -0800 Subject: [PATCH 3/3] Rename event field name from `hook` to `hooks` Co-authored-by: Ramarti --- test/foundry/modules/base/HookRegistryTest.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/foundry/modules/base/HookRegistryTest.t.sol b/test/foundry/modules/base/HookRegistryTest.t.sol index db8b7478..6a8dca8d 100644 --- a/test/foundry/modules/base/HookRegistryTest.t.sol +++ b/test/foundry/modules/base/HookRegistryTest.t.sol @@ -15,7 +15,7 @@ import { MockIPOrg } from "test/foundry/mocks/MockIPOrg.sol"; contract HookRegistryTest is BaseTest { MockHookRegistry hookRegistry; - event HooksRegistered(HookRegistry.HookType indexed hType, bytes32 indexed registryKey, address[] hook); + event HooksRegistered(HookRegistry.HookType indexed hType, bytes32 indexed registryKey, address[] hooks); event HooksCleared(HookRegistry.HookType indexed hType, bytes32 indexed registryKey); function setUp() public override {