- 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
- Init a repo using the EVM only OFT template:
npx create-lz-oapp@latest --example oft- when prompted to select an example, select
OFT
- when prompted to select an example, select
- open the OFT repo
- set up the
.envfile 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
/deploymentsfolder - From your existing repo, copy over the
/deploymentsfolder into the new OFT repo - note the full name of the Base folder in
/deployments, we need it for the following steps. It's eitherbase-mainnetor something else. - now we need to add Base Mainnet into the Hardhat config and LZ config files.
- in
hardhat.config.ts, undernetworks, changebase-sepoliato 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-sepoliaentry completely, to streamline.
- where
- in
layerzero.config.ts, update thebaseContractvariable 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.jsonfile under the Base deployment folder under/deployments. E.g. if you have/deployments/base-mainnet/Common.json', then you it should beCommon`- optionally, remove the
arbitrumContractvariable entirely
- deploy the Rescue DVN by running
npx hardhat lz:deploy --tags SimpleDVNMock. Ensure you select base mainnet when prompted. The tag should beSimpleDVNMock - 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> \
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.