{"id":22646958,"url":"https://github.com/dutterbutter/anvil-zksync-action","last_synced_at":"2025-03-29T06:47:23.903Z","repository":{"id":265286203,"uuid":"895673001","full_name":"dutterbutter/anvil-zksync-action","owner":"dutterbutter","description":"GitHub Action for quick CI/CD usage with anvil-zksync","archived":false,"fork":false,"pushed_at":"2025-03-27T17:57:47.000Z","size":1240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T18:46:23.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/matter-labs/anvil-zksync","language":"JavaScript","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":"CHANGELOG.md","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-11-28T16:47:45.000Z","updated_at":"2025-03-27T17:56:06.000Z","dependencies_parsed_at":"2024-11-28T18:34:48.924Z","dependency_job_id":"39cedb12-861c-4f5e-a7cf-6d510ed7d2db","html_url":"https://github.com/dutterbutter/anvil-zksync-action","commit_stats":null,"previous_names":["dutterbutter/anvil-zksync-action"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fanvil-zksync-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fanvil-zksync-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fanvil-zksync-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dutterbutter%2Fanvil-zksync-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dutterbutter","download_url":"https://codeload.github.com/dutterbutter/anvil-zksync-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246150408,"owners_count":20731419,"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-12-09T07:31:37.292Z","updated_at":"2025-03-29T06:47:23.890Z","avatar_url":"https://github.com/dutterbutter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# anvil-zksync Action 🚀\n\nThis repository has been renamed from `era-test-node-action` to `anvil-zksync-action`. All references to the previous name have been updated to reflect this change.\n\n## Description\n\nThis GitHub Action runs the [`anvil-zksync`](https://github.com/matter-labs/anvil-zksync) with various options. It offers high configurability, making it easy to integrate `anvil-zksync` into your CI/CD workflows on GitHub Actions.\n\n**anvil-zksync repo**: [matter-labs/anvil-zksync](https://github.com/matter-labs/anvil-zksync).\n\n## Features 🌟\n\n- **Multiple Modes:** Supports `run` and `fork` modes for flexible testing scenarios.\n- **Network Forking:** Allows you to fork from any network (e.g., `mainnet`, `sepolia-testnet`) at a specific block height or transaction hash.\n- **Detailed Logging:** Configurable options to display calls, storage logs, VM details, and gas details.\n- **Hash Resolution:** Enables ABI and topic name resolution for better readability.\n- **Customizable Gas Configuration:** Set custom gas prices and scale factors for more accurate simulations.\n- **System Configuration:** Override bytecodes and specify system contracts for advanced setups.\n- **Caching Mechanism:** Supports in-memory or disk caching with options to reset or specify cache directories.\n- **Account Management:** Configure the number of dev accounts, their balances, and derivation paths.\n\n## Example Usage 📝\n\n### Quickstart\n\nRun `anvil-zksync` with default settings.\n\n```yml\nname: Run anvil-zksync\n\non:\n  push:\n    branches: [ main ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n\n      - name: Run anvil-zksync\n        uses: dutterbutter/anvil-zksync-action@v1.1.0\n```\n\n### Forking from Mainnet\n\nRun `anvil-zksync` in fork mode, forking from mainnet at a specific block height.\n\n```yml\nname: Run anvil-zksync\n\non:\n  push:\n    branches: [ main ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n\n      - name: Run anvil-zksync with fork\n        uses: dutterbutter/anvil-zksync-action@v1.1.0\n        with:\n          mode: 'fork'\n          forkUrl: 'https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID'\n          forkBlockNumber: '12345678'\n          port: '8545'\n          chainId: '1'\n          debugMode: 'true'\n          showCalls: 'all'\n          showStorageLogs: 'write'\n          showVmDetails: 'all'\n          showGasDetails: 'all'\n          resolveHashes: 'true'\n          log: 'debug'\n          logFilePath: 'logs/anvil_zksync.log'\n          target: 'x86_64-unknown-linux-gnu'\n          releaseTag: 'latest'\n```\n\n### Upload Log File to Artifacts\n\nRun `anvil-zksync` and upload the log file as a GitHub Action artifact.\n\n```yml\nname: Run anvil-zksync\n\non:\n  pull_request:\n    branches: [main]\n  workflow_dispatch:\n\njobs:\n  test:\n    name: Unit Tests\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout Code\n        uses: actions/checkout@v3\n      \n      - name: Run anvil-zksync\n        uses: dutterbutter/anvil-zksync-action@v1.1.0\n        with:\n          mode: 'fork'\n          forkUrl: 'https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID'\n          showCalls: 'user'\n          showStorageLogs: 'read'\n          showVmDetails: 'all'\n          showGasDetails: 'all'\n          resolveHashes: 'true'\n          log: 'info'\n          logFilePath: 'anvil_zksync.log'\n          target: 'x86_64-unknown-linux-gnu'\n          releaseTag: 'latest'\n\n      - name: Install Dependencies\n        run: yarn install\n      \n      - name: Run Tests\n        run: |\n          yarn test:contracts\n\n      - name: Upload Anvil ZKSYNC Log\n        uses: actions/upload-artifact@v4\n        with:\n          name: anvil_zksync-log\n          path: anvil_zksync.log\n```\n\n### Using Custom Accounts\n\nRun `anvil-zksync` with custom account configurations.\n\n```yml\nname: Run Anvil ZKSYNC Action\n\non:\n  push:\n    branches: [ main ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n\n      - name: Run Anvil ZKSync with EVM Emulation\n        uses: dutterbutter/anvil-zksync-action@v1.1.0\n        with:\n          mode: 'run'\n          accounts: '20'\n          balance: '5000'\n          mnemonic: 'test test test test test test test test test test test junk'\n          derivationPath: \"m/44'/60'/0'/0/\"\n          autoImpersonate: 'true'\n          blockTime: '15'\n          log: 'debug'\n          logFilePath: 'anvil_zksync.log'\n          target: 'x86_64-unknown-linux-gnu'\n          releaseTag: 'latest'\n```\n\n---\n\n## Additional Information\n\n### Handling Sensitive Inputs Securely\n\nEnsure that sensitive inputs like `mnemonic` are stored securely using GitHub Secrets and not exposed in logs. For example, use the `secrets` context to pass sensitive data:\n\n```yml\n- name: Run anvil-zksync\n  uses: dutterbutter/anvil-zksync-action@v1.1.0\n  with:\n    mnemonic: ${{ secrets.MNEMONIC }}\n    # ... other inputs\n```\n\n## Inputs 🛠\n\n### `releaseTag`\n\n**Description:**  \nRelease tag of `anvil-zksync` to use.\n\n- **Required:** No\n- **Default:** `latest`\n- **Example:** `v1.0.0`\n\n---\n\n### `target`\n\n**Description:**  \nTarget architecture for the `anvil-zksync` binary.\n\n- **Required:** No\n- **Default:** `x86_64-unknown-linux-gnu`\n- **Options:** \n  - `x86_64-unknown-linux-gnu`\n  - `x86_64-apple-darwin`\n  - `aarch64-apple-darwin`\n\n---\n\n### `mode`\n\n**Description:**  \nMode to run `anvil-zksync` in.\n\n- **Required:** No\n- **Default:** `run`\n- **Options:** \n  - `run`\n  - `fork`\n\n---\n\n### `forkUrl`\n\n**Description:**  \nThe network URL to fork from (e.g., `https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID`). **Must be used alongside `mode` set to `fork`.**\n\n- **Required:** No\n\n---\n\n### `forkBlockNumber`\n\n**Description:**  \nFetch state from a specific block number over a remote endpoint. **Must be used alongside `mode` set to `fork`.**\n\n- **Required:** No\n- **Example:** `12345678`\n\n---\n\n### `forkTransactionHash`\n\n**Description:**  \nFetch state from a specific transaction hash over a remote endpoint. **Must be used alongside `mode` set to `fork`.**\n\n- **Required:** No\n- **Example:** `0xabcdef123456...`\n\n---\n\n### `port`\n\n**Description:**  \nPort to listen on.\n\n- **Required:** No\n- **Default:** `8011`\n- **Example:** `8545`\n\n---\n\n### `host`\n\n**Description:**  \nThe host IP address to listen on.\n\n- **Required:** No\n- **Default:** `127.0.0.1`\n- **Example:** `0.0.0.0`\n\n---\n\n### `chainId`\n\n**Description:**  \nSpecify the chain ID.\n\n- **Required:** No\n- **Default:** `260`\n- **Example:** `1`\n\n---\n\n### `debugMode`\n\n**Description:**  \nEnable debug mode for more verbose logging.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `showCalls`\n\n**Description:**  \nShow call debug information.\n\n- **Required:** No\n- **Default:** `none`\n- **Options:** \n  - `none`\n  - `user`\n  - `system`\n  - `all`\n\n---\n\n### `showOutputs`\n\n**Description:**  \nShow call output information.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `showStorageLogs`\n\n**Description:**  \nShow storage log information.\n\n- **Required:** No\n- **Default:** `none`\n- **Options:** \n  - `none`\n  - `read`\n  - `write`\n  - `paid`\n  - `all`\n\n---\n\n### `showVmDetails`\n\n**Description:**  \nShow VM details information.\n\n- **Required:** No\n- **Default:** `none`\n- **Options:** \n  - `none`\n  - `all`\n\n---\n\n### `showGasDetails`\n\n**Description:**  \nShow gas details information.\n\n- **Required:** No\n- **Default:** `none`\n- **Options:** \n  - `none`\n  - `all`\n\n---\n\n### `resolveHashes`\n\n**Description:**  \nEnable ABI and topic name resolution for better readability.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `log`\n\n**Description:**  \nLog filter level.\n\n- **Required:** No\n- **Default:** `info`\n- **Options:** \n  - `debug`\n  - `info`\n  - `warn`\n  - `error`\n\n---\n\n### `logFilePath`\n\n**Description:**  \nPath to the log file.\n\n- **Required:** No\n- **Default:** `anvil_zksync.log`\n- **Example:** `logs/anvil_zksync.log`\n\n---\n\n### `offline`\n\n**Description:**  \nRun in offline mode.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `healthCheckEndpoint`\n\n**Description:**  \nEnable health check endpoint.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `configOut`\n\n**Description:**  \nOutput config file path.\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `config.json`\n\n---\n\n### `l1GasPrice`\n\n**Description:**  \nCustom L1 gas price (in wei).\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `20000000000`\n\n---\n\n### `l2GasPrice`\n\n**Description:**  \nCustom L2 gas price (in wei).\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `1000000000`\n\n---\n\n### `l1PubdataPrice`\n\n**Description:**  \nCustom L1 pubdata price (in wei).\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `1000000000`\n\n---\n\n### `priceScaleFactor`\n\n**Description:**  \nGas price estimation scale factor.\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `1.2`\n\n---\n\n### `limitScaleFactor`\n\n**Description:**  \nGas limit estimation scale factor.\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `1.1`\n\n---\n\n### `overrideBytecodesDir`\n\n**Description:**  \nDirectory to override bytecodes.\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `bytecodes/`\n\n---\n\n### `devSystemContracts`\n\n**Description:**  \nOption for system contracts.\n\n- **Required:** No\n- **Default:** Not set\n- **Options:** \n  - `built-in`\n  - `local`\n  - `built-in-without-security`\n\n---\n\n### `emulateEvm`\n\n**Description:**  \nEnable EVM emulation.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `cache`\n\n**Description:**  \nCache type.\n\n- **Required:** No\n- **Default:** `disk`\n- **Options:** \n  - `none`\n  - `memory`\n  - `disk`\n\n---\n\n### `resetCache`\n\n**Description:**  \nReset the local disk cache.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `cacheDir`\n\n**Description:**  \nCache directory location for disk cache.\n\n- **Required:** No\n- **Default:** `.cache`\n- **Example:** `/tmp/cache`\n\n---\n\n### `accounts`\n\n**Description:**  \nNumber of dev accounts to generate and configure.\n\n- **Required:** No\n- **Default:** `10`\n- **Example:** `20`\n\n---\n\n### `balance`\n\n**Description:**  \nThe balance of every dev account in Ether.\n\n- **Required:** No\n- **Default:** `10000`\n- **Example:** `5000`\n\n---\n\n### `mnemonic`\n\n**Description:**  \nBIP39 mnemonic phrase for generating accounts.\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `test test test test test test test test test test test junk`\n\n---\n\n### `mnemonicRandom`\n\n**Description:**  \nAutomatically generate a BIP39 mnemonic phrase.\n\n- **Required:** No\n- **Default:** `12` (number of words)\n- **Example:** `24`\n\n---\n\n### `mnemonicSeedUnsafe`\n\n**Description:**  \nGenerate a BIP39 mnemonic from a given seed (unsafe for production).\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `0x123456789abcdef...`\n\n---\n\n### `derivationPath`\n\n**Description:**  \nDerivation path of the child key to be derived.\n\n- **Required:** No\n- **Default:** `m/44'/60'/0'/0/`\n- **Example:** `m/44'/60'/0'/0/1`\n\n---\n\n### `autoImpersonate`\n\n**Description:**  \nEnable automatic impersonation on startup.\n\n- **Required:** No\n- **Default:** `false`\n- **Options:** `true`, `false`\n\n---\n\n### `blockTime`\n\n**Description:**  \nBlock time in seconds for interval sealing.\n\n- **Required:** No\n- **Default:** Not set\n- **Example:** `15`\n\n---\n\n### Support\n\nIf you encounter issues not covered in the troubleshooting section, feel free to [open an issue](https://github.com/dutterbutter/anvil-zksync-action/issues) in the repository.\n\n## Contributing 🤝\n\nFeel free to open issues or PRs if you find any problems or have suggestions for improvements. Your contributions are more than welcome!\n\n## License 📄\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n**Happy Testing! 🚀**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdutterbutter%2Fanvil-zksync-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdutterbutter%2Fanvil-zksync-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdutterbutter%2Fanvil-zksync-action/lists"}