Skip to content

Foundry-ZKSync Supported Commands

This is a comprehensive review of all the Foundry commands actually supported in the actual stage of development.

🔄 Last update: September 12, 2024

CommandStatusDescription
forge bind✅ SupportedGenerates type-safe bindings for Solidity contracts, which can be used in other programming languages like Go.
forge bind-json✅ SupportedSimilar to forge bind, but generates bindings directly from JSON ABI files.
forge build✅ SupportedCompiles Solidity contracts and generates build artifacts, such as ABI and bytecode files.
forge clone✅ SupportedClones an existing project from a Git repository, setting up a new Foundry project.
forge completions✅ SupportedGenerates shell completion scripts for forge, enhancing command-line usability.
forge config✅ SupportedDisplays or modifies the configuration settings for a Foundry project.
forge create✅ SupportedDeploys a Solidity contract to a blockchain network, handling the transaction and deployment process.
forge doc✅ SupportedGenerates documentation for Solidity contracts, extracting comments and annotations into a readable format.
forge flatten✅ SupportedFlattens a Solidity contract and its dependencies into a single file, useful for verification or analysis.
forge coverage❌ Not SupportedRuns tests and generates a code coverage report, showing how much of the code is covered by tests.
forge debug❌ Not SupportedDebugs a transaction on a local fork or a live network, allowing you to step through the execution.
forge cache clean✅ SupportedClears the local cache, removing stored build artifacts and other cached data.
forge cache ls✅ SupportedLists the contents of the local cache, including build artifacts and other data.
forge clean✅ SupportedRemoves build artifacts and resets the project's build state.
forge eip712✅ SupportedGenerates EIP-712 typed data structures for Solidity contracts, used for off-chain signing and verification.
forge fmt✅ SupportedFormats Solidity source code according to a standard style guide, ensuring consistency.
forge geiger✅ SupportedAnalyzes a Solidity project for unsafe or potentially insecure code patterns, helping to improve security.
forge generate✅ SupportedAutomatically generates Solidity code or tests based on specified templates or patterns.
forge generate test✅ SupportedGenerates boilerplate test files for Solidity contracts, speeding up the testing process.
forge generate-fig-spec✅ SupportedGenerates a Fig spec for Forge, which can be used to create command-line autocomplete functionality.
forge init✅ SupportedInitializes a new Foundry project, creating the necessary directories and configuration files.
forge inspect✅ SupportedInspects the details of a Solidity contract, such as ABI, bytecode, and other metadata.
forge install✅ SupportedInstalls dependencies from the Foundry package manager, adding them to the project.
forge remappings✅ SupportedManages remappings for Solidity imports, allowing for custom paths or package names.
forge remove✅ SupportedRemoves a dependency from the project, cleaning up any related files or configuration.
forge script✅ SupportedExecutes Solidity scripts, which can be used for tasks like deploying contracts or interacting with the blockchain.
forge selectors✅ SupportedExtracts and manages function selectors from Solidity contracts, used for interacting with contracts.
forge selectors collision✅ SupportedDetects and reports any selector collisions in Solidity contracts, preventing potential conflicts.
forge selectors upload✅ SupportedUploads function selectors to a specified registry, making them available for use in other projects.
forge selectors list✅ SupportedLists all function selectors in a Solidity contract, providing an overview of its interface.
forge snapshot✅ SupportedCreates a snapshot of the current state of tests, which can be used to check for regressions.
forge soldeer install✅ SupportedInstalls a specific version of Soldeer, ensuring compatibility with the project.
forge soldeer update✅ SupportedUpdates the Soldeer installation to the latest version, applying any necessary patches or improvements.
forge soldeer login✅ SupportedLogs into the Soldeer service, providing authentication for managing dependencies and projects.
forge soldeer push✅ SupportedPushes changes to a Soldeer project, syncing them with the remote repository or service.
forge soldeer version-dry-run✅ SupportedTests a version update of Soldeer without actually applying the changes, useful for checking compatibility.
forge test✅ SupportedRuns unit tests for Solidity contracts, with options for gas reporting, fuzzing, and more.
forge tree✅ SupportedDisplays the dependency tree of the project, showing how contracts and libraries are interconnected.
forge update✅ SupportedUpdates the project's dependencies to their latest versions, ensuring everything is up-to-date.
forge verify-bytecode✅ SupportedVerifies that a deployed contract's bytecode matches the expected source code, ensuring it hasn't been tampered with.
forge verify-check✅ SupportedChecks the contract's verification status on either the ZKsync block explorer (using --verifier) or Etherscan, confirming successful verification.
forge verify-contract✅ SupportedVerifies a deployed contract on Etherscan, ensuring it matches the source code.
cast 4byte✅ SupportedFetches function signatures from the 4byte.directory by their selector.
cast 4byte-decode✅ SupportedDecodes a given 4-byte selector into its associated function signature.
cast 4byte-event✅ SupportedFetches event signatures from the 4byte.directory by their selector.
cast abi-decode✅ SupportedDecodes ABI-encoded data into a human-readable format.
cast abi-encode✅ SupportedEncodes data into ABI format for function calls and transactions.
cast access-list❌ Not SupportedGenerates an access list for a transaction, which can be used to optimize gas usage.
cast address-zero✅ SupportedOutputs the zero address (0x0000000000000000000000000000000000000000).
cast admin✅ SupportedReturns the admin of a specified proxy contract.
cast age✅ SupportedCalculates the age of a block in seconds.
cast balance✅ SupportedRetrieves the balance of an address in wei or ether.
cast base-fee✅ SupportedFetches the base fee of the latest block, useful for estimating gas costs.
cast bind (DEPRECATED)✅ SupportedGenerates Go bindings for Solidity contracts, similar to forge bind.
cast block✅ SupportedRetrieves detailed information about a specific block on the blockchain.
cast block-number✅ SupportedReturns the current block number of the Ethereum blockchain.
cast call✅ SupportedExecutes a read-only (constant) call to a smart contract.
cast call --create✅ SupportedCalls a contract and creates a new contract in the same transaction.
cast calldata✅ SupportedEncodes function call data for a contract, which can be used in transactions.
cast calldata-decode✅ SupportedDecodes encoded calldata back into its original arguments.
cast chain❌ Not SupportedDisplays information about the current Ethereum chain, including its name and ID.
cast chain-id✅ SupportedReturns the chain ID of the Ethereum network, which is used for transaction signing.
cast client✅ SupportedFetches information about the connected Ethereum client, such as its version.
cast code✅ SupportedRetrieves the bytecode of a contract deployed at a specific address.
cast codesize✅ SupportedReturns the size of the bytecode at a specific address, in bytes.
cast completions✅ SupportedGenerates shell completions for cast, improving command-line usability.
cast compute-address✅ SupportedComputes the Ethereum address for a contract deployed by a specific account.
cast concat-hex✅ SupportedConcatenates multiple hexadecimal values into a single hex string.
cast create2✅ SupportedComputes the address of a contract deployed using the CREATE2 opcode.
cast decode-eof✅ SupportedDecodes Ethereum Object Format (EOF) bytecode, used in Ethereum contracts.
cast decode-transaction✅ SupportedDecodes the data and parameters of a raw transaction.
cast disassemble❌ Not SupportedDisassembles contract bytecode into readable EVM assembly instructions.
cast estimate✅ SupportedEstimates the gas cost of executing a transaction on the blockchain.
cast estimate --create✅ SupportedEstimates the gas cost for deploying a contract with a creation transaction.
cast source✅ SupportedFetches and displays the verified source code of a contract from a block explorer.
cast find-block✅ SupportedFinds a block based on a given timestamp, returning the block number.
cast format-bytes32-string✅ SupportedConverts a string into a bytes32 format for Solidity.
cast from-bin✅ SupportedDecodes binary-encoded data into a human-readable format.
cast from-fixed-point✅ SupportedConverts a fixed-point number into a human-readable string.
cast from-rlp✅ SupportedDecodes RLP-encoded data, commonly used in Ethereum transactions.
cast from-utf8✅ SupportedConverts a UTF-8 string to a hex-encoded representation.
cast from-wei✅ SupportedConverts a value from wei (the smallest unit of ether) to ether.
cast gas-price✅ SupportedFetches the current gas price on the Ethereum network.
cast generate-fig-spec✅ SupportedGenerates a Fig spec for Cast, which can be used for command-line autocomplete functionality.
cast hash-message (DEPRECATED)✅ SupportedHashes a message using Ethereum's eth_sign method, preparing it for signing.
cast hash-zero✅ SupportedReturns the hash of an empty string (0x000...000) using Keccak-256.
cast implementation✅ SupportedReturns the implementation address of a specified proxy contract.
cast index❌ Not SupportedFetches the indexed logs of an event from the blockchain, useful for querying historical data.
cast index-erc7201✅ SupportedFetches the logs of an ERC-7201 compliant event from the blockchain
cast interface❌ Not SupportedGenerates a Solidity interface from a deployed contract's ABI.
cast keccak✅ SupportedComputes the Keccak-256 hash of the provided input data.
cast logs✅ SupportedFetches logs and events from the blockchain, based on specified filters.
cast lookup-address✅ SupportedFetches the ENS name associated with a given Ethereum address, if any.
cast max-int✅ SupportedOutputs the maximum value for a signed 256-bit integer.
cast max-uint✅ SupportedOutputs the maximum value for an unsigned 256-bit integer.
cast min-int✅ SupportedOutputs the minimum value for a signed 256-bit integer.
cast mktx✅ SupportedCreates a transaction object without sending it, useful for offline signing.
cast mktx --create✅ SupportedCreates a transaction that deploys a contract, without sending it.
cast namehash✅ SupportedComputes the ENS namehash for a given domain name.
cast nonce✅ SupportedRetrieves the nonce of an Ethereum address, useful for determining transaction order.
cast parse-bytes32-address✅ SupportedParses a bytes32 value into an Ethereum address.
cast parse-bytes32-string✅ SupportedParses a bytes32 value into a human-readable string.
cast pretty-calldata✅ SupportedFormats calldata in a human-readable manner.
cast proof❌ Not SupportedRetrieves and displays a Merkle proof for a specific storage slot or account.
cast publish✅ SupportedPublishes a smart contract's ABI to Etherscan.
cast receipt✅ SupportedFetches and displays the receipt of a transaction, including gas used and status.
cast resolve-name✅ SupportedResolves an ENS name to its associated Ethereum address.
cast rpc✅ SupportedSends a raw JSON-RPC request to an Ethereum node, allowing low-level interaction.
cast run✅ SupportedRuns a script file, such as a .js or .ts file, with access to Cast functions.
cast selectors❌ Not SupportedFetches the function selectors for a given contract or ABI.
cast send✅ SupportedSends a transaction to the blockchain, including smart contract interactions.
cast send --create✅ SupportedSends a transaction that creates a new contract on the blockchain.
cast shl✅ SupportedPerforms a bitwise left shift on the provided input.
cast shr✅ SupportedPerforms a bitwise right shift on the provided input.
cast sig✅ SupportedOutputs the Keccak-256 hash of a function signature.
cast sig-event✅ SupportedOutputs the Keccak-256 hash of an event signature.
cast storage✅ SupportedFetches and displays the raw storage value of a contract at a specific slot.
cast to-ascii✅ SupportedConverts a hexadecimal string to an ASCII string.
cast to-base✅ SupportedConverts a number to a different base (e.g., from decimal to hexadecimal).
cast to-bytes32✅ SupportedConverts input data to a bytes32 format.
cast to-check-sum-address✅ SupportedConverts an Ethereum address to a checksummed format, which includes capital letters for error detection.
cast to-dec✅ SupportedConverts input data to a decimal number.
cast to-fixed-point✅ SupportedConverts input data to a fixed-point number representation.
cast to-hex✅ SupportedConverts input data to a hexadecimal format.
cast to-hexdata✅ SupportedConverts input data to hex-encoded binary data.
cast to-int256✅ SupportedConverts input data to a signed 256-bit integer.
cast to-rlp✅ SupportedEncodes input data in Recursive Length Prefix (RLP) format.
cast to-uint256✅ SupportedConverts input data to an unsigned 256-bit integer.
cast to-unit✅ SupportedConverts ether or wei into different units, like gwei or finney.
cast to-utf8✅ SupportedConverts a hexadecimal string to a UTF-8 encoded string.
cast to-wei✅ SupportedConverts ether or other units into wei, the smallest unit of ether.
cast tx✅ SupportedFetches and displays details of a specific Ethereum transaction.
cast upload-signature✅ SupportedUploads a function or event signature to the 4byte.directory.
cast wallet✅ SupportedA suite of wallet-related commands, allowing you to manage Ethereum wallets, create new ones, sign transactions, and more.
cast wallet new✅ SupportedGenerates a new Ethereum wallet with a private key and address.
cast wallet new-mnemonic✅ SupportedCreates a new wallet using a mnemonic phrase, which can be used to recover the wallet later.
cast wallet vanity✅ SupportedGenerates a new wallet with a custom, vanity address (e.g., one that starts with specific characters).
cast wallet address✅ SupportedOutputs the Ethereum address associated with a given private key.
cast wallet sign✅ SupportedSigns a message or transaction using the private key of a specified wallet.
cast wallet sign-auth (DEPRECATED?)✅ SupportedSigns an authorization message with a private key, often used in authentication workflows.
cast wallet verify✅ SupportedVerifies a signed message, confirming that it was signed by the holder of the private key associated with a specific address.
cast wallet import✅ SupportedImports an Ethereum wallet using a private key or mnemonic phrase.
cast wallet list✅ SupportedLists all wallets stored in a specific keystore.
cast wallet private-key✅ SupportedOutputs the private key associated with a given wallet, provided proper authentication.
cast wallet decrypt-keystore✅ SupportedDecrypts a keystore file to retrieve the private key, requiring the correct password.
anvil✅ SupportedA local Ethereum node implementation, similar to Ganache, that can be used for testing and development.
anvil completions✅ SupportedGenerates shell completions for anvil, useful for auto-completing commands in the terminal.
anvil generate-fig-spec✅ SupportedGenerates a Fig autocomplete spec for anvil, providing interactive command suggestions.
chisel✅ SupportedA tool used to interact with and modify smart contracts, providing operations like loading, listing, and clearing caches of tools.
chisel list✅ SupportedLists all available chisel tools or operations that can be applied to smart contracts.
chisel load✅ SupportedLoads a specific chisel tool or operation, making it ready for use on a smart contract.
chisel view✅ SupportedDisplays the details or configuration of a loaded chisel tool or operation.
chisel clear-cache✅ SupportedClears the cache of chisel tools or operations, forcing a reload or update.