Skip to content
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

[General] Passing an array in zksync-cli #656

Open
bxpana opened this issue Aug 17, 2024 Discussed in #646 · 1 comment
Open

[General] Passing an array in zksync-cli #656

bxpana opened this issue Aug 17, 2024 Discussed in #646 · 1 comment
Labels
devtools Questions related to zkSync Tooling docs Items needed to be added or updated in the documentation feature-request Feature request general General question

Comments

@bxpana
Copy link
Contributor

bxpana commented Aug 17, 2024

Tracking in matter-labs/zksync-cli#164

Discussed in #646

Originally posted by 1am August 10, 2024

Environment

Mainnet

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?
Whatever I try to input it never gets interpreted as array and API encodes it as a s string in this line

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 Details

No response

@bxpana bxpana added feature-request Feature request general General question devtools Questions related to zkSync Tooling labels Aug 17, 2024
@itsacoyote
Copy link

This has been fixed with matter-labs/zksync-cli#166

@bxpana bxpana added the docs Items needed to be added or updated in the documentation label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devtools Questions related to zkSync Tooling docs Items needed to be added or updated in the documentation feature-request Feature request general General question
Projects
None yet
Development

No branches or pull requests

2 participants