Skip to content

Commit 0f48d3e

Browse files
committed
attempting to brute force tx sender nonce
1 parent 97f8bd2 commit 0f48d3e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/submit_transaction.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,19 @@ async fn main() {
6969

7070
async fn send_transaction(provider: &HostProvider, recipient_address: Address) {
7171
// construct simple transaction to send ETH to a recipient
72+
let nonce = match provider.get_transaction_count(provider.default_signer_address()).await {
73+
Ok(count) => count + 1,
74+
Err(e) => {
75+
error!(error = ?e, "failed to get transaction count");
76+
return;
77+
},
78+
};
79+
7280
let tx = TransactionRequest::default()
7381
.with_from(provider.default_signer_address())
7482
.with_to(recipient_address)
7583
.with_value(U256::from(1))
84+
.with_nonce(nonce)
7685
.with_gas_limit(30_000);
7786

7887
// start timer to measure how long it takes to mine the transaction

0 commit comments

Comments
 (0)