Skip to content

Commit

Permalink
EEI: clarify return and selfdestruct
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Oct 8, 2016
1 parent 27d94fb commit 02fad14
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions eth_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ account with non-empty associated code.

## return

Halt execution returning output data.
Set the returning output data for the execution.

*Note*: multiple invocations will overwrite the previous data.

**Parameters**

Expand All @@ -390,8 +392,12 @@ Halt execution returning output data.

## selfDestruct

Halt execution and register account for later deletion giving the remaining
balance to an address path
Mark account for later deletion and give the remaining balance to the specified
beneficiary address. This takes effect once the contract execution terminates.

*Note*: multiple invocations will overwrite the benficiary address.

*Note*: the contract **shall** halt execution after this call.

**Parameters**

Expand Down

3 comments on commit 02fad14

@pepyakin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean "the contract shall halt execution after this call"? Is it means that contract code is supposed to some how return control after calling selfDestruct? What if it doesn't do so? Why just don't trap?

@axic
Copy link
Member Author

@axic axic commented on 02fad14 Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time please open an issue on the repo - it is way harder to track it that way.

It just means that effectively selfDestruct is just a marking for deletion a buffer. Any subsequent calls overwrite that buffer. Any successful halt will enforce the selfdestruct.

Combining it with a trap would put the condition detection onus no the VM implementation - not all (especially browser) VMs make that easy.

@pepyakin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your response and sorry for inconvenience!
I moved discussion into the issue

Please sign in to comment.