Skip to content

Conversation

@nazreen
Copy link
Contributor

@nazreen nazreen commented Jan 23, 2026

Solana OFT debug script: state that value 0 for confirmations means 'use default'

Closes DEVREL-1238

When running:

npx hardhat lz:oft:solana:debug --eid <eid> --dst-eids <dst-eids>  

Before:

           confirmations: 0                                        

After:

           confirmations: 0 (Use Pathway Defaults)

Solana OFT - updateMetadata script supports Token-2022 Metadata Update

Closes DEVREL-1239

Problem

  • lz:oft:solana:update-metadata only supported Metaplex metadata, not Token-2022.

Solution

  • Auto-detect metadata type: SPL Token → Metaplex; Token-2022 → probe Metaplex first, else Token Extensions.
  • Add updateTokenExtensionsMetadata() with authority validation and rent handling for multisig.

Changes

  • updateMetadata.ts: Auto-detect and support Token-2022 metadata with authority checks and rent top-up.

Example Run

pnpm hardhat lz:oft:solana:update-metadata --eid 40168 --mint <MINT> --name "New Name"

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 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 #6661 - Passed - 2026-01-29 16:57 (UTC)
  • Run #6628 - Passed - 2026-01-23 22:05 (UTC)

@nazreen nazreen requested review from fabianhug and lzJxhn January 29, 2026 17:09
@nazreen nazreen marked this pull request as ready for review January 29, 2026 17:09
@cursor
Copy link

cursor bot commented Jan 29, 2026

PR Summary

Medium Risk
Adds new Token-2022 metadata update flow (including authority checks and rent top-ups) and changes how update transactions are constructed/sent, which could affect on-chain behavior if mis-detected. Other changes are minor UX tweaks to scripts and deployment-file handling.

Overview
Extends lz:oft:solana:update-metadata to auto-detect SPL vs Token-2022 mints and update metadata via Metaplex when a metadata PDA exists, otherwise via Token Extensions (with update-authority validation, optional multisig/base58 output for Squads, and rent top-up handling when metadata grows).

Tweaks lz:oft:solana:debug to explicitly label confirmations: 0 as "Use Pathway Defaults", and adjusts getOftStoreAddress to return null silently when deployments/.../OFT.json doesn’t exist (expected during create) while still warning on malformed files. Also bumps @layerzerolabs/hyperliquid-composer in the Hyperliquid example lockfile and adds changesets for these patches.

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

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 (instructions.length === 0) {
throw new Error('At least one of --name, --symbol, or --uri must be provided')
}
Copy link

Choose a reason for hiding this comment

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

Validation check bypassed when rent transfer added first

Medium Severity

The instructions.length === 0 validation check in updateTokenExtensionsMetadata is performed after the rent transfer instruction may have already been added to the instructions array. Due to the 100-byte buffer in estimatedNewSize, additionalLamports is often positive even when no metadata fields are provided. This causes the validation to pass when it should fail, resulting in a transaction that only transfers lamports without updating any metadata fields. The user would see a successful transaction but no metadata would be changed.

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