setcodetx

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: MIT Imports: 17 Imported by: 0

README

Set Code Transactions

Send transactions that update contract code using the SELFDESTRUCT opcode. This scenario is useful for testing contract code updates and state changes.

Usage

spamoor setcodetx [flags]

Configuration

Base Settings (required)
  • --privkey - Private key of the sending wallet
  • --rpchost - RPC endpoint(s) to send transactions to
Volume Control (either -c or -t required)
  • -c, --count - Total number of transactions to send
  • -t, --throughput - Transactions to send per slot
  • --max-pending - Maximum number of pending transactions
Transaction Settings
  • --basefee - Max fee per gas in gwei (default: 20)
  • --tipfee - Max tip per gas in gwei (default: 2)
  • --gaslimit - Gas limit for each transaction in gwei (default: 200000)
  • --amount - Amount to send with each transaction in gwei (default: 20)
  • --random-amount - Use random amounts for transactions (with --amount as limit)
  • --random-target - Use random to addresses for transactions
  • --data - Transaction call data to send
  • --code-addr - Code delegation target address to use for transactions
  • --random-code-addr - Use random delegation target for transactions
  • --rebroadcast - Seconds to wait before rebroadcasting (default: 120)
Wallet Management
  • --max-wallets - Maximum number of child wallets to use
  • --min-authorizations - Minimum number of authorizations to send per transaction (default: 1)
  • --max-authorizations - Maximum number of authorizations to send per transaction (default: 10)
  • --max-delegators - Maximum number of random delegators to use (0 = no delegator gets reused)
Client Settings
  • --client-group - Client group to use for sending transactions
Debug Options
  • -v, --verbose - Enable verbose output
  • --log-txs - Log all submitted transactions
  • --trace - Enable tracing output

Example

Send 100 set code transactions:

spamoor setcodetx -p "<PRIVKEY>" -h http://rpc-host:8545 -c 100

Send 2 set code transactions per slot with random amounts:

spamoor setcodetx -p "<PRIVKEY>" -h http://rpc-host:8545 -t 2 --random-amount

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ScenarioDefaultOptions = ScenarioOptions{
	TotalCount:        0,
	Throughput:        100,
	MaxPending:        0,
	MaxWallets:        0,
	MinAuthorizations: 1,
	MaxAuthorizations: 10,
	MaxDelegators:     0,
	Rebroadcast:       1,
	BaseFee:           20,
	TipFee:            2,
	GasLimit:          200000,
	Amount:            20,
	Data:              "",
	CodeAddr:          "",
	RandomAmount:      false,
	RandomTarget:      false,
	RandomCodeAddr:    false,
	Timeout:           "",
	ClientGroup:       "",
	LogTxs:            false,
}
View Source
var ScenarioDescriptor = scenario.Descriptor{
	Name:           ScenarioName,
	Description:    "Send setcode transactions with different configurations",
	DefaultOptions: ScenarioDefaultOptions,
	NewScenario:    newScenario,
}
View Source
var ScenarioName = "setcodetx"

Functions

This section is empty.

Types

type Scenario

type Scenario struct {
	// contains filtered or unexported fields
}

func (*Scenario) Flags

func (s *Scenario) Flags(flags *pflag.FlagSet) error

func (*Scenario) Init

func (s *Scenario) Init(options *scenario.Options) error

func (*Scenario) Run

func (s *Scenario) Run(ctx context.Context) error

type ScenarioOptions

type ScenarioOptions struct {
	TotalCount        uint64  `yaml:"total_count"`
	Throughput        uint64  `yaml:"throughput"`
	MaxPending        uint64  `yaml:"max_pending"`
	MaxWallets        uint64  `yaml:"max_wallets"`
	MinAuthorizations uint64  `yaml:"min_authorizations"`
	MaxAuthorizations uint64  `yaml:"max_authorizations"`
	MaxDelegators     uint64  `yaml:"max_delegators"`
	Rebroadcast       uint64  `yaml:"rebroadcast"`
	BaseFee           float64 `yaml:"base_fee"`
	TipFee            float64 `yaml:"tip_fee"`
	BaseFeeWei        string  `yaml:"base_fee_wei"`
	TipFeeWei         string  `yaml:"tip_fee_wei"`
	GasLimit          uint64  `yaml:"gas_limit"`
	Amount            uint64  `yaml:"amount"`
	Data              string  `yaml:"data"`
	CodeAddr          string  `yaml:"code_addr"`
	RandomAmount      bool    `yaml:"random_amount"`
	RandomTarget      bool    `yaml:"random_target"`
	RandomCodeAddr    bool    `yaml:"random_code_addr"`
	Timeout           string  `yaml:"timeout"`
	ClientGroup       string  `yaml:"client_group"`
	LogTxs            bool    `yaml:"log_txs"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL