@@ -10,7 +10,7 @@ use foundry_cli::{
1010} ;
1111use foundry_common:: ens:: NameOrAddress ;
1212use foundry_config:: Config ;
13- use std:: str:: FromStr ;
13+ use std:: { path :: PathBuf , str:: FromStr } ;
1414
1515/// CLI arguments for `cast mktx`.
1616#[ derive( Debug , Parser ) ]
@@ -33,6 +33,16 @@ pub struct MakeTxArgs {
3333 #[ command( flatten) ]
3434 tx : TransactionOpts ,
3535
36+ /// The path of blob data to be sent.
37+ #[ arg(
38+ long,
39+ value_name = "BLOB_DATA_PATH" ,
40+ conflicts_with = "legacy" ,
41+ requires = "blob" ,
42+ help_heading = "Transaction options"
43+ ) ]
44+ path : Option < PathBuf > ,
45+
3646 #[ command( flatten) ]
3747 eth : EthereumOpts ,
3848}
@@ -55,7 +65,9 @@ pub enum MakeTxSubcommands {
5565
5666impl MakeTxArgs {
5767 pub async fn run ( self ) -> Result < ( ) > {
58- let Self { to, mut sig, mut args, command, tx, eth } = self ;
68+ let Self { to, mut sig, mut args, command, tx, path, eth } = self ;
69+
70+ let blob_data = if let Some ( path) = path { Some ( std:: fs:: read ( path) ?) } else { None } ;
5971
6072 let code = if let Some ( MakeTxSubcommands :: Create {
6173 code,
@@ -88,6 +100,7 @@ impl MakeTxArgs {
88100 . with_tx_kind ( tx_kind)
89101 . with_code_sig_and_args ( code, sig, args)
90102 . await ?
103+ . with_blob_data ( blob_data) ?
91104 . build ( from)
92105 . await ?;
93106
0 commit comments