Skip to content

Commit

Permalink
Update EIP-223: Update eip-223.md
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
Dexaran authored Aug 10, 2023
1 parent de1457b commit df63138
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion EIPS/eip-223.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ function transfer(address _to, uint _value) returns (bool)
This function must transfer tokens, and if `_to` is a contract, it must call the `tokenReceived(address, uint256, bytes calldata)` function of `_to`. If the `tokenReceived` function is not implemented in `_to` (recipient contract), then the transaction must fail and the transfer of tokens must be reverted.
If `_to` is an externally owned address, then the transaction must be sent without executing `tokenReceived` in `_to`.
`_data` can be attached to this token transaction, but it requires more gas. `_data` can be empty.

The `tokenReceived` function of `_to` MUST be called after all other operations to avoid re-entrancy attacks.

##### `transfer(address, uint, bytes)`

Expand All @@ -108,7 +110,9 @@ This function must transfer tokens and invoke the function `tokenReceived (addre
If `_to` is an externally owned address (determined by the code size being zero), then the transaction must be sent without executing `tokenReceived` in `_to`.
`_data` can be attached to this token transaction, but it requires more gas. `_data` can be empty.

NOTE: A possible way to check whether the `_to` is a contract or an address is to assemble the code of `_to`. If there is no code in `_to`, then this is an externally owned address, otherwise it's a contract.116
NOTE: A possible way to check whether the `_to` is a contract or an address is to assemble the code of `_to`. If there is no code in `_to`, then this is an externally owned address, otherwise it's a contract.

The `tokenReceived` function of `_to` MUST be called after all other operations to avoid re-entrancy attacks.

#### Events

Expand Down

1 comment on commit df63138

@StemmlerSisters
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.