Skip to content
Merged
Show file tree
Hide file tree
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 Jun 30, 2025
cba33e1
lint
nazreen Jun 30, 2025
58c69c6
amend
nazreen Jul 1, 2025
b55242e
add deploy script for MyOFTMock
nazreen Jul 1, 2025
8cbf960
reduce mesh to 2 chains
nazreen Jul 1, 2025
bbcfc17
fix typos, use pnpm
nazreen Jul 1, 2025
8f4abe4
ToC
nazreen Jul 1, 2025
1531986
readme
nazreen Jul 1, 2025
8c0ebbf
oft send task
nazreen Jul 2, 2025
679f5fb
use mock
nazreen Jul 2, 2025
0fb0258
mock
nazreen Jul 2, 2025
07af20c
update to include optional introduction
nazreen Jul 2, 2025
9e66911
wording tweak
nazreen Jul 2, 2025
a3532d4
simplify to 2
nazreen Jul 2, 2025
0607d8c
add deploy script
nazreen Jul 2, 2025
d60399f
revamp readme
nazreen Jul 2, 2025
a30e078
amount
nazreen Jul 2, 2025
c3fc819
Merge branch 'main' into examples-readme-oft
nazreen Jul 2, 2025
57cac46
fix variable name
nazreen Jul 2, 2025
3c8ae88
rm avalanche
nazreen Jul 2, 2025
67161ce
note on minting
nazreen Jul 2, 2025
a3f8f84
sending
nazreen Jul 2, 2025
ef06068
oft adapter readme complete
nazreen Jul 2, 2025
2807cfd
update ToC
nazreen Jul 2, 2025
1165dc8
update ToC
nazreen Jul 2, 2025
2446750
update term to Enable Messsaging
nazreen Jul 2, 2025
d9ab6e9
README
nazreen Jul 2, 2025
2702884
oft-upgradeable send tasks and simple config generator
nazreen Jul 2, 2025
4cc8d3c
update
nazreen Jul 2, 2025
d9ab744
rm unneeded
nazreen Jul 2, 2025
0df58e9
lint
nazreen Jul 2, 2025
ba6cc3b
lint
nazreen Jul 2, 2025
c4b8bea
eslint error
nazreen Jul 3, 2025
a8f72a0
rename to SPECS
nazreen Jul 3, 2025
61518a8
fix lint
nazreen Jul 3, 2025
42f18f4
lockfile
nazreen Jul 3, 2025
941b765
update specs
nazreen Jul 3, 2025
8c6a47f
fix
nazreen Jul 3, 2025
d15d846
try docs as workspace package
nazreen Jul 3, 2025
3c454e1
fix
nazreen Jul 3, 2025
cfa7579
fix line
nazreen Jul 3, 2025
befb36b
fix
nazreen Jul 3, 2025
1748b13
typo
nazreen Jul 3, 2025
87a5b0f
fix README lints
nazreen Jul 3, 2025
5f92527
use pnpm exec for prettier
nazreen Jul 3, 2025
91070c0
lint fixes
nazreen Jul 3, 2025
a6298f5
Revert "lint fixes"
nazreen Jul 3, 2025
7c2964a
apply exec at top level lint-staged
nazreen Jul 3, 2025
a442b09
lint fix
nazreen Jul 3, 2025
2b2930c
reorder
nazreen Jul 3, 2025
ca285d8
try removing pnpm exec
nazreen Jul 4, 2025
66f0cde
reduce to 2 chains
nazreen Jul 4, 2025
9b76d41
single quotes
nazreen Jul 4, 2025
c15dbe8
update instructions
nazreen Jul 4, 2025
ee0d30d
typo
nazreen Jul 4, 2025
2830f6f
changesets
nazreen Jul 4, 2025
b2176f7
revert
nazreen Jul 4, 2025
22f4b43
reformat
nazreen Jul 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Welcome to the **LayerZero Developer Tools Hub**. This repository houses everyth
Visit our <a href="https://docs.layerzero.network/" style="color: #a77dff">developer docs</a> to get started building omnichain applications.

## Repository Structure

The primary folders that smart contract developers will find most useful are:

`examples/`: Contains various example projects demonstrating how to build with `OApp.sol` (Omnichain App Standard), `OFT.sol` (Omnichain Fungible Tokens), `ONFT.sol` (Omnichain Non-Fungible Tokens), and more. These examples serve as templates and learning resources.
Expand Down Expand Up @@ -88,7 +89,7 @@ pnpm build

This will build all the packages and examples in the repository.

Review the README for each individual `examples/` project to learn how to interact with and use each sample project.
Review the README for each individual `examples/` project to learn how to interact with and use each sample project.

## Contributing

Expand Down
115 changes: 115 additions & 0 deletions docs/EXAMPLES_SPECS.md
Comment thread
nazreen marked this conversation as resolved.
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>`
Comment thread
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.
12 changes: 12 additions & 0 deletions docs/package.json
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'"
}
}
5 changes: 1 addition & 4 deletions examples/mint-burn-oft-adapter/tasks/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { createLogger } from '@layerzerolabs/io-devtools'
import { endpointIdToNetwork } from '@layerzerolabs/lz-definitions'
import { Options } from '@layerzerolabs/lz-v2-utilities'

const logger = createLogger()

export const deploymentMetadataUrl = 'https://metadata.layerzero-api.com/v1/metadata/deployments'

/**
Expand All @@ -14,7 +11,7 @@ export async function getBlockExplorerLink(srcEid: number, txHash: string): Prom
const network = endpointIdToNetwork(srcEid) // e.g. "ethereum-mainnet"
const res = await fetch(deploymentMetadataUrl)
if (!res.ok) return
const all = (await res.json()) as Record<string, any>
const all = (await res.json()) as Record<string, { blockExplorers?: { url: string }[] }>
const meta = all[network]
const explorer = meta?.blockExplorers?.[0]?.url
if (explorer) {
Expand Down
Loading