This repository creates and launches the same fungible token on Solana and BSC, and wires them together with LayerZero OFT (Omnichain Fungible Token) so users can bridge between the two chains.
The stack includes:
- Meteora Dynamic Bonding Curve (DBC) on Solana for creation/liquidity bootstrapping
- A mintable ERC‑20 on BSC with optional PancakeSwap liquidity
- LayerZero OFT contracts and simple scripts for cross‑chain transfer flows
Important: This repo is configured for testnets/dev tooling and includes example endpoints. Always verify current LayerZero endpoint addresses and EIDs in the official docs before mainnet.
- Solana token creation using Meteora DBC (Token‑2022, 6 decimals)
- BSC token deployment (ERC‑20, 6 decimals) with a simple Pancake V2 liquidity example
- LayerZero OFT bridging BSC ↔ Solana (burn/mint model)
- End‑to‑end script that creates on both chains and sets up bridging
├── contracts/
│ ├── BSC_OFT.sol # EVM OFT token for BSC
│ └── Solana_OFT.sol # Placeholder EVM-side Solana OFT (for parity)
├── solana-program/
│ └── src/lib.rs # Anchor program skeleton for Solana-side OFT logic
├── deploy/
│ ├── bsc-oft-deploy.ts # Deploys BSC OFT contract
│ └── solana-oft-deploy.ts # Initializes Solana OFT program state
├── bridge/
│ └── layerzero-bridge.ts # Example bridging flows using deployed artifacts
├── index.ts # Solana DBC creation (Meteora)
├── pancake-launch.ts # BSC ERC-20 + Pancake example
├── integrated-launch.ts # Orchestrates creation + bridging setup
└── metadata.json # Token metadata (name, symbol, etc.)
- Node.js 18+
- TypeScript toolchain
ts-node/ts-node-dev- Git + a code editor
- Solana CLI wallet funded on Devnet
- BSC Testnet wallet funded with tBNB
npm installCreate a .env file at project root with your keys:
# Solana (base58-encoded secret key for a Keypair)
PRIVATE_KEY=base58_of_your_solana_secret_key
# BSC (0x-prefixed hex private key)
BSC_PRIVATE_KEY=0xabc123...
Tips:
PRIVATE_KEYshould be the base58 exported secret key (not the pubkey). You can export from a local~/.config/solana/id.jsonusing a converter or usebs58to encode a Uint8Array secret key.- Ensure both wallets are funded: devnet SOL on Solana and tBNB on BSC Testnet.
Edit metadata.json to your token’s name/symbol and optional fields:
{
"name": "Your Token Name",
"symbol": "YTN",
"description": "Your token description",
"image": "https://example.com/token-image.png"
}Decimals are fixed to 6 in both chains in this template.
- Create Solana token with Meteora DBC only:
npm start- Create BSC token and attempt Pancake liquidity example:
ts-node pancake-launch.ts- Deploy BSC LayerZero OFT contract:
npm run deploy:bsc- Initialize Solana OFT program state (Anchor-less skeleton):
npm run deploy:solana- Run a sample bridge flow helper (reads deployments in
deployments/):
npm run bridge- End‑to‑end orchestration (create on both chains + OFT deploy + example bridge):
npm run start integrated-launch.tsArtifacts are written to:
deployments/bsc-oft-deployment.jsondeployments/solana-oft-deployment.json
This repo includes placeholders for LayerZero endpoints and EIDs to demonstrate flows. Before production, confirm the following in LayerZero’s official docs:
- Endpoint addresses per chain/network (Testnet/Mainnet)
- Endpoint IDs (EIDs) used by OFT
sendcalls - Required adapter params and fee quoting for cross‑chain messages
In deploy/bsc-oft-deploy.ts:
- Update
LAYERZERO_ENDPOINTS[97]to the current BSC Testnet endpoint
In bridge/layerzero-bridge.ts:
- Replace example EIDs (
[101], etc.) with correct values for your target networks - Provide proper adapter params and fee payment as per LayerZero v2 docs
Implemented here:
- EVM OFT token for BSC (
contracts/BSC_OFT.sol) - Scripts to deploy and store addresses
- A Solana Anchor program skeleton with mint/burn entrypoints (no on-chain LayerZero integration yet)
- Example bridging script that demonstrates the intended flow shape
You must finalize before production:
- Wire the Solana program to LayerZero’s Solana SDK (Endpoint CPI, packet verification, message processing). See LayerZero Solana docs for v2.
- Replace placeholder endpoint addresses/EIDs with real ones for your networks
- Add robust fee quoting on EVM and Solana sides
- Add access controls and pausable guards as needed
- Deploy BSC OFT and initialize Solana OFT state:
npm run deploy:bsc
npm run deploy:solana-
Check the saved artifacts in
deployments/. -
Try the sample send from BSC → Solana:
npm run bridgeNotes:
- The sample uses nominal fees and placeholder EIDs; update for real execution.
- On Solana, the current program is a skeleton and will not process LayerZero packets until you complete the integration.
- Verify the BSC contract on BscScan (manual or a Hardhat/Foundry setup)
- Track transactions:
- BSC:
https://testnet.bscscan.com/ - Solana:
https://solscan.io/?cluster=devnet
- BSC:
- Log/store bridge events and tx hashes for monitoring
- Ownable roles restricted; consider multi‑sig for
owner - Consider pausable stops for send/receive
- Validate destination addresses and supported chains
- Rate‑limit or cap bridge amounts
- Monitor LayerZero endpoint fee changes
- Thoroughly test with fuzz/unit tests before mainnet
- "Insufficient funds" on BSC: fund the deployer with tBNB
- "Blockhash not found" on Solana: re-run quickly or increase commitment/timeout
- Contract compile errors: ensure Node 18+,
solcversion matches pragma - Endpoint/EID errors: re-check LayerZero docs; these change over time
- Pancake liquidity add failing: pair may not exist or amounts too small; adjust amounts and gas
- Meteora DBC: https://docs.meteora.ag/
- LayerZero Docs: https://docs.layerzero.network/
- Solana Docs: https://docs.solana.com/
- BscScan Testnet: https://testnet.bscscan.com/
- Solscan Devnet: https://solscan.io/?cluster=devnet
MIT