Draft: ITokenFactory#6
Draft
amiecorso wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Draft of the B-20 token factory interface. Not for merge. Posting so the team can react to the shape and the open design questions before we commit to anything.
Key design choice: no address prefix, registry-based dispatch
Earlier drafts proposed reserving 0xB200 / 0xB201 address prefixes for B-20 tokens. We dropped that approach because Base has roughly hundreds of pre-existing contracts at addresses already starting with any given 16-bit prefix; reserving the prefix would either break those contracts or require extensive scanning + grandfathering at hardfork time.
Instead: B-20 tokens have arbitrary-looking addresses (CREATE2-style derivation, no fixed prefix). The chain maintains an internal registry of "addresses that are B-20 tokens", populated by the factory at creation time. Dispatch is registry-based; `variantOf(token)` reads from the registry. Full rationale in FACTORY_DESIGN_NOTES.md.
What's in this draft
Open questions (full list in FACTORY_DESIGN_NOTES.md)
Status
Draft. Looking for team reaction on the registry-vs-prefix decision and the other open questions before iterating further.