{"id":22497070,"url":"https://github.com/anajuliabit/randomness_solidity","last_synced_at":"2025-07-09T12:44:30.675Z","repository":{"id":133939423,"uuid":"458984175","full_name":"anajuliabit/randomness_solidity","owner":"anajuliabit","description":"Secure random number generator in solidity","archived":false,"fork":false,"pushed_at":"2022-02-16T22:13:31.000Z","size":186,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-20T12:20:51.883Z","etag":null,"topics":["hardhat","nft","randomness","rng","solidity"],"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/anajuliabit.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":"2022-02-14T01:58:45.000Z","updated_at":"2024-12-12T13:57:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2ef3220-f277-496b-aef2-be8ce21c6dd8","html_url":"https://github.com/anajuliabit/randomness_solidity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anajuliabit%2Frandomness_solidity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anajuliabit%2Frandomness_solidity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anajuliabit%2Frandomness_solidity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anajuliabit%2Frandomness_solidity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anajuliabit","download_url":"https://codeload.github.com/anajuliabit/randomness_solidity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238603807,"owners_count":19499502,"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":["hardhat","nft","randomness","rng","solidity"],"created_at":"2024-12-06T20:16:07.061Z","updated_at":"2025-02-13T06:17:13.301Z","avatar_url":"https://github.com/anajuliabit.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Randomness Solidity\n\nThis project is a demonstration of two solutions for the generation of pseudo-random numbers in Solidity.\n\n## Solutions\n\n- [OnChain](/contracts/OnChain.sol): Solution with 2 on chain steps to remove any possibility of taking advantage of the participants.\n- [OffChain](/contracts/OffChain) Solution using oracle.\n\n## Mumbai address\n\n- OnChain: [0xf08285fc747c17140ff24b98ab46e58d4dc11fec](https://mumbai.polygonscan.com/address/0xf08285fc747c17140ff24b98ab46e58d4dc11fec)\n- OffChain: [0xa48b924a93b1495b90f170ee90234c9b04868846](https://mumbai.polygonscan.com/address/0xa48b924a93b1495b90f170ee90234c9b04868846)\n\n## Tasks\n\n```shell\nnpx hardhat accounts\nnpx hardhat compile\nnpx hardhat clean\nnpx hardhat test\nnpx hardhat node\nnpx hardhat help\nREPORT_GAS=true npx hardhat test\nnpx hardhat coverage\nnpx hardhat run scripts/deploy.ts\nTS_NODE_FILES=true npx ts-node scripts/deploy.ts\nnpx eslint '**/*.{js,ts}'\nnpx eslint '**/*.{js,ts}' --fix\nnpx prettier '**/*.{json,sol,md}' --check\nnpx prettier '**/*.{json,sol,md}' --write\nnpx solhint 'contracts/**/*.sol'\nnpx solhint 'contracts/**/*.sol' --fix\n```\n\n# Etherscan verification\n\nTo try out Etherscan verification, you first need to deploy a contract to an Ethereum network that's supported by Etherscan, such as Ropsten.\n\nIn this project, copy the .env.example file to a file named .env, and then edit it to fill in the details. Enter your Etherscan API key, your Ropsten node URL (eg from Alchemy), and the private key of the account which will send the deployment transaction. With a valid .env file in place, first deploy your contract:\n\n```shell\nhardhat run --network ropsten scripts/sample-script.ts\n```\n\nThen, copy the deployment address and paste it in to replace `DEPLOYED_CONTRACT_ADDRESS` in this command:\n\n```shell\nnpx hardhat verify --network ropsten DEPLOYED_CONTRACT_ADDRESS \"Hello, Hardhat!\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanajuliabit%2Frandomness_solidity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanajuliabit%2Frandomness_solidity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanajuliabit%2Frandomness_solidity/lists"}