Skip to content

Conversation

@nazreen
Copy link
Contributor

@nazreen nazreen commented Jan 16, 2026

There should be a helper to go from endpoint id to network name

Problem

  • No public utility to go from endpoint ID to chain ID, though there is one for going from endpoint ID to network name
  • getDefaultChainId (from network name to chain ID) exists in verify-contract but wasn't exported

Changes

  • Export getDefaultChainId from @layerzerolabs/verify-contract (one keyword change)

Notes

  • Somehow we only store the mapping between chainkey and chain ID in the verify-contract package
  • The best place imo to export a helper for eid -> chainId is lz-definitions but that package is in monorepo, not in devtools. Easier to make the change here. Also, lz-definitions does not currently have chainkey<>chainId mapping

How to use

import { getDefaultChainId } from '@layerzerolabs/verify-contract'                                            
                                                                                                                
getDefaultChainId('ethereum-mainnet')  // 1                                                                   
getDefaultChainId('polygon-mainnet')   // 137                                                                 
getDefaultChainId('hyperevm-mainnet')  // 999 

--only-oft-store should be a flag, not param

Problem

  • --only-oft-store required passing true as a value, which is verbose for a boolean flag.

Changes

  • Converted --only-oft-store from boolean param to a flag in createOFT.ts and setAuthority.ts
    across oft-solana and lzapp-migration examples.
  • Updated error messages, prompts, and README docs to use --only-oft-store (no true).

Solana OFT: Prompts should respect --ci flag

Problem

  • Several prompts in oft-solana tasks ignored the --ci flag, requiring manual confirmation even in CI mode.

Changes

  • createOFT.ts: Wrapped confirmMaxSupply and continueFreezeAuthority prompts with if (!ci) checks.
  • createOFTAdapter.ts: Added --ci flag and wrapped confirmMaxSupply prompt.
  • setUpdateAuthority.ts: Added --ci flag and wrapped doContinue prompt.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

🧪 E2E Test Status

E2E tests are non-blocking and validate real blockchain interactions. Failures may occur due to network issues, RPC rate limits, or external service downtime.

Test Runs (Newest First):

  • Run #6625 - Passed - 2026-01-23 01:43 (UTC)
  • Run #6607 - Passed - 2026-01-22 01:42 (UTC)
  • Run #6604 - Passed - 2026-01-21 23:56 (UTC)
  • Run #6571 - Passed - 2026-01-16 23:33 (UTC)

@nazreen
Copy link
Contributor Author

nazreen commented Jan 20, 2026

will collapse this into another PR

@nazreen nazreen changed the title param to flag QoL batch 2 Jan 21, 2026
@nazreen nazreen changed the title QoL batch 2 DEVREL-1240 QoL batch 2 Jan 23, 2026
@nazreen nazreen marked this pull request as ready for review January 29, 2026 01:04
@cursor
Copy link

cursor bot commented Jan 29, 2026

PR Summary

Low Risk
Mostly CLI ergonomics and documentation updates; risk is limited to changed task argument parsing and skipping confirmations when --ci is used.

Overview
Improves Solana OFT Hardhat task UX and automation. --only-oft-store is converted from a boolean param requiring true to a proper flag across the Solana OFT create/set-authority tasks (and corresponding READMEs), with updated validation/error messaging.

CI/non-interactive flows are fixed by gating confirmation prompts behind --ci in the Solana OFT tasks (notably max-supply and freeze-authority confirmations, plus adding --ci support to the OFT adapter create task and update-authority task). Separately, @layerzerolabs/verify-contract now exports getDefaultChainId for external consumers.

Written by Cursor Bugbot for commit 7ac1ffd. This will update automatically on new commits. Configure here.

@nazreen nazreen requested review from fabianhug and lzJxhn January 29, 2026 01:05
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.


if (onlyOftStore && !ci) {
const continueWithOnlyOftStore = await promptToContinue(
`You have chosen \`--only-oft-store true\`. This means that only the OFT Store will be able to mint new tokens${freezeAuthorityStr ? '' : ' and that the Freeze Authority will be immediately renounced'}. Continue?`
Copy link

Choose a reason for hiding this comment

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

CI flag not respected for prompts in lzapp-migration

Medium Severity

The --ci flag is defined in examples/lzapp-migration/tasks/solana/createOFT.ts but the confirmMaxSupply and continueFreezeAuthority prompts do not check it. These prompts will block execution even when --ci is passed, preventing automated CI workflows. The equivalent file in examples/oft-solana/tasks/solana/createOFT.ts correctly wraps these prompts with if (!ci) checks.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant