diff --git a/src/tasks/eth/037-rev-share-ink-soneium/.env b/src/tasks/eth/037-rev-share-ink-soneium/.env new file mode 100644 index 0000000000..737d60cbf0 --- /dev/null +++ b/src/tasks/eth/037-rev-share-ink-soneium/.env @@ -0,0 +1 @@ +TENDERLY_GAS=16700000 \ No newline at end of file diff --git a/src/tasks/eth/037-rev-share-ink-soneium/README.md b/src/tasks/eth/037-rev-share-ink-soneium/README.md new file mode 100644 index 0000000000..0298d85dc2 --- /dev/null +++ b/src/tasks/eth/037-rev-share-ink-soneium/README.md @@ -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 +``` + +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 +``` diff --git a/src/tasks/eth/037-rev-share-ink-soneium/VALIDATION.md b/src/tasks/eth/037-rev-share-ink-soneium/VALIDATION.md new file mode 100644 index 0000000000..ac55c285d4 --- /dev/null +++ b/src/tasks/eth/037-rev-share-ink-soneium/VALIDATION.md @@ -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 +``` diff --git a/src/tasks/eth/037-rev-share-ink-soneium/config.toml b/src/tasks/eth/037-rev-share-ink-soneium/config.toml new file mode 100644 index 0000000000..b34a425689 --- /dev/null +++ b/src/tasks/eth/037-rev-share-ink-soneium/config.toml @@ -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" +] + +# 2 ether +l1WithdrawerMinWithdrawalAmounts = [2000000000000000000, 2000000000000000000] + +# FeesDepositor address in mainnet +l1WithdrawerRecipients = [ + "0xed9B99a703BaD32AC96FDdc313c0652e379251Fd", + "0xed9B99a703BaD32AC96FDdc313c0652e379251Fd" +] +l1WithdrawerGasLimits = [800000, 800000] + +[addresses] +ProxyAdminOwner = "0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A" + diff --git a/src/tasks/sep/049-rev-share-ink-soneium/.env b/src/tasks/sep/049-rev-share-ink-soneium/.env new file mode 100644 index 0000000000..fe89703585 --- /dev/null +++ b/src/tasks/sep/049-rev-share-ink-soneium/.env @@ -0,0 +1 @@ +TENDERLY_GAS=16700000 diff --git a/src/tasks/sep/049-rev-share-ink-soneium/README.md b/src/tasks/sep/049-rev-share-ink-soneium/README.md new file mode 100644 index 0000000000..c95b14bc14 --- /dev/null +++ b/src/tasks/sep/049-rev-share-ink-soneium/README.md @@ -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 + +# For individual simulation: +cd src/tasks/sep/049-rev-share-ink-soneium +SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path "$(pwd)"/.env --justfile ../../../justfile simulate +``` + +Signing commands for each safe: + +```bash +cd src/tasks/sep/049-rev-share-ink-soneium +just --dotenv-path "$(pwd)"/.env --justfile ../../../justfile sign +``` diff --git a/src/tasks/sep/049-rev-share-ink-soneium/VALIDATION.md b/src/tasks/sep/049-rev-share-ink-soneium/VALIDATION.md new file mode 100644 index 0000000000..bb87a8c5dc --- /dev/null +++ b/src/tasks/sep/049-rev-share-ink-soneium/VALIDATION.md @@ -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 +``` diff --git a/src/tasks/sep/049-rev-share-ink-soneium/config.toml b/src/tasks/sep/049-rev-share-ink-soneium/config.toml new file mode 100644 index 0000000000..9b95827c7c --- /dev/null +++ b/src/tasks/sep/049-rev-share-ink-soneium/config.toml @@ -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} +] diff --git a/test/integration/IntegrationBase.t.sol b/test/integration/IntegrationBase.t.sol index 9e6757659e..b034ed048b 100644 --- a/test/integration/IntegrationBase.t.sol +++ b/test/integration/IntegrationBase.t.sol @@ -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 @@ -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 @@ -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); } } diff --git a/test/integration/RevShareContractsUpgraderIntegration.t.sol b/test/integration/RevShareContractsUpgraderIntegration.t.sol index 904ee507f3..0a5ca87cb2 100644 --- a/test/integration/RevShareContractsUpgraderIntegration.t.sol +++ b/test/integration/RevShareContractsUpgraderIntegration.t.sol @@ -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"); @@ -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 @@ -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 @@ -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 diff --git a/test/integration/RevShareSetupIntegration.t.sol b/test/integration/RevShareSetupIntegration.t.sol index 13f10477a5..6b3f759e8c 100644 --- a/test/integration/RevShareSetupIntegration.t.sol +++ b/test/integration/RevShareSetupIntegration.t.sol @@ -30,11 +30,9 @@ contract RevShareSetupIntegrationTest is IntegrationBase { address internal _feeSplitterImpl; function setUp() public { - // Create forks for L1 (mainnet) and L2s (OP Mainnet, Ink, Soneium) + // Create forks for L1 (mainnet) and L2 (OP Mainnet only - proxies already upgraded) _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"); // Deploy contracts on L1 vm.selectFork(_mainnetForkId); @@ -63,7 +61,7 @@ contract RevShareSetupIntegrationTest is IntegrationBase { Proxy proxyTemplate = new Proxy(address(this)); bytes memory proxyCode = address(proxyTemplate).code; - // Etch predeploys on OP Mainnet fork + // Etch predeploys on OP Mainnet fork (proxies already upgraded, just need setup) vm.selectFork(_opMainnetForkId); _etchImplementations( _operatorFeeVaultImpl, @@ -79,38 +77,6 @@ contract RevShareSetupIntegrationTest is IntegrationBase { proxyCode, _operatorFeeVaultImpl, _sequencerFeeVaultImpl, _defaultFeeVaultImpl, _feeSplitterImpl ); - // Etch predeploys on Ink Mainnet fork - vm.selectFork(_inkMainnetForkId); - _etchImplementations( - _operatorFeeVaultImpl, - _sequencerFeeVaultImpl, - _defaultFeeVaultImpl, - _feeSplitterImpl, - operatorFeeVaultImplCode, - sequencerFeeVaultImplCode, - defaultFeeVaultImplCode, - feeSplitterImplCode - ); - _setupProxyPredeploys( - proxyCode, _operatorFeeVaultImpl, _sequencerFeeVaultImpl, _defaultFeeVaultImpl, _feeSplitterImpl - ); - - // Etch predeploys on Soneium Mainnet fork - vm.selectFork(_soneiumMainnetForkId); - _etchImplementations( - _operatorFeeVaultImpl, - _sequencerFeeVaultImpl, - _defaultFeeVaultImpl, - _feeSplitterImpl, - operatorFeeVaultImplCode, - sequencerFeeVaultImplCode, - defaultFeeVaultImplCode, - feeSplitterImplCode - ); - _setupProxyPredeploys( - proxyCode, _operatorFeeVaultImpl, _sequencerFeeVaultImpl, _defaultFeeVaultImpl, _feeSplitterImpl - ); - // Switch back to mainnet fork after setup vm.selectFork(_mainnetForkId); } @@ -189,24 +155,20 @@ contract RevShareSetupIntegrationTest is IntegrationBase { vm.store(FEE_SPLITTER, PROXY_OWNER_SLOT, bytes32(uint256(uint160(RevShareCommon.PROXY_ADMIN)))); } - /// @notice Test the integration of setupRevShare + /// @notice Test the integration of setupRevShare (OP Mainnet only - proxies already upgraded) function test_setupRevShare_integration() public { // Step 1: Record logs for L1→L2 message replay vm.recordLogs(); // Step 2: Execute task simulation - revShareTask.simulate("test/tasks/example/eth/017-revshare-setup/config.toml"); + revShareTask.simulate("test/tasks/example/eth/016-revshare-setup/config.toml"); - // Step 3: Relay deposit transactions from L1 to all L2s - uint256[] memory forkIds = new uint256[](3); + // Step 3: Relay deposit transactions from L1 to OP Mainnet + uint256[] memory forkIds = new uint256[](1); forkIds[0] = _opMainnetForkId; - forkIds[1] = _inkMainnetForkId; - forkIds[2] = _soneiumMainnetForkId; - address[] memory portals = new address[](3); + address[] memory portals = new address[](1); portals[0] = OP_MAINNET_PORTAL; - portals[1] = INK_MAINNET_PORTAL; - portals[2] = SONEIUM_MAINNET_PORTAL; _relayAllMessages(forkIds, IS_SIMULATE, portals); @@ -224,55 +186,19 @@ contract RevShareSetupIntegrationTest is IntegrationBase { OP_CHAIN_FEES_RECIPIENT ); - // Step 5: 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 - ); - address inkRevShareCalculator = _computeRevShareCalculatorAddress(inkL1Withdrawer, INK_CHAIN_FEES_RECIPIENT); - _assertL2State( - inkL1Withdrawer, - inkRevShareCalculator, - INK_MIN_WITHDRAWAL_AMOUNT, - INK_L1_WITHDRAWAL_RECIPIENT, - INK_WITHDRAWAL_GAS_LIMIT, - INK_CHAIN_FEES_RECIPIENT - ); - - // Step 6: 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 - ); - address soneiumRevShareCalculator = - _computeRevShareCalculatorAddress(soneiumL1Withdrawer, SONEIUM_CHAIN_FEES_RECIPIENT); - _assertL2State( - soneiumL1Withdrawer, - soneiumRevShareCalculator, - SONEIUM_MIN_WITHDRAWAL_AMOUNT, - SONEIUM_L1_WITHDRAWAL_RECIPIENT, - SONEIUM_WITHDRAWAL_GAS_LIMIT, - SONEIUM_CHAIN_FEES_RECIPIENT - ); - - // Step 7: Do a withdrawal flow + // Step 5: 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 + _fundVaults(5 ether, _opMainnetForkId); - // 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 + // Disburse fees and expect the L1Withdrawer to trigger the withdrawal + // 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 - ); } } diff --git a/test/tasks/Regression.t.sol b/test/tasks/Regression.t.sol index ce08bbb965..fcce553564 100644 --- a/test/tasks/Regression.t.sol +++ b/test/tasks/Regression.t.sol @@ -984,20 +984,20 @@ contract RegressionTest is Test { _assertDataToSignNestedMultisig(multisigTask, actions, expectedDataToSign, MULTICALL3_ADDRESS, rootSafe); } - /// @notice Expected call data and data to sign generated by manually running the RevShareSetup template at block 23820274 on mainnet. - /// Simulate from task directory (test/tasks/example/eth/017-revshare-setup) with: + /// @notice Expected call data and data to sign generated by manually running the RevShareSetup template at block 23992159 on mainnet. + /// Simulate from task directory (test/tasks/example/eth/016-revshare-setup) with: /// SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path "$(pwd)"/.env --justfile ../../../../../src/justfile simulate function testRegressionCallDataMatches_RevShareSetup() public { - string memory taskConfigFilePath = "test/tasks/example/eth/017-revshare-setup/config.toml"; + string memory taskConfigFilePath = "test/tasks/example/eth/016-revshare-setup/config.toml"; string memory expectedCallData = - "0x82ad56cb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006fee65a372d63295e8eb12574652f0bfeb913149000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000224cdab407800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000beb5fc579115071764c7423a4f12edde41f106ed0000000000000000000000000000000000000000000000000000000000055730000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000c350000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005d66c1782664115999c47c9fa5cd031f495d3e4f000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000000000000000000000000000000000000000000200000000000000000000000088e529a6ccd302c948689cd5156c83d4614fae92000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000"; + "0x82ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000071241bbae674967dd523e621c272ea32cf33119a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e4cdab407800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000beb5fc579115071764c7423a4f12edde41f106ed0000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c350000000000000000000000000016a27462b4d61bdd72cbbabd3e43e11791f7a28c00000000000000000000000000000000000000000000000000000000"; MultisigTask multisigTask = new RevShareSetup(); address rootSafe = address(0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A); address foundationChildMultisig = 0x847B5c174615B1B7fDF770882256e2D3E95b9D92; address[] memory allSafes = MultisigTaskTestHelper.getAllSafes(rootSafe, foundationChildMultisig); (Action[] memory actions, uint256[] memory allOriginalNonces) = - _setupAndSimulate(taskConfigFilePath, 23820274, "mainnet", multisigTask, allSafes); + _setupAndSimulate(taskConfigFilePath, 23992159, "mainnet", multisigTask, allSafes); _assertCallDataMatches(multisigTask, actions, allSafes, allOriginalNonces, expectedCallData); @@ -1005,56 +1005,56 @@ contract RegressionTest is Test { // Foundation expectedDataToSign[0] = - "0x1901a4a9c312badf3fcaa05eafe5dc9bee8bd9316c78ee8b0bebe3115bb21b7326725ee24803aca0a6af16bc1c33df420238c2447291f5ab417a1a6fe8375a17d5c0"; + "0x1901a4a9c312badf3fcaa05eafe5dc9bee8bd9316c78ee8b0bebe3115bb21b7326729274d248fd7f8e1b1f92c852c13cda5f74ee146ef2cb9042e964537121530f3f"; // Security council expectedDataToSign[1] = - "0x1901df53d510b56e539b90b369ef08fce3631020fbf921e3136ea5f8747c20bce9678d870bb68459395de3d3ba0b1a21834e6c6802a206a8797c4442d74f8a96cecb"; + "0x1901df53d510b56e539b90b369ef08fce3631020fbf921e3136ea5f8747c20bce9672ee146debea815c958fa995bfd6d89d3d788c42d814343d1d0e3b0d50a7bd717"; _assertDataToSignNestedMultisig(multisigTask, actions, expectedDataToSign, MULTICALL3_ADDRESS, rootSafe); } - /// @notice Expected call data and data to sign generated by manually running the RevShareUpgradeAndSetup template at block 9628956 on Sepolia. + /// @notice Expected call data and data to sign generated by manually running the RevShareSetup template at block 9819931 on Sepolia. /// Simulate from task directory (test/tasks/example/sep/031-revshare-setup) with: - /// SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path $(pwd)/.env --justfile ../../../../../src/improvements/single.just simulate + /// SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path $(pwd)/.env --justfile ../../../../../src/justfile simulate function testRegressionCallDataMatches_RevShareSetupSepolia() public { string memory taskConfigFilePath = "test/tasks/example/sep/031-revshare-setup/config.toml"; string memory expectedCallData = - "0x82ad56cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000890c61c7f3f40b851ebcaacfa879c6075426419d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e4cdab40780000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000016fc5058f25648194471939df75cf27a2fdc48bc0000000000000000000000000000000000000000000000000000000000055730000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"; + "0x82ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000071241bbae674967dd523e621c272ea32cf33119a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e4cdab40780000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000016fc5058f25648194471939df75cf27a2fdc48bc0000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c35000000000000000000000000007ca800c55ad9c745ac84fdeefaf4522f4df0757700000000000000000000000000000000000000000000000000000000"; MultisigTask multisigTask = new RevShareSetup(); address rootSafe = address(0x1Eb2fFc903729a0F03966B917003800b145F56E2); address foundationChildMultisig = address(0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B); address[] memory allSafes = MultisigTaskTestHelper.getAllSafes(rootSafe, foundationChildMultisig); (Action[] memory actions, uint256[] memory allOriginalNonces) = - _setupAndSimulate(taskConfigFilePath, 9628956, "sepolia", multisigTask, allSafes); + _setupAndSimulate(taskConfigFilePath, 9819931, "sepolia", multisigTask, allSafes); _assertCallDataMatches(multisigTask, actions, allSafes, allOriginalNonces, expectedCallData); string[] memory expectedDataToSign = new string[](2); // Foundation expectedDataToSign[0] = - "0x190137e1f5dd3b92a004a23589b741196c8a214629d4ea3a690ec8e41ae45c689cbb60593f7cc9aeca00d93e8d3bc4ecfc1d1d3f77fd8e9d914002b75cf47d794d41"; + "0x190137e1f5dd3b92a004a23589b741196c8a214629d4ea3a690ec8e41ae45c689cbb9a6021263c87db078acdf5102df412b2eac1815fd6dd93803fd401af5a72399e"; // Security Council expectedDataToSign[1] = - "0x1901be081970e9fc104bd1ea27e375cd21ec7bb1eec56bfe43347c3e36c5d27b8533a12d8bcecba052629a3d85176a5924c80e5faa201eed78daf784b6d0cbbdf5e2"; + "0x1901be081970e9fc104bd1ea27e375cd21ec7bb1eec56bfe43347c3e36c5d27b8533bb9fba64c345e8ad2842a1c208445a87adbb6308cd074ae3d5ab8fce971a65f1"; _assertDataToSignNestedMultisig(multisigTask, actions, expectedDataToSign, MULTICALL3_ADDRESS, rootSafe); } - /// @notice Expected call data and data to sign generated by manually running the RevShareUpgradeAndSetup template at block 23820274 on mainnet. - /// Simulate from task directory (test/tasks/example/eth/016-revshare-upgrade-and-setup) with: + /// @notice Expected call data and data to sign generated by manually running the RevShareUpgradeAndSetup template at block 23992159 on mainnet. + /// Simulate from task directory (test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink) with: /// SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path "$(pwd)"/.env --justfile ../../../../../src/justfile simulate - function testRegressionCallDataMatches_RevShareUpgradeAndSetup() public { - string memory taskConfigFilePath = "test/tasks/example/eth/016-revshare-upgrade-and-setup/config.toml"; + function testRegressionCallDataMatches_RevShareUpgradeAndSetupSonyInk() public { + string memory taskConfigFilePath = "test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/config.toml"; string memory expectedCallData = - "0x82ad56cb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006fee65a372d63295e8eb12574652f0bfeb9131490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000002241a80dc3800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000beb5fc579115071764c7423a4f12edde41f106ed0000000000000000000000000000000000000000000000000000000000055730000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000c350000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005d66c1782664115999c47c9fa5cd031f495d3e4f000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000000000000000000000000000000000000000000200000000000000000000000088e529a6ccd302c948689cd5156c83d4614fae92000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000"; + "0x82ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000071241bbae674967dd523e621c272ea32cf33119a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001841a80dc38000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005d66c1782664115999c47c9fa5cd031f495d3e4f0000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c35000000000000000000000000005f077b4c3509c2c192e50b6654d924fcb8126a6000000000000000000000000088e529a6ccd302c948689cd5156c83d4614fae920000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000f07b3169fff67a8aecdbb18d9761aeee3459111200000000000000000000000000000000000000000000000000000000"; MultisigTask multisigTask = new RevShareUpgradeAndSetup(); address rootSafe = address(0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A); address foundationChildMultisig = 0x847B5c174615B1B7fDF770882256e2D3E95b9D92; address[] memory allSafes = MultisigTaskTestHelper.getAllSafes(rootSafe, foundationChildMultisig); (Action[] memory actions, uint256[] memory allOriginalNonces) = - _setupAndSimulate(taskConfigFilePath, 23820274, "mainnet", multisigTask, allSafes); + _setupAndSimulate(taskConfigFilePath, 23992159, "mainnet", multisigTask, allSafes); _assertCallDataMatches(multisigTask, actions, allSafes, allOriginalNonces, expectedCallData); @@ -1062,38 +1062,38 @@ contract RegressionTest is Test { // Foundation expectedDataToSign[0] = - "0x1901a4a9c312badf3fcaa05eafe5dc9bee8bd9316c78ee8b0bebe3115bb21b732672569b3a00909d6ad42875c28e2c90907c62c499ce07f5c2dacdb7a87254d21912"; + "0x1901a4a9c312badf3fcaa05eafe5dc9bee8bd9316c78ee8b0bebe3115bb21b732672dd737ad6dfb9e5cf0d3bda4b051450e4a1d7b8c38c158ed4b57712a70f50707a"; // Security council expectedDataToSign[1] = - "0x1901df53d510b56e539b90b369ef08fce3631020fbf921e3136ea5f8747c20bce96739b6686709d121f08dcfd80a4755692c5571d9c561a666d4cb5b16467f69a32e"; + "0x1901df53d510b56e539b90b369ef08fce3631020fbf921e3136ea5f8747c20bce967ddd5bfdade4e3e69c2a1055039c1f159b6fc48e52a21206cbaf0828ec7f06008"; _assertDataToSignNestedMultisig(multisigTask, actions, expectedDataToSign, MULTICALL3_ADDRESS, rootSafe); } - /// @notice Expected call data and data to sign generated by manually running the RevShareUpgradeAndSetup template at block 9628956 on Sepolia. - /// Simulate from task directory (test/tasks/example/sep/032-revshare-upgrade-and-setup) with: - /// SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path $(pwd)/.env --justfile ../../../../../src/improvements/single.just simulate - function testRegressionCallDataMatches_RevShareUpgradeAndSetupSepolia() public { - string memory taskConfigFilePath = "test/tasks/example/sep/032-revshare-upgrade-and-setup/config.toml"; + /// @notice Expected call data and data to sign generated by manually running the RevShareUpgradeAndSetup template at block 9819931 on Sepolia. + /// Simulate from task directory (test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink) with: + /// SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path $(pwd)/.env --justfile ../../../../../src/justfile simulate + function testRegressionCallDataMatches_RevShareUpgradeAndSetupSonyInkSepolia() public { + string memory taskConfigFilePath = "test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink/config.toml"; string memory expectedCallData = - "0x82ad56cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000890c61c7f3f40b851ebcaacfa879c6075426419d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e41a80dc380000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000016fc5058f25648194471939df75cf27a2fdc48bc0000000000000000000000000000000000000000000000000000000000055730000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"; + "0x82ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000071241bbae674967dd523e621c272ea32cf33119a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001841a80dc38000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005c1d29c6c9c8b0800692acc95d700bcb4966a1d70000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000bea2bc852a160b8547273660e22f4f08c2fa9bbb00000000000000000000000065ea1489741a5d72ffdd8e6485b216bbdcc15af30000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ed9b99a703bad32ac96fddc313c0652e379251fd00000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000660203dd7e933646905dfdc2c3c0bb156d51000a00000000000000000000000000000000000000000000000000000000"; MultisigTask multisigTask = new RevShareUpgradeAndSetup(); address rootSafe = address(0x1Eb2fFc903729a0F03966B917003800b145F56E2); address foundationChildMultisig = address(0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B); address[] memory allSafes = MultisigTaskTestHelper.getAllSafes(rootSafe, foundationChildMultisig); (Action[] memory actions, uint256[] memory allOriginalNonces) = - _setupAndSimulate(taskConfigFilePath, 9628956, "sepolia", multisigTask, allSafes); + _setupAndSimulate(taskConfigFilePath, 9819931, "sepolia", multisigTask, allSafes); _assertCallDataMatches(multisigTask, actions, allSafes, allOriginalNonces, expectedCallData); string[] memory expectedDataToSign = new string[](2); // Foundation expectedDataToSign[0] = - "0x190137e1f5dd3b92a004a23589b741196c8a214629d4ea3a690ec8e41ae45c689cbbbac05a0518253e95dd986d5abd3f1894e18287daa1908e6ff2b6c98b7e70668d"; + "0x190137e1f5dd3b92a004a23589b741196c8a214629d4ea3a690ec8e41ae45c689cbb48bc25353b26df29df127a047c7bc5f4e68b717ff69cdd72a85caf9b6d2740c8"; // Security Council expectedDataToSign[1] = - "0x1901be081970e9fc104bd1ea27e375cd21ec7bb1eec56bfe43347c3e36c5d27b853399672aa96c22a175fb34019069064f173ac35414e6f9bb22b6f2952c5d53d653"; + "0x1901be081970e9fc104bd1ea27e375cd21ec7bb1eec56bfe43347c3e36c5d27b8533a1bb7dbd920e5f69e3932f20c6869a0eb6be1c88c1ce5003eb641222c112e69a"; _assertDataToSignNestedMultisig(multisigTask, actions, expectedDataToSign, MULTICALL3_ADDRESS, rootSafe); } diff --git a/test/tasks/example/eth/016-revshare-setup/.env b/test/tasks/example/eth/016-revshare-setup/.env new file mode 100644 index 0000000000..bf430a8637 --- /dev/null +++ b/test/tasks/example/eth/016-revshare-setup/.env @@ -0,0 +1,3 @@ +TENDERLY_GAS=16700000 +NESTED_SAFE_NAME_DEPTH_1=foundation +FORK_BLOCK_NUMBER=23992159 \ No newline at end of file diff --git a/test/tasks/example/eth/016-revshare-setup/config.toml b/test/tasks/example/eth/016-revshare-setup/config.toml new file mode 100644 index 0000000000..d327cdca55 --- /dev/null +++ b/test/tasks/example/eth/016-revshare-setup/config.toml @@ -0,0 +1,31 @@ +# RevShare Setup Configuration + +templateName = "RevShareSetup" + +# L2 chains to target (OP Mainnet only - proxies already upgraded) +l2chains = [{name = "OP Mainnet", chainId = 10}] + +safeAddress = "ProxyAdminOwner" + +# RevShareContractsUpgrader address +revShareUpgrader = "0x71241bbae674967dd523e621c272ea32cf33119a" + +# RevShare configurations (one per chain) - flattened arrays +portals = [ + "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed" # OP Mainnet Portal +] +chainFeesRecipients = [ + "0x16A27462B4D61BDD72CbBabd3E43e11791F7A28c" +] + +# 2 ether +l1WithdrawerMinWithdrawalAmounts = [2000000000000000000] + +# FeesDepositor address in mainnet +l1WithdrawerRecipients = [ + "0xed9B99a703BaD32AC96FDdc313c0652e379251Fd" +] +l1WithdrawerGasLimits = [800000] + +[addresses] +ProxyAdminOwner = "0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A" diff --git a/test/tasks/example/eth/016-revshare-upgrade-and-setup/.env b/test/tasks/example/eth/016-revshare-upgrade-and-setup/.env deleted file mode 100644 index ea5dd7ac84..0000000000 --- a/test/tasks/example/eth/016-revshare-upgrade-and-setup/.env +++ /dev/null @@ -1,3 +0,0 @@ -TENDERLY_GAS=24000000 -NESTED_SAFE_NAME_DEPTH_1=foundation -FORK_BLOCK_NUMBER=23872150 \ No newline at end of file diff --git a/test/tasks/example/eth/016-revshare-upgrade-and-setup/config.toml b/test/tasks/example/eth/016-revshare-upgrade-and-setup/config.toml deleted file mode 100644 index d86d88efe5..0000000000 --- a/test/tasks/example/eth/016-revshare-upgrade-and-setup/config.toml +++ /dev/null @@ -1,38 +0,0 @@ -# RevShare Setup Configuration - -templateName = "RevShareUpgradeAndSetup" - -# L2 chains to target -l2chains = [{name = "OP Mainnet", chainId = 10}, {name = "Ink", chainId = 57073}, {name = "Soneium", chainId = 1868}] - -safeAddress = "ProxyAdminOwner" - -# RevShareContractsUpgrader address -# TODO: Update to the corresponding address after audit -revShareUpgrader = "0x6fee65A372d63295E8EB12574652F0BfEb913149" - -# RevShare configurations (one per chain) - flattened arrays -portals = [ - "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed", # OP Mainnet Portal - "0x5d66C1782664115999C47c9fA5cd031f495D3e4F", # Ink Mainnet Portal - "0x88e529A6ccd302c948689Cd5156C83D4614FAE92" # Soneium Mainnet Portal -] -chainFeesRecipients = [ - "0x0000000000000000000000000000000000000001", # TODO: Update to the corresponding address once defined - "0x0000000000000000000000000000000000000002", # TODO: Update to the corresponding address once defined - "0x0000000000000000000000000000000000000003" # TODO: Update to the corresponding address once defined -] -l1WithdrawerMinWithdrawalAmounts = [350000, 500000, 500000] - -l1WithdrawerRecipients = [ - # TODO: Update to the corresponding (e.g. FeesDepositor) address once defined - "0x0000000000000000000000000000000000000001", - # TODO: Update to the corresponding (e.g. FeesDepositor) address once defined - "0x0000000000000000000000000000000000000002", - # TODO: Update to the corresponding (e.g. FeesDepositor) address once defined - "0x0000000000000000000000000000000000000003" -] -l1WithdrawerGasLimits = [800000, 800000, 800000] - -[addresses] -ProxyAdminOwner = "0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A" diff --git a/test/tasks/example/eth/017-revshare-setup/.env b/test/tasks/example/eth/017-revshare-setup/.env deleted file mode 100644 index 8610954676..0000000000 --- a/test/tasks/example/eth/017-revshare-setup/.env +++ /dev/null @@ -1,3 +0,0 @@ -TENDERLY_GAS=16000000 -NESTED_SAFE_NAME_DEPTH_1=foundation -FORK_BLOCK_NUMBER=23820274 \ No newline at end of file diff --git a/test/tasks/example/eth/017-revshare-setup/config.toml b/test/tasks/example/eth/017-revshare-setup/config.toml deleted file mode 100644 index 61daeb3573..0000000000 --- a/test/tasks/example/eth/017-revshare-setup/config.toml +++ /dev/null @@ -1,38 +0,0 @@ -# RevShare Setup Configuration - -templateName = "RevShareSetup" - -# L2 chains to target -l2chains = [{name = "OP Mainnet", chainId = 10}, {name = "Ink", chainId = 57073}, {name = "Soneium", chainId = 1868}] - -safeAddress = "ProxyAdminOwner" - -# RevShareContractsUpgrader address -# TODO: Update to the corresponding address after audit -revShareUpgrader = "0x6fee65A372d63295E8EB12574652F0BfEb913149" - -# RevShare configurations (one per chain) - flattened arrays -portals = [ - "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed", # OP Mainnet Portal - "0x5d66C1782664115999C47c9fA5cd031f495D3e4F", # Ink Mainnet Portal - "0x88e529A6ccd302c948689Cd5156C83D4614FAE92" # Soneium Mainnet Portal -] -chainFeesRecipients = [ - "0x0000000000000000000000000000000000000001", # TODO: Update to the corresponding address once defined - "0x0000000000000000000000000000000000000002", # TODO: Update to the corresponding address once defined - "0x0000000000000000000000000000000000000003" # TODO: Update to the corresponding address once defined -] -l1WithdrawerMinWithdrawalAmounts = [350000, 500000, 500000] - -l1WithdrawerRecipients = [ - # TODO: Update to the corresponding (e.g. FeesDepositor) address once defined - "0x0000000000000000000000000000000000000001", - # TODO: Update to the corresponding (e.g. FeesDepositor) address once defined - "0x0000000000000000000000000000000000000002", - # TODO: Update to the corresponding (e.g. FeesDepositor) address once defined - "0x0000000000000000000000000000000000000003" -] -l1WithdrawerGasLimits = [800000, 800000, 800000] - -[addresses] -ProxyAdminOwner = "0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A" diff --git a/test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/.env b/test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/.env new file mode 100644 index 0000000000..bf430a8637 --- /dev/null +++ b/test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/.env @@ -0,0 +1,3 @@ +TENDERLY_GAS=16700000 +NESTED_SAFE_NAME_DEPTH_1=foundation +FORK_BLOCK_NUMBER=23992159 \ No newline at end of file diff --git a/test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/config.toml b/test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/config.toml new file mode 100644 index 0000000000..b34a425689 --- /dev/null +++ b/test/tasks/example/eth/017-revshare-upgrade-and-setup-sony-ink/config.toml @@ -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" +] + +# 2 ether +l1WithdrawerMinWithdrawalAmounts = [2000000000000000000, 2000000000000000000] + +# FeesDepositor address in mainnet +l1WithdrawerRecipients = [ + "0xed9B99a703BaD32AC96FDdc313c0652e379251Fd", + "0xed9B99a703BaD32AC96FDdc313c0652e379251Fd" +] +l1WithdrawerGasLimits = [800000, 800000] + +[addresses] +ProxyAdminOwner = "0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A" + diff --git a/test/tasks/example/sep/031-revshare-setup/.env b/test/tasks/example/sep/031-revshare-setup/.env index 2fd241eabf..55e4c18990 100644 --- a/test/tasks/example/sep/031-revshare-setup/.env +++ b/test/tasks/example/sep/031-revshare-setup/.env @@ -1,3 +1,3 @@ -TENDERLY_GAS=16000000 -FORK_BLOCK_NUMBER=9628956 +TENDERLY_GAS=16700000 +FORK_BLOCK_NUMBER=9819931 NESTED_SAFE_NAME_DEPTH_1=foundation diff --git a/test/tasks/example/sep/031-revshare-setup/config.toml b/test/tasks/example/sep/031-revshare-setup/config.toml index e39def724b..aee7093d9c 100644 --- a/test/tasks/example/sep/031-revshare-setup/config.toml +++ b/test/tasks/example/sep/031-revshare-setup/config.toml @@ -1,21 +1,30 @@ # RevShare Setup Configuration - +# NOTE: The example task with OP as input is for reference only. templateName = "RevShareSetup" -# L2 chains to target -l2chains = [{name = "OP Sepolia Testnet", chainId = 11155420}] +# L2 chains to target (OP Sepolia only - proxies already upgraded) +l2chains = [{name = "OP Sepolia", chainId = 11155420}] safeAddress = "ProxyAdminOwner" # RevShareContractsUpgrader address -# TODO: Update to the corresponding address after audit -revShareUpgrader = "0x890C61C7F3f40B851EbCAacFA879C6075426419D" +revShareUpgrader = "0x71241bbae674967dD523e621c272Ea32cf33119A" # RevShare configurations (one per chain) - flattened arrays -portals = ["0x16Fc5058F25648194471939df75CF27A2fdC48BC"] # OP Sepolia Testnet Portal -chainFeesRecipients = ["0x0000000000000000000000000000000000000001"] # OP Sepolia Testnet chain fees recipient -l1WithdrawerMinWithdrawalAmounts = [350000] -l1WithdrawerRecipients = ["0x0000000000000000000000000000000000000001"] +portals = [ + "0x16Fc5058F25648194471939df75CF27A2fdC48BC" # OP Sepolia Portal +] +chainFeesRecipients = [ + "0x7ca800c55ad9C745AC84FdeEfaf4522F4Df07577" +] + +# 2 ether +l1WithdrawerMinWithdrawalAmounts = [2000000000000000000] + +# FeesDepositor address in mainnet +l1WithdrawerRecipients = [ + "0xed9B99a703BaD32AC96FDdc313c0652e379251Fd" +] l1WithdrawerGasLimits = [800000] [addresses] diff --git a/test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink/.env b/test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink/.env new file mode 100644 index 0000000000..d289629924 --- /dev/null +++ b/test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink/.env @@ -0,0 +1,3 @@ +TENDERLY_GAS=16700000 +FORK_BLOCK_NUMBER=9819931 +NESTED_SAFE_NAME_DEPTH_1=foundation \ No newline at end of file diff --git a/test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink/config.toml b/test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink/config.toml new file mode 100644 index 0000000000..c7df1a1d9a --- /dev/null +++ b/test/tasks/example/sep/032-revshare-upgrade-and-setup-sony-ink/config.toml @@ -0,0 +1,39 @@ +# 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" + diff --git a/test/tasks/example/sep/032-revshare-upgrade-and-setup/.env b/test/tasks/example/sep/032-revshare-upgrade-and-setup/.env deleted file mode 100644 index 2fd241eabf..0000000000 --- a/test/tasks/example/sep/032-revshare-upgrade-and-setup/.env +++ /dev/null @@ -1,3 +0,0 @@ -TENDERLY_GAS=16000000 -FORK_BLOCK_NUMBER=9628956 -NESTED_SAFE_NAME_DEPTH_1=foundation diff --git a/test/tasks/example/sep/032-revshare-upgrade-and-setup/config.toml b/test/tasks/example/sep/032-revshare-upgrade-and-setup/config.toml deleted file mode 100644 index 7d48794581..0000000000 --- a/test/tasks/example/sep/032-revshare-upgrade-and-setup/config.toml +++ /dev/null @@ -1,22 +0,0 @@ -# RevShare Setup Configuration - -templateName = "RevShareUpgradeAndSetup" - -# L2 chains to target -l2chains = [{name = "OP Sepolia Testnet", chainId = 11155420}] - -safeAddress = "ProxyAdminOwner" - -# RevShareContractsUpgrader address -# TODO: Update to the corresponding address after audit -revShareUpgrader = "0x890C61C7F3f40B851EbCAacFA879C6075426419D" - -# RevShare configurations (one per chain) - flattened arrays -portals = ["0x16Fc5058F25648194471939df75CF27A2fdC48BC"] # OP Sepolia Testnet Portal -chainFeesRecipients = ["0x0000000000000000000000000000000000000001"] # OP Sepolia Testnet chain fees recipient -l1WithdrawerMinWithdrawalAmounts = [350000] -l1WithdrawerRecipients = ["0x0000000000000000000000000000000000000001"] -l1WithdrawerGasLimits = [800000] - -[addresses] -ProxyAdminOwner = "0x1Eb2fFc903729a0F03966B917003800b145F56E2"