Skip to content

Commit

Permalink
refactor: use derivData's IPAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
scottphc committed Jan 24, 2025
1 parent 04c153b commit 838f269
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/spotlight-token-factory/ISpotlightTokenFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ interface ISpotlightTokenFactory {
* @param ipMetadata Metadata for the intellectual property. See {IStoryDerivativeWorkflows-registerIpAndMakeDerivative}.
* @param sigMetadata Signature data for token creation. See {IStoryDerivativeWorkflows-registerIpAndMakeDerivative}.
* @param sigRegister Signature data for IP registration. See {IStoryDerivativeWorkflows-registerIpAndMakeDerivative}.
* @param parentIPAccount The address of the Parent IP account to be used for the token creation.
*
* @return tokenAddress The address of the newly created token.
* @return ipId The ID of the newly registered intellectual property.
Expand All @@ -168,8 +167,7 @@ interface ISpotlightTokenFactory {
StoryWorkflowStructs.MakeDerivative calldata derivData,
StoryWorkflowStructs.IPMetadata calldata ipMetadata,
StoryWorkflowStructs.SignatureData calldata sigMetadata,
StoryWorkflowStructs.SignatureData calldata sigRegister,
address parentIPAccount
StoryWorkflowStructs.SignatureData calldata sigRegister
) external payable returns (address tokenAddress, address ipId);

/**
Expand Down
10 changes: 7 additions & 3 deletions src/spotlight-token-factory/SpotlightTokenFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,14 @@ contract SpotlightTokenFactory is OwnableUpgradeable, SpotlightTokenFactoryStora
StoryWorkflowStructs.MakeDerivative calldata derivData,
StoryWorkflowStructs.IPMetadata calldata ipMetadata,
StoryWorkflowStructs.SignatureData calldata sigMetadata,
StoryWorkflowStructs.SignatureData calldata sigRegister,
address parentIPAccount
StoryWorkflowStructs.SignatureData calldata sigRegister
) external payable needInitialized returns (address tokenAddress, address ipId) {
tokenAddress = _deploySpotlightToken(tokenCreationData, msg.sender, parentIPAccount);
require(derivData.parentIpIds.length > 0, "SpotlightTokenFactory: Parent IP ID is required");
tokenAddress = _deploySpotlightToken(
tokenCreationData,
msg.sender,
derivData.parentIpIds[0] // get first parent IPAccount only
);

ISpotlightTokenIPCollection(_tokenIpCollection).mint(msg.sender, tokenCreationData.tokenIpNFTId);

Expand Down

0 comments on commit 838f269

Please sign in to comment.