test_self_destructing_initcode()
¶
Documentation for tests/cancun/eip6780_selfdestruct/test_selfdestruct.py::test_self_destructing_initcode@83970623
.
Generate fixtures for these test cases for Prague with:
fill -v tests/cancun/eip6780_selfdestruct/test_selfdestruct.py::test_self_destructing_initcode --fork Prague
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.
Test ID (Abbreviated) | selfdestruct_contract_initial_balance | call_times | create_opcode |
---|---|---|---|
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Shanghai-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Shanghai-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Cancun-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Cancun-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Prague-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Prague-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Osaka-blockchain_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE | 0 | 0 | CREATE |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_0-call_times_0-create_opcode_CREATE2 | 0 | 0 | CREATE2 |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE | 0 | 1 | CREATE |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_0-call_times_1-create_opcode_CREATE2 | 0 | 1 | CREATE2 |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE | 100000 | 0 | CREATE |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_100000-call_times_0-create_opcode_CREATE2 | 100000 | 0 | CREATE2 |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE | 100000 | 1 | CREATE |
...fork_Osaka-state_test-selfdestruct_contract_initial_balance_100000-call_times_1-create_opcode_CREATE2 | 100000 | 1 | CREATE2 |