{"id":19498151,"url":"https://github.com/patrickalphac/decentralized-raffle","last_synced_at":"2025-04-25T22:33:20.256Z","repository":{"id":46070296,"uuid":"417990540","full_name":"PatrickAlphaC/decentralized-raffle","owner":"PatrickAlphaC","description":null,"archived":false,"fork":false,"pushed_at":"2021-11-16T17:02:22.000Z","size":425,"stargazers_count":15,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-04T01:09:11.037Z","etag":null,"topics":["blockchain","chainlink","ethereum"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/PatrickAlphaC.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}},"created_at":"2021-10-17T01:31:57.000Z","updated_at":"2023-01-25T07:36:14.000Z","dependencies_parsed_at":"2022-08-26T06:21:56.317Z","dependency_job_id":null,"html_url":"https://github.com/PatrickAlphaC/decentralized-raffle","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fdecentralized-raffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fdecentralized-raffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fdecentralized-raffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fdecentralized-raffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickAlphaC","download_url":"https://codeload.github.com/PatrickAlphaC/decentralized-raffle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224019638,"owners_count":17242176,"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","chainlink","ethereum"],"created_at":"2024-11-10T21:49:22.609Z","updated_at":"2024-11-10T21:49:23.079Z","avatar_url":"https://github.com/PatrickAlphaC.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decentralized Raffle\n\n# Quickstart\n ## Requirements\n\n- [nodejs](https://nodejs.org/en/)\n- [NPM](https://www.npmjs.com/) or [YARN](https://yarnpkg.com/)\n\n## Installation\n\n```sh\ngit clone https://github.com/PatrickAlphaC/decentralized-raffle.git\ncd decentralized-raffle\nyarn\n```\n### Deploy contracts\n\n```sh\nnpx hardhat deploy\n```\n\n### Deploy and start a local node\n\n```sh\nnpx hardhat node\n```\n\n### Deploy to Kovan\n\nTo deploy to a testnet or a live network, you need the following environment variables:\n\n1. KOVAN_RPC_URL=https://eth-ropsten.alchemyapi.io/v2/\u003cYOUR ALCHEMY KEY\u003e\n2. PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1\n\nYour `KOVAN_RPC_URL` is the URL of your blockchain node, for example, from [alchemy](https://www.alchemy.com/).\n\nYour `PRIVATE_KEY` is the private key of your metamask or cryptowallet. Make sure it starts with `0x`. You might have to add `0x` if you're pulling the key from something like metamask. \n\nYou can set them in a file named `.env`. You can follow the example of `.env.example` of what the contents of that file will look like. \n\nYou'll also need testnet ETH and testnet LINK. You can [find both here.](https://faucets.chain.link/)\n\nOnce you do so, you can run:\n\n```\nnpx hardhat deploy --network kovan\n```\nFund your contract with LINK.\n```\nnpx hardhat fund-link --contract insert-contract-address-here --network kovan\n```\nAnd enter your raffle\n``` \nnpx hardhat run scripts/enter.ts --network kovan\n```\n\n\n### Add keepers\n\nOnce you deploy to Kovan, you can register your contract with the kovan keepers registry. Please [follow the documentation](https://docs.chain.link/docs/chainlink-keepers/compatible-contracts/) for more information. \n\n```sh\nnpx hardhat deploy --network kovan\n```\n\nAnd you can verify once you have an [`ETHERSCAN_API_KEY`](https://etherscan.io/apis)\n\nAdd this configuration in the file named `.env`:\n\n```javascript\nETHERSCAN_API_KEY=\u003cYOUR ETHERSCAN KEY\u003e\n```\n\nThe command to verify the source code in Etherscan is:\n\n```sh\nnpx hardhat verify --network mainnet DEPLOYED_CONTRACT_ADDRESS args...\n```\n\nThe contract `Raffle` receives these arguments in his constructor:\n\n```solidity\n        address _vrfCoordinator,\n        address _linkToken,\n        bytes32 _keyHash,\n        uint256 _chainlinkFee,\n        uint256 _entranceFee,\n        uint256 _interval\n```\n\nGet the deploy's arguments in the file [helper-hardhat-config.ts](./helper-hardhat-config.ts).\nFind the network kovan (42). Per example:\n\n```javascript\n  42: {\n    name: 'kovan',\n    linkToken: '0xa36085F69e2889c224210F603D836748e7dC0088',\n    keyHash:\n      '0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4',\n    vrfCoordinator: '0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9',\n    chainlinkFee: '100000000000000000',\n    entranceFee: '100000000000000000',\n    fundAmount: '1000000000000000000',\n    interval: '20'\n  }\n```\n\nThen run this command to verify the source code in Etherscan:\n\n```sh\nnpx hardhat verify --network kovan \u003cDEPLOYED_CONTRACT_ADDRESS\u003e \u003cvrfCoordinator\u003e \u003clinkToken\u003e \u003ckeyHash\u003e \u003cchainlinkFee\u003e \u003centranceFee\u003e \u003cinterval\u003e\n```\n\n## Tests\n\n```sh\nnpx hardhat test\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fdecentralized-raffle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickalphac%2Fdecentralized-raffle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fdecentralized-raffle/lists"}