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 {
138
138
pub struct CastTxBuilder < P , S > {
139
139
provider : P ,
140
140
tx : WithOtherFields < TransactionRequest > ,
141
+ /// Whether the transaction should be sent as a legacy transaction.
141
142
legacy : bool ,
142
143
blob : bool ,
143
144
auth : Option < CliAuthorizationList > ,
@@ -157,7 +158,8 @@ impl<P: Provider<AnyNetwork>> CastTxBuilder<P, InitState> {
157
158
let chain = utils:: get_chain ( config. chain , & provider) . await ?;
158
159
let etherscan_api_version = config. get_etherscan_api_version ( Some ( chain) ) ;
159
160
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 ( ) ) ;
161
163
162
164
if let Some ( gas_limit) = tx_opts. gas_limit {
163
165
tx. set_gas_limit ( gas_limit. to ( ) ) ;
You can’t perform that action at this time.
0 commit comments