Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
maurelian committed Nov 21, 2024
1 parent e72ae37 commit 15af9a9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions protocol/l1-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ contract SimpleStorage is Initializable {
}
```

The only change to this contract will be to add a new `upgrade()` function which also
has the `initializer` modifier.
The only change to this contract will be to:

1. store the `initialized` value in an unstructured storage location.
2. add a new `upgrade()` function which also has the `initializer` modifier.

```solidity
/// @notice Called to upgrade a pre-existing system.
Expand All @@ -128,7 +130,7 @@ has the `initializer` modifier.
```

The `StorageSetter` contract can then be replaced with a special purpose contract which
directly reset the `initialized` slot.
directly resets the `initialized` slot.

The new contract **deployment** flow used by the OPCM thus becomes:

Expand All @@ -141,7 +143,7 @@ And the contract **upgrade** flow used by the OPCM would be:
1. set its implementation to an `InitializerResetter` contract (does what the name says).
2. call `InitializerResetter.reset()`
3. set its implementation to `SimpleStorage`.
4. Call `SimpleStorage.initialize()`.
4. Call `SimpleStorage.upgrade()`.

**Alternatives considered:** Other approaches were considered including:

Expand Down Expand Up @@ -278,6 +280,7 @@ function upgrade(SuperchainProxyAdmin _admin, ISystemConfig[] _systemConfigs, Ne
// 2. Call the appropriate `SuperchainProxyAdmin.upgradeAndCall()` function to update the
// implementation and call `upgrade()` on the contract.
}
// run safety assertions to validate the upgrade
}
```

Expand Down

0 comments on commit 15af9a9

Please sign in to comment.