util
Cast-style helpers for ABI encoding, unit conversion, hashing, RLP, and address derivation. Runs without Beam config or wallets.
beam util exposes pure local helpers that do not require Beam config, wallets, RPCs, OpenChain, or Etherscan. It runs as a standalone path, so it works even when ~/.beam has not been initialized.
Several subcommands also read stdin when you omit the positional value, so shell pipelines map cleanly onto beam util.
ABI and calldata
$ beam util sig "transfer(address,uint256)"
$ beam util sig-event "Transfer(address indexed,address indexed,uint256)"
$ beam util calldata "transfer(address,uint256)" 0x1111... 5
$ beam util abi-encode "(address,uint256)" 0x1111... 5
$ beam util abi-encode-event "Transfer(address indexed,address indexed,uint256)" \
0x1111... 0x2222... 5
$ beam util decode-calldata 0xa9059cbb...
$ beam util decode-abi "(address,uint256)" 0x...
$ beam util decode-error 0x08c379a0...
$ beam util decode-event "Transfer(address,address,uint256)" 0x...
$ beam util decode-string 0x...
$ beam util pretty-calldata 0xa9059cbb...
Bytes and text
$ beam util address-zero
$ beam util hash-zero
$ beam util concat-hex 0xab 0xcd
$ beam util format-bytes32-string "hello"
$ beam util parse-bytes32-string 0x...
$ beam util parse-bytes32-address 0x...
$ beam util from-bin # raw bytes via stdin → hex
$ beam util to-hexdata "hello"
$ beam util from-utf8 "hello"
$ beam util to-utf8 0x68656c6c6f
$ beam util to-ascii 0x68656c6c6f
$ beam util to-bytes32 0xab
$ beam util pad 0xab 32
$ beam util to-check-sum-address 0x1111...
Units and number transforms
$ beam util to-wei 1 gwei
$ beam util from-wei 1000000000 gwei
$ beam util to-unit 1 gwei
$ beam util parse-units 1.5 18
$ beam util format-units 1500000000000000000 18
$ beam util max-int
$ beam util max-uint
$ beam util min-int
$ beam util shl 0x01 4
$ beam util shr 0xff 2
$ beam util to-base 100 16 # decimal → hex
$ beam util to-dec 0x64
$ beam util to-hex 100
$ beam util to-int256 -1
$ beam util to-uint256 1
$ beam util to-fixed-point 3.14 18
$ beam util from-fixed-point 3140000000000000000 18
Hashing, storage, address derivation
$ beam util keccak "hello"
$ beam util hash-message "hello"
$ beam util namehash alice.eth
$ beam util index address 0x1111... 1
$ beam util index-erc7201 "my.namespace.id"
$ beam util compute-address --deployer 0x... --nonce 0
$ beam util create2 \
--deployer 0x0000000000000000000000000000000000000000 \
--salt 0x0000000000000000000000000000000000000000000000000000000000000000 \
--init-code 0x00
RLP
$ beam util to-rlp '["0xab","0xcd"]'
$ beam util from-rlp 0xc4823412abcd
Full subcommand list
- ABI and calldata:
abi-encode,abi-encode-event,calldata,decode-abi,decode-calldata,decode-error,decode-event,decode-string,pretty-calldata,sig,sig-event - Bytes and text:
address-zero,concat-hex,format-bytes32-string,from-bin,from-utf8,hash-zero,pad,parse-bytes32-address,parse-bytes32-string,to-ascii,to-bytes32,to-check-sum-address,to-hexdata,to-utf8 - Units and number transforms:
format-units,from-fixed-point,from-wei,max-int,max-uint,min-int,parse-units,shl,shr,to-base,to-dec,to-fixed-point,to-hex,to-int256,to-uint256,to-unit,to-wei - Hashing, storage, address derivation:
compute-address,create2,hash-message,index,index-erc7201,keccak,namehash - RLP:
from-rlp,to-rlp