Skip to content

Instantly share code, notes, and snippets.

View ParsaAminpour's full-sized avatar
🏗️
building

0xParsa | Σ🧠Ξ ParsaAminpour

🏗️
building
View GitHub Profile
@ParsaAminpour
ParsaAminpour / index.ts
Created March 28, 2025 14:48
Script for performing PRCP collection admin operations on the Abstract network.
import { program } from 'commander'
import * as dotenv from 'dotenv'
import chalk from "chalk";
import Web3, { Wallet, Web3BaseWalletAccount } from "web3";
import { ContractAbi, Contract } from 'web3';
import fs from "fs";
dotenv.config()
/*
Example Commands:
@ParsaAminpour
ParsaAminpour / spl_transfer.js
Last active March 13, 2025 12:28
SPL Token Transfer
const { Keypair, Transaction, Connection, PublicKey } = require("@solana/web3.js");
const { getAssociatedTokenAddress, createTransferCheckedInstruction, createAssociatedTokenAccountInstruction } = require("@solana/spl-token");
const { bs58 } = require("@coral-xyz/anchor/dist/cjs/utils/bytes");
const owner = 'AoE9wryGTiVPGAGJ5gZvK2NrmGbPwmKC93JfEGtEifXX'
const spltoken = new PublicKey("31PA6pBcHVPgJN5QDDqHzarrkd3uGkGzYmAKigcYWurj");
const sourceWallet = Keypair.fromSecretKey(bs58.decode(owner));
const connection = new Connection("https://api.devnet.solana.com");
const destWallet = new PublicKey("ReplaceWithYourDesireDestination");
@ParsaAminpour
ParsaAminpour / gist:eff9be1ef8b3e81beb1e7f87e6534c78
Last active March 14, 2025 08:34
Hints to generate Accounts associated to SPL Accounts ecosystem (It's a quick script, doesn't followed the coding best practices)
import * as anchor from "@coral-xyz/anchor";
import { BN, Program, web3, SystemProgram } from "@coral-xyz/anchor";
import { StakingProgram } from "../target/types/staking_program";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import {
createMint,
getOrCreateAssociatedTokenAccount,
mintTo,
TOKEN_PROGRAM_ID,
ASSOCIATED_TOKEN_PROGRAM_ID,

Author: Parsa Amini

Findings

[L-1] Multi-calling the length of list in the loop at the pipeline::Pipeline.sol smart contract.

Vulnerability Details

Using multi-continuous calling during a loop takes cost, especially if the function is external. Therefore, the length of the list could be arbitrary, cause increasing the number of calls.