Sending transactions
Cast sends transactions to deploy contracts, call functions, and transfer value. Transactions require a signer (private key, keystore, or hardware wallet).
Basic transaction
$ cast send $TO --value 1ether --private-key $PRIVATE_KEYSigning options
Private key
Pass directly (not recommended for production):
$ cast send $CONTRACT "mint()" --private-key $PRIVATE_KEYKeystore file
Use an encrypted keystore:
$ cast send $CONTRACT "mint()" --keystore ~/.foundry/keystores/my-key --password $PASSWORDOr prompt for password:
$ cast send $CONTRACT "mint()" --keystore ~/.foundry/keystores/my-key --interactiveTransaction parameters
$ cast send $CONTRACT "mint()" --gas-limit 100000 --private-key $KEYWaiting and confirmations
By default, cast send waits for the transaction to be mined.
$ cast send $CONTRACT "mint()" --private-key $KEY --asyncTransaction simulation
Preview a transaction without sending:
Simulate with cast call
$ cast call $CONTRACT "transfer(address,uint256)" $TO $AMOUNT --from $SENDEREstimate gas
$ cast estimate $CONTRACT "transfer(address,uint256)" $TO $AMOUNT --from $SENDERAccess lists (EIP-2930)
Create an access list to reduce gas costs:
Generate access list
$ cast access-list $CONTRACT "transfer(address,uint256)" $TO $AMOUNT --from $SENDERSend with access list
$ cast send $CONTRACT "transfer(address,uint256)" $TO $AMOUNT --access-list $ACCESS_LIST --private-key $KEYRaw transactions
Sign without sending
$ cast mktx $CONTRACT "mint()" --private-key $KEYPublish a signed transaction
$ cast publish $SIGNED_TXBlob transactions (EIP-4844)
Send transactions with blob data:
Send blob transaction
$ cast send $CONTRACT "submitBlob()" --blob "0x..." --private-key $KEYWas this helpful?
