test_self_destructing_initcode()¶
Documentation for tests/cancun/eip6780_selfdestruct/test_selfdestruct.py::test_self_destructing_initcode@verkle@v0.0.6.
Generate fixtures for these test cases for Shanghai with:
Shanghai only:
fill -v tests/cancun/eip6780_selfdestruct/test_selfdestruct.py::test_self_destructing_initcode --fork=Shanghai --evm-bin=/path/to/evm-tool-dev-version
For all forks up to and including Shanghai:
fill -v tests/cancun/eip6780_selfdestruct/test_selfdestruct.py::test_self_destructing_initcode --until=Shanghai
Test that a contract can self-destruct in its initcode.
Behavior is the same before and after EIP-6780.
Test using
- Different initial balances for the self-destructing contract
- Different opcodes: CREATE, CREATE2
- Different number of calls to the self-destructing contract in the same tx
Source code in tests/cancun/eip6780_selfdestruct/test_selfdestruct.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | |
Parametrized Test Cases¶
The interactive table below is also available as a standalone page.
Skipped Parameters
For more concise readability, the table below does not list the following parameter values:
fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.
| Test ID | selfdestruct_contract_initial_balance | call_times | create_opcode |
|---|---|---|---|
| selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
| selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
| selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
| selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
| selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
| selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
| selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
| selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
| selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
| selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
| selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
| selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
| selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
| selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
| selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
| selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |