storyprotocol / protocol-periphery-v1

Periphery contract for story protocol, mainnet repo
MIT License
28 stars 20 forks source link

feat(derivative): use licensing module's `predictMintingLicenseFee` for minting fee calculation #64

Closed sebsadface closed 1 month ago

sebsadface commented 1 month ago

Description

This PR replaces the existing minting fee calculation logic for a single parent with a call to predictMintingLicenseFee function from the licensing module. This function allows minting fee prediction without triggering any state changes.

Test Plan

All existing tests pass locally.

Related Issue

sebsadface commented 1 month ago

Wonder whether we have unit test cover this function?

The minting fee calculation is only used when registering derivatives without license tokens. We already have a test case that covers this logic by testing derivative registration for a parent with a commercial license. More details here: https://github.com/storyprotocol/protocol-periphery-v1/blob/25888685da76b7b860211230def1cc9884e1a20d/test/StoryProtocolGateway.t.sol#L287).