{"id":20303144,"url":"https://github.com/vanities/foundry-starter-kit","last_synced_at":"2025-03-04T06:44:50.803Z","repository":{"id":124357180,"uuid":"542870494","full_name":"vanities/foundry-starter-kit","owner":"vanities","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-29T01:50:43.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T11:03:57.405Z","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/vanities.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-29T01:50:41.000Z","updated_at":"2022-09-29T01:50:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f193410e-f044-4999-980b-d8a5374a921a","html_url":"https://github.com/vanities/foundry-starter-kit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"smartcontractkit/foundry-starter-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanities%2Ffoundry-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanities%2Ffoundry-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanities%2Ffoundry-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanities%2Ffoundry-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanities","download_url":"https://codeload.github.com/vanities/foundry-starter-kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801194,"owners_count":20022383,"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-11-14T16:36:06.554Z","updated_at":"2025-03-04T06:44:50.787Z","avatar_url":"https://github.com/vanities.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"*Note: This repo has been recently updated for Goerli*\n\n# Foundry Starter Kit\n\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://chain.link\" target=\"_blank\"\u003e\n\u003cimg src=\"./img/chainlink-foundry.png\" width=\"225\" alt=\"Chainlink Foundry logo\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/smartcontractkit/foundry-starter-kit)\n\nFoundry Starter Kit is a repo that shows developers how to quickly build, test, and deploy smart contracts with one of the fastest frameworks out there, [foundry](https://github.com/gakonst/foundry)!\n\n\n- [Foundry Starter Kit](#foundry-starter-kit)\n- [Getting Started](#getting-started)\n  - [Requirements](#requirements)\n  - [Quickstart](#quickstart)\n  - [Testing](#testing)\n- [Deploying to a network](#deploying-to-a-network)\n  - [Setup](#setup)\n  - [Deploying](#deploying)\n    - [Working with a local network](#working-with-a-local-network)\n    - [Working with other chains](#working-with-other-chains)\n- [Security](#security)\n- [Contributing](#contributing)\n- [Thank You!](#thank-you)\n  - [Resources](#resources)\n    - [TODO](#todo)\n\n# Getting Started\n\n## Requirements\n\nPlease install the following:\n\n-   [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)  \n    -   You'll know you've done it right if you can run `git --version`\n-   [Foundry / Foundryup](https://github.com/gakonst/foundry)\n    -   This will install `forge`, `cast`, and `anvil`\n    -   You can test you've installed them right by running `forge --version` and get an output like: `forge 0.2.0 (f016135 2022-07-04T00:15:02.930499Z)`\n    -   To get the latest of each, just run `foundryup`\n\nAnd you probably already have `make` installed... but if not [try looking here.](https://askubuntu.com/questions/161104/how-do-i-install-make)\n\n## Quickstart\n\n```sh\ngit clone https://github.com/smartcontractkit/foundry-starter-kit\ncd foundry-starter-kit\nmake # This installs the project's dependencies.\nmake test\n```\n\n## Testing\n\n```\nmake test\n```\n\nor\n\n```\nforge test\n```\n\n# Deploying to a network\n\nDeploying to a network uses the [foundry scripting system](https://book.getfoundry.sh/tutorials/solidity-scripting.html), where you write your deploy scripts in solidity!\n\n## Setup\n\nWe'll demo using the Goerli testnet. (Go here for [testnet goerli ETH](https://faucets.chain.link/).)\n\nYou'll need to add the following variables to a `.env` file:\n\n-   `GOERLI_RPC_URL`: A URL to connect to the blockchain. You can get one for free from [Alchemy](https://www.alchemy.com/). \n-   `PRIVATE_KEY`: A private key from your wallet. You can get a private key from a new [Metamask](https://metamask.io/) account\n    -   Additionally, if you want to deploy to a testnet, you'll need test ETH and/or LINK. You can get them from [faucets.chain.link](https://faucets.chain.link/).\n-   Optional `ETHERSCAN_API_KEY`: If you want to verify on etherscan\n\n## Deploying\n\n```\nmake deploy-goerli contract=\u003cCONTRACT_NAME\u003e\n```\n\nFor example:\n\n```\nmake deploy-goerli contract=PriceFeedConsumer\n```\n\nThis will run the forge script, the script it's running is:\n\n```\n@forge script script/${contract}.s.sol:Deploy${contract} --rpc-url ${GOERLI_RPC_URL}  --private-key ${PRIVATE_KEY} --broadcast --verify --etherscan-api-key ${ETHERSCAN_API_KEY}  -vvvv\n```\n\nIf you don't have an `ETHERSCAN_API_KEY`, you can also just run:\n\n```\n@forge script script/${contract}.s.sol:Deploy${contract} --rpc-url ${GOERLI_RPC_URL}  --private-key ${PRIVATE_KEY} --broadcast \n```\n\nThese pull from the files in the `script` folder. \n\n### Working with a local network\n\nFoundry comes with local network [anvil](https://book.getfoundry.sh/anvil/index.html) baked in, and allows us to deploy to our local network for quick testing locally. \n\nTo start a local network run:\n\n```\nmake anvil\n```\n\nThis will spin up a local blockchain with a determined private key, so you can use the same private key each time. \n\nThen, you can deploy to it with:\n\n```\nmake deploy-anvil contract=\u003cCONTRACT_NAME\u003e\n```\n\nSimilar to `deploy-goerli`\n\n### Working with other chains\n\nTo add a chain, you'd just need to make a new entry in the `Makefile`, and replace `\u003cYOUR_CHAIN\u003e` with whatever your chain's information is. \n\n```\ndeploy-\u003cYOUR_CHAIN\u003e :; @forge script script/${contract}.s.sol:Deploy${contract} --rpc-url ${\u003cYOUR_CHAIN\u003e_RPC_URL}  --private-key ${PRIVATE_KEY} --broadcast -vvvv\n\n```\n\n# Security\n\nThis framework comes with slither parameters, a popular security framework from [Trail of Bits](https://www.trailofbits.com/). To use slither, you'll first need to [install python](https://www.python.org/downloads/) and [install slither](https://github.com/crytic/slither#how-to-install).\n\nThen, you can run:\n\n```\nmake slither\n```\n\nAnd get your slither output. \n\n\n\n# Contributing\n\nContributions are always welcome! Open a PR or an issue!\n\n# Thank You!\n\n## Resources\n\n-   [Chainlink Documentation](https://docs.chain.link/)\n-   [Foundry Documentation](https://book.getfoundry.sh/)\n\n### TODO\n\n[ ] Add bash scripts to interact with contracts using `cast`\n\n[ ] Make deploying contracts to `anvil` simpler\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanities%2Ffoundry-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanities%2Ffoundry-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanities%2Ffoundry-starter-kit/lists"}