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

Feature: ERC-1155 Transfers #143

Merged
merged 41 commits into from
May 7, 2024
Merged

Feature: ERC-1155 Transfers #143

merged 41 commits into from
May 7, 2024

Conversation

brunomenezes
Copy link
Collaborator

@brunomenezes brunomenezes commented Apr 3, 2024

Summary

code changes to support multi-token transfers through available portals ERC-1155 Batch Portal and ERC-1155 Single Portal.

I will get ahead and explain some rationale for the decisions I made. Note that only one component is exported, but based on the mode, it will pick one form or the other. There are shared components and validators where due, but the amount of differences in what makes one or the other form ready and given the way the hooks work would increase the difficulty in maintenance (The most critical piece to me. Developing is easy, maintaining is hard) given the number of variables to look after to enable or not these calls (only because of this eager nature of hooks), also other logical variables to decide when action buttons should be enabled or not that would be another unnecessary complexity. So there you have it, dear reviewer(s)

The implementation was done keeping in mind the specification EIP-1155. At the moment, the only thing ruled out is the possible use of locale in the URI for i18n/i10n.

Summary of changes:

  • Added check for supported interfaces in a given contract address before allowing the user to proceed (Check the spec)
  • Added validations to check the operator's (Portal) approval and to see if the user is not exceeding the balance. In batch mode, any deposit in the review list is also included in a sum to be checked.
  • I added a metadata preview when available. If not, informational messages are displayed, but the user can proceed if comfortable.
  • Added a new graphql query to be able to search for already indexed ERC-1155 contracts.
  • Added a new component to generate a link to the connected chain block-explorer to check the transaction upon transfer success (confirmation). Note: devnet does not have one, so nothing is generated
  • Added test cases.

@brunomenezes brunomenezes linked an issue Apr 3, 2024 that may be closed by this pull request
10 tasks
Copy link

vercel bot commented Apr 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollups-explorer-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 6:22am
rollups-explorer-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 6:22am
rollups-explorer-workshop ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 6:22am

After the send-transaction mocks refactoring, the mocks behave as expected, deeming the WagmiProvider HoC and Vitest dangerouslyIgnoreUnhandledErrors flag unnecessary.
Copy link
Contributor

@nevendyulgerov nevendyulgerov left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for making those tweaks!

@brunomenezes brunomenezes merged commit 6580e4d into main May 7, 2024
8 checks passed
@brunomenezes brunomenezes deleted the feature/erc-1155-deposit branch May 7, 2024 10:07
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.

ERC-1155 Deposit
3 participants