├── .all-contributorsrc
├── .gitattributes
├── .github
├── CODEOWNERS
└── workflows
│ ├── deploy.yml
│ ├── project.yml
│ ├── test.yml
│ └── update.yml
├── .gitignore
├── .gitmodules
├── CONTRIBUTING.md
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── book.toml
├── scripts
├── common
├── gen_output.sh
└── gen_output
│ ├── cast.sh
│ ├── chisel.sh
│ ├── forge.sh
│ ├── help.rs
│ ├── help.sh
│ └── vm.sh
├── src
├── README.md
├── SUMMARY.md
├── ci-cd
│ └── github-actions.md
├── contributing.md
├── reference
│ └── cli
│ │ └── forge
│ │ └── soldeer
│ │ └── update.md
└── static
│ ├── config.default.toml
│ ├── custom.css
│ └── solidity.min.js
├── theme
├── card.png
├── favicon.png
└── head.hbs
└── vocs
├── README.md
├── bun.lockb
├── docs
├── pages
│ ├── anvil
│ │ ├── overview.md
│ │ └── reference.md
│ ├── cast
│ │ ├── overview.md
│ │ └── reference
│ │ │ ├── abi-commands.mdx
│ │ │ ├── account-commands.mdx
│ │ │ ├── block-commands.mdx
│ │ │ ├── cast-4byte-calldata.mdx
│ │ │ ├── cast-4byte-event.mdx
│ │ │ ├── cast-4byte.mdx
│ │ │ ├── cast-abi-encode.mdx
│ │ │ ├── cast-access-list.mdx
│ │ │ ├── cast-address-zero.mdx
│ │ │ ├── cast-age.mdx
│ │ │ ├── cast-balance.mdx
│ │ │ ├── cast-basefee.mdx
│ │ │ ├── cast-block-number.mdx
│ │ │ ├── cast-block.mdx
│ │ │ ├── cast-call.mdx
│ │ │ ├── cast-calldata.mdx
│ │ │ ├── cast-chain-id.mdx
│ │ │ ├── cast-chain.mdx
│ │ │ ├── cast-client.mdx
│ │ │ ├── cast-code.mdx
│ │ │ ├── cast-codesize.mdx
│ │ │ ├── cast-completions.mdx
│ │ │ ├── cast-compute-address.mdx
│ │ │ ├── cast-concat-hex.mdx
│ │ │ ├── cast-create2.mdx
│ │ │ ├── cast-decode-abi.mdx
│ │ │ ├── cast-decode-calldata.mdx
│ │ │ ├── cast-estimate.mdx
│ │ │ ├── cast-etherscan-source.mdx
│ │ │ ├── cast-find-block.mdx
│ │ │ ├── cast-format-bytes32-string.mdx
│ │ │ ├── cast-from-bin.mdx
│ │ │ ├── cast-from-fixed-point.mdx
│ │ │ ├── cast-from-rlp.mdx
│ │ │ ├── cast-from-utf8.mdx
│ │ │ ├── cast-from-wei.mdx
│ │ │ ├── cast-gas-price.mdx
│ │ │ ├── cast-help.mdx
│ │ │ ├── cast-index.mdx
│ │ │ ├── cast-interface.mdx
│ │ │ ├── cast-keccak.mdx
│ │ │ ├── cast-logs.mdx
│ │ │ ├── cast-lookup-address.mdx
│ │ │ ├── cast-max-int.mdx
│ │ │ ├── cast-max-uint.mdx
│ │ │ ├── cast-min-int.mdx
│ │ │ ├── cast-mktx.mdx
│ │ │ ├── cast-namehash.mdx
│ │ │ ├── cast-nonce.mdx
│ │ │ ├── cast-parse-bytes32-address.mdx
│ │ │ ├── cast-parse-bytes32-string.mdx
│ │ │ ├── cast-pretty-calldata.mdx
│ │ │ ├── cast-proof.mdx
│ │ │ ├── cast-publish.mdx
│ │ │ ├── cast-receipt.mdx
│ │ │ ├── cast-resolve-name.mdx
│ │ │ ├── cast-rpc.mdx
│ │ │ ├── cast-run.mdx
│ │ │ ├── cast-selectors.mdx
│ │ │ ├── cast-send.mdx
│ │ │ ├── cast-shl.mdx
│ │ │ ├── cast-shr.mdx
│ │ │ ├── cast-sig-event.mdx
│ │ │ ├── cast-sig.mdx
│ │ │ ├── cast-storage.mdx
│ │ │ ├── cast-to-ascii.mdx
│ │ │ ├── cast-to-base.mdx
│ │ │ ├── cast-to-bytes32.mdx
│ │ │ ├── cast-to-check-sum-address.mdx
│ │ │ ├── cast-to-dec.mdx
│ │ │ ├── cast-to-fixed-point.mdx
│ │ │ ├── cast-to-hex.mdx
│ │ │ ├── cast-to-hexdata.mdx
│ │ │ ├── cast-to-int256.mdx
│ │ │ ├── cast-to-rlp.mdx
│ │ │ ├── cast-to-uint256.mdx
│ │ │ ├── cast-to-unit.mdx
│ │ │ ├── cast-to-wei.mdx
│ │ │ ├── cast-tx.mdx
│ │ │ ├── cast-upload-signature.mdx
│ │ │ ├── cast-wallet-address.mdx
│ │ │ ├── cast-wallet-import.mdx
│ │ │ ├── cast-wallet-list.mdx
│ │ │ ├── cast-wallet-new-mnemonic.mdx
│ │ │ ├── cast-wallet-new.mdx
│ │ │ ├── cast-wallet-sign-auth.mdx
│ │ │ ├── cast-wallet-sign.mdx
│ │ │ ├── cast-wallet-vanity.mdx
│ │ │ ├── cast-wallet-verify.mdx
│ │ │ ├── cast-wallet.mdx
│ │ │ ├── chain-commands.mdx
│ │ │ ├── common-options.mdx
│ │ │ ├── conversion-commands.mdx
│ │ │ ├── ens-commands.mdx
│ │ │ ├── etherscan-commands.mdx
│ │ │ ├── general-commands.mdx
│ │ │ ├── overview.mdx
│ │ │ ├── sig-description.mdx
│ │ │ ├── transaction-commands.mdx
│ │ │ ├── utility-commands.mdx
│ │ │ └── wallet-commands.mdx
│ ├── chisel
│ │ ├── overview.md
│ │ └── reference.md
│ ├── config
│ │ ├── continuous-integration.md
│ │ ├── dynamic-test-linking.md
│ │ ├── hardhat.md
│ │ ├── lint.mdx
│ │ ├── overview.md
│ │ ├── reference
│ │ │ ├── README.mdx
│ │ │ ├── default-config.mdx
│ │ │ ├── doc-generator.mdx
│ │ │ ├── etherscan.mdx
│ │ │ ├── formatter.mdx
│ │ │ ├── inline-test-config.mdx
│ │ │ ├── overview.mdx
│ │ │ ├── project.mdx
│ │ │ ├── solidity-compiler.mdx
│ │ │ └── testing.mdx
│ │ ├── shell-autocompletion.md
│ │ ├── static-analyzers.md
│ │ ├── vscode.md
│ │ └── vyper.md
│ ├── forge
│ │ ├── advanced-testing
│ │ │ ├── differential-ffi-testing.md
│ │ │ ├── fuzz-testing.md
│ │ │ ├── invariant-testing.md
│ │ │ └── overview.md
│ │ ├── debugger.md
│ │ ├── deploying.md
│ │ ├── gas-tracking
│ │ │ ├── gas-function-snapshots.md
│ │ │ ├── gas-reports.md
│ │ │ ├── gas-section-snapshots.mdx
│ │ │ └── overview.md
│ │ ├── overview.md
│ │ ├── reference
│ │ │ ├── README.mdx
│ │ │ ├── build-commands.mdx
│ │ │ ├── common-options.mdx
│ │ │ ├── compiler-options.mdx
│ │ │ ├── core-build-options.mdx
│ │ │ ├── deploy-commands.mdx
│ │ │ ├── evm-options.mdx
│ │ │ ├── executor-options.mdx
│ │ │ ├── forge-bind.mdx
│ │ │ ├── forge-build.mdx
│ │ │ ├── forge-cache-clean.mdx
│ │ │ ├── forge-cache-ls.mdx
│ │ │ ├── forge-cache.mdx
│ │ │ ├── forge-clean.mdx
│ │ │ ├── forge-clone.mdx
│ │ │ ├── forge-completions.mdx
│ │ │ ├── forge-config.mdx
│ │ │ ├── forge-coverage.mdx
│ │ │ ├── forge-create.mdx
│ │ │ ├── forge-doc.mdx
│ │ │ ├── forge-flatten.mdx
│ │ │ ├── forge-geiger.mdx
│ │ │ ├── forge-help.mdx
│ │ │ ├── forge-init.mdx
│ │ │ ├── forge-inspect.mdx
│ │ │ ├── forge-install.mdx
│ │ │ ├── forge-lint.mdx
│ │ │ ├── forge-remappings.mdx
│ │ │ ├── forge-remove.mdx
│ │ │ ├── forge-script.mdx
│ │ │ ├── forge-snapshot.mdx
│ │ │ ├── forge-test.mdx
│ │ │ ├── forge-tree.mdx
│ │ │ ├── forge-update.mdx
│ │ │ ├── forge-upload-selectors.mdx
│ │ │ ├── forge-verify-check.mdx
│ │ │ ├── forge-verify-contract.mdx
│ │ │ ├── general-commands.mdx
│ │ │ ├── overview.mdx
│ │ │ ├── project-commands.mdx
│ │ │ ├── project-options.mdx
│ │ │ ├── test-commands.mdx
│ │ │ ├── test-options.mdx
│ │ │ ├── utility-commands.mdx
│ │ │ └── watch-options.mdx
│ │ └── tests
│ │ │ ├── cheatcodes.md
│ │ │ ├── forge-std.md
│ │ │ ├── fork-testing.md
│ │ │ ├── overview.md
│ │ │ ├── replay-testing.md
│ │ │ ├── traces.md
│ │ │ └── writing-tests.md
│ ├── guides
│ │ ├── best-practices.md
│ │ ├── deterministic-deployments-using-create2.md
│ │ ├── forking-mainnet-with-cast-anvil.md
│ │ ├── foundry-in-docker.md
│ │ ├── scripting-with-solidity.md
│ │ └── video-tutorials.md
│ ├── index.mdx
│ ├── introduction
│ │ ├── getting-started.mdx
│ │ ├── installation.md
│ │ └── overview.md
│ ├── misc
│ │ ├── README.md
│ │ ├── announcements.md
│ │ ├── faq.md
│ │ ├── struct-encoding.md
│ │ └── v1.0-migration.md
│ ├── projects
│ │ ├── clone-a-verified-contract.mdx
│ │ ├── creating-a-new-project.md
│ │ ├── dependencies.md
│ │ ├── project-layout.md
│ │ └── soldeer.md
│ └── reference
│ │ ├── README.md
│ │ ├── cheatcodes
│ │ ├── accesses.mdx
│ │ ├── active-fork.mdx
│ │ ├── addr.mdx
│ │ ├── allow-cheatcodes.mdx
│ │ ├── assertions.mdx
│ │ ├── assume-no-revert.mdx
│ │ ├── assume.mdx
│ │ ├── breakpoint.mdx
│ │ ├── broadcast.mdx
│ │ ├── chain-id.mdx
│ │ ├── clear-mocked-calls.mdx
│ │ ├── coinbase.mdx
│ │ ├── copy-storage.mdx
│ │ ├── create-fork.mdx
│ │ ├── create-select-fork.mdx
│ │ ├── create-wallet.mdx
│ │ ├── deal.mdx
│ │ ├── derive-key.mdx
│ │ ├── difficulty.mdx
│ │ ├── env-address.mdx
│ │ ├── env-bool.mdx
│ │ ├── env-bytes.mdx
│ │ ├── env-bytes32.mdx
│ │ ├── env-int.mdx
│ │ ├── env-or.mdx
│ │ ├── env-string.mdx
│ │ ├── env-uint.mdx
│ │ ├── environment.mdx
│ │ ├── etch.mdx
│ │ ├── expect-call.mdx
│ │ ├── expect-emit.mdx
│ │ ├── expect-revert.mdx
│ │ ├── external.mdx
│ │ ├── fee.mdx
│ │ ├── ffi.mdx
│ │ ├── forking.mdx
│ │ ├── fs.mdx
│ │ ├── fuzzer.mdx
│ │ ├── gas-snapshots.mdx
│ │ ├── get-block-number.mdx
│ │ ├── get-block-timestamp.mdx
│ │ ├── get-code.mdx
│ │ ├── get-deployed-code.mdx
│ │ ├── get-label.mdx
│ │ ├── get-nonce.mdx
│ │ ├── get-recorded-logs.mdx
│ │ ├── is-context.mdx
│ │ ├── is-persistent.mdx
│ │ ├── key-exists-json.mdx
│ │ ├── key-exists-toml.mdx
│ │ ├── key-exists.mdx
│ │ ├── label.mdx
│ │ ├── load.mdx
│ │ ├── make-persistent.mdx
│ │ ├── mock-call-revert.mdx
│ │ ├── mock-call.mdx
│ │ ├── mock-calls.mdx
│ │ ├── mock-function.mdx
│ │ ├── overview.mdx
│ │ ├── parse-address.mdx
│ │ ├── parse-bool.mdx
│ │ ├── parse-bytes.mdx
│ │ ├── parse-bytes32.mdx
│ │ ├── parse-int.mdx
│ │ ├── parse-json-keys.mdx
│ │ ├── parse-json.mdx
│ │ ├── parse-toml-keys.mdx
│ │ ├── parse-toml.mdx
│ │ ├── parse-uint.mdx
│ │ ├── pause-gas-metering.mdx
│ │ ├── prank.mdx
│ │ ├── prevrandao.mdx
│ │ ├── project-root.mdx
│ │ ├── prompt.mdx
│ │ ├── read-callers.mdx
│ │ ├── record-logs.mdx
│ │ ├── record.mdx
│ │ ├── remember-key.mdx
│ │ ├── reset-gas-metering.mdx
│ │ ├── resume-gas-metering.mdx
│ │ ├── revoke-persistent.mdx
│ │ ├── roll-fork.mdx
│ │ ├── roll.mdx
│ │ ├── rpc.mdx
│ │ ├── select-fork.mdx
│ │ ├── serialize-json.mdx
│ │ ├── set-arbitrary-storage.mdx
│ │ ├── set-env.mdx
│ │ ├── set-nonce.mdx
│ │ ├── sign-delegation.mdx
│ │ ├── sign.mdx
│ │ ├── signing.mdx
│ │ ├── skip.mdx
│ │ ├── sleep.mdx
│ │ ├── start-broadcast.mdx
│ │ ├── start-prank.mdx
│ │ ├── start-state-diff-recording.mdx
│ │ ├── state-snapshots.mdx
│ │ ├── stop-and-return-state-diff.mdx
│ │ ├── stop-broadcast.mdx
│ │ ├── stop-prank.mdx
│ │ ├── store.mdx
│ │ ├── to-string.mdx
│ │ ├── transact.mdx
│ │ ├── tx-gas-price.mdx
│ │ ├── unix-time.mdx
│ │ ├── utilities.mdx
│ │ ├── warp.mdx
│ │ ├── write-json.mdx
│ │ └── write-toml.mdx
│ │ ├── common
│ │ ├── base-options.mdx
│ │ ├── display-options.mdx
│ │ ├── etherscan-options.mdx
│ │ ├── multi-wallet-options-hardware.mdx
│ │ ├── multi-wallet-options-keystore.mdx
│ │ ├── multi-wallet-options-raw.mdx
│ │ ├── multi-wallet-options-remote.mdx
│ │ ├── multi-wallet-options.mdx
│ │ ├── retry-options.mdx
│ │ ├── rpc-options.mdx
│ │ ├── rpc-url-option.mdx
│ │ ├── transaction-options.mdx
│ │ ├── tx-value-option.mdx
│ │ ├── verifier-options.mdx
│ │ ├── wallet-options-hardware.mdx
│ │ ├── wallet-options-keystore.mdx
│ │ ├── wallet-options-raw.mdx
│ │ ├── wallet-options-remote.mdx
│ │ └── wallet-options.mdx
│ │ ├── ds-test.md
│ │ └── forge-std
│ │ ├── abs.mdx
│ │ ├── arithmeticError.mdx
│ │ ├── assertApproxEqAbs.mdx
│ │ ├── assertApproxEqAbsDecimal.mdx
│ │ ├── assertApproxEqRel.mdx
│ │ ├── assertApproxEqRelDecimal.mdx
│ │ ├── assertEq.mdx
│ │ ├── assertEqDecimal.mdx
│ │ ├── assertFalse.mdx
│ │ ├── assertGe.mdx
│ │ ├── assertGeDecimal.mdx
│ │ ├── assertGt.mdx
│ │ ├── assertGtDecimal.mdx
│ │ ├── assertLe.mdx
│ │ ├── assertLeDecimal.mdx
│ │ ├── assertLt.mdx
│ │ ├── assertLtDecimal.mdx
│ │ ├── assertNotEq.mdx
│ │ ├── assertNotEqDecimal.mdx
│ │ ├── assertTrue.mdx
│ │ ├── assertionError.mdx
│ │ ├── assume-no-precompiles.mdx
│ │ ├── assume-payable.mdx
│ │ ├── bound.mdx
│ │ ├── change-prank.mdx
│ │ ├── checked_write.mdx
│ │ ├── compute-create-address.mdx
│ │ ├── console-log.mdx
│ │ ├── deal.mdx
│ │ ├── delta.mdx
│ │ ├── deployCode.mdx
│ │ ├── deployCodeTo.mdx
│ │ ├── depth.mdx
│ │ ├── derive-remember-key.mdx
│ │ ├── divisionError.mdx
│ │ ├── enable_packed_slots.mdx
│ │ ├── encodeStorageError.mdx
│ │ ├── enumConversionError.mdx
│ │ ├── fail.mdx
│ │ ├── find.mdx
│ │ ├── hoax.mdx
│ │ ├── indexOOBError.mdx
│ │ ├── make-addr-and-key.mdx
│ │ ├── make-addr.mdx
│ │ ├── memOverflowError.mdx
│ │ ├── noGasMetering.mdx
│ │ ├── overview.mdx
│ │ ├── percentDelta.mdx
│ │ ├── popError.mdx
│ │ ├── read.mdx
│ │ ├── rewind.mdx
│ │ ├── script-utils.mdx
│ │ ├── sig.mdx
│ │ ├── skip.mdx
│ │ ├── startHoax.mdx
│ │ ├── std-assertions.mdx
│ │ ├── std-cheats.mdx
│ │ ├── std-errors.mdx
│ │ ├── std-logs.mdx
│ │ ├── std-math.mdx
│ │ ├── std-storage.mdx
│ │ ├── target.mdx
│ │ ├── with_key.mdx
│ │ └── zeroVarError.mdx
├── public
│ ├── _redirects
│ ├── anvil.png
│ ├── breakpoint.png
│ ├── cropped-ripped-jesus.png
│ ├── debugger.png
│ ├── foundry-banner.png
│ ├── foundry-logo.png
│ ├── fuzzer.png
│ ├── nft-tutorial
│ │ ├── gas-report-oz-nft.png
│ │ ├── gas-report-solmate-nft.png
│ │ └── nft-tutorial-project-structure.png
│ ├── og-image.png
│ └── solidity-scripting
│ │ ├── compile-successful.png
│ │ ├── contract-verified.png
│ │ └── set-up-commands.png
├── snippets
│ ├── clone_contract
│ │ ├── clone-meta
│ │ └── forge-clone
│ ├── output
│ │ ├── cast
│ │ │ ├── cast-4byte-calldata
│ │ │ └── cast-call
│ │ ├── cheatcodes
│ │ │ ├── forge-test-cheatcodes-expectrevert
│ │ │ └── forge-test-simple
│ │ ├── chisel
│ │ │ └── help
│ │ ├── forge_tree
│ │ │ ├── forge-tree
│ │ │ └── forge-tree-no-dedupe
│ │ ├── fuzz_testing
│ │ │ ├── forge-test-fail-fuzz
│ │ │ ├── forge-test-no-fuzz
│ │ │ └── forge-test-success-fuzz
│ │ ├── hello_foundry
│ │ │ ├── forge-build
│ │ │ ├── forge-init
│ │ │ ├── forge-install
│ │ │ ├── forge-remappings
│ │ │ ├── forge-test
│ │ │ ├── tree
│ │ │ └── tree-with-files
│ │ ├── test_filters
│ │ │ ├── forge-test-match-contract-and-test
│ │ │ └── forge-test-match-path
│ │ └── vm
│ │ │ └── Vm.sol
│ └── projects
│ │ ├── README.md
│ │ ├── cheatcodes
│ │ ├── cache
│ │ │ └── solidity-files-cache.json
│ │ ├── foundry.toml
│ │ ├── lib
│ │ │ └── forge-std
│ │ │ │ ├── .gitattributes
│ │ │ │ ├── .github
│ │ │ │ └── workflows
│ │ │ │ │ ├── ci.yml
│ │ │ │ │ └── sync.yml
│ │ │ │ ├── .gitignore
│ │ │ │ ├── .gitmodules
│ │ │ │ ├── LICENSE-APACHE
│ │ │ │ ├── LICENSE-MIT
│ │ │ │ ├── README.md
│ │ │ │ ├── foundry.toml
│ │ │ │ ├── lib
│ │ │ │ └── ds-test
│ │ │ │ │ ├── .github
│ │ │ │ │ └── workflows
│ │ │ │ │ │ └── build.yml
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── Makefile
│ │ │ │ │ ├── default.nix
│ │ │ │ │ ├── demo
│ │ │ │ │ └── demo.sol
│ │ │ │ │ ├── package.json
│ │ │ │ │ └── src
│ │ │ │ │ ├── test.sol
│ │ │ │ │ └── test.t.sol
│ │ │ │ ├── package.json
│ │ │ │ ├── scripts
│ │ │ │ └── vm.py
│ │ │ │ ├── src
│ │ │ │ ├── Base.sol
│ │ │ │ ├── Script.sol
│ │ │ │ ├── StdAssertions.sol
│ │ │ │ ├── StdChains.sol
│ │ │ │ ├── StdCheats.sol
│ │ │ │ ├── StdError.sol
│ │ │ │ ├── StdInvariant.sol
│ │ │ │ ├── StdJson.sol
│ │ │ │ ├── StdMath.sol
│ │ │ │ ├── StdStorage.sol
│ │ │ │ ├── StdStyle.sol
│ │ │ │ ├── StdUtils.sol
│ │ │ │ ├── Test.sol
│ │ │ │ ├── Vm.sol
│ │ │ │ ├── console.sol
│ │ │ │ ├── console2.sol
│ │ │ │ ├── interfaces
│ │ │ │ │ ├── IERC1155.sol
│ │ │ │ │ ├── IERC165.sol
│ │ │ │ │ ├── IERC20.sol
│ │ │ │ │ ├── IERC4626.sol
│ │ │ │ │ ├── IERC721.sol
│ │ │ │ │ └── IMulticall3.sol
│ │ │ │ ├── mocks
│ │ │ │ │ ├── MockERC20.sol
│ │ │ │ │ └── MockERC721.sol
│ │ │ │ └── safeconsole.sol
│ │ │ │ └── test
│ │ │ │ ├── StdAssertions.t.sol
│ │ │ │ ├── StdChains.t.sol
│ │ │ │ ├── StdCheats.t.sol
│ │ │ │ ├── StdError.t.sol
│ │ │ │ ├── StdMath.t.sol
│ │ │ │ ├── StdStorage.t.sol
│ │ │ │ ├── StdStyle.t.sol
│ │ │ │ ├── StdUtils.t.sol
│ │ │ │ ├── Vm.t.sol
│ │ │ │ ├── compilation
│ │ │ │ ├── CompilationScript.sol
│ │ │ │ ├── CompilationScriptBase.sol
│ │ │ │ ├── CompilationTest.sol
│ │ │ │ └── CompilationTestBase.sol
│ │ │ │ ├── fixtures
│ │ │ │ └── broadcast.log.json
│ │ │ │ └── mocks
│ │ │ │ ├── MockERC20.t.sol
│ │ │ │ └── MockERC721.t.sol
│ │ ├── out
│ │ │ ├── Base.sol
│ │ │ │ ├── CommonBase.json
│ │ │ │ ├── ScriptBase.json
│ │ │ │ └── TestBase.json
│ │ │ ├── IERC165.sol
│ │ │ │ └── IERC165.json
│ │ │ ├── IERC20.sol
│ │ │ │ └── IERC20.json
│ │ │ ├── IERC721.sol
│ │ │ │ ├── IERC721.json
│ │ │ │ ├── IERC721Enumerable.json
│ │ │ │ ├── IERC721Metadata.json
│ │ │ │ └── IERC721TokenReceiver.json
│ │ │ ├── IMulticall3.sol
│ │ │ │ └── IMulticall3.json
│ │ │ ├── MockERC20.sol
│ │ │ │ └── MockERC20.json
│ │ │ ├── MockERC721.sol
│ │ │ │ ├── IERC721TokenReceiver.json
│ │ │ │ └── MockERC721.json
│ │ │ ├── OwnerUpOnly.t.sol
│ │ │ │ ├── OwnerUpOnly.json
│ │ │ │ └── OwnerUpOnlyTest.json
│ │ │ ├── StdAssertions.sol
│ │ │ │ └── StdAssertions.json
│ │ │ ├── StdChains.sol
│ │ │ │ └── StdChains.json
│ │ │ ├── StdCheats.sol
│ │ │ │ ├── StdCheats.json
│ │ │ │ └── StdCheatsSafe.json
│ │ │ ├── StdError.sol
│ │ │ │ └── stdError.json
│ │ │ ├── StdInvariant.sol
│ │ │ │ └── StdInvariant.json
│ │ │ ├── StdJson.sol
│ │ │ │ └── stdJson.json
│ │ │ ├── StdMath.sol
│ │ │ │ └── stdMath.json
│ │ │ ├── StdStorage.sol
│ │ │ │ ├── stdStorage.json
│ │ │ │ └── stdStorageSafe.json
│ │ │ ├── StdStyle.sol
│ │ │ │ └── StdStyle.json
│ │ │ ├── StdUtils.sol
│ │ │ │ └── StdUtils.json
│ │ │ ├── Vm.sol
│ │ │ │ ├── Vm.json
│ │ │ │ └── VmSafe.json
│ │ │ ├── build-info
│ │ │ │ └── e07172c741b4cf80e75e0c1aca270cb3.json
│ │ │ ├── console.sol
│ │ │ │ └── console.json
│ │ │ ├── console2.sol
│ │ │ │ └── console2.json
│ │ │ ├── safeconsole.sol
│ │ │ │ └── safeconsole.json
│ │ │ └── test.sol
│ │ │ │ ├── DSTest.json
│ │ │ │ └── Test.json
│ │ └── test
│ │ │ ├── BlastMock.t.sol
│ │ │ ├── EmitContract.t.sol
│ │ │ └── OwnerUpOnly.t.sol
│ │ ├── fuzz_testing
│ │ ├── cache
│ │ │ ├── fuzz
│ │ │ │ └── failures
│ │ │ ├── solidity-files-cache.json
│ │ │ └── test-failures
│ │ ├── foundry.toml
│ │ ├── lib
│ │ │ └── forge-std
│ │ │ │ ├── .gitattributes
│ │ │ │ ├── .github
│ │ │ │ └── workflows
│ │ │ │ │ ├── ci.yml
│ │ │ │ │ └── sync.yml
│ │ │ │ ├── .gitignore
│ │ │ │ ├── .gitmodules
│ │ │ │ ├── LICENSE-APACHE
│ │ │ │ ├── LICENSE-MIT
│ │ │ │ ├── README.md
│ │ │ │ ├── foundry.toml
│ │ │ │ ├── lib
│ │ │ │ └── ds-test
│ │ │ │ │ ├── .github
│ │ │ │ │ └── workflows
│ │ │ │ │ │ └── build.yml
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── Makefile
│ │ │ │ │ ├── default.nix
│ │ │ │ │ ├── demo
│ │ │ │ │ └── demo.sol
│ │ │ │ │ ├── package.json
│ │ │ │ │ └── src
│ │ │ │ │ ├── test.sol
│ │ │ │ │ └── test.t.sol
│ │ │ │ ├── package.json
│ │ │ │ ├── scripts
│ │ │ │ └── vm.py
│ │ │ │ ├── src
│ │ │ │ ├── Base.sol
│ │ │ │ ├── Script.sol
│ │ │ │ ├── StdAssertions.sol
│ │ │ │ ├── StdChains.sol
│ │ │ │ ├── StdCheats.sol
│ │ │ │ ├── StdError.sol
│ │ │ │ ├── StdInvariant.sol
│ │ │ │ ├── StdJson.sol
│ │ │ │ ├── StdMath.sol
│ │ │ │ ├── StdStorage.sol
│ │ │ │ ├── StdStyle.sol
│ │ │ │ ├── StdUtils.sol
│ │ │ │ ├── Test.sol
│ │ │ │ ├── Vm.sol
│ │ │ │ ├── console.sol
│ │ │ │ ├── console2.sol
│ │ │ │ ├── interfaces
│ │ │ │ │ ├── IERC1155.sol
│ │ │ │ │ ├── IERC165.sol
│ │ │ │ │ ├── IERC20.sol
│ │ │ │ │ ├── IERC4626.sol
│ │ │ │ │ ├── IERC721.sol
│ │ │ │ │ └── IMulticall3.sol
│ │ │ │ ├── mocks
│ │ │ │ │ ├── MockERC20.sol
│ │ │ │ │ └── MockERC721.sol
│ │ │ │ └── safeconsole.sol
│ │ │ │ └── test
│ │ │ │ ├── StdAssertions.t.sol
│ │ │ │ ├── StdChains.t.sol
│ │ │ │ ├── StdCheats.t.sol
│ │ │ │ ├── StdError.t.sol
│ │ │ │ ├── StdMath.t.sol
│ │ │ │ ├── StdStorage.t.sol
│ │ │ │ ├── StdStyle.t.sol
│ │ │ │ ├── StdUtils.t.sol
│ │ │ │ ├── Vm.t.sol
│ │ │ │ ├── compilation
│ │ │ │ ├── CompilationScript.sol
│ │ │ │ ├── CompilationScriptBase.sol
│ │ │ │ ├── CompilationTest.sol
│ │ │ │ └── CompilationTestBase.sol
│ │ │ │ ├── fixtures
│ │ │ │ └── broadcast.log.json
│ │ │ │ └── mocks
│ │ │ │ ├── MockERC20.t.sol
│ │ │ │ └── MockERC721.t.sol
│ │ ├── out
│ │ │ ├── Base.sol
│ │ │ │ ├── CommonBase.json
│ │ │ │ ├── ScriptBase.json
│ │ │ │ └── TestBase.json
│ │ │ ├── IERC165.sol
│ │ │ │ └── IERC165.json
│ │ │ ├── IERC20.sol
│ │ │ │ └── IERC20.json
│ │ │ ├── IERC721.sol
│ │ │ │ ├── IERC721.json
│ │ │ │ ├── IERC721Enumerable.json
│ │ │ │ ├── IERC721Metadata.json
│ │ │ │ └── IERC721TokenReceiver.json
│ │ │ ├── IMulticall3.sol
│ │ │ │ └── IMulticall3.json
│ │ │ ├── MockERC20.sol
│ │ │ │ └── MockERC20.json
│ │ │ ├── MockERC721.sol
│ │ │ │ ├── IERC721TokenReceiver.json
│ │ │ │ └── MockERC721.json
│ │ │ ├── Safe.t.sol
│ │ │ │ ├── Safe.json
│ │ │ │ └── SafeTest.json
│ │ │ ├── StdAssertions.sol
│ │ │ │ └── StdAssertions.json
│ │ │ ├── StdChains.sol
│ │ │ │ └── StdChains.json
│ │ │ ├── StdCheats.sol
│ │ │ │ ├── StdCheats.json
│ │ │ │ └── StdCheatsSafe.json
│ │ │ ├── StdError.sol
│ │ │ │ └── stdError.json
│ │ │ ├── StdInvariant.sol
│ │ │ │ └── StdInvariant.json
│ │ │ ├── StdJson.sol
│ │ │ │ └── stdJson.json
│ │ │ ├── StdMath.sol
│ │ │ │ └── stdMath.json
│ │ │ ├── StdStorage.sol
│ │ │ │ ├── stdStorage.json
│ │ │ │ └── stdStorageSafe.json
│ │ │ ├── StdStyle.sol
│ │ │ │ └── StdStyle.json
│ │ │ ├── StdUtils.sol
│ │ │ │ └── StdUtils.json
│ │ │ ├── Vm.sol
│ │ │ │ ├── Vm.json
│ │ │ │ └── VmSafe.json
│ │ │ ├── build-info
│ │ │ │ ├── 2c096d68ff8d8fc6f33a2256db531064.json
│ │ │ │ └── c186f1547a0c7709619a33cc07333f6d.json
│ │ │ ├── console.sol
│ │ │ │ └── console.json
│ │ │ ├── console2.sol
│ │ │ │ └── console2.json
│ │ │ ├── safeconsole.sol
│ │ │ │ └── safeconsole.json
│ │ │ └── test.sol
│ │ │ │ ├── DSTest.json
│ │ │ │ └── Test.json
│ │ └── test
│ │ │ ├── Safe.t.sol
│ │ │ ├── Safe.t.sol.1
│ │ │ ├── Safe.t.sol.2
│ │ │ └── Safe.t.sol.3
│ │ ├── test_filters
│ │ ├── cache
│ │ │ └── solidity-files-cache.json
│ │ ├── foundry.toml
│ │ ├── lib
│ │ │ └── forge-std
│ │ │ │ ├── .gitattributes
│ │ │ │ ├── .github
│ │ │ │ └── workflows
│ │ │ │ │ ├── ci.yml
│ │ │ │ │ └── sync.yml
│ │ │ │ ├── .gitignore
│ │ │ │ ├── .gitmodules
│ │ │ │ ├── LICENSE-APACHE
│ │ │ │ ├── LICENSE-MIT
│ │ │ │ ├── README.md
│ │ │ │ ├── foundry.toml
│ │ │ │ ├── lib
│ │ │ │ └── ds-test
│ │ │ │ │ ├── .github
│ │ │ │ │ └── workflows
│ │ │ │ │ │ └── build.yml
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── Makefile
│ │ │ │ │ ├── default.nix
│ │ │ │ │ ├── demo
│ │ │ │ │ └── demo.sol
│ │ │ │ │ ├── package.json
│ │ │ │ │ └── src
│ │ │ │ │ ├── test.sol
│ │ │ │ │ └── test.t.sol
│ │ │ │ ├── package.json
│ │ │ │ ├── scripts
│ │ │ │ └── vm.py
│ │ │ │ ├── src
│ │ │ │ ├── Base.sol
│ │ │ │ ├── Script.sol
│ │ │ │ ├── StdAssertions.sol
│ │ │ │ ├── StdChains.sol
│ │ │ │ ├── StdCheats.sol
│ │ │ │ ├── StdError.sol
│ │ │ │ ├── StdInvariant.sol
│ │ │ │ ├── StdJson.sol
│ │ │ │ ├── StdMath.sol
│ │ │ │ ├── StdStorage.sol
│ │ │ │ ├── StdStyle.sol
│ │ │ │ ├── StdUtils.sol
│ │ │ │ ├── Test.sol
│ │ │ │ ├── Vm.sol
│ │ │ │ ├── console.sol
│ │ │ │ ├── console2.sol
│ │ │ │ ├── interfaces
│ │ │ │ │ ├── IERC1155.sol
│ │ │ │ │ ├── IERC165.sol
│ │ │ │ │ ├── IERC20.sol
│ │ │ │ │ ├── IERC4626.sol
│ │ │ │ │ ├── IERC721.sol
│ │ │ │ │ └── IMulticall3.sol
│ │ │ │ ├── mocks
│ │ │ │ │ ├── MockERC20.sol
│ │ │ │ │ └── MockERC721.sol
│ │ │ │ └── safeconsole.sol
│ │ │ │ └── test
│ │ │ │ ├── StdAssertions.t.sol
│ │ │ │ ├── StdChains.t.sol
│ │ │ │ ├── StdCheats.t.sol
│ │ │ │ ├── StdError.t.sol
│ │ │ │ ├── StdMath.t.sol
│ │ │ │ ├── StdStorage.t.sol
│ │ │ │ ├── StdStyle.t.sol
│ │ │ │ ├── StdUtils.t.sol
│ │ │ │ ├── Vm.t.sol
│ │ │ │ ├── compilation
│ │ │ │ ├── CompilationScript.sol
│ │ │ │ ├── CompilationScriptBase.sol
│ │ │ │ ├── CompilationTest.sol
│ │ │ │ └── CompilationTestBase.sol
│ │ │ │ ├── fixtures
│ │ │ │ └── broadcast.log.json
│ │ │ │ └── mocks
│ │ │ │ ├── MockERC20.t.sol
│ │ │ │ └── MockERC721.t.sol
│ │ ├── out
│ │ │ ├── Base.sol
│ │ │ │ ├── CommonBase.json
│ │ │ │ ├── ScriptBase.json
│ │ │ │ └── TestBase.json
│ │ │ ├── ComplicatedContract.t.sol
│ │ │ │ └── ComplicatedContractTest.json
│ │ │ ├── ContractB.t.sol
│ │ │ │ └── ContractBTest.json
│ │ │ ├── IERC165.sol
│ │ │ │ └── IERC165.json
│ │ │ ├── IERC20.sol
│ │ │ │ └── IERC20.json
│ │ │ ├── IERC721.sol
│ │ │ │ ├── IERC721.json
│ │ │ │ ├── IERC721Enumerable.json
│ │ │ │ ├── IERC721Metadata.json
│ │ │ │ └── IERC721TokenReceiver.json
│ │ │ ├── IMulticall3.sol
│ │ │ │ └── IMulticall3.json
│ │ │ ├── MockERC20.sol
│ │ │ │ └── MockERC20.json
│ │ │ ├── MockERC721.sol
│ │ │ │ ├── IERC721TokenReceiver.json
│ │ │ │ └── MockERC721.json
│ │ │ ├── StdAssertions.sol
│ │ │ │ └── StdAssertions.json
│ │ │ ├── StdChains.sol
│ │ │ │ └── StdChains.json
│ │ │ ├── StdCheats.sol
│ │ │ │ ├── StdCheats.json
│ │ │ │ └── StdCheatsSafe.json
│ │ │ ├── StdError.sol
│ │ │ │ └── stdError.json
│ │ │ ├── StdInvariant.sol
│ │ │ │ └── StdInvariant.json
│ │ │ ├── StdJson.sol
│ │ │ │ └── stdJson.json
│ │ │ ├── StdMath.sol
│ │ │ │ └── stdMath.json
│ │ │ ├── StdStorage.sol
│ │ │ │ ├── stdStorage.json
│ │ │ │ └── stdStorageSafe.json
│ │ │ ├── StdStyle.sol
│ │ │ │ └── StdStyle.json
│ │ │ ├── StdUtils.sol
│ │ │ │ └── StdUtils.json
│ │ │ ├── Vm.sol
│ │ │ │ ├── Vm.json
│ │ │ │ └── VmSafe.json
│ │ │ ├── build-info
│ │ │ │ ├── 76832cf701783337fd99a073df82e599.json
│ │ │ │ └── e776ddde0c1225dc1f034664920a57b6.json
│ │ │ ├── console.sol
│ │ │ │ └── console.json
│ │ │ ├── console2.sol
│ │ │ │ └── console2.json
│ │ │ ├── safeconsole.sol
│ │ │ │ └── safeconsole.json
│ │ │ └── test.sol
│ │ │ │ ├── DSTest.json
│ │ │ │ └── Test.json
│ │ └── test
│ │ │ ├── ComplicatedContract.t.sol
│ │ │ └── ContractB.t.sol
│ │ └── writing_tests
│ │ ├── foundry.toml
│ │ └── test
│ │ ├── Basic.t.sol
│ │ └── Basic2.t.sol
└── styles.css
├── package.json
├── sidebar
├── cmd-reference.ts
├── forge-overview.ts
└── sidebar.ts
├── tsconfig.json
└── vocs.config.ts
/.gitattributes:
--------------------------------------------------------------------------------
1 | src/output/**/* linguist-generated
2 | src/output/README.md -linguist-generated
3 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @mattsse @onbjerg @grandizzy @yash-atreya @zerosnacks
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: deploy
2 | on: [push]
3 |
4 | jobs:
5 | deploy:
6 | runs-on: ubuntu-latest
7 | permissions:
8 | contents: read
9 | deployments: write
10 | name: Deploy to Cloudflare Pages
11 | steps:
12 | - name: Checkout
13 | uses: actions/checkout@v4
14 |
15 | - name: Install bun
16 | uses: oven-sh/setup-bun@v2
17 |
18 | - name: Build Vocs
19 | run: cd vocs && bun install && bun run build
20 |
21 | - name: Publish
22 | uses: cloudflare/pages-action@v1.4.0
23 | with:
24 | apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
25 | accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
26 | projectName: foundry-book
27 | directory: vocs/docs/dist
28 | gitHubToken: ${{ secrets.GITHUB_TOKEN }}
29 |
--------------------------------------------------------------------------------
/.github/workflows/project.yml:
--------------------------------------------------------------------------------
1 | name: project
2 | on:
3 | issues:
4 | types: [opened, transferred]
5 |
6 | jobs:
7 | add-to-project:
8 | name: add issue
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/add-to-project@main
12 | with:
13 | project-url: https://github.com/orgs/foundry-rs/projects/1
14 | github-token: ${{ secrets.GH_PROJECTS_TOKEN }}
15 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: build
2 | on:
3 | push:
4 | branches: [master]
5 | pull_request:
6 | branches: [master]
7 |
8 | jobs:
9 | test:
10 | runs-on: ubuntu-latest
11 | name: vocs build
12 |
13 | steps:
14 | - name: Checkout
15 | uses: actions/checkout@v4
16 |
17 | - name: Install bun
18 | uses: oven-sh/setup-bun@v2
19 |
20 | - name: Build Vocs
21 | run: cd vocs && bun install && bun run build
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /book
2 | /.idea
3 | /.vscode
4 |
5 | /cache/
6 | /vocs/snippets/projects/**/cache/
7 | /out/
8 | /vocs/snippets/projects/**/out/
9 |
10 | /vocs/node_modules
11 | /vocs/docs/dist
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "projects/cheatcodes/lib/forge-std"]
2 | path = projects/cheatcodes/lib/forge-std
3 | url = https://github.com/foundry-rs/forge-std
4 | [submodule "projects/fuzz_testing/lib/forge-std"]
5 | path = projects/fuzz_testing/lib/forge-std
6 | url = https://github.com/foundry-rs/forge-std
7 | [submodule "projects/test_filters/lib/forge-std"]
8 | path = projects/test_filters/lib/forge-std
9 | url = https://github.com/foundry-rs/forge-std
10 | [submodule "projects/writing_tests/lib/forge-std"]
11 | path = projects/writing_tests/lib/forge-std
12 | url = https://github.com/foundry-rs/forge-std
13 |
--------------------------------------------------------------------------------
/book.toml:
--------------------------------------------------------------------------------
1 | [book]
2 | authors = ["Oliver Nordbjerg"]
3 | language = "en"
4 | src = "src"
5 | title = "Foundry Book"
6 | description = "A book on all things Foundry"
7 |
8 | [build]
9 | create-missing = false
10 |
11 | [preprocessor.external-links]
12 |
13 | [output.html]
14 | git-repository-url = "https://github.com/foundry-rs/book"
15 | edit-url-template = "https://github.com/foundry-rs/book/edit/master/{path}"
16 | default-theme = "ayu"
17 | additional-js = ["src/static/solidity.min.js"]
18 | cname = "book.getfoundry.sh"
19 | additional-css = ["src/static/custom.css"]
20 |
21 | [output.html.fold]
22 | enable = true
23 | level = 1
24 |
--------------------------------------------------------------------------------
/scripts/gen_output.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -eo pipefail
3 |
4 | source "$(dirname "$0")/common"
5 |
6 | source "$SCRIPTS/gen_output/cast.sh"
7 | source "$SCRIPTS/gen_output/chisel.sh"
8 | source "$SCRIPTS/gen_output/forge.sh"
9 | source "$SCRIPTS/gen_output/help.sh"
10 | source "$SCRIPTS/gen_output/vm.sh"
11 |
12 | need_cmd git
13 | need_cmd mktemp
14 | need_cmd sed
15 |
16 | need_cmd forge
17 | need_cmd cast
18 | need_cmd anvil
19 | need_cmd chisel
20 |
21 | gen_help
22 | gen_cast
23 | gen_chisel
24 | gen_forge
25 | gen_vm
26 |
--------------------------------------------------------------------------------
/scripts/gen_output/cast.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -eo pipefail
3 |
4 | gen_cast() {
5 | source "$(dirname "$0")/common"
6 |
7 | need_cmd cast
8 |
9 | echo "Generating output (cast)..."
10 | mkdir -p "$OUTPUT_DIR/cast"
11 |
12 | run_command "$OUTPUT_DIR/cast/cast-call" \
13 | cast call 0x6b175474e89094c44da98b954eedeac495271d0f "totalSupply()(uint256)" --rpc-url "$ETH_RPC_URL"
14 |
15 | run_command "$OUTPUT_DIR/cast/cast-4byte-calldata" \
16 | cast 4byte-decode 0x1F1F897F676d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e7 \
17 |
18 | echo OK.
19 | }
20 |
--------------------------------------------------------------------------------
/scripts/gen_output/chisel.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -eo pipefail
3 |
4 | gen_chisel() {
5 | need_cmd chisel
6 |
7 | echo "Generating output (chisel)..."
8 |
9 | mkdir -p "$OUTPUT_DIR/chisel"
10 |
11 | print_anchored \
12 | "echo '!help' | chisel" \
13 | "$(echo '!help' | chisel | escape_colors)" \
14 | > "$OUTPUT_DIR/chisel/help"
15 |
16 | echo OK.
17 | }
18 |
--------------------------------------------------------------------------------
/scripts/gen_output/help.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -eo pipefail
3 |
4 | gen_help() {
5 | bins=(forge cast anvil chisel)
6 | for bin in "${bins[@]}"; do
7 | need_cmd "$bin"
8 | echo "Generating help output ($bin)..."
9 | done
10 |
11 | cmd=(
12 | "$SCRIPTS/gen_output/help.rs"
13 | --root-dir "$ROOT/src/"
14 | --root-summary
15 | --root-indentation 4
16 | --readme
17 | --verbose
18 | --out-dir "$ROOT/src/reference/cli/"
19 | "${bins[@]}"
20 | )
21 | echo "Running: $" "${cmd[*]}"
22 | "${cmd[@]}"
23 | }
24 |
--------------------------------------------------------------------------------
/scripts/gen_output/vm.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -eo pipefail
3 |
4 | gen_vm() {
5 | need_cmd curl
6 |
7 | echo "Generating output (vm)..."
8 | mkdir -p "$OUTPUT_DIR/vm"
9 |
10 | curl https://raw.githubusercontent.com/foundry-rs/forge-std/refs/heads/master/src/Vm.sol > "$OUTPUT_DIR/vm/Vm.sol"
11 |
12 | echo OK.
13 | }
14 |
15 | gen_vm
--------------------------------------------------------------------------------
/src/reference/cli/forge/soldeer/update.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/static/custom.css:
--------------------------------------------------------------------------------
1 | kbd {
2 | --kbd-color-background: rgb(247, 247, 247);
3 | --kbd-color-border: #cbcccd;
4 | --kbd-color-text: rgb(34, 35, 37);
5 |
6 | background-color: var(--kbd-color-background);
7 | color: var(--kbd-color-text);
8 |
9 | border-radius: 0.25rem;
10 |
11 | border: 1px solid var(--kbd-color-border);
12 |
13 | box-shadow: 0 2px 0 1px var(--kbd-color-border);
14 |
15 | cursor: default;
16 |
17 | font-size: 0.75em;
18 |
19 | line-height: 1;
20 |
21 | text-align: center;
22 |
23 | padding: 2px 5px;
24 |
25 | position: relative;
26 | top: -1px;
27 | }
28 |
--------------------------------------------------------------------------------
/theme/card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/theme/card.png
--------------------------------------------------------------------------------
/theme/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/theme/favicon.png
--------------------------------------------------------------------------------
/theme/head.hbs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/vocs/README.md:
--------------------------------------------------------------------------------
1 | This is a [Vocs](https://vocs.dev) project bootstrapped with the Vocs CLI.
2 |
--------------------------------------------------------------------------------
/vocs/bun.lockb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/bun.lockb
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/abi-commands.mdx:
--------------------------------------------------------------------------------
1 | ## ABI Commands
2 |
3 | - [cast abi-encode](/cast/reference/cast-abi-encode)
4 | - [cast 4byte](/cast/reference/cast-4byte)
5 | - [cast 4byte-calldata](/cast/reference/cast-4byte-calldata)
6 | - [cast 4byte-event](/cast/reference/cast-4byte-event)
7 | - [cast calldata](/cast/reference/cast-calldata)
8 | - [cast decode-abi](/cast/reference/cast-decode-abi)
9 | - [cast decode-calldata](/cast/reference/cast-decode-calldata)
10 | - [cast pretty-calldata](/cast/reference/cast-pretty-calldata)
11 | - [cast selectors](/cast/reference/cast-selectors)
12 | - [cast upload-signature](/cast/reference/cast-upload-signature)
13 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/account-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Account Commands
2 |
3 | - [cast balance](/cast/reference/cast-balance)
4 | - [cast storage](/cast/reference/cast-storage)
5 | - [cast proof](/cast/reference/cast-proof)
6 | - [cast nonce](/cast/reference/cast-nonce)
7 | - [cast code](/cast/reference/cast-code)
8 | - [cast codesize](/cast/reference/cast-codesize)
9 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/block-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Block Commands
2 |
3 | - [cast find-block](/cast/reference/cast-find-block)
4 | - [cast gas-price](/cast/reference/cast-gas-price)
5 | - [cast block-number](/cast/reference/cast-block-number)
6 | - [cast basefee](/cast/reference/cast-basefee)
7 | - [cast block](/cast/reference/cast-block)
8 | - [cast age](/cast/reference/cast-age)
9 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-4byte-event.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast 4byte-event
4 |
5 | ### NAME
6 |
7 | cast-4byte-event - Get the event signature for a given topic 0 from [Openchain Signatures](https://openchain.xyz/signatures).
8 |
9 | ### SYNOPSIS
10 |
11 | `cast 4byte-event` [*options*] _topic_0_
12 |
13 | ### DESCRIPTION
14 |
15 | Get the event signature for a given topic 0 from https://openchain.xyz/signatures.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Get the event signature for a topic 0 of `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`:
24 | ```sh
25 | cast 4byte-event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview), [cast 4byte](/cast/reference/cast-4byte.mdx), [cast 4byte-calldata](/cast/reference/cast-4byte-calldata.mdx)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-4byte.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast 4byte
4 |
5 | ### NAME
6 |
7 | cast-4byte - Get the function signatures for the given selector from [Openchain Signatures](https://openchain.xyz/signatures).
8 |
9 | ### SYNOPSIS
10 |
11 | `cast 4byte` [*options*] _sig_
12 |
13 | ### DESCRIPTION
14 |
15 | Get the function signatures for the given selector from https://openchain.xyz/signatures.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Get the function signature for the selector `0x8cc5ce99`:
24 | ```sh
25 | cast 4byte 0x8cc5ce99
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview), [cast 4byte-calldata](/cast/reference/cast-4byte-calldata.mdx), [cast 4byte-event](/cast/reference/cast-4byte-event.mdx), [cast selectors](/cast/reference/cast-selectors.mdx)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-abi-encode.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast abi-encode
4 |
5 | ### NAME
6 |
7 | cast-abi-encode - ABI encode the given function arguments, excluding the selector.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast abi-encode` [*options*] _sig_ [*args...*]
12 |
13 | ### DESCRIPTION
14 |
15 | ABI encode the given function, excluding the selector.
16 |
17 | The signature (_sig_) is a fragment in the form `()`.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. ABI-encode the arguments for a call to `someFunc(address,uint256)`:
26 |
27 | ```sh
28 | cast abi-encode "someFunc(address,uint256)" 0x... 1
29 | ```
30 |
31 | 2. For encoding a type with components (as a tuple, or custom struct):
32 |
33 | ```sh
34 | cast abi-encode "someFunc((string,uint256))" "(myString,1)"
35 | ```
36 |
37 | ### SEE ALSO
38 |
39 | [cast](/cast/reference/overview), [cast calldata](/cast/reference/cast-calldata.mdx)
40 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-address-zero.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast address-zero
4 |
5 | ### NAME
6 |
7 | cast address-zero - Prints the zero address.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast address-zero`
12 |
13 | ### DESCRIPTION
14 |
15 | Prints the zero address.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | [cast](/cast/reference/overview)
22 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-age.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast age
5 |
6 | ### NAME
7 |
8 | cast-age - Get the timestamp of a block.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast age` [*options*] [*block*]
13 |
14 | ### DESCRIPTION
15 |
16 | Get the timestamp of a block.
17 |
18 | The specified _block_ can be a block number, or any of the tags: `earliest`, `finalized`, `safe`, `latest` or `pending`. Default to `latest`.
19 |
20 | ### OPTIONS
21 |
22 | #### RPC Options
23 |
24 |
25 |
26 |
27 |
28 | ### EXAMPLES
29 |
30 | 1. Get the timestamp of the latest block:
31 |
32 | ```sh
33 | cast age
34 | ```
35 |
36 | 2. Get the timestamp of the genesis block:
37 | ```sh
38 | cast age 1
39 | ```
40 |
41 | ### SEE ALSO
42 |
43 | [cast](/cast/reference/overview), [cast block](/cast/reference/cast-block.mdx), [cast basefee](/cast/reference/cast-basefee.mdx)
44 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-basefee.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast basefee
5 |
6 | ### NAME
7 |
8 | cast-base-fee - Get the basefee of a block.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast base-fee` [*options*] [*block*]
13 |
14 | ### DESCRIPTION
15 |
16 | Get the basefee of a block.
17 |
18 | The specified _block_ can be a block number, or any of the tags: `earliest`, `finalized`, `safe`, `latest` or `pending`. Default to `latest`.
19 |
20 | ### OPTIONS
21 |
22 | #### RPC Options
23 |
24 |
25 |
26 |
27 |
28 | ### EXAMPLES
29 |
30 | 1. Get the basefee of the latest block:
31 |
32 | ```sh
33 | cast base-fee
34 | ```
35 |
36 | 2. Get the basefee of the genesis block:
37 | ```sh
38 | cast base-fee 1
39 | ```
40 |
41 | ### SEE ALSO
42 |
43 | [cast](/cast/reference/overview), [cast block](/cast/reference/cast-block.mdx), [cast age](/cast/reference/cast-age.mdx)
44 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-block-number.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast block-number
5 |
6 | ### NAME
7 |
8 | cast-block-number - Get the latest block number.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast block-number` [*options*]
13 |
14 | ### DESCRIPTION
15 |
16 | Get the latest block number.
17 |
18 | ### OPTIONS
19 |
20 | #### RPC Options
21 |
22 |
23 |
24 |
25 |
26 | ### EXAMPLES
27 |
28 | 1. Get the latest block number:
29 | ```sh
30 | cast block-number
31 | ```
32 |
33 | ### SEE ALSO
34 |
35 | [cast](/cast/reference/overview), [cast block](/cast/reference/cast-block.mdx)
36 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-calldata.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast calldata
4 |
5 | ### NAME
6 |
7 | cast-calldata - ABI-encode a function with arguments.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast calldata` [*options*] _sig_ [*args...*]
12 |
13 | ### DESCRIPTION
14 |
15 | ABI-encode a function with arguments.
16 |
17 | The signature (_sig_) is a fragment in the form `()`.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. ABI-encode the arguments for a call to `someFunc(address,uint256)`:
26 | ```sh
27 | cast calldata "someFunc(address,uint256)" 0x... 1
28 | ```
29 |
30 | ### SEE ALSO
31 |
32 | [cast](/cast/reference/overview), [cast abi-encode](/cast/reference/cast-abi-encode.mdx)
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-chain-id.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast chain-id
5 |
6 | ### NAME
7 |
8 | cast-chain-id - Get the Ethereum chain ID.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast chain-id` [*options*]
13 |
14 | ### DESCRIPTION
15 |
16 | Get the Ethereum [chain ID][chain-id] from the RPC endpoint we are connected to.
17 |
18 | ### OPTIONS
19 |
20 | #### RPC Options
21 |
22 |
23 |
24 |
25 |
26 | ### EXAMPLES
27 |
28 | 1. Get the chain ID when talking to `$RPC`:
29 |
30 | ```sh
31 | cast chain-id --rpc-url $RPC
32 | ```
33 |
34 | 2. Get the chain ID when `$ETH_RPC_URL` is set:
35 | ```sh
36 | cast chain-id
37 | ```
38 |
39 | ### SEE ALSO
40 |
41 | [cast](/cast/reference/overview), [cast chain](/cast/reference/cast-chain.mdx)
42 |
43 | [chain-id]: https://chainlist.org/
44 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-chain.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast chain
5 |
6 | ### NAME
7 |
8 | cast-chain - Get the symbolic name of the current chain.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast chain` [*options*]
13 |
14 | ### DESCRIPTION
15 |
16 | Get the symbolic chain name from the RPC endpoint we are connected to.
17 |
18 | ### OPTIONS
19 |
20 | #### RPC Options
21 |
22 |
23 |
24 |
25 |
26 | ### EXAMPLES
27 |
28 | 1. Get the chain name when talking to `$RPC`:
29 |
30 | ```sh
31 | cast chain --rpc-url $RPC
32 | ```
33 |
34 | 2. Get the chain name when `$ETH_RPC_URL` is set:
35 | ```sh
36 | cast chain
37 | ```
38 |
39 | ### SEE ALSO
40 |
41 | [cast](/cast/reference/overview), [cast chain-id](/cast/reference/cast-chain-id.mdx)
42 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-client.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast client
5 |
6 | ### NAME
7 |
8 | cast-client - Get the current client version.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast client` [*options*]
13 |
14 | ### DESCRIPTION
15 |
16 | Get the current client version.
17 |
18 | ### OPTIONS
19 |
20 | #### RPC Options
21 |
22 |
23 |
24 |
25 |
26 | ### EXAMPLES
27 |
28 | 1. Get the current client version:
29 | ```sh
30 | cast client
31 | ```
32 |
33 | ### SEE ALSO
34 |
35 | [cast](/cast/reference/overview)
36 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-completions.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast completions
4 |
5 | ### NAME
6 |
7 | cast-completions - Generate shell completions script
8 |
9 | ### SYNOPSIS
10 |
11 | `cast completions` _shell_
12 |
13 | ### DESCRIPTION
14 |
15 | Generates a shell completions script for the given shell.
16 |
17 | Supported shells are:
18 |
19 | - bash
20 | - elvish
21 | - fish
22 | - powershell
23 | - zsh
24 |
25 | ### OPTIONS
26 |
27 |
28 |
29 | ### EXAMPLES
30 |
31 | 1. Generate shell completions script for zsh:
32 | ```sh
33 | cast completions zsh > $HOME/.oh-my-zsh/completions/_cast
34 | ```
35 |
36 | ### SEE ALSO
37 |
38 | [cast](/cast/reference/overview)
39 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-compute-address.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast compute-address
5 |
6 | ### NAME
7 |
8 | cast-compute-address - Compute the contract address from a given nonce and deployer address.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast compute-address` [*options*] _address_
13 |
14 | ### DESCRIPTION
15 |
16 | Compute the contract address from a given nonce and deployer address.
17 |
18 | ### OPTIONS
19 |
20 | #### Compute Options
21 |
22 | `--nonce` _nonce_
23 | The nonce of the account. Defaults to the latest nonce, fetched from the RPC.
24 |
25 | #### RPC Options
26 |
27 |
28 |
29 |
30 |
31 | ### SEE ALSO
32 |
33 | [cast](/cast/reference/overview), [cast proof](/cast/reference/cast-proof.mdx), [cast create2](/cast/reference/cast-create2.mdx)
34 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-concat-hex.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast concat-hex
4 |
5 | ### NAME
6 |
7 | cast-concat-hex - Concatenate hex strings.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast concat-hex` _data..._
12 |
13 | ### DESCRIPTION
14 |
15 | Concatenate hex strings.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Concatenate hex strings:
24 | ```sh
25 | cast concat-hex 0xa 0xb 0xc
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-decode-calldata.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast decode-calldata
4 |
5 | ### NAME
6 |
7 | cast-decode-calldata - Decode ABI-encoded input data.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast decode-calldata` [*options*] _sig_ _calldata_
12 |
13 | ### DESCRIPTION
14 |
15 | Decode ABI-encoded input data.
16 |
17 | The signature (_sig_) is a fragment in the form `()`.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. Decode input data for a `transfer` call:
26 | ```sh
27 | cast decode-calldata "transfer(address,uint256)" \
28 | 0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d0000000000000000000000000000000000000000000000000008a8e4b1a3d8000
29 | ```
30 |
31 | ### SEE ALSO
32 |
33 | [cast](/cast/reference/overview), [cast decode-abi](/cast/reference/cast-decode-abi.mdx)
34 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-find-block.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast find-block
5 |
6 | ### NAME
7 |
8 | cast-find-block - Get the block number closest to the provided timestamp.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast find-block` [*options*] _timestamp_
13 |
14 | ### DESCRIPTION
15 |
16 | Get the block number closest to the provided timestamp.
17 |
18 | ### OPTIONS
19 |
20 | #### RPC Options
21 |
22 |
23 |
24 |
25 |
26 | ### EXAMPLES
27 |
28 | 1. Get the block number closest to New Years 2021
29 | ```sh
30 | cast find-block 1609459200
31 | ```
32 |
33 | ### SEE ALSO
34 |
35 | [cast](/cast/reference/overview)
36 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-format-bytes32-string.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast format-bytes32-string
4 |
5 | ### NAME
6 |
7 | cast-format-bytes32-string - Formats a string into bytes32 encoding.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast format-bytes32-string` [*options*] _string_
12 |
13 | ### DESCRIPTION
14 |
15 | Formats a string into bytes32 encoding.
16 |
17 | Note that this command is for formatting a [Solidity string literal](https://docs.soliditylang.org/en/v0.8.16/types.html#string-literals-and-types) into `bytes32` only. If you're looking to pad a byte string, use [to-bytes32](/cast/reference/cast-to-bytes32.mdx) instead.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. Turn string "hello" into bytes32 hex:
26 | ```sh
27 | cast format-bytes32-string "hello"
28 | ```
29 |
30 | ### SEE ALSO
31 |
32 | [cast](/cast/reference/overview)
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-from-bin.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast from-bin
4 |
5 | ### NAME
6 |
7 | cast-from-bin - Convert binary data into hex data.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast from-bin` [*options*]
12 |
13 | ### DESCRIPTION
14 |
15 | Convert binary data into hex data.
16 |
17 | The input is taken from stdin.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### SEE ALSO
24 |
25 | [cast](/cast/reference/overview)
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-from-fixed-point.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast from-fixed-point
4 |
5 | ### NAME
6 |
7 | cast-from-fixed-point - Convert a fixed point number into an integer.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast from-fixed-point` [*options*] _decimals_ _value_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert a fixed point number into an integer.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Convert 10.55 to an integer:
24 | ```sh
25 | cast from-fixed-point 2 10.55
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-from-rlp.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast from-rlp
4 |
5 | ### NAME
6 |
7 | cast-from-rlp - Decodes RLP-encoded data.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast from-rlp` _data_
12 |
13 | ### DESCRIPTION
14 |
15 | Decodes RLP-encoded data.
16 |
17 | The _data_ is a hexadecimal string with optional 0x prefix.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. Decode RLP data:
26 |
27 | ```sh
28 | cast from-rlp 0xc481f181f2
29 |
30 | cast from-rlp c481f181f2
31 | ```
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-from-utf8.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast from-utf8
4 |
5 | ### NAME
6 |
7 | cast-from-utf8 - Convert UTF8 text to hex.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast from-utf8` [*options*] _text_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert UTF8 text to hex.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Convert UTF8 text to hex:
24 | ```sh
25 | cast from-utf8 "hello"
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-from-wei.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast from-wei
4 |
5 | ### NAME
6 |
7 | cast-from-wei - Convert wei into an ETH amount.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast from-wei` [*options*] _value_ [*unit*]
12 |
13 | ### DESCRIPTION
14 |
15 | Convert wei into an ETH amount.
16 |
17 | Consider using [`cast to-unit`](/cast/reference/cast-to-unit.mdx).
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### SEE ALSO
24 |
25 | [cast](/cast/reference/overview), [cast calldata](/cast/reference/cast-to-unit.mdx)
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-gas-price.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast gas-price
5 |
6 | ### NAME
7 |
8 | cast-gas-price - Get the current gas price.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast gas-price` [*options*]
13 |
14 | ### DESCRIPTION
15 |
16 | Get the current gas price.
17 |
18 | ### OPTIONS
19 |
20 | #### RPC Options
21 |
22 |
23 |
24 |
25 |
26 | ### EXAMPLES
27 |
28 | 1. Get the current gas price:
29 | ```sh
30 | cast gas-price
31 | ```
32 |
33 | ### SEE ALSO
34 |
35 | [cast](/cast/reference/overview), [cast basefee](/cast/reference/cast-basefee.mdx)
36 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-help.mdx:
--------------------------------------------------------------------------------
1 | ## cast help
2 |
3 | ### NAME
4 |
5 | cast-help - Get help for a Cast command
6 |
7 | ### SYNOPSIS
8 |
9 | `cast help` [*subcommand*]
10 |
11 | ### DESCRIPTION
12 |
13 | Prints a help message for the given command.
14 |
15 | ### EXAMPLES
16 |
17 | 1. Get help for a command:
18 |
19 | ```sh
20 | cast help call
21 | ```
22 |
23 | 2. Help is also available with the `--help` flag:
24 | ```sh
25 | cast call --help
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-keccak.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast keccak
4 |
5 | ### NAME
6 |
7 | cast-keccak - Hash arbitrary data using keccak-256.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast keccak` [*options*] _data_
12 |
13 | ### DESCRIPTION
14 |
15 | Hash arbitrary data using keccak-256.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### SEE ALSO
22 |
23 | [cast](/cast/reference/overview)
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-max-int.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast max-int
4 |
5 | ### NAME
6 |
7 | cast-max-int - Get the maximum i256 value.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast max-int`
12 |
13 | ### DESCRIPTION
14 |
15 | Get the maximum i256 value.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### SEE ALSO
22 |
23 | [cast](/cast/reference/overview), [cast min-int](/cast/reference/cast-min-int.mdx), [cast max-uint](/cast/reference/cast-max-uint.mdx)
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-max-uint.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast max-uint
4 |
5 | ### NAME
6 |
7 | cast-max-uint - Get the maximum uint256 value.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast max-uint`
12 |
13 | ### DESCRIPTION
14 |
15 | Get the maximum uint256 value.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### SEE ALSO
22 |
23 | [cast](/cast/reference/overview), [cast max-int](/cast/reference/cast-max-int.mdx)
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-min-int.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast min-int
4 |
5 | ### NAME
6 |
7 | cast-min-int - Get the minimum i256 value.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast min-int`
12 |
13 | ### DESCRIPTION
14 |
15 | Get the minimum i256 value.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### SEE ALSO
22 |
23 | [cast](/cast/reference/overview), [cast max-int](/cast/reference/cast-max-int.mdx)
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-namehash.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast namehash
4 |
5 | ### NAME
6 |
7 | cast-namehash - Calculate the ENS namehash of a name.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast namehash` [*options*] _name_
12 |
13 | ### DESCRIPTION
14 |
15 | Calculate the ENS namehash of a name.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Calculate the namehash of an ENS name.
24 | ```sh
25 | cast namehash vitalik.eth
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview), [cast lookup-address](/cast/reference/cast-lookup-address.mdx), [cast resolve-name](/cast/reference/cast-resolve-name.mdx)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-nonce.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast nonce
5 |
6 | ### NAME
7 |
8 | cast-nonce - Get the nonce for an account.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast nonce` [*options*] _who_
13 |
14 | ### DESCRIPTION
15 |
16 | Get the nonce of an account.
17 |
18 | The argument _who_ can be an ENS name or an address.
19 |
20 | ### OPTIONS
21 |
22 | #### Query Options
23 |
24 | `-B` _block_
25 | `--block` _block_
26 | The block height you want to query at.
27 |
28 | Can be a block number, or any of the tags: `earliest`, `finalized`, `safe`, `latest` or `pending`.
29 |
30 | #### RPC Options
31 |
32 |
33 |
34 |
35 |
36 | ### EXAMPLES
37 |
38 | 1. Get the nonce of beer.eth
39 | ```sh
40 | cast nonce beer.eth
41 | ```
42 |
43 | ### SEE ALSO
44 |
45 | [cast](/cast/reference/overview), [cast balance](/cast/reference/cast-balance.mdx)
46 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-parse-bytes32-address.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast parse-bytes32-address
4 |
5 | ### NAME
6 |
7 | cast-parse-bytes32-address - Parses a checksummed address from bytes32 encoding.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast parse-bytes32-address` [*options*] _bytes_
12 |
13 | ### DESCRIPTION
14 |
15 | Parses a checksummed address from its bytes32 encoding representation.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Parse the bytes32 encoding of the WETH9 contract address to its address representation:
24 | ```sh
25 | cast parse-bytes32-address 0x000000000000000000000000C02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-parse-bytes32-string.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast parse-bytes32-string
4 |
5 | ### NAME
6 |
7 | cast-parse-bytes32-string - Parses a string from bytes32 encoding.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast parse-bytes32-string` [*options*] _bytes_
12 |
13 | ### DESCRIPTION
14 |
15 | Parses a [Solidity string literal](https://docs.soliditylang.org/en/v0.8.16/types.html#string-literals-and-types) from its bytes32 encoding representation mostly by interpreting bytes as ASCII characters. This command undos the encoding in [--format-bytes32-string](/cast/reference/cast-format-bytes32-string.mdx).
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Parse bytes32 string encoding of "hello" back to the string representation:
24 | ```sh
25 | cast parse-bytes32-string "0x68656c6c6f000000000000000000000000000000000000000000000000000000"
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-pretty-calldata.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast pretty-calldata
4 |
5 | ### NAME
6 |
7 | cast-pretty-calldata - Pretty print calldata.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast pretty-calldata` [*options*] _calldata_
12 |
13 | ### DESCRIPTION
14 |
15 | Pretty print calldata.
16 |
17 | Tries to decode the calldata using [Openchain Signatures](https://openchain.xyz/signatures) unless `--offline` is passed.
18 |
19 | ### OPTIONS
20 |
21 | #### 4byte Options
22 |
23 | `-o`
24 | `--offline`
25 | Skip the https://openchain.xyz/signatures lookup.
26 |
27 |
28 |
29 | ### EXAMPLES
30 |
31 | 1. Decode calldata for a `transfer` call:
32 | ```sh
33 | cast pretty-calldata 0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d00000000000000000000000000000000000000000000000000174b37380cea000
34 | ```
35 |
36 | ### SEE ALSO
37 |
38 | [cast](/cast/reference/overview), [cast 4byte-calldata](/cast/reference/cast-4byte-calldata.mdx)
39 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-selectors.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast selectors
4 |
5 | ### NAME
6 |
7 | cast-selectors - Extracts function selectors and arguments from bytecode
8 |
9 | ### SYNOPSIS
10 |
11 | `cast selectors` [*options*] _bytecode_
12 |
13 | ### DESCRIPTION
14 |
15 | Extracts function selectors and arguments from bytecode using the [EVMole library](https://github.com/cdump/evmole)
16 |
17 | ### OPTIONS
18 |
19 | `-r`
20 | `--resolve`
21 | Resolve the function signatures for the extracted selectors using https://openchain.xyz
22 |
23 |
24 |
25 | ### EXAMPLES
26 |
27 | 1. Get WETH's contract function signatures & arguments:
28 | ```sh
29 | cast selectors $(cast code 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
30 | ```
31 |
32 | ### SEE ALSO
33 |
34 | [cast](/cast/reference/overview), [cast 4byte](/cast/reference/cast-4byte.mdx)
35 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-shl.mdx:
--------------------------------------------------------------------------------
1 | import BaseOptions from "../../reference/common/base-options.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast shl
5 |
6 | ### NAME
7 |
8 | cast-shl - Perform a left shifting operation.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast shl` [*options*] _value_ _shift_
13 |
14 | ### DESCRIPTION
15 |
16 | Perform a left shifting operation.
17 |
18 | ### OPTIONS
19 |
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. Perform a 3 position left bit shift of the number 61
26 | ```sh
27 | cast shl --base-in 10 61 3
28 | ```
29 |
30 | > Note: The --base-in parameter is not enforced but will be needed if the input is ambiguous.
31 |
32 | ### SEE ALSO
33 |
34 | [cast](/cast/reference/overview), [cast shr](/cast/reference/cast-shr.mdx)
35 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-shr.mdx:
--------------------------------------------------------------------------------
1 | import BaseOptions from "../../reference/common/base-options.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## cast shr
5 |
6 | ### NAME
7 |
8 | cast-shr - Perform a right shifting operation.
9 |
10 | ### SYNOPSIS
11 |
12 | `cast shr` [*options*] _value_ _shift_
13 |
14 | ### DESCRIPTION
15 |
16 | Perform a right shifting operation.
17 |
18 | ### OPTIONS
19 |
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. Perform a single right bit shift of 0x12
26 | ```sh
27 | cast shr --base-in 16 0x12 1
28 | ```
29 |
30 | > Note: The --base-in parameter is not enforced but will be needed if the input is ambiguous.
31 |
32 | ### SEE ALSO
33 |
34 | [cast](/cast/reference/overview), [cast shl](/cast/reference/cast-shl.mdx)
35 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-sig-event.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast sig-event
4 |
5 | ### NAME
6 |
7 | cast-sig-event - Generate event signatures from event string.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast sig-event` [*options*] _event_string_
12 |
13 | ### DESCRIPTION
14 |
15 | Generate event signatures from event string.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Get the hash for the log `Transfer(address indexed from, address indexed to, uint256 amount)`:
24 | ```sh
25 | cast sig-event "Transfer(address indexed from, address indexed to, uint256 amount)"
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-ascii.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-ascii
4 |
5 | ### NAME
6 |
7 | cast-to-ascii - Convert hex data to an ASCII string.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-ascii` [*options*] _text_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert hex data to an ASCII string.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Convert hex data to an ASCII string:
24 | ```sh
25 | cast to-ascii "0x68656c6c6f"
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-base.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-base
4 |
5 | ### NAME
6 |
7 | cast-to-base - Convert a number of one base to another.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-base` [*options*] _value_ _base_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert a number of one base to another.
16 |
17 | ### OPTIONS
18 |
19 | #### Base Options
20 |
21 | `--base-in` _base_
22 | The base of the input number. Available options:
23 |
24 | 10, d, dec, decimal
25 |
26 | 16, h, hex, hexadecimal
27 |
28 |
29 |
30 | ### EXAMPLES
31 |
32 | 1. Convert the decimal number 64 to hexadecimal
33 |
34 | ```sh
35 | cast to-base 64 hex
36 | ```
37 |
38 | 2. Convert the hexadecimal number 100 to binary
39 | ```sh
40 | cast to-base 0x100 2
41 | ```
42 |
43 | > Note: The --base-in parameter is not enforced but will be needed if the input is ambiguous.
44 |
45 | ### SEE ALSO
46 |
47 | [cast](/cast/reference/overview)
48 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-bytes32.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-bytes32
4 |
5 | ### NAME
6 |
7 | cast-to-bytes32 - Right-pads hex data to 32 bytes.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-bytes32` [*options*] _bytes_
12 |
13 | ### DESCRIPTION
14 |
15 | Right-pads hex data to 32 bytes.
16 |
17 | Note that this command is for padding a byte string only. If you're looking to format a [Solidity string literal](https://docs.soliditylang.org/en/v0.8.16/types.html#string-literals-and-types) into `bytes32`, use [format-bytes32-string](/cast/reference/cast-format-bytes32-string.mdx) instead.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### SEE ALSO
24 |
25 | [cast](/cast/reference/overview)
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-check-sum-address.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-check-sum-address
4 |
5 | ### NAME
6 |
7 | cast-to-check-sum-address - Convert an address to a checksummed format ([EIP-55][eip55]).
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-check-sum-address` _address_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert an address to a checksummed format ([EIP-55][eip55]).
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Convert an address to its checksummed format:
24 | ```sh
25 | cast to-check-sum-address 0xDf99A0839818B3f120EBAC9B73f82B617Dc6A555
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
32 | [eip55]: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-dec.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-dec
4 |
5 | ### NAME
6 |
7 | cast-to-dec - Converts a number of one base to decimal
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-dec` [*options*] _value_
12 |
13 | ### DESCRIPTION
14 |
15 | Converts a number of one base to decimal
16 |
17 | ### OPTIONS
18 |
19 | `--base-in` _base_in_
20 | The input base.
21 |
22 |
23 |
24 | ### EXAMPLES
25 |
26 | 1. Convert ff in hexadecimal to decimal
27 | ```sh
28 | cast to-dec ff
29 | ```
30 |
31 | ### SEE ALSO
32 |
33 | [cast](/cast/reference/overview)
34 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-fixed-point.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-fixed-point
4 |
5 | ### NAME
6 |
7 | cast-to-fixed-point - Convert an integer into a fixed point number.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-fixed-point` [*options*] _decimals_ _value_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert an integer into a fixed point number.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Convert 250 to a fixed point number with 2 decimals:
24 | ```sh
25 | cast to-fixed-point 2 250
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [cast](/cast/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-hex.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-hex
4 |
5 | ### NAME
6 |
7 | cast-to-hex - Converts a number of one base to another
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-hex` [*options*] _value_
12 |
13 | ### DESCRIPTION
14 |
15 | Converts a number of one base to another
16 |
17 | ### OPTIONS
18 |
19 | `--base-in` _base_in_
20 | The input base.
21 |
22 |
23 |
24 | ### SEE ALSO
25 |
26 | [cast](/cast/reference/overview)
27 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-int256.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-int256
4 |
5 | ### NAME
6 |
7 | cast-to-int256 - Convert a number to a hex-encoded int256.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-int256` [*options*] _value_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert a number to a hex-encoded int256.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### SEE ALSO
22 |
23 | [cast](/cast/reference/overview)
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-rlp.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-rlp
4 |
5 | ### NAME
6 |
7 | cast-to-rlp - Encodes hex data to RLP.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-rlp` _array_
12 |
13 | ### DESCRIPTION
14 |
15 | RLP encodes a hex string or a JSON array of hex strings.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Encoding RLP data:
24 |
25 | ```sh
26 | cast to-rlp '["0xaa","0xbb","cc"]'
27 |
28 | cast to-rlp f0a9
29 | ```
30 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-uint256.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-uint256
4 |
5 | ### NAME
6 |
7 | cast-to-uint256 - Convert a number to a hex-encoded uint256.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-uint256` [*options*] _value_
12 |
13 | ### DESCRIPTION
14 |
15 | Convert a number to a hex-encoded uint256.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### SEE ALSO
22 |
23 | [cast](/cast/reference/overview)
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-unit.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-unit
4 |
5 | ### NAME
6 |
7 | cast-to-unit - Convert an eth amount to another unit.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-unit` [*options*] _value_ [*unit*]
12 |
13 | ### DESCRIPTION
14 |
15 | Convert an eth amount to another unit.
16 |
17 | The value to convert (_value_) can be a quantity of eth (in wei), or a number with a unit attached to it.
18 |
19 | Valid units are:
20 |
21 | - `ether`
22 | - `gwei`
23 | - `wei`
24 |
25 | ### OPTIONS
26 |
27 |
28 |
29 | ### EXAMPLES
30 |
31 | 1. Convert 1000 wei to gwei
32 |
33 | ```sh
34 | cast to-unit 1000 gwei
35 | ```
36 |
37 | 2. Convert 1 eth to gwei
38 | ```sh
39 | cast to-unit 1ether gwei
40 | ```
41 |
42 | ### SEE ALSO
43 |
44 | [cast](/cast/reference/overview)
45 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-to-wei.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast to-wei
4 |
5 | ### NAME
6 |
7 | cast-to-wei - Convert an eth amount to wei.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast to-wei` [*options*] _value_ [*unit*]
12 |
13 | ### DESCRIPTION
14 |
15 | Convert an eth amount to wei.
16 |
17 | Consider using [`cast to-unit`](/cast/reference/cast-to-unit.mdx).
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### SEE ALSO
24 |
25 | [cast](/cast/reference/overview), [cast calldata](/cast/reference/cast-to-unit.mdx)
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-tx.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "../../reference/common/rpc-url-option.mdx";
2 | import DisplayOptions from "../../reference/common/display-options.mdx";
3 | import CommonOptions from "./common-options.mdx";
4 |
5 | ## cast tx
6 |
7 | ### NAME
8 |
9 | cast-tx - Get information about a transaction.
10 |
11 | ### SYNOPSIS
12 |
13 | `cast tx` [*options*] _tx_hash_ [*field*]
14 |
15 | ### DESCRIPTION
16 |
17 | Get information about a transaction.
18 |
19 | If _field_ is specified, then only the given field of the transaction is displayed.
20 |
21 | ### OPTIONS
22 |
23 | #### RPC Options
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | ### EXAMPLES
32 |
33 | 1. Get information about a transaction:
34 |
35 | ```sh
36 | cast tx $TX_HASH
37 | ```
38 |
39 | 2. Get the sender of a transaction:
40 | ```sh
41 | cast tx $TX_HASH from
42 | ```
43 |
44 | ### SEE ALSO
45 |
46 | [cast](/cast/reference/overview), [cast receipt](/cast/reference/cast-receipt.mdx)
47 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-upload-signature.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast upload-signature
4 |
5 | ### NAME
6 |
7 | cast-upload-signature
8 |
9 | ### SYNOPSIS
10 |
11 | `cast upload-signature` [*signatures...*]
12 |
13 | ### DESCRIPTION
14 |
15 | Upload the given signatures to [https://openchain.xyz/signatures](https://openchain.xyz/signatures).
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Upload signatures
24 | ```sh
25 | cast upload-signature 'function approve(address,uint256)' \
26 | 'transfer(uint256)' 'event Transfer(uint256,address)'
27 | ```
28 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-wallet-address.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 | import WalletOptionsRaw from "../../reference/common/wallet-options-raw.mdx";
3 | import WalletOptionsKeystore from "../../reference/common/wallet-options-keystore.mdx";
4 | import WalletOptionsHardware from "../../reference/common/wallet-options-hardware.mdx";
5 |
6 | ## cast wallet address
7 |
8 | ### NAME
9 |
10 | cast-wallet-address - Convert a private key to an address.
11 |
12 | ### SYNOPSIS
13 |
14 | `cast wallet address` [*options*]
15 |
16 | ### DESCRIPTION
17 |
18 | Convert a private key to an address.
19 |
20 | ### OPTIONS
21 |
22 | #### Keystore Options
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | ### EXAMPLES
31 |
32 | 1. Get the address of the keypair in `keystore.json`:
33 | ```sh
34 | cast wallet address --keystore keystore.json
35 | ```
36 |
37 | ### SEE ALSO
38 |
39 | [cast](/cast/reference/overview), [cast wallet](/cast/reference/cast-wallet.mdx)
40 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-wallet-list.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast wallet list
4 |
5 | ### NAME
6 |
7 | cast-wallet-list - List all the accounts in the keystore default directory.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast wallet list`
12 |
13 | ### DESCRIPTION
14 |
15 | List all the accounts in the keystore default directory `~/.foundry/keystores`.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### SEE ALSO
22 |
23 | [cast](/cast/reference/overview), [cast wallet](/cast/reference/cast-wallet.mdx)
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/cast-wallet-verify.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## cast wallet verify
4 |
5 | ### NAME
6 |
7 | cast-wallet-verify - Verify the signature of a message.
8 |
9 | ### SYNOPSIS
10 |
11 | `cast wallet verify` [*options*] `--address` _address_ _message_ _signature_
12 |
13 | ### DESCRIPTION
14 |
15 | Verify the signature of a message.
16 |
17 | ### OPTIONS
18 |
19 | #### Signature Options
20 |
21 | `-a` _address_
22 | `--address` _address_
23 | The address of the message signer.
24 |
25 |
26 |
27 | ### SEE ALSO
28 |
29 | [cast](/cast/reference/overview), [cast wallet](/cast/reference/cast-wallet.mdx)
30 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/chain-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Chain Commands
2 |
3 | - [cast chain-id](/cast/reference/cast-chain-id.mdx)
4 | - [cast chain](/cast/reference/cast-chain.mdx)
5 | - [cast client](/cast/reference/cast-client.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/common-options.mdx:
--------------------------------------------------------------------------------
1 | #### Common Options
2 |
3 | `-h`
4 | `--help`
5 | Prints help information.
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/ens-commands.mdx:
--------------------------------------------------------------------------------
1 | ## ENS Commands
2 |
3 | - [cast lookup-address](/cast/reference/cast-lookup-address.mdx)
4 | - [cast resolve-name](/cast/reference/cast-resolve-name.mdx)
5 | - [cast namehash](/cast/reference/cast-namehash.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/etherscan-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Etherscan Commands
2 |
3 | - [cast etherscan-source](/cast/reference/cast-etherscan-source.mdx)
4 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/general-commands.mdx:
--------------------------------------------------------------------------------
1 | ## General Commands
2 |
3 | - [cast](/cast/reference/overview)
4 | - [cast help](/cast/reference/cast-help.mdx)
5 | - [cast completions](/cast/reference/cast-completions.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/sig-description.mdx:
--------------------------------------------------------------------------------
1 | The signature (*sig*) can be:
2 |
3 | - A fragment: `someFunction(uint256,bytes32)`
4 | - A selector and encoded calldata: `0xcdba2fd40000000000000000000000000000000000000000000000000000000000007a69`
5 | - Only the function name: in this case Cast will try to fetch the function signature from Etherscan
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/transaction-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Transaction Commands
2 |
3 | - [cast publish](/cast/reference/cast-publish.mdx)
4 | - [cast receipt](/cast/reference/cast-receipt.mdx)
5 | - [cast send](/cast/reference/cast-send.mdx)
6 | - [cast mktx](/cast/reference/cast-mktx.mdx)
7 | - [cast call](/cast/reference/cast-call.mdx)
8 | - [cast rpc](/cast/reference/cast-rpc.mdx)
9 | - [cast tx](/cast/reference/cast-tx.mdx)
10 | - [cast run](/cast/reference/cast-run.mdx)
11 | - [cast estimate](/cast/reference/cast-estimate.mdx)
12 | - [cast access-list](/cast/reference/cast-access-list.mdx)
13 | - [cast logs](/cast/reference/cast-logs.mdx)
14 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/utility-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Utility Commands
2 |
3 | - [cast address-zero](/cast/reference/cast-address-zero.mdx)
4 | - [cast sig](/cast/reference/cast-sig.mdx)
5 | - [cast sig-event](/cast/reference/cast-sig-event.mdx)
6 | - [cast keccak](/cast/reference/cast-keccak.mdx)
7 | - [cast compute-address](/cast/reference/cast-compute-address.mdx)
8 | - [cast create2](/cast/reference/cast-create2.mdx)
9 | - [cast interface](/cast/reference/cast-interface.mdx)
10 | - [cast index](/cast/reference/cast-index.mdx)
11 | - [cast concat-hex](/cast/reference/cast-concat-hex.mdx)
12 | - [cast max-int](/cast/reference/cast-max-int.mdx)
13 | - [cast min-int](/cast/reference/cast-min-int.mdx)
14 | - [cast max-uint](/cast/reference/cast-max-uint.mdx)
15 | - [cast to-check-sum-address](/cast/reference/cast-to-check-sum-address.mdx)
16 |
--------------------------------------------------------------------------------
/vocs/docs/pages/cast/reference/wallet-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Wallet Commands
2 |
3 | - [cast wallet](/cast/reference/cast-wallet.mdx)
4 | - [cast wallet address](/cast/reference/cast-wallet-address.mdx)
5 | - [cast wallet new](/cast/reference/cast-wallet-new.mdx)
6 | - [cast wallet sign](/cast/reference/cast-wallet-sign.mdx)
7 | - [cast wallet vanity](/cast/reference/cast-wallet-vanity.mdx)
8 | - [cast wallet verify](/cast/reference/cast-wallet-verify.mdx)
9 | - [cast wallet import](/cast/reference/cast-wallet-import.mdx)
10 |
--------------------------------------------------------------------------------
/vocs/docs/pages/config/lint.mdx:
--------------------------------------------------------------------------------
1 | ## Linter Configuration
2 |
3 | Configuration related to the behavior of the linter. These keys are set in the `[lint]` section.
4 |
5 | ##### `severity`
6 |
7 | - Type: array of strings
8 | - Default: all severities enabled (`high`, `med`, `low`, `info`, `gas`)
9 | - Environment: `FOUNDRY_LINT_SEVERITY`
10 |
11 | Specifies which lints to run based on severity. If omitted, all severities are checked.
12 |
13 | ##### `exclude_lints`
14 |
15 | - Type: array of strings
16 | - Default: `[]`
17 | - Environment: `FOUNDRY_LINT_EXCLUDE_LINTS`
18 |
19 | List of lint IDs to exclude from checking (e.g., `"mixed-case-function"`).
20 |
21 | ##### `ignore`
22 |
23 | - Type: array of strings (patterns)
24 | - Default: `[]`
25 | - Environment: `FOUNDRY_LINT_IGNORE`
26 |
27 | List of files or patterns to ignore when running the linter. This is a comma-separated list of glob patterns.
28 |
--------------------------------------------------------------------------------
/vocs/docs/pages/config/reference/README.mdx:
--------------------------------------------------------------------------------
1 | ## Config Reference
2 |
3 | - [Overview](/config/reference/overview.mdx)
4 | - [Project](/config/reference/project.mdx)
5 | - [Solidity Compiler](/config/reference/solidity-compiler.mdx)
6 | - [Testing](/config/reference/testing.mdx)
7 | - [In-line test configuration](/config/reference/inline-test-config.mdx)
8 | - [Formatter](/config/reference/formatter.mdx)
9 | - [Documentation Generator](/config/reference/doc-generator.mdx)
10 | - [Etherscan](/config/reference/etherscan.mdx)
11 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/advanced-testing/overview.md:
--------------------------------------------------------------------------------
1 | ## Advanced Testing
2 |
3 | Forge comes with a number of advanced testing methods:
4 |
5 | - [Fuzz Testing](/forge/advanced-testing/fuzz-testing)
6 | - [Invariant Testing](/forge/advanced-testing/invariant-testing)
7 | - [Differential Testing](/forge/advanced-testing/differential-ffi-testing)
8 |
9 | In the future, Forge will also support these:
10 |
11 | - [Symbolic Execution](#)
12 | - [Mutation Testing](#)
13 |
14 | Each chapter dives into what problem the testing methods solve, and how to apply them to your own project.
15 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/gas-tracking/gas-section-snapshots.mdx:
--------------------------------------------------------------------------------
1 | import GasSnapshots from "../../reference/cheatcodes/gas-snapshots.mdx";
2 |
3 | # Gas Section Snapshots
4 |
5 | Forge can capture gas snapshots over arbitrary sections inside of your test functions. This can be useful to get a granular measurement of how much gas your logic is consuming as both external calls and internal gas usage are measured.
6 |
7 | Instead of running a command like `forge snapshot` or `forge test --gas-report`, you use the `snapshotGas` [cheatcodes](/reference/cheatcodes/gas-snapshots) in your tests to capture gas usage as follows:
8 |
9 |
10 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/README.mdx:
--------------------------------------------------------------------------------
1 | ## forge Commands
2 |
3 | - [General Commands](/forge/reference/general-commands.mdx)
4 | - [Project Commands](/forge/reference/project-commands.mdx)
5 | - [Build Commands](/forge/reference/build-commands.mdx)
6 | - [Test Commands](/forge/reference/test-commands.mdx)
7 | - [Deploy Commands](/forge/reference/deploy-commands.mdx)
8 | - [Utility Commands](/forge/reference/utility-commands.mdx)
9 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/build-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Build Commands
2 |
3 | - [forge build](/forge/reference/forge-build.mdx)
4 | - [forge clean](/forge/reference/forge-clean.mdx)
5 | - [forge inspect](/forge/reference/forge-inspect.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/common-options.mdx:
--------------------------------------------------------------------------------
1 | #### Common Options
2 |
3 | `-h`
4 | `--help`
5 | Prints help information.
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/core-build-options.mdx:
--------------------------------------------------------------------------------
1 | import CompilerOptions from "./compiler-options.mdx";
2 | import ProjectOptions from "./project-options.mdx";
3 |
4 | #### Cache Options
5 |
6 | `--force`
7 | Clear the cache and artifacts folder and recompile.
8 |
9 | #### Linker Options
10 |
11 | `--libraries` _libraries_
12 | Set pre-linked libraries.
13 |
14 | The parameter must be in the format `::`, e.g. `src/Contract.sol:Library:0x...`.
15 |
16 | Can also be set in your configuration file as `libraries = ["::"]`.
17 |
18 |
19 |
20 |
21 |
22 | `-o` _path_
23 | `--out` _path_
24 | The project's artifacts directory.
25 |
26 | `--silent`
27 | Suppress all output.
28 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/deploy-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Deploy Commands
2 |
3 | - [forge create](/forge/reference/forge-create.mdx)
4 | - [forge verify-contract](/forge/reference/forge-verify-contract.mdx)
5 | - [forge verify-check](/forge/reference/forge-verify-check.mdx)
6 | - [forge flatten](/forge/reference/forge-flatten.mdx)
7 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/executor-options.mdx:
--------------------------------------------------------------------------------
1 | #### Executor Options
2 |
3 | `--base-fee `
4 | `--block-base-fee-per-gas `
5 | The base fee in a block (in wei).
6 |
7 | `--block-coinbase` *address*
8 | The coinbase of the block.
9 |
10 | `--block-difficulty` *difficulty*
11 | The block difficulty.
12 |
13 | `--block-gas-limit` *gas_limit*
14 | The block gas limit.
15 |
16 | `--block-number` *block*
17 | The block number.
18 |
19 | `--block-timestamp` *timestamp*
20 | The timestamp of the block (in seconds).
21 |
22 | `--chain-id` *chain_id*
23 | The chain ID.
24 |
25 | `--gas-limit` *gas_limit*
26 | The block gas limit.
27 |
28 | `--gas-price` *gas_price*
29 | The gas price (in wei).
30 |
31 | `--tx-origin` *address*
32 | The transaction origin.
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-cache-ls.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## `forge cache ls`
4 |
5 | ### NAME
6 |
7 | forge-cache-ls - Shows cached data from `~/.foundry`.
8 |
9 | ### SYNOPSIS
10 |
11 | `forge cache ls` [*chains..*]
12 |
13 | ### DESCRIPTION
14 |
15 | Lists what is in the `~/.foundry/cache` folder currently.
16 |
17 | ### OPTIONS
18 |
19 |
20 |
21 | ### EXAMPLES
22 |
23 | 1. Show the entire cache (also, `forge cache ls` is an alias for this)
24 |
25 | ```sh
26 | forge cache ls all
27 | ```
28 |
29 | 2. Show cache data for a specific chain, by name
30 | ```sh
31 | forge cache ls rinkeby
32 | ```
33 | 3. Specify multiple chains
34 | ```sh
35 | forge cache ls rinkeby mainnet
36 | ```
37 |
38 | ### SEE ALSO
39 |
40 | [forge](/forge/reference/overview), [forge cache](/forge/reference/forge-cache.mdx)
41 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-cache.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## `forge cache`
4 |
5 | ### NAME
6 |
7 | forge-cache - Manage the Foundry cache.
8 |
9 | ### SYNOPSIS
10 |
11 | `forge cache` [*options*] _command_ [*args*]
12 | `forge cache` [*options*] `--version`
13 | `forge cache` [*options*] `--help`
14 |
15 | ### DESCRIPTION
16 |
17 | This program is a set of tools to manage the Foundry cache.
18 |
19 | ### COMMANDS
20 |
21 | [forge cache clean](/forge/reference/forge-cache-clean.mdx)
22 | Cleans cached data from `~/.foundry`.
23 |
24 | [forge cache ls](/forge/reference/forge-cache-ls.mdx)
25 | Shows cached data from `~/.foundry`.
26 |
27 | ### OPTIONS
28 |
29 | #### Special Options
30 |
31 | `-V`
32 | `--version`
33 | Print version info and exit.
34 |
35 |
36 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-clean.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## forge clean
4 |
5 | ### NAME
6 |
7 | forge-clean - Remove the build artifacts and cache directories.
8 |
9 | ### SYNOPSIS
10 |
11 | `forge clean` [*options*]
12 |
13 | ### DESCRIPTION
14 |
15 | Remove the build artifacts and cache directories.
16 |
17 | ### OPTIONS
18 |
19 | #### Clean Options
20 |
21 | `--root` _path_
22 | The project's root path. Defaults to the current working directory.
23 |
24 |
25 |
26 | ### EXAMPLES
27 |
28 | 1. Clean artifacts and cache in a project:
29 | ```sh
30 | forge clean
31 | ```
32 |
33 | ### SEE ALSO
34 |
35 | [forge](/forge/reference/overview)
36 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-completions.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## forge completions
4 |
5 | ### NAME
6 |
7 | forge-completions - Generate shell completions script
8 |
9 | ### SYNOPSIS
10 |
11 | `forge completions` _shell_
12 |
13 | ### DESCRIPTION
14 |
15 | Generates a shell completions script for the given shell.
16 |
17 | Supported shells are:
18 |
19 | - bash
20 | - elvish
21 | - fish
22 | - powershell
23 | - zsh
24 |
25 | ### OPTIONS
26 |
27 |
28 |
29 | ### EXAMPLES
30 |
31 | 1. Generate shell completions script for zsh:
32 | ```sh
33 | forge completions zsh > $HOME/.oh-my-zsh/completions/_forge
34 | ```
35 |
36 | ### SEE ALSO
37 |
38 | [forge](/forge/reference/overview)
39 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-geiger.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## forge geiger
4 |
5 | ### NAME
6 |
7 | forge-geiger - Detects usage of unsafe cheat codes in a foundry project and its dependencies.
8 |
9 | ### SYNOPSIS
10 |
11 | `forge geiger` [*options*] [*path*]
12 |
13 | ### DESCRIPTION
14 |
15 | Detects usage of unsafe cheat codes in a foundry project and its dependencies.
16 |
17 | ### OPTIONS
18 |
19 | `--root` _path_
20 | The project's root path. By default, this is the root directory of the current git repository, or the current working directory.
21 |
22 | `--check`
23 | Run in 'check' mode. Exits with 0 if no unsafe cheat codes were found. Exits with 1 if unsafe cheat codes are detected.
24 |
25 | `--full`
26 | Print a full report of all files even if no unsafe functions are found.
27 |
28 |
29 |
30 | ### SEE ALSO
31 |
32 | [forge](/forge/reference/overview)
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-help.mdx:
--------------------------------------------------------------------------------
1 | ## forge help
2 |
3 | ### NAME
4 |
5 | forge-help - Get help for a Forge command
6 |
7 | ### SYNOPSIS
8 |
9 | `forge help` [*subcommand*]
10 |
11 | ### DESCRIPTION
12 |
13 | Prints a help message for the given command.
14 |
15 | ### EXAMPLES
16 |
17 | 1. Get help for a command:
18 |
19 | ```sh
20 | forge help build
21 | ```
22 |
23 | 2. Help is also available with the `--help` flag:
24 | ```sh
25 | forge build --help
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | [forge](/forge/reference/overview)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-remappings.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## forge remappings
4 |
5 | ### NAME
6 |
7 | forge-remappings - Get the automatically inferred remappings for the project.
8 |
9 | ### SYNOPSIS
10 |
11 | `forge remappings` [*options*]
12 |
13 | ### DESCRIPTION
14 |
15 | Get the automatically inferred remappings for the project.
16 |
17 | ### OPTIONS
18 |
19 | #### Project Options
20 |
21 | `--root` _path_
22 | The project's root path. By default, this is the root directory of the current git repository, or the current working directory.
23 |
24 | `--lib-path` _path_
25 | The path to the library folder.
26 |
27 |
28 |
29 | ### EXAMPLES
30 |
31 | 1. Create a `remappings.txt` file from the inferred remappings:
32 | ```sh
33 | forge remappings > remappings.txt
34 | ```
35 |
36 | ### SEE ALSO
37 |
38 | [forge](/forge/reference/overview)
39 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-remove.mdx:
--------------------------------------------------------------------------------
1 | import CommonOptions from "./common-options.mdx";
2 |
3 | ## forge remove
4 |
5 | ### NAME
6 |
7 | forge-remove - Remove one or multiple dependencies.
8 |
9 | ### SYNOPSIS
10 |
11 | `forge remove` [*options*] [*deps...*]
12 |
13 | ### DESCRIPTION
14 |
15 | Remove one or multiple dependencies.
16 |
17 | Dependencies can be a raw URL (`https://foo.com/dep`), the path to a GitHub repository (`owner/repo`) or the path to the dependency in the project tree.
18 |
19 | ### OPTIONS
20 |
21 |
22 |
23 | ### EXAMPLES
24 |
25 | 1. Remove a dependency by path:
26 |
27 | ```sh
28 | forge remove lib/solmate
29 | ```
30 |
31 | 2. Remove a dependency by GitHub repository name:
32 | ```sh
33 | forge remove dapphub/solmate
34 | ```
35 |
36 | ### SEE ALSO
37 |
38 | [forge](/forge/reference/overview), [forge install](/forge/reference/forge-install.mdx), [forge update](/forge/reference/forge-update.mdx)
39 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-tree.mdx:
--------------------------------------------------------------------------------
1 | import ProjectOptions from "./project-options.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## forge tree
5 |
6 | ### NAME
7 |
8 | forge-tree - Display a tree visualization of the project's dependency graph.
9 |
10 | ### SYNOPSIS
11 |
12 | `forge tree` [*options*]
13 |
14 | ### DESCRIPTION
15 |
16 | Display a visualization of the project's dependency graph.
17 |
18 | ```
19 | // [!include ~/snippets/output/forge_tree/forge-tree:all]
20 | ```
21 |
22 | ### OPTIONS
23 |
24 | #### Flatten Options
25 |
26 | `--charset` _charset_
27 | Character set to use in output: utf8, ascii. Default: utf8
28 |
29 | `--no-dedupe`
30 | Do not de-duplicate (repeats all shared dependencies)
31 |
32 |
33 |
34 |
35 |
36 | ### SEE ALSO
37 |
38 | [forge](/forge/reference/overview)
39 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/forge-upload-selectors.mdx:
--------------------------------------------------------------------------------
1 | import ProjectOptions from "./project-options.mdx";
2 | import CommonOptions from "./common-options.mdx";
3 |
4 | ## forge upload-selectors
5 |
6 | ### NAME
7 |
8 | forge-upload-selectors - Uploads abi of given contract to https://openchain.xyz/signatures function selector database.
9 |
10 | ### SYNOPSIS
11 |
12 | `forge upload-selectors` [*options*] _contract_
13 |
14 | ### DESCRIPTION
15 |
16 | Uploads abi of given contract to https://openchain.xyz/signatures function selector database.
17 |
18 | ### OPTIONS
19 |
20 |
21 |
22 |
23 |
24 | ### EXAMPLES
25 |
26 | 1. Upload ABI to selector database
27 | ```sh
28 | forge upload-selectors LinearVestingVault
29 | ```
30 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/general-commands.mdx:
--------------------------------------------------------------------------------
1 | ## General Commands
2 |
3 | - [forge](/forge/reference/overview)
4 | - [forge help](/forge/reference/forge-help.mdx)
5 | - [forge completions](/forge/reference/forge-completions.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/project-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Project Commands
2 |
3 | - [forge init](/forge/reference/forge-init.mdx)
4 | - [forge clone](/forge/reference/forge-clone.mdx)
5 | - [forge install](/forge/reference/forge-install.mdx)
6 | - [forge update](/forge/reference/forge-update.mdx)
7 | - [forge remove](/forge/reference/forge-remove.mdx)
8 | - [forge config](/forge/reference/forge-config.mdx)
9 | - [forge remappings](/forge/reference/forge-remappings.mdx)
10 | - [forge tree](/forge/reference/forge-tree.mdx)
11 | - [forge geiger](/forge/reference/forge-geiger.mdx)
12 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/test-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Test Commands
2 |
3 | - [forge test](/forge/reference/forge-test.mdx)
4 | - [forge snapshot](/forge/reference/forge-snapshot.mdx)
5 | - [forge coverage](/forge/reference/forge-coverage.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/forge/reference/utility-commands.mdx:
--------------------------------------------------------------------------------
1 | ## Utility Commands
2 |
3 | - [forge bind](/forge/reference/forge-bind.mdx)
4 | - [forge cache](/forge/reference/forge-cache.mdx)
5 | - [forge cache clean](/forge/reference/forge-cache-clean.mdx)
6 | - [forge cache ls](/forge/reference/forge-cache-ls.mdx)
7 | - [forge script](/forge/reference/forge-script.mdx)
8 | - [forge upload-selectors](/forge/reference/forge-upload-selectors.mdx)
9 | - [forge doc](/forge/reference/forge-doc.mdx)
10 |
--------------------------------------------------------------------------------
/vocs/docs/pages/guides/video-tutorials.md:
--------------------------------------------------------------------------------
1 | ## Foundry Tutorial Videos
2 |
3 | Unofficial _youtube playlists_ of Foundry tutorials from Blockchain educators.
4 |
--------------------------------------------------------------------------------
/vocs/docs/pages/misc/README.md:
--------------------------------------------------------------------------------
1 | ## Miscellaneous
2 |
3 | - [Struct encoding](./struct-encoding.md)
4 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/README.md:
--------------------------------------------------------------------------------
1 | ## References
2 |
3 | - [forge Commands](/forge/reference/overview)
4 | - [cast Commands](/cast/reference/overview)
5 | - [anvil Reference](/anvil/reference)
6 | - [chisel Reference](/chisel/reference)
7 | - [Config Reference](/config/reference/overview)
8 | - [Cheatcodes Reference](/reference/cheatcodes/overview)
9 | - [Forge Standard Library Reference](/reference/forge-std/overview)
10 | - [ds-test Reference](/reference/ds-test)
11 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/accesses.mdx:
--------------------------------------------------------------------------------
1 | ## `accesses`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function accesses(
7 | address
8 | )
9 | external
10 | returns (
11 | bytes32[] memory reads,
12 | bytes32[] memory writes
13 | );
14 | ```
15 |
16 | ### Description
17 |
18 | Gets all storage slots that have been read (`reads`) or written to (`writes`) on an address.
19 |
20 | Note that [`record`](/reference/cheatcodes/record.mdx) must be called first.
21 |
22 | > ℹ️ **Note**
23 | >
24 | > Every write also counts as an additional read.
25 |
26 | ### Examples
27 |
28 | ```solidity
29 | /// contract NumsContract {
30 | /// uint256 public num1 = 100; // slot 0
31 | /// uint256 public num2 = 200; // slot 1
32 | /// }
33 |
34 | vm.record();
35 | numsContract.num2();
36 | (bytes32[] memory reads, bytes32[] memory writes) = vm.accesses(
37 | address(numsContract)
38 | );
39 | emit log_uint(uint256(reads[0])); // 1
40 | ```
41 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/active-fork.mdx:
--------------------------------------------------------------------------------
1 | ## `activeFork`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function activeFork() external returns (uint256);
7 | ```
8 |
9 | ### Description
10 |
11 | Returns the identifier for the currently active fork. Reverts if no fork is currently active.
12 |
13 | ### Examples
14 |
15 | Get the currently active fork id:
16 |
17 | ```solidity
18 | uint256 mainnetForkId = vm.createFork(MAINNET_RPC_URL);
19 | uint256 optimismForkId = vm.createFork(OPTIMISM_RPC_URL);
20 |
21 | assert(mainnetForkId != optimismForkId);
22 |
23 | vm.selectFork(mainnetForkId);
24 | assertEq(vm.activeFork(), mainnetForkId);
25 |
26 | vm.selectFork(optimismForkId);
27 | assertEq(vm.activeFork(), optimismForkId);
28 | ```
29 |
30 | ### SEE ALSO
31 |
32 | - [createFork](/reference/cheatcodes/create-fork.mdx)
33 | - [selectFork](/reference/cheatcodes/select-fork.mdx)
34 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/addr.mdx:
--------------------------------------------------------------------------------
1 | ## `addr`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function addr(uint256 privateKey) external returns (address);
7 | ```
8 |
9 | ### Description
10 |
11 | Computes the address for a given private key.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | address alice = vm.addr(1);
17 | emit log_address(alice); // 0x7e5f4552091a69125d5dfcb7b8c2659029395bdf
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/allow-cheatcodes.mdx:
--------------------------------------------------------------------------------
1 | ## `allowCheatcodes`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function allowCheatcodes(address) external;
7 | ```
8 |
9 | ### Description
10 |
11 | In forking mode, explicitly grant the given address cheatcode access.
12 |
13 | By default, the test contract, and its deployer are allowed to access cheatcodes. In addition to that, cheat code
14 | access is granted if the contract was deployed by an address that already has cheatcode access.
15 | This will prevent cheatcode access from accounts already deployed on the forked network.
16 |
17 | > ℹ️ **Note**
18 | >
19 | > This is only useful for more complex test setups in forking mode.
20 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/assertions.mdx:
--------------------------------------------------------------------------------
1 | ## Assertions
2 |
3 | - [`expectRevert`](/reference/cheatcodes/expect-revert.mdx)
4 | - [`expectEmit`](/reference/cheatcodes/expect-emit.mdx)
5 | - [`expectCall`](/reference/cheatcodes/expect-call.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/assume-no-revert.mdx:
--------------------------------------------------------------------------------
1 | ## `assumeNoRevert`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assumeNoRevert() external;
7 | ```
8 |
9 | ### Description
10 |
11 | The fuzzer will discard the current fuzz inputs and start a new fuzz run if next call reverted.
12 |
13 | The test may fail if you hit the max number of rejects.
14 |
15 | You can configure the rejection thresholds by setting [`fuzz.max_test_rejects`][max-test-rejects] in your `foundry.toml` file.
16 |
17 | ### Examples
18 |
19 | For a function that requires an amount in certain range:
20 | ```solidity
21 | function doSomething(uint256 amount) public {
22 | require(amount > 100 ether && amount < 1_000 ether);
23 | }
24 | ```
25 | reverts are discarded, resulting in test pass (or fail if max number of rejects hit):
26 | ```solidity
27 | function testSomething(uint256 amount) public {
28 | vm.assumeNoRevert();
29 | target.doSomething(amount);
30 | // [PASS]
31 | }
32 | ```
33 |
34 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/breakpoint.mdx:
--------------------------------------------------------------------------------
1 | ## `breakpoint`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function breakpoint(string) external;
7 | function breakpoint(string, bool) external;
8 | ```
9 |
10 | ### Description
11 |
12 | Places a breakpoint to jump to in the debugger view.
13 |
14 | Calling `vm.breakpoint(', true)` is equivalent to `vm.breakpoint(')`, but calling `vm.breakpoint(', false)` will erase the breakpoint at `'`.
15 |
16 | If the char is overwritten, only the last one that was visited in the execution steps is considered.
17 |
18 | ### Examples
19 |
20 | ```solidity
21 | function testBreakpoint() public {
22 | vm.breakpoint("a");
23 | }
24 | ```
25 |
26 | Opening up the debugger in a test environment and pressing `'a` will then place the debugger step at the place where the breakpoint cheatcode was called.
27 |
28 | 
29 |
30 | ### SEE ALSO
31 |
32 | [debugger](/forge/debugger)
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/chain-id.mdx:
--------------------------------------------------------------------------------
1 | ## `chainId`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function chainId(uint256) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets `block.chainid`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | vm.chainId(31337);
17 | emit log_uint(block.chainid); // 31337
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/clear-mocked-calls.mdx:
--------------------------------------------------------------------------------
1 | ## `clearMockedCalls`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function clearMockedCalls() external;
7 | ```
8 |
9 | ### Description
10 |
11 | Clears all [mocked calls](/reference/cheatcodes/mock-call.mdx).
12 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/coinbase.mdx:
--------------------------------------------------------------------------------
1 | ## `coinbase`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function coinbase(address) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets `block.coinbase`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | emit log_address(block.coinbase); // 0x0000000000000000000000000000000000000000
17 | vm.coinbase(0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8);
18 | emit log_address(block.coinbase); // 0xea674fdde714fd979de3edf0f56aa9716b898ec8
19 | ```
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/deal.mdx:
--------------------------------------------------------------------------------
1 | ## `deal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function deal(address who, uint256 newBalance) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets the balance of an address `who` to `newBalance`.
12 |
13 | If the alternative signature of `deal` is used (defined in `StdCheats.sol`), then we can additionally specify ERC20 token address, as well as an option to update `totalSupply`.
14 |
15 | ### Examples
16 |
17 | ```solidity
18 | address alice = makeAddr("alice");
19 | emit log_address(alice);
20 | vm.deal(alice, 1 ether);
21 | log_uint256(alice.balance); // 1000000000000000000
22 | ```
23 |
24 | ```solidity
25 | address alice = makeAddr("alice");
26 | emit log_address(alice);
27 | deal(address(DAI), alice, 1 ether); // import StdUtils.sol first
28 | log_uint256(address(DAI).balanceOf(alice)); // 1000000000000000000
29 | ```
30 |
31 | ### SEE ALSO
32 |
33 | Forge Standard Library
34 |
35 | [`deal`](/reference/forge-std/deal.mdx), [`hoax`](/reference/forge-std/hoax.mdx), [`startHoax`](/reference/forge-std/startHoax.mdx)
36 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/difficulty.mdx:
--------------------------------------------------------------------------------
1 | ## `difficulty`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function difficulty(uint256) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets `block.difficulty`.
12 |
13 | If used with a post-merge EVM version (Paris and onwards), it will revert. In that case, use [`vm.prevrandao`][prevrandao] instead.
14 |
15 | ### Examples
16 |
17 | ```solidity
18 | vm.difficulty(25);
19 | emit log_uint(block.difficulty); // 25
20 | ```
21 |
22 |
23 | [prevrandao]: ./prevrandao.md
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/external.mdx:
--------------------------------------------------------------------------------
1 | ## External
2 |
3 | - [`ffi`](/reference/cheatcodes/ffi.mdx)
4 | - [`prompt`](/reference/cheatcodes/prompt.mdx)
5 | - [`projectRoot`](/reference/cheatcodes/project-root.mdx)
6 | - [`getCode`](/reference/cheatcodes/get-code.mdx)
7 | - [`getDeployedCode`](/reference/cheatcodes/get-deployed-code.mdx)
8 | - [`sleep`](/reference/cheatcodes/sleep.mdx)
9 | - [`unixTime`](/reference/cheatcodes/unix-time.mdx)
10 | - [`setEnv`](/reference/cheatcodes/set-env.mdx)
11 | - [`envOr`](/reference/cheatcodes/env-or.mdx)
12 | - [`envBool`](/reference/cheatcodes/env-bool.mdx)
13 | - [`envUint`](/reference/cheatcodes/env-uint.mdx)
14 | - [`envInt`](/reference/cheatcodes/env-int.mdx)
15 | - [`envAddress`](/reference/cheatcodes/env-address.mdx)
16 | - [`envBytes32`](/reference/cheatcodes/env-bytes32.mdx)
17 | - [`envString`](/reference/cheatcodes/env-string.mdx)
18 | - [`envBytes`](/reference/cheatcodes/env-bytes.mdx)
19 | - [`parseJson`](/reference/cheatcodes/parse-json.mdx)
20 | - [`fs`](/reference/cheatcodes/fs.mdx)
21 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/fee.mdx:
--------------------------------------------------------------------------------
1 | ## `fee`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function fee(uint256) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets `block.basefee`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | vm.fee(25 gwei);
17 | emit log_uint(block.basefee); // 25000000000
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/forking.mdx:
--------------------------------------------------------------------------------
1 | ## Forking
2 |
3 | - [`createFork`](/reference/cheatcodes/create-fork.mdx)
4 | - [`selectFork`](/reference/cheatcodes/select-fork.mdx)
5 | - [`createSelectFork`](/reference/cheatcodes/create-select-fork.mdx)
6 | - [`activeFork`](/reference/cheatcodes/active-fork.mdx)
7 | - [`rollFork`](/reference/cheatcodes/roll-fork.mdx)
8 | - [`makePersistent`](/reference/cheatcodes/make-persistent.mdx)
9 | - [`revokePersistent`](/reference/cheatcodes/revoke-persistent.mdx)
10 | - [`isPersistent`](/reference/cheatcodes/is-persistent.mdx)
11 | - [`allowCheatcodes`](/reference/cheatcodes/allow-cheatcodes.mdx)
12 | - [`transact`](/reference/cheatcodes/transact.mdx)
13 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/fuzzer.mdx:
--------------------------------------------------------------------------------
1 | ## Fuzzer
2 |
3 | - [`assume`](/reference/cheatcodes/assume.mdx)
4 | - [`assumeNoRevert`](/reference/cheatcodes/assume-no-revert.mdx)
5 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/get-block-number.mdx:
--------------------------------------------------------------------------------
1 | ## `getBlockNumber`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function getBlockNumber() external view returns (uint256 height);
7 | ```
8 |
9 | ### Description
10 |
11 | Gets the current `block.number`. This is useful in cases where `vm.roll` along with `--via-ir` compilation is used, as `block.number` is assumed to be a constant during a transaction. This means that on every forge test, multiple calls to `block.number` would get optimized to just returning a constant value, instead of actually accessing the current `block.number`. `vm.getBlockNumber()` avoids this optimization and returns the current `block.number`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | uint256 height = vm.getBlockNumber();
17 | assertEq(height, uint256(block.number));
18 | vm.roll(10);
19 | assertEq(vm.getBlockNumber(), 10);
20 | ```
21 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/get-block-timestamp.mdx:
--------------------------------------------------------------------------------
1 | ## `getBlockTimestamp`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function getBlockTimestamp() external view returns (uint256 timestamp);
7 | ```
8 |
9 | ### Description
10 |
11 | Gets the current `block.timestamp`. This is useful in cases where `vm.warp` along with `--via-ir` compilation is used, as `block.timestamp` is assumed to be a constant during a transaction. This means that in every forge test, multiple calls to `block.timestamp` would get optimized to just returning a constant value, instead of actually accessing the current `block.timestamp`. `vm.getBlockTimestamp()` avoids this optimization and returns the current `block.timestamp`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | assertEq(vm.getBlockTimestamp(), 1, "timestamp should be 1");
17 | vm.warp(10);
18 | assertEq(vm.getBlockTimestamp(), 10, "warp failed");
19 | ```
20 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/get-label.mdx:
--------------------------------------------------------------------------------
1 | ## `getLabel`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function getLabel(address) external returns (string memory);
7 | ```
8 |
9 | ### Description
10 |
11 | Retrieves the label for an address if it was previously labeled. If not, it returns the address prefixed with `unlabeled:`.
12 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/get-nonce.mdx:
--------------------------------------------------------------------------------
1 | ## `getNonce`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function getNonce(address account) external returns (uint64);
7 | ```
8 |
9 | ```solidity
10 | function getNonce(Wallet memory wallet) external returns (uint64);
11 | ```
12 |
13 | ### Description
14 |
15 | Gets the nonce of the given account or [Wallet](/reference/cheatcodes/create-wallet.mdx).
16 |
17 | ### Examples
18 |
19 | #### `address`
20 |
21 | ```solidity
22 | uint256 nonce = vm.getNonce(address(100));
23 | emit log_uint(nonce); // 0
24 | ```
25 |
26 | #### `Wallet`
27 |
28 | ```solidity
29 | Wallet memory alice = vm.createWallet("alice");
30 | uint256 nonce = vm.getNonce(alice);
31 | emit log_uint(nonce); // 0
32 | ```
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/is-persistent.mdx:
--------------------------------------------------------------------------------
1 | ## `isPersistent`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function isPersistent(address) external returns (bool);
7 | ```
8 |
9 | ### Description
10 |
11 | Returns whether an account is marked as persistent ([`makePersistent`](/reference/cheatcodes/make-persistent.mdx)).
12 |
13 | ### Examples
14 |
15 | Check default status of `msg.sender` and the current test account
16 |
17 | ```solidity
18 | // By default the `sender` and the test contract itself are persistent
19 | assert(cheats.isPersistent(msg.sender));
20 | assert(cheats.isPersistent(address(this)));
21 | ```
22 |
23 | ### SEE ALSO
24 |
25 | - [makePersistent](/reference/cheatcodes/make-persistent.mdx)
26 | - [revokePersistent](/reference/cheatcodes/revoke-persistent.mdx)
27 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/key-exists-json.mdx:
--------------------------------------------------------------------------------
1 | ## `keyExistsJson`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | // Check if a key exists in a JSON string.
7 | vm.keyExistsJson(string memory json, string memory key) returns (bool)
8 | ```
9 |
10 | ### Description
11 |
12 | Checks if a key exists in a JSON string.
13 |
14 | ### Examples
15 |
16 | ```solidity
17 | string memory path = "./path/to/jsonfile.json";
18 | string memory json = vm.readFile(path);
19 | bool exists = vm.keyExistsJson(json, ".key");
20 | assertTrue(exists);
21 | ```
22 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/key-exists-toml.mdx:
--------------------------------------------------------------------------------
1 | ## `keyExistsToml`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | // Check if a key exists in a TOML table.
7 | vm.keyExistsToml(string memory toml, string memory key) returns (bool)
8 | ```
9 |
10 | ### Description
11 |
12 | Checks if a key exists in a TOML table.
13 |
14 | ### Examples
15 |
16 | ```solidity
17 | string memory path = "./path/to/tomlfile.toml";
18 | string memory toml = vm.readFile(path);
19 | bool exists = vm.keyExistsToml(toml, ".key");
20 | assertTrue(exists);
21 | ```
22 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/key-exists.mdx:
--------------------------------------------------------------------------------
1 | ## `keyExists`
2 |
3 | ### Status
4 |
5 | `keyExists` is being deprecated in favor of `keyExistsJson`. It will be removed in future versions.
6 |
7 | ### Signature
8 |
9 | ```solidity
10 | // Check if a key exists in a JSON string.
11 | vm.keyExists(string memory json, string memory key) returns (bool)
12 | ```
13 |
14 | ### Description
15 |
16 | Checks if a key exists in a JSON string.
17 |
18 | ### Examples
19 |
20 | ```solidity
21 | string memory path = "./path/to/jsonfile.json";
22 | string memory json = vm.readFile(path);
23 | bool exists = vm.keyExists(json, ".key");
24 | assertTrue(exists);
25 | ```
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/label.mdx:
--------------------------------------------------------------------------------
1 | ## `label`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function label(address addr, string calldata label) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets a label `label` for `addr` in test traces.
12 |
13 | If an address is labelled, the label will show up in test traces instead of the address.
14 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/load.mdx:
--------------------------------------------------------------------------------
1 | ## `load`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function load(address account, bytes32 slot) external returns (bytes32);
7 | ```
8 |
9 | ### Description
10 |
11 | Loads the value from storage slot `slot` on account `account`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | /// contract LeetContract {
17 | /// uint256 private leet = 1337; // slot 0
18 | /// }
19 |
20 | bytes32 leet = vm.load(address(leetContract), bytes32(uint256(0)));
21 | emit log_uint(uint256(leet)); // 1337
22 | ```
23 |
24 | ### SEE ALSO
25 |
26 | Forge Standard Library
27 |
28 | [Std Storage](/reference/forge-std/std-storage.mdx)
29 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-address.mdx:
--------------------------------------------------------------------------------
1 | ## `parseAddress`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function parseAddress(string calldata stringifiedValue) external pure returns (address parsedValue);
7 | ```
8 |
9 | ### Description
10 |
11 | Parses the value of `string` into `address`
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | string memory addressAsString = "0x0000000000000000000000000000000000000000";
17 | address stringToAddress = vm.parseAddress(addressAsString); // 0x0000000000000000000000000000000000000000
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-bool.mdx:
--------------------------------------------------------------------------------
1 | ## `parseBool`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function parseBool(string calldata stringifiedValue) external pure returns (bool parsedValue);
7 | ```
8 |
9 | ### Description
10 |
11 | Parses the value of `string` into `bool`
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | string memory boolAsString = "false";
17 | bool stringToBool = vm.parseBool(boolAsString); // false
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-bytes.mdx:
--------------------------------------------------------------------------------
1 | ## `parseBytes`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function parseBytes(string calldata stringifiedValue) external pure returns (bytes memory parsedValue);
7 | ```
8 |
9 | ### Description
10 |
11 | Parses the value of `string` into `bytes`
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | string memory bytesAsString = "0x00000000000000000000000000000000";
17 | bytes memory stringToBytes = vm.parseBytes(bytesAsString); // 0x00000000000000000000000000000000
18 |
19 | ```
20 |
21 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-bytes32.mdx:
--------------------------------------------------------------------------------
1 | ## `parseBytes32`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function parseBytes32(string calldata stringifiedValue) external pure returns (bytes32 parsedValue);
7 | ```
8 |
9 | ### Description
10 |
11 | Parses the value of `string` into `bytes32`
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | string memory bytes32AsString = "0x0000000000000000000000000000000000000000000000000000000000000000";
17 | bytes32 stringToBytes32 = vm.parseBytes32(bytes32AsString); // 0x0000000000000000000000000000000000000000000000000000000000000000
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-int.mdx:
--------------------------------------------------------------------------------
1 | ## `parseInt`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function parseInt(string calldata stringifiedValue) external pure returns (int256 parsedValue);
7 | ```
8 |
9 | ### Description
10 |
11 | Parses the value of `string` into `int256`
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | string memory intAsString = "-12345";
17 | int256 stringToInt = vm.parseInt(intAsString); // -12345
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-json-keys.mdx:
--------------------------------------------------------------------------------
1 | ## `parseJsonKeys`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | // Get list of keys present in a JSON string
7 | function parseJsonKeys(string calldata json, string calldata key) external pure returns (string[] memory keys);
8 | ```
9 |
10 | ### Description
11 |
12 | Gets list of keys present in a JSON string
13 |
14 | ### Examples
15 |
16 | ```solidity
17 | string memory json = '{"key": {"a": 1, "b": 2}}';
18 | string[] memory keys = vm.parseJsonKeys(json, ".key"); // ["a", "b"]
19 | ```
20 |
21 | ```solidity
22 | string memory json = '{"key": "something"}';
23 | string[] memory keys = vm.parseJsonKeys(json, "$"); // ["key"]
24 | ```
25 |
26 | ```solidity
27 | string memory json = '{"root_key": [{"a": 1, "b": 2}]}';
28 | string[] memory keys = vm.parseJsonKeys(json, ".root_key[0]"); // ["a", "b"]
29 | ```
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-toml-keys.mdx:
--------------------------------------------------------------------------------
1 | ## `parseTomlKeys`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | // Get list of keys present in a TOML string
7 | function parseTomlKeys(string calldata toml, string calldata key) external pure returns (string[] memory keys);
8 | ```
9 |
10 | ### Description
11 |
12 | Gets list of keys present in a TOML string
13 |
14 | ### Examples
15 |
16 | ```solidity
17 | // [key]
18 | // a = 1
19 | // b = 2
20 |
21 | string memory toml = '[key]\n a = 1\n b = 2';
22 | string[] memory keys = vm.parseTomlKeys(toml, ".key"); // ["a", "b"]
23 | ```
24 |
25 | ```solidity
26 | // key = "something"
27 |
28 | string memory toml = 'key = \"something\"';
29 | string[] memory keys = vm.parseTomlKeys(toml, "$"); // ["key"]
30 | ```
31 |
32 | ```solidity
33 | // [[root_key]]
34 | // a = 1
35 | // b = 2
36 |
37 | string memory toml = '[[root_key]]\n a = 1\n b = 2';
38 | string[] memory keys = vm.parseTomlKeys(toml, ".root_key.0"); // ["a", "b"]
39 | ```
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/parse-uint.mdx:
--------------------------------------------------------------------------------
1 | ## `parseUint`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function parseUint(string calldata stringifiedValue) external pure returns (uint256 parsedValue);
7 | ```
8 |
9 | ### Description
10 |
11 | Parses the value of `string` into `uint256`
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | string memory uintAsString = "12345";
17 | uint256 stringToUint = vm.parseUint(uintAsString); // 12345
18 | ```
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/pause-gas-metering.mdx:
--------------------------------------------------------------------------------
1 | ## `pauseGasMetering`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function pauseGasMetering() external;
7 | ```
8 |
9 | ### Description
10 |
11 | Pauses gas metering (i.e. `gasleft()` does not decrease as operations are executed).
12 |
13 | This can be useful for getting a better sense of gas costs, by turning off gas metering for unnecessary code, as well as long-running scripts that would otherwise run out of gas.
14 |
15 | > ℹ️ **Note**
16 | >
17 | > `pauseGasMetering` *turns off DoS protections* that come from metering gas usage.
18 | >
19 | > Exposing a service that assumes a particular instance of the EVM will complete due to gas usage no longer is true, and a timeout should be enabled in that case.
20 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/prevrandao.mdx:
--------------------------------------------------------------------------------
1 | ## `prevrandao`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function prevrandao(bytes32) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets `block.prevrandao`.
12 |
13 | If used with an EVM version previous to the Paris hard fork, it will revert. In that case, use [`vm.difficulty`][prevrandao] instead.
14 |
15 | ### Examples
16 |
17 | ```solidity
18 | vm.prevrandao(bytes32(uint256(42)));
19 | emit log_uint(block.prevrandao); // 42
20 | ```
21 |
22 |
23 | [prevrandao]: ./difficulty.md
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/project-root.mdx:
--------------------------------------------------------------------------------
1 | ## `projectRoot`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function projectRoot() external returns (string memory);
7 | ```
8 |
9 | ### Description
10 |
11 | Returns the root directory of the current Foundry project.
12 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/record-logs.mdx:
--------------------------------------------------------------------------------
1 | ## `recordLogs`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function recordLogs() external;
7 | ```
8 |
9 | ### Description
10 |
11 | Tells the VM to start recording all the emitted events. To access them, use [`getRecordedLogs`](/reference/cheatcodes/get-recorded-logs.mdx).
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | /// event LogCompleted(
17 | /// uint256 indexed topic1,
18 | /// bytes data
19 | /// );
20 |
21 | vm.recordLogs();
22 |
23 | emit LogCompleted(10, "operation completed");
24 |
25 | Vm.Log[] memory entries = vm.getRecordedLogs();
26 |
27 | assertEq(entries.length, 1);
28 | assertEq(entries[0].topics[0], keccak256("LogCompleted(uint256,bytes)"));
29 | assertEq(entries[0].topics[1], bytes32(uint256(10)));
30 | assertEq(abi.decode(entries[0].data, (string)), "operation completed");
31 | ```
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/record.mdx:
--------------------------------------------------------------------------------
1 | ## `record`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function record() external;
7 | ```
8 |
9 | ### Description
10 |
11 | Tell the VM to start recording all storage reads and writes. To access the reads and writes, use [`accesses`](/reference/cheatcodes/accesses.mdx).
12 |
13 | > ℹ️ **Note**
14 | >
15 | > Every write also counts as an additional read.
16 |
17 | ### Examples
18 |
19 | ```solidity
20 | /// contract NumsContract {
21 | /// uint256 public num1 = 100; // slot 0
22 | /// uint256 public num2 = 200; // slot 1
23 | /// }
24 |
25 | vm.record();
26 | numsContract.num2();
27 | (bytes32[] memory reads, bytes32[] memory writes) = vm.accesses(
28 | address(numsContract)
29 | );
30 | emit log_uint(uint256(reads[0])); // 1
31 | ```
32 |
33 | ### SEE ALSO
34 |
35 | Forge Standard Library
36 |
37 | [Std Storage](/reference/forge-std/startHoax.mdx)
38 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/reset-gas-metering.mdx:
--------------------------------------------------------------------------------
1 | ## `resetGasMetering`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function resetGasMetering() external;
7 | ```
8 |
9 | ### Description
10 |
11 | Resets gas metering to the gas limit of current execution frame (i.e. `gasleft()` will be restored to initial value).
12 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/resume-gas-metering.mdx:
--------------------------------------------------------------------------------
1 | ## `resumeGasMetering`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function resumeGasMetering() external;
7 | ```
8 |
9 | ### Description
10 |
11 | Resumes gas metering (i.e. `gasleft()` will decrease as operations are executed). Gas usage will resume at the same amount at which it was paused.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/roll.mdx:
--------------------------------------------------------------------------------
1 | ## `roll`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function roll(uint256) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets `block.number`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | vm.roll(100);
17 | emit log_uint(block.number); // 100
18 | ```
19 |
20 | ### SEE ALSO
21 |
22 | - [rollFork](/reference/cheatcodes/roll-fork.mdx)
23 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/select-fork.mdx:
--------------------------------------------------------------------------------
1 | ## `selectFork`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function selectFork(uint256 forkId) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Takes a fork identifier created by `createFork` and sets the corresponding forked state as active.
12 |
13 | ### Examples
14 |
15 | Select a previously created fork:
16 |
17 | ```solidity
18 | uint256 forkId = vm.createFork(MAINNET_RPC_URL);
19 |
20 | vm.selectFork(forkId);
21 |
22 | assertEq(vm.activeFork(), forkId);
23 | ```
24 |
25 | ### SEE ALSO
26 |
27 | - [createFork](/reference/cheatcodes/create-fork.mdx)
28 | - [activeFork](/reference/cheatcodes/active-fork.mdx)
29 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/set-env.mdx:
--------------------------------------------------------------------------------
1 | ## `setEnv`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function setEnv(string calldata key, string calldata value) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Set an environment variable `key=value`.
12 |
13 | > ℹ️ **Note**
14 | >
15 | > Environment variables set by a process are only accessible by itself and its child
16 | > processes. Thus, calling `setEnv` will only modify environment variables of the currently running
17 | > `forge` process, and won't affect the shell (`forge`'s parent process), i.e., the they won't persist
18 | > after the `forge` process exit.
19 |
20 | ### Tips
21 |
22 | - The environment variable key can't be empty.
23 | - The environment variable key can't contain the equal sign `=` or the NUL character `\0`.
24 | - The environment variable value can't contain the NUL character `\0`.
25 |
26 | ### Examples
27 |
28 | ```solidity
29 | string memory key = "hello";
30 | string memory val = "world";
31 | cheats.setEnv(key, val);
32 | ```
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/set-nonce.mdx:
--------------------------------------------------------------------------------
1 | ## `setNonce`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function setNonce(address account, uint64 nonce) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets the nonce of the given account.
12 |
13 | The new nonce must be higher than the current nonce of the account.
14 |
15 | ### Examples
16 |
17 | ```solidity
18 | vm.setNonce(address(100), 1234);
19 | ```
20 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/signing.mdx:
--------------------------------------------------------------------------------
1 | ## Signing
2 |
3 | - [`sign`](/reference/cheatcodes/sign.mdx)
4 | - [`signDelegation`](/reference/cheatcodes/sign-delegation.mdx)
5 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/skip.mdx:
--------------------------------------------------------------------------------
1 | ## `skip`
2 |
3 | ## Signature
4 |
5 | ```solidity
6 | function skip(bool skip) external;
7 | ```
8 |
9 | ## Description
10 |
11 | Marks a test as skipped, conditionally. It must be called at the top of the test to ensure it is skipped without any execution.
12 |
13 | If `skip` is called with a false boolean, it will not skip the test.
14 |
15 | Tests marked as skipped will appear with a `[SKIPPED]` label on the test runner and on the summary, to easily identify skipped tests.
16 |
17 | ### Examples
18 |
19 | ```solidity
20 |
21 | function testSkip() public {
22 | vm.skip(true);
23 | /// This revert will not be reached as this test will be skipped.
24 | revert("Should not reach this revert");
25 | }
26 |
27 | function testNotSkip() public {
28 | vm.skip(false);
29 | /// This revert will be reached as this test will not be skipped, and the test will fail.
30 | revert("Should reach this revert");
31 | }
32 | ```
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/sleep.mdx:
--------------------------------------------------------------------------------
1 | ## `sleep`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function sleep(uint256 milliseconds) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sleeps for a given amount of milliseconds.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | vm.sleep(10_000); // Halts execution for 10 seconds
17 | ```
18 |
19 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/start-state-diff-recording.mdx:
--------------------------------------------------------------------------------
1 | ## `startStateDiffRecording`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function startStateDiffRecording()
7 | ```
8 |
9 | ### Description
10 |
11 | Records all state changes as part of CREATE, CALL or SELFDESTRUCT opcodes in order,
12 | along with the context of the calls.
13 | Refer to [`stopAndReturnStateDiff`](/reference/cheatcodes/stop-and-return-state-diff.mdx) for more details on how to access and interpret the recorded state changes.
14 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/stop-broadcast.mdx:
--------------------------------------------------------------------------------
1 | ## `stopBroadcast`
2 |
3 | ### Signature
4 | ```solidity
5 | function stopBroadcast() external;
6 | ```
7 |
8 | ### Description
9 |
10 | Stops collecting transactions for later on-chain broadcasting.
11 |
12 | ### Examples
13 |
14 | ```solidity
15 | function deployNoArgs() public {
16 | // broadcast the next call
17 | cheats.broadcast();
18 | Test test1 = new Test();
19 |
20 | // broadcast all calls between this line and `stopBroadcast`
21 | cheats.startBroadcast();
22 | Test test2 = new Test();
23 | cheats.stopBroadcast();
24 | }
25 | ```
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/stop-prank.mdx:
--------------------------------------------------------------------------------
1 | ## `stopPrank`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function stopPrank() external;
7 | ```
8 |
9 | ### Description
10 |
11 | Stops an active prank started by [`startPrank`](/reference/cheatcodes/start-prank.mdx), resetting `msg.sender` and `tx.origin` to the values before `startPrank` was called.
12 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/store.mdx:
--------------------------------------------------------------------------------
1 | ## `store`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function store(address account, bytes32 slot, bytes32 value) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Stores the value `value` in storage slot `slot` on account `account`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | /// contract LeetContract {
17 | /// uint256 private leet = 1337; // slot 0
18 | /// }
19 |
20 | vm.store(address(leetContract), bytes32(uint256(0)), bytes32(uint256(31337)));
21 | bytes32 leet = vm.load(address(leetContract), bytes32(uint256(0)));
22 | emit log_uint(uint256(leet)); // 31337
23 | ```
24 |
25 | ### SEE ALSO
26 |
27 | Forge Standard Library
28 |
29 | [Std Storage](/reference/forge-std/std-storage.mdx)
30 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/tx-gas-price.mdx:
--------------------------------------------------------------------------------
1 | ## `txGasPrice`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function txGasPrice(uint256) external;
7 | ```
8 |
9 | ```solidity
10 | function txGasPrice(uint256 newGasPrice) external;
11 | ```
12 |
13 | ### Description
14 |
15 | Sets `tx.gasprice` **for the rest of the transaction**.
16 |
17 | ### Examples
18 |
19 | We can use this to get accurate gas usage for a transaction.
20 |
21 | ```solidity
22 | function testCalculateGas() public {
23 | vm.txGasPrice(2);
24 | uint256 gasStart = gasleft();
25 | myContract.doStuff();
26 | uint256 gasEnd = gasleft();
27 | uint256 gasUsed = (gasStart - gasEnd) * tx.gasprice; // tx.gasprice is now 2
28 | }
29 | ```
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/unix-time.mdx:
--------------------------------------------------------------------------------
1 | ## `unixTime`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function unixTime() external returns (uint milliseconds);
7 | ```
8 |
9 | ### Description
10 |
11 | Returns the time since unix epoch in milliseconds.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | uint start = vm.unixTime();
17 | vm.sleep(10_000); // Halts execution for 10 seconds
18 | uint end = vm.unixTime();
19 | assertEq(end - start, 10_000);
20 | ```
21 |
22 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/utilities.mdx:
--------------------------------------------------------------------------------
1 | ## Utilities
2 |
3 | - [`addr`](/reference/cheatcodes/addr.mdx)
4 | - [`label`](/reference/cheatcodes/label.mdx)
5 | - [`getLabel`](/reference/cheatcodes/get-label.mdx)
6 | - [`deriveKey`](/reference/cheatcodes/derive-key.mdx)
7 | - [`rememberKey`](/reference/cheatcodes/remember-key.mdx)
8 | - [`toString`](/reference/cheatcodes/to-string.mdx)
9 | - [`breakpoint`](/reference/cheatcodes/breakpoint.mdx)
10 | - [`createWallet`](/reference/cheatcodes/create-wallet.mdx)
11 | - [`copyStorage`](/reference/cheatcodes/copy-storage.mdx)
12 | - [`setArbitraryStorage`](/reference/cheatcodes/set-arbitrary-storage.mdx)
13 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/cheatcodes/warp.mdx:
--------------------------------------------------------------------------------
1 | ## `warp`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function warp(uint256) external;
7 | ```
8 |
9 | ### Description
10 |
11 | Sets `block.timestamp`.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | vm.warp(1641070800);
17 | emit log_uint(block.timestamp); // 1641070800
18 | ```
19 |
20 | ### SEE ALSO
21 |
22 | Forge Standard Library
23 |
24 | [`skip`](/reference/forge-std/skip.mdx), [`rewind`](/reference/forge-std/rewind.mdx)
25 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/base-options.mdx:
--------------------------------------------------------------------------------
1 | #### Base Options
2 |
3 | `--base-in` *base*
4 | The base of the input number. Available options:
5 |
6 | 10, d, dec, decimal
7 |
8 | 16, h, hex, hexadecimal
9 |
10 | `--base-out` *base*
11 | The desired base of the output. Available options:
12 |
13 | 2, b, bin, binary
14 |
15 | 8, o, oct, octal
16 |
17 | 10, d, dec, decimal
18 |
19 | 16, h, hex, hexadecimal
20 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/display-options.mdx:
--------------------------------------------------------------------------------
1 | #### Display Options
2 |
3 | `-j`
4 | `--json`
5 | Print the deployment information as JSON.
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/etherscan-options.mdx:
--------------------------------------------------------------------------------
1 | #### Etherscan Options
2 |
3 | `--chain` _chain_name_
4 | The Etherscan chain.
5 |
6 | `--etherscan-api-key` _key_
7 | Etherscan API key, or the key of an [Etherscan configuration table](/config/reference/etherscan#etherscan).
8 | Environment: `ETHERSCAN_API_KEY`
9 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/multi-wallet-options-hardware.mdx:
--------------------------------------------------------------------------------
1 | #### Wallet Options - Hardware Wallet
2 |
3 | `-t`
4 | `--trezor`
5 | Use a Trezor hardware wallet.
6 |
7 | `-l`
8 | `--ledger`
9 | Use a Ledger hardware wallet.
10 |
11 | `--hd-paths` *paths*
12 | The derivation paths to use with hardware wallets.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/multi-wallet-options-keystore.mdx:
--------------------------------------------------------------------------------
1 | #### Wallet Options - Keystore
2 |
3 | `--keystores` *paths*
4 | Use the keystores in the given folders or files.
5 | Environment: `ETH_KEYSTORE`
6 |
7 | `--account` _account-name_
8 | Use a keystore from the default keystores folder (~/.foundry/keystores) by its filename.
9 | Environment: `ETH_KEYSTORE_ACCOUNT`
10 |
11 | `--password` *passwords*
12 | The keystore passwords. Used with `--keystore`.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/multi-wallet-options-raw.mdx:
--------------------------------------------------------------------------------
1 | #### Wallet Options - Raw
2 |
3 | `-i`
4 | `--interactives` *num*
5 | Open an interactive prompt to enter your private key. Takes a value for the number of keys to enter.
6 | Default: 0
7 |
8 | `--mnemonic-indexes` *indexes*
9 | Use the private key from the given mnemonic index. Used with --mnemonic-path.
10 | Default: 0
11 |
12 | `--mnemonic-paths` *paths*
13 | Use the mnemonic file at the specified path(s).
14 |
15 | `--private-key` *raw_private_key*
16 | Use the provided private key.
17 |
18 | `--private-keys` *raw_private_keys*
19 | Use the provided private keys.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/multi-wallet-options-remote.mdx:
--------------------------------------------------------------------------------
1 | #### Wallet Options - Remote
2 |
3 | `-a` *addresses*
4 | `--froms` *addresses*
5 | Sign the transaction with the specified accounts on the RPC.
6 | Environment: `ETH_FROM`
7 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/multi-wallet-options.mdx:
--------------------------------------------------------------------------------
1 | import MultiWalletOptionsRaw from "./multi-wallet-options-raw.mdx";
2 | import MultiWalletOptionsKeystore from "./multi-wallet-options-keystore.mdx";
3 | import MultiWalletOptionsHardware from "./multi-wallet-options-hardware.mdx";
4 | import MultiWalletOptionsRemote from "./multi-wallet-options-remote.mdx";
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/retry-options.mdx:
--------------------------------------------------------------------------------
1 | `--delay` *delay*
2 | Optional timeout to apply in between attempts in seconds. Defaults to 3.
3 |
4 | `--retries` *retries*
5 | Number of attempts for retrying. Defaults to 15.
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/rpc-options.mdx:
--------------------------------------------------------------------------------
1 | import RpcUrlOption from "./rpc-url-option.mdx";
2 |
3 | #### RPC Options
4 |
5 |
6 |
7 | `--flashbots`
8 | Use the Flashbots RPC URL: https://rpc.flashbots.net.
9 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/rpc-url-option.mdx:
--------------------------------------------------------------------------------
1 | `--rpc-url` *url*
2 | The RPC endpoint. Accepts a URL or an existing alias in the [rpc_endpoints] table, like `mainnet`.
3 | Environment: `ETH_RPC_URL`
4 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/transaction-options.mdx:
--------------------------------------------------------------------------------
1 | import TxValueOption from "./tx-value-option.mdx";
2 |
3 | #### Transaction Options
4 |
5 | `--gas-limit` _gas_limit_
6 | Gas limit for the transaction.
7 |
8 | `--gas-price` _price_
9 | Gas price for the transaction, or max fee per gas for EIP1559 transactions.
10 |
11 | `--priority-gas-price` _price_
12 | Max priority fee per gas for EIP1559 transactions.
13 |
14 |
15 |
16 | `--nonce` _nonce_
17 | Nonce for the transaction.
18 |
19 | `--legacy`
20 | Send a legacy transaction instead of an [EIP1559][eip1559] transaction.
21 |
22 | This is automatically enabled for common networks without EIP1559.
23 |
24 | [eip1559]: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md
25 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/tx-value-option.mdx:
--------------------------------------------------------------------------------
1 | `--value` *value*
2 | Ether to send in the transaction.
3 |
4 | Either specified as an integer (wei), or as a string with a unit, for example:
5 | - `1ether`
6 | - `10gwei`
7 | - `0.01ether`
8 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/verifier-options.mdx:
--------------------------------------------------------------------------------
1 | `--verifier` *name*
2 | The verification provider. Available options: `etherscan`, `sourcify` & `blockscout`. Default: `etherscan`. Note: make sure you add "/api\?" to the end of the Blockscout homepage explorer URL.
3 |
4 | `--verifier-url` *url*
5 | The optional verifier url for submitting the verification request.
6 | Environment: `VERIFIER_URL`
7 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/wallet-options-hardware.mdx:
--------------------------------------------------------------------------------
1 | #### Wallet Options - Hardware Wallet
2 |
3 | `-t`
4 | `--trezor`
5 | Use a Trezor hardware wallet.
6 |
7 | `-l`
8 | `--ledger`
9 | Use a Ledger hardware wallet.
10 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/wallet-options-keystore.mdx:
--------------------------------------------------------------------------------
1 | #### Wallet Options - Keystore
2 |
3 | `--keystore` _path_
4 | Use the keystore in the given folder or file.
5 | Environment: `ETH_KEYSTORE`
6 |
7 | `--account` _account-name_
8 | Use a keystore from the default keystores folder (~/.foundry/keystores) by its filename.
9 | Environment: `ETH_KEYSTORE_ACCOUNT`
10 |
11 | `--interactive`
12 |
13 | `--password` _password_
14 | The keystore password. Used with `--keystore`.
15 | Environment: `ETH_PASSWORD`
16 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/wallet-options-remote.mdx:
--------------------------------------------------------------------------------
1 | #### Wallet Options - Remote
2 |
3 | `-f` *address*
4 | `--from` *address*
5 | Sign the transaction with the specified account on the RPC.
6 | Environment: `ETH_FROM`
7 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/common/wallet-options.mdx:
--------------------------------------------------------------------------------
1 | import WalletOptionsRaw from "./wallet-options-raw.mdx";
2 | import WalletOptionsKeystore from "./wallet-options-keystore.mdx";
3 | import WalletOptionsHardware from "./wallet-options-hardware.mdx";
4 | import WalletOptionsRemote from "./wallet-options-remote.mdx";
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/abs.mdx:
--------------------------------------------------------------------------------
1 | ## `abs`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function abs(int256 a) internal pure returns (uint256)
7 | ```
8 |
9 | ### Description
10 |
11 | Returns the absolute value of a number.
12 |
13 | ### Example
14 |
15 | ```solidity
16 | uint256 ten = stdMath.abs(-10);
17 | ```
18 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertApproxEqAbsDecimal.mdx:
--------------------------------------------------------------------------------
1 | ## `assertApproxEqAbsDecimal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertApproxEqAbsDecimal(uint256 left, uint256 right, uint256 maxDelta, uint256 decimals) internal;
7 | ```
8 |
9 | ```solidity
10 | function assertApproxEqAbsDecimal(uint256 left, uint256 right, uint256 maxDelta, uint256 decimals, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is approximately equal to `right` with delta in absolute value.
24 |
25 | `left` and `right` are formatted with decimals in the revert string.
26 |
27 | Optionally includes an error message in the revert string.
28 |
29 | ### SEE ALSO
30 |
31 | - [`assertApproxEqAbs`](/reference/forge-std/assertApproxEqAbs.mdx)
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertEqDecimal.mdx:
--------------------------------------------------------------------------------
1 | ## `assertEqDecimal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertEqDecimal(uint256 left, uint256 right, uint256 decimals) internal
7 | ```
8 |
9 | ```solidity
10 | function assertEqDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertEqDecimal(int256 left, int256 right, uint256 decimals) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertEqDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is equal to `right`.
24 |
25 | `left` and `right` are formatted with decimals in the revert string.
26 |
27 | Optionally includes an error message in the revert string.
28 |
29 | ### SEE ALSO
30 |
31 | - [`assertEq`](/reference/forge-std/assertEq.mdx)
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertFalse.mdx:
--------------------------------------------------------------------------------
1 | ## `assertFalse`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertFalse(bool data) internal;
7 | ```
8 |
9 | ```solidity
10 | function assertFalse(bool data, string memory err) internal;
11 | ```
12 |
13 | ### Description
14 |
15 | Asserts `data` is false.
16 |
17 | Optionally includes an error message in the revert string.
18 |
19 | ### Examples
20 |
21 | ```solidity
22 | bool failure = contract.fun();
23 | assertFalse(failure);
24 | ```
25 |
26 | ### SEE ALSO
27 |
28 | - [`assertTrue`](/reference/forge-std/assertTrue.mdx)
29 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertGe.mdx:
--------------------------------------------------------------------------------
1 | ## `assertGe`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertGe(uint256 left, uint256 right) internal;
7 | ```
8 |
9 | ```solidity
10 | function assertGe(uint256 left, uint256 right, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertGe(int256 left, int256 right) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertGe(int256 left, int256 right, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is greater than or equal to `right`.
24 |
25 | Optionally includes an error message in the revert string.
26 |
27 | ### SEE ALSO
28 |
29 | - [`assertGeDecimal`](/reference/forge-std/assertGeDecimal.mdx)
30 | - [`assertGt`](/reference/forge-std/assertGt.mdx)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertGeDecimal.mdx:
--------------------------------------------------------------------------------
1 | ## `assertGeDecimal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertGeDecimal(uint256 left, uint256 right, uint256 decimals) internal
7 | ```
8 |
9 | ```solidity
10 | function assertGeDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertGeDecimal(int256 left, int256 right, uint256 decimals) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertGeDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is greater than or equal to `right`.
24 |
25 | `left` and `right` are formatted with decimals in the revert string.
26 |
27 | Optionally includes an error message in the revert string.
28 |
29 | ### SEE ALSO
30 |
31 | - [`assertGe`](/reference/forge-std/assertGe.mdx)
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertGt.mdx:
--------------------------------------------------------------------------------
1 | ## `assertGt`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertGt(uint256 left, uint256 right) internal;
7 | ```
8 |
9 | ```solidity
10 | function assertGt(uint256 left, uint256 right, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertGt(int256 left, int256 right) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertGt(int256 left, int256 right, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is strictly greater than `right`.
24 |
25 | Optionally includes an error message in the revert string.
26 |
27 | ### SEE ALSO
28 |
29 | - [`assertGtDecimal`](/reference/forge-std/assertGtDecimal.mdx)
30 | - [`assertGe`](/reference/forge-std/assertGe.mdx)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertGtDecimal.mdx:
--------------------------------------------------------------------------------
1 | ## `assertGtDecimal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertGtDecimal(uint256 left, uint256 right, uint256 decimals) internal
7 | ```
8 |
9 | ```solidity
10 | function assertGtDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertGtDecimal(int256 left, int256 right, uint256 decimals) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertGtDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is strictly greater than `right`.
24 |
25 | `left` and `right` are formatted with decimals in the revert string.
26 |
27 | Optionally includes an error message in the revert string.
28 |
29 | ### SEE ALSO
30 |
31 | - [`assertGt`](/reference/forge-std/assertGt.mdx)
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertLe.mdx:
--------------------------------------------------------------------------------
1 | ## `assertLe`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertLe(uint256 left, uint256 right) internal;
7 | ```
8 |
9 | ```solidity
10 | function assertLe(uint256 left, uint256 right, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertLe(int256 left, int256 right) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertLe(int256 left, int256 right, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is less than or equal to `right`.
24 |
25 | Optionally includes an error message in the revert string.
26 |
27 | ### SEE ALSO
28 |
29 | - [`assertLeDecimal`](/reference/forge-std/assertLeDecimal.mdx)
30 | - [`assertLt`](/reference/forge-std/assertLt.mdx)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertLeDecimal.mdx:
--------------------------------------------------------------------------------
1 | ## `assertLeDecimal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertLeDecimal(uint256 left, uint256 right, uint256 decimals) internal
7 | ```
8 |
9 | ```solidity
10 | function assertLeDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertLeDecimal(int256 left, int256 right, uint256 decimals) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertLeDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is less than or equal to `right`.
24 |
25 | `left` and `right` are formatted with decimals in the revert string.
26 |
27 | Optionally includes an error message in the revert string.
28 |
29 | ### SEE ALSO
30 |
31 | - [`assertLe`](/reference/forge-std/assertLe.mdx)
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertLt.mdx:
--------------------------------------------------------------------------------
1 | ## `assertLt`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertLt(uint256 left, uint256 right) internal;
7 | ```
8 |
9 | ```solidity
10 | function assertLt(uint256 left, uint256 right, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertLt(int256 left, int256 right) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertLt(int256 left, int256 right, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is strictly less than `right`.
24 |
25 | Optionally includes an error message in the revert string.
26 |
27 | ### SEE ALSO
28 |
29 | - [`assertLtDecimal`](/reference/forge-std/assertLtDecimal.mdx)
30 | - [`assertLe`](/reference/forge-std/assertLe.mdx)
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertLtDecimal.mdx:
--------------------------------------------------------------------------------
1 | ## `assertLtDecimal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertLtDecimal(uint256 left, uint256 right, uint256 decimals) internal
7 | ```
8 |
9 | ```solidity
10 | function assertLtDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertLtDecimal(int256 left, int256 right, uint256 decimals) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertLtDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is strictly less than `right`.
24 |
25 | `left` and `right` are formatted with decimals in the revert string.
26 |
27 | Optionally includes an error message in the revert string.
28 |
29 | ### SEE ALSO
30 |
31 | - [`assertLt`](/reference/forge-std/assertLt.mdx)
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertNotEqDecimal.mdx:
--------------------------------------------------------------------------------
1 | ## `assertNotEqDecimal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals) internal
7 | ```
8 |
9 | ```solidity
10 | function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal;
11 | ```
12 |
13 | ```solidity
14 | function assertNotEqDecimal(int256 left, int256 right, uint256 decimals) internal;
15 | ```
16 |
17 | ```solidity
18 | function assertNotEqDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal;
19 | ```
20 |
21 | ### Description
22 |
23 | Asserts `left` is not equal to `right`.
24 |
25 | `left` and `right` are formatted with decimals in the revert string.
26 |
27 | Optionally includes an error message in the revert string.
28 |
29 | ### SEE ALSO
30 |
31 | - [`assertNotEq`](/reference/forge-std/assertNotEq.mdx)
32 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertTrue.mdx:
--------------------------------------------------------------------------------
1 | ## `assertTrue`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assertTrue(bool data) internal;
7 | ```
8 |
9 | ```solidity
10 | function assertTrue(bool data, string memory err) internal;
11 | ```
12 |
13 | ### Description
14 |
15 | Asserts `data` is true.
16 |
17 | Optionally includes an error message in the revert string.
18 |
19 | ### Examples
20 |
21 | ```solidity
22 | bool success = contract.fun();
23 | assertTrue(success);
24 | ```
25 |
26 | ### SEE ALSO
27 |
28 | - [`assertFalse`](/reference/forge-std/assertFalse.mdx)
29 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assertionError.mdx:
--------------------------------------------------------------------------------
1 | ## `assertionError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.assertionError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when an `assert` fails.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/assume-payable.mdx:
--------------------------------------------------------------------------------
1 | ## `assumePayable`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function assumePayable(address addr) public;
7 | ```
8 |
9 | ### Description
10 |
11 | Uses [`assume`](/reference/cheatcodes/assume.mdx) to filter addresses that reject Ether transfers.
12 |
13 | This makes an external call to the specified `addr` with a no calldata and checks `assume` against the success of the call.
14 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/bound.mdx:
--------------------------------------------------------------------------------
1 | ## `bound`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function bound(uint256 x, uint256 min, uint256 max) public returns (uint256 result);
7 | ```
8 |
9 | ### Description
10 |
11 | A mathematical function for wrapping inputs of fuzz tests into a certain range.
12 |
13 | You can use it instead of the `assume` cheatcode to get better performance in some cases. Read more [here](/reference/cheatcodes/assume.mdx).
14 |
15 | ### Examples
16 |
17 | ```solidity
18 | input = bound(input, 99, 101);
19 | ```
20 |
21 | Returns `99` for input `0`.
22 |
23 |
24 | Returns `100` for input `1`.
25 |
26 | Returns `101` for input `2`.
27 |
28 | Returns `99` for input `3`.
29 |
30 | And so on.
31 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/change-prank.mdx:
--------------------------------------------------------------------------------
1 | ## `changePrank`
2 |
3 | ### Status
4 |
5 | `changePrank` is deprecated.
6 |
7 | ### Signature
8 |
9 | ```solidity
10 | function changePrank(address who) internal;
11 | ```
12 |
13 | ### Description
14 |
15 | Stops the active prank with `stopPrank` and passes address to `startPrank`.
16 |
17 | Useful for starting a global prank in the `setUp` function and deactivating it in certain tests.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/checked_write.mdx:
--------------------------------------------------------------------------------
1 | ## `checked_write`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function checked_write(StdStorage storage self, address who) internal;
7 | ```
8 |
9 | ```solidity
10 | function checked_write(StdStorage storage self, uint256 amt) internal;
11 | ```
12 |
13 | ```solidity
14 | function checked_write(StdStorage storage self, bool write) internal;
15 | ```
16 |
17 | ```solidity
18 | function checked_write(StdStorage storage self, bytes32 set) internal;
19 | ```
20 |
21 | ```solidity
22 | function checked_write_int(StdStorage storage self, int256 val) internal;
23 | ```
24 |
25 | ### Description
26 |
27 | Sets the data to be written to the storage slot(s).
28 |
29 | Reverts with a message if unsuccessful.
30 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/compute-create-address.mdx:
--------------------------------------------------------------------------------
1 | ## `computeCreateAddress`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function computeCreateAddress(address deployer, uint256 nonce) internal pure returns (address)
7 | ```
8 |
9 | ### Description
10 |
11 | Compute the address a contract will be deployed at for a given deployer address and nonce. Useful to precalculate the address a contract **will** be deployed at.
12 |
13 | ### Example
14 |
15 | ```solidity
16 | address governanceAddress = computeCreateAddress(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, 1);
17 |
18 | // this contract requires a governance contract which hasn't been deployed yet
19 | Contract contract = new Contract(governanceAddress);
20 | // now we deploy it
21 | Governance governance = new Governance(contract);
22 |
23 | // assuming `contract` has a `governance()` accessor
24 | assertEq(governanceAddress, address(governance)); // [PASS]
25 | ```
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/deal.mdx:
--------------------------------------------------------------------------------
1 | ## `deal`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function deal(address to, uint256 give) public;
7 | ```
8 |
9 | ```solidity
10 | function deal(address token, address to, uint256 give) public;
11 | ```
12 |
13 | ```solidity
14 | function deal(address token, address to, uint256 give, bool adjust) public;
15 | ```
16 |
17 | ### Description
18 |
19 | A wrapper around the [`deal`](/reference/cheatcodes/deal.mdx) cheatcode that also works for most ERC-20 tokens.
20 |
21 | If the alternative signature of `deal` is used, adjusts the token's total supply after setting the balance.
22 |
23 | ### Examples
24 |
25 | ```solidity
26 | deal(address(dai), alice, 10000e18);
27 | assertEq(dai.balanceOf(alice), 10000e18);
28 | ```
29 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/delta.mdx:
--------------------------------------------------------------------------------
1 | ## `delta`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function delta(uint256 a, uint256 b) internal pure returns (uint256)
7 | ```
8 |
9 | ```solidity
10 | function delta(int256 a, int256 b) internal pure returns (uint256)
11 | ```
12 |
13 | ### Description
14 |
15 | Returns the difference between two numbers in absolute value.
16 |
17 | ### Example
18 |
19 | ```solidity
20 | uint256 four = stdMath.delta(-1, 3);
21 | ```
22 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/depth.mdx:
--------------------------------------------------------------------------------
1 | ## `depth`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage);
7 | ```
8 |
9 | ### Description
10 |
11 | Sets the position of the value in the `tuple` (e.g. inside a `struct`).
12 |
13 | Default value: `uint256(0)`
14 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/divisionError.mdx:
--------------------------------------------------------------------------------
1 | ## `divisionError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.divisionError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when a division fails, e.g. division by zero.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/enable_packed_slots.mdx:
--------------------------------------------------------------------------------
1 | ## `enable_packed_slots`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function enable_packed_slots(StdStorage storage self) internal returns (StdStorage storage);
7 | ```
8 |
9 | ### Description
10 |
11 | Enables the usage of packed storage slots
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | // Write arbitrary balances even on gas-optimized contracts like AUSD
17 | stdstore
18 | .enable_packed_slots()
19 | .target(_tokenAddress)
20 | .sig("balanceOf(address)")
21 | .with_key(_to)
22 | .checked_write(
23 | _amount
24 | );
25 | ```
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/encodeStorageError.mdx:
--------------------------------------------------------------------------------
1 | ## `encodeStorageError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.encodeStorageError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when trying to access data in storage that is corrupted. Data cannot be corrupted unless assembly had been used.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/enumConversionError.mdx:
--------------------------------------------------------------------------------
1 | ## `enumConversionError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.enumConversionError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when trying to convert a number to a variant of an enum, if the number is larger than the number of variants in the enum (counting from 0).
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/fail.mdx:
--------------------------------------------------------------------------------
1 | ## `fail`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function fail(string memory err) internal virtual;
7 | ```
8 |
9 | ### Description
10 |
11 | Fail a test with a message if a certain branch or execution point is hit.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | function test() external {
17 | for(uint256 place; place < 10; ++i){
18 | if(game.leaderboard(place) == address(this)) return;
19 | }
20 | fail("Not in the top 10.");
21 | }
22 | ```
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/find.mdx:
--------------------------------------------------------------------------------
1 | ## `find`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function find(StdStorage storage self) internal returns (uint256);
7 | ```
8 |
9 | ### Description
10 |
11 | Finds an arbitrary storage slot given [`target`](/reference/forge-std/target.mdx), [`sig`](/reference/forge-std/sig.mdx), [`with_key`](/reference/forge-std/with_key.mdx)(s), and [`depth`](/reference/forge-std/depth.mdx).
12 |
13 | Reverts with a message if unsuccessful.
14 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/hoax.mdx:
--------------------------------------------------------------------------------
1 | ## `hoax`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function hoax(address who) public;
7 | ```
8 |
9 | ```solidity
10 | function hoax(address who, uint256 give) public;
11 | ```
12 |
13 | ```solidity
14 | function hoax(address who, address origin) public;
15 | ```
16 |
17 | ```solidity
18 | function hoax(address who, address origin, uint256 give) public;
19 | ```
20 |
21 | ### Description
22 |
23 | Sets up a [`prank`](/reference/cheatcodes/prank.mdx) from an address that has some ether.
24 |
25 | If the balance is not specified, it will be set to 2^128 wei.
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/indexOOBError.mdx:
--------------------------------------------------------------------------------
1 | ## `indexOOBError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.indexOOBError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when trying to access an element of an array that is out of bounds.
12 |
13 | Will not work for empty arrays in external contracts. For those, use `expectRevert` without any arguments.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/make-addr-and-key.mdx:
--------------------------------------------------------------------------------
1 | ## `makeAddrAndKey`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function makeAddrAndKey(string memory name) internal returns(address addr, uint256 privateKey);
7 | ```
8 |
9 | ### Description
10 |
11 | Creates an address and private key derived from the provided `name`.
12 |
13 | A [`label`](/reference/cheatcodes/label.mdx) is created for the derived address with the provided `name` used as the label value.
14 |
15 | ### Examples
16 |
17 | ```solidity
18 | (address alice, uint256 key) = makeAddrAndKey("alice");
19 | emit log_address(alice); // 0x328809bc894f92807417d2dad6b7c998c1afdac6
20 | emit log_uint(key); // 70564938991660933374592024341600875602376452319261984317470407481576058979585
21 | ```
22 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/make-addr.mdx:
--------------------------------------------------------------------------------
1 | ## `makeAddr`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function makeAddr(string memory name) internal returns(address addr);
7 | ```
8 |
9 | ### Description
10 |
11 | Creates an address derived from the provided `name`.
12 |
13 | A [`label`](/reference/cheatcodes/label.mdx) is created for the derived address with the provided `name` used as the label value.
14 |
15 | ### Examples
16 |
17 | ```solidity
18 | address alice = makeAddr("alice");
19 | emit log_address(alice); // 0x328809bc894f92807417d2dad6b7c998c1afdac6
20 | ```
21 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/memOverflowError.mdx:
--------------------------------------------------------------------------------
1 | ## `memOverflowError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.memOverflowError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when trying to allocate a dynamic memory array with more than 2^64-1 items.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/percentDelta.mdx:
--------------------------------------------------------------------------------
1 | ## `percentDelta`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function percentDelta(uint256 a, uint256 b) internal pure returns (uint256)
7 | ```
8 |
9 | ```solidity
10 | function percentDelta(int256 a, int256 b) internal pure returns (uint256)
11 | ```
12 |
13 | ### Description
14 |
15 | Returns the difference between two numbers in percentage, where `1e18` is 100%.
16 | More precisely, `percentDelta(a, b)` computes `abs((a-b) / b) * 1e18`.
17 |
18 | ### Example
19 |
20 | ```solidity
21 | uint256 percent150 = stdMath.percentDelta(uint256(125), 50);
22 | uint256 percent60 = stdMath.percentDelta(uint256(50), 125);
23 | ```
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/popError.mdx:
--------------------------------------------------------------------------------
1 | ## `popError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.popError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when trying to pop an element off of an empty array.
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/read.mdx:
--------------------------------------------------------------------------------
1 | ## `read`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function read_bytes32(StdStorage storage self) internal returns (bytes32);
7 | ```
8 |
9 | ```solidity
10 | function read_bool(StdStorage storage self) internal returns (bool);
11 | ```
12 |
13 | ```solidity
14 | function read_address(StdStorage storage self) internal returns (address);
15 | ```
16 |
17 | ```solidity
18 | function read_uint(StdStorage storage self) internal returns (uint256);
19 | ```
20 |
21 | ```solidity
22 | function read_int(StdStorage storage self) internal returns (int256);
23 | ```
24 |
25 | ### Description
26 |
27 | Reads the value from the storage slot as `bytes32`, `bool`, `address`, `uint256`, or `int256`.
28 |
29 | Reverts with a message if unsuccessful.
30 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/rewind.mdx:
--------------------------------------------------------------------------------
1 | ## `rewind`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function rewind(uint256 time) public;
7 | ```
8 |
9 | ### Description
10 |
11 | Rewinds `block.timestamp` by the specified number of seconds.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | assertEq(block.timestamp, 3600);
17 | rewind(3600);
18 | assertEq(block.timestamp, 0);
19 | ```
20 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/script-utils.mdx:
--------------------------------------------------------------------------------
1 | ## Script Utils
2 |
3 | - [`computeCreateAddress`](/reference/forge-std/compute-create-address.mdx)
4 | - [`deriveRememberKey`](/reference/forge-std/derive-remember-key.mdx)
5 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/sig.mdx:
--------------------------------------------------------------------------------
1 | ## `sig`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage);
7 | ```
8 |
9 | ```solidity
10 | function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage);
11 | ```
12 |
13 | ### Description
14 |
15 | Sets the 4-byte selector of the function to static call.
16 |
17 | Default value: `hex"00000000"`
18 |
19 | ### Examples
20 |
21 | ```solidity
22 | uint256 slot = stdstore
23 | .target(addr)
24 | .sig(addr.fun.selector)
25 | .with_key(1)
26 | .find();
27 | ```
28 |
29 | ```solidity
30 | uint256 slot = stdstore
31 | .target(addr)
32 | .sig("fun(uint256)")
33 | .with_key(1)
34 | .find();
35 | ```
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/skip.mdx:
--------------------------------------------------------------------------------
1 | ## `skip`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function skip(uint256 time) public;
7 | ```
8 |
9 | ### Description
10 |
11 | Skips forward `block.timestamp` by the specified number of seconds.
12 |
13 | ### Examples
14 |
15 | ```solidity
16 | assertEq(block.timestamp, 0);
17 | skip(3600);
18 | assertEq(block.timestamp, 3600);
19 | ```
20 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/startHoax.mdx:
--------------------------------------------------------------------------------
1 | ## `startHoax`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function startHoax(address who) public;
7 | ```
8 |
9 | ```solidity
10 | function startHoax(address who, uint256 give) public;
11 | ```
12 |
13 | ```solidity
14 | function startHoax(address who, address origin) public;
15 | ```
16 |
17 | ```solidity
18 | function startHoax(address who, address origin, uint256 give) public;
19 | ```
20 |
21 | ### Description
22 |
23 | Start a [perpetual `prank`](/reference/cheatcodes/start-prank.mdx) from an address that has some ether.
24 |
25 | If the balance is not specified, it will be set to 2^128 wei.
26 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/std-cheats.mdx:
--------------------------------------------------------------------------------
1 | ## Std Cheats
2 |
3 | - [`skip`](/reference/forge-std/skip.mdx)
4 | - [`rewind`](/reference/forge-std/rewind.mdx)
5 | - [`hoax`](/reference/forge-std/hoax.mdx)
6 | - [`startHoax`](/reference/forge-std/startHoax.mdx)
7 | - [`deal`](/reference/forge-std/deal.mdx)
8 | - [`deployCode`](/reference/forge-std/deployCode.mdx)
9 | - [`deployCodeTo`](/reference/forge-std/deployCodeTo.mdx)
10 | - [`bound`](/reference/forge-std/bound.mdx)
11 | - [`changePrank`](/reference/forge-std/change-prank.mdx)
12 | - [`makeAddr`](/reference/forge-std/make-addr.mdx)
13 | - [`makeAddrAndKey`](/reference/forge-std/make-addr-and-key.mdx)
14 | - [`noGasMetering`](/reference/forge-std/noGasMetering.mdx)
15 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/std-errors.mdx:
--------------------------------------------------------------------------------
1 | ## Std Errors
2 |
3 | - [`assertionError`](/reference/forge-std/assertionError.mdx)
4 | - [`arithmeticError`](/reference/forge-std/arithmeticError.mdx)
5 | - [`divisionError`](/reference/forge-std/divisionError.mdx)
6 | - [`enumConversionError`](/reference/forge-std/enumConversionError.mdx)
7 | - [`encodeStorageError`](/reference/forge-std/encodeStorageError.mdx)
8 | - [`popError`](/reference/forge-std/popError.mdx)
9 | - [`indexOOBError`](/reference/forge-std/indexOOBError.mdx)
10 | - [`memOverflowError`](/reference/forge-std/memOverflowError.mdx)
11 | - [`zeroVarError`](/reference/forge-std/zeroVarError.mdx)
12 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/std-math.mdx:
--------------------------------------------------------------------------------
1 | ## Std Math
2 |
3 | - [`abs`](/reference/forge-std/abs.mdx)
4 | - [`delta`](/reference/forge-std/delta.mdx)
5 | - [`percentDelta`](/reference/forge-std/percentDelta.mdx)
6 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/target.mdx:
--------------------------------------------------------------------------------
1 | ## `target`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function target(StdStorage storage self, address _target) internal returns (StdStorage storage);
7 | ```
8 |
9 | ### Description
10 |
11 | Sets the address of the contract.
12 |
13 | Default value: `address(0)`
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/with_key.mdx:
--------------------------------------------------------------------------------
1 | ## `with_key`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | function with_key(StdStorage storage self, address who) internal returns (StdStorage storage);
7 | ```
8 |
9 | ```solidity
10 | function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage);
11 | ```
12 |
13 | ```solidity
14 | function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage);
15 | ```
16 |
17 | ### Description
18 |
19 | Passes an argument to the function.
20 |
21 | Can be used multiple times to pass multiple arguments. The order matters.
22 |
23 | ### Examples
24 |
25 | ```solidity
26 | uint256 slot = stdstore
27 | .target(addr)
28 | .sig("fun(uint256,address)")
29 | .with_key(1)
30 | .with_key(address(this))
31 | .find();
32 | ```
33 |
--------------------------------------------------------------------------------
/vocs/docs/pages/reference/forge-std/zeroVarError.mdx:
--------------------------------------------------------------------------------
1 | ## `zeroVarError`
2 |
3 | ### Signature
4 |
5 | ```solidity
6 | stdError.zeroVarError
7 | ```
8 |
9 | ### Description
10 |
11 | The internal Solidity error when trying to call a function via a function pointer that has not been initialized.
--------------------------------------------------------------------------------
/vocs/docs/public/_redirects:
--------------------------------------------------------------------------------
1 | /getting-started/installation /introduction/installation
2 | /getting-started/introduction /introduction/overview
3 | /getting-started/first-steps /introduction/getting-started
4 |
5 | /reference/forge/:id /forge/reference/:id
6 |
7 | /cheatcodes /reference/cheatcodes/overview
8 | /cheatcodes/:id /reference/cheatcodes/:id
9 |
10 | /guides/v1.0-migration /misc/v1.0-migration
--------------------------------------------------------------------------------
/vocs/docs/public/anvil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/anvil.png
--------------------------------------------------------------------------------
/vocs/docs/public/breakpoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/breakpoint.png
--------------------------------------------------------------------------------
/vocs/docs/public/cropped-ripped-jesus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/cropped-ripped-jesus.png
--------------------------------------------------------------------------------
/vocs/docs/public/debugger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/debugger.png
--------------------------------------------------------------------------------
/vocs/docs/public/foundry-banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/foundry-banner.png
--------------------------------------------------------------------------------
/vocs/docs/public/foundry-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/foundry-logo.png
--------------------------------------------------------------------------------
/vocs/docs/public/fuzzer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/fuzzer.png
--------------------------------------------------------------------------------
/vocs/docs/public/nft-tutorial/gas-report-oz-nft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/nft-tutorial/gas-report-oz-nft.png
--------------------------------------------------------------------------------
/vocs/docs/public/nft-tutorial/gas-report-solmate-nft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/nft-tutorial/gas-report-solmate-nft.png
--------------------------------------------------------------------------------
/vocs/docs/public/nft-tutorial/nft-tutorial-project-structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/nft-tutorial/nft-tutorial-project-structure.png
--------------------------------------------------------------------------------
/vocs/docs/public/og-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/og-image.png
--------------------------------------------------------------------------------
/vocs/docs/public/solidity-scripting/compile-successful.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/solidity-scripting/compile-successful.png
--------------------------------------------------------------------------------
/vocs/docs/public/solidity-scripting/contract-verified.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/solidity-scripting/contract-verified.png
--------------------------------------------------------------------------------
/vocs/docs/public/solidity-scripting/set-up-commands.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundry-rs/book/cc63fce37b980f10101d0b99a7fa79fabf1c9d31/vocs/docs/public/solidity-scripting/set-up-commands.png
--------------------------------------------------------------------------------
/vocs/docs/snippets/clone_contract/clone-meta:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ cat .clone.meta | jq
4 | // [!endregion command]
5 | // [!region output]
6 | {
7 | "path": "src/Contract.sol",
8 | "targetContract": "WETH9",
9 | "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
10 | "chainId": 1,
11 | "creationTransaction": "0xb95343413e459a0f97461812111254163ae53467855c0d73e0f1e7c5b8442fa3",
12 | "deployer": "0x4f26ffbe5f04ed43630fdc30a87638d53d0b0876",
13 | "constructorArguments": "0x",
14 | "storageLayout": {
15 | "storage": [],
16 | "types": {}
17 | }
18 | }
19 | // [!endregion output]
20 | // [!endregion all]
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/cast/cast-4byte-calldata:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ cast 4byte-decode 0x1F1F897F676d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e7
4 | // [!endregion command]
5 | // [!region output]
6 | 1) "fulfillRandomness(bytes32,uint256)"
7 | 0x676d000000000000000000000000000000000000000000000000000000000000
8 | 999
9 | // [!endregion output]
10 | // [!endregion all]
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/cast/cast-call:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ cast call 0x6b175474e89094c44da98b954eedeac495271d0f "totalSupply()(uint256)" --rpc-url https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf
4 | // [!endregion command]
5 | // [!region output]
6 | 3696884440995286197434703193 [3.696e27]
7 | // [!endregion output]
8 | // [!endregion all]
9 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/cheatcodes/forge-test-cheatcodes-expectrevert:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test --match-test test_IncrementAsOwner|test_IncrementAsNotOwner --match-path test/OwnerUpOnly.t.sol
4 | // [!endregion command]
5 | // [!region output]
6 | No files changed, compilation skipped
7 |
8 | Ran 1 test for test/OwnerUpOnly.t.sol:OwnerUpOnlyTest
9 | [PASS] test_IncrementAsOwner() (gas: 29808)
10 | Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 668.83µs (150.50µs CPU time)
11 |
12 | Ran 1 test suite in 125.08ms (668.83µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
13 | // [!endregion output]
14 | // [!endregion all]
15 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/cheatcodes/forge-test-simple:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test --match-test test_IncrementAsOwner
4 | // [!endregion command]
5 | // [!region output]
6 | Compiling 24 files with Solc 0.8.10
7 | Solc 0.8.10 finished in 582.81ms
8 | Compiler run successful!
9 |
10 | Ran 1 test for test/OwnerUpOnly.t.sol:OwnerUpOnlyTest
11 | [PASS] test_IncrementAsOwner() (gas: 29808)
12 | Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 729.92µs (165.83µs CPU time)
13 |
14 | Ran 1 test suite in 124.08ms (729.92µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
15 | // [!endregion output]
16 | // [!endregion all]
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/fuzz_testing/forge-test-fail-fuzz:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test --allow-failure
4 | // [!endregion command]
5 | // [!region output]
6 | Compiling 1 files with Solc 0.8.10
7 | Solc 0.8.10 finished in 538.28ms
8 | Compiler run successful!
9 |
10 | Ran 1 test for test/Safe.t.sol:SafeTest
11 | [FAIL: EvmError: Revert; counterexample: calldata=0x29facca7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe args=[115792089237316195423570985008687907853269984665640564039457584007913129639934 [1.157e77]]] testFuzz_Withdraw(uint256) (runs: 4, μ: 19884, ~: 19884)
12 | Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 3.53ms (3.00ms CPU time)
13 |
14 | Ran 1 test suite in 124.01ms (3.53ms CPU time): 0 tests passed, 1 failed, 0 skipped (1 total tests)
15 | // [!endregion output]
16 | // [!endregion all]
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/fuzz_testing/forge-test-no-fuzz:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test
4 | // [!endregion command]
5 | // [!region output]
6 | Compiling 24 files with Solc 0.8.10
7 | Solc 0.8.10 finished in 573.11ms
8 | Compiler run successful!
9 |
10 | Ran 1 test for test/Safe.t.sol:SafeTest
11 | [PASS] test_Withdraw() (gas: 19644)
12 | Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 920.67µs (376.00µs CPU time)
13 |
14 | Ran 1 test suite in 123.11ms (920.67µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
15 | // [!endregion output]
16 | // [!endregion all]
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/fuzz_testing/forge-test-success-fuzz:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test
4 | // [!endregion command]
5 | // [!region output]
6 | Compiling 1 files with Solc 0.8.10
7 | Solc 0.8.10 finished in 549.00ms
8 | Compiler run successful!
9 |
10 | Ran 1 test for test/Safe.t.sol:SafeTest
11 | [PASS] testFuzz_Withdraw(uint96) (runs: 257, μ: 19401, ~: 19923)
12 | Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 25.22ms (24.67ms CPU time)
13 |
14 | Ran 1 test suite in 124.27ms (25.22ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
15 | // [!endregion output]
16 | // [!endregion all]
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/hello_foundry/forge-build:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge build
4 | // [!endregion command]
5 | // [!region output]
6 | Compiling 23 files with Solc 0.8.29
7 | Solc 0.8.29 finished in 481.28ms
8 | Compiler run successful!
9 | // [!endregion output]
10 | // [!endregion all]
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/hello_foundry/forge-init:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge init hello_foundry
4 | // [!endregion command]
5 | // [!region output]
6 | Initializing /private/var/folders/x4/z46ytl8n5msgkg6dst5hwwhh0000gn/T/tmp.AkOjwj9xvM/hello_foundry...
7 | Installing forge-std in /private/var/folders/x4/z46ytl8n5msgkg6dst5hwwhh0000gn/T/tmp.AkOjwj9xvM/hello_foundry/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: None)
8 | Installed forge-std v1.9.7
9 | Initialized forge project
10 | // [!endregion output]
11 | // [!endregion all]
12 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/hello_foundry/forge-install:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge install vectorized/solady
4 | // [!endregion command]
5 | // [!region output]
6 | Installing solady in /private/var/folders/x4/z46ytl8n5msgkg6dst5hwwhh0000gn/T/tmp.AkOjwj9xvM/hello_foundry/lib/solady (url: Some("https://github.com/vectorized/solady"), tag: None)
7 | Installed solady v0.1.19
8 | // [!endregion output]
9 | // [!endregion all]
10 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/hello_foundry/forge-remappings:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge remappings
4 | // [!endregion command]
5 | // [!region output]
6 | forge-std/=lib/forge-std/src/
7 | solady/=lib/solady/src/
8 | // [!endregion output]
9 | // [!endregion all]
10 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/hello_foundry/forge-test:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test
4 | // [!endregion command]
5 | // [!region output]
6 | No files changed, compilation skipped
7 |
8 | Ran 2 tests for test/Counter.t.sol:CounterTest
9 | [PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 31965, ~: 32354)
10 | [PASS] test_Increment() (gas: 31851)
11 | Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 38.79ms (33.61ms CPU time)
12 |
13 | Ran 1 test suite in 137.49ms (38.79ms CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests)
14 | // [!endregion output]
15 | // [!endregion all]
16 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/hello_foundry/tree:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ tree . -d -L 1
4 | // [!endregion command]
5 | // [!region output]
6 | .
7 | ├── lib
8 | ├── script
9 | ├── src
10 | └── test
11 |
12 | 5 directories
13 | // [!endregion output]
14 | // [!endregion all]
15 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/hello_foundry/tree-with-files:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ tree . -L 3 -I output
4 | // [!endregion command]
5 | // [!region output]
6 | .
7 | ├── README.md
8 | ├── foundry.toml
9 | ├── lib
10 | │ └── forge-std
11 | │ ├── CONTRIBUTING.md
12 | │ ├── LICENSE-APACHE
13 | │ ├── LICENSE-MIT
14 | │ ├── README.md
15 | │ ├── foundry.toml
16 | │ ├── package.json
17 | │ ├── scripts
18 | │ ├── src
19 | │ └── test
20 | ├── script
21 | │ └── Counter.s.sol
22 | ├── src
23 | │ └── Counter.sol
24 | └── test
25 | └── Counter.t.sol
26 |
27 | 9 directories, 11 files
28 | // [!endregion output]
29 | // [!endregion all]
30 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/test_filters/forge-test-match-contract-and-test:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test --match-contract ComplicatedContractTest --match-test test_Deposit
4 | // [!endregion command]
5 | // [!region output]
6 | Compiling 24 files with Solc 0.8.10
7 | Solc 0.8.10 finished in 587.40ms
8 | Compiler run successful!
9 |
10 | Ran 2 tests for test/ComplicatedContract.t.sol:ComplicatedContractTest
11 | [PASS] test_DepositERC20() (gas: 179207)
12 | [PASS] test_DepositETH() (gas: 107628)
13 | Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 4.29ms (6.23ms CPU time)
14 |
15 | Ran 1 test suite in 122.03ms (4.29ms CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests)
16 | // [!endregion output]
17 | // [!endregion all]
18 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/output/test_filters/forge-test-match-path:
--------------------------------------------------------------------------------
1 | // [!region all]
2 | // [!region command]
3 | $ forge test --match-path test/ContractB.t.sol
4 | // [!endregion command]
5 | // [!region output]
6 | Compiling 1 files with Solc 0.8.10
7 | Solc 0.8.10 finished in 543.88ms
8 | Compiler run successful!
9 |
10 | Ran 1 test for test/ContractB.t.sol:ContractBTest
11 | [PASS] testExample() (gas: 257)
12 | Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 618.25µs (135.42µs CPU time)
13 |
14 | Ran 1 test suite in 129.13ms (618.25µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
15 | // [!endregion output]
16 | // [!endregion all]
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/README.md:
--------------------------------------------------------------------------------
1 | ## Projects
2 |
3 | These projects are used to auto-generate CLI output, and for source snippets, throughout the book.
4 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/foundry.toml:
--------------------------------------------------------------------------------
1 | [profile.default]
2 | src = 'src'
3 | out = 'out'
4 | libs = ['lib']
5 |
6 | # See more config options https://github.com/foundry-rs/foundry/tree/master/crates/config
7 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/.gitattributes:
--------------------------------------------------------------------------------
1 | src/Vm.sol linguist-generated
2 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/.github/workflows/sync.yml:
--------------------------------------------------------------------------------
1 | name: Sync Release Branch
2 |
3 | on:
4 | release:
5 | types:
6 | - created
7 |
8 | jobs:
9 | sync-release-branch:
10 | runs-on: ubuntu-latest
11 | if: startsWith(github.event.release.tag_name, 'v1')
12 | steps:
13 | - name: Check out the repo
14 | uses: actions/checkout@v3
15 | with:
16 | fetch-depth: 0
17 | ref: v1
18 |
19 | - name: Configure Git
20 | run: |
21 | git config user.name github-actions[bot]
22 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com
23 |
24 | - name: Sync Release Branch
25 | run: |
26 | git fetch --tags
27 | git checkout v1
28 | git reset --hard ${GITHUB_REF}
29 | git push --force
30 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/.gitignore:
--------------------------------------------------------------------------------
1 | cache/
2 | out/
3 | .vscode
4 | .idea
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "lib/ds-test"]
2 | path = lib/ds-test
3 | url = https://github.com/dapphub/ds-test
4 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/foundry.toml:
--------------------------------------------------------------------------------
1 | [profile.default]
2 | fs_permissions = [{ access = "read-write", path = "./"}]
3 |
4 | [rpc_endpoints]
5 | # The RPC URLs are modified versions of the default for testing initialization.
6 | mainnet = "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3" # Different API key.
7 | optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash.
8 | arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash.
9 | needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}"
10 |
11 | [fmt]
12 | # These are all the `forge fmt` defaults.
13 | line_length = 120
14 | tab_width = 4
15 | bracket_spacing = false
16 | int_types = 'long'
17 | multiline_func_header = 'attributes_first'
18 | quote_style = 'double'
19 | number_underscore = 'preserve'
20 | single_line_statement_blocks = 'preserve'
21 | ignore = ["src/console.sol", "src/console2.sol"]
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/lib/ds-test/.gitignore:
--------------------------------------------------------------------------------
1 | /.dapple
2 | /build
3 | /out
4 | /cache/
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/lib/ds-test/Makefile:
--------------------------------------------------------------------------------
1 | all:; dapp build
2 |
3 | test:
4 | -dapp --use solc:0.4.23 build
5 | -dapp --use solc:0.4.26 build
6 | -dapp --use solc:0.5.17 build
7 | -dapp --use solc:0.6.12 build
8 | -dapp --use solc:0.7.5 build
9 |
10 | demo:
11 | DAPP_SRC=demo dapp --use solc:0.7.5 build
12 | -hevm dapp-test --verbose 3
13 |
14 | .PHONY: test demo
15 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/lib/ds-test/default.nix:
--------------------------------------------------------------------------------
1 | { solidityPackage, dappsys }: solidityPackage {
2 | name = "ds-test";
3 | src = ./src;
4 | }
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/lib/ds-test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ds-test",
3 | "version": "1.0.0",
4 | "description": "Assertions, equality checks and other test helpers ",
5 | "bugs": "https://github.com/dapphub/ds-test/issues",
6 | "license": "GPL-3.0",
7 | "author": "Contributors to ds-test",
8 | "files": [
9 | "src/*"
10 | ],
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/dapphub/ds-test.git"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "forge-std",
3 | "version": "1.7.6",
4 | "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.",
5 | "homepage": "https://book.getfoundry.sh/forge/forge-std",
6 | "bugs": "https://github.com/foundry-rs/forge-std/issues",
7 | "license": "(Apache-2.0 OR MIT)",
8 | "author": "Contributors to Forge Standard Library",
9 | "files": [
10 | "src/**/*"
11 | ],
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/foundry-rs/forge-std.git"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/src/Script.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | // 💬 ABOUT
5 | // Forge Std's default Script.
6 |
7 | // 🧩 MODULES
8 | import {console} from "./console.sol";
9 | import {console2} from "./console2.sol";
10 | import {safeconsole} from "./safeconsole.sol";
11 | import {StdChains} from "./StdChains.sol";
12 | import {StdCheatsSafe} from "./StdCheats.sol";
13 | import {stdJson} from "./StdJson.sol";
14 | import {stdMath} from "./StdMath.sol";
15 | import {StdStorage, stdStorageSafe} from "./StdStorage.sol";
16 | import {StdStyle} from "./StdStyle.sol";
17 | import {StdUtils} from "./StdUtils.sol";
18 | import {VmSafe} from "./Vm.sol";
19 |
20 | // 📦 BOILERPLATE
21 | import {ScriptBase} from "./Base.sol";
22 |
23 | // ⭐️ SCRIPT
24 | abstract contract Script is ScriptBase, StdChains, StdCheatsSafe, StdUtils {
25 | // Note: IS_SCRIPT() must return true.
26 | bool public IS_SCRIPT = true;
27 | }
28 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/src/interfaces/IERC165.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2;
3 |
4 | interface IERC165 {
5 | /// @notice Query if a contract implements an interface
6 | /// @param interfaceID The interface identifier, as specified in ERC-165
7 | /// @dev Interface identification is specified in ERC-165. This function
8 | /// uses less than 30,000 gas.
9 | /// @return `true` if the contract implements `interfaceID` and
10 | /// `interfaceID` is not 0xffffffff, `false` otherwise
11 | function supportsInterface(bytes4 interfaceID) external view returns (bool);
12 | }
13 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/test/Vm.t.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.8.0 <0.9.0;
3 |
4 | import {Test} from "../src/Test.sol";
5 | import {Vm, VmSafe} from "../src/Vm.sol";
6 |
7 | contract VmTest is Test {
8 | // This test ensures that functions are never accidentally removed from a Vm interface, or
9 | // inadvertently moved between Vm and VmSafe. This test must be updated each time a function is
10 | // added to or removed from Vm or VmSafe.
11 | function test_interfaceId() public {
12 | assertEq(type(VmSafe).interfaceId, bytes4(0x01ec102d), "VmSafe");
13 | assertEq(type(Vm).interfaceId, bytes4(0xaf68a970), "Vm");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/test/compilation/CompilationScript.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Script.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationScript is Script {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/test/compilation/CompilationScriptBase.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Script.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationScriptBase is ScriptBase {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/test/compilation/CompilationTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Test.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationTest is Test {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/cheatcodes/lib/forge-std/test/compilation/CompilationTestBase.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Test.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationTestBase is TestBase {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/cache/fuzz/failures:
--------------------------------------------------------------------------------
1 | # Seeds for failure cases proptest has generated in the past. It is
2 | # automatically read and these particular cases re-run before any
3 | # novel cases are generated.
4 | #
5 | # It is recommended to check this file in to source control so that
6 | # everyone who runs the test benefits from these saved cases.
7 | cc a7864044f3f630c3f7588c6656e8d4a7f455175094aac05f20a18392b6f8e497 # shrinks to 0x29facca7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe
8 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/cache/test-failures:
--------------------------------------------------------------------------------
1 | testFuzz_Withdraw
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/foundry.toml:
--------------------------------------------------------------------------------
1 | [profile.default]
2 | src = 'src'
3 | out = 'out'
4 | libs = ['lib']
5 |
6 | # See more config options https://github.com/gakonst/foundry/tree/master/config
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/.gitattributes:
--------------------------------------------------------------------------------
1 | src/Vm.sol linguist-generated
2 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/.github/workflows/sync.yml:
--------------------------------------------------------------------------------
1 | name: Sync Release Branch
2 |
3 | on:
4 | release:
5 | types:
6 | - created
7 |
8 | jobs:
9 | sync-release-branch:
10 | runs-on: ubuntu-latest
11 | if: startsWith(github.event.release.tag_name, 'v1')
12 | steps:
13 | - name: Check out the repo
14 | uses: actions/checkout@v3
15 | with:
16 | fetch-depth: 0
17 | ref: v1
18 |
19 | - name: Configure Git
20 | run: |
21 | git config user.name github-actions[bot]
22 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com
23 |
24 | - name: Sync Release Branch
25 | run: |
26 | git fetch --tags
27 | git checkout v1
28 | git reset --hard ${GITHUB_REF}
29 | git push --force
30 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/.gitignore:
--------------------------------------------------------------------------------
1 | cache/
2 | out/
3 | .vscode
4 | .idea
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "lib/ds-test"]
2 | path = lib/ds-test
3 | url = https://github.com/dapphub/ds-test
4 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/foundry.toml:
--------------------------------------------------------------------------------
1 | [profile.default]
2 | fs_permissions = [{ access = "read-write", path = "./"}]
3 |
4 | [rpc_endpoints]
5 | # The RPC URLs are modified versions of the default for testing initialization.
6 | mainnet = "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3" # Different API key.
7 | optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash.
8 | arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash.
9 | needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}"
10 |
11 | [fmt]
12 | # These are all the `forge fmt` defaults.
13 | line_length = 120
14 | tab_width = 4
15 | bracket_spacing = false
16 | int_types = 'long'
17 | multiline_func_header = 'attributes_first'
18 | quote_style = 'double'
19 | number_underscore = 'preserve'
20 | single_line_statement_blocks = 'preserve'
21 | ignore = ["src/console.sol", "src/console2.sol"]
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/lib/ds-test/.gitignore:
--------------------------------------------------------------------------------
1 | /.dapple
2 | /build
3 | /out
4 | /cache/
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/lib/ds-test/Makefile:
--------------------------------------------------------------------------------
1 | all:; dapp build
2 |
3 | test:
4 | -dapp --use solc:0.4.23 build
5 | -dapp --use solc:0.4.26 build
6 | -dapp --use solc:0.5.17 build
7 | -dapp --use solc:0.6.12 build
8 | -dapp --use solc:0.7.5 build
9 |
10 | demo:
11 | DAPP_SRC=demo dapp --use solc:0.7.5 build
12 | -hevm dapp-test --verbose 3
13 |
14 | .PHONY: test demo
15 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/lib/ds-test/default.nix:
--------------------------------------------------------------------------------
1 | { solidityPackage, dappsys }: solidityPackage {
2 | name = "ds-test";
3 | src = ./src;
4 | }
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/lib/ds-test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ds-test",
3 | "version": "1.0.0",
4 | "description": "Assertions, equality checks and other test helpers ",
5 | "bugs": "https://github.com/dapphub/ds-test/issues",
6 | "license": "GPL-3.0",
7 | "author": "Contributors to ds-test",
8 | "files": [
9 | "src/*"
10 | ],
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/dapphub/ds-test.git"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "forge-std",
3 | "version": "1.7.6",
4 | "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.",
5 | "homepage": "https://book.getfoundry.sh/forge/forge-std",
6 | "bugs": "https://github.com/foundry-rs/forge-std/issues",
7 | "license": "(Apache-2.0 OR MIT)",
8 | "author": "Contributors to Forge Standard Library",
9 | "files": [
10 | "src/**/*"
11 | ],
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/foundry-rs/forge-std.git"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/src/Script.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | // 💬 ABOUT
5 | // Forge Std's default Script.
6 |
7 | // 🧩 MODULES
8 | import {console} from "./console.sol";
9 | import {console2} from "./console2.sol";
10 | import {safeconsole} from "./safeconsole.sol";
11 | import {StdChains} from "./StdChains.sol";
12 | import {StdCheatsSafe} from "./StdCheats.sol";
13 | import {stdJson} from "./StdJson.sol";
14 | import {stdMath} from "./StdMath.sol";
15 | import {StdStorage, stdStorageSafe} from "./StdStorage.sol";
16 | import {StdStyle} from "./StdStyle.sol";
17 | import {StdUtils} from "./StdUtils.sol";
18 | import {VmSafe} from "./Vm.sol";
19 |
20 | // 📦 BOILERPLATE
21 | import {ScriptBase} from "./Base.sol";
22 |
23 | // ⭐️ SCRIPT
24 | abstract contract Script is ScriptBase, StdChains, StdCheatsSafe, StdUtils {
25 | // Note: IS_SCRIPT() must return true.
26 | bool public IS_SCRIPT = true;
27 | }
28 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/src/interfaces/IERC165.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2;
3 |
4 | interface IERC165 {
5 | /// @notice Query if a contract implements an interface
6 | /// @param interfaceID The interface identifier, as specified in ERC-165
7 | /// @dev Interface identification is specified in ERC-165. This function
8 | /// uses less than 30,000 gas.
9 | /// @return `true` if the contract implements `interfaceID` and
10 | /// `interfaceID` is not 0xffffffff, `false` otherwise
11 | function supportsInterface(bytes4 interfaceID) external view returns (bool);
12 | }
13 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/test/Vm.t.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.8.0 <0.9.0;
3 |
4 | import {Test} from "../src/Test.sol";
5 | import {Vm, VmSafe} from "../src/Vm.sol";
6 |
7 | contract VmTest is Test {
8 | // This test ensures that functions are never accidentally removed from a Vm interface, or
9 | // inadvertently moved between Vm and VmSafe. This test must be updated each time a function is
10 | // added to or removed from Vm or VmSafe.
11 | function test_interfaceId() public {
12 | assertEq(type(VmSafe).interfaceId, bytes4(0x01ec102d), "VmSafe");
13 | assertEq(type(Vm).interfaceId, bytes4(0xaf68a970), "Vm");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/test/compilation/CompilationScript.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Script.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationScript is Script {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/test/compilation/CompilationScriptBase.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Script.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationScriptBase is ScriptBase {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/test/compilation/CompilationTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Test.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationTest is Test {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/lib/forge-std/test/compilation/CompilationTestBase.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Test.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationTestBase is TestBase {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/fuzz_testing/test/Safe.t.sol.1:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 | // [!region all]
3 | pragma solidity 0.8.10;
4 |
5 | import {Test} from "forge-std/Test.sol";
6 |
7 | contract Safe {
8 | receive() external payable {}
9 |
10 | function withdraw() external {
11 | payable(msg.sender).transfer(address(this).balance);
12 | }
13 | }
14 |
15 | contract SafeTest is Test {
16 | Safe safe;
17 |
18 | // Needed so the test contract itself can receive ether
19 | // when withdrawing
20 | receive() external payable {}
21 |
22 | function setUp() public {
23 | safe = new Safe();
24 | }
25 |
26 | function test_Withdraw() public {
27 | payable(address(safe)).transfer(1 ether);
28 | uint256 preBalance = address(this).balance;
29 | safe.withdraw();
30 | uint256 postBalance = address(this).balance;
31 | assertEq(preBalance + 1 ether, postBalance);
32 | }
33 | }
34 | // [!endregion all]
35 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/foundry.toml:
--------------------------------------------------------------------------------
1 | [profile.default]
2 | src = 'src'
3 | out = 'out'
4 | libs = ['lib']
5 |
6 | # See more config options https://github.com/gakonst/foundry/tree/master/config
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/.gitattributes:
--------------------------------------------------------------------------------
1 | src/Vm.sol linguist-generated
2 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/.github/workflows/sync.yml:
--------------------------------------------------------------------------------
1 | name: Sync Release Branch
2 |
3 | on:
4 | release:
5 | types:
6 | - created
7 |
8 | jobs:
9 | sync-release-branch:
10 | runs-on: ubuntu-latest
11 | if: startsWith(github.event.release.tag_name, 'v1')
12 | steps:
13 | - name: Check out the repo
14 | uses: actions/checkout@v3
15 | with:
16 | fetch-depth: 0
17 | ref: v1
18 |
19 | - name: Configure Git
20 | run: |
21 | git config user.name github-actions[bot]
22 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com
23 |
24 | - name: Sync Release Branch
25 | run: |
26 | git fetch --tags
27 | git checkout v1
28 | git reset --hard ${GITHUB_REF}
29 | git push --force
30 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/.gitignore:
--------------------------------------------------------------------------------
1 | cache/
2 | out/
3 | .vscode
4 | .idea
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "lib/ds-test"]
2 | path = lib/ds-test
3 | url = https://github.com/dapphub/ds-test
4 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/foundry.toml:
--------------------------------------------------------------------------------
1 | [profile.default]
2 | fs_permissions = [{ access = "read-write", path = "./"}]
3 |
4 | [rpc_endpoints]
5 | # The RPC URLs are modified versions of the default for testing initialization.
6 | mainnet = "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3" # Different API key.
7 | optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash.
8 | arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash.
9 | needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}"
10 |
11 | [fmt]
12 | # These are all the `forge fmt` defaults.
13 | line_length = 120
14 | tab_width = 4
15 | bracket_spacing = false
16 | int_types = 'long'
17 | multiline_func_header = 'attributes_first'
18 | quote_style = 'double'
19 | number_underscore = 'preserve'
20 | single_line_statement_blocks = 'preserve'
21 | ignore = ["src/console.sol", "src/console2.sol"]
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/lib/ds-test/.gitignore:
--------------------------------------------------------------------------------
1 | /.dapple
2 | /build
3 | /out
4 | /cache/
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/lib/ds-test/Makefile:
--------------------------------------------------------------------------------
1 | all:; dapp build
2 |
3 | test:
4 | -dapp --use solc:0.4.23 build
5 | -dapp --use solc:0.4.26 build
6 | -dapp --use solc:0.5.17 build
7 | -dapp --use solc:0.6.12 build
8 | -dapp --use solc:0.7.5 build
9 |
10 | demo:
11 | DAPP_SRC=demo dapp --use solc:0.7.5 build
12 | -hevm dapp-test --verbose 3
13 |
14 | .PHONY: test demo
15 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/lib/ds-test/default.nix:
--------------------------------------------------------------------------------
1 | { solidityPackage, dappsys }: solidityPackage {
2 | name = "ds-test";
3 | src = ./src;
4 | }
5 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/lib/ds-test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ds-test",
3 | "version": "1.0.0",
4 | "description": "Assertions, equality checks and other test helpers ",
5 | "bugs": "https://github.com/dapphub/ds-test/issues",
6 | "license": "GPL-3.0",
7 | "author": "Contributors to ds-test",
8 | "files": [
9 | "src/*"
10 | ],
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/dapphub/ds-test.git"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "forge-std",
3 | "version": "1.7.6",
4 | "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.",
5 | "homepage": "https://book.getfoundry.sh/forge/forge-std",
6 | "bugs": "https://github.com/foundry-rs/forge-std/issues",
7 | "license": "(Apache-2.0 OR MIT)",
8 | "author": "Contributors to Forge Standard Library",
9 | "files": [
10 | "src/**/*"
11 | ],
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/foundry-rs/forge-std.git"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/src/Script.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | // 💬 ABOUT
5 | // Forge Std's default Script.
6 |
7 | // 🧩 MODULES
8 | import {console} from "./console.sol";
9 | import {console2} from "./console2.sol";
10 | import {safeconsole} from "./safeconsole.sol";
11 | import {StdChains} from "./StdChains.sol";
12 | import {StdCheatsSafe} from "./StdCheats.sol";
13 | import {stdJson} from "./StdJson.sol";
14 | import {stdMath} from "./StdMath.sol";
15 | import {StdStorage, stdStorageSafe} from "./StdStorage.sol";
16 | import {StdStyle} from "./StdStyle.sol";
17 | import {StdUtils} from "./StdUtils.sol";
18 | import {VmSafe} from "./Vm.sol";
19 |
20 | // 📦 BOILERPLATE
21 | import {ScriptBase} from "./Base.sol";
22 |
23 | // ⭐️ SCRIPT
24 | abstract contract Script is ScriptBase, StdChains, StdCheatsSafe, StdUtils {
25 | // Note: IS_SCRIPT() must return true.
26 | bool public IS_SCRIPT = true;
27 | }
28 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/src/interfaces/IERC165.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2;
3 |
4 | interface IERC165 {
5 | /// @notice Query if a contract implements an interface
6 | /// @param interfaceID The interface identifier, as specified in ERC-165
7 | /// @dev Interface identification is specified in ERC-165. This function
8 | /// uses less than 30,000 gas.
9 | /// @return `true` if the contract implements `interfaceID` and
10 | /// `interfaceID` is not 0xffffffff, `false` otherwise
11 | function supportsInterface(bytes4 interfaceID) external view returns (bool);
12 | }
13 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/test/Vm.t.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.8.0 <0.9.0;
3 |
4 | import {Test} from "../src/Test.sol";
5 | import {Vm, VmSafe} from "../src/Vm.sol";
6 |
7 | contract VmTest is Test {
8 | // This test ensures that functions are never accidentally removed from a Vm interface, or
9 | // inadvertently moved between Vm and VmSafe. This test must be updated each time a function is
10 | // added to or removed from Vm or VmSafe.
11 | function test_interfaceId() public {
12 | assertEq(type(VmSafe).interfaceId, bytes4(0x01ec102d), "VmSafe");
13 | assertEq(type(Vm).interfaceId, bytes4(0xaf68a970), "Vm");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/test/compilation/CompilationScript.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Script.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationScript is Script {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/test/compilation/CompilationScriptBase.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Script.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationScriptBase is ScriptBase {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/test/compilation/CompilationTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Test.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationTest is Test {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/lib/forge-std/test/compilation/CompilationTestBase.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.6.2 <0.9.0;
3 |
4 | pragma experimental ABIEncoderV2;
5 |
6 | import "../../src/Test.sol";
7 |
8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing
9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207
10 | contract CompilationTestBase is TestBase {}
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/test/ComplicatedContract.t.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 | pragma solidity 0.8.10;
3 |
4 | import {Test} from "forge-std/Test.sol";
5 |
6 | contract ComplicatedContractTest is Test {
7 | function test_DepositERC20() public pure {
8 | // waste some gas for display purposes
9 | for (uint256 i = 1000; i > 0; i--) {}
10 | }
11 |
12 | function test_DepositETH() public pure {
13 | // waste some gas for display purposes
14 | for (uint256 i = 600; i > 0; i--) {}
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/test_filters/test/ContractB.t.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 | pragma solidity 0.8.10;
3 |
4 | import {Test} from "forge-std/Test.sol";
5 |
6 | contract ContractBTest is Test {
7 | function testExample() public {
8 | assertTrue(true);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/writing_tests/foundry.toml:
--------------------------------------------------------------------------------
1 | [profile.default]
2 | src = 'src'
3 | out = 'out'
4 | libs = ['lib']
5 |
6 | # See more config options https://github.com/gakonst/foundry/tree/master/config
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/writing_tests/test/Basic.t.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 | // [!region all]
3 | pragma solidity 0.8.10;
4 |
5 | // [!region import]
6 | import {Test} from "forge-std/Test.sol";
7 | // [!endregion import]
8 |
9 | contract ContractBTest is Test {
10 | uint256 testNumber;
11 |
12 | // [!region setUp]
13 | function setUp() public {
14 | testNumber = 42;
15 | }
16 | // [!endregion setUp]
17 |
18 | // [!region testNumberIs42]
19 | function test_NumberIs42() public {
20 | assertEq(testNumber, 42);
21 | }
22 | // [!endregion testNumberIs42]
23 |
24 | // [!region testRevert_Subtract43]
25 | /// forge-config: default.allow_internal_expect_revert = true
26 | function testRevert_Subtract43() public {
27 | vm.expectRevert();
28 | testNumber -= 43;
29 | }
30 | // [!endregion testFailSubtract43]
31 | }
32 | // [!endregion all]
33 |
--------------------------------------------------------------------------------
/vocs/docs/snippets/projects/writing_tests/test/Basic2.t.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 | // [!region all
3 | pragma solidity 0.8.10;
4 |
5 | // [!region import]
6 | import {Test, stdError} from "forge-std/Test.sol";
7 | // [!endregion import]
8 |
9 | contract ContractBTest is Test {
10 | uint256 testNumber;
11 |
12 | // [!region setUp]
13 | function setUp() public {
14 | testNumber = 42;
15 | }
16 | // [!endregion setUp]
17 |
18 | // [!region testCannotSubtract43]
19 | function test_CannotSubtract43() public {
20 | vm.expectRevert(stdError.arithmeticError);
21 | testNumber -= 43;
22 | }
23 | // [!endregion testCannotSubtract43]
24 | }
25 | // [!endregion all]
26 |
--------------------------------------------------------------------------------
/vocs/docs/styles.css:
--------------------------------------------------------------------------------
1 | @import "tailwindcss" important;
2 |
3 | @custom-variant dark (&:where(.dark, .dark *));
4 |
5 | [data-layout="landing"] .vocs_Button_button {
6 | border-radius: 4px !important;
7 | height: 36px !important;
8 | padding: 0 16px !important;
9 | }
10 |
11 | [data-layout="landing"] .vocs_Content {
12 | position: inherit;
13 | }
14 |
15 | #home-install .vocs_CodeGroup {
16 | display: flex;
17 | height: 100%;
18 | flex-direction: column;
19 | }
20 |
21 | #home-install .vocs_Tabs_content {
22 | flex: 1;
23 | }
24 |
25 | #home-install .vocs_Code {
26 | font-size: 18px;
27 | }
--------------------------------------------------------------------------------
/vocs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vocs",
3 | "private": true,
4 | "version": "0.0.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vocs dev",
8 | "build": "vocs build",
9 | "preview": "vocs preview"
10 | },
11 | "dependencies": {
12 | "react": "latest",
13 | "react-dom": "latest",
14 | "vocs": "latest"
15 | },
16 | "devDependencies": {
17 | "@types/react": "latest",
18 | "typescript": "latest"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/vocs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "module": "ESNext",
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 | "jsx": "react-jsx",
16 |
17 | /* Linting */
18 | "strict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noFallthroughCasesInSwitch": true
22 | },
23 | "include": ["**/*.ts", "**/*.tsx"]
24 | }
25 |
--------------------------------------------------------------------------------