test(contracts): improve OptimismMintableERC20 test coverage #18696
+80
−27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the
OptimismMintableERC20test file by converting focused tests to fuzz tests for broader coverage and adding tests for previously uncovered code paths.Changes:
allowance()non-PERMIT2 branchsupportsInterface()false return casedecimals()andversion()functionsassert()→assertTrue()(Forge convention)Review & Testing Checklist for Human
test_decimals_succeedsassertion of 18 decimals matches howL2Tokenis created inCommonTest.bridgeInitializerSetUp()viacreateStandardL2Token()vm.assume(_owner != _to)in permit2 test prevents self-transfer edge case - is this intentional?)just test-dev --match-path test/universal/OptimismMintableERC20.t.sol -vto verify all 16 tests passRecommended test plan: Run the test suite locally and verify the fuzz tests exercise meaningful value ranges.
Notes
Link to Devin run: https://app.devin.ai/sessions/84c09a1ef33944368652d4d50888283a
Requested by: Ariel Diaz (@aliersh)
Last update: 2025-12-29 03:00 ET