Currently, the periphery contracts use an additional hasIpAttachedLicenseTerms call to the license registry to ensure idempotency when attaching a license (see LicensingHelper.sol for more details). This extra call introduces unnecessary gas costs when the IP does not already have the license attached.
Suggested Solution
To optimize gas usage, we propose wrapping the attachLicenseTerms() function in a try/catch block to handle the case where the license is not attached.
Description and Context
Currently, the periphery contracts use an additional
hasIpAttachedLicenseTerms
call to the license registry to ensure idempotency when attaching a license (seeLicensingHelper.sol
for more details). This extra call introduces unnecessary gas costs when the IP does not already have the license attached.Suggested Solution
To optimize gas usage, we propose wrapping the
attachLicenseTerms()
function in atry/catch
block to handle the case where the license is not attached.Definition of Done