[General] Passing an array in zksync-cli #646
-
EnvironmentMainnet Provide a brief description of the functionality you're trying to implement and the issue you are running into.Hello I'm trying to test one contract which requires an address[] as input but it doesn't seem possible with zksync-cli, am I getting it right? My flow looks like below (addresses trimmed for readability, though nothing secret here) $ zksync-cli contract read
? Chain to use zkSync Mainnet
? Contract address 0x8....4
? Contract method to call getPairInfo(address[] path, bool stable) view returns (address tokenA, address tokenB, address pair, uint256 reserveA,
uint256 reserveB, uint256 fee)
? Provide method arguments:
? [1/2] path (address[]) [0x5...E,0x0...A]
>> Failed to encode provided argument: expected array value (argument="path",
value="[0x5...E,0x0...A]", code=INVALID_ARGUMENT, version=abi/5.7.0) Is there some other way to interact with such contracts, other than writing a script? I find the CLI super useful but got stopped by this situation ;) Repo Link (Optional)No response Additional DetailsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
It seems you are encountering an issue with passing an array of addresses as an argument in the ZKsync CLI. The correct way to pass an array of addresses to a method using the ZKsync CLI is to ensure that the array is formatted correctly in the command line interface. Here’s how you can format the array of addresses:
If you continue to experience issues, it might be helpful to check the documentation for any updates or specific instructions on passing array types, or consider using a script for more complex interactions. For more detailed guidance on using the ZKsync CLI, you can refer to the ZKsync CLI documentation. Your feedback helps us serve you better. If this fully addresses your question, please give it a thumbs up. If it doesn't, please give it a thumbs down. This will inform the community and team so we can improve our support. |
Beta Was this translation helpful? Give feedback.
-
Added as feature request in the zksync-cli repo: matter-labs/zksync-cli#164 |
Beta Was this translation helpful? Give feedback.
-
This has been fixed with matter-labs/zksync-cli#166 |
Beta Was this translation helpful? Give feedback.
This has been fixed with matter-labs/zksync-cli#166