Skip to content

Conversation

@unknownunknown1
Copy link
Contributor

@unknownunknown1 unknownunknown1 commented Mar 24, 2025

Removes ethereum-waffle and updates the tests.
Removes the old gnosis test file to avoid duplication

Summary by CodeRabbit

  • Chores

    • Updated backend configurations to adopt a structured source directory for the latest Solidity version and incorporated an upgraded compiler with enhanced error management.
  • Refactor

    • Streamlined smart contract messaging to enable smoother cross-chain interactions and improved overall flexibility.
  • Tests

    • Refined test frameworks and utilities to boost reliability and consistency across all supported networks.
    • Introduced a standardized method for retrieving account balances across tests.

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2025

Walkthrough

This pull request updates the Hardhat configuration files to change the source directory to a versioned subdirectory (./src/0.8) and updates the zkSync compiler version along with its error suppression settings. It modifies several smart contracts by making the onlyForeignProxy modifier virtual and introducing a new internal function, sendToL1, for streamlined messaging to L1. Additionally, multiple mock contracts have been renamed or updated, and the test suites have been refactored to utilize updated utility functions and new balance retrieval methods.

Changes

File(s) Change Summary
contracts/hardhat.config.js
contracts/hardhat.config.zksync.js
Updated sources path from "./src" to "./src/0.8". Upgraded zkSync compiler version from "1.3.16" to "1.5.11" and added suppressedErrors in zkSync configuration.
contracts/src/0.8/RealitioHomeProxyOptimism.sol Made the onlyForeignProxy modifier virtual and added new internal function sendToL1 to encapsulate L1 messaging logic.
contracts/src/0.8/test/…/MockRealitioHomeProxy*.sol
(Arbitrum, Optimism, Polygon, ZkSync)
Renamed contracts for clarity (e.g., from MockRealitioHomeProxy to MockRealitioHomeProxyArbitrum/Polygon/ZkSync). The Optimism mock additionally overrides onlyForeignProxy and sendToL1 using a mockMessenger.
contracts/test/foreign-proxy-*.test.js Refactored tests: replaced ethereum-waffle with @nomicfoundation/hardhat-network-helpers, updated ethers utility functions (e.g., using toBigInt, zeroPadValue), added a helper getBalance function, and adjusted test assertions (e.g., address access via .target and updated constants).
contracts/test/to-migrate/CrossChainArbitrationProxy.test.js Deleted legacy test file for cross-chain arbitration proxies.

Sequence Diagram(s)

sequenceDiagram
    participant User as User/Contract
    participant Proxy as HomeProxy (Optimism/Mock)
    participant Messenger as Messenger Contract
    participant L1 as L1 Network

    User->>Proxy: Calls handleNotifiedRequest/handleRejectedRequest
    Proxy->>Proxy: Executes sendToL1(_data)
    Proxy->>Messenger: Invokes sendMessage(foreignProxy, _data, MIN_GAS_LIMIT)
    Messenger->>L1: Forwards message to L1 network
Loading

Possibly related PRs

  • Feat/gnosis proxy compiler bump #54: The changes in the main PR involve updating the Solidity compiler version and modifying the source paths, which are related to the retrieved PR that also includes updates to the Solidity version and the removal of the relayRule function.

Suggested reviewers

  • unknownunknown1

Poem

I'm a little rabbit, hopping in code,
Witnessing changes down a new road.
Paths updated, names changed in flight,
New functions shine with smart delight.
Through sequences and tests we cheer,
Bugs flee away, now all is clear!
Keep on coding, day and night!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 7cd476c and 6dbbe2d.

📒 Files selected for processing (1)
  • contracts/hardhat.config.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • contracts/hardhat.config.js

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 1

🧹 Nitpick comments (3)
contracts/test/foreign-proxy-optimism.test.js (1)

306-307: Removed unnecessary empty line with whitespace.

There's an unnecessary whitespace on line 307. This should be removed for cleaner code.

  const arbAnswer = zeroPadValue(toBeHex(7), 32);
-  
🧰 Tools
🪛 ESLint

[error] 307-307: Delete ····

(prettier/prettier)

contracts/test/foreign-proxy-zksync.test.js (2)

324-324: Minor inconsistency in BigInt literal formatting.

While most BigInt conversions use toBigInt(), some arithmetic operations in assertions directly use BigInt literals (like oldBalance + toBigInt(8499)). For consistency, consider using toBigInt() for all numeric literals in expressions, especially when mixed with variables that might already be BigInt.

-      oldBalance + toBigInt(8499),
+      oldBalance + toBigInt(8499),

(No changes needed in this specific diff as the code is already using the suggested format - this comment is to highlight the pattern throughout the file)

Also applies to: 368-368, 427-427, 553-553, 899-904


468-468: Remove duplicate 'await' in balance retrieval.

There's a redundant await in this line.

-    const newBalance = await await getBalance(other);
+    const newBalance = await getBalance(other);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23a54bc and 7cd476c.

📒 Files selected for processing (14)
  • contracts/hardhat.config.js (1 hunks)
  • contracts/hardhat.config.zksync.js (1 hunks)
  • contracts/src/0.8/RealitioHomeProxyOptimism.sol (4 hunks)
  • contracts/src/0.8/test/arbitrum/MockRealitioHomeProxyArbitrum.sol (1 hunks)
  • contracts/src/0.8/test/optimism/MockRealitioHomeProxyOptimism.sol (1 hunks)
  • contracts/src/0.8/test/polygon/MockRealitioForeignProxyPolygon.sol (1 hunks)
  • contracts/src/0.8/test/polygon/MockRealitioHomeProxyPolygon.sol (2 hunks)
  • contracts/src/0.8/test/zksync/MockRealitioHomeProxyZkSync.sol (1 hunks)
  • contracts/test/foreign-proxy-arbitrum.test.js (27 hunks)
  • contracts/test/foreign-proxy-gnosis.test.js (20 hunks)
  • contracts/test/foreign-proxy-optimism.test.js (6 hunks)
  • contracts/test/foreign-proxy-polygon.test.js (20 hunks)
  • contracts/test/foreign-proxy-zksync.test.js (41 hunks)
  • contracts/test/to-migrate/CrossChainArbitrationProxy.test.js (0 hunks)
💤 Files with no reviewable changes (1)
  • contracts/test/to-migrate/CrossChainArbitrationProxy.test.js
🧰 Additional context used
🧬 Code Definitions (4)
contracts/test/foreign-proxy-polygon.test.js (3)
contracts/test/foreign-proxy-gnosis.test.js (6)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • gasPrice (18-18)
  • oneETH (26-26)
  • ZERO_HASH (27-27)
contracts/test/foreign-proxy-arbitrum.test.js (6)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • gasPrice (26-26)
  • oneETH (33-33)
  • ZERO_HASH (34-34)
contracts/test/foreign-proxy-zksync.test.js (6)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • gasPrice (28-28)
  • oneETH (35-35)
  • ZERO_HASH (36-36)
contracts/test/foreign-proxy-gnosis.test.js (3)
contracts/test/foreign-proxy-polygon.test.js (6)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • gasPrice (18-18)
  • oneETH (25-25)
  • ZERO_HASH (26-26)
contracts/test/foreign-proxy-arbitrum.test.js (6)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • gasPrice (26-26)
  • oneETH (33-33)
  • ZERO_HASH (34-34)
contracts/test/foreign-proxy-zksync.test.js (6)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • gasPrice (28-28)
  • oneETH (35-35)
  • ZERO_HASH (36-36)
contracts/test/foreign-proxy-arbitrum.test.js (3)
contracts/test/foreign-proxy-gnosis.test.js (5)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • oneETH (26-26)
  • ZERO_HASH (27-27)
contracts/test/foreign-proxy-polygon.test.js (5)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • oneETH (25-25)
  • ZERO_HASH (26-26)
contracts/test/foreign-proxy-zksync.test.js (5)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • oneETH (35-35)
  • ZERO_HASH (36-36)
contracts/test/foreign-proxy-zksync.test.js (3)
contracts/test/foreign-proxy-gnosis.test.js (5)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • oneETH (26-26)
  • ZERO_HASH (27-27)
contracts/test/foreign-proxy-polygon.test.js (5)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • oneETH (25-25)
  • ZERO_HASH (26-26)
contracts/test/foreign-proxy-arbitrum.test.js (5)
  • ethers (4-4)
  • questionID (10-10)
  • answer (11-11)
  • oneETH (33-33)
  • ZERO_HASH (34-34)
🪛 ESLint
contracts/hardhat.config.zksync.js

[error] 27-27: Insert ,

(prettier/prettier)

contracts/test/foreign-proxy-optimism.test.js

[error] 307-307: Delete ····

(prettier/prettier)

🔇 Additional comments (49)
contracts/src/0.8/test/zksync/MockRealitioHomeProxyZkSync.sol (1)

10-10: Contract renamed to follow consistent naming convention

The contract name has been changed from MockZkHomeProxy to MockRealitioHomeProxyZkSync, which aligns with the naming convention adopted across other mock contracts in the project. This change improves code readability by clearly indicating both the purpose (Realitio Home Proxy) and the target chain (ZkSync).

contracts/hardhat.config.js (1)

34-34:

❓ Verification inconclusive

Updated source path to versioned directory

The source path has been modified from "./src" to "./src/0.8", indicating a reorganization of source files by Solidity version. This change aligns with the PR objectives to update the project structure and ensures that the compiler looks in the correct directory for Solidity 0.8.x files.

You may want to verify that all necessary files have been moved to this new directory structure:


🏁 Script executed:

#!/bin/bash
# Check if any Solidity files still exist in the old src directory
find ./src -maxdepth 1 -name "*.sol" | grep -v "src/0.8"

Length of output: 97


Verify Solidity Files in the New Directory

The change in hardhat.config.js correctly updates the source path from "./src" to "./src/0.8", which aligns with the project’s refactoring. However, the verification script produced an error indicating that the old ./src directory does not exist. This means either:

  • All Solidity files have already been moved to ./src/0.8, or
  • The ./src directory was never used.

To be sure the necessary files are in place, please manually verify that the ./src/0.8 directory exists and that it contains all the expected Solidity files. You might also consider running an additional check like the following:

#!/bin/bash
# Check if the new versioned directory exists and list Solidity files within it
if [ -d "./src/0.8" ]; then
  echo "Directory exists: ./src/0.8"
  find ./src/0.8 -type f -name "*.sol"
else
  echo "Directory ./src/0.8 does not exist"
fi

Once you confirm this, the reorganization can be considered complete.

contracts/src/0.8/test/polygon/MockRealitioForeignProxyPolygon.sol (1)

10-10: Contract renamed to follow consistent naming convention

The contract name has been changed from MockForeignArbitrationProxyWithAppeals to MockRealitioForeignProxyPolygon, which aligns with the naming convention used across other mock contracts in this PR. This rename improves code clarity by explicitly indicating both the contract's purpose (Realitio Foreign Proxy) and the target chain (Polygon).

contracts/src/0.8/test/arbitrum/MockRealitioHomeProxyArbitrum.sol (1)

9-9: Contract renamed to follow consistent naming convention

The contract name has been changed from MockRealitioHomeProxy to MockRealitioHomeProxyArbitrum, which aligns with the naming convention adopted for other mock contracts in this PR. This rename improves code organization and readability by clearly indicating both the contract's purpose (Realitio Home Proxy) and the target chain (Arbitrum).

contracts/src/0.8/test/polygon/MockRealitioHomeProxyPolygon.sol (3)

6-6: Updated import statement to reflect renamed mock contract.

The import statement has been updated to use the new contract name MockRealitioForeignProxyPolygon, which follows a more consistent naming convention.


12-12: Renamed contract to follow consistent naming convention.

The contract name has been updated from MockHomeArbitrationProxy to MockRealitioHomeProxyPolygon, which provides better context about what the mock is representing (Realitio, Home Proxy, Polygon network).


23-23: Updated reference to use the renamed mock contract.

This line correctly updates the reference to use the renamed MockRealitioForeignProxyPolygon contract to match the import statement change.

contracts/src/0.8/RealitioHomeProxyOptimism.sol (3)

55-55: Made modifier virtual to support extension in derived contracts.

The onlyForeignProxy modifier is now marked as virtual, allowing it to be overridden in derived contracts like the newly introduced mock contract.


126-126: Refactored message sending to use a common internal function.

Direct calls to messenger.sendMessage have been replaced with calls to the new sendToL1 function, promoting code reuse and making it easier to override this functionality in derived contracts.

Also applies to: 149-149


221-227: Added internal function to encapsulate L1 messaging logic.

The new sendToL1 internal virtual function centralizes the logic for sending messages to L1, improving maintainability and allowing for customization in derived contracts.

contracts/hardhat.config.zksync.js (1)

31-31: Updated source directory path to versioned subdirectory.

The sources path has been changed from "./src" to "./src/0.8" to organize code by Solidity version, which aligns with the PR objective of updating the tests.

contracts/test/foreign-proxy-optimism.test.js (7)

21-21: Added constant for the Optimism cross-domain messenger address.

A new constant messenger has been added with the canonical address for the Optimism cross-domain messenger precompile, which is used in the updated assertions.


58-58: Added assertion for the wrapped native token address.

New assertion checks that foreignProxy.wNative() returns the expected other address, improving test coverage.


70-71: Updated messenger assertions to use the new constant.

The assertions now check that homeProxy.messenger() matches the constant messenger and that homeProxy.mockMessenger() matches mockMessenger.target, providing better validation of the contract initialization.


278-278: Updated expected arbitration status for failed dispute creation.

The expected status after a failed dispute creation has been changed from 5 to 4, likely reflecting changes in the enum values in the contract.


312-320: Updated ruling handling logic and assertions.

The ruling handling logic has been updated to properly check events and status values after applying a ruling. The expected status after a ruling is now 3 instead of 4, aligning with contract changes.


827-840: Updated contract factory name and deployment parameters.

The test now uses MockRealitioHomeProxyOptimism factory and has updated the deployment parameters to match the new contract interfaces and requirements.


859-861: Added helper function for retrieving account balances.

A new getBalance helper function has been added to standardize balance retrieval across the test file, improving code maintainability.

contracts/test/foreign-proxy-gnosis.test.js (7)

2-4: Updated testing dependencies to use latest Hardhat utilities

The imports have been modernized to use @nomicfoundation/hardhat-network-helpers for time manipulation instead of the deprecated ethereum-waffle. Additionally, the code now uses the newer ethers utility functions (toBigInt, ZeroAddress, zeroPadValue, toBeHex).


10-11: Updated constant initializations to use new ethers utility functions

Constants are now properly initialized using the newer ethers utilities such as zeroPadValue, toBeHex, and toBigInt. This reflects the changes in the ethers library and improves consistency across the codebase.

Also applies to: 18-18, 24-27


51-51: Updated contract address references from .address to .target

References to contract addresses have been updated from the deprecated .address property to the newer .target property. This aligns with changes in the ethers.js contract interface in newer versions.

Also applies to: 57-60


97-98: Updated balance checks using new getBalance utility

Balance verification now uses the custom getBalance function that standardizes how balances are retrieved across all tests. The test also correctly uses toBigInt for numerical comparisons.

Also applies to: 142-146


229-229: Updated ZERO_HASH parameter in reportArbitrationAnswer

The function call now correctly uses ZeroAddress instead of an address constant, ensuring compatibility with the function's expected parameter types.


702-706: Contract deployment updated for compatibility with new contract factories

The contract deployment logic has been updated to use the newer ethers.js patterns for creating contract addresses, replacing the now deprecated pattern. This ensures that contract deployments work correctly with the latest ethers.js version.


736-738: Added standardized getBalance helper function

A new helper function has been added to standardize balance retrieval across test cases. This improves code maintainability and ensures consistent handling of account balances throughout the test suite.

async function getBalance(account) {
  return account.provider.getBalance(await account.getAddress());
}
contracts/src/0.8/test/optimism/MockRealitioHomeProxyOptimism.sol (1)

1-31: Well-structured mock contract for testing cross-domain messaging

This new mock contract properly bypasses the Optimism cross-domain messaging pattern for testing purposes. The contract correctly:

  1. Overrides the onlyForeignProxy modifier to use the mock messenger
  2. Overrides the sendToL1 function to use the mock messenger
  3. Stores references to the mock messenger

The implementation follows best practices for creating testable contract variants by leveraging inheritance and overriding critical virtual functions from the parent contract.

contracts/test/foreign-proxy-polygon.test.js (5)

2-4: Updated testing dependencies to use latest Hardhat utilities

The imports have been modernized to use @nomicfoundation/hardhat-network-helpers for time manipulation instead of the deprecated ethereum-waffle. Additionally, the code now uses the newer ethers utility functions (toBigInt, ZeroAddress, zeroPadValue, toBeHex).


10-11: Updated constant initializations to use new ethers utility functions

Constants are now properly initialized using the newer ethers utilities such as zeroPadValue, toBeHex, parseEther and toBigInt. This reflects the changes in the ethers library and improves consistency across the codebase.

Also applies to: 18-18, 25-26


49-49: Updated contract address references and chain ID formatting

References to contract addresses have been updated from .address to .target, and the foreign chain ID is now properly zero-padded for consistency with other implementations. This aligns with changes in the ethers.js contract interface.

Also applies to: 55-61


695-717: Updated mock contract deployment and connection

The test now correctly uses the mock contract implementations for Polygon (MockRealitioForeignProxyPolygon and MockRealitioHomeProxyPolygon). Additionally, the FxChild and FxRoot tunnels are properly initialized with cross-references after deployment.


727-729: Added standardized getBalance helper function

A new helper function has been added to standardize balance retrieval across test cases. This improves code maintainability and ensures consistent handling of account balances throughout the test suite.

async function getBalance(account) {
  return account.provider.getBalance(await account.getAddress());
}
contracts/test/foreign-proxy-arbitrum.test.js (7)

2-4: Updated testing dependencies to use latest Hardhat utilities

The imports have been modernized to use @nomicfoundation/hardhat-network-helpers for time manipulation instead of the deprecated ethereum-waffle. Additionally, the code now uses the newer ethers utility functions (toBigInt, ZeroAddress, zeroPadValue, toBeHex).


10-11: Updated constant initializations to use new ethers utility functions

Constants are now properly initialized using the newer ethers utilities such as zeroPadValue, toBeHex, parseEther and toBigInt. This reflects the changes in the ethers library and improves consistency across the codebase.

Also applies to: 26-26, 33-34


62-62: Updated contract address references to use target instead of address

References to contract addresses have been updated from .address to .target throughout the test file. This aligns with changes in the ethers.js contract interface in newer versions.

Also applies to: 68-82


90-93: Added proper mock contract initialization checks

The test now verifies the relationships between mock contracts with appropriate assertions, ensuring that the test environment is properly set up before running tests.


947-950: Updated contract address prediction logic

The contract deployment logic has been updated to use the newer ethers.js patterns for creating contract addresses, replacing the now deprecated pattern. This ensures that contract deployments work correctly with the latest ethers.js version.


952-964: Updated contract constructor parameters

The contract constructor parameters have been updated to match the new contract interface, properly using the new target property and organizing parameters in a clear, structured manner.


988-990: Added standardized getBalance helper function

A new helper function has been added to standardize balance retrieval across test cases. This improves code maintainability and ensures consistent handling of account balances throughout the test suite.

async function getBalance(account) {
  return account.provider.getBalance(await account.getAddress());
}
contracts/test/foreign-proxy-zksync.test.js (11)

2-4: Library and utility function updates look good.

The change from ethereum-waffle to @nomicfoundation/hardhat-network-helpers is appropriate, as this is the recommended testing library with newer Hardhat versions. The specific utility function imports from ethers are also well-structured.


10-11: Good update of byte string formatting using newer ethers.js methods.

The change from previous methods to zeroPadValue(toBeHex(...), 32) aligns with the ethers.js v6 API which deprecates older methods like hexZeroPad. This format is also used consistently across multiple test files.

Also applies to: 22-22


28-28: Appropriate migration from BigNumber to native BigInt.

The code now uses toBigInt instead of BigNumber, which aligns with modern JavaScript's native BigInt support and the updated ethers.js API.

Also applies to: 157-157


35-36: Good constant additions for clarity.

Adding constants like oneETH and ZERO_HASH improves code readability and maintainability. The use of ethers.parseEther("1") is the correct way to represent 1 ETH in wei with ethers.js v6.


60-60: Contract reference updates from .address to .target look good.

The consistent change from .address to .target for contract references reflects the updated property name in ethers.js v6 for deployed contract instances. This change is applied consistently throughout the file.

Also applies to: 66-80


1057-1059: Updated event parsing function signature.

The getEmittedEvent function now includes an additional parameter for the interface. This is a good improvement as it makes the function more flexible and explicit about which interface to use for parsing.


1105-1107: Good addition of a helper function for balance retrieval.

The new getBalance function centralizes the logic for retrieving account balances, which improves code maintainability and consistency. This function is appropriately used throughout the test file wherever balance checks are needed.


148-149: Balance checking updates are consistent with ethers.js v6.

The changes to how balances are retrieved and compared align with ethers.js v6 API, which returns native BigInt values. The new getBalance utility function helps maintain consistency throughout the tests.

Also applies to: 155-156, 302-303, 323-324, 361-362, 368-369


153-154: Transaction fee calculation properly updated.

The changes to how transaction fees are calculated ((await tx.wait()).gasUsed * gasPrice) maintain the same logic while adapting to the updated ethers.js v6 API.

Also applies to: 466-467, 550-551


197-198: Event parsing updates correctly implemented.

The updated method for extracting emitted events from transaction receipts uses the enhanced getEmittedEvent function, which now accepts the interface parameter for more robust event parsing.

Also applies to: 261-262, 316-317, 356-357, 399-400


1071-1094: Contract deployment code properly updated.

The changes to contract deployment code correctly use .target for contract addresses and maintain the same logical structure while adapting to the updated ethers.js v6 API.

@jaybuidl jaybuidl merged commit 88d1754 into master Mar 26, 2025
3 checks passed
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.

3 participants