Skip to content

Instantly share code, notes, and snippets.

@nazreen
nazreen / instructions.md
Last active October 27, 2025 09:50
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
@nazreen
nazreen / instructions.md
Last active October 13, 2025 14:14
ApeCoin OFT expansion instructions - EVM pathways

This is instructions set 3 of 3.

Right now the OFT configs are spread across 3 repos:

For context, the Solana OFT repo is pretty much a superset of the EVM only OFT repo. So moving forward, the Solana OFT repo can host the EVM-EVM pathway configs too. I suggest archiving or clearly marking the ape-oft repo to not be used. Link to the ape-solana repo instead.

@nazreen
nazreen / instructions.md
Last active October 13, 2025 13:40
ApeCoin OFT expansion instructions - Solana

This is instructions set 1 of 3.

ape-solana

  1. Upload Base and BNB deployments folders into /deployments in the ape-solana repo (only base-mainnet and bsc-mainnet are needed)
  2. 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,
@nazreen
nazreen / instructions.md
Last active October 13, 2025 13:40
ApeCoin OFT expansion instructions - HyperEVM

This is instructions set 2 of 3.

hyperEVM

  1. You have already uploaded the deployments, so this step is done.
  2. Amend hardhat.config.ts
    • Note: https://rpc.hyperliquid-mainnet.xyz/evm might not work anymore. Either replace it or set an env var for RPC_URL_HYPEREVM_MAINNET. https://hyperliquid.drpc.org seems to be working at time of writing.
    • 2b. add the following into config.networks:
    'base-mainnet': {
        eid: EndpointId.BASE_V2_MAINNET,
    
@nazreen
nazreen / overview.md
Created October 9, 2025 15:28
LzReceiveTypesV2
title sidebar_label audience goal
LayerZero V2 Solana OApp Reference
Solana OApp
Solana smart-contract engineers who already understand Anchor basics and the LayerZero V2 protocol on EVM.
Show every moving piece you must implement to make a Solana program behave like an **OApp** (Omnichain Application) under LayerZero’s Executor / DVN flow.

import ZoomableMermaidV2 from '@site/src/components/ZoomableMermaidV2';

The OApp Standard provides developers with a generic message passing interface to send and receive arbitrary pieces of data between contracts existing on different blockchain networks.

@nazreen
nazreen / index.ts
Last active March 6, 2025 00:40
find deployed programs
import { Connection, PublicKey } from '@solana/web3.js';
import { promises as fs } from 'fs';
import path from 'path';
import bs58 from 'bs58';
// --- Constants & Types ---
const RPC_URL = 'https://api.devnet.solana.com';
const CACHE_DIR = path.join(__dirname, 'cache');
const INSPECTED_FILE = path.join(CACHE_DIR, 'instructionsInspected.json');
const LAST_CHECKED_FILE = path.join(CACHE_DIR, 'lastChecked.json');
@nazreen
nazreen / README.md
Last active April 9, 2025 12:48
How to upgrade your Solana OFT program (previous version of Solana OFT)

This document details how to upgrade your Solana OFT program.

Notes

  • program ID == program address. The terms can be used interchangeably.
  • you will need the Squads Vault address which is the current OFT Program's Update Authority

Instructions

Prepare the updated code

@nazreen
nazreen / layerzero.config.ts
Created December 5, 2024 11:01
USDEBT lz config
import { EndpointId } from '@layerzerolabs/lz-definitions'
import { ExecutorOptionType } from '@layerzerolabs/lz-v2-utilities'
import type { OAppOmniGraphHardhat, OmniPointHardhat } from '@layerzerolabs/toolbox-hardhat'
// Note: Do not use address for EVM OmniPointHardhat contracts. Contracts are loaded using hardhat-deploy.
// If you do use an address, ensure artifacts exists.
const sepoliaContract: OmniPointHardhat = {
eid: EndpointId.SEPOLIA_V2_TESTNET,
contractName: 'MyOFTAdapter',
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@nazreen
nazreen / 0.js
Created April 17, 2019 03:34
2019-04-16 process.on('unresolvedPromise')
// in index.js
...
async function handler(event, context) {
try {
return handlerService.call(event, context, { AWS })
} catch (e) {
if (process.env.NODE_ENV === 'local') throw e
throw JSON.stringify(e)