-
Notifications
You must be signed in to change notification settings - Fork 262
Convert erc20 to serc20 tutorial #1403
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
Conversation
✅ Deploy Preview for docs-optimism ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThis pull request updates several documentation pages in the interop tutorials section. Two new tutorial cards have been added to the overview page: one for "Deploying crosschain event composability (contests)" (a duplicate of an existing card) and another for "Creating custom SuperchainERC20 tokens." The custom SuperchainERC20 tutorial page has been revised to clarify the process of upgrading an ERC20 token, now described as "teleporting" across the Superchain interop cluster. New sections have been added detailing the creation of a basic ERC20 contract and its extension with the SuperchainERC20 interface, including code examples for Sequence Diagram(s)sequenceDiagram
participant U as User
participant OV as Tutorials Overview Page
participant TS as Tutorial (SuperchainERC20)
U->>OV: Load Tutorials Overview
OV->>U: Display list of tutorial cards
U->>OV: Click "Creating custom SuperchainERC20 tokens" card
OV->>U: Redirect to /stack/interop/tutorials/custom-superchain-erc20
U->>TS: View detailed tutorial with code snippets
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
pages/stack/interop/tutorials/convert-erc20.mdx (2)
23-33
: Enhance punctuation for improved clarity.At line 25, consider adding a comma after "First" to enhance readability. For example, change to: "First, let's chat about what your token will look like by the end of the conversion:".
🧰 Tools
🪛 LanguageTool
[uncategorized] ~24-~24: Possible missing comma found.
Context: ...c20). ## SuperchainERC20 requirements First let's chat about what your token will l...(AI_HYDRA_LEO_MISSING_COMMA)
148-152
: Next steps section is well-organized.The bullet points are clear, actionable, and conform to the required style. For uniformity, consider ending the last bullet with a period.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
pages/stack/interop/tutorials.mdx
(1 hunks)pages/stack/interop/tutorials/convert-erc20.mdx
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.mdx`: "ALWAYS review Markdown content THOROUGHLY with ...
**/*.mdx
: "ALWAYS review Markdown content THOROUGHLY with the following criteria:
- Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
- Avoid gender-specific language and use the imperative form.
- Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
- Ensure proper nouns are capitalized in sentences.
- Apply the Oxford comma.
- Use proper title case for buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
- Use correct spelling and grammar at all times (IMPORTANT).
- For H1, H2, and H3 headers:
- Use sentence case, capitalizing only the first word.
- Preserve the capitalization of proper nouns, technical terms, and acronyms as defined in the 'nouns.txt' file located in the root directory of the project.
- Do not automatically lowercase words that appear in the 'nouns.txt' file, regardless of their position in the header.
- Flag any headers that seem to inconsistently apply these rules for manual review.
- When reviewing capitalization, always refer to the 'nouns.txt' file for the correct capitalization of proper nouns and technical terms specific to the project.
"
pages/stack/interop/tutorials.mdx
pages/stack/interop/tutorials/convert-erc20.mdx
🪛 LanguageTool
pages/stack/interop/tutorials/convert-erc20.mdx
[uncategorized] ~24-~24: Possible missing comma found.
Context: ...c20). ## SuperchainERC20 requirements First let's chat about what your token will l...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - docs-optimism
- GitHub Check: Header rules - docs-optimism
- GitHub Check: Pages changed - docs-optimism
🔇 Additional comments (12)
pages/stack/interop/tutorials.mdx (1)
32-33
: New tutorial card addition is correctly implemented.The new card titled "Converting an ERC20 into a SuperchainERC20" is added with consistent formatting and a proper link reference. Please verify that its style and behavior match those of the other cards.
pages/stack/interop/tutorials/convert-erc20.mdx (11)
1-5
: Front matter metadata is well configured.The title, language, and description fields follow the project’s conventions and accurately describe the tutorial.
7-9
: Import statements are clear and concise.The imports for the Callout and Steps components are correctly stated and support the MDX content structure.
10-13
: Callout component usage is effective.The Callout clearly informs users about the production readiness of the SuperchainERC20 standard and notes the current development status of the OP Stack interoperability upgrade.
15-15
: Header is appropriately styled.The header "# Convert an ERC20 token into a SuperchainERC20 token" uses sentence case as required and clearly communicates the tutorial’s subject.
17-22
: Introduction section is clear and informative.The tutorial introduction effectively outlines the objective and provides helpful links, such as the guided walkthrough video and documentation reference.
34-57
: Basic ERC20 contract snippet is well integrated.The code snippet demonstrating a basic ERC20 contract is correctly formatted and easy to follow.
58-60
: Section introduction for the new interface is clear.The header and accompanying text for adding the new SuperchainERC20 interface are concise and follow MDX styling best practices.
61-89
: Solidity snippet implementing the SuperchainERC20 interface is accurate.The code correctly imports the required contracts, defines the new contract, and implements the
supportsInterface
function. Everything is clear and well documented.
91-94
: Section for crosschain functions is clearly introduced.The text explains the purpose of the
crosschainMint
andcrosschainBurn
functions effectively and appropriately links to additional documentation.
95-145
: Verify event declarations for crosschain functions.The code snippet emits
CrosschainMint
andCrosschainBurn
events; however, their declarations are not shown. To ensure the contract compiles successfully, consider adding event declarations such as:+ event CrosschainMint(address indexed to, uint256 amount, address indexed bridge); + event CrosschainBurn(address indexed from, uint256 amount, address indexed bridge);If these events are declared elsewhere, please verify the visibility; otherwise, adding them here would improve clarity and completeness.
146-147
: Steps component is correctly structured.The Steps component is properly used and closed, preserving the integrity of the MDX content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just missing a link here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
pages/stack/interop/tutorials/custom-superchain-erc20.mdx (4)
30-31
: Ensure token naming consistency.
The bullet under “What you'll learn” currently refers to deploying “custom ERC20 tokens” while the overall tutorial and title focus on “SuperchainERC20 tokens.” Consider revising the bullet to reference “custom SuperchainERC20 tokens” to maintain consistency throughout the document.
35-36
: Refine introductory phrasing.
The statement “At a high level you will:” would read more smoothly with a comma: “At a high level, you will:” This minor grammatical improvement can enhance readability.🧰 Tools
🪛 LanguageTool
[typographical] ~36-~36: Consider adding a comma after this introductory phrase.
Context: ...entation, or write your own. At a high level you will: ### Create a basic ...(AS_A_NN_COMMA)
121-127
: Include event declarations for clarity.
The code examples emit events (CrosschainMint
andCrosschainBurn
) without showing their declarations. To assist readers—especially those new to Solidity—it would be beneficial to either include a brief event declaration in the snippet or add an explanatory note with a reference to where these events are defined.
274-274
: Polish link call-to-action punctuation.
In the sentence “For more details see the explainer,” adding a comma after “For more details” (i.e. “For more details, see the explainer”) could improve readability and adhere to standard punctuation practices.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
pages/stack/interop/tutorials.mdx
(1 hunks)pages/stack/interop/tutorials/custom-superchain-erc20.mdx
(3 hunks)pages/stack/interop/tutorials/deploy-superchain-erc20.mdx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- pages/stack/interop/tutorials/deploy-superchain-erc20.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
- pages/stack/interop/tutorials.mdx
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.mdx`: "ALWAYS review Markdown content THOROUGHLY with ...
**/*.mdx
: "ALWAYS review Markdown content THOROUGHLY with the following criteria:
- Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
- Avoid gender-specific language and use the imperative form.
- Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
- Ensure proper nouns are capitalized in sentences.
- Apply the Oxford comma.
- Use proper title case for buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
- Use correct spelling and grammar at all times (IMPORTANT).
- For H1, H2, and H3 headers:
- Use sentence case, capitalizing only the first word.
- Preserve the capitalization of proper nouns, technical terms, and acronyms as defined in the 'nouns.txt' file located in the root directory of the project.
- Do not automatically lowercase words that appear in the 'nouns.txt' file, regardless of their position in the header.
- Flag any headers that seem to inconsistently apply these rules for manual review.
- When reviewing capitalization, always refer to the 'nouns.txt' file for the correct capitalization of proper nouns and technical terms specific to the project.
"
pages/stack/interop/tutorials/custom-superchain-erc20.mdx
🪛 LanguageTool
pages/stack/interop/tutorials/custom-superchain-erc20.mdx
[typographical] ~36-~36: Consider adding a comma after this introductory phrase.
Context: ...entation, or write your own. At a high level you will: ### Create a basic ...
(AS_A_NN_COMMA)
🪛 Gitleaks (8.21.2)
pages/stack/interop/tutorials/custom-superchain-erc20.mdx
146-146: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - docs-optimism
- GitHub Check: Header rules - docs-optimism
- GitHub Check: Pages changed - docs-optimism
🔇 Additional comments (4)
pages/stack/interop/tutorials/custom-superchain-erc20.mdx (4)
19-20
: Clarify upgrade process description.
The introductory paragraph clearly explains how an ERC20 token is “upgraded” to a SuperchainERC20 token that can “teleport” across the interop cluster. To improve clarity, consider explicitly noting whether “upgrade” and “teleport” refer to sequential steps or if “teleport” is simply a descriptive metaphor for cross-chain migration.
21-23
: Enhance deployment method explanation.
The paragraph on ensuring fungibility by enforcing the same contract address across chains is concise and informative. Optionally, you might add a brief explanation or a link regarding “deterministic deployment methods” to assist readers who are less familiar with the concept.
121-138
: Review hard-coded bridge address in cross-chain functions.
In thecrosschainMint
andcrosschainBurn
functions, the caller is verified against a hard-coded address (0x4200000000000000000000000000000000000028
). While this is likely intentional (to restrict access to the SuperchainTokenBridge), please verify that it is not inadvertently exposing sensitive configuration data or resembling an API key. If it is a fixed public constant, consider adding a comment to explain its origin and ensure that it is maintained securely.
278-279
: Verify external link currency and clarity in next steps.
The “Next steps” section directs users to a guided walkthrough via a tutorial video and to review the Superchain Interop Explainer. Please ensure that the URL for the tutorial video (https://x.com/i/status/1866095114374045969) is current and accessible. Additionally, verify that the language remains consistent and instructional throughout these calls to action.
No description provided.