File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ pub struct InputState {
138138pub struct CastTxBuilder < P , S > {
139139 provider : P ,
140140 tx : WithOtherFields < TransactionRequest > ,
141+ /// Whether the transaction should be sent as a legacy transaction.
141142 legacy : bool ,
142143 blob : bool ,
143144 auth : Option < CliAuthorizationList > ,
@@ -157,7 +158,8 @@ impl<P: Provider<AnyNetwork>> CastTxBuilder<P, InitState> {
157158 let chain = utils:: get_chain ( config. chain , & provider) . await ?;
158159 let etherscan_api_version = config. get_etherscan_api_version ( Some ( chain) ) ;
159160 let etherscan_api_key = config. get_etherscan_api_key ( Some ( chain) ) ;
160- let legacy = tx_opts. legacy || chain. is_legacy ( ) ;
161+ // mark it as legacy if requested or the chain is legacy and no 7702 is provided.
162+ let legacy = tx_opts. legacy || ( chain. is_legacy ( ) && tx_opts. auth . is_none ( ) ) ;
161163
162164 if let Some ( gas_limit) = tx_opts. gas_limit {
163165 tx. set_gas_limit ( gas_limit. to ( ) ) ;
You can’t perform that action at this time.
0 commit comments