Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
41074ad
test: update configs with soneium (#81)
0xChin Nov 27, 2025
1561a44
fix: forge fmt (#84)
0xChin Nov 27, 2025
a4606e8
Merge branch 'main' into sc-feat/configs-update
0xDiscotech Nov 27, 2025
a39d229
Merge branch 'main' into chore/sync-main
0xChin Nov 28, 2025
0323300
Merge branch 'main' into chore/sync-main
0xChin Nov 28, 2025
1ab812b
Merge pull request #87 from defi-wonderland/chore/sync-main
0xDiscotech Nov 28, 2025
61863c8
fix: build error (#88)
0xChin Nov 28, 2025
b3feacd
fix: warning
0xDiscotech Nov 28, 2025
b0b425b
chore: sync prod configs (#94)
0xChin Dec 4, 2025
8f64339
chore: update tasks config values
0xChin Dec 10, 2025
2a87370
Merge branch 'main' into chore/sync-prod-configs
0xChin Dec 10, 2025
9a16ce0
fix: remove wrong config
0xChin Dec 10, 2025
e0695de
Merge pull request #97 from defi-wonderland/chore/sync-prod-configs
0xDiscotech Dec 10, 2025
1cbc138
feat: add production task (#98)
0xChin Dec 11, 2025
9ebf89d
Merge branch 'main' into chore/sync-and-fusaka-blocks
0xChin Dec 11, 2025
1e23feb
test: use fusaka block numbers and update regression tests
0xChin Dec 11, 2025
cece3da
fix: sep task order on name
0xDiscotech Dec 11, 2025
9d73dcb
Merge pull request #99 from defi-wonderland/chore/sync-and-fusaka-blocks
0xDiscotech Dec 11, 2025
55f0e45
fix: integration and stack simulate tests (#100)
0xDiscotech Dec 11, 2025
294dfb1
Merge branch 'main' into chore/sync-prod-configs
0xChin Dec 12, 2025
eff68e1
fix: update message hashes
0xDiscotech Dec 12, 2025
a44782d
fix: reduce upgrade gas limit (#102)
0xChin Dec 12, 2025
7228ff8
chore: update gas limit on examples as well
0xDiscotech Dec 12, 2025
8e57372
Merge pull request #101 from defi-wonderland/chore/sync-prod-configs
0xDiscotech Dec 12, 2025
7ab25a3
fix: sep council msg hash based on stacked simulation (#103)
0xDiscotech Dec 16, 2025
825301e
fix: add nonce overrides in sepolia task, fix hash in eth task (#106)
0xChin Dec 16, 2025
fd7c738
fix: remove pao nonce update on 048 and msg hashes (#107)
0xDiscotech Dec 16, 2025
cc21765
Merge branch 'main' into chore/sync-prod-configs-3
0xChin Dec 18, 2025
7cfbd99
Merge pull request #108 from defi-wonderland/chore/sync-prod-configs-3
0xDiscotech Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/tasks/eth/037-rev-share-ink-soneium/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TENDERLY_GAS=16700000
36 changes: 36 additions & 0 deletions src/tasks/eth/037-rev-share-ink-soneium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 037-rev-share-ink-soneium: RevShare Upgrade and Setup for Ink and Soneium Mainnets

Status: [DRAFT, NOT READY TO SIGN]()

## Objective

Upgrade proxies and setup RevShare contracts for Ink and Soneium Mainnets. This task:

1. Deploys all needed contract implementations:
- FeeVaults
- FeeSplitter
- L1Withdrawer (pointing to the FeesDepositor on L1)
- RevShareCalculator (pointing to the L1Withdrawer and the ChainFeesRecipient)
2. Upgrades the fee vault proxy implementations (SequencerFeeVault, BaseFeeVault, L1FeeVault, OperatorFeeVault) on Ink and Soneium L2s
3. Sets FeeSplitter predeploy to point to the new FeeSplitter implementation and initializes it with the RevShareCalculator address

Target chains:

- Ink Mainnet (chainId: 57073)
- Soneium Mainnet (chainId: 1868)

## Simulation & Signing

Simulation commands for each safe:

```bash
cd src/tasks/eth/037-rev-share-ink-soneium
SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path "$(pwd)"/.env --justfile ../../../justfile simulate <council|foundation>
```

Signing commands for each safe:

```bash
cd src/tasks/eth/037-rev-share-ink-soneium
SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path "$(pwd)"/.env --justfile ../../../justfile sign <council|foundation>
```
29 changes: 29 additions & 0 deletions src/tasks/eth/037-rev-share-ink-soneium/VALIDATION.md
Comment thread
maurelian marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Validation

This document can be used to validate the inputs and result of the execution of the upgrade transaction which you are
signing.

## Expected Domain and Message Hashes

Validate the domain and message hashes. These values should match both the values on your ledger and
the values printed to the terminal when you run the task.

> [!CAUTION]
>
> Before signing, ensure the below hashes match what is on your ledger.
>
> ### Nested Safe 1 (Foundation): `0x847B5c174615B1B7fDF770882256e2D3E95b9D92`
>
> - Domain Hash: `0xa4a9c312badf3fcaa05eafe5dc9bee8bd9316c78ee8b0bebe3115bb21b732672`
> - Message Hash: `0x54ce340c4739a7b821abc9a4d1fc553ef3eab9af2a4f6d6cd8b029e254050c0f`
>
> ### Nested Safe 2 (Security Council): `0xc2819DC788505Aac350142A7A707BF9D03E3Bd03`
>
> - Domain Hash: `0xdf53d510b56e539b90b369ef08fce3631020fbf921e3136ea5f8747c20bce967`
> - Message Hash: `0xddd5bfdade4e3e69c2a1055039c1f159b6fc48e52a21206cbaf0828ec7f06008`

## Task Calldata

```
0x82ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000071241bbae674967dd523e621c272ea32cf33119a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001841a80dc38000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005d66c1782664115999c47c9fa5cd031f495d3e4f0000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c35000000000000000000000000005f077b4c3509c2c192e50b6654d924fcb8126a6000000000000000000000000088e529a6ccd302c948689cd5156c83d4614fae920000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000f07b3169fff67a8aecdbb18d9761aeee3459111200000000000000000000000000000000000000000000000000000000
```
36 changes: 36 additions & 0 deletions src/tasks/eth/037-rev-share-ink-soneium/config.toml
Comment thread
maurelian marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# RevShare Upgrade And Setup Configuration

templateName = "RevShareUpgradeAndSetup"

# L2 chains to target
l2chains = [{name = "Ink", chainId = 57073}, {name = "Soneium", chainId = 1868}]

safeAddress = "ProxyAdminOwner"

# RevShareContractsUpgrader address
revShareUpgrader = "0x71241bbae674967dd523e621c272ea32cf33119a"

# RevShare configurations (one per chain) - flattened arrays
portals = [
"0x5d66C1782664115999C47c9fA5cd031f495D3e4F", # Ink Mainnet Portal
"0x88e529A6ccd302c948689Cd5156C83D4614FAE92" # Soneium Mainnet Portal
]

chainFeesRecipients = [
"0x5f077b4c3509C2c192e50B6654d924Fcb8126A60", # L1Withdrawer to send funds in Mainnet to address 0xa6f0F94C13C4255231958079E7331694205F6c93
"0xF07b3169ffF67A8AECdBb18d9761AEeE34591112"
Comment thread
maurelian marked this conversation as resolved.
]

# 2 ether
l1WithdrawerMinWithdrawalAmounts = [2000000000000000000, 2000000000000000000]

# FeesDepositor address in mainnet
l1WithdrawerRecipients = [
"0xed9B99a703BaD32AC96FDdc313c0652e379251Fd",
"0xed9B99a703BaD32AC96FDdc313c0652e379251Fd"
]
l1WithdrawerGasLimits = [800000, 800000]

[addresses]
ProxyAdminOwner = "0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A"

1 change: 1 addition & 0 deletions src/tasks/sep/049-rev-share-ink-soneium/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TENDERLY_GAS=16700000
44 changes: 44 additions & 0 deletions src/tasks/sep/049-rev-share-ink-soneium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 049-rev-share-ink-soneium: RevShare Upgrade and Setup for Ink Sepolia and Soneium Minato

Status: [DRAFT, NOT READY TO SIGN]()

## Objective

Upgrade proxies and setup RevShare contracts for Ink Sepolia and Soneium Testnet Minato. This task:

1. Deploys all needed contract implementations:
- FeeVaults
- FeeSplitter
- L1Withdrawer (pointing to the FeesDepositor on L1)
- RevShareCalculator (pointing to the L1Withdrawer and the ChainFeesRecipient)
2. Upgrades the fee vault proxy implementations (SequencerFeeVault, BaseFeeVault, L1FeeVault, OperatorFeeVault) on Ink Sepolia and Soneium Minato L2s
3. Sets FeeSplitter predeploy to point to the new FeeSplitter implementation and initializes it with the RevShareCalculator address

Target chains:

- Ink Sepolia (chainId: 763373)
- Soneium Testnet Minato (chainId: 1946)

## Simulation & Signing

> **Note:** This task depends on prior tasks in the Sepolia stack (047, 048). The hashes in VALIDATION.md
> were generated using `simulate-stack` which simulates all tasks in sequence. Running `simulate` individually
> may show different hashes because it doesn't account for nonce increments from prior tasks.

Simulation commands for each safe:

```bash
# For stacked simulation (recommended for validation):
just simulate-stack sep 049-rev-share-ink-soneium <council|foundation>

# For individual simulation:
cd src/tasks/sep/049-rev-share-ink-soneium
SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path "$(pwd)"/.env --justfile ../../../justfile simulate <council|foundation>
```

Signing commands for each safe:

```bash
cd src/tasks/sep/049-rev-share-ink-soneium
just --dotenv-path "$(pwd)"/.env --justfile ../../../justfile sign <council|foundation>
```
29 changes: 29 additions & 0 deletions src/tasks/sep/049-rev-share-ink-soneium/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Validation

This document can be used to validate the inputs and result of the execution of the upgrade transaction which you are
signing.

## Expected Domain and Message Hashes

Validate the domain and message hashes. These values should match both the values on your ledger and
the values printed to the terminal when you run the task.

> [!CAUTION]
>
> Before signing, ensure the below hashes match what is on your ledger.
>
> ### Nested Safe 1 (Foundation): `0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B`
>
> - Domain Hash: `0x37e1f5dd3b92a004a23589b741196c8a214629d4ea3a690ec8e41ae45c689cbb`
> - Message Hash: `0x525fe8644760f20a75f3e4b4e33f7e980d3c16270a1aa01e724a6a0b9c3cb888`
>
> ### Nested Safe 2 (Security Council): `0xf64bc17485f0B4Ea5F06A96514182FC4cB561977`
>
> - Domain Hash: `0xbe081970e9fc104bd1ea27e375cd21ec7bb1eec56bfe43347c3e36c5d27b8533`
> - Message Hash: `0x7aab487c69b9f7c565a696bec5c74ea6ae486eeb746dabc87e7182d0cc5bf0e7`

## Task Calldata

```
0x82ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000071241bbae674967dd523e621c272ea32cf33119a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001841a80dc38000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005c1d29c6c9c8b0800692acc95d700bcb4966a1d70000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000bea2bc852a160b8547273660e22f4f08c2fa9bbb00000000000000000000000065ea1489741a5d72ffdd8e6485b216bbdcc15af30000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000660203dd7e933646905dfdc2c3c0bb156d51000a00000000000000000000000000000000000000000000000000000000
```
44 changes: 44 additions & 0 deletions src/tasks/sep/049-rev-share-ink-soneium/config.toml
Comment thread
maurelian marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# RevShare Upgrade and Setup Configuration

templateName = "RevShareUpgradeAndSetup"

# L2 chains to target
l2chains = [
{name = "Ink Sepolia", chainId = 763373},
{name = "Soneium Testnet Minato", chainId = 1946}
]

safeAddress = "ProxyAdminOwner"

# RevShareContractsUpgrader address
revShareUpgrader = "0x71241bbae674967dD523e621c272Ea32cf33119A"

# RevShare configurations (one per chain) - flattened arrays
portals = [
"0x5c1d29C6c9C8b0800692acC95D700bcb4966A1d7", # Ink Sepolia Portal
"0x65ea1489741A5D72fFdD8e6485B216bBdcC15Af3" # Soneium Testnet Minato Portal
]

chainFeesRecipients = [
"0xBeA2Bc852a160B8547273660E22F4F08C2fa9Bbb",
"0x660203DD7E933646905DfDc2C3c0Bb156d51000A"
]

# 2 ether
l1WithdrawerMinWithdrawalAmounts = [2000000000000000000, 2000000000000000000]

# FeesDepositor address in mainnet
l1WithdrawerRecipients = [
"0xed9B99a703BaD32AC96FDdc313c0652e379251Fd",
"0xed9B99a703BaD32AC96FDdc313c0652e379251Fd"
]
l1WithdrawerGasLimits = [800000, 800000]

[addresses]
ProxyAdminOwner = "0x1Eb2fFc903729a0F03966B917003800b145F56E2"

[stateOverrides]
# Security Council
0xf64bc17485f0B4Ea5F06A96514182FC4cB561977 = [
{key = "0x0000000000000000000000000000000000000000000000000000000000000005", value = 60}
]
37 changes: 18 additions & 19 deletions test/integration/IntegrationBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {ISuperchainRevSharesCalculator} from "src/interfaces/ISuperchainRevShare
/// @title IntegrationBase
/// @notice Base contract for integration tests with L1->L2 deposit transaction relay functionality
abstract contract IntegrationBase is Test {
// Events for testing
// Event for testing
event WithdrawalInitiated(address indexed recipient, uint256 amount);

// Fork IDs
Expand All @@ -44,23 +44,28 @@ abstract contract IntegrationBase is Test {
address internal constant L1_FEE_VAULT = 0x420000000000000000000000000000000000001A;
address internal constant FEE_SPLITTER = 0x420000000000000000000000000000000000002B;

// Test configuration - Globals
uint256 internal constant DEFAULT_MIN_WITHDRAWAL_AMOUNT = 2 ether;
uint32 internal constant DEFAULT_WITHDRAWAL_GAS_LIMIT = 800000;
address internal constant FEES_DEPOSITOR = 0xed9B99a703BaD32AC96FDdc313c0652e379251Fd;

// Test configuration - OP Mainnet
uint256 internal constant OP_MIN_WITHDRAWAL_AMOUNT = 350000;
address internal constant OP_L1_WITHDRAWAL_RECIPIENT = 0x0000000000000000000000000000000000000001;
uint32 internal constant OP_WITHDRAWAL_GAS_LIMIT = 800000;
address internal constant OP_CHAIN_FEES_RECIPIENT = 0x0000000000000000000000000000000000000001;
uint256 internal constant OP_MIN_WITHDRAWAL_AMOUNT = DEFAULT_MIN_WITHDRAWAL_AMOUNT;
address internal constant OP_L1_WITHDRAWAL_RECIPIENT = FEES_DEPOSITOR;
uint32 internal constant OP_WITHDRAWAL_GAS_LIMIT = DEFAULT_WITHDRAWAL_GAS_LIMIT;
address internal constant OP_CHAIN_FEES_RECIPIENT = 0x16A27462B4D61BDD72CbBabd3E43e11791F7A28c;

// Test configuration - Ink Mainnet
uint256 internal constant INK_MIN_WITHDRAWAL_AMOUNT = 500000;
address internal constant INK_L1_WITHDRAWAL_RECIPIENT = 0x0000000000000000000000000000000000000002;
uint32 internal constant INK_WITHDRAWAL_GAS_LIMIT = 800000;
address internal constant INK_CHAIN_FEES_RECIPIENT = 0x0000000000000000000000000000000000000002;
uint256 internal constant INK_MIN_WITHDRAWAL_AMOUNT = DEFAULT_MIN_WITHDRAWAL_AMOUNT;
address internal constant INK_L1_WITHDRAWAL_RECIPIENT = FEES_DEPOSITOR;
uint32 internal constant INK_WITHDRAWAL_GAS_LIMIT = DEFAULT_WITHDRAWAL_GAS_LIMIT;
address internal constant INK_CHAIN_FEES_RECIPIENT = 0x5f077b4c3509C2c192e50B6654d924Fcb8126A60;

// Test configuration - Soneium Mainnet
uint256 internal constant SONEIUM_MIN_WITHDRAWAL_AMOUNT = 500000;
address internal constant SONEIUM_L1_WITHDRAWAL_RECIPIENT = 0x0000000000000000000000000000000000000003;
uint32 internal constant SONEIUM_WITHDRAWAL_GAS_LIMIT = 800000;
address internal constant SONEIUM_CHAIN_FEES_RECIPIENT = 0x0000000000000000000000000000000000000003;
uint256 internal constant SONEIUM_MIN_WITHDRAWAL_AMOUNT = DEFAULT_MIN_WITHDRAWAL_AMOUNT;
address internal constant SONEIUM_L1_WITHDRAWAL_RECIPIENT = FEES_DEPOSITOR;
uint32 internal constant SONEIUM_WITHDRAWAL_GAS_LIMIT = DEFAULT_WITHDRAWAL_GAS_LIMIT;
address internal constant SONEIUM_CHAIN_FEES_RECIPIENT = 0xF07b3169ffF67A8AECdBb18d9761AEeE34591112;

bool internal constant IS_SIMULATE = true;
/// @notice Relay all deposit transactions from L1 to multiple L2s
Expand Down Expand Up @@ -318,14 +323,8 @@ abstract contract IntegrationBase is Test {
vm.selectFork(_forkId);
vm.warp(block.timestamp + IFeeSplitter(FEE_SPLITTER).feeDisbursementInterval() + 1);

uint256 balanceBefore = Predeploys.L2_TO_L1_MESSAGE_PASSER.balance;

vm.expectEmit(true, true, true, true);
emit WithdrawalInitiated(_l1WithdrawalRecipient, _expectedWithdrawalAmount);
IFeeSplitter(FEE_SPLITTER).disburseFees();

uint256 balanceAfter = Predeploys.L2_TO_L1_MESSAGE_PASSER.balance;

assertEq(balanceAfter - balanceBefore, _expectedWithdrawalAmount);
}
}
56 changes: 19 additions & 37 deletions test/integration/RevShareContractsUpgraderIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ contract RevShareContractsUpgraderIntegrationTest is IntegrationBase {
RevShareUpgradeAndSetup public revShareTask;

function setUp() public {
// Create forks for L1 (mainnet) and L2s
// Create forks for L1 (mainnet) and L2s (Ink and Soneium only - need proxy upgrade)
_mainnetForkId = vm.createFork("http://127.0.0.1:8545");
_opMainnetForkId = vm.createFork("http://127.0.0.1:9545");
_inkMainnetForkId = vm.createFork("http://127.0.0.1:9546");
_soneiumMainnetForkId = vm.createFork("http://127.0.0.1:9547");

Expand All @@ -27,42 +26,26 @@ contract RevShareContractsUpgraderIntegrationTest is IntegrationBase {
revShareTask = new RevShareUpgradeAndSetup();
}

/// @notice Test the integration of upgradeAndSetupRevShare
/// @notice Test the integration of upgradeAndSetupRevShare (Ink and Soneium only - need proxy upgrade)
function test_upgradeAndSetupRevShare_integration() public {
// Step 1: Record logs for L1→L2 message relay
vm.recordLogs();

// Step 2: Execute task simulation
revShareTask.simulate("test/tasks/example/eth/016-revshare-upgrade-and-setup/config.toml");
revShareTask.simulate("test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/config.toml");

// Step 3: Relay deposit transactions from L1 to all L2s
uint256[] memory forkIds = new uint256[](3);
forkIds[0] = _opMainnetForkId;
forkIds[1] = _inkMainnetForkId;
forkIds[2] = _soneiumMainnetForkId;
// Step 3: Relay deposit transactions from L1 to Ink and Soneium
uint256[] memory forkIds = new uint256[](2);
forkIds[0] = _inkMainnetForkId;
forkIds[1] = _soneiumMainnetForkId;

address[] memory portals = new address[](3);
portals[0] = OP_MAINNET_PORTAL;
portals[1] = INK_MAINNET_PORTAL;
portals[2] = SONEIUM_MAINNET_PORTAL;
address[] memory portals = new address[](2);
portals[0] = INK_MAINNET_PORTAL;
portals[1] = SONEIUM_MAINNET_PORTAL;

_relayAllMessages(forkIds, IS_SIMULATE, portals);

// Step 4: Assert the state of the OP Mainnet contracts
vm.selectFork(_opMainnetForkId);
address opL1Withdrawer =
_computeL1WithdrawerAddress(OP_MIN_WITHDRAWAL_AMOUNT, OP_L1_WITHDRAWAL_RECIPIENT, OP_WITHDRAWAL_GAS_LIMIT);
address opRevShareCalculator = _computeRevShareCalculatorAddress(opL1Withdrawer, OP_CHAIN_FEES_RECIPIENT);
_assertL2State(
opL1Withdrawer,
opRevShareCalculator,
OP_MIN_WITHDRAWAL_AMOUNT,
OP_L1_WITHDRAWAL_RECIPIENT,
OP_WITHDRAWAL_GAS_LIMIT,
OP_CHAIN_FEES_RECIPIENT
);

// Step 5: Assert the state of the Ink Mainnet contracts
// Step 4: Assert the state of the Ink Mainnet contracts
vm.selectFork(_inkMainnetForkId);
address inkL1Withdrawer = _computeL1WithdrawerAddress(
INK_MIN_WITHDRAWAL_AMOUNT, INK_L1_WITHDRAWAL_RECIPIENT, INK_WITHDRAWAL_GAS_LIMIT
Expand All @@ -77,7 +60,7 @@ contract RevShareContractsUpgraderIntegrationTest is IntegrationBase {
INK_CHAIN_FEES_RECIPIENT
);

// Step 6: Assert the state of the Soneium Mainnet contracts
// Step 5: Assert the state of the Soneium Mainnet contracts
vm.selectFork(_soneiumMainnetForkId);
address soneiumL1Withdrawer = _computeL1WithdrawerAddress(
SONEIUM_MIN_WITHDRAWAL_AMOUNT, SONEIUM_L1_WITHDRAWAL_RECIPIENT, SONEIUM_WITHDRAWAL_GAS_LIMIT
Expand All @@ -93,21 +76,20 @@ contract RevShareContractsUpgraderIntegrationTest is IntegrationBase {
SONEIUM_CHAIN_FEES_RECIPIENT
);

// Step 7: Do a withdrawal flow
// Step 6: Do a withdrawal flow

// Fund vaults with amount > minWithdrawalAmount
_fundVaults(1 ether, _opMainnetForkId);
_fundVaults(1 ether, _inkMainnetForkId);
_fundVaults(1 ether, _soneiumMainnetForkId);
// It disburses 5 ether to each of the 4 vaults, so total sent is 20 ether per chain
_fundVaults(5 ether, _inkMainnetForkId);
_fundVaults(5 ether, _soneiumMainnetForkId);

// Disburse fees in all chains and expect the L1Withdrawer to trigger the withdrawal
// Expected L1Withdrawer share = 3 ether * 15% = 0.45 ether
// It is 3 ether instead of 4 because net revenue doesn't count L1FeeVault's balance
// Expected L1Withdrawer share = 15 ether * 15% = 2.25 ether
// It is 15 ether instead of 20 because net revenue doesn't count L1FeeVault's balance
// For details on the rev share calculation, check the SuperchainRevSharesCalculator contract.
// https://github.com/ethereum-optimism/optimism/blob/f392d4b7e8bc5d1c8d38fcf19c8848764f8bee3b/packages/contracts-bedrock/src/L2/SuperchainRevSharesCalculator.sol#L67-L101
uint256 expectedWithdrawalAmount = 0.45 ether;
uint256 expectedWithdrawalAmount = 2.25 ether;

_executeDisburseAndAssertWithdrawal(_opMainnetForkId, OP_L1_WITHDRAWAL_RECIPIENT, expectedWithdrawalAmount);
_executeDisburseAndAssertWithdrawal(_inkMainnetForkId, INK_L1_WITHDRAWAL_RECIPIENT, expectedWithdrawalAmount);
_executeDisburseAndAssertWithdrawal(
_soneiumMainnetForkId, SONEIUM_L1_WITHDRAWAL_RECIPIENT, expectedWithdrawalAmount
Expand Down
Loading