Skip to content

Instantly share code, notes, and snippets.

@daxherrera
daxherrera / gist:1ce9cb33193741a4628563df3ac85d7e
Created April 18, 2026 23:31
Extend a Solana upgradeable program’s ProgramData account by deriving it automatically from the program ID.
/**
* Extend any upgradeable program's ProgramData account directly.
* Pass the program address and this script derives the ProgramData PDA automatically.
*
* Usage:
* PROGRAM_ADDRESS=<pubkey> ADDITIONAL_BYTES=4096 npx ts-node --transpile-only scripts/extend-program-by-address.ts
* npx ts-node --transpile-only scripts/extend-program-by-address.ts <PROGRAM_ADDRESS> [ADDITIONAL_BYTES]
*
* Optional:
* RESOLVE_ONLY=1 ... # print derived addresses and exit without sending
@daxherrera
daxherrera / contracts...Dickels.sol
Created March 22, 2023 01:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts@4.8.2/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts@4.8.2/access/Ownable.sol";
import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Votes.sol";
/// @custom:security-contact dickmasterson@gmail.com