- Rust
v1.75.0
- Anchor
v0.29
- Solana CLI
v1.17.31
- Docker
- Node.js
We recommend using pnpm
as a package manager, but you can use any package manager of your choice.
Docker is required for building with Anchor. Ensure you have the latest Docker version to avoid issues.
0.29
and Solana version 1.17.31
to compile the build artifacts. Using higher versions may cause unexpected issues. See these issues in Anchor's repo: Issue 1, Issue 2.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
sh -c "$(curl -sSfL https://release.solana.com/v1.17.31/install)"
cargo install --git https://github.com/coral-xyz/anchor --tag v0.29.0 anchor-cli --locked
pnpm install
Note: test includes default LayerZero OFT test with OFT Mock contract.
forge test
solana airdrop 5 -u devnet
Use the official Solana faucet if needed.
cp .env.example .env
Also set RPC_URL_SOLANA_TESTNET
(reffers to Solana Devnet for consistency with EVM testnets).
pnpm hardhat morpheus:setup:anchor:keys
--force
, which overwrites existing keys.
View the generated program ID:
anchor keys list
Ensure Docker is running before building.
pnpm hardhat morpheus:anchor:build:verifiable
pnpm hardhat morpheus:solana:deploy:rent
Example output:
Rent-exempt minimum: 3.87415872 SOL
pnpm hardhat morpheus:anchor:deploy:verifiable
pnpm hardhat morpheus:solana:create-squads # Takes keypair path from `.env` by default.
pnpm hardhat morpheus:oft:solana:create
--additional-minters <YOUR_SOLANA_PUBLIC_KEY>
.
Check layerzero.config.ts
and ensure only the address
for Solana is specified. Do not specify addresses for EVM chain contracts.
pnpm hardhat lz:deploy
Note: token has 18 decimals.
cast send <TOKEN_ADDRESS> "mint(address,uint256)" <RECIPIENT> 1000000000000000000000 --private-key <EVM_PRIVATE_KEY> --rpc-url wss://arbitrum-sepolia-rpc.publicnode.com
Since the LayerZero CLI does not load the private key automatically, you need to set it explicitly. Use the following command to provide your private key:
npx hardhat morpheus:solana:base-58
Also pass MOROFT_ID
from .env
as param explicitly.
pnpm hardhat lz:oapp:init:solana --oapp-config layerzero.config.ts --solana-secret-key <SECRET_KEY> --solana-program-id <MOROFT_ID>
<SECRET_KEY>
should be in base58 format.
pnpm hardhat lz:oapp:wire --oapp-config layerzero.config.ts --solana-secret-key <PRIVATE_KEY> --solana-program-id <PROGRAM_ID>
layerzero.config.ts
file must include the correct EVM MOROFT contract name that was deployed using the PRIVATE_KEY
specified in the .env
file here:
const sepoliaContract: OmniPointHardhat = {
eid: EndpointId.ARBSEP_V2_TESTNET,
contractName: "<MOROFT_CONTRACT_NAME>",
};
Note: 9 decimals for Solana. Amount is in lamports.
pnpm hardhat --network arbsep-testnet morpheus:evm:send --amount 1000000000 --to <TO_SOLANA_ADDRESS>
No Contract deployed with name
, ensure tokenName
in tasks/evm/send.ts
matches the deployed contract name.
pnpm hardhat morpheus:oft:solana:send --amount 1000000000 --to <TO_EVM_ADDRESS>