Skip to content

test: add require tests for fields on Revenue Sharing templates#26

Merged
0xDiscotech merged 5 commits into
sc-feat/revshare-setupfrom
test/requirements-test
Oct 9, 2025
Merged

test: add require tests for fields on Revenue Sharing templates#26
0xDiscotech merged 5 commits into
sc-feat/revshare-setupfrom
test/requirements-test

Conversation

@0xiamflux
Copy link
Copy Markdown

@0xiamflux 0xiamflux commented Oct 7, 2025

This PR adds tests for three templates that check required field validations.

Changes

  • Created tests for DeployFeesDepositor, LateOptInRevenueShare, and RevenueShareV100UpgradePath templates
  • Added corresponding config files to trigger specific validation errors

Closes OPT-1199

@0xiamflux 0xiamflux self-assigned this Oct 7, 2025
@0xiamflux 0xiamflux marked this pull request as ready for review October 7, 2025 22:14
@linear
Copy link
Copy Markdown

linear Bot commented Oct 7, 2025

@defi-wonderland defi-wonderland deleted a comment from linear Bot Oct 7, 2025
@0xiamflux 0xiamflux changed the title test: add require tests for fields on LateOptInRevenueShare template test: add require tests for fields on Revenue Sharing templates Oct 7, 2025
/// @notice Tests that the template reverts when the proxyAdminOwner is a zero address.
function test_deployFeesDepositor_proxyAdminOwner_zero_address_reverts() public {
string memory configPath = "test/template/deploy-fees-depositor/config/proxyAdminOwner-zero-address-config.toml";
vm.expectRevert("SimpleAddressRegistry: zero address for ProxyAdminOwner");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we can remove this line on FeesDepositor:

         require(proxyAdminOwner != address(0), "proxyAdminOwner must be set");

Since it fails before on .get()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, thought leaving it for completeness as the require in the script was there already but definitely can be both removed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed here.

}

/// @notice Test contract for the LateOptInRevenueShare that expect reverts on misconfiguration of required fields.
contract LateOptInRevenueShareRequiredFieldsTest is Test {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing portal != address(0)? Also, I think we can remove that require on the contract since get() already handles it. But worth checking

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, I think it's the same as the previous comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed here.

@0xiamflux 0xiamflux requested a review from 0xDiscotech October 8, 2025 21:57
@0xDiscotech 0xDiscotech merged commit a8f4c70 into sc-feat/revshare-setup Oct 9, 2025
1 check passed
@0xDiscotech 0xDiscotech deleted the test/requirements-test branch October 9, 2025 16:03
0xDiscotech added a commit that referenced this pull request Nov 18, 2025
…ethereum-optimism#1257)

* feat: add Revenue Share Upgrade Path (#8)

* feat: Deploy FeesDepositor (#15)

* feat: late opt-in template (#21)

* refactor: contracts update creationcode (#23)

* fix: sync (#24)

* test: add require tests for fields on Revenue Sharing templates (#26)

* fix: L2 target ProxyAdmin (#27)

* chore: update cost of upgrades and deployments (#29)

* test: revenue sharing upgrade unit tests (#22)

* test: add basic validation for fees depositor template (#32)

* chore: updates the bytecode for vaults, using initialize (#31)

* test: integration supersim revshare (#30)

* fix: broken simulations

* fix: wrong location of synced regression tests

* test: integration revshare late opt in (#33)

* fix: ir fixes (#38)

* chore: gas costs (#39)

* fix: minors (#46)

* fix: remove vm usage for getCreate2Address utils function (#48)

* feat: descope late opt in (#51)

* feat: add rev share upgrader (#53)

* fix: bash on comment

* fix: forge fmt

* refactor: reduce code size by splitting logic between lib and contract (#59)

* refactor: reduce code size by splitting logic between lib and contract

* chore: remove comment

* chore: remove prefix

* refactor: split library (#60)

* refactor: reduce code size by splitting logic between lib and contract

* chore: remove comment

* chore: remove prefix

* refactor: split library in two to avoid code size error

* feat: regression tests (#61)

* fix: relay typo

* fix: improve template validation checks (#62)

* fix: wrong fee splitter bytecode (#63)

* fix: skip comment

* fix: rename test create two deployer

* chore: add commit

* feat: add upgrader deployment script (#64)

* chore: update gas limits

* refactor: use create two to get a deterministic deployment of the upgrader (#68)

* chore: add todos (#66)

* chore: remove tenderly simulations (#65)

* chore: deploy and update new contract (#67)

* fix: forge fmt (#69)

* chore: fuzz init code on get create2 test (#70)

* feat: deploy revshare mainnet (#71)

* fix: forge fmt (#72)

* chore: add todo comments (#73)

* chore: reduce tenderly gas

Co-authored-by: Maurelian <john@oplabs.co>

* fix: reduce tenderly gas limit on sepolia (#77)

---------

Co-authored-by: IamFlux <175354924+0xiamflux@users.noreply.github.com>
Co-authored-by: Chiin <77933451+0xChin@users.noreply.github.com>
Co-authored-by: 0xchin <alanracciatti1220@gmail.com>
Co-authored-by: Maurelian <john@oplabs.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants