send
Send a low-level transaction. Provide [to] for a call/transfer, --data for raw calldata, --value for native value, or any combination.
Syntax
Section titled “Syntax”send [to]Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
[to] | address | Target address. Omit for a CREATE-style deployment (use the deploy command for address binding). |
Options
Section titled “Options”| Name | Type | Description |
|---|---|---|
--data | bytes | Pre-encoded calldata or init code |
--value | number | Native value to send (in wei) |
--from | address | Sender address (requires simulation or connected wallet) |
--gas | number | Gas limit |
--max-fee-per-gas | number | Max fee per gas (EIP-1559) |
--max-priority-fee-per-gas | number | Max priority fee per gas (EIP-1559) |
--nonce | number | 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 1e18Error Captures
Section titled “Error Captures”Like exec, send supports error captures (-!> / -?!>):
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