Skip to content

Commit 8fff899

Browse files
authored
Merge branch 'ethereum:master' into master
2 parents 4cc5dea + 807f4e0 commit 8fff899

40 files changed

Lines changed: 207 additions & 5848 deletions

.github/renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"ignoreDeps": [
1111
"Pandapip1/jekyll-label-action",
1212
"ethereum/eipw-action",
13-
"ethereum/eip-review-bot"
13+
"ethereum/eip-review-bot",
14+
"ethereum/EIP-Bot"
1415
]
1516
}

.github/workflows/auto-stagnate-bot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ on:
22
schedule:
33
# A job that runs every sunday at 00:00
44
- cron: '0 0 * * 0'
5+
workflow_dispatch:
56

67
name: Auto Stagnant Bot
78
jobs:
@@ -17,7 +18,7 @@ jobs:
1718
with:
1819
node-version: '14'
1920
- name: auto-stagnant-bot
20-
uses: ethereum/EIP-Bot@fe4c395bd8bd1f006c353f9b04e694da890ad69a # mark-eips-stale
21+
uses: ethereum/EIP-Bot@b3ac0ba3600aea27157fc68d1e36c08cc5a6db77 # mark-eips-stale
2122
id: auto-stagnant-bot
2223
with:
2324
GITHUB-TOKEN: ${{ secrets.TOKEN }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
- name: Checkout EIP Repository
112112
uses: actions/checkout@47fbe2df0ad0e27efb67a70beac3555f192b062f
113113

114-
- uses: ethereum/eipw-action@af0856c89aa1a245cf0da9ae904eafbbddb94ecf
114+
- uses: ethereum/eipw-action@b8de7ea9ad5cb842301e63898afb996c451c18cf
115115
id: eipw
116116
with:
117117
token: ${{ secrets.GITHUB_TOKEN }}

EIPS/eip-5289.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ requires: 165, 5568
1515

1616
Currently, the real-world applications of smart contracts are limited by the fact that they aren't legally binding. This EIP proposes a standard that allows smart contracts to be legally binding by providing IPFS links to legal documents and ensuring that the users of the smart contract have privity with the relevant legal documents.
1717

18+
Please note that the authors are not lawyers, and that this EIP is not legal advice.
19+
1820
## Motivation
1921

2022
NFTs have oftentimes been branded as a way to hold and prove copyright of a specific work. However, this, in practice, has almost never been the case. Most of the time, NFTs have no legally-binding meaning, and in the rare cases that do, the NFT simply provides a limited license for the initial holder to use the work (but cannot provide any license for any future holders).

EIPS/eip-5568.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
eip: 5568
3-
title: Revert Reason for Required Actions
4-
description: Signal to wallets that an action is needed by returning a custom revert code
3+
title: Well-Known Format for Required Actions
4+
description: Signal to wallets that an action is needed through a well-known function and revert reason
55
author: Gavin John (@Pandapip1)
66
discussions-to: https://ethereum-magicians.org/t/eip-5568-revert-signals/10622
77
status: Review
@@ -13,21 +13,33 @@ requires: 140
1313

1414
## Abstract
1515

16-
This ERC introduces a minimalistic machine-readable (binary) format to signal to wallets that an action needs to be taken by the user using a well-known revert reason. This custom revert reason contains just enough data to be extendable by future ERCs and to take in arbitrary parameters (up to 64 kB of data). Example use cases could include approving a token for an exchange, sending an HTTP request, or requesting the user to rotate their keys after a certain period of time to enforce good hygiene.
16+
This ERC introduces a minimalistic machine-readable (binary) format to signal to wallets that an action needs to be taken by the user using a well-known function and revert reason. It provides just enough data to be extendable by future ERCs and to take in arbitrary parameters (up to 64 kB of data). Example use cases could include approving a token for an exchange, sending an HTTP request, or requesting the user to rotate their keys after a certain period of time to enforce good hygiene.
1717

1818
## Motivation
1919

2020
Oftentimes, a smart contract needs to signal to a wallet that an action needs to be taken, such as to sign a transaction or send an HTTP request to a URL. Traditionally, this has been done by hard-coding the logic into the frontend, but this ERC allows the smart contract itself to request the action.
2121

22-
This means that, for example, an exchange or a market can directly tell the wallet to approve the smart contract to spend the token, vastly simplifying the front-end code.
22+
This means that, for example, an exchange or a market can directly tell the wallet to approve the smart contract to spend the token, vastly simplifying front-end code.
2323

2424
## Specification
2525

2626
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
2727

28+
### Action Detection
29+
30+
```solidity
31+
interface IERC5568 {
32+
function walletSignal24(bytes32 selector, bytes function_data) view returns (uint24 instruction_id, bytes instruction_data);
33+
}
34+
```
35+
36+
The `instruction_id` of an instruction defined by an ERC MUST be its ERC number unless there are exceptional circumstances (be reasonable). An ERC MUST define exactly zero or one `instruction_id`. The structure of the instruction data for any `instruction_id` MUST be defined by the ERC that defines the `instruction_id`.
37+
38+
To indicate that an action needs to be taken, return the `instruction_id` and `instruction_data`. To indicate no actions need to be taken, set `instruction_id` to be `0` and `instruction_data` to any value.
39+
2840
### Custom Revert Reason
2941

30-
To signal an action needs to be taken, a compliant smart contract MUST revert with the following error:
42+
To signal an action was not taken, a compliant smart contract MUST revert with the following error:
3143

3244
```solidity
3345
error WalletSignal24(uint24 instruction_id, bytes instruction_data)
@@ -37,15 +49,17 @@ The `instruction_id` of an instruction defined by an ERC MUST be its ERC number
3749

3850
### Responding to a Revert
3951

40-
Before submitting a transaction to the mempool, it MUST be evaluated locally. If it reverts and the revert signature matches the custom error, then the following applies.
52+
Before submitting a transaction to the mempool, the `walletSignal24` function MUST be simulated locally. It MUST be treated as if it were a non-`view` function capable of making state changes (e.g. `CALLS` to non-`view` functions are allowed). If the resulting `instruction_id` is nonzero, an action needs to be taken.
4153

42-
The `instruction_id`, and `instruction_data` MUST be parsed from the revert data. The instruction SHOULD be evaluated as per the relevant ERC. If the instruction is not supported by the wallet, it MUST display an error to the user indicating that is the case. The wallet MUST then re-evaluate the transaction, except if an instruction explicitly states that the transaction MUST NOT be re-evaluated.
54+
The `instruction_id`, and `instruction_data` MUST be taken from the `walletSignal24` simulation. The instruction SHOULD be evaluated as per the relevant ERC. If the instruction is not supported by the wallet, it MUST display an error to the user indicating that is the case. The wallet MUST then re-evaluate the transaction, except if an instruction explicitly states that the transaction MUST NOT be re-evaluated.
4355

4456
If an instruction is invalid, or the `instruction_id`, and `instruction_data` cannot be parsed, then an error MUST be displayed to the user indicating that is the case. The transaction MUST NOT be re-evaluated.
4557

4658
## Rationale
4759

48-
This ERC was explicitly optimized for deployment gas cost and simplicity. It is expected that libraries will eventually be developed that makes sending and receiving these well-known reverts more developer-friendly.
60+
This ERC was explicitly optimized for deployment gas cost and simplicity. It is expected that libraries will eventually be developed that makes this more developer-friendly.
61+
62+
[ERC-165](./eip-165.md) is not used, since the interface is simple enough that it can be detected simply by calling the function.
4963

5064
## Backwards Compatibility
5165

EIPS/eip-6188.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Capping a nonce allows for contracts with special properties to be created, with
3737

3838
## Backwards Compatibility
3939

40-
This EIP requires a protocol upgrade, since it modifies consensus rules. The further restriction of nonce should not have an effect on accounts, as reaching a nonce of `2^64-2` is unfeasible.
40+
This EIP requires a protocol upgrade, since it modifies consensus rules. The further restriction of nonce should not have an effect on accounts, as reaching a nonce of `2^64-2` is difficult.
4141

4242
## Security Considerations
4343

EIPS/eip-6189.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ This opcode remains unchanged; `ADDRESS` points to the address that doesn't have
8383

8484
Transfers to the zero address continue to have the same effect as the `CREATE` opcode, and will cost extra gas as discussed in the [`CREATE` and `CREATE2`](#create-and-create2) section.
8585

86+
### Transaction Validity
87+
88+
The "origin" refers to the account that sent the transaction to be validated.
89+
90+
If the nonce of the origin is `2^64-1`, the origin MUST be updated to the address stored in the `0`th storage slot of the current origin (as if the origin was the address stored in the `0`th storage slot of the current origin). This MUST repeat until a non-alias contract is reached.
91+
92+
If there is more than one alias contract in the chain, the original origin and all subsequent origins (except the last one) MUST have their `0`th storage slot set to the address of the final non-alias contract. Then, the call MUST be forwarded as usual.
93+
94+
An additional `25` gas per account accessed in this manner (including the final one, and including if no aliased accounts were used), in addition to all the regular costs incurred by accessing accounts (see [EIP-2929](./eip-2929.md)) is added to the validation costs. For every account whose `0`th storage slot is updated, it also costs an additional `5000` gas.
95+
96+
Finally, validation proceeds as normal.
97+
8698
### RPC Endpoint Changes
8799

88100
#### `eth_getStorageAt`

0 commit comments

Comments
 (0)