|
11 | 11 | - [`_target`](#_target) |
12 | 12 | - [`ExecutingMessage` Event](#executingmessage-event) |
13 | 13 | - [Reference implementation](#reference-implementation) |
| 14 | + - [Deposit Handling](#deposit-handling) |
14 | 15 | - [`Identifier` Getters](#identifier-getters) |
15 | 16 | - [L2ToL2CrossDomainMessenger](#l2tol2crossdomainmessenger) |
16 | 17 | - [`relayMessage` Invariants](#relaymessage-invariants) |
|
26 | 27 | - [L1Block](#l1block) |
27 | 28 | - [Static Configuration](#static-configuration) |
28 | 29 | - [Dependency Set](#dependency-set) |
| 30 | + - [Deposit Context](#deposit-context) |
| 31 | + - [`isDeposit`](#isdeposit) |
| 32 | + - [`setDepositing`](#setdepositing) |
29 | 33 | - [Security Considerations](#security-considerations) |
30 | 34 |
|
31 | 35 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
@@ -139,6 +143,12 @@ function executeMessage(Identifier calldata _id, address _target, bytes calldata |
139 | 143 |
|
140 | 144 | Note that the `executeMessage` function is `payable` to enable relayers to earn in the gas paying asset. |
141 | 145 |
|
| 146 | +### Deposit Handling |
| 147 | + |
| 148 | +A call to `executeMessage` reverts if the call is made in a [deposit context](./derivation.md#deposit-context). The deposit context status can be determined by callling `isDeposit` on the `L1Block` contract. |
| 149 | + |
| 150 | +In the future, deposit handling will be modified to be more permissive. It will revert only in specific cases where interop dependency resolution is not feasible. |
| 151 | + |
142 | 152 | ### `Identifier` Getters |
143 | 153 |
|
144 | 154 | The `Identifier` MUST be exposed via `public` getters so that contracts can call back to authenticate |
@@ -416,6 +426,30 @@ dependency set called `dependencySet()`. This function MUST return the array of |
416 | 426 | `L1Block` MUST also provide a public getter to get the dependency set size called `dependencySetSize()`. This function |
417 | 427 | MUST return the length of the dependency set array. |
418 | 428 |
|
| 429 | +### Deposit Context |
| 430 | + |
| 431 | +The `L1Block` contract is updated with the following methods to support [deposit contexts](./derivation.md#deposit-context). |
| 432 | + |
| 433 | +#### `isDeposit` |
| 434 | + |
| 435 | +```solidity |
| 436 | +function isDeposit() (return bool) |
| 437 | +``` |
| 438 | + |
| 439 | +A new method added to `L1Block` indicating whether the current execution is in a [deposit context](./derivation.md#deposit-context). The method has the following signature: |
| 440 | + |
| 441 | + |
| 442 | +Only the `CrossL2Inbox` is authorized to call `isDeposit`. |
| 443 | + |
| 444 | +#### `setDepositing` |
| 445 | + |
| 446 | +```solidity |
| 447 | +function setDepositing(bool _isDepositing) |
| 448 | +``` |
| 449 | +A new method added to indicate whether the current execution is in a deposit context. |
| 450 | + |
| 451 | +Only the `DEPOSITOR_ACCOUNT` is authorized to call `setDepositing`. |
| 452 | + |
419 | 453 | ## Security Considerations |
420 | 454 |
|
421 | 455 | TODO |
0 commit comments