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

fix(zora): add tokenId to zora SDK getToken call for 1155s #511

Merged

Conversation

mmackz
Copy link
Collaborator

@mmackz mmackz commented Aug 15, 2024

  • Updated Zora SDK requires a tokenId on the getToken call, otherwise it will fail and return the base fee.

Fixes BOOST-4477

https://linear.app/rh-app/issue/BOOST-4477/zora-getfees-fails-for-1155-wo-tokenid-plugin

@mmackz mmackz requested a review from a team as a code owner August 15, 2024 19:49
Copy link

changeset-bot bot commented Aug 15, 2024

🦋 Changeset detected

Latest commit: 33ab22d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@rabbitholegg/questdk-plugin-zora Patch
@rabbitholegg/questdk-plugin-registry Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@Quazia Quazia left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -471,6 +472,12 @@ export const getFees = async (
publicClient: client,
})

// if contract type is 1155, we need to get the latest tokenId
if (contractType === '1155' && tokenId == null) {
Copy link
Member

Choose a reason for hiding this comment

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

if we pass tokenId into getNextTokenId it should account for the existing tokenId right? Neutral on if we pass it or implementation, important thing is that the simulation and fees are both using the same logic to determine the token to use (both use next if tokenId is undefined)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

getNextTokenId passes back the existing tokenId if it is defined.

Felt this was more semantic.

SimulateMint and getFees will both use getNextTokenId when no token is available.

@mmackz mmackz merged commit 180e8e6 into main Aug 15, 2024
9 checks passed
@mmackz mmackz deleted the matthew/boost-4477-zora-getfees-fails-for-1155-wo-tokenid-plugin branch August 15, 2024 21:34
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