-
Notifications
You must be signed in to change notification settings - Fork 88
Invalid Parameter caller
for HookModule verification
#117
Comments
My thinking is to disable the commercializers for beta release. We may need some more time to rethink how is can be supported post beta. |
Thoughts @kingster-will @Ramarti ? The patch in #119 solves these issues, which are checked with additional tests in the integration test. I think commercializers are important for beta release, especially to observe the potential capability/creativity of hooks for minting and licensing. |
I think minting is pretty well defined, either:
Policy parameters means the address should pass commercializers
Up to the caller how to satisfy that Commercializers is just a hook. I think the most confusing part is the name, which comes straight from the legal text. I would be to make more explicit in the code that is a Hook, by renaming the variable. For the PIL to make sense, the metadata should still say "Commercializers" in the attribute, since the hook defines those. |
The issue in question is not related to the HookModule, nor is it caused by the code snippet highlighted in the issue description. Instead, the core of the issue lies in determining who should possess the NFT during the verification of the commercializer. To resolve this, we need to decide the rightful license holder during the IP Parent linking process. We have three potential options:
Each option has implications:
|
I felt the issue is why we allow RegistrationModule call linkIPtoParent? |
Problem
Each commercial policy has a commercializer checker that gets called for verification on minting and linking.
See below for the verification callbacks
protocol-core/contracts/modules/licensing/PILPolicyFrameworkManager.sol
Lines 104 to 110 in 03b8c2b
protocol-core/contracts/modules/licensing/PILPolicyFrameworkManager.sol
Lines 138 to 144 in 03b8c2b
The issue with the current implementation is that the
caller
parameter in not cessearily the IPAccount owner.Here is an example call path that leads to the bug (verification failing):
registrationModule.registerDerivativeIP()
licensingModule.linkIpToParents()
caller
is the RegistrationModule address.In particular, if I use a token-gated hook module as the commercializer checker, then the hook module will check for NFT ownership of the RegistrationModule, since caller is the registration module.
This is NOT an intended behavior - we want to check ownership of the actual caller (EOA or IPAccount).
This bug will lead to reverts/fails (return "false" on hook module verification) on all contract-to-contract interactions that call
linkIpToParents
with a policy that has a commercializer checker (so, the caller is a contract, not EOA or IPAccount).This breaks
This logic was introduced in #85 but was uncaught in integration tests due to many moving pieces in contracts and logic after the PR. Particularly, this bug is only reproducible with a valid PolicyFrameworkManager, in our case PIL PFM, which was finalized yesterday / today.
Solution
We can pass in
licensee
address for thecaller
parameter.protocol-core/contracts/modules/licensing/LicensingModule.sol
Line 301 in 03b8c2b
When the LicensingModule calls
verifyLink
orverifyLink
, it knows the value of the licensee (owner of the licenses). So we can trust the module to pass in the correct value.protocol-core/contracts/modules/licensing/LicensingModule.sol
Lines 291 to 293 in 03b8c2b
The text was updated successfully, but these errors were encountered: