Skip to content

Instantly share code, notes, and snippets.

View bh2smith's full-sized avatar
🤘

Benjamin Smith bh2smith

🤘
View GitHub Profile
@bh2smith
bh2smith / near-contract-monorepo.md
Created June 3, 2024 14:44
Near Contract Monorepo Archetecture

The following guide was coppied from ChatGPT 4o:

When managing multiple NEAR smart contracts within a single repository, it's common to structure the repository to facilitate organization, compilation, and deployment. Here’s a pattern you can follow for a multi-contract NEAR project in Rust:

Directory Structure

  1. root directory: Contains common configuration files.
  2. contracts: A directory containing individual subdirectories for each contract.
  3. scripts: Contains scripts for building, testing, and deploying contracts.
  4. tests: Contains integration tests that might involve multiple contracts.
@bh2smith
bh2smith / mpc-relayer-manual.md
Created June 11, 2024 13:37
Multichain Gas Relayer Manual Interactions
@bh2smith
bh2smith / safe-sdk.md
Last active June 28, 2024 13:25
Safe SDK Feedback

Runtime Arguments vs. Environment Variables

Runtime Arguments:

  • Definition: These are parameters passed to a program at the time it is executed. They are typically specified in the command line.
  • Usage:
    • Directly affect the program's behavior for a specific run.
    • Ideal for options or configurations that might change frequently.
    • Example: If you have a script that processes files, you might pass the filename as a runtime argument (python process_file.py input.txt).
@bh2smith
bh2smith / multicall.ts
Created April 23, 2025 08:05
Example Multicall
import {
createPublicClient,
decodeFunctionResult,
encodeFunctionData,
http,
parseAbi,
} from "viem";
import { mainnet } from "viem/chains";
const multicallAbi = [