Skip to content

Commit aad332f

Browse files
authored
Merge branch 'ethereum:master' into master
2 parents 666ed83 + 7b45933 commit aad332f

58 files changed

Lines changed: 5527 additions & 711 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

EIPS/eip-1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ EIPs should be written in [markdown](https://github.com/adam-p/markdown-here/wik
118118

119119
Each EIP must begin with an [RFC 822](https://www.ietf.org/rfc/rfc822.txt) style header preamble, preceded and followed by three hyphens (`---`). This header is also termed ["front matter" by Jekyll](https://jekyllrb.com/docs/front-matter/). The headers must appear in the following order.
120120

121-
`eip`: *EIP number* (this is determined by the EIP editor)
121+
`eip`: *EIP number*
122122

123123
`title`: *The EIP title is a few words, not a complete sentence*
124124

@@ -451,7 +451,7 @@ If the EIP isn't ready, the editor will send it back to the author for revision,
451451
452452
Once the EIP is ready for the repository, the EIP editor will:
453453
454-
- Assign an EIP number (generally the PR number, but the decision is with the editors)
454+
- Assign an EIP number (generally incremental; editors can reassign if number sniping is suspected)
455455
- Merge the corresponding [pull request](https://github.com/ethereum/EIPs/pulls)
456456
- Send a message back to the EIP author with the next step.
457457

EIPS/eip-1271.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This function should be implemented by contracts which desire to sign messages (
5757
## Rationale
5858
We believe the name of the proposed function to be appropriate considering that an *authorized* signers providing proper signatures for a given data would see their signature as "valid" by the signing contract. Hence, a signed action message is only valid when the signer is authorized to perform a given action on the behalf of a smart wallet.
5959
60-
Two arguments are provided for simplicity of separating the hash signed from the signature. A bytes32 hash is used instead of the unhashed message for simplicy, since contracts could expect a certain hashing function that is not standard, such as with [EIP-712](./eip-712.md).
60+
Two arguments are provided for simplicity of separating the hash signed from the signature. A bytes32 hash is used instead of the unhashed message for simplicity, since contracts could expect a certain hashing function that is not standard, such as with [EIP-712](./eip-712.md).
6161
6262
`isValidSignature()` should not be able to modify states in order to prevent `GasToken` minting or similar attack vectors. Again, this is to simplify the implementation surface of the function for better standardization and to allow off-chain contract queries.
6363

EIPS/eip-1820.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ The contract has the address above for every chain on which it is deployed.
339339
<details>
340340
<summary>Raw metadata of <code>./contracts/ERC1820Registry.sol</code></summary>
341341
<pre>
342-
<code>{
342+
343+
```json
344+
{
343345
"compiler": {
344346
"version": "0.5.3+commit.10d17f24"
345347
},
@@ -655,7 +657,9 @@ The contract has the address above for every chain on which it is deployed.
655657
}
656658
},
657659
"version": 1
658-
}</code>
660+
}
661+
```
662+
659663
</pre>
660664
</details>
661665

EIPS/eip-1822.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,6 @@ category: ERC
99
created: 2019-03-04
1010
---
1111

12-
## Table of contents
13-
14-
<!-- TOC -->
15-
16-
- [Table of contents](#table-of-contents)
17-
- [Simple Summary](#simple-summary)
18-
- [Abstract](#abstract)
19-
- [Motivation](#motivation)
20-
- [Terminology](#terminology)
21-
- [Specification](#specification)
22-
- [Proxy Contract](#proxy-contract)
23-
- [Functions](#functions)
24-
- [`fallback`](#fallback)
25-
- [`constructor`](#constructor)
26-
- [Proxiable Contract](#proxiable-contract)
27-
- [Functions](#functions-1)
28-
- [`proxiable`](#proxiable)
29-
- [`updateCodeAddress`](#updatecodeaddress)
30-
- [Pitfalls when using a proxy](#pitfalls-when-using-a-proxy)
31-
- [Separating Variables from Logic](#separating-variables-from-logic)
32-
- [Restricting dangerous functions](#restricting-dangerous-functions)
33-
- [Examples](#examples)
34-
- [Owned](#owned)
35-
- [ERC-20 Token](#erc-20-token)
36-
- [Proxy Contract](#proxy-contract-1)
37-
- [Token Logic Contract](#token-logic-contract)
38-
- [References](#references)
39-
- [Copyright](#copyright)
40-
<!-- /TOC -->
41-
4212
## Simple Summary
4313

4414
Standard upgradeable proxy contract.
@@ -60,7 +30,7 @@ The following describes a standard for proxy contracts which is universally comp
6030
- **Logic Contract** - The contract **B** which contains the logic used by Proxy Contract **A**
6131
- **Proxiable Contract** - Inherited in Logic Contract **B** to provide the upgrade functionality
6232

63-
<p align="center"><img src="../assets/eip-1822/proxy-diagram.png" alt="diagram" width="600"/></p>
33+
![](../assets/eip-1822/proxy-diagram.png)
6434

6535
## Specification
6636

EIPS/eip-223.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
22
eip: 223
3-
title: Token with communication model
3+
title: Token with transaction handling model
44
description: Token with transaction handling model designed to behave identical to native currency (ether)
55
author: Dexaran (@Dexaran) <dexaran@ethereumclassic.org>
66
discussions-to: https://ethereum-magicians.org/t/erc-223-token-standard/12894
7-
status: Review
7+
status: Last Call
8+
last-call-deadline: 2023-09-03
89
type: Standards Track
910
category: ERC
1011
created: 2017-05-03
1112
---
1213

1314
## Abstract
1415

15-
The following describes an interface for fungible tokens that supports a `tokenReceived` callback to notify contract recipients when tokens are received.
16+
The following describes an interface and logic for fungible tokens that supports a `tokenReceived` callback to notify contract recipients when tokens are received. This makes tokens behave identical to ether.
1617

1718
## Motivation
1819

@@ -38,25 +39,25 @@ Token transfers to contracts not implementing `tokenReceived` as described below
3839
function totalSupply() view returns (uint256 totalSupply)
3940
```
4041

41-
Gets the total supply of the token. The functionality of this method is identical to that of ERC-20.
42+
Returns the total supply of the token. The functionality of this method is identical to that of ERC-20.
4243

4344
##### `name`
4445

4546
```solidity
4647
function name() view returns (string _name)
4748
```
4849

49-
Gets the name of the token. The functionality of this method is identical to that of ERC-20.
50+
Returns the name of the token. The functionality of this method is identical to that of ERC-20.
5051

5152
OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
5253

5354
##### `symbol`
5455

5556
```solidity
56-
function symbol() view returns (bytes32 _symbol)
57+
function symbol() view returns (string _symbol)
5758
```
5859

59-
Gets the symbol of the token. The functionality of this method is identical to that of ERC-20.
60+
Returns the symbol of the token. The functionality of this method is identical to that of ERC-20.
6061

6162
OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
6263

@@ -66,7 +67,17 @@ OPTIONAL - This method can be used to improve usability, but interfaces and othe
6667
function decimals() view returns (uint8 _decimals)
6768
```
6869

69-
Gets the number of decimals of the token. The functionality of this method is identical to that of ERC-20.
70+
Returns the number of decimals of the token. The functionality of this method is identical to that of ERC-20.
71+
72+
OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
73+
74+
##### `standard`
75+
76+
```solidity
77+
function standard() view returns (string memory)
78+
```
79+
80+
Returns the identifier of the standard. If the token is [ERC-223](./eip-20.md) then it must return `"223"`.
7081

7182
OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
7283

@@ -76,7 +87,7 @@ OPTIONAL - This method can be used to improve usability, but interfaces and othe
7687
function balanceOf(address _owner) view returns (uint256 balance)
7788
```
7889

79-
Gets the account balance of another account with address `_owner`. The functionality of this method is identical to that of ERC-20.
90+
Returns the account balance of another account with address `_owner`. The functionality of this method is identical to that of ERC-20.
8091

8192
##### `transfer(address, uint)`
8293

@@ -87,6 +98,8 @@ function transfer(address _to, uint _value) returns (bool)
8798
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.
8899
If `_to` is an externally owned address, then the transaction must be sent without executing `tokenReceived` in `_to`.
89100
`_data` can be attached to this token transaction, but it requires more gas. `_data` can be empty.
101+
102+
The `tokenReceived` function of `_to` MUST be called after all other operations to avoid re-entrancy attacks.
90103

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

@@ -98,7 +111,9 @@ This function must transfer tokens and invoke the function `tokenReceived (addre
98111
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`.
99112
`_data` can be attached to this token transaction, but it requires more gas. `_data` can be empty.
100113

101-
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
114+
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.
115+
116+
The `tokenReceived` function of `_to` MUST be called after all other operations to avoid re-entrancy attacks.
102117

103118
#### Events
104119

@@ -216,13 +231,13 @@ library Address {
216231
217232
abstract contract IERC223Recipient {
218233
/**
219-
* @dev Standard ERC223 function that will handle incoming token transfers.
234+
* @dev Standard ERC-223 receiving function that will handle incoming token transfers.
220235
*
221236
* @param _from Token sender address.
222237
* @param _value Amount of tokens.
223238
* @param _data Transaction metadata.
224239
*/
225-
function tokenReceived(address _from, uint _value, bytes memory _data) public virtual;
240+
function tokenReceived(address _from, uint _value, bytes memory _data) public virtual returns (bytes4);
226241
}
227242
228243
/**
@@ -240,7 +255,7 @@ contract ERC223Token {
240255
uint8 private _decimals;
241256
uint256 private _totalSupply;
242257
243-
mapping(address => uint256) public balances; // List of user balances.
258+
mapping(address => uint256) private balances; // List of user balances.
244259
245260
/**
246261
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
@@ -302,6 +317,14 @@ contract ERC223Token {
302317
return _totalSupply;
303318
}
304319
320+
/**
321+
* @dev See {IERC223-standard}.
322+
*/
323+
function standard() public view returns (string memory)
324+
{
325+
return "223";
326+
}
327+
305328
306329
/**
307330
* @dev Returns balance of the `_owner`.

0 commit comments

Comments
 (0)