Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EEI: transfer() method and simplification of selfDestruct() #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions eth_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,12 @@ from last executed `call`, `callCode`, `callDelegate`, `callStatic` or `create`.

## selfDestruct

Mark account for later deletion and give the remaining balance to the specified
beneficiary address. This will cause a trap and the execution will be aborted immediately.
Mark account for later deletion.
This will cause a trap and the execution will be aborted immediately.

**Parameters**

- `addressOffset` **i32ptr** the memory offset to load the address from (`address`)
*nothing*

**Returns**

Expand All @@ -472,3 +472,25 @@ Get the block’s timestamp.
**Returns**

`blockTimestamp` **i64**


## transfer

Trasfers ETH from the current account to the destination address.
When the balance of the current account is not sufficient the method ends
with a failure.

**Parameters**

- `destinationOffset` **i32ptr** the memory offset to load the destination address from (`address`)
- `valueOffset` **i32ptr** the memory offset to load the value from (`u128`)

**Returns**

`result` **i32** Returns 0 on success, 1 on failure.

**Rationale**

This method is added for compatibility with EVM1 where you can achieve the same
result by using CREATE + SELFDESTRUCT combo.