{"id":23858776,"url":"https://github.com/tthebc01/create2-example","last_synced_at":"2026-05-14T01:39:24.036Z","repository":{"id":248982788,"uuid":"830337573","full_name":"TtheBC01/create2-example","owner":"TtheBC01","description":"Minimal example of using create2 opcode in solidity","archived":false,"fork":false,"pushed_at":"2024-07-22T05:53:34.000Z","size":380,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T10:38:48.905Z","etag":null,"topics":["create2-opcode","openzeppelin-solidity","solidity"],"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/TtheBC01.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":"2024-07-18T04:53:35.000Z","updated_at":"2024-07-22T05:53:37.000Z","dependencies_parsed_at":"2024-07-22T06:41:40.848Z","dependency_job_id":null,"html_url":"https://github.com/TtheBC01/create2-example","commit_stats":null,"previous_names":["tthebc01/create2-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TtheBC01/create2-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TtheBC01%2Fcreate2-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TtheBC01%2Fcreate2-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TtheBC01%2Fcreate2-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TtheBC01%2Fcreate2-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TtheBC01","download_url":"https://codeload.github.com/TtheBC01/create2-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TtheBC01%2Fcreate2-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33006679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["create2-opcode","openzeppelin-solidity","solidity"],"created_at":"2025-01-03T03:19:15.764Z","updated_at":"2026-05-14T01:39:23.993Z","avatar_url":"https://github.com/TtheBC01.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Create2 Example Using OpenZeppelin and Hardhat\n\nUpdated example of OpenZeppelin [Create2](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol) \nlibrary using Solidity `0.8.24` and OZ v `5.0.2` using the Hardhat framework. \n\nThis demo shows how to use Create2 to deploy a vanilla Vault contract with [Create2.deploy](/contracts/VaultFactory.sol#L32) and the [new keyword](/contracts/VaultFactory.sol#L45) as well as an upgradeable Vault via an [Upgradeable Beacon](/contracts/VaultFactory.sol#L56).\n\nCheck out [CreateX](https://createx.rocks/) while you are researching this topic.\n\n**IMPORTANT**: \nIf you change anything within a smart contract (even white spaces), you will get a different deployment address across networks. \n\n```sh\ngit clone https://github.com/TtheBC01/create2-example.git\ncd create2-example\nnpm install\n```\n\n## Setup you ENV file\n\n```sh\ncp .env-sample .env\n```\n\nThen add add either a private key or mnemonic with testnet funds if you want to deploy to a testnet.\n\nThis example has already been deployed to Fuji and Sepolia testnets, so you'll need to change the salt value or the owner address to something else if you want\nto try that yourself. \n\n## Run Tests\n\n```sh\nnpx hardhat test\n```\n\n## Deploying the Vault Factory\n\nChange the `owner` address in the [VaultFactory.ts](/ignition/modules/VaultFactory.ts#L5) module to an account you control before deploying:\n\n```sh\nnpx hardhat ignition deploy ignition/modules/VaultFactory.ts --network sepolia --strategy create2\n```\n\nVaultFactory address on [fuji](https://testnet.snowtrace.io/address/0x0568846C86B727Ba76794fF1bFD0713384d879ab) and [sepolia](https://sepolia.etherscan.io/address/0x0568846C86B727Ba76794fF1bFD0713384d879ab): `0x0568846C86B727Ba76794fF1bFD0713384d879ab`\n\n## Hardhat Tasks\n\n```sh\n# predict the address of a proxy Vault\nnpx hardhat getProxyAddress --name TtheBC01 --network fuji\n# predict the address of a regular Vault\nnpx hardhat getVaultAddress --name TtheBC01 --network fuji\n\n# deploy a proxy Vault (change the owner and name to something else)\nnpx hardhat deployProxy --name TtheBC01 --owner 0x9fEad8B19C044C2f404dac38B925Ea16ADaa2954 --network fuji\n# deploy a regular Vault (change the owner and name to something else)\nnpx hardhat deployVault --name TtheBC01 --owner 0x9fEad8B19C044C2f404dac38B925Ea16ADaa2954 --network fuji\n\n# check the owner address of a proxy Vault\nnpx hardhat getProxyOwner --name TtheBC01 --network sepolia\n# check the owner address of a regular Vault\nnpx hardhat getVaultOwner --name TtheBC01 --network sepolia\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftthebc01%2Fcreate2-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftthebc01%2Fcreate2-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftthebc01%2Fcreate2-example/lists"}