{"id":30790332,"url":"https://github.com/toptrendev/raffle-game-contract-rust","last_synced_at":"2025-09-05T14:09:39.294Z","repository":{"id":310808645,"uuid":"963589258","full_name":"TopTrenDev/raffle-game-contract-rust","owner":"TopTrenDev","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-20T09:52:56.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T11:47:02.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/TopTrenDev.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-04-09T23:03:46.000Z","updated_at":"2025-08-20T09:52:59.000Z","dependencies_parsed_at":"2025-08-20T11:47:05.219Z","dependency_job_id":"a5185701-0e87-45e1-bdee-5c8148611ad2","html_url":"https://github.com/TopTrenDev/raffle-game-contract-rust","commit_stats":null,"previous_names":["toptrendev/raffle-game-contract-rust"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TopTrenDev/raffle-game-contract-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTrenDev%2Fraffle-game-contract-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTrenDev%2Fraffle-game-contract-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTrenDev%2Fraffle-game-contract-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTrenDev%2Fraffle-game-contract-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TopTrenDev","download_url":"https://codeload.github.com/TopTrenDev/raffle-game-contract-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTrenDev%2Fraffle-game-contract-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273768124,"owners_count":25164465,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-09-05T14:09:35.214Z","updated_at":"2025-09-05T14:09:39.286Z","avatar_url":"https://github.com/TopTrenDev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raffle-program\n\nThis is the raffle project that winners can receive the raffle NFT, spl-tokens or winners can buy NFTs by low price. You can buy tickets by $Sol and $PREY token.\n\n\u003ch4\u003e 📞 Cᴏɴᴛᴀᴄᴛ ᴍᴇ Oɴ ʜᴇʀᴇ: 👆🏻 \u003c/h4\u003e\n\n\u003cp\u003e \n    \u003ca href=\"mailto:marekdvojak146@gmail.com\" target=\"_blank\"\u003e\n        \u003cimg alt=\"Email\"\n        src=\"https://img.shields.io/badge/Email-00599c?style=for-the-badge\u0026logo=gmail\u0026logoColor=white\"/\u003e\n    \u003c/a\u003e\n     \u003ca href=\"https://x.com/toptrendev\" target=\"_blank\"\u003e\u003cimg alt=\"Twitter\"\n        src=\"https://img.shields.io/badge/Twitter-000000?style=for-the-badge\u0026logo=x\u0026logoColor=white\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://t.me/toptrendev\" target=\"_blank\"\u003e\u003cimg alt=\"Telegram\"\n        src=\"https://img.shields.io/badge/Telegram-26A5E4?style=for-the-badge\u0026logo=telegram\u0026logoColor=white\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Install Dependencies\n\n- Install `node` and `yarn`\n- Install `ts-node` as global command\n- Confirm the solana wallet preparation: `/home/fury/.config/solana/id.json` in test case\n\n## Usage\n\n- Main script source for all functionality is here: `/cli/script.ts`\n- Program account types are declared here: `/cli/types.ts`\n- Idl to make the JS binding easy is here: `/cli/raffle.json`\n\nAble to test the script functions working in this way.\n\n- Change commands properly in the main functions of the `script.ts` file to call the other functions\n- Confirm the `ANCHOR_WALLET` environment variable of the `ts-node` script in `package.json`\n- Run `yarn ts-node`\n\n## Features\n\n### - As a Smart Contract Owner\n\nFor the first time use, the Smart Contract Owner should `initialize` the Smart Contract for global account allocation.\n\n- `initProject`\n\n### - As the Creator of Raffle\n\nThe NFTs will be stored in the globalAuthority address.\nWhen the admin creates a raffle, call the `creatRaffle` function, the NFT will be sent to the PDA and the data of this raffle is stored on blockchain.\n\n```js\ncreatRaffle(\n    userAddress: PublicKey,\n    nft_mint: PublicKey,\n    ticketPriceSol: number,\n    ticketPriceReap: number,\n    endTimestamp: number,\n    rewardAmount: number,\n    winnerCount: number,\n    whitelisted: number,\n    max: number\n)\n```\n\nThe creator can withdraw NFT from the PDA if nobody buys tickets and the time exceeds the endTime of raffle.\n\n```js\nwithdrawNft(\n    userAddress: PublicKey,\n    nft_mint: PublicKey\n)\n```\n\n### - As the User of Raffle\n\nWhen users buy tickets, call the `buyTicket` function, users will send $Sol and $REAP token to the raffle creator.\n\n```js\nbuyTicket(\n    userAddress: PublicKey,\n    nft_mint: PublicKey,\n    amount: number\n)\n```\n\nWhen users want to see the winners, call `revealWinner` function.\n\n```js\nrevealWinner(\n    userAddress: PublicKey,\n    nft_mint: PublicKey\n)\n```\n\n### - As the Winner of Raffle\n\nWinners can claim rewards by calling `claimReward` function.\n\n```js\nclaimReward(\n    userAddress: PublicKey,\n    nft_mint: PublicKey\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoptrendev%2Fraffle-game-contract-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoptrendev%2Fraffle-game-contract-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoptrendev%2Fraffle-game-contract-rust/lists"}