{"id":19762807,"url":"https://github.com/dutterbutter/min-zksync-upgradability","last_synced_at":"2026-05-10T12:31:56.427Z","repository":{"id":256975900,"uuid":"852920339","full_name":"dutterbutter/min-zksync-upgradability","owner":"dutterbutter","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-13T15:32:06.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T23:42:50.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dutterbutter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-09-05T16:54:15.000Z","updated_at":"2024-09-17T06:09:04.000Z","dependencies_parsed_at":"2024-09-14T06:31:13.118Z","dependency_job_id":"93e33e46-cbb8-4d4f-bb3b-9f1e0a449b75","html_url":"https://github.com/dutterbutter/min-zksync-upgradability","commit_stats":null,"previous_names":["dutterbutter/min-zksync-upgradability"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fmin-zksync-upgradability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fmin-zksync-upgradability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fmin-zksync-upgradability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fmin-zksync-upgradability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dutterbutter","download_url":"https://codeload.github.com/dutterbutter/min-zksync-upgradability/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241094696,"owners_count":19908686,"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-11-12T04:07:06.146Z","updated_at":"2026-05-10T12:31:51.380Z","avatar_url":"https://github.com/dutterbutter.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# min-zksync-upgradability\n\nThis repository demonstrates a minimum setup for zkSync contract upgradability using [**foundry-zksync**](https://github.com/matter-labs/foundry-zksync). It includes scripts for deploying and upgrading contracts using the UUPS, Beacon, and Transparent proxy patterns on zkSync.\n\n## Prerequisites\n\nEnsure that you have **foundry-zksync** installed. Follow the installation instructions in the [Foundry-zksync repository](https://github.com/matter-labs/foundry-zksync).\n\n## Getting Started\n\nTo get started with this repository, follow the steps below:\n\n### 1. Clone the repository\n\n```bash\ngit clone git@github.com:dutterbutter/min-zksync-upgradability.git\n```\n\nNavigate into the project directory:\n\n```bash\ncd min-zksync-upgradability\n```\n\n### 2. Install Dependencies\n\nInstall the necessary dependencies using `forge`:\n\n```bash\nforge install\n```\n\n### 3. Build the Project for zkSync\n\nTo build the project for zkSync, run:\n\n```bash\nforge build --zksync\n```\n\n### 4. Private Key Setup with Foundry Keystore\n\nFollow these steps to securely store your wallet's private key to use it in Foundry projects:\n\n- **Extract Your Private Key**: If you're using a local zkSync Era node, use a private key from the available rich accounts. Otherwise, find your personal wallet's private key (e.g., from MetaMask).\n\n- **Create a Foundry Keystore**: Create a keystore and import your private key by running:\n\n    ```bash\n    cast wallet import myKeystore --interactive\n    ```\n\n    When prompted, enter your private key, provide a password, and copy the returned address (keystore address).\n\n    \u003e Note: The name `myKeystore` is arbitrary and can be changed. If you decide to use another name, ensure consistency when referencing it in commands.\n\n- **Using the Keystore**: When running commands requiring a private key (e.g., `forge create` or `cast send`), use:\n\n    ```bash\n    --account myKeystore --sender \u003cKEYSTORE_ADDRESS\u003e\n    ```\n\n    You'll need to enter the keystore password during execution.\n\n### 5. Running the Upgrade Scripts\n\nThe repository provides scripts to deploy and upgrade contracts using various upgradeability patterns. Execute these scripts using `forge script`:\n\n#### Deploy and Upgrade UUPS Proxy\n\n```bash\nforge script script/DeployAndUpgradeUUPSProxy.s.sol:DeployAndUpgradeUUPSProxy --slow --account \u003cYOUR-ACCOUNT-KEYSTORE\u003e --sender \u003cYOUR-SENDER-ADDRESS\u003e --rpc-url ZKsyncSepoliaTestnet --broadcast --zksync -vvvv\n```\n\n#### Deploy and Upgrade Transparent Proxy\n\n```bash\nforge script script/DeployAndUpgradeTransparentProxy.s.sol:DeployAndUpgradeTransparentProxy --slow --account \u003cYOUR-ACCOUNT-KEYSTORE\u003e --sender \u003cYOUR-SENDER-ADDRESS\u003e --rpc-url ZKsyncSepoliaTestnet --broadcast --zksync -vvvv\n```\n\n#### Deploy and Upgrade Beacon Proxy\n\n```bash\nforge script script/DeployAndUpgradeBeaconProxy.s.sol:DeployAndUpgradeBeaconProxy --slow --account \u003cYOUR-ACCOUNT-KEYSTORE\u003e --sender \u003cYOUR-SENDER-ADDRESS\u003e --rpc-url ZKsyncSepoliaTestnet --broadcast --zksync -vvvv\n```\n\n### 6. Explanation of Flags\n\n- **`--slow`**: This flag sends transactions one at a time, ensuring that they are executed in order, which is critical for upgradable contracts on ZKsync.\n  \n- **`--zksync`**: Compiles the sources for `zksolc` and automatically switches the execution to the ZKsync context, ensuring compatibility with zkSync Era.\n\n### 7. Broadcasting Transactions on zkSync\n\nTo execute the scripts and broadcast transactions correctly on ZKsync, make sure to use the **--slow** and **--zksync** flags to ensure that transactions are processed sequentially and compiled for the ZKsync network.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdutterbutter%2Fmin-zksync-upgradability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdutterbutter%2Fmin-zksync-upgradability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdutterbutter%2Fmin-zksync-upgradability/lists"}