Skip to content

Conversation

@clement-ux
Copy link
Contributor

@clement-ux clement-ux commented Oct 23, 2025

Description

This PR aims to create the deployment script to upgrade the current OEHT ARM to the latest contract OriginARM.

Slot overriding

Even if this contract has already been initialized, we will initialize it again because the old storage slot are not aligned with the new storage slot.

Current storage slots:

$ cast storage -r RPC_URL -e ETHERSCAN_API_KEY -c 1 0xd8ff298eaed581f74ab845af62c48acf85b2f05e
╭--------------+-------------+------+--------+-------╮
| Name         | Type        | Slot | Offset | Bytes |
+==============+=============+======+========+=======+
| initialized  | bool        | 0    | 0      | 1     |
|--------------+-------------+------+--------+-------|
| initializing | bool        | 0    | 1      | 1     |
|--------------+-------------+------+--------+-------|
| gap          | uint256[50] | 1    | 0      | 1600  |
|--------------+-------------+------+--------+-------|
| operator     | address     | 51   | 0      | 20    |
|--------------+-------------+------+--------+-------|
| _gap         | uint256[50] | 52   | 0      | 1600  |
╰--------------+-------------+------+--------+-------╯

New storage slots:

$ forge inspect OriginARM storageLayout
╭-----------------------+------------------+------+--------+-------╮
| Name                  | Type             | Slot | Offset | Bytes |
+=======================+==================+======+========+=======+
| operator              | address          | 0    | 0      | 20    |
|-----------------------+------------------+------+--------+-------|
| _gap                  | uint256[49]      | 1    | 0      | 1568  |
|-----------------------+------------------+------+--------+-------|
| traderate0            | uint256          | 50   | 0      | 32    |
|-----------------------+------------------+------+--------+-------|
| traderate1            | uint256          | 51   | 0      | 32    |
|-----------------------+------------------+------+--------+-------|
| crossPrice            | uint256          | 52   | 0      | 32    |
|-----------------------+------------------+------+--------+-------|
| withdrawsQueued       | uint128          | 53   | 0      | 16    |
|-----------------------+------------------+------+--------+-------|
| withdrawsClaimed      | uint128          | 53   | 16     | 16    |
|-----------------------+------------------+------+--------+-------|
| nextWithdrawalIndex   | uint256          | 54   | 0      | 32    |
|-----------------------+------------------+------+--------+-------|
| withdrawalRequests    | mapping          | 55   | 0      | 32    |
|-----------------------+------------------+------+--------+-------|
| fee                   | uint16           | 56   | 0      | 2     |
|-----------------------+------------------+------+--------+-------|
| lastAvailableAssets   | int128           | 56   | 2      | 16    |
|-----------------------+------------------+------+--------+-------|
| feeCollector          | address          | 57   | 0      | 20    |
|-----------------------+------------------+------+--------+-------|
| capManager            | address          | 58   | 0      | 20    |
|-----------------------+------------------+------+--------+-------|
| activeMarket          | address          | 59   | 0      | 20    |
|-----------------------+------------------+------+--------+-------|
| supportedMarkets      | mapping          | 60   | 0      | 32    |
|-----------------------+------------------+------+--------+-------|
| armBuffer             | uint256          | 61   | 0      | 32    |
|-----------------------+------------------+------+--------+-------|
| _gap                  | uint256[38]      | 62   | 0      | 1216  |
|-----------------------+------------------+------+--------+-------|
| vaultWithdrawalAmount | uint256          | 100  | 0      | 32    |
╰-----------------------+------------------+------+--------+-------╯

Governance upgrade

  1. & 2. Transfer all OETH and WETH in the ARM to the TreasuryLP address: 0x6E3fddab68Bf1EBaf9daCF9F7907c7Bc0951D1dc. This is done to avoid silly assets per share ration.
  2. Timelock approves OETH ARM to pull WETH (as it mint small shares)
  3. Upgrade the ARM proxy with new implementation and call initialization.

clement-ux and others added 30 commits October 3, 2025 11:46
clement-ux and others added 3 commits October 24, 2025 11:20
* remove old OETH ARM

* fix: correct contract names to use consistent LidoARM casing

* remove unused import

* fix failing test

* fix failing test

* generate puml files
@clement-ux clement-ux marked this pull request as ready for review October 30, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants