{"id":31923886,"url":"https://github.com/chainsafe/vrf-lootbox-contracts","last_synced_at":"2025-10-13T23:58:38.696Z","repository":{"id":207316971,"uuid":"668297624","full_name":"ChainSafe/vrf-lootbox-contracts","owner":"ChainSafe","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-20T11:58:50.000Z","size":1313,"stargazers_count":3,"open_issues_count":10,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-02T02:53:34.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ChainSafe.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,"publiccode":null,"codemeta":null}},"created_at":"2023-07-19T13:28:47.000Z","updated_at":"2025-02-08T13:05:04.000Z","dependencies_parsed_at":"2024-04-25T18:48:55.446Z","dependency_job_id":"90b5190d-b3e8-4073-9c55-d09ae03d5a37","html_url":"https://github.com/ChainSafe/vrf-lootbox-contracts","commit_stats":null,"previous_names":["chainsafe/vrf-lootbox-contracts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChainSafe/vrf-lootbox-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fvrf-lootbox-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fvrf-lootbox-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fvrf-lootbox-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fvrf-lootbox-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChainSafe","download_url":"https://codeload.github.com/ChainSafe/vrf-lootbox-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fvrf-lootbox-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017175,"owners_count":26086019,"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-10-13T02:00:06.723Z","response_time":61,"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-10-13T23:58:23.382Z","updated_at":"2025-10-13T23:58:38.687Z","avatar_url":"https://github.com/ChainSafe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vrf-lootbox-contracts\n\n### Chainsafe Documentation\n\nEach function has detail natspec comments for those that know how to read solidity. If you'd prefer a more user friendly approach you can check out our documentation on what each contract function does aswell as how to use them here https://docs.gaming.chainsafe.io/current/lootboxes\n\n### Install\n\n    node 18.x is required\n    npm install\n    npm run compile\n\n### Docs\n\n    npm run hardhat docgen\n\n### Deployment\n\nTo deploy to live networks, create a `.env` file using the `.env.example` and fill in the relevant variables (only the ones needed for your deployment).\nYou need to either have a private key specified or a ledger address and derivation path (if signing transactions with Ledger).\nTo deploy to Ethereum Mainnet do:\n\n    npm run hardhat -- --network mainnet deploy-factory\n\nTo deploy to other networks, replace the `mainnet` with the network name from the supported list:\n\n    mainnet\n    fantom\n    avax\n    polygon\n    bsc\n    sepolia\n    fantomtest\n    fuji\n    mumbai\n    bsctest\n\nYou could optionally set your ETHERSCAN_API key, and use `--verify true` in order to publish the source code after deployemnt. NOTE: Chainlink didn't want to publish the source code yet.\n\n### Integration env and usage\n\nBy default everything is executed on the forked network, and no real transactions being sent.\nYou can add dev keys to your wallet (like MetaMask) in order to interract with the contracts on the local node.\nThe private keys are:\n\n    57b26bc4bcfd781dcab2fbda189bbf9eb124c7084690571ce185294cbb3d010a Deployer\n    7bb779a88af05bc9bc0d0a1da4357cced604f545459a532f92c3eb6d42f1900c Supplier\n    8c2fa29c9d3b9dfd7e1230296e1038f8e27d16ce4a5bbbbcb629ac8f0f00e9c9 User\n\n#### First step, launch a local mainnet fork (repeat if things stop working). This will give you a local node running on http://localhost:8545/\n\n    npm run node\n\nYou can perform a full dev setup with a single command, for a more fine grained setup proceed to the second step below instead\n\n    npm run hardhat -- devsetup\n\n#### Second step, deploy a lootbox factory\n\n    npm run hardhat -- deploy-factory\n\n### All the next steps are for development and testing purposes only, and will not work on real networks\n\nDeploy a lootbox and transfer LINK to it. Also deploys a ERC20 with balance 100000, ERC721 with 20 tokens, ERC1155 with 10 tokens with 1000 balance each, and an ERC1155NFT with 15 tokens. All the reward tokens are added to whitelist of the lootbox and the supplier user given supply role\n\n    npm run hardhat -- deploy-lootbox\n\nDeploy additional lootboxes by specifying an optional `id` parameter, and others\n\n    npm run hardhat -- deploy-lootbox --id 10 --uri \"ipfs://somehash\" --linkamount 1000\n\nSupply rewards, as much as needed\n\n    npm run hardhat -- supply-rewards --type ERC20 --amount 1000\n    npm run hardhat -- supply-rewards --type ERC1155NFT --tokenid 3\n    npm run hardhat -- supply-rewards --type ERC1155 --tokenid 4 --amount 150\n    npm run hardhat -- supply-rewards --type ERC721 --tokenid 9\n\nSet amounts per unit \n\n    npm run hardhat -- set-amountperunit --type ERC20 --amountperunit 30\n    npm run hardhat -- set-amountperunit --type ERC1155 --tokenid 3 --amountperunit 35\n    npm run hardhat -- set-amountperunit --type ERC1155 --tokenid 4 --amountperunit 50\n\nSet price per lootbox \n\n    npm run hardhat -- set-price --price 0.001\n\nMint lootboxes to the user. TokenId represents how many rewards user will get per lootbox.\n\n    npm run hardhat -- mint\n\nAfter the user submits an open request, fulfill randomness\n\n    npm run hardhat -- fulfill\n\nYou can get help on any command by doing\n\n    npm run hardhat help fulfill\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainsafe%2Fvrf-lootbox-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainsafe%2Fvrf-lootbox-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainsafe%2Fvrf-lootbox-contracts/lists"}