diff --git a/spammer/helper.go b/spammer/helper.go index 9878093..17520c9 100644 --- a/spammer/helper.go +++ b/spammer/helper.go @@ -9,7 +9,6 @@ import ( txfuzz "github.com/MariusVanDerWijden/tx-fuzz" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" ) @@ -29,26 +28,3 @@ func SendTx(sk *ecdsa.PrivateKey, backend *ethclient.Client, to common.Address, signedTx, _ := types.SignTx(tx, types.NewEIP155Signer(chainid), sk) return backend.SendTransaction(context.Background(), signedTx) } - -func unstuck(sk *ecdsa.PrivateKey, backend *ethclient.Client, to common.Address, value, gasPrice *big.Int) error { - sender := crypto.PubkeyToAddress(sk.PublicKey) - blocknumber, err := backend.BlockNumber(context.Background()) - if err != nil { - return err - } - nonce, err := backend.NonceAt(context.Background(), sender, big.NewInt(int64(blocknumber))) - if err != nil { - return err - } - chainid, err := backend.ChainID(context.Background()) - if err != nil { - return err - } - fmt.Printf("Acc: %v Nonce: %v\n", sender, nonce) - if gasPrice == nil { - gasPrice, _ = backend.SuggestGasPrice(context.Background()) - } - tx := types.NewTransaction(nonce, to, value, 21000, gasPrice, nil) - signedTx, _ := types.SignTx(tx, types.NewEIP155Signer(chainid), sk) - return backend.SendTransaction(context.Background(), signedTx) -}