zksync-cli contract
zksync-cli contract [sub-command] [options]
Description
The contract
command provides several sub-commands to interact with transactions via the command line.
read
zksync-cli contract read [options]
The id of the chain to create the transaction.
Override the defined L2 RPC URL for the Chain specified.
The address of the smart contract.
The method with argument types in the smart contract to interact with.
Example: "balanceOf(address)"
The arguments for the smart contract method.
The encoded transaction data to add to the transaction.
The expected output types returned from the method.
The address to read on behalf of.
The relative file location of the contract artifact or ABI file.
Set to true to skip the decoding response.
Set to true to show the transaction request information (e.g. encoded data).
write
zksync-cli contract write [options]
The id of the chain to create the transaction.
Override the defined L2 RPC URL for the Chain specified.
The address of the smart contract.
The method with argument types in the smart contract to interact with.
Example: "transfer(address, uint256)"
The arguments for the smart contract method.
The Ether value to send with the transaction.
The encoded transaction data to add to the transaction.
The private key of the sender used to generate the transaction.
The relative file location of the contract artifact or ABI file.
Set to true to show the transaction request information (e.g. encoded data).
encode
zksync-cli contract encode [options]
The method with argument types in the smart contract to interact with.
Example: "transfer(address, uint256)"
The arguments for the smart contract method.
The relative file location of the contract artifact or ABI file.