Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions packages/contracts-bedrock/test/L2/FeeSplitter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ReentrantMockFeeVault } from "test/mocks/ReentrantMockFeeVault.sol";
// Libraries
import { Predeploys } from "src/libraries/Predeploys.sol";
import { Types } from "src/libraries/Types.sol";
import { DevFeatures } from "src/libraries/DevFeatures.sol";

// Interfaces
import { IFeeSplitter } from "interfaces/L2/IFeeSplitter.sol";
Expand Down Expand Up @@ -41,6 +42,10 @@ contract FeeSplitter_TestInit is CommonTest {

/// @notice Test setup.
function setUp() public virtual override {
// Resolve features and skip whole test suite if custom gas token is enabled
resolveFeaturesFromEnv();
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

// Enable revenue sharing before calling parent setUp
super.enableRevenueShare();
super.setUp();
Expand Down
8 changes: 4 additions & 4 deletions packages/contracts-bedrock/test/L2/L1Withdrawer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ contract L1Withdrawer_TestInit is CommonTest {

/// @notice Test setup.
function setUp() public virtual override {
// Resolve features and skip whole test suite if custom gas token is enabled
resolveFeaturesFromEnv();
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

// Enable revenue sharing before calling parent setUp
super.enableRevenueShare();
super.setUp();
Expand Down Expand Up @@ -76,8 +80,6 @@ contract L1Withdrawer_Receive_Test is L1Withdrawer_TestInit {
}

function testFuzz_receive_atOrAboveThreshold_succeeds(uint256 _sendAmount) external {
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

_sendAmount = bound(_sendAmount, minWithdrawalAmount, type(uint256).max);

vm.deal(address(this), _sendAmount);
Expand Down Expand Up @@ -105,8 +107,6 @@ contract L1Withdrawer_Receive_Test is L1Withdrawer_TestInit {
}

function testFuzz_receive_multipleDeposits_succeeds(uint256 _firstAmount, uint256 _secondAmount) external {
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

// First amount should not exceed minWithdrawalAmount (so it doesn't trigger withdrawal)
_firstAmount = bound(_firstAmount, 0, minWithdrawalAmount - 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ contract RevenueSharingIntegration_Test is CommonTest {
event FundsReceived(address indexed sender, uint256 amount, uint256 newBalance);

function setUp() public override {
// Resolve features and skip whole test suite if custom gas token is enabled
resolveFeaturesFromEnv();
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

// Enable revenue sharing before calling parent setUp
super.enableRevenueShare();
super.setUp();
Expand Down Expand Up @@ -135,8 +139,6 @@ contract RevenueSharingIntegration_Test is CommonTest {
// | 0/0/0/0 | 2.5 | 205.55 | Accumulating |
// |__________________|______________|______________|________________________________|
function test_revenueSharing_fullFlow_succeeds() public {
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

// Configure vaults to withdraw to FeeSplitter
_configureVaultsForFeeSplitter();

Expand Down Expand Up @@ -256,8 +258,6 @@ contract RevenueSharingIntegration_Test is CommonTest {
)
public
{
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

// Bound inputs to prevent overflow and ensure reasonable test ranges
_sequencerFees = bound(_sequencerFees, 0, 100 ether);
_baseFees = bound(_baseFees, 0, 100 ether);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ISharesCalculator } from "interfaces/L2/ISharesCalculator.sol";
import { ISuperchainRevSharesCalculator } from "interfaces/L2/ISuperchainRevSharesCalculator.sol";

// Libraries
import { DevFeatures } from "src/libraries/DevFeatures.sol";

/// @notice Base setup contract for SuperchainRevSharesCalculator tests.
contract SuperchainRevSharesCalculator_TestInit is CommonTest {
Expand All @@ -23,6 +24,10 @@ contract SuperchainRevSharesCalculator_TestInit is CommonTest {
event RemainderRecipientUpdated(address indexed oldRemainderRecipient, address indexed newRemainderRecipient);

function setUp() public virtual override {
// Resolve features and skip whole test suite if custom gas token is enabled
resolveFeaturesFromEnv();
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

// Enable revenue sharing before calling parent setUp
super.enableRevenueShare();
super.setUp();
Expand Down
6 changes: 4 additions & 2 deletions packages/contracts-bedrock/test/invariants/FeeSplit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ contract FeeSplitter_Invariant is CommonTest {

/// @notice Setup: enable the revenue share, deploy handlers and target them.
function setUp() public override {
// Resolve features and skip whole test suite if custom gas token is enabled
resolveFeaturesFromEnv();
skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

super.enableRevenueShare();
super.setUp();

skipIfDevFeatureEnabled(DevFeatures.CUSTOM_GAS_TOKEN);

disburser = new FeeSplitter_Disburser(vm, feeSplitter, l1Withdrawer);
preconditions = new FeeSplitter_Preconditions();
callDistributionBias = new FeeSplitter_CallDistributionBias();
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/test/scripts/L2Genesis.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ contract L2Genesis_Run_Test is L2Genesis_TestInit {
}

/// @notice Tests that enabling both CGT and revenue share reverts.
function test_cgt_and_revenueShare_reverts() external {
function test_cgt_revenueShare_reverts() external {
_setInputCGTEnabled();
input.useRevenueShare = true;
vm.expectRevert("FeeVault: custom gas token and revenue share cannot be enabled together");
Expand Down