Skip to content

test(contracts): enhance OptimismMintableERC721 test coverage with fuzz tests#19094

Merged
maurelian merged 2 commits intodevelopfrom
devin/1770275120-improve-optimism-mintable-erc721-tests
Feb 5, 2026
Merged

test(contracts): enhance OptimismMintableERC721 test coverage with fuzz tests#19094
maurelian merged 2 commits intodevelopfrom
devin/1770275120-improve-optimism-mintable-erc721-tests

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 5, 2026

Summary

Enhances the OptimismMintableERC721 test file by converting 6 existing focused tests to fuzz tests and adding 2 new tests for improved coverage.

Fuzz test conversions:

  • Constructor test now fuzzes remoteChainId parameter
  • safeMint test now fuzzes recipient address and tokenId
  • safeMint access control test now fuzzes caller address
  • burn test now fuzzes tokenId
  • burn access control test now fuzzes caller address
  • tokenURI test now fuzzes tokenId

New tests added:

  • testFuzz_supportsInterface_unsupportedInterface_fails - verifies unsupported interfaces return false
  • test_version_validFormat_succeeds - validates version string format using SemverComp.parse()

Updates since last revision

  • Fixed supportsInterface fuzz test to exclude IERC721Metadata interface ID (inherited from ERC721 base class). The contract supports 5 interfaces total, not 4.

Review & Testing Checklist for Human

  • Confirm the supportsInterface fuzz test properly excludes all 5 supported interface IDs: IOptimismMintableERC721, IERC721Enumerable, IERC721, IERC721Metadata, IERC165
  • Verify the safeMint fuzz test constraint _to.code.length == 0 is appropriate (prevents ERC721 receiver callback issues with contract addresses)
  • Run the tests locally with heavy fuzz: FOUNDRY_FUZZ_RUNS=10000 forge test --match-path test/L2/OptimismMintableERC721.t.sol -v

Notes

All 12 tests pass locally with 10,000 fuzz runs. All CI checks pass (heavy fuzz tests included).

Link to Devin run: https://app.devin.ai/sessions/04465ffa962c420d939b99ca540fe183
Requested by: @aliersh

…zz tests

- Convert constructor test to fuzz test with variable remoteChainId
- Convert safeMint test to fuzz test with variable recipient and tokenId
- Convert safeMint notBridge test to fuzz test with variable caller
- Convert burn test to fuzz test with variable tokenId
- Convert burn notBridge test to fuzz test with variable caller
- Convert tokenURI test to fuzz test with variable tokenId
- Add supportsInterface test for unsupported interfaces
- Add version format validation test using SemverComp.parse()
@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner February 5, 2026 07:14
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.42%. Comparing base (1294a28) to head (9e5e399).
⚠️ Report is 4292 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #19094      +/-   ##
===========================================
+ Coverage    73.83%   77.42%   +3.59%     
===========================================
  Files          189      134      -55     
  Lines        11244     7213    -4031     
===========================================
- Hits          8302     5585    -2717     
+ Misses        2796     1628    -1168     
+ Partials       146        0     -146     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 77.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 55 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The contract inherits IERC721Metadata from ERC721, so it must be excluded
from the unsupported interface fuzz test to prevent false failures.
@maurelian maurelian enabled auto-merge February 5, 2026 15:02
@maurelian maurelian added this pull request to the merge queue Feb 5, 2026
Merged via the queue into develop with commit ed77b12 Feb 5, 2026
222 checks passed
@maurelian maurelian deleted the devin/1770275120-improve-optimism-mintable-erc721-tests branch February 5, 2026 15:28
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