{"id":19662474,"url":"https://github.com/cgrade/raffle_contract","last_synced_at":"2026-06-06T21:32:12.224Z","repository":{"id":262059797,"uuid":"842943765","full_name":"cgrade/Raffle_Contract","owner":"cgrade","description":"Raffle is a decentralized application that allows users to participate in a raffle and randomly selects a winner. The contract utilizes Chainlink VRF (Verifiable Random Function) for secure random number generation, ensuring fairness in the selection process.","archived":false,"fork":false,"pushed_at":"2024-11-10T08:17:39.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T01:52:17.777Z","etag":null,"topics":["chainlink","ethereum-contract","foundry","smart-contracts","solidity","vrfcoordinator"],"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/cgrade.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-15T12:52:23.000Z","updated_at":"2024-11-10T08:19:31.000Z","dependencies_parsed_at":"2024-11-10T09:19:07.193Z","dependency_job_id":null,"html_url":"https://github.com/cgrade/Raffle_Contract","commit_stats":null,"previous_names":["cgrade/foundry-smart-contract-lottery-f23"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2FRaffle_Contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2FRaffle_Contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2FRaffle_Contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2FRaffle_Contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgrade","download_url":"https://codeload.github.com/cgrade/Raffle_Contract/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240971272,"owners_count":19886716,"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":["chainlink","ethereum-contract","foundry","smart-contracts","solidity","vrfcoordinator"],"created_at":"2024-11-11T16:11:30.600Z","updated_at":"2025-11-20T22:05:31.999Z","avatar_url":"https://github.com/cgrade.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raffle Smart Contract\n\n## Overview\n\n**Raffle** is a decentralized application that allows users to participate in a raffle and randomly selects a winner. The contract utilizes Chainlink VRF (Verifiable Random Function) for secure random number generation, ensuring fairness in the selection process.\n\n## Features\n\n- Users can enter the raffle by sending ETH.\n- A winner is randomly selected after a specified time interval.\n- The contract emits events for significant actions, such as entering the raffle and selecting a winner.\n- Implements Chainlink VRF for secure and verifiable randomness.\n\n## Smart Contracts\n\n### 1. Raffle.sol\n\n- **Description**: The main contract that manages the raffle process.\n- **Key Functions**:\n  - `enterRaffle()`: Allows users to enter the raffle by sending ETH.\n  - `checkUpkeep()`: Checks if the conditions are met to pick a winner.\n  - `performUpkeep()`: Performs the upkeep to select a winner.\n  - `fulfillRandomWords()`: Callback function called by Chainlink VRF to fulfill the random number request.\n  - `getEntranceFee()`: Returns the entrance fee for the raffle.\n  - `getRaffleState()`: Returns the current state of the raffle.\n  - `getPlayer(uint256 index)`: Returns the address of a player at a specific index.\n\n### 2. DeployRaffle.s.sol\n\n- **Description**: A script for deploying the Raffle contract.\n- **Key Functions**:\n  - `run()`: Deploys the Raffle contract and sets up the necessary configurations.\n\n### 3. HelperConfig.s.sol\n\n- **Description**: A helper contract that manages network configurations and settings.\n- **Key Functions**:\n  - `getConfig()`: Returns the configuration for the current network.\n  - `setConfig()`: Sets the configuration for a specific network.\n\n### 4. LinkToken.sol\n\n- **Description**: A mock ERC20 token contract for LINK, used in the raffle.\n- **Key Functions**:\n  - `mint()`: Mints new tokens to a specified address.\n  - `transferAndCall()`: Transfers tokens to a contract address and calls a function on the recipient.\n\n### 5. RaffleTest.t.sol\n\n- **Description**: Unit tests for the Raffle contract.\n- **Key Tests**:\n  - Tests for entering the raffle, checking upkeep, performing upkeep, and fulfilling random words.\n\n## Installation\n\nTo install the necessary dependencies, run:\n\n```shell\n$ forge install\n```\n\n## Usage\n\n### Build\n\n```shell\n$ forge build\n```\n\n### Test\n\n```shell\n$ forge test\n```\n\n### Deploy\n\nTo deploy the contracts, use the following command:\n\n```shell\n$ forge script script/DeployRaffle.s.sol:DeployRaffle --rpc-url \u003cyour_rpc_url\u003e --private-key \u003cyour_private_key\u003e\n```\n\n## Contributing\n\nIf you would like to contribute to this project, please fork the repository and submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgrade%2Fraffle_contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgrade%2Fraffle_contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgrade%2Fraffle_contract/lists"}