Skip to content

Commit

Permalink
fix CLI commands instruction in solana (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanL0 authored Dec 3, 2024
1 parent 97c931b commit 2c9d984
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions examples/oft-solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- Rust `v1.75.0`
- Anchor `v0.29`
- Solana CLI `v.1.17.31`
- Solana CLI `v1.17.31`
- Docker
- Node.js

Expand Down Expand Up @@ -165,7 +165,7 @@ This section only applies if you are unable to land your deployment transaction
sh -c "$(curl -sSfL https://release.solana.com/v1.18.26/install)"
```

You can run `npx hardhat solana:get-priority-fees --eid <SOLANA_EID> --address <PROGRAM_ID>` and use the `averageFeeExcludingZeros` value.
You can run `npx hardhat lz:solana:get-priority-fees --eid <SOLANA_EID> --address <PROGRAM_ID>` and use the `averageFeeExcludingZeros` value.

:information_source: The average is calculated from getting the prioritization fees across recent blocks, but some blocks may have `0` as the prioritization fee. `averageFeeExcludingZeros` ignores blocks with `0` prioritization fees.

Expand Down Expand Up @@ -256,7 +256,7 @@ With a squads multisig, you can simply append the `--multisigKey` flag to the en

This is only relevant for **OFT**. If you opted to include the `--amount` flag in the create step, that means you already have minted some Solana OFT and you can skip this section.

:information_source: This is only possible if you specified your deployer address as part of the `--additional-minters` flag when creating the Solana OFT. If you had chosen `--only-oft-store`, you will not be able to mint your OFT on Solana.
:information_source: This is only possible if you specified your deployer address as part of the `--additional-minters` flag when creating the Solana OFT. If you had chosen `--only-oft-store true`, you will not be able to mint your OFT on Solana.

First, you need to create the Associated Token Account for your address.

Expand Down
9 changes: 5 additions & 4 deletions examples/oft-solana/tasks/common/wire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ task(TASK_LZ_OAPP_WIRE)
keyPair,
true
)
// The next (optional) parameter is the OFT program ID
//
// Only pass this if you deployed a new OFT program, if you are using the default
// LayerZero OFT program you can omit this
.addParam('solanaProgramId', 'The OFT program ID to use', undefined, publicKey, true)
.addParam('multisigKey', 'The MultiSig key', undefined, publicKey, true)
// We use this argument to get around the fact that we want to both override the task action for the wiring task
Expand Down Expand Up @@ -87,6 +83,11 @@ task(TASK_LZ_OAPP_WIRE)
// Then we grab the programId from the args
const programId = args.solanaProgramId

if (!programId) {
logger.error('Missing --solana-program-id CLI argument')
return
}

const configurator = args.internalConfigurator

//
Expand Down
4 changes: 3 additions & 1 deletion examples/oft-solana/tasks/solana/createOFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ task('lz:oft:solana:create', 'Mints new SPL Token and creates new OFT Store acco
const { programId, lockBox, escrowPK, oftStorePda, eddsa } = deriveKeys(programIdStr)
if (!additionalMintersAsStrings) {
if (!onlyOftStore) {
throw new Error('If you want to proceed with only the OFTStore, please specify --onlyOFTStore')
throw new Error(
'If you want to proceed with only the OFTStore, please specify --only-oft-store true'
)
}
console.log(
'No additional minters specified. This will result in only the OFTStore being able to mint new tokens.'
Expand Down
4 changes: 3 additions & 1 deletion examples/oft-solana/tasks/solana/setAuthority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ task('lz:oft:solana:setauthority', 'Create a new Mint Authority SPL multisig and
const tokenProgram = publicKey(tokenProgramStr)
if (!additionalMintersAsStrings) {
if (!onlyOftStore) {
throw new Error('If you want to proceed with only the OFTStore, please specify --onlyOFTStore')
throw new Error(
'If you want to proceed with only the OFTStore, please specify --only-oft-store true'
)
}
console.log(
'No additional minters specified. This will result in only the OFTStore being able to mint new tokens.'
Expand Down

0 comments on commit 2c9d984

Please sign in to comment.