Skip to content
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

feat(examples/oft-solana): introduce getSolanaDeploymentFunction #1306

Merged
merged 11 commits into from
Feb 21, 2025

Conversation

nazreen
Copy link
Contributor

@nazreen nazreen commented Feb 19, 2025

Motivation

Solana deployments should have a similar devex compared to what is achieved through hardhat-deploy, which is that the deployment values (account addresses) should be auto retrieved and not need manual passing via params.

This PR

  • introduces a getSolanaDeploymentFunction which reads the existing OFT.json under deployments
  • using the new function, obtain the necessary values from the OFT.json, removing the need to manually pass in values such as Solana program ID and mint address

Impact

We get to simplify solana tasks/commands, with the most drastic change being the send (from Solana) script,

from:

npx hardhat lz:oft:solana:send --amount 1000000000 --from-eid 40168 --to $EVM_ADDY --to-eid 40161 --mint <MINT_ADDRESS> --program-id <PROGRAM_ID> --escrow <ESCROW>

to:

npx hardhat lz:oft:solana:send --amount 1000000000 --from-eid 40168 --to $EVM_ADDY --to-eid 40161

Testing

To test, run:

LAYERZERO_EXAMPLES_REPOSITORY_REF=#nazreen/oft-solana-read-prog-id LZ_ENABLE_SOLANA_OFT_EXAMPLE=1 npx create-lz-oapp@latest

Select OFT (Solana)

Proceed as usual; refer to the README diff to see which commands are now simplified.

@nazreen nazreen marked this pull request as ready for review February 19, 2025 16:21
@nazreen nazreen merged commit ce3a36b into main Feb 21, 2025
10 checks passed
@nazreen nazreen deleted the nazreen/oft-solana-read-prog-id branch February 21, 2025 15:14
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.

2 participants