{"id":28443346,"url":"https://github.com/codebatine/chores-for-crypto","last_synced_at":"2025-06-29T12:32:27.356Z","repository":{"id":296998472,"uuid":"995289391","full_name":"codebatine/Chores-for-Crypto","owner":"codebatine","description":"A Chainlink CCIP Hackathon Project 2025.","archived":false,"fork":false,"pushed_at":"2025-06-25T13:21:00.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T14:27:49.277Z","etag":null,"topics":["blockchain","ccip","chainlink","hackathon","hardhat","solidity"],"latest_commit_sha":null,"homepage":"","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/codebatine.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,"zenodo":null}},"created_at":"2025-06-03T08:56:47.000Z","updated_at":"2025-06-25T13:21:04.000Z","dependencies_parsed_at":"2025-06-03T20:33:57.627Z","dependency_job_id":"ae882276-82be-4c94-8a11-8f0aa47ba289","html_url":"https://github.com/codebatine/Chores-for-Crypto","commit_stats":null,"previous_names":["codebatine/chores-for-crypto"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codebatine/Chores-for-Crypto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebatine%2FChores-for-Crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebatine%2FChores-for-Crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebatine%2FChores-for-Crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebatine%2FChores-for-Crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebatine","download_url":"https://codeload.github.com/codebatine/Chores-for-Crypto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebatine%2FChores-for-Crypto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262593956,"owners_count":23334093,"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":["blockchain","ccip","chainlink","hackathon","hardhat","solidity"],"created_at":"2025-06-06T07:11:51.575Z","updated_at":"2025-06-29T12:32:27.337Z","avatar_url":"https://github.com/codebatine.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧹 Chores for Crypto\n\nRewards for chores with Sepolia ETH, priced in real-time USD using Chainlink oracles\n\n---\n\n## Project Links\n\n- **Contract Address:** [ChoresReward.sol on Sepolia Etherscan](https://sepolia.etherscan.io/address/0x210b858e80253117e7a572112810ecc07c44a98c)\n- **Demo Video:** [YouTube Demo](PASTE_YOUTUBE_LINK)\n- **GitHub:** [Chores for Crypto Repo](https://github.com/codebatine/Chores-for-Crypto)\n- **Smart Contract Source Code:** [ChoresReward.sol](https://github.com/codebatine/Chores-for-Crypto/tree/main/contracts)\n\n---\n\n## Description\n\n**Chores for Crypto** lets parents pay children for chores in Sepolia Eth with the amount denominated in USD.  \nParents specify a USD amount and the smart contract uses **Chainlink's ETH/USD price feed** to determine and send the real-time equivalent in ETH.  \nThis ensures the reward always matches the intended value, regardless of ETH price.\n\n---\n\n## Architecture\n\n- **Frontend:** React (Vite), Tailwind CSS, Ethers.js, Web3Modal\n- **Smart Contracts:** Solidity (`ChoresReward.sol`) on Sepolia testnet\n- **Chainlink:** ETH/USD Price Feed ([0x694AA1769357215DE4FAC081bf1f309aDC325306](https://sepolia.etherscan.io/address/0x694AA1769357215DE4FAC081bf1f309aDC325306), Sepolia)\n\n---\n\n## Chainlink Usage\n\nThis project uses **Chainlink Data Feeds** inside a state-changing contract function.\n\n- In `ChoresReward.sol`, the contract:\n  - Imports Chainlink's `AggregatorV3Interface`\n  - Reads the current ETH/USD price directly **inside the `sendReward` function** (which sends ETH to the child).\n  - This means every time a parent sends a reward, a real Chainlink oracle call determines the ETH amount.\n\n**Relevant contract snippet:**\n\n```solidity\nimport \"@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol\";\n\ncontract ChoresReward {\n    AggregatorV3Interface public priceFeed;\n\n    constructor(address _priceFeed) {\n        priceFeed = AggregatorV3Interface(_priceFeed);\n    }\n\n    function sendReward(address payable child, uint256 usdAmount) public payable {\n        uint256 ethAmount = getETHAmountFromUSD(usdAmount);\n        require(msg.value \u003e= ethAmount, \"Not enough ETH sent for reward!\");\n        child.transfer(ethAmount);\n        // emits event, refunds any excess\n    }\n\n    function getETHAmountFromUSD(uint256 usdAmount) public view returns (uint256) {\n        (, int256 price, , , ) = priceFeed.latestRoundData();\n        require(price \u003e 0, \"Invalid price feed value\");\n        return (usdAmount * 1e18) / uint256(price) * 1e8;\n    }\n}\n```\n\n**Chainlink usage files:**\n\n- [`contracts/ChoresReward.sol`](contracts/ChoresReward.sol) (main contract)\n- Chainlink AggregatorV3Interface used at [0x694AA1769357215DE4FAC081bf1f309aDC325306](https://sepolia.etherscan.io/address/0x694AA1769357215DE4FAC081bf1f309aDC325306) (Sepolia)\n\n---\n\n## How to Run Locally\n\n1. **Clone the repo**\n   ```bash\n   git clone https://github.com/yourusername/chores-for-crypto-frontend\n   cd chores-for-crypto-frontend\n   ```\n2. **Install dependencies**\n   ```bash\n   npm install\n   ```\n3. **Start local dev server**\n   ```bash\n   npm run dev\n   ```\n4. **Configure MetaMask for Sepolia**\n5. **Interact with the dApp locally**\n\n_No frontend deployment—run `npm run dev` and use `localhost`!_\n\n---\n\n## Usage\n\n1. **Connect your wallet (MetaMask)**\n2. **Parent** can (optionally) add children’s wallet addresses to an address book for easy selection.\n3. Select a child’s address from the address book (or enter a new address manually).\n4. Enter the USD reward amount for the chore.\n5. App calculates the ETH amount using the smart contract.\n6. Parent confirms the transaction (MetaMask popup).\n7. **Child receives ETH** for their hard work!\n\n---\n\n## Submission Checklist\n\n- **[x]** Chainlink Data Feeds used for state change (see [ChoresReward.sol](contracts/ChoresReward.sol))\n- **[x]** Public repo with code\n- **[x]** Demo video (public link above)\n- **[x]** README covers Chainlink usage and architecture\n- **[x]** All files using Chainlink are clearly linked\n\n---\n\n_Thank you for reviewing our project!_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebatine%2Fchores-for-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebatine%2Fchores-for-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebatine%2Fchores-for-crypto/lists"}