{"id":15924085,"url":"https://github.com/ericglau/custom-beacon","last_synced_at":"2025-04-03T12:45:53.241Z","repository":{"id":116634943,"uuid":"575023753","full_name":"ericglau/custom-beacon","owner":"ericglau","description":"Hardhat Upgrades with Custom Beacon","archived":false,"fork":false,"pushed_at":"2022-12-06T19:17:43.000Z","size":163,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T02:15:39.048Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ericglau.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-12-06T15:30:25.000Z","updated_at":"2022-12-06T15:31:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"50e6cde3-a390-4929-83ac-3d1a47a78ce0","html_url":"https://github.com/ericglau/custom-beacon","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/ericglau%2Fcustom-beacon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericglau%2Fcustom-beacon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericglau%2Fcustom-beacon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericglau%2Fcustom-beacon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericglau","download_url":"https://codeload.github.com/ericglau/custom-beacon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247005406,"owners_count":20868019,"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-10-06T21:20:19.256Z","updated_at":"2025-04-03T12:45:53.217Z","avatar_url":"https://github.com/ericglau.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hardhat Upgrades with Custom Beacon\n\nThis project demonstrates how to use a custom beacon with [OpenZeppelin Hardhat Upgrades](https://docs.openzeppelin.com/upgrades-plugins/1.x/hardhat-upgrades). It comes with some example contracts, a test case, and a deployment script.\n\nThe custom beacon used in this example is an upgradeable beacon with role-based access control.\n\n## Overview\n\nIn this scenario, OpenZeppelin Hardhat Upgrades handles validations and deployment of implementation contracts, beacon proxies, and upgrades, with a custom beacon that is deployed directly.\n\nThe steps are:\n1. Use [`deployImplementation`](https://docs.openzeppelin.com/upgrades-plugins/1.x/api-hardhat-upgrades#deploy-implementation) to validate and deploy the implementation.\n2. Deploy the custom beacon contract directly using the `deploy` function from the ethers contract factory.\n3. Use [`deployBeaconProxy`](https://docs.openzeppelin.com/upgrades-plugins/1.x/api-hardhat-upgrades#deploy-beacon-proxy) to deploy a beacon proxy, and/or use [`upgradeBeacon`](https://docs.openzeppelin.com/upgrades-plugins/1.x/api-hardhat-upgrades#upgrade-beacon) to validate and upgrade the implementation to a new version.\n\n## Installing dependencies\n\n```\nnpm install\n```\n\n## Testing\n\nSee [test/test.ts](test/test.ts) for an example test case.\n\nRun tests with:\n```\nnpm test\n```\n\n## Deploying\n\nSee [scripts/deploy.ts](scripts/deploy.ts) for an example deployment script.\n\nSet the `DEFAULT_ADMIN_ADDRESS` and `UPGRADER_ADDRESS` constants in the script.\n\nRun the script to target any network from your Hardhat config using:\n```\nnpx hardhat run --network \u003cnetwork-name\u003e scripts/deploy.ts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericglau%2Fcustom-beacon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericglau%2Fcustom-beacon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericglau%2Fcustom-beacon/lists"}