{"id":13759845,"url":"https://github.com/alchemyplatform/polygon-smart-contract-tutorial","last_synced_at":"2025-07-10T22:32:02.521Z","repository":{"id":103992143,"uuid":"477870659","full_name":"alchemyplatform/polygon-smart-contract-tutorial","owner":"alchemyplatform","description":"A guide for coding and deploying a basic Polygon (MATIC) smart contract!","archived":false,"fork":false,"pushed_at":"2022-04-11T05:35:07.000Z","size":377,"stargazers_count":13,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-16T16:37:37.639Z","etag":null,"topics":["alchemy","ethersjs","hardhat","matic"],"latest_commit_sha":null,"homepage":"https://docs.alchemy.com/alchemy/tutorials/how-to-code-and-deploy-a-polygon-smart-contract","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/alchemyplatform.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}},"created_at":"2022-04-04T20:56:57.000Z","updated_at":"2024-11-12T03:40:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2e5e91d-5ecf-41c4-8755-bdf58d2bccd1","html_url":"https://github.com/alchemyplatform/polygon-smart-contract-tutorial","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/alchemyplatform%2Fpolygon-smart-contract-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fpolygon-smart-contract-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fpolygon-smart-contract-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fpolygon-smart-contract-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alchemyplatform","download_url":"https://codeload.github.com/alchemyplatform/polygon-smart-contract-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225658502,"owners_count":17503667,"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":["alchemy","ethersjs","hardhat","matic"],"created_at":"2024-08-03T13:00:59.940Z","updated_at":"2024-11-21T02:15:27.087Z","avatar_url":"https://github.com/alchemyplatform.png","language":"JavaScript","readme":"# How to Code, Deploy, and Interact with a Polygon (MATIC) Smart Contract\n\nFollow the full written tutorial [here](https://docs.alchemy.com/alchemy/tutorials/how-to-code-and-deploy-a-polygon-smart-contract).\n\nFollow the full video tutorial here.\n\n## Quickstart\n\n1. `npm install`\n2. Rename `.env-example` to `.env`, and populate the variable values.\n    1. Grab `API_URL` from [www.alchemy.com](https://alchemy.com/?a=polygon-smart-contract) by setting up a Polygon Mumbai testnet app.\n    2. For `PRIVATE_KEY`, use your Ethereum wallet address's corresponding private key.\n    3. You can leave `CONTRACT_ADDRESS` blank until you deploy with `npx run scripts/sample-script.js`, then grab the address where you deployed your contract to.\n    4. `ALCHEMY_API_KEY` is very similar to `API_URL` except you can remove the http or ws prefix.\n    5. `MATIC_URL` you can grab from [www.alchemy.com](https://alchemy.com/?a=polygon-smart-contract) but make sure your Alchemy app is a Polygon Mainnet app.\n3. run `npx run scripts/sample-script.js --network mumbai` to deploy your contract to Mumbai testnet\n4. run `npx run scripts/greet.js --network mumbai` to modify blockchain state by calling the Greet function on your smart contract.\n5. Repeat those steps with `--network matic` to deploy and interact on Polygon (MATIC) mainnet chain. ","funding_links":[],"categories":["dApps directory"],"sub_categories":["Smart Contract Templates"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fpolygon-smart-contract-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchemyplatform%2Fpolygon-smart-contract-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fpolygon-smart-contract-tutorial/lists"}