{"id":18794487,"url":"https://github.com/chainstacklabs/lottery-contract-cronos-hardhat","last_synced_at":"2025-09-02T06:32:49.637Z","repository":{"id":145844227,"uuid":"602493778","full_name":"chainstacklabs/lottery-contract-cronos-hardhat","owner":"chainstacklabs","description":"Learn how to develop and deploy a lottery smart contract on Cronos using Chainstack and Hardhat","archived":false,"fork":false,"pushed_at":"2024-04-04T14:56:21.000Z","size":1468,"stargazers_count":3,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-04T21:18:41.924Z","etag":null,"topics":["blockchain","hardhat","smart-contract","solidity"],"latest_commit_sha":null,"homepage":"https://chainstack.com/lottery-smart-contract-on-cronos-blockchain/","language":"JavaScript","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/chainstacklabs.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":"2023-02-16T10:28:51.000Z","updated_at":"2024-01-27T04:35:08.000Z","dependencies_parsed_at":"2024-12-29T16:41:01.152Z","dependency_job_id":null,"html_url":"https://github.com/chainstacklabs/lottery-contract-cronos-hardhat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chainstacklabs/lottery-contract-cronos-hardhat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Flottery-contract-cronos-hardhat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Flottery-contract-cronos-hardhat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Flottery-contract-cronos-hardhat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Flottery-contract-cronos-hardhat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainstacklabs","download_url":"https://codeload.github.com/chainstacklabs/lottery-contract-cronos-hardhat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Flottery-contract-cronos-hardhat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244301,"owners_count":25070958,"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-02T02:00:09.530Z","response_time":77,"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":["blockchain","hardhat","smart-contract","solidity"],"created_at":"2024-11-07T21:29:35.560Z","updated_at":"2025-09-02T06:32:48.284Z","avatar_url":"https://github.com/chainstacklabs.png","language":"JavaScript","readme":"\u003cimg width=\"1200\" alt=\"Labs\" src=\"https://user-images.githubusercontent.com/99700157/213291931-5a822628-5b8a-4768-980d-65f324985d32.png\"\u003e\n\n\u003cp\u003e\n \u003ch3 align=\"center\"\u003eChainstack is the leading suite of services connecting developers with Web3 infrastructure\u003c/h3\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-ethereum/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Ethereum.svg\" /\u003e\u003c/a\u003e\u0026nbsp;  \n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-bnb-smart-chain/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/BNB.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-polygon/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Polygon.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-avalanche/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Avalanche.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-solana/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Solana.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/protocols/\"\u003eSupported protocols\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/blog/\"\u003eChainstack blog\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://docs.chainstack.com/\"\u003eChainstack docs\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://docs.chainstack.com/api/\"\u003eBlockchain API reference\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://console.chainstack.com/user/account/create\"\u003eStart for free\u003c/a\u003e\n\u003c/p\u003e\n\n# Lottery smart contract on Cronos blockchain\n\nIn this tutorial, you will learn how to build a lottery smart contract using Solidity, and how to deploy and verify smart contracts on the Cronos blockchain using Hardhat.\nThis repo serves as the codebase for you to be able to follow along comfortably with the written tutorial on Chainstack's blog:\n\n- [Lottery smart contract on Cronos blockchain](https://chainstack.com/lottery-smart-contract-on-cronos-blockchain/ \"Lottery smart contract on Cronos blockchain\")\n\n## Project details\n\nCronos is an EVM-compatible layer 1 blockchain, equipped with the unique Inter Blockchain Communications (IBC) protocol powered by the Cosmos SDK. This gives Cronos interoperability between Cosmos and EVM ecosystems.\n\nIn this project you will be create, test, deploy and verify a Lottery smart contract on the Cronos Testnet straight from Hardhat's command line.\n\n## Quick Start\n\nClone this repository.\n\n### Install project-level dependencies:\n```bash\nnpm install\n```\n\n### Setting up dotenv file\n\nRun this command at the root of oyur terminal to create a dotenv file:\n```bash\ntouch .env\n```\nConfigure it along the following lines:\n\n```bash\nRPC_URL=CHAINSTACK_CRONOS_NODE_URL\nPRIVATE_KEY=YOUR_PRIVATE_KEY\nAPI_KEY=CRONOSCAN_API_KEY(to verify the smart contract)\n```\nSave the dotenv file and run this command in your terminal:\n\n```bash\nsource .env\n```\n\n\n### Compile smart contract\n```bash\nnpx hardhat compile\n```\n\n### Testing in Hardhat\n\nRun this command to start a local Hardhat node in your terminal:\n\n```bash\nnpx hardhat node\n```\nRun the tests on your local node with:\n\n```bash\nnpx hardhat test --network localhost\n```\n\n### Deploy and verify\n\nYou already have the deploy script setup in scripts/DeployDutch.js. To dpeloy on Cronos testnet, simply run:\n\n```bash\nnpx hardhat run --network Cronos_testnet scripts/DeployDutch.js\n```\n\nTo verify:\n\n```bash\nnpx hardhat verify --network Cronos_testnet {Contract Address}\n```\n\n## Conclusion\n\nYou now have a deployed and verified smart contract on the Cronos Testnet. Feel free to create your own project from scratch by following along with our blog, linked above.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainstacklabs%2Flottery-contract-cronos-hardhat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainstacklabs%2Flottery-contract-cronos-hardhat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainstacklabs%2Flottery-contract-cronos-hardhat/lists"}