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 clement-ux changed the title Upgrade OETH ARM [Origin ARM] Deploy upgrade. Dec 5, 2025
@clement-ux clement-ux changed the title [Origin ARM] Deploy upgrade. [Origin ARM] Upgrade script and cleanup. Dec 5, 2025
@clement-ux clement-ux self-assigned this Dec 5, 2025
@clement-ux clement-ux added the Deployment script Deployment script for smart contract. label Dec 5, 2025
naddison36
naddison36 previously approved these changes Dec 9, 2025
Copy link
Collaborator

@naddison36 naddison36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good

@naddison36 naddison36 merged commit ebc416d into main Dec 9, 2025
8 checks passed
@naddison36 naddison36 deleted the clement/upgrade-OETH-ARM branch December 9, 2025 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Deployment script Deployment script for smart contract.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants