Skip to content

Conversation

@Amxx
Copy link
Collaborator

@Amxx Amxx commented Jan 13, 2026

No description provided.

@Amxx Amxx requested a review from a team as a code owner January 13, 2026 19:50
@Amxx Amxx added tests Test suite and helpers. ignore-changeset labels Jan 13, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2026

⚠️ No Changeset found

Latest commit: 3e3bd25

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

Walkthrough

The pull request refactors EIP7702-related tests by introducing a generalized setDelegation helper function that replaces manual authorization flows. The test fixture now obtains EOA accounts through getSigners() instead of constructing random wallets. Additionally, the EIP7702SmartAccount.deploy method signature is updated to accept an optional relayer parameter, delegating transaction sending to the provided relayer instead of using hardhat-specific wallet construction. The explicit gasLimit specification in transaction calls is removed.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a description explaining the motivation and details of using native signers instead of manual wallet construction in EIP-7702 tests.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: shifting from hardcoded/manual wallet creation to using native signers (getSigners()) in EIP-7702 tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/account/utils/EIP7702Utils.test.js (1)

5-19: Verify the nonce adjustment logic for self-relayed transactions.

The nonce is incremented by 1 when relayer?.address == account.address to account for the transaction incrementing the signer's nonce before the EIP-7702 authorization is applied. This logic appears correct for the self-relay case.

However, consider using strict equality (===) and normalizing addresses with ethers.getAddress() for safer comparison, as mixed-case addresses could cause unexpected behavior:

-        nonce: nonce + (relayer?.address == account.address ? 1 : 0),
+        nonce: nonce + (relayer?.address?.toLowerCase() === account.address.toLowerCase() ? 1 : 0),
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3807726 and 3e3bd25.

📒 Files selected for processing (2)
  • test/account/utils/EIP7702Utils.test.js
  • test/helpers/erc4337.js
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: ernestognw
Repo: OpenZeppelin/openzeppelin-contracts PR: 5891
File: test/account/modules/ERC7579Module.behavior.js:56-61
Timestamp: 2025-10-15T02:52:05.027Z
Learning: In ERC7579 validator tests for `isValidSignatureWithSender`, using `this.mock` (not bound to a specific account) is valid when testing signature validation with any arbitrary sender, while `this.mockFromAccount` is used when testing account-specific validation scenarios.
📚 Learning: 2025-09-04T09:13:21.278Z
Learnt from: Amxx
Repo: OpenZeppelin/openzeppelin-contracts PR: 5904
File: contracts/crosschain/ERC7786Recipient.sol:3-3
Timestamp: 2025-09-04T09:13:21.278Z
Learning: In OpenZeppelin contracts, hardhat.config.js uses a sophisticated yargs-based configuration where the Solidity compiler version is set via argv.compiler (line 77) with a default of '0.8.27' defined in the yargs options (line 21), allowing flexible command-line overrides while maintaining a consistent default.

Applied to files:

  • test/helpers/erc4337.js
📚 Learning: 2025-09-04T09:13:21.278Z
Learnt from: Amxx
Repo: OpenZeppelin/openzeppelin-contracts PR: 5904
File: contracts/crosschain/ERC7786Recipient.sol:3-3
Timestamp: 2025-09-04T09:13:21.278Z
Learning: In OpenZeppelin contracts, hardhat.config.js uses yargs to configure the Solidity compiler version dynamically via command line arguments, with a default of '0.8.27' set on line 21 and the solidity configuration using argv.compile around lines 76-87, rather than hardcoded version strings.

Applied to files:

  • test/helpers/erc4337.js
📚 Learning: 2025-10-15T02:52:05.027Z
Learnt from: ernestognw
Repo: OpenZeppelin/openzeppelin-contracts PR: 5891
File: test/account/modules/ERC7579Module.behavior.js:56-61
Timestamp: 2025-10-15T02:52:05.027Z
Learning: In ERC7579 validator tests for `isValidSignatureWithSender`, using `this.mock` (not bound to a specific account) is valid when testing signature validation with any arbitrary sender, while `this.mockFromAccount` is used when testing account-specific validation scenarios.

Applied to files:

  • test/account/utils/EIP7702Utils.test.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: boostsecurity - boostsecurityio/scanner
  • GitHub Check: boostsecurity - boostsecurityio/boost-sca
  • GitHub Check: tests-foundry
  • GitHub Check: tests-upgradeable
  • GitHub Check: tests
  • GitHub Check: coverage
  • GitHub Check: slither
  • GitHub Check: halmos
🔇 Additional comments (4)
test/helpers/erc4337.js (2)

1-1: LGTM!

The import now includes predeploy from hardhat, which is used elsewhere in the file for entrypoint and senderCreator defaults.


199-206: Clean refactor to use relayer-based deployment.

The updated signature deploy(relayer = this.runner) maintains backward compatibility while enabling explicit relayer control. The pattern aligns with the SmartAccount.deploy(account = this.runner) method at line 175, providing a consistent API across both account types.

test/account/utils/EIP7702Utils.test.js (2)

21-25: Good refactor to use native signers.

Using getSigners() instead of constructing random wallets simplifies the test setup and aligns with standard Hardhat testing patterns. This eliminates the need for manual wallet funding and key management.


37-51: LGTM!

The test cases correctly exercise the setDelegation helper for setting, verifying, and revoking EIP-7702 delegations. Using ethers.ZeroAddress as the target for revocation is the correct pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-changeset tests Test suite and helpers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants