Coder Social home page Coder Social logo

quickpoc's Introduction

quickpoc

easy POC template generation from the command line

features

from the command line, call quickpoc 0x.. [folder_name] to generate a ready-to-go sandbox for running POCs for the given address against mainnet, including:

  • forge template with name mirroring contract name
  • src/ folder populated with all contracts and libraries
  • test file autogenerated with contract import
  • test setup with contract variable and mainnet forking
  • cd folder_name copied to clipboard to save you 1 extra second

you can run forge test to confirm it's working, then go into tests/POC.t.sol to interact with the contract (saved in storage as c).

install

on a unix machine with bash installed, make sure you have all dependencies:

clone this repo:

git clone https://github.com/zobront/quickpoc.git

set up two environment variables by calling the following from your terminal (or adding to your bash rc file):

export ETH_RPC_URL="..."
export ETHERSCAN_API_KEY="..."

save quickpoc to a location you won't move it:

mkdir ~/.quickpoc && mkdir ~/.quickpoc/bin
cp quickpoc ~/.quickpoc/bin/quickpoc # call from within the cloned repo

add the path to your bash rc file:

export PATH="$PATH:/Users/{your_name}/.quickpoc/bin"

make sure the file is executable:

chmod +x ~/.quickpoc/bin/quickpoc

you should then be able to call quickpoc 0x.. from any folder to generate the POC folder within it.

thank yous

big thanks to deliriusz for adding proxy checks and professionalism. check out his fork turbopoc for a more full featured version.

quickpoc's People

Contributors

deliriusz avatar wardenjakx avatar wuwe1 avatar zobront avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

quickpoc's Issues

cannot process any contract

Running quickpoc for any contract address results in:

$ quickpoc <CONTRACT>
error: invalid value '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' for '[SLOT]': Could not parse slot number: digit 33 is out of range for base 16

For more information, try '--help'.
error: the following required arguments were not provided:
  <CALLDATA>

Usage: cast abi-decode <SIG> <CALLDATA>

For more information, try '--help'.
jq: error (at <stdin>:0): Cannot index string with number
error: already folder named  - enter a custom name as a second arg

Version of cast:

$ cast -V
cast 0.2.0 (059aa45 2023-11-07T08:20:43.751770000Z)

Version of quickpoc:

$ git log -n 1
commit 0d1fdcbfa4248cd70eb93f00e6352186f689e478 (HEAD -> main, origin/main, origin/HEAD)
Merge: 6dbd389 a542792
Author: Zach Obront <[email protected]>
Date:   Wed Jan 10 13:13:50 2024 -0600

    Merge pull request #7 from WardenJakx/patch-1

    Update README.md

Contracts do not compile due to missing import

Once you type: ./quickpoc 0x6982508145454Ce325dDbE47a25d4ec3d2311933 pepe
and the repo is created, if you try to run forge build it does not compile due to missing import in the POC.t.sol file.
The import missing should import the contract extracted from etherscan named Contract.sol from the /src folder

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.