{"id":22701740,"url":"https://github.com/looksrare/contracts-raffle","last_synced_at":"2025-04-12T09:41:26.508Z","repository":{"id":187495491,"uuid":"625881292","full_name":"LooksRare/contracts-raffle","owner":"LooksRare","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-09T16:01:14.000Z","size":874,"stargazers_count":1,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T04:41:19.551Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LooksRare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-04-10T10:07:14.000Z","updated_at":"2024-10-24T14:43:46.000Z","dependencies_parsed_at":"2024-01-19T12:01:38.872Z","dependency_job_id":"20ee6cd8-b715-499b-a316-95fb2de892ce","html_url":"https://github.com/LooksRare/contracts-raffle","commit_stats":null,"previous_names":["looksrare/contracts-raffle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LooksRare%2Fcontracts-raffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LooksRare%2Fcontracts-raffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LooksRare%2Fcontracts-raffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LooksRare%2Fcontracts-raffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LooksRare","download_url":"https://codeload.github.com/LooksRare/contracts-raffle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248549232,"owners_count":21122853,"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-12-10T07:10:04.100Z","updated_at":"2025-04-12T09:41:26.478Z","avatar_url":"https://github.com/LooksRare.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @looksrare/contracts-raffle\n\n[![Tests](https://github.com/LooksRare/contracts-raffle/actions/workflows/tests.yaml/badge.svg)](https://github.com/LooksRare/contracts-raffle/actions/workflows/tests.yaml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## Description\n\nThis project contains the smart contracts used for LooksRare's raffle protocol. The main contract `Raffle`\nallows anyone to create a raffle with multiple prizes and winners. The fees must be paid in ETH or ERC-20, while\nthe prizes can be ERC-721, ERC-1155, ETH or ERC-20.\n\n## Deployments\n\n| Network  | Raffle                                                                                                                             | RaffleV2                                                                                                                           |\n| :------- | :--------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |\n| Ethereum | [0x0000000000009703EcD0fFEa3143fc9096DE91B0](https://etherscan.io/address/0x0000000000009703EcD0fFEa3143fc9096DE91B0#code)         | [0x0000000000aDEaD599C11A0C9a7475B67852c1D0](https://etherscan.io/address/0x0000000000aDEaD599C11A0C9a7475B67852c1D0#code)         |\n| Goerli   | [0xC5F7FCde87e30Aa339d3d61B4fe3c1C261f6EEe2](https://goerli.etherscan.io/address/0xC5F7FCde87e30Aa339d3d61B4fe3c1C261f6EEe2#code)  | [0xda28aC345040C9abC0E19AfD6025c4f5A45C4b30](https://goerli.etherscan.io/address/0xda28aC345040C9abC0E19AfD6025c4f5A45C4b30#code)  |\n| Sepolia  | [0xb0C8a1a0569F7302d36e380755f1835C3e59aCB9](https://sepolia.etherscan.io/address/0xb0C8a1a0569F7302d36e380755f1835C3e59aCB9#code) | [0xae7cf912ab5d9f6aa53126ea7aabd007f844ceec](https://sepolia.etherscan.io/address/0xae7cf912ab5d9f6aa53126ea7aabd007f844ceec#code) |\n\n### Raffle states\n\nEach raffle consists of the following states:\n\n1. `None`\n   There is no raffle at the provided ID.\n\n2. `Open`\n   The raffle has been created, prizes have been deposited and is open for entries.\n\n3. `Drawing`\n   When a raffle's minimum entries has reached before the cutoff time, the smart contract calls Chainlink VRF\n   to draw a random number to determine the winners. Raffle owners also have the option to draw the winners if the minimum entries is not met after the cutoff time. The state `Drawing` represents the intermediary state\n   of waiting for Chainlink VRF's callback.\n\n4. `RandomnessFulfilled`\n   When Chainlink VRF's callback is complete, the raffle stores the random words and transitions to `RandomnessFulfilled`.\n\n5. `Drawn`\n   The process to store random words and to select the winners are separated into 2 functions as there is a 2.5m callback gas limit\n   from Chainlink. Once the winners are selected via the function `selectWinners`, the raffle is considered `Drawn`.\n\n6. `Complete`\n   After the raffle creator claims the fees accumulated from selling raffle tickets, the raffle is considered `Complete`.\n\n7. `Refundable`\n   If the raffle is still in the `Created` state (no prizes were deposited) or is not able to sell out at least the specified minimum entries, then the raffle can be cancelled. The raffle can be transitioned to `Refundable` state if there are deposited prizes. The raffle creator can withdraw the prizes and the ticket buyers can withdraw the fees spent (if any).\n\n8. `Cancelled`\n   A raffle can transition from `Refundable` to `Cancelled` by having the raffle creator withdrawing the prizes or it can transition from `Created` to `Cancelled` directly if the prizes were never deposited.\n   Ticket buyers can still withdraw the fees spent.\n\n### Protocol fees\n\nThe contract owner can set a protocol fee recipient and a protocol fee basis points (up to 25%) per raffle.\n\n### Pricing options\n\nEach raffle can have between 1 to 5 pricing options. The rules are as follows:\n\n1. The raffle's minimum entries must be divisible by the first pricing option's entries count.\n2. The first pricing option must not have a price of 0.\n3. Each pricing option after the first one must have a higher entries count than the previous one.\n4. Each pricing option after the first one must have a higher **total price** than the previous one.\n5. Each pricing option after the first one must not have a higher **price per entry** than the previous one.\n6. Each pricing option's entries count must be divisible by the next pricing option's entries count.\n\n### Misc. rules\n\n1. Each raffle's lifespan must between 1 day to 7 days.\n2. If the fee/prize token is an ERC-20, then it must be allowed by the contract owner (LooksRare's multi-sig).\n3. There can be up to 200 prizes per raffle. Each ERC-721 prize counts as 1 even if they belong to the same collection.\n   Each ERC-20 / ERC-1155 with the same token ID and multiple winners count as 1.\n4. The maximum winners per raffle is 200.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flooksrare%2Fcontracts-raffle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flooksrare%2Fcontracts-raffle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flooksrare%2Fcontracts-raffle/lists"}