-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix localnet issues #265
Conversation
WalkthroughThe recent changes focus on restructuring and enhancing the contract deployment functions within the codebase. Key functions were renamed and updated to improve clarity and functionality, while new parameters were introduced to facilitate better interaction with the protocol's contracts. Additionally, significant updates were made to task parameters for local network interactions, ensuring consistency across contract references and fostering correct operation in the evolving ecosystem. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Worker
participant Contract
User->>Worker: Initiate deployProtocolContracts
Worker->>Contract: Deploy contracts with new parameters
Contract-->>Worker: Return contract addresses
Worker-->>User: Output deployed contract addresses
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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
Outside diff range, codebase verification and nitpick comments (1)
tasks/localnet.ts (1)
84-86
: Issues found with the contract addresses.The contract addresses
0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
,0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82
, and0x8A791620dd6260079BF849Dc5567aDC3F2FdC318
were not found in the codebase. This suggests that they might be incorrect or unused.
- Ensure that the contract addresses are valid and correctly deployed.
- Verify that the addresses are correctly referenced in the codebase.
Analysis chain
Verify the new contract addresses.
Ensure that the new contract addresses for
gatewayEVM
,zContract
, anderc20
are valid and correctly deployed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new contract addresses for `gatewayEVM`, `zContract`, and `erc20`. # Test: Check if the contracts are deployed at the new addresses. Expect: Contract code at the addresses. addresses=("0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318") for address in "${addresses[@]}"; do echo "Checking contract at address: $address" code=$(npx hardhat --network localhost getCode $address) if [ "$code" == "0x" ]; then echo "No contract found at address: $address" exit 1 else echo "Contract found at address: $address" fi doneLength of output: 1717
Script:
#!/bin/bash # Description: Search for the usage of the contract addresses in the codebase. addresses=("0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318") for address in "${addresses[@]}"; do echo "Searching for address: $address" ast-grep --lang javascript --pattern $address doneLength of output: 922
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- scripts/worker.ts (8 hunks)
- tasks/localnet.ts (5 hunks)
Additional context used
Path-based instructions (2)
tasks/localnet.ts (1)
Pattern
tasks/**
: Review the Hardhat tasks for best practices.scripts/worker.ts (1)
Pattern
scripts/**
: Review the Hardhat scripts for best practices.
Additional comments not posted (5)
tasks/localnet.ts (3)
10-11
: Verify the new contract addresses.Ensure that the new contract addresses for
gatewayZEVM
andreceiverEVM
are valid and correctly deployed.
32-34
: Verify the new contract addresses.Ensure that the new contract addresses for
gatewayZEVM
,receiverEVM
, andzrc20
are valid and correctly deployed.Verification successful
Verify the new contract addresses by examining their usage in the codebase.
We need to ensure that the new contract addresses for
gatewayZEVM
,receiverEVM
, andzrc20
are correctly referenced and deployed by examining their usage in the codebase.
The new contract addresses are correctly referenced in the codebase.
The addresses
0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6
,0x610178dA211FEF7D417bC0e6FeD39F05609AD788
, and0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe
are correctly referenced in thetasks/localnet.ts
file and found in multiple configuration files, indicating they are recognized addresses in different environments.
tasks/localnet.ts
: Lines 32-34, 40-42, 47-49data/addresses.testnet.json
data/addresses.mainnet.json
data/addresses.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new contract addresses for `gatewayZEVM`, `receiverEVM`, and `zrc20`. # Test: Check if the contracts are deployed at the new addresses. Expect: Contract code at the addresses. addresses=("0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" "0x610178dA211FEF7D417bC0e6FeD39F05609AD788" "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe") for address in "${addresses[@]}"; do echo "Checking contract at address: $address" code=$(npx hardhat --network localhost getCode $address) if [ "$code" == "0x" ]; then echo "No contract found at address: $address" exit 1 else echo "Contract found at address: $address" fi doneLength of output: 1717
Script:
#!/bin/bash # Search for the usage of the contract addresses in the codebase addresses=("0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" "0x610178dA211FEF7D417bC0e6FeD39F05609AD788" "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe") for address in "${addresses[@]}"; do echo "Searching for usage of address: $address" rg "$address" -A 5 -B 5 doneLength of output: 7322
66-67
: Verify the new contract addresses.Ensure that the new contract addresses for
gatewayEVM
andzContract
are valid and correctly deployed.scripts/worker.ts (2)
11-57
: Verify the correct integration of new parameters and contract instances.Ensure that the new parameters (
ownerEVM
,ownerZEVM
,fungibleModuleSigner
) and new contract instances (TestERC20
,ZetaConnectorNonNative
,WZETA
) are correctly integrated and functioning as expected.
Line range hint
67-116
:
Verify the correct integration of new references and management of contracts.Ensure that the new references (
protocolContracts
) and management of contracts (e.g.,TestERC20
,ReceiverEVM
,TestZContract
,ZRC20New
) are correctly integrated and functioning as expected.Verification successful
Verified the correct integration of new references and management of contracts.
The deployment patterns for the contracts
TestERC20
,ReceiverEVM
,TestZContract
, andZRC20New
were found in thescripts/worker.ts
file, confirming that the changes are correctly integrated.
TestERC20
: Found at lines 19 and 74 inscripts/worker.ts
.ReceiverEVM
: Found at line 75 inscripts/worker.ts
.TestZContract
: Found at line 87 inscripts/worker.ts
.ZRC20New
: Found at line 90 inscripts/worker.ts
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct integration of new references and management of contracts. # Test: Check if the contracts are deployed and initialized correctly. contracts=("TestERC20" "ReceiverEVM" "TestZContract" "ZRC20New") for contract in "${contracts[@]}"; do echo "Checking deployment of contract: $contract" code=$(npx hardhat --network localhost getContractFactory $contract) if [ -z "$code" ]; then echo "Failed to deploy contract: $contract" exit 1 else echo "Successfully deployed contract: $contract" fi doneLength of output: 448
Script:
#!/bin/bash # Description: Verify the correct integration of new references and management of contracts. # Use ast-grep to search for deployment and interaction patterns of the contracts within the codebase patterns=( 'await ethers.getContractFactory("TestERC20")' 'await ethers.getContractFactory("ReceiverEVM")' 'await ethers.getContractFactory("TestZContract")' 'await ethers.getContractFactory("ZRC20New")' ) for pattern in "${patterns[@]}"; do echo "Searching for pattern: $pattern" ast-grep --lang typescript --pattern "$pattern" doneLength of output: 1842
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
==========================================
+ Coverage 49.13% 58.10% +8.97%
==========================================
Files 16 16
Lines 403 401 -2
Branches 108 28 -80
==========================================
+ Hits 198 233 +35
- Misses 160 165 +5
+ Partials 45 3 -42 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I do something wrong in the setup, I used to be able to run the command.
Get the following error with yarn localnet
:
[WORKER] Error HH700: Artifact for contract "forge-std/Test.sol:Test" not found.
If I run yarn compile
:
Error HH700: Artifact for contract "forge-std/Test.sol:Test" not found.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving following @fadeev feedbacks, as I assume the yarn errors I listed will be solved with the v1/v2 separation
probably you can remove artifacts folder or force recompile to get artifacts from lib folder, but with separation it should be easier yes @fadeev could you please approve if it works and i will merge this one? |
closes: #261
Summary by CodeRabbit
New Features
Bug Fixes
Chores