Skip to content

DEVREL-549 docs: example READMEs specs + examples/oft README revamp - #1596

Merged
nazreen merged 58 commits into
mainfrom
examples-readme-oft
Jul 4, 2025
Merged

DEVREL-549 docs: example READMEs specs + examples/oft README revamp#1596
nazreen merged 58 commits into
mainfrom
examples-readme-oft

Conversation

@nazreen

@nazreen nazreen commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

This PR

  • introduces a new specs document for Examples, which will initially contain the structure for READMEs
  • revamps the following examples' READMEs based on the new specs:
    • oft
    • oft-adapter
    • oft-upgradeable
    • oapp (WIP)
    • oapp-read (WIP)

Currently depends on #1561 for the lz:oft:send command. Alternatively, revert the example instruction in this PR to not depend on that.

For tests-user/tests/create-lz-oapp.bats (what defines the "User Tests" CI job), the order of commands were changed: pnpm lint:fix moved to before pnpm:lint due to inconsistent README.md linting behavior for examples. This was deemed as acceptable given we have another CI job specifically for linting.

Proof of tests

examples/oft

https://testnet.layerzeroscan.com/tx/0xe1cfc9ac18fae768c1e3ec626695fa403caf1e73db0580f134806ed60e14f950

examples/oft-adapter

https://testnet.layerzeroscan.com/tx/0x7231e3f7df87c69265bb94a7448aac51463ba1b6779b2786ce6a270a0ceb68f4

examples/oft-upgradeable

https://testnet.layerzeroscan.com/tx/0xe10a4e6de4b454dd63fda1c44a7ac2013caf8713a1548dfb82f8a3b0df72dd9a

examples/oapp

https://testnet.layerzeroscan.com/tx/0xc6185188bc62ef04a3918f426d8f0d0abb3d3987e1f0301e620e72320c21fa06

Detailed Changes

examples/oft

  • reduced mesh from 3 chains to 2 chains
  • added missing send instructions

examples/oft-adapter

  • reduced mesh from 3 chains to 2 chains
  • added missing instructions on deploying inner token
  • clarified deploy instructions further to deploy OFTAdapter and OFT separately

examples/oft-upgradeable

  • added missing instructions to scaffold examples
  • applied Simple Config Generator
  • added missing send tasks

examples/oapp

  • added missing import for @layerzerolabs/io-devtools

@nazreen nazreen changed the title docs: example READMEs specs + examples/oft README revamp DEVREL-549 docs: example READMEs specs + examples/oft README revamp Jul 2, 2025
@nazreen
nazreen marked this pull request as draft July 2, 2025 10:07
@nazreen
nazreen requested a review from Copilot July 3, 2025 20:12

This comment was marked as outdated.

@nazreen
nazreen requested a review from Copilot July 4, 2025 09:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new specs document for example READMEs and applies those specs by revamping the READMEs across multiple example projects. It also adjusts CI test scripts, workspace configuration, and adds mock deployment scripts.

  • Add a docs/EXAMPLES_SPECS.md to define example README structure.
  • Revamp README.md files for oft, oft-adapter, oft-upgradeable, oapp, and mint-burn-oft-adapter examples.
  • Update CI tests, workspace, lint-staged configuration, and introduce mock deployment scripts.

Reviewed Changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests-user/tests/create-lz-oapp.bats Adjusted lint steps order in CI tests
pnpm-workspace.yaml Added docs package to workspace
package.json Changed lint-staged to run prettier directly
examples/oft/tasks/utils.ts Removed unused logger import and tightened JSON typing
examples/oft/layerzero.config.ts Reduced mesh to two chains; updated contractName to MyOFTMock
examples/oft/hardhat.config.ts Removed avalanche-testnet network
examples/oft/deploy/MyOFTMock.ts Added mock OFT deploy script
examples/oft/deploy/MyOFT.ts Clarified example network comment
examples/oft/README.md Full README revamp following new specs
examples/oft-upgradeable/tasks/utils.ts Added utility functions with proper typing
examples/oft-upgradeable/layerzero.config.ts Switched to metadata-tools generator and defined pathways
examples/oft-upgradeable/hardhat.config.ts Imported sendOFT task and removed obsolete networks
examples/oft-upgradeable/deploy/MyOFTUpgradeableMock.ts Added upgradeable mock deploy script
examples/oft-upgradeable/README.md Complete README revamp
examples/oft-adapter/tasks/utils.ts Removed unused logger import and tightened JSON typing
examples/oft-adapter/layerzero.config.ts Reduced mesh to two chains; updated pathways
examples/oft-adapter/hardhat.config.ts Removed avalanche-testnet network
examples/oft-adapter/deploy/MyERC20Mock.ts Renamed variables for clarity in mock ERC20 deployment
examples/oft-adapter/README.md Aligned README with new specs
examples/oapp/package.json Added @layerzerolabs/io-devtools dependency
examples/oapp/README.md Full README revamp
examples/mint-burn-oft-adapter/tasks/utils.ts Removed unused logger import and tightened JSON typing
docs/package.json Initialized docs project stub
docs/EXAMPLES_SPECS.md New document defining example README structure
README.md Minor repository structure update
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)

package.json:32

  • Consider using pnpm exec prettier instead of calling prettier directly to ensure the project uses the locally installed version.
      "prettier --write --ignore-unknown",

tests-user/tests/create-lz-oapp.bats:133

  • [nitpick] The compile/test/lint sequence is repeated in multiple tests. Consider extracting it into a helper function to reduce duplication and simplify maintenance.
    pnpm compile

examples/oapp/package.json:26

  • [nitpick] You added @layerzerolabs/io-devtools as a dependency. Ensure it's actually imported and used in this example (e.g., createLogger), or remove it if unused.
    "@layerzerolabs/io-devtools": "~0.2.0",

10xKelly
10xKelly previously approved these changes Jul 4, 2025

@10xKelly 10xKelly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nazreen
nazreen dismissed St0rmBr3w’s stale review July 4, 2025 21:50

feedback resolved, need to merge so hackers for Cannes will get updated README
also briefed IRL to Krak on this PR's changes
main change that needed discussion was switching order of lint:fix and that was agreed upon IRL

@nazreen
nazreen merged commit 870deb2 into main Jul 4, 2025
11 checks passed
@nazreen
nazreen deleted the examples-readme-oft branch July 4, 2025 21:52
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.

5 participants