{"id":21569730,"url":"https://github.com/muhdhammad/foundry-fund-me","last_synced_at":"2026-01-07T07:36:57.014Z","repository":{"id":252228669,"uuid":"839846005","full_name":"Muhdhammad/foundry-fund-me","owner":"Muhdhammad","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-08T12:48:46.000Z","size":1968,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T14:47:25.575Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Muhdhammad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-08T12:47:45.000Z","updated_at":"2024-08-26T15:14:46.000Z","dependencies_parsed_at":"2024-08-08T13:46:36.661Z","dependency_job_id":"3764f210-d7c6-454a-bd6a-565232de0785","html_url":"https://github.com/Muhdhammad/foundry-fund-me","commit_stats":null,"previous_names":["muhdhammad/foundry-fund-me"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muhdhammad%2Ffoundry-fund-me","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muhdhammad%2Ffoundry-fund-me/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muhdhammad%2Ffoundry-fund-me/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muhdhammad%2Ffoundry-fund-me/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Muhdhammad","download_url":"https://codeload.github.com/Muhdhammad/foundry-fund-me/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246049619,"owners_count":20715510,"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-24T11:10:28.902Z","updated_at":"2026-01-07T07:36:56.971Z","avatar_url":"https://github.com/Muhdhammad.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting Started\n\n## About \n\n__Fund Me__ is a smart contract built on Foundry and Solidity. This contract allows anyone to contribute funds directly to it. It provides a straightforward and secure way to collect donations or support for various purposes by interacting with the Ethereum blockchain.\n\n## Requirements\n[git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git): \nYou should have git installed on your PC, you can check the git version by running `git --version` and if is showing some version like `git version x.x.x`, then you have installed it correctly.\n\n[foundry](https://getfoundry.sh/):\nYou should have foundry installed, you can check by running the `forge --version`, if you see something like this `forge 0.2.0 (f2518c9 2024-08-06T00:18:13.943817879Z)` then you have done it correctly.\n\n## Usage\n### Deployment\n\n```\nforge script script/DeployFundMe.s.sol\n```\n### Testing\n\nThis project consists of (03) tests to ensure its functionality.\n1. Unit\n2. Integration\n3. Forked\n\n```\nforge test\n```\nYou can also,\n```\n// Only run test functions matching the specified regex pattern.\n\nforge test --match-test testFunctionName\n```\n\nor\n```\nforge test --fork-url $SEPOLIA_RPC_URL\n```\n\n### Test Coverage\n```\nforge coverage\n```\n\n## Deployment to testnet or mainnet\n1. Setup environment variables\n\nYou'll have to set up your `$SEPOLIA_RPC_URL` and `PRIVATE_KEY` as environment variables in a `.env file` \n\n* `$PRIVATE_KEY`: The private key of you account (example from [Metamask](https://metamask.io/)) __SERIOUS NOTE:__ For Development purpose, always use a key that does'nt have any real funds in it.\n* `$SEPOLIA_RPC_URL`: This is url of the sepolia testnet node you're working with, you can choose any free node as a service provider like [Alchemy](https://www.alchemy.com/).\n* Optionally, add you `ETHERSCAN_API_KEY` if you want to verify your contract on [Etherscan](https://etherscan.io/).\n\n\n2. Get testnet ETH \n \nGo to [faucets.chain.link](https://faucets.chain.link/) or any other faucet to get testnet ETH, you should see ETH appear in you wallet.\n\n3. Deploy\n\n```\nforge script script/DeployFundMe.s.sol --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY\n```\nYou can also make its key in a `makefile` to access it easily instead of writing down all of this in the terminal.\n\n\n## Scripts\n\nAfter deploying to a testnet or local net, you can run the scripts.\n\nDeploying locally using cast\n```\ncast send \u003cFUNDME_CONTRACT_ADDRESS\u003e \"fund()\" --value 0.1ether --private-key \u003cPRIVATE_KEY\u003e\n```\nor\n```\nforge script script/Interactions.s.sol:Fund_FundMe --rpc-url sepolia  --private-key $PRIVATE_KEY  --broadcast\nforge script script/Interactions.s.sol:Withdraw_FundMe --rpc-url sepolia  --private-key $PRIVATE_KEY  --broadcast\n```\n\n## Withdraw\n```\ncast send \u003cFUNDME_CONTRACT_ADDRESS\u003e \"withdraw()\" --private-key \u003cPRIVATE_KEY\u003e\n```\n\n## Gas Estimation\nYou can estimate how much gas different things cost by running\n```\nforge snapshot\n```\nYou'll see any output file called `.gas-snapshot`\n\n## Additional Note\n\nBest practice to use your `$PRIVATE_KEY` is to encode it and then use it, you should never hard copy paste your private key with the real funds in the `.env` file.\n\n# Thanks!\nThank you for staying engaged with this project, if you appreciated this, feel free to follow!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhdhammad%2Ffoundry-fund-me","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhdhammad%2Ffoundry-fund-me","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhdhammad%2Ffoundry-fund-me/lists"}