-
Notifications
You must be signed in to change notification settings - Fork 280
DEVREL-549 docs: example READMEs specs + examples/oft README revamp #1596
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
Merged
Merged
Changes from 54 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
374885e
structure doc + OFT README revamp
nazreen cba33e1
lint
nazreen 58c69c6
amend
nazreen b55242e
add deploy script for MyOFTMock
nazreen 8cbf960
reduce mesh to 2 chains
nazreen bbcfc17
fix typos, use pnpm
nazreen 8f4abe4
ToC
nazreen 1531986
readme
nazreen 8c0ebbf
oft send task
nazreen 679f5fb
use mock
nazreen 0fb0258
mock
nazreen 07af20c
update to include optional introduction
nazreen 9e66911
wording tweak
nazreen a3532d4
simplify to 2
nazreen 0607d8c
add deploy script
nazreen d60399f
revamp readme
nazreen a30e078
amount
nazreen c3fc819
Merge branch 'main' into examples-readme-oft
nazreen 57cac46
fix variable name
nazreen 3c8ae88
rm avalanche
nazreen 67161ce
note on minting
nazreen a3f8f84
sending
nazreen ef06068
oft adapter readme complete
nazreen 2807cfd
update ToC
nazreen 1165dc8
update ToC
nazreen 2446750
update term to Enable Messsaging
nazreen d9ab6e9
README
nazreen 2702884
oft-upgradeable send tasks and simple config generator
nazreen 4cc8d3c
update
nazreen d9ab744
rm unneeded
nazreen 0df58e9
lint
nazreen ba6cc3b
lint
nazreen c4b8bea
eslint error
nazreen a8f72a0
rename to SPECS
nazreen 61518a8
fix lint
nazreen 42f18f4
lockfile
nazreen 941b765
update specs
nazreen 8c6a47f
fix
nazreen d15d846
try docs as workspace package
nazreen 3c454e1
fix
nazreen cfa7579
fix line
nazreen befb36b
fix
nazreen 1748b13
typo
nazreen 87a5b0f
fix README lints
nazreen 5f92527
use pnpm exec for prettier
nazreen 91070c0
lint fixes
nazreen a6298f5
Revert "lint fixes"
nazreen 7c2964a
apply exec at top level lint-staged
nazreen a442b09
lint fix
nazreen 2b2930c
reorder
nazreen ca285d8
try removing pnpm exec
nazreen 66f0cde
reduce to 2 chains
nazreen 9b76d41
single quotes
nazreen c15dbe8
update instructions
nazreen ee0d30d
typo
nazreen 2830f6f
changesets
nazreen b2176f7
revert
nazreen 22f4b43
reformat
nazreen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| This document is intended for the maintainers of the examples that are in `/examples` in this repo. It is also meant as a guide for coding agents for the purposes of reviewing or editing. | ||
|
|
||
| Currently, this document will only detail the structure for the READMEs of the examples. | ||
|
|
||
| ## 1. README Structure | ||
|
|
||
| 1. **Header** | ||
| - Goal: Branding + promote docs site + entrypoint | ||
| - Contents: LayerZero logo + links to docs and dev portal | ||
|
|
||
| 2. **Example Title** | ||
| - Goal: What the example will teach | ||
| - Contents: Title + 1–2 sentence goal-style description | ||
|
|
||
| 3. **Table of Contents** | ||
| - Goal: Allow user to easily navigate the README | ||
| - Contents: TOC of all headings | ||
|
|
||
| 4. **Prerequisite Knowledge** | ||
| - Goal: What to understand before running the example | ||
| - Contents: e.g., What is an OApp? What is an OFT? | ||
|
|
||
| 5. **Introduction** _(optional)_ | ||
| - Goal: High-level context on what this example covers | ||
| - Contents: Brief explanation; skip if title + prerequisites suffice | ||
|
|
||
| 6. **Requirements** | ||
| - Goal: What needs to be installed | ||
| - Contents: Tools + versions; optionally call out testnet funding needs | ||
|
|
||
| 7. **Scaffold this example** | ||
| - Goal: How to initialize the example | ||
| - Contents: `pnpm dlx create-lz-oapp@latest --example <name>` | ||
|
nazreen marked this conversation as resolved.
Outdated
|
||
|
|
||
| 8. **Helper Tasks (inline notice)** | ||
| - Goal: Let users know helpers exist | ||
| - Contents: Single-line pointer to helper tasks section | ||
|
|
||
| 9. **Setup** | ||
| - Goal: What to configure before building | ||
| - Contents: `.env` setup, deployer account prep | ||
|
|
||
| 10. **Build** | ||
| - Goal: How to compile contracts/programs/modules | ||
| - Contents: Build commands | ||
|
|
||
| 11. **Deploy** | ||
| - Goal: How to deploy contracts/programs/modules | ||
| - Contents: Deploy command + minting instructions (if applicable) | ||
|
|
||
| 12. **Enable Messaging** | ||
| - Goal: How to wire/configure OApps for messaging | ||
| - Contents: LZ config, init, and wiring steps | ||
|
|
||
| 13. **Sending Message/OFT/ONFT** | ||
| - Goal: Trigger a cross-chain action | ||
| - Contents: Send command(s), both/all directions | ||
|
|
||
| 14. **Next Steps** | ||
| - Goal: What to know after completing the deployment | ||
| - Contents: Production Deployment Checklist + links (Security Stack, Message Options) | ||
|
|
||
| 15. **Production Deployment Checklist** | ||
| - Goal: Prep for production usage | ||
| - Contents: Gas profiling, DVN config, confirmation settings | ||
|
|
||
| 16. **Appendix** | ||
| - Goal: Mark end of core deployment steps | ||
| - Contents: Additional topics and configuration | ||
|
|
||
| 16.1. **Running tests** | ||
| - Goal: How to test contracts/programs | ||
| - Contents: Test commands | ||
|
|
||
| 16.2. **Adding other chains** | ||
| - Goal: Expand the example to more networks | ||
| - Contents: Add logic, update `hardhat.config.ts` | ||
|
|
||
| 16.3. **Using Multisigs** | ||
| - Goal: Deploy using a multisig wallet | ||
| - Contents: Command param diffs, multi-VM notes | ||
|
|
||
| 16.4. **LayerZero Hardhat Helper Tasks (detailed)** | ||
| - Goal: Understand all helper tasks | ||
| - Contents: Link to docs + list of built-in and local tasks | ||
|
|
||
| 16.5. **Contract/Program Verification** | ||
| - Goal: Verify deployments | ||
| - Contents: VM-specific verification docs | ||
|
|
||
| 16.6. **Troubleshooting** | ||
| - Goal: Resolve errors and setup issues | ||
| - Contents: Link to general troubleshooting + local fixes | ||
|
|
||
| --- | ||
|
|
||
| ## 2. README Principles | ||
|
|
||
| 1. Example READMEs should focus on required commands, with elaborations linked to docs. | ||
| 2. Avoid duplicating explanations of general concepts (e.g., OFTs)—link to docs instead. | ||
| 3. The first mention of concepts like Endpoint IDs, Wiring, etc. should link to the glossary: https://docs.layerzero.network/v2/home/glossary | ||
| 4. TODO: Every README should invite partners to provide feedback to drive improvements. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Example Code Principles | ||
|
|
||
| 1. **Options-first**: Enforced Options implementation and instructions should be included by default (e.g. in `layerzero.config.ts`). | ||
| 2. **Two chains only**: Examples should use only 2 chains by default to reduce testnet setup friction; use “Add other chains” section to scale up if needed. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| Any sections that don't appear in the above list should be considered for removal. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "@layerzerolabs/devtools-docs", | ||
| "version": "0.0.1", | ||
| "private": true, | ||
| "description": "Documentation for LayerZero devtools", | ||
| "scripts": { | ||
| "build": "echo 'No build needed for docs'", | ||
| "clean": "echo 'No clean needed for docs'", | ||
| "lint": "echo 'No lint needed for docs'", | ||
| "test": "echo 'No tests for docs'" | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.