Skip to content

Commit

Permalink
fix: address todos - part 1 (#66)
Browse files Browse the repository at this point in the history
# What 💻 
* Address series of todos

# Why ✋
* Need to get done

# Evidence 📷
Include screenshots, screen recordings, or `console` output here
demonstrating that your changes work as intended

<!-- All sections below are optional. You can uncomment any section
applicable to your Pull Request. -->

<!-- # Notes 📝
* Any notes/thoughts that the reviewers should know prior to reviewing
the code? -->

---------

Co-authored-by: Sabrina Ferguson <[email protected]>
  • Loading branch information
dutterbutter and itsacoyote authored May 16, 2024
1 parent dce9eba commit 021337a
Show file tree
Hide file tree
Showing 27 changed files with 79 additions and 103 deletions.
1 change: 0 additions & 1 deletion content/00.build/10.quick-start/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,5 @@ To deploy contracts, you'll need to securely add your wallet's private key to th
You should now have a fully working local environment to build new projects on zkSync!
- Continue to [Hello zkSync!](/build/quick-start/hello-zksync) to begin the series on building a crowdfunding campaign for Zeek.
<!-- TODO: add a link to other guides -->
- This setup provides you everything you need to build in zkSync.
You can skip on to creating your own projects using `zksync-cli` with your fully set up local dev environment.
10 changes: 4 additions & 6 deletions content/00.build/40.tooling/20.hardhat/10.getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ to align with your local zkSync and Ethereum node's L2 and L1 RPC URLs, respecti

::callout{icon="i-heroicons-information-circle" color="blue"}
This template project includes a basic unit test in the `/test` folder that runs with the local-setup and can be executed with `yarn test`.
<!-- TODO: update link -->
<!-- Learn more about how to [start the local setup and write unit tests here](../../test-and-debug/getting-started.md). -->
::

## Set your Private Key
Expand Down Expand Up @@ -256,7 +254,7 @@ This script deploys the `Greeting` contract with the message "Hi there!" to %%zk

You should see something like this:

```text
```bash
Running deploy script for the Greeter contract
The deployment is estimated to cost 0.00579276320831943 ETH
constructor args:0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000094869207468657265210000000000000000000000000000000000000000000000
Expand All @@ -281,7 +279,7 @@ The template project contains another script to interact with the contract.

1. Enter the address of the deployed Greeter contract in the `CONTRACT_ADDRESS` variable of the `use-greeter.ts` script:

```ts
```ts [use-greeter.ts]
import { Provider } from "zksync-ethers";
import * as ethers from "ethers";
import { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down Expand Up @@ -345,7 +343,7 @@ The template project contains another script to interact with the contract.

You should see something like this:

```text
```bash
Running script to interact with contract Greeter
The message is Hello there!
Transaction to change the message is 0x12f16578A16DB0f47e9D61175a823ac214288Af
Expand All @@ -358,4 +356,4 @@ The template project contains another script to interact with the contract.

- To learn more about the zkSync Hardhat plugins check out the [plugins documentation](/build/tooling/hardhat/getting-started).
- If you want to know more about how to interact with zkSync using Javascript,
check out the [zksync-ethers Javascript SDK documentation](https://zksync-sdk-docs-staging.web.app/ethers/v6/getting-started).
check out the [zksync-ethers Javascript SDK documentation](https://docs.zksync.io/sdk/js/ethers/v6/getting-started).
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ This plugin creates no additional tasks.
## Environment extensions

This plugins adds an zksync-ethers object to the Hardhat Runtime Environment.
<!-- TODO: update link -->
<!-- This object has the same API as [zksync-ethers](../../sdks/js/zksync-ethers/getting-started.md), with some extra Hardhat-specific functionality. -->

This object has the same API as [zksync-ethers](https://docs.zksync.io/sdk/js/ethers/v6/getting-started), with some extra Hardhat-specific functionality.

## Helpers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,8 @@ export default async function (hre: HardhatRuntimeEnvironment) {
}
```

<!-- TODO: update links -->
::callout{icon="i-heroicons-information-circle" color="blue"}
<!-- To obtain Sepolia ETH please refer to the [network faucets page](../network-faucets.md) for more info. -->
To obtain Sepolia ETH please refer to the [network faucets page](/ecosystem/network-faucets) for more info.
<br>
To transfer Sepolia ETH to %%zk_testnet_name%% use [bridges](https://zksync.io/explore#bridges).
::
Expand Down Expand Up @@ -262,8 +261,8 @@ import { utils, Provider, Contract, Wallet } from "zksync-ethers";
You also need to use the `contract ABI` from the `artifacts-zk` folder to instantiate contracts.

Apart from the same classes and methods provided by ethers, zksync-ethers includes additional methods for zksync-specific features.
<!-- TODO: update link -->
<!-- You can read more in the [`zksync-ethers` documentation](../../sdks/js/getting-started.md). -->

You can read more in the [`zksync-ethers` documentation](https://docs.zksync.io/sdk/js/ethers/v6/getting-started).

## Verify contracts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ This approach is implemented to provide a caching mechanism, avoiding the risk o

### zkSync Era Solidity compiler

<!-- TODO: update links -->
Due to [the identified limitations](https://docs.zksync.io/zk-stack/components/compiler/toolchain/solidity.html#limitations)
Due to [the identified limitations](/zk-stack/components/compiler/toolchain/solidity#limitations)
of the [upstream Solidity compiler](https://github.com/ethereum/solidity),
our team has developed [a new edition](%%zk_git_repo_era-solidity%%)
of the compiler, which effectively addresses and resolves these constraints.
Expand Down Expand Up @@ -211,8 +210,8 @@ npx hardhat compile
Compiles all the smart contracts in the `contracts` directory and creates the `artifacts-zk` folder with all the compilation artifacts,
including factory dependencies for the contracts, which could be used for contract deployment.

<!-- TODO: update link -->
<!-- To understand what the factory dependencies are, read more about them in the [Web3 API](../../api) documentation. -->
To understand what the factory dependencies are, read more about them
[here](/build/developer-reference/ethereum-differences/contract-deployment#note-on-factory-deps) documentation.

## Troubleshooting

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ To use the `hardhat-zksync-deploy` in your project, we recommend that:

- You have a Node installation and `yarn` or `npm` package manager.
- You are already familiar with deploying smart contracts on zkSync Era.
<!-- TODO: update link -->
<!-- If not, please refer to the first section of the [quickstart tutorial](../../quick-start/hello-world.md). -->

If not, please refer to the first section of the [quickstart material](/build/quick-start/hello-zksync).

- A wallet with sufficient Sepolia `ETH` on Ethereum and %%zk_testnet_name%% to pay for deploying smart contracts on testnet.
<!-- TODO: update link -->
<!-- You can get Sepolia ETH from the [network faucets](../../tooling/network-faucets.md). -->

You can get Sepolia ETH from the [network faucets](/ecosystem/network-faucets).

- Get testnet `ETH` for zkSync Era using [bridges](https://zksync.io/explore#bridges) to bridge funds to zkSync.
- You know [how to get your private key from your MetaMask wallet](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key).

Expand All @@ -29,7 +31,7 @@ Explore more in the [zksync-cli documentation](/build/tooling/zksync-cli).
::

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
**Version Compatibility Warning**
#### Version Compatibility Warning

Ensure you are using the correct version of the plugin with ethers:

Expand Down Expand Up @@ -587,8 +589,8 @@ with all required fields stated above, or specify `defaultNetwork` in `hardhat.c
If network argument `--network` or `defaultNetwork` configuration are not specified,
local setup with `http://localhost:8545` (Ethereum RPC URL) and `http://localhost:3050` (zkSync Era RPC URL),
will be used. In this case zkSync Era network will not need to be configured in `hardhat.config.ts` file.
<!-- TODO: update link -->
<!-- For more details about a dockerized local setup, check out [Local testing](../../test-and-debug/getting-started.md). -->

For more details about a dockerized local setup, check out [Local testing](/build/test-and-debug/dockerized-l1-l2-nodes).
::

`yarn hardhat deploy-zksync:contract --contract-name <contract name or FQN>`
Expand Down
14 changes: 6 additions & 8 deletions content/00.build/40.tooling/20.hardhat/other-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ Different options to export smart contract ABIs.

### hardhat-gas-reporter

<!-- TODO: update link -->
<!-- Although this plugin works out of the box, zkSync Era has a [different fee model](../../developer-reference/fee-model.md) than Ethereum. -->
Although this plugin works out of the box, zkSync Era has a [different fee model](/build/developer-reference/fee-model) than Ethereum.
Users should consider this when analysing the report generated by this plugin.

<!-- TODO: update link -->
<!-- In addition, make sure to read about [local testing](../../test-and-debug/getting-started.md). -->
In addition, make sure to read about [local testing](/build/test-and-debug/).

[More Information](https://www.npmjs.com/package/hardhat-gas-reporter)

Expand All @@ -82,10 +80,10 @@ To prevent this, please include the `--no-compile` flag: `yarn hardhat verify --
This plugin adds new methods that interact with the Hardhat network used for testing.

However, we do not recommend using the Hardhat network for testing contracts that will be deployed on zkSync Era.
<!-- TODO: update links -->
<!-- We recommend instead using the [in-memory node](../../test-and-debug/era-test-node.md)
or the [docker setup to test your contracts](../../test-and-debug/dockerized-l1-l2-nodes.md)
as they will give you the same results as our testnet/mainnet. -->

We recommend instead using the [in-memory node](/build/test-and-debug/in-memory-node)
or the [docker setup to test your contracts](/build/test-and-debug/dockerized-l1-l2-nodes)
as they will give you the same results as our testnet/mainnet.

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
The additional methods provided by this plugin are not compatible with the zkSync Era in-memory node or docker setup yet.
Expand Down
6 changes: 0 additions & 6 deletions content/00.build/60.test-and-debug/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ This detailed setup mirrors how your contracts will function within the mainnet
This setup facilitates forking the state from the mainnet or testnet, suitable for replaying transactions
or observing the impact of modifications on existing contracts.

<!-- TODO: is this still a thing to callout? -->
::callout{icon="i-heroicons-information-circle-16-solid" color="amber"}
Being in its alpha stage, the In-Memory Node comes with some constraints and doesn't fully support all functionalities.
For definitive testing, the Dockerized local setup or a testnet is highly recommended.
::

### Feature comparison

The following table highlights the key characteristics of each testing environment for a quick comparison:
Expand Down
2 changes: 1 addition & 1 deletion content/00.build/60.test-and-debug/20.in-memory-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can visit the `era-test-node` repository [to learn more](%%zk_git_repo_era-t

You can setup the In-Memory Node quickly with `zksync-cli dev start`.
If you don't have `zksync-cli` setup, see the [Overview](/build/tooling/zksync-cli) guide.
<!-- TODO: is this note still relevant -->

Note: at the moment this method won't allow you to use additional features like forking networks or replaying transactions.

## Install and set up `era_test_node`
Expand Down
1 change: 0 additions & 1 deletion content/00.build/60.test-and-debug/50.foundry.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: Foundry
description: Learn how to test using Foundry for zkSync.
---

<!-- TODO: update link -->
For instructions on how to install `foundry-zksync` please refer to the Foundry [Getting Started](/build/tooling/foundry/getting-started) page.

`foundry-zksync`, a fork of Foundry, provides developers with a tailored testing framework designed specifically for zkSync environments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ in IRs: `linkersymbol` in Yul and `PUSHLIB` in EVM legacy assembly.

All linking happens at compile-time. Deploy-time linking is not supported.

<!-- TODO: @dutterbutter add non-linable content here? -->
For compiling non-linable libraries please refer to the documentation [here](/build/tooling/hardhat/compiling-libraries).
4 changes: 2 additions & 2 deletions content/00.build/65.developer-reference/60.bridging-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ You can find example scripts to deposit ETH and ERC20 tokens using the default b
::callout{icon="i-heroicons-light-bulb"}

- To provide additional security during the Alpha phase, **withdrawals in zkSync Era take 24 hours**.
<!-- TODO: add link for withdrawal guide -->
- For more information, read the withdrawal delay guide.

- For more information, read the [withdrawal delay guide](/build/resources/withdrawal-delay).

::

Expand Down
1 change: 0 additions & 1 deletion content/00.build/70.api-reference/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ zkSync Era seamlessly integrates with the Ethereum ecosystem. To achieve this in
we support not only the standard <a href="https://ethereum.org/en/developers/docs/apis/json-rpc/" target="_blank">Ethereum JSON-RPC API</a>
but also introduce L2-specific features that enhance functionality.

<!-- TODO: make icon larger -->
::callout{icon="i-heroicons-information-circle" color="amber"}
To ensure a seamless experience, we impose rate limits on both HTTPS and WebSocket APIs.
Generally, these limits are ample, ranging from 10 to 100 requests per second (RPS) per client.
Expand Down
7 changes: 3 additions & 4 deletions content/10.zk-stack/05.concepts/00.transaction-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ Returned values from any RPC call outputting transaction details include:
## Contract Deployment Transactions

Contract deployment transactions interact with the `ContractDeployer` system contract and differ from standard transactions.
<!-- TODO: update link -->
<!-- [Learn more about contract deployment in zkSync](../../build/developer-reference/contract-deployment.md). -->

[Learn more about contract deployment in zkSync](/build/developer-reference/ethereum-differences/contract-deployment).

---
## Transaction statuses
Expand Down Expand Up @@ -110,10 +110,9 @@ In zkSync Era, while the EIP-1559 transaction format is supported, the `maxFeePe

### EIP-712: `0x71`

<!-- TODO: update links -->
[EIP-712: Typed structured data hashing and signing](https://eips.ethereum.org/EIPS/eip-712)
enables structured data hashing and signing within transactions.
<!-- zkSync Era uses this for features like [account abstraction](#) and [paymasters](#). -->
zkSync Era uses this for features like [account abstraction](/build/developer-reference/account-abstraction/introduction) and [paymasters](/build/developer-reference/account-abstraction/paymasters).

```json
"gasPerPubdata": "1212",
Expand Down
10 changes: 5 additions & 5 deletions content/10.zk-stack/05.concepts/99.account-abstraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ title: Account Abstraction
description: Explore the nuances of account abstraction in zkSync, including account versioning, nonce ordering, and the significance of returned magic values in transaction validation.
---

Account abstraction (AA) is a pivotal feature in zkSync that allows for greater flexibility and functionality
in how accounts operate and interact with transactions.
<!-- TODO: update link -->
<!-- For a comprehensive understanding, it is recommended to review
the detailed [AA protocol documentation](../../build/developer-reference/account-abstraction.md). -->
Account abstraction (AA) is a pivotal feature in zkSync that allows for greater flexibility and
functionality in how accounts operate and interact with transactions.

For a comprehensive understanding, it is recommended to review
the detailed [AA protocol documentation](/build/developer-reference/account-abstraction/introduction).

### Account versioning

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ The admin facet is controlled by two entities:

### MailboxFacet

<!-- TODO: update link -->
<!-- The facet that handles L2 <-> L1 communication, an overview for which can be found in
[docs](../../../build/developer-reference/l1-l2-interop.md). -->
The facet that handles L2 <-> L1 communication, an overview for which can be found in
[docs](/build/developer-reference/l1-l2-interoperability).

The Mailbox performs three functions:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ We are using two high-level source code compilers at the time of writing:
- [solc](https://github.com/ethereum/solc-bin): the official Solidity compiler. For more info, see the latest [Solidity documentation](https://docs.soliditylang.org/en/latest/).
- [vyper](https://github.com/vyperlang/vyper/releases): the official Vyper compiler. For more info, see the latest [Vyper documentation](https://docs.vyperlang.org/en/latest/index.html).

<!-- TODO: update link -->
<!-- ::callout{icon="i-heroicons-information-circle" color="blue"} -->
<!-- **Security and best practices:** -->
<!-- Follow the [security considerations and best practices](../../../../build/quick-start/best-practices.md#security-and-best-practices) -->
<!-- to build smart contracts on zkSync Era. -->
<!-- :: -->
::callout{icon="i-heroicons-information-circle" color="blue"}
**Security and best practices:**
<br />
Follow the [security considerations and best practices](/build/developer-reference/best-practices#security-and-best-practices)
to build smart contracts on zkSync Era.
::

## IR Compilers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Additional zkEVM data inserted by `zksolc`:
- `zk_version`: the `zksolc` version.
- `contract/hash`: the hash of the zkEVM bytecode.
- `contract/factory_dependencies`: bytecode hashes of contracts created in the current contract with `CREATE`.
<!-- TODO: update link -->
<!-- [More details here](/build/developer-reference/contract-deployment#note-on-factory-deps). -->

[More details here](/build/developer-reference/ethereum-differences/contract-deployment#note-on-factory-deps).

Unsupported sections of the output JSON, ignored by `zksolc`:

Expand All @@ -77,8 +77,8 @@ Additional zkEVM data, inserted by `zksolc`:

- `zk_version`: the version of `zksolc`.
- `contract/factory_deps`: bytecode hashes of contracts created by the current contract with `CREATE`.
<!-- TODO: update link -->
<!-- [More details here](/build/developer-reference/contract-deployment#note-on-factory-deps). -->

[More details here](/build/developer-reference/ethereum-differences/contract-deployment#note-on-factory-deps).

Unsupported combined JSON flags, rejected by `zksolc`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Additional zkEVM data is inserted into the output combined JSON by `zksolc`:
- `zk_version`: the `zksolc` version.
- `contract/factory_deps`: bytecode hashes of contracts created in the current contract with `CREATE`.
Since Vyper does not support `CREATE` directly, only the forwarder can be present in this mapping.
<!-- TODO: update link -->
<!-- [More details here](/build/developer-reference/contract-deployment.md#note-on-factory-deps). -->

[More details here](/build/developer-reference/ethereum-differences/contract-deployment#note-on-factory-deps).

Regardless of the requested output, only the `combined_json`, `abi`, `method_identifiers`, `bytecode`, `bytecode_runtime`
flags are supported, while the rest are ignored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ description:
This is a technical deep-dive into the specifics of how the compiler works.
If you're looking to just deploy a contract,
please visit [Toolchain](/zk-stack/components/compiler/toolchain/overview) to understand the specifics around our Solidity, Vyper and LLVM compilers.
<!-- TODO: update link? -->
<!-- please visit [Contract deployment](../../../../build/developer-reference/contract-development.md#smart-contract-development)
to better understand the workflow or -->

## Glossary

| Entity | Description |
Expand Down
Loading

0 comments on commit 021337a

Please sign in to comment.