This is instructions set 1 of 3.
- Upload Base and BNB deployments folders into /deployments in the ape-solana repo (only base-mainnet and bsc-mainnet are needed)
- In hardhat.config.ts, add the following into
config.networks:
'base-mainnet': {
eid: EndpointId.BASE_V2_MAINNET,
url: process.env.RPC_URL_BASE_MAINNET || 'https://base.gateway.tenderly.co',
accounts,
},
'bsc-mainnet': {
eid: EndpointId.BSC_V2_MAINNET,
url: process.env.RPC_URL_BSC_MAINNET || 'https://bsc.drpc.org',
accounts,
},
-
In layerzero.config.ts, add the following,
3a - contract instances:
const bnbContract: OmniPointHardhat = { eid: EndpointId.BSC_V2_MAINNET, contractName: 'ApeOFT', } const baseContract: OmniPointHardhat = { eid: EndpointId.BASE_V2_MAINNET, contractName: 'ApeOFT', }3b - Enforced Options variables:
const TO_BNB_MAINNET_ENFORCED_OPTIONS: OAppEnforcedOption[] = [ { msgType: 1, optionType: ExecutorOptionType.LZ_RECEIVE, gas: 100_000, value: 0, }, ] const TO_BASE_MAINNET_ENFORCED_OPTIONS: OAppEnforcedOption[] = [ { msgType: 1, optionType: ExecutorOptionType.LZ_RECEIVE, gas: 100_000, value: 0, }, ]3c
generateConnectionsConfig'sconnections:// then in generateConnectionsConfig, add the following into the array [ bnbContract, // Chain A contract solanaContract, // Chain B contract [['LayerZero Labs', 'Horizen'], []], // [ requiredDVN[], [ optionalDVN[], threshold ] ] [20, 32], // [A to B confirmations, B to A confirmations] [TO_SOLANA_ENFORCED_OPTIONS, TO_BNB_MAINNET_ENFORCED_OPTIONS], // Chain B enforcedOptions, Chain A enforcedOptions ], [ baseContract, // Chain A contract solanaContract, // Chain B contract [['LayerZero Labs', 'Horizen'], []], // [ requiredDVN[], [ optionalDVN[], threshold ] ] [10, 32], // [A to B confirmations, B to A confirmations] [TO_SOLANA_ENFORCED_OPTIONS, TO_BASE_MAINNET_ENFORCED_OPTIONS], // Chain B enforcedOptions, Chain A enforcedOptions ],3d -
generateConnectionsConfig'scontractsarray:{ contract: bnbContract }, { contract: baseContract }, -
In the repo root, create a new file named
convertTxnData.tsand paste the following as its content:import fs from 'fs' import bs58 from 'bs58' // Get filename from command line argument const [, , fileName] = process.argv if (!fileName) { console.error('❌ Usage: pnpm ts-node convertTxnData.ts <JSON_FILENAME>') process.exit(1) } // Read and parse JSON file const input = JSON.parse(fs.readFileSync(fileName, 'utf8')) // Loop through entries for (const entry of input) { const { point, data } = entry if (point?.eid === 30168 && typeof data === 'string') { const hex = data.startsWith('0x') ? data.slice(2) : data if (hex.length % 2 !== 0) { throw new Error(`Invalid hex string for eid ${point.eid}`) } const bytes = Uint8Array.from(hex.match(/.{2}/g)!.map((b) => parseInt(b, 16))) entry.data = bs58.encode(bytes) } } // Write to output file (same name with `_converted.json`) const outputFile = fileName.replace(/\.json$/, '') + '_converted.json' fs.writeFileSync(outputFile, JSON.stringify(input, null, 2)) console.log(`✅ Converted entries with eid 30168 to Base58 and saved as ${outputFile}`)We will use this script to convert the txn data (to base58) for Solana transactions as devtools outputs all txn data in hex format but Squads expects them in base58.
-
Run init-config -
npx hardhat lz:oft:solana:init-config --oapp-config layerzero.config.ts --multisig-key GPuMML3FeJXTr948CvTwSYANHm74RSW5iUibw5T6vSfa --output-filename base-bnb-init-config-txns.json- When asked to preview txns, you can choose Y or just terminate the process immediately, as at this point,
base-bnb-init-config-txns.jsonwould have already been generated. If asked " Would you like to submit the required transactions?", just respond with 'N' to terminate the process as you should proceed with manually pasting in the txn data into the Squads UI. - Note: the txn data are in Hex, but we need them to be in base58 in order to import into Squads UI.
- 5a. Now, run
pnpm ts-node convertTxnData.ts base-bnb-init-config-txns.json - 5b. Open up
base-bnb-init-config-txns_converted.jsonto view the 2 txns. - 5c. Copy the
data, import into the Squads UI and execute the txn.
- When asked to preview txns, you can choose Y or just terminate the process immediately, as at this point,
-
Run wire -
npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts --multisig-key GPuMML3FeJXTr948CvTwSYANHm74RSW5iUibw5T6vSfa --output-filename base-bnb-wire-txns.json- Note: for the txns that are for Solana (eid: 30168), the txn data are in Hex, but we need them to be in base58 in order to import into Squads UI.
- When asked to preview txns, you can choose Y or just terminate the process immediately, as at this point,
base-bnb-wire-txns.jsonwould have already been generated. If asked " Would you like to submit the required transactions?", just respond with 'N' to terminate the process as you should proceed with manually pasting in the txn data into the Squads UI. - 6a. Now, run
pnpm ts-node convertTxnData.ts base-bnb-wire-txns.json - 6b. Open up
base-bnb-wire-txns_converted.jsonto view the txns. - 6c. Identify the Solana txns, they are the ones with
eidvalue of30168- copy thedata, import into the Squads UI and execute the txn. - 6d. Identify the Ape txns, they are the ones with
eidvalue of30312- execute them via the Safe Multisig UI. - 6e. Identify the Arbitrum txns, they are the ones with
eidvalue of30110- execute them via the Safe Multisig UI. - 6f. Identify the Base txns, they are the ones with
eidvalue of30184- execute them via the Safe Multisig UI. - 6g. Identify the BNB txns, they are the ones with
eidvalue of30102- execute them via the Safe Multisig UI. - 6h. Identify the Hyperliquid txns, they are the ones with
eidvalue of30367- execute them via the Safe Multisig UI.