Skip to content

Instantly share code, notes, and snippets.

View asiawildboar's full-sized avatar
🎯
Focusing

0xwildboar asiawildboar

🎯
Focusing
View GitHub Profile
@asiawildboar
asiawildboar / rpc_fetch_pump_token_price.ts
Created November 17, 2024 07:11 — forked from rubpy/rpc_fetch_pump_token_price.ts
Fetching Pump.fun bonding curve state and calculating price of token/SOL.
import * as web3 from "@solana/web3.js";
//////////////////////////////////////////////////
function readBytes(buf: Buffer, offset: number, length: number): Buffer {
const end = offset + length;
if (buf.byteLength < end) throw new RangeError("range out of bounds");
return buf.subarray(offset, end);
}
@asiawildboar
asiawildboar / private_fork.md
Created February 6, 2024 10:21 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

object "Contract" {
code {
datacopy(0, dataoffset("runtime"), datasize("runtime"))
return(0, datasize("runtime"))
}
object "runtime" {
code {
if iszero(calledByOwner()) { revert(0, 0) }
switch selector()
case 0x00 {