Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(royalty): remove currencyTokens parameter and extract internally in batch claim functions #75

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR implements the enhancement proposed in PR #74 by removing the currencyTokens parameter from the methods transferToVaultAndSnapshotAndClaimByTokenBatch and transferToVaultAndSnapshotAndClaimBySnapshotBatch. The functions now internally extract the list of unique currency token addresses from the royaltyClaimDetails parameter.

Key Changes

  • Removed the currencyTokens parameter from the function signatures of:
    • transferToVaultAndSnapshotAndClaimByTokenBatch
    • transferToVaultAndSnapshotAndClaimBySnapshotBatch
  • Added a private function _getCurrencyTokenList that extracts a unique list of currency token addresses from the royaltyClaimDetails array.
  • Modified existing tests to accommodate the changes in function parameters.
  • Added additional assertions in the RoyaltyWorkflows tests to verify that the functions return the correct values.

Test

All existing tests pass locally after the changes.

- Catch and handle `IpRoyaltyVault__NoClaimableTokens` error.
- Revert with original error for all other cases using assembly.
- Existing tests already covers the non-revert case
- Added tests to cover the revert case
Copy link

@kingster-will kingster-will left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sebsadface sebsadface merged commit 6da0a50 into storyprotocol:main Sep 24, 2024
3 checks passed
@sebsadface sebsadface deleted the royalty-enhancement branch October 16, 2024 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants