You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A suicide with an argument to a non-existant address creates a new account at that address in the state. This seems like unintended behaviour according to our model.
Steps to reproduce
Start qtumd in regtest mode: ./qtumd -regtest
Mine some blocks: ./qtum-cli -regtest generate 20
Create a new contract that suicides and refunds the contract's balance to the address at 0xe0e on calling the fallback function, store the contract's address for later use CONTRACT=$(./qtum-cli -regtest createcontract "60606040523415600b57fe5b5b603d8060196000396000f30060606040525b600f5b610e0eff5b565b0000a165627a7a723058209e90cd77b49430d225c3ebd97a7eabf1282254a9d0260e71448f338a40207fa10029" | python3 -c "import json; import sys; print(json.loads(sys.stdin.read())['address'])")
Mine this tx: ./qtum-cli -regtest generate 1
Send a tx that calls the fallback function: ./qtum-cli -regtest sendtocontract $CONTRACT "00"
Mine this tx: ./qtum-cli -regtest generate 1
List the contracts that currently exists: ./qtum-cli -regtest listcontracts
Expected results:
No contracts should exists.
Actual results:
A contract exists
Suicide contract:
pragma solidity ^0.4.11;
contract Test {
function () payable {
suicide(0xe0e);
}
}
The text was updated successfully, but these errors were encountered:
Description
A suicide with an argument to a non-existant address creates a new account at that address in the state. This seems like unintended behaviour according to our model.
Steps to reproduce
./qtumd -regtest
./qtum-cli -regtest generate 20
CONTRACT=$(./qtum-cli -regtest createcontract "60606040523415600b57fe5b5b603d8060196000396000f30060606040525b600f5b610e0eff5b565b0000a165627a7a723058209e90cd77b49430d225c3ebd97a7eabf1282254a9d0260e71448f338a40207fa10029" | python3 -c "import json; import sys; print(json.loads(sys.stdin.read())['address'])")
./qtum-cli -regtest generate 1
./qtum-cli -regtest sendtocontract $CONTRACT "00"
./qtum-cli -regtest generate 1
./qtum-cli -regtest listcontracts
Expected results:
Actual results:
Suicide contract:
The text was updated successfully, but these errors were encountered: