send
Send a low-level transaction. Provide [to] for a call/transfer, --data for raw calldata, --value for native value, or any combination.
Supports runtime fields inside smart blocks. Use explicit @helper! expressions or captured outputs; other fields are evaluated at build time.
Syntax
Section titled “Syntax”send [to]Arguments
Section titled “Arguments”| Name | Type | Evaluation | Description |
|---|---|---|---|
[to] | address | Runtime in smart blocks | Target address. Omit for a CREATE-style deployment (use the deploy command for address binding). |
Options
Section titled “Options”| Name | Type | Evaluation | Description |
|---|---|---|---|
--data | bytes | Runtime in smart blocks | Pre-encoded calldata or init code; runtime calldata requires a fixed selector from @abi.encodeCall! |
--value | number | Runtime in smart blocks | Native value to send (in wei) |
--from | address | Build time | Sender address (requires simulation or connected wallet) |
--gas | number | Build time | Gas limit |
--max-fee-per-gas | number | Build time | Max fee per gas (EIP-1559) |
--max-priority-fee-per-gas | number | Build time | Max priority fee per gas (EIP-1559) |
--nonce | number | Build time | Transaction nonce override |
Examples
Section titled “Examples”# Send pre-encoded calldataset $data @abi.encodeCall("transfer(address,uint256)" 0x44fA8E6f47987339850636F88629646662444217 100e18)send @token(DAI) --data $data
# Native value transfersend 0x44fA8E6f47987339850636F88629646662444217 --value 1e18Revert Captures
Section titled “Revert Captures”Like exec, send supports revert captures (-!> / -?!>) on the transaction it sends, and refusal captures (-/> / -?/>) on a failure raised before the send:
set $contract 0x44fA8E6f47987339850636F88629646662444217set $calldata 0xa3fdfee3
# Assert the call reverts with a specific errorsend $contract --data 0xa3fdfee3 -!> Unauthorized()
# Capture the revert reasonsend $contract --data $calldata -!> Error(string) [$reason]
# Boolean variablesend $contract --data $calldata -?!> Unauthorized() $e- Either
<to>or--datamust be provided. Sending without either is a no-op and is rejected. - Omitting
<to>while supplying--dataproduces a CREATE-style deployment transaction. For deployments where you also want the predicted contract address bound to a variable, use the deploy command instead.
See Also
Section titled “See Also”- exec — call a contract by signature (auto-encodes)
- deploy — deploy a contract from raw creation bytecode
- @abi.encodeCall — encode calldata from a signature