Skip to main content

Module call_spec

Module call_spec 

Source
Expand description

Call specification parsing for batch transactions.

Parses call specs in the format: to[:<value>][:<sig>[:<args>]] or to[:<value>][:<0xrawdata>]

Examples:

  • 0x1234567890123456789012345678901234567890 - Just an address (empty call)
  • 0x1234567890123456789012345678901234567890:0.1ether - ETH transfer
  • 0x1234567890123456789012345678901234567890::transfer(address,uint256): 0x0987654321098765432109876543210987654321,1000 - Contract call with signature
  • 0x1234567890123456789012345678901234567890::batch(uint256[],(uint256,uint256)): [1,2],(3,4)
    • Array and tuple arguments.
  • 0x1234567890123456789012345678901234567890::0x123def - Contract call with raw calldata
  • 0x1234567890123456789012345678901234567890:1ether:deposit() - Value + function call

Re-exportsยง

use alloy_network::Network; ๐Ÿ”’
use alloy_primitives::Address; ๐Ÿ”’
use alloy_primitives::Bytes; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use alloy_primitives::hex; ๐Ÿ”’
use alloy_primitives::hex; ๐Ÿ”’
use alloy_provider::Provider; ๐Ÿ”’
use eyre::Result; ๐Ÿ”’
use eyre::WrapErr; ๐Ÿ”’
use eyre::eyre; ๐Ÿ”’
use foundry_cli::utils::parse_ether_value; ๐Ÿ”’
use foundry_cli::utils::parse_function_args; ๐Ÿ”’
use foundry_config::Chain; ๐Ÿ”’
use std::str::FromStr; ๐Ÿ”’
use tempo_primitives::transaction::Call; ๐Ÿ”’

Structsยง

CallSpec
A parsed call specification for batch transactions.

Functionsยง

split_call_args ๐Ÿ”’
Split call arguments on top-level commas, respecting nested parentheses, brackets, and quoted strings.