Skip to content

Commit

Permalink
spammer: removed unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden committed Oct 13, 2023
1 parent 6f4c010 commit dcc997d
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions spammer/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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)
}

0 comments on commit dcc997d

Please sign in to comment.