Skip to content

Instantly share code, notes, and snippets.

@nazreen
Last active October 27, 2025 09:50
Show Gist options
  • Select an option

  • Save nazreen/1322b8d2784df865d8fcd90ae6338b43 to your computer and use it in GitHub Desktop.

Select an option

Save nazreen/1322b8d2784df865d8fcd90ae6338b43 to your computer and use it in GitHub Desktop.
Recover Instructions

Terms

  • Current repo - the existing repo in which the Base and Solana deployments are hosted in
  • Rescue repo - a new repo that you will be guided to create below
  • BASE_NETWORK_NAME - the name used in the Current repo's hardhat.config.ts, which is also the subfolder name under `/deployments' in the Current repo
  • Original Solana OFT - the one mistakenly created with 18 decimals
  • New Solana OFT - the new one, created with 9 decimals

Rescue Repo

  • Init a repo using the EVM only OFT template: npx create-lz-oapp@latest --example oft
    • when prompted to select an example, select OFT
  • open the OFT repo
  • set up the .env file with your EVM private key
  • (the following instructions are partially based on the ones in /docs/simple-workers/SIMPLE_WORKERS_GUIDE.md)
  • (still in the OFT repo), create a /deployments folder
  • From your existing repo, copy over the /deployments folder into the new OFT repo
  • note the full name of the Base folder in /deployments, we need it for the following steps. It's either base-mainnet or something else.
  • now we need to add Base Mainnet into the Hardhat config and LZ config files.
  • in hardhat.config.ts, under networks, change base-sepolia to following:
    '<BASE_FOLDER_NAME>': {
        eid: EndpointId.BASE_V2_MAINNET,
        url: 'https://base.gateway.tenderly.co',
        accounts,
    },
    
    • where <BASE_FOLDER_NAME> is the full name of the base folder under /deployments
    • optionally, remove the arbitrum-sepolia entry completely, to streamline.
  • in layerzero.config.ts, update the baseContract variable to be as following:
    const baseContract: OmniPointHardhat = {
        eid: EndpointId.BASE_V2_MAINNET,
        contractName: '<BASE_CONTRACT_NAME>', // Note: change this to 'MyOFT' or your production contract name
    }
    
    • <BASE_CONTRACT_NAME> should be the same as the name of the .json file under the Base deployment folder under /deployments. E.g. if you have /deployments/base-mainnet/Common.json', then you it should be Common`
    • optionally, remove the arbitrumContract variable entirely
  • deploy the Rescue DVN by running npx hardhat lz:deploy --tags SimpleDVNMock. Ensure you select base mainnet when prompted. The tag should be SimpleDVNMock
  • Run npx hardhat lz:simple-workers:set-receive-config --contract-name <BASE_CONTRACT_NAME> --src-eid 30168 --network <BASE_NETWORK_NAME>
  • Time to recover the tokens
  • Important: verify that the total number of tokens to be recovered is 20110897. If this number is not correct, replace it in the following command.
  • Run the following:
    npx hardhat lz:simple-workers:process-receive \
    --src-eid 30168 \
    --dst-eid 30184 \
    --dst-contract-name <BASE_CONTRACT_NAME> \
    --src-oapp F1huZi6gX6aUx4hdkoDSfyx3fhaUH5qzsjuF8FNPGMJL \
    --nonce 3 \
    --to-address <ADDRESS_TO_SEND_RECOVERED_TOKENS_TO> \
    --amount 20110897 \
    --network <BASE_NETWORK_NAME> \
    

Current repo

NOTE: THIS ASSUMES THAT THE CURERENT REPO ALREADY HAS THE NEW SOLANA OFT AND THE ORIGINAL SOLANA OFT'S DEPLOYMENT IS NO LONGER PRESENT. If this is not the case, please inform me (Nazreen) so I can update these instructions.

  • Time to wire to the new peer and restore the Base-Solana config to the original DVNs. Run:
npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts

Since we never modified the LZ Config or Hardhat Config in the Current repo, the above step should be sufficient. No modifications to Hardhat Config or LZ Config are necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment