Skip to content

Instantly share code, notes, and snippets.

@nazreen
nazreen / README.md
Last active March 3, 2026 18:27
upgrading to anchor 0.32.1

Upgrading to Anchor 0.32.1 / Supporting the Pausable extension for Solana OFTs

These instructions assume that you want to deploy a Solana OFT in MABA mode and require support of the Pausable extension.

For extensions such as Pausable (which appears as PausableConfig on the Mint Account's list of extensions), Anchor 0.32.1 is needed.

The current Solana OFT program is on Anchor 0.31.1. In order to bump it to Anchor 0.32.1 so that the Pausable extension can be supported, several steps need to be carried out:

  • in Anchor.toml:
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.27;
// OZ
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol";
// LZ
import { NativeOFTAdapter } from "./../lib/devtools/packages/oft-evm/contracts/NativeOFTAdapter.sol";
@nazreen
nazreen / oapp.json
Created November 28, 2025 13:29
IDL
{
"address": "CoVroueYhpvD9i24JmWRJJBZZSpfvoeDkQGkSBgEbRcg",
"metadata": {
"name": "my_oapp",
"version": "0.1.0",
"spec": "0.1.0",
"description": "Created with Anchor"
},
"instructions": [
{
@nazreen
nazreen / cedefi.json
Created November 25, 2025 15:09
custom idl
{
"version": "0.1.0",
"name": "cedefi_v3",
"instructions": [
{
"name": "initStore",
"docs": ["初始化 OApp Store"],
"accounts": [
{
"name": "payer",
@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');