Skip to content

Process Ethereum VM bytecode and/or contracts. Runs as a stand-alone executable or library

License

Notifications You must be signed in to change notification settings

FraktalLabs/proc-evm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proc EVM

readme style standard

Process Ethereum VM bytecode and/or contracts

Stand-alone C++20 executable used to run EVM bytecode and contracts. Acts only as the execution layer. Allows users to run bytecode scripts, deploy contracts, and call contracts on provided state & contexts.

Table of Contents

Install

make all

NOTE: Dependencies must be compiled & linked into compilation aswell.

Usage

Commandline

proc-evm comes with various commandline functions, including :

Run - runs bytecode as a script on the state ( no contract call )

./bin/proc-evm run --snapshotFile ./path/to/snapshot.json --blockContextFile ./path/to/blockcontext.json --txContextFile ./path/to/txcontext.json --contractCode 600260040160005260206000f3

Deploy - deploys contract on state using init code ( in the standard EVM way )

./bin/proc-evm deploy --snapshotFile ./path/to/snapshot.json --blockContextFile ./path/to/blockcontext.json --txContextFile ./path/to/txcontext.json --contractCode 6001600201600a55600D6014600039600D6000F3600260040160005260206000F3

Deploy At - deploys contract on state using init code to specified address ( useful in genesis setup )

./bin/proc-evm deployAt --snapshotFile ./path/to/snapshot.json --blockContextFile ./path/to/blockcontext.json --txContextFile ./path/to/txcontext.json --contractCode 6001600201600a55600D6014600039600D6000F3600260040160005260206000F3 --deployAddress 4200000000000000000000000000000000000000

Call - call a contract in state w/ provided args ( in the standard EVM way )

./bin/proc-evm call --contractAddress 4200000000000000000000000000000000000000 --snapshotFile ./path/to/snapshot.json --blockContextFile ./path/to/blockcontext.json --txContextFile ./path/to/txcontext.json

Note : Use -h flag on each sub-command to see more options

Library Usage

This repo contains a library setup aswell, to use proc-evm within your code.

Add include path to compilation -I./path/to/proc-evm/include.

Import into your code.

#include <proc-evm/proc-evm.h>

Use proc-evm functionality as desired. This includes CallContext, Stack, Memory, Opcodes, commands, and more.

NOTE: Dependencies must be compiled & linked into compilation aswell.

Dependencies

  • intx : 256-bit (32-byte) unsigned integers
  • ethash : Ethereum hash functions
  • evm-cpp-utils : EVM state & context types + utils

Testing

This repo contains various tests under ./test/ to make sure things are working. To run use :

make run-test
make deploy-test
make deploy-at-test
make call-test

Check the diff in ./test/snapshot.json to see if things processed properly.

Media

EVM Call Chart

EVM Deploy Chart

Maintainer

Brandon Roberts @b-j-roberts

License

MIT

About

Process Ethereum VM bytecode and/or contracts. Runs as a stand-alone executable or library

Resources

License

Stars

Watchers

Forks

Packages

No packages published