Skip to content

Conversation

@0xpantera
Copy link

This PR continues the work started in #1040 by @swan-of-bodom, implementing the ERC-6909 multi-token standard for Cairo.
It rebases that branch on top of the latest main, resolves merge conflicts, modernizes the code to align with current Cairo and OpenZeppelin patterns, and adds missing tests and documentation.

Fixes #1570

Summary of changes

  • Implements core ERC-6909 functionality (multi-token with extension hooks).
  • Adds metadata, supply, and URI extensions and integrates them with ERC6909.
  • Updates macros and components to support with_components!(ERC6909, ...).
  • Refactors and cleans up imports, storage structs, and mock contracts.
  • Adds comprehensive tests for core and extension behavior.
  • Updates and reorganizes documentation to match OpenZeppelin formatting.

Context

The original PR (#1040) had gone stale for over a year.
This branch preserves @swan-of-bodom’s commits and authorship while bringing the implementation up to date with current Cairo contracts.

PR Checklist

  • Tests
  • Documentation
  • Added entry to CHANGELOG.md
  • Tried the feature on a public network

Co-authored-by: @swan-of-bodom

@bidzyyys
Copy link
Collaborator

Hey @lumoswiz!
You have some failing CI jobs. Please fix them 🙏

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.60%. Comparing base (ea1ca46) to head (64a8e2f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1594      +/-   ##
==========================================
+ Coverage   92.36%   92.60%   +0.24%     
==========================================
  Files          85       86       +1     
  Lines        2278     2325      +47     
==========================================
+ Hits         2104     2153      +49     
+ Misses        174      172       -2     
Files with missing lines Coverage Δ
packages/token/src/erc6909/erc6909.cairo 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea1ca46...64a8e2f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lumoswiz
Copy link

@bidzyyys Updated docs & have CI passing now.

I need some advice/feedback on the following:

  • In ERC6909MetadataComponent, I think we can remove _update_token_metadata, _token_metadata_exists and _set_token_metadata. Updating the token metadata in hooks feels awkward since passing the metadata directly to the hooks is not possible (as it currently stands). Removal of these also aligns well with the OZ Solidity impl.

Let me know what you think, and I can make the changes if appropriate.

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.

[Feature]: Add ERC-6909 token

4 participants