{"id":22370559,"url":"https://github.com/zaryab2000/foundrytemplate","last_synced_at":"2025-03-26T16:41:46.800Z","repository":{"id":203517790,"uuid":"709789929","full_name":"zaryab2000/foundryTemplate","owner":"zaryab2000","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-25T12:05:12.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T21:11:28.731Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaryab2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-25T12:04:53.000Z","updated_at":"2023-10-25T12:04:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"9fb6c145-a285-4228-b279-253966e5e2dd","html_url":"https://github.com/zaryab2000/foundryTemplate","commit_stats":null,"previous_names":["zaryab2000/foundrytemplate"],"tags_count":0,"template":false,"template_full_name":"PaulRBerg/foundry-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2FfoundryTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2FfoundryTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2FfoundryTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2FfoundryTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaryab2000","download_url":"https://codeload.github.com/zaryab2000/foundryTemplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245697157,"owners_count":20657852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T19:46:03.984Z","updated_at":"2025-03-26T16:41:46.778Z","avatar_url":"https://github.com/zaryab2000.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Foundry Template [![Open in Gitpod][gitpod-badge]][gitpod] [![Github Actions][gha-badge]][gha] [![Foundry][foundry-badge]][foundry] [![License: MIT][license-badge]][license]\n\n[gitpod]: https://gitpod.io/#https://github.com/zaryab2000/foundryTemplate\n[gitpod-badge]: https://img.shields.io/badge/Gitpod-Open%20in%20Gitpod-FFB45B?logo=gitpod\n[gha]: https://github.com/zaryab2000/foundryTemplate/actions\n[gha-badge]: https://github.com/zaryab2000/foundryTemplate/actions/workflows/ci.yml/badge.svg\n[foundry]: https://getfoundry.sh/\n[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg\n[license]: https://opensource.org/licenses/MIT\n[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg\n\nA Foundry-based template for developing Solidity smart contracts, with sensible defaults.\n\n## What's Inside\n\n- [Forge](https://github.com/foundry-rs/foundry/blob/master/forge): compile, test, fuzz, format, and deploy smart\n  contracts\n- [Forge Std](https://github.com/foundry-rs/forge-std): collection of helpful contracts and cheatcodes for testing\n- [PRBTest](https://github.com/PaulRBerg/prb-test): modern collection of testing assertions and logging utilities\n- [Prettier](https://github.com/prettier/prettier): code formatter for non-Solidity files\n- [Solhint Community](https://github.com/solhint-community/solhint-community): linter for Solidity code\n\n## Getting Started\n\nClick the [`Use this template`](https://github.com/PaulRBerg/foundry-template/generate) button at the top of the page to\ncreate a new repository with this repo as the initial state.\n\nOr, if you prefer to install the template manually:\n\n```sh\n$ mkdir my-project\n$ cd my-project\n$ forge init --template PaulRBerg/foundry-template\n$ pnpm install # install Solhint, Prettier, and other Node.js deps\n```\n\nIf this is your first time with Foundry, check out the\n[installation](https://github.com/foundry-rs/foundry#installation) instructions.\n\n## Features\n\nThis template builds upon the frameworks and libraries mentioned above, so for details about their specific features,\nplease consult their respective documentation.\n\nFor example, if you're interested in exploring Foundry in more detail, you should look at the\n[Foundry Book](https://book.getfoundry.sh/). In particular, you may be interested in reading the\n[Writing Tests](https://book.getfoundry.sh/forge/writing-tests.html) tutorial.\n\n### Sensible Defaults\n\nThis template comes with a set of sensible default configurations for you to use. These defaults can be found in the\nfollowing files:\n\n```text\n├── .editorconfig\n├── .gitignore\n├── .prettierignore\n├── .prettierrc.yml\n├── .solhint.json\n├── foundry.toml\n└── remappings.txt\n```\n\n### VSCode Integration\n\nThis template is IDE agnostic, but for the best user experience, you may want to use it in VSCode alongside Nomic\nFoundation's [Solidity extension](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity).\n\nFor guidance on how to integrate a Foundry project in VSCode, please refer to this\n[guide](https://book.getfoundry.sh/config/vscode).\n\n### GitHub Actions\n\nThis template comes with GitHub Actions pre-configured. Your contracts will be linted and tested on every push and pull\nrequest made to the `main` branch.\n\nYou can edit the CI script in [.github/workflows/ci.yml](./.github/workflows/ci.yml).\n\n## Writing Tests\n\nTo write a new test contract, you start by importing [PRBTest](https://github.com/PaulRBerg/prb-test) and inherit from\nit in your test contract. PRBTest comes with a pre-instantiated [cheatcodes](https://book.getfoundry.sh/cheatcodes/)\nenvironment accessible via the `vm` property. If you would like to view the logs in the terminal output you can add the\n`-vvv` flag and use [console.log](https://book.getfoundry.sh/faq?highlight=console.log#how-do-i-use-consolelog).\n\nThis template comes with an example test contract [Foo.t.sol](./test/Foo.t.sol)\n\n## Usage\n\nThis is a list of the most frequently needed commands.\n\n### Build\n\nBuild the contracts:\n\n```sh\n$ forge build\n```\n\n### Clean\n\nDelete the build artifacts and cache directories:\n\n```sh\n$ forge clean\n```\n\n### Compile\n\nCompile the contracts:\n\n```sh\n$ forge build\n```\n\n### Coverage\n\nGet a test coverage report:\n\n```sh\n$ forge coverage\n```\n\n### Deploy\n\nDeploy to Anvil:\n\n```sh\n$ forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545\n```\n\nFor this script to work, you need to have a `MNEMONIC` environment variable set to a valid\n[BIP39 mnemonic](https://iancoleman.io/bip39/).\n\nFor instructions on how to deploy to a testnet or mainnet, check out the\n[Solidity Scripting](https://book.getfoundry.sh/tutorials/solidity-scripting.html) tutorial.\n\n### Format\n\nFormat the contracts:\n\n```sh\n$ forge fmt\n```\n\n### Gas Usage\n\nGet a gas report:\n\n```sh\n$ forge test --gas-report\n```\n\n### Lint\n\nLint the contracts:\n\n```sh\n$ pnpm lint\n```\n\n### Test\n\nRun the tests:\n\n```sh\n$ forge test\n```\n\nGenerate test coverage and output result to the terminal:\n\n```sh\n$ pnpm test:coverage\n```\n\nGenerate test coverage with lcov report (you'll have to open the `./coverage/index.html` file in your browser, to do so\nsimply copy paste the path):\n\n```sh\n$ pnpm test:coverage:report\n```\n\n## Notes\n\n1. Foundry uses [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to manage dependencies. For\n   detailed instructions on working with dependencies, please refer to the\n   [guide](https://book.getfoundry.sh/projects/dependencies.html) in the book\n2. You don't have to create a `.env` file, but filling in the environment variables may be useful when debugging and\n   testing against a fork.\n\n## Related Efforts\n\n- [abigger87/femplate](https://github.com/abigger87/femplate)\n- [cleanunicorn/ethereum-smartcontract-template](https://github.com/cleanunicorn/ethereum-smartcontract-template)\n- [foundry-rs/forge-template](https://github.com/foundry-rs/forge-template)\n- [FrankieIsLost/forge-template](https://github.com/FrankieIsLost/forge-template)\n\n## License\n\nThis project is licensed under MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaryab2000%2Ffoundrytemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaryab2000%2Ffoundrytemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaryab2000%2Ffoundrytemplate/lists"}