From 72bd846b0a3da6f8f9028840c6474293db6b674b Mon Sep 17 00:00:00 2001 From: Raul Date: Sat, 17 Feb 2024 02:04:54 -0800 Subject: [PATCH] fix --- .../modules/licensing/UMLPolicyFrameworkManager.sol | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contracts/modules/licensing/UMLPolicyFrameworkManager.sol b/contracts/modules/licensing/UMLPolicyFrameworkManager.sol index e43e161dd..d0f2c868c 100644 --- a/contracts/modules/licensing/UMLPolicyFrameworkManager.sol +++ b/contracts/modules/licensing/UMLPolicyFrameworkManager.sol @@ -83,7 +83,6 @@ contract UMLPolicyFrameworkManager is bytes calldata policyData ) external override nonReentrant onlyLicensingModule returns (bool) { UMLPolicy memory policy = abi.decode(policyData, (UMLPolicy)); - bool linkAllowed = true; // Trying to burn a license to create a derivative, when the license doesn't allow derivatives. if (!policy.derivativesAllowed) { @@ -92,18 +91,18 @@ contract UMLPolicyFrameworkManager is // If the policy defines the licensor must approve derivatives, check if the // derivative is approved by the licensor - if (policy.derivativesApproval) { - linkAllowed = linkAllowed && isDerivativeApproved(licenseId, ipId); + if (policy.derivativesApproval && !isDerivativeApproved(licenseId, ipId)) { + return false; } // Check if the commercializerChecker allows the link if (policy.commercializerChecker != address(0)) { // No need to check if the commercializerChecker supports the IHookModule interface, as it was checked // when the policy was registered. if (!IHookModule(policy.commercializerChecker).verify(caller, policy.commercializerCheckerData)) { - linkAllowed = false; + return false; } } - return linkAllowed; + return true; } /// @notice Verify policy parameters for minting a license.