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❌ Not 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❌ Not 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❌ Not SupportedVerifies that a deployed contract’s bytecode matches the expected source code, ensuring it hasn’t been tampered with.
forge verify-check❌ Not SupportedChecks the verification status of a contract on a blockchain explorer like Etherscan, confirming that it has been successfully verified.
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❌ Not 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❌ Not SupportedEstimates the gas cost of executing a transaction on the blockchain.
cast estimate –create❌ Not SupportedEstimates the gas cost for deploying a contract with a creation transaction.
cast etherscan-sourceβœ… SupportedFetches and displays the verified source code of a contract from Etherscan.
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❌ Not 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❌ Not 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❌ Not 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.