Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into support-practices
Browse files Browse the repository at this point in the history
  • Loading branch information
bxpana authored Apr 29, 2024
2 parents 9efde90 + ed2e747 commit 3c92d47
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 58 deletions.
30 changes: 8 additions & 22 deletions docs/build/test-and-debug/era-test-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ Here's an example of what you should expect to see:
{"jsonrpc":"2.0","result":"0x0000000000000000000000000000000000000000000000000000000000000012","id":1}
```

Or, if you prefer, use [`foundry-zksync`](https://github.com/matter-labs/foundry-zksync). Make sure to install and configure `foundry-zksync` before proceeding (for installation instructions, please see this [link](https://github.com/matter-labs/foundry-zksync/tree/main#foundry-with-zksync-era-v01)):
Or, if you prefer, use [`foundry-zksync`](https://github.com/matter-labs/foundry-zksync). Make sure to install and configure `foundry-zksync` before proceeding (for installation instructions, please see this [link](https://github.com/matter-labs/foundry-zksync?tab=readme-ov-file#-prerequisites)):

```bash
zkcast call 0xe1134444211593Cfda9fc9eCc7B43208615556E2 "name()(string)" --rpc-url http://localhost:8011
cast call 0xe1134444211593Cfda9fc9eCc7B43208615556E2 "name()(string)" --rpc-url http://localhost:8011
```

Here's an example of what you should expect to see:
Expand All @@ -255,7 +255,7 @@ Uniswap
Retrieve the balance of a particular contract:

```bash
zkcast call 0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78 "balanceOf(address)(uint256)" 0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78 --rpc-url http://localhost:8011
cast call 0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78 "balanceOf(address)(uint256)" 0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78 --rpc-url http://localhost:8011
```

Here's an example of what you should expect to see:
Expand All @@ -266,25 +266,12 @@ Here's an example of what you should expect to see:

### Deploying contracts

For the deployment of your contracts, you have the flexibility to choose between two preferred methods: either by using Hardhat with the `hardhat-zksync-deploy` and `hardhat-zksync-solc` plugins, or via `foundry-zksync`. The following example will detail the process using `foundry-zksync`.
For the deployment of your contracts, you have the flexibility to choose between two preferred methods: either by using Hardhat with the `@matter-labs/hardhat-zksync`, or via `foundry-zksync`. The following example will detail the process using `foundry-zksync`.

Before proceeding, ensure that you've compiled your contracts using `zkforge zk-build`. For instructions on how to do this, please refer to this [link](https://github.com/matter-labs/foundry-zksync#compile-with-zkforge-zk-build).
Before proceeding, ensure that you've compiled your contracts using `forge build --zksync`.

```bash
zkforge zkc contracts/Greeter.sol:Greeter --constructor-args "ZkSync and Foundry" --private-key 7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 --rpc-url http://localhost:8011 --chain 260
```

Here's an example of what you should expect to see:

```bash
Deploying contract...
+-------------------------------------------------+
Contract successfully deployed to address: 0x0a40ecde17dc16c4001bf0e4f5d5ff1818219b3b
Transaction Hash: 0x9d59bea38ca6f3cef365c23f339547bcc8ce28abb8344999ffffa5fa62c9ff8e
Gas used: 2570407
Effective gas price: 500
Block Number: 8072361
+-------------------------------------------------+
forge create contracts/Greeter.sol:Greeter --constructor-args "ZkSync and Foundry" --private-key 7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 --rpc-url http://localhost:8011 --chain 260 --zksync
```

## Testing bootloader and system contracts
Expand Down Expand Up @@ -366,8 +353,7 @@ Ensure era-test-node is running in another process before executing yarn test.
:::

```typescript
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
import "@matterlabs/hardhat-zksync";

module.exports = {
zksolc: {
Expand Down Expand Up @@ -399,7 +385,7 @@ module.exports = {
import { expect } from "chai";
import { Wallet, Provider, Contract } from "zksync-ethers";
import * as hre from "hardhat";
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { Deployer } from "@matterlabs/hardhat-zksync";

const RICH_WALLET_PK = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110";

Expand Down
26 changes: 15 additions & 11 deletions docs/build/tooling/data-indexers.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,35 @@ head:

Welcome to the Analytics page, a comprehensive hub dedicated to interacting with data services, analytic tooling on zkSync Era. Each guide includes hands-on examples, ensuring that both newcomers and experienced developers can seamlessly harness the power of the analytical tooling within the zkSync Era.

### The Graph Network

[The Graph](https://thegraph.com/) is a decentralized protocol for indexing and querying blockchain data. The Graph makes it possible to query data that is difficult to query directly. Use The Graph network today to index protocol data on zkSync!

### SubQuery Network

[SubQuery](https://subquery.network/) is a fast, flexible, and reliable open-source data indexer that provides you with custom APIs for your web3 project across all of our supported chains.

### Covalent

[Covalent](https://www.covalenthq.com/docs/networks/zksync-era/) provides the industry-leading Unified API bringing visibility to billions of Web3 data points. Developers use Covalent to build exciting multi-chain applications like crypto wallets, NFT galleries, and investor dashboard tools utilizing data.

### DipDup

[DipDup](https://dipdup.io/) is a Python framework for building smart contract indexers. It helps developers focus on business logic instead of writing a boilerplate to store and serve data. DipDup-based indexers are selective, which means only required data is requested. This approach allows to achieve faster indexing times and decreased load on underlying APIs.

### Flair

[Flair](https://docs.flair.dev/) offers reusable **indexing primitives** (such as fault-tolerant RPC ingestors, custom processors, re-org aware database integrations) to make it easy to receive, transform, store and access your on-chain data.

### DipDup
### Graph Network

[DipDup](https://dipdup.io/) is a Python framework for building smart contract indexers. It helps developers focus on business logic instead of writing a boilerplate to store and serve data. DipDup-based indexers are selective, which means only required data is requested. This approach allows to achieve faster indexing times and decreased load on underlying APIs.
[The Graph](https://thegraph.com/) is a decentralized protocol for indexing and querying blockchain data. The Graph makes it possible to query data that is difficult to query directly. Use The Graph network today to index protocol data on zkSync!

### Space & Time

[Space and Time](https://www.spaceandtime.io/) is the verifiable compute layer that scales zero-knowledge proofs on a decentralized data warehouse to deliver trustless data processing to smart contracts, LLMs, and enterprises. Space and Time joins indexed blockchain data from major chains with offchain datasets.

### SubQuery Network

[SubQuery](https://subquery.network/) is a fast, flexible, and reliable open-source data indexer that provides you with custom APIs for your web3 project across all of our supported chains.

### Usage guides

- [the-graph](../tutorials/tooling-guides/the-graph.md)
- [subquery](../tutorials/tooling-guides/subquery.md)

### **Contribute**
### Contribute

The world of decentralized analytics is expansive, and there's always room for fresh perspectives. If you have carved your path through the data forest and gleaned invaluable insights or have fresh tutorials to share, we wholeheartedly welcome your contributions. Enlighten the community with your analytical prowess.
48 changes: 31 additions & 17 deletions docs/build/tooling/foundry/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,51 @@ To integrate `foundry-zksync` into your projects, you have the flexibility to in

1. Clone the repository:

```bash
git clone git@github.com:matter-labs/foundry-zksync.git
```
```bash
git clone git@github.com:matter-labs/foundry-zksync.git
```

2. Navigate to the project directory:

```bash
cd foundry-zksync
```

3. Prepare the Installation Script: Ensure the script is executable

```bash
chmod +x ./install-foundry-zksync
```

4. Run the Installer: Execute the script to install the foundry-zksync binaries forge and cast

2. Navigate to the project directory and switch to the main branch:
```bash
./install-foundry-zksync
```

```bash
cd foundry-zksync && git checkout dev
```
Once the `forge` and `cast` binaries are installed, you can start using `foundry-zksync`. Source your preferred profile or refresh your terminal window to activate the changes. You are now ready to begin working with `foundry-zksync`!

For component-specific installations:
For component-specific installations from source:

- **Forge**: To install, execute:

```bash
cargo install --path ./crates/forge --profile local --force --locked
```
```bash
cargo install --path ./crates/forge --profile local --force --locked
```

- **Cast**: To install, run:

```bash
cargo install --path ./crates/cast --profile local --force --locked
```
```bash
cargo install --path ./crates/cast --profile local --force --locked
```

For the entire suite:

- Execute the following command for a comprehensive installation:

```bash
cargo build --release
```
```bash
cargo build --release
```

Choose the installation that best fits your development needs.

Expand Down
17 changes: 11 additions & 6 deletions docs/build/tooling/node-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ head:

[DRPC](https://drpc.org/public-endpoints/zksync) offers access to distributed network of independent third-party partners and public nodes for zkSync. They provide a free tier that allows for an unlimited amount of requests over public nodes, or a paid tier which provides access to all providers, as well as other additional features.

### GetBlock

[GetBlock](https://getblock.io/nodes/zksync/) provides access to zkSync API endpoint for your project. With GetBlock you don’t need to know how to run zkSync nodes as they are already are available for mainnet and testnets.

### Quicknode

[QuickNode](https://www.quicknode.com/chains/zkSync) offers access to hosted zkSync nodes as part of their free Discover Plan. You can configure add-ons, like "Trace Mode" and "Archive Mode" for an additional cost by upgrading to one of their paid plans.
Expand All @@ -37,9 +41,10 @@ head:

### Public RPCs

| Mainnet | Testnet |
| ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [https://mainnet.era.zksync.io](https://mainnet.era.zksync.io) | [https://sepolia.era.zksync.dev](https://sepolia.era.zksync.dev) |
| [https://zksync.drpc.org](https://zksync.drpc.org) | [https://zksync-era-sepolia.blockpi.network/v1/rpc/public](https://zksync-era-sepolia.blockpi.network/v1/rpc/public) |
| [https://zksync.meowrpc.com](https://zksync.meowrpc.com) | |
| [https://zksync-era.blockpi.network/v1/rpc/public](https://zksync-era.blockpi.network/v1/rpc/public) | |
| Mainnet | Testnet |
| ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| [https://mainnet.era.zksync.io](https://mainnet.era.zksync.io) | [https://sepolia.era.zksync.dev](https://sepolia.era.zksync.dev) |
| [https://zksync.drpc.org](https://zksync.drpc.org) | [https://zksync-era-sepolia.blockpi.network/v1/rpc/public](https://zksync-era-sepolia.blockpi.network/v1/rpc/public) |
| [https://zksync.meowrpc.com](https://zksync.meowrpc.com) | |
| [https://zksync-era.blockpi.network/v1/rpc/public](https://zksync-era.blockpi.network/v1/rpc/public) | |
| [https://go.getblock.io/f76c09905def4618a34946bf71851542](https://go.getblock.io/f76c09905def4618a34946bf71851542) | |
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ yarn add -D @matterlabs/zksync-contracts @openzeppelin/contracts@4.9.5

::: warning

This project does not use the latest version available of `@openzeppelin/contracts`. Mae sure you install the specific version mentioned above.
This project does not use the latest version available of `@openzeppelin/contracts`. Make sure you install the specific version mentioned above.

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ yarn add -D @matterlabs/zksync-contracts @openzeppelin/contracts@4.9.5
```

::: warning
This project does not use the latest version available of `@openzeppelin/contracts`. Mae sure you install the specific version mentioned above.
This project does not use the latest version available of `@openzeppelin/contracts`. Make sure you install the specific version mentioned above.
:::

5. Include the `isSystem: true` setting in the `zksolc` section of the `hardhat.config.ts` configuration file to allow interaction with system contracts:
Expand Down

0 comments on commit 3c92d47

Please sign in to comment.