Functions
bag.watch function library
Table functions
- compile Compiles Solidity or Vyper smart contract source code returning contract name, ABI, and bytecode.
- create2_mine Performs a CREATE2 brute-force search across salt ranges, optionally applying byte masks to target vanity patterns or protocol bitfields.
- evm_disassemble Disassembles EVM bytecode into core instruction metadata using evmone's advanced analysis. Returns 22 essential columns: pc, label, mnemonic, opcode, push_value (BYTES32), instruction properties, stack analysis, block structure, and gas costs from evmone. For comprehensive analysis including CFG, function detection, memory tracking, and dominance analysis, use evm_disassemble_full().
- get_block Retrieves block metadata via eth_getBlockBy* endpoints using the canonical schema.
- get_logs Streams contract logs via eth_getLogs, decoding topics with human-readable signatures or ABI.
- get_transaction Retrieves canonical transaction metadata via eth_getTransactionByHash with strict hash validation.
Scalar functions
- call Invokes eth_call using the provided transport, target address, and calldata, returning the raw bytes.
- create2_predict Derives the deterministic CREATE2 deployment address from a deployer, 32-byte salt, and init code hash.
- encode_function_data Encodes contract function arguments using ABI definitions, returning selector-prefixed calldata.
- error_selector
- error_selector_json
- event_signature
- event_signature_json
- evm_prepare_deployment Creates deployment payloads by combining bytecode with constructor arguments.
- evm_prepare_tx Builds an unsigned eth_sendTransaction JSON payload with minimal inputs.
- format_ether Human-readable helper for wei balances. Equivalent to format_units(amount, 18).
- format_units Scales raw EVM integer balances by 10^decimals and returns a DECIMAL(38, decimals) value.
- function_selector
- function_selector_json
- get_balance Returns the Wei-denominated account balance via eth_getBalance through the configured transport.
- get_code Retrieves deployed EVM bytecode via eth_getCode, returning NULL for EOAs or pre-deploy addresses.
- get_storage_at Retrieves raw storage slot values via eth_getStorageAt for EVM forensics, bytecode analysis, and state inspection. Returns 32-byte BYTES32 values suitable for low-level contract state research.
- http_transport Creates a TRANSPORT JSON blob backed by the HTTP client, carrying base timeouts and headers.
- keccak256 Computes the Keccak-256 hash used across the EVM toolchain, returning a BYTES32 digest.
- read_contract Invokes eth_call with ABI-aware argument encoding. Returns a single value if the ABI function has one output, or a STRUCT with named fields if multiple outputs.
- rpc_call Issues a JSON-RPC request using the provided transport configuration and returns the raw result.
- transport Builds a TRANSPORT JSON payload suitable for RPC helpers, normalizing the URL and attaching metadata.