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

Commit

Permalink
Create separate menus for API/SDKs and Tools (#542)
Browse files Browse the repository at this point in the history
* create separate menus API y tools

* fix image links

* fix image links

* remove trailing comma

* testing bulk redirects

* testing bulk redirects

* testing wildcard

* capturing more redirects

* fix blockcexplorer

* update table of contents

* another redirect

* fix broken links

---------

Co-authored-by: Blessing Krofegha <[email protected]>
  • Loading branch information
kailash-manasarovar and krofax authored May 30, 2023
1 parent 99580b4 commit 39f0eba
Show file tree
Hide file tree
Showing 46 changed files with 202 additions and 157 deletions.
8 changes: 5 additions & 3 deletions docs/.vuepress/navbar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ export const enNavbar = navbar([
text: "Home",
link: "/"
},

{
text: "Developer docs",
link: "/dev/"
},

{
text: "Tools and SDK",
text: "API/SDKs",
link: "/api/"
},
{
text: "Tools",
link: "/tools/"
},
{
text: "Versions",
children: [
Expand Down
97 changes: 48 additions & 49 deletions docs/.vuepress/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,8 @@ export const enSidebar = sidebar({
],
},
],
//The sidebar for Tools and SDKs
//The sidebar for Tools and SDKs
"/api": [
{
text: "Overview", // required
link: "/api/", // optional, which should be a absolute path.
},
{
text: "Web3 JSON-RPC API", // required
link: "/api/api.md", // optional, which should be a absolute path.
Expand All @@ -97,45 +93,6 @@ export const enSidebar = sidebar({
"/api/js/front-end",
],
},
{
text: "Hardhat", // required
link: "/api/hardhat", // optional, which should be a absolute path.
children: [
"/api/hardhat/getting-started",
"/api/hardhat/migrating-to-zksync",
{
text: "Plugins", // required
link: "/api/hardhat/plugins", // optional, which should be a absolute path.
collapsible: true,
children: [
"/api/hardhat/hardhat-zksync-solc",
"/api/hardhat/hardhat-zksync-vyper",
"/api/hardhat/hardhat-zksync-upgradable",
"/api/hardhat/hardhat-zksync-deploy",
"/api/hardhat/hardhat-zksync-chai-matchers",
"/api/hardhat/hardhat-zksync-verify",
"/api/hardhat/other-plugins",
],
},
"/api/hardhat/testing",
"/api/hardhat/compiling-libraries",
],
},
{
text: "Block Explorer", // required
link: "/api/tools/block-explorer", // optional, which should be a absolute path.
children: ["/api/tools/block-explorer/intro", "/api/tools/block-explorer/block-view", "/api/tools/block-explorer/search", "/api/tools/block-explorer/contract-verification"],
},
{
text: "Compiler Toolchain",
link: "/api/compiler-toolchain",
children: ["/api/compiler-toolchain/overview.md", "/api/compiler-toolchain/solidity.md", "/api/compiler-toolchain/vyper.md", "/api/compiler-toolchain/llvm.md"],
},
{
text: "zkSync Era CLI", // required
link: "/api/tools/zksync-cli/", // optional, which should be a absolute path.
children: [],
},
{
text: "Python SDK",
link: "/api/python",
Expand All @@ -148,11 +105,6 @@ export const enSidebar = sidebar({
"/api/python/types",
],
},
{
text: "Java SDK", // required
link: "/api/java/getting-started", // optional, which should be a absolute path.
children: ["/api/java/getting-started"],
},
{
text: "Go SDK",
link: "/api/go",
Expand All @@ -165,6 +117,53 @@ export const enSidebar = sidebar({
"/api/go/types",
],
},
{
text: "Java SDK", // required
link: "/api/java/getting-started", // optional, which should be a absolute path.
children: ["/api/java/getting-started"],
},
],
//The sidebar for Tools and SDKs
"/tools": [
{
text: "Hardhat", // required
link: "/tools/hardhat", // optional, which should be a absolute path.
children: [
"/tools/hardhat/getting-started",
"/tools/hardhat/migrating-to-zksync",
{
text: "Plugins", // required
link: "/tools/hardhat/plugins", // optional, which should be a absolute path.
collapsible: true,
children: [
"/tools/hardhat/hardhat-zksync-solc",
"/tools/hardhat/hardhat-zksync-vyper",
"/tools/hardhat/hardhat-zksync-upgradable",
"/tools/hardhat/hardhat-zksync-deploy",
"/tools/hardhat/hardhat-zksync-chai-matchers",
"/tools/hardhat/hardhat-zksync-verify",
"/tools/hardhat/other-plugins",
],
},
"/tools/hardhat/testing",
"/tools/hardhat/compiling-libraries",
],
},
{
text: "Compiler Toolchain",
link: "/tools/compiler-toolchain",
children: ["/tools/compiler-toolchain/overview.md", "/tools/compiler-toolchain/solidity.md", "/tools/compiler-toolchain/vyper.md", "/tools/compiler-toolchain/llvm.md"],
},
{
text: "zkSync Era CLI", // required
link: "/tools/zksync-cli/", // optional, which should be a absolute path.
children: [],
},
{
text: "Block Explorer", // required
link: "/tools/block-explorer", // optional, which should be a absolute path.
children: ["/tools/block-explorer/intro", "/tools/block-explorer/block-view", "/tools/block-explorer/search", "/tools/block-explorer/contract-verification"],
},
],
//The legal related sidebar
"/legal/": ["/legal/terms", "/legal/privacy"],
Expand Down
27 changes: 5 additions & 22 deletions docs/api/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
# Overview
# Contents

Our SDKs enable you to build web3 applications, with capabilities such as:
## JSON-RPC API

- Connecting to user's wallets
- Deploying and interacting with smart contracts
We support a few languages (and are working on more) to make it easier for you to build different kinds of applications.

## API

- [Web3 API](./api.md)
- [Web3 JSON-RPC API](./api.md)

## SDKs

- [TypeScript SDK](./js)
- [JavaScript SDK](./js)
- [Python SDK](./python/getting-started.md)
- [Java SDK](./java/getting-started.md)
- [Go SDK](./go/getting-started.md)

## Tools

- [Hardhat plugins](./hardhat)
- [hardhat-zksync-solc](./hardhat/hardhat-zksync-solc.md)
- [hardhat-zksync-vyper](./hardhat/hardhat-zksync-vyper.md)
- [hardhat-zksync-deploy](./hardhat/hardhat-zksync-deploy.md)
- [hardhat-zksync-chai-matchers](./hardhat/hardhat-zksync-chai-matchers.md)
- [hardhat-zksync-verify](./hardhat/hardhat-zksync-verify.md)
- [Block Explorer](./tools/block-explorer/)
- [zkSync CLI](./tools/zksync-cli/)
- [Java SDK](./java/getting-started.md)
2 changes: 1 addition & 1 deletion docs/api/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ While most of the existing SDKs should work out of the box, deploying smart cont

To provide easy access to all the features of zkSync Era, the `zksync2` Go SDK was created.

## Table of contents
## Contents

- [Getting started](./getting-started.md)
- [Providers](./providers.md)
Expand Down
17 changes: 0 additions & 17 deletions docs/api/hardhat/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ While most of the existing SDKs should work out of the box, deploying smart cont

To provide easy access to all of the features of zkSync Era, the `zksync-web3` JavaScript SDK was created, which is based on the `ethers.js` library. This section serves as its reference.

## Table of contents
## Contents

- [Getting started](./getting-started.md)
- [Providers](./providers.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/js/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ await withdrawL2.waitFinalize();

## Deploying a contract

A guide on deploying smart contracts using our hardhat plugin is available [here](../hardhat).
A guide on deploying smart contracts using our hardhat plugin is available [here](../../tools/hardhat/).

## Adding tokens to the standard bridge

Expand Down
2 changes: 1 addition & 1 deletion docs/api/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ While most of the existing SDKs should work out of the box, deploying smart cont

To provide easy access to all the features of zkSync Era, the `zksync2` Python SDK was created.

## Table of contents
## Contents

- [Getting started](./getting-started.md)
- [Providers](./providers.md)
Expand Down
8 changes: 4 additions & 4 deletions docs/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ token.
### Tools and SDKs

- [zkSync Era Portal](https://portal.zksync.io) - Explore Wallet, Bridge and Faucet features.
- [Block Explorer](../api/tools/block-explorer/) - Search for real-time and historical information about blocks, transactions, addresses, and more on zkSync block explorer.
- [Block Explorer](../tools/block-explorer/) - Search for real-time and historical information about blocks, transactions, addresses, and more on zkSync block explorer.
- [Javascript SDK](../api/js/) - Extending the capabilities of Ethers, our Javascript SDK contains specific classes and methods required to build on zkSync Era.
- [Hardhat Plugins](../api/hardhat/) - Use our Hardhat zkSync plugins to compile, test, deploy, and verify your Solidity or Vyper based
- [zkSync CLI](../api/tools/zksync-cli/) - Simplify your development process and interact with zkSync Era from your terminal with zkSync CLI.
- [Compiler Toolchain](../api/compiler-toolchain/overview.md) - Learn about our compiler toolchain.
- [Hardhat Plugins](../tools/hardhat/) - Use our Hardhat zkSync plugins to compile, test, deploy, and verify your Solidity or Vyper based
- [zkSync CLI](../tools/zksync-cli/) - Simplify your development process and interact with zkSync Era from your terminal with zkSync CLI.
- [Compiler Toolchain](../tools/compiler-toolchain/overview.md) - Learn about our compiler toolchain.
- [Python SDK](../api/python/) - Explore all the Python methods and functions required to build on zkSync Era.
- [Java SDK](../api/java/getting-started.md) - Explore all the Java methods and functions required to build on zkSync Era.
6 changes: 3 additions & 3 deletions docs/dev/building-on-zksync/contracts/contract-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ To deploy a contract on Ethereum, a user sends a transaction to the zero address

To deploy a contract on zkSync Era, a user calls the `create` function of the [ContractDeployer system contract](../../developer-guides/system-contracts.md#contractdeployer) providing the hash of the contract to be published, as well as the constructor arguments. The contract bytecode itself is supplied in the `factory_deps` field of the transaction (as it's an [EIP712 transaction](../../../api/api.md#eip712)). If the contract is a factory (i.e. it can deploy other contracts), these contracts' bytecodes should be included in the `factory_deps` as well.

We recommend using the [hardhat-zksync-deploy](../../../api/hardhat) plugin, to simplify the deployment process. It provides classes and methods to take care of all the deployment requirements, like generating the [bytecode hash of the contract](#format-of-bytecode-hash).
We recommend using the [hardhat-zksync-deploy](../../../tools/hardhat/) plugin, to simplify the deployment process. It provides classes and methods to take care of all the deployment requirements, like generating the [bytecode hash of the contract](#format-of-bytecode-hash).

Here's a [step-by-step guide on how to use it](../../../api/hardhat/getting-started.md).
Here's a [step-by-step guide on how to use it](../../../tools/hardhat/getting-started.md).

### Note on `factory_deps`

Expand All @@ -31,7 +31,7 @@ Some examples of usage are:
- The obvious one is when you deploy a contract, you need to provide its code in the `factory_deps` field.
- On zkSync, factories (i.e. contracts that can deploy other contracts) do not store bytecodes of their dependencies, i.e. contracts that they can deploy. They only store their hashes. That's why you need to include _all_ the bytecodes of the dependencies in the `factory_deps` field.

Both of these examples are already seamlessly done under the hood by our [hardhat-zksync-deploy](../../../api/hardhat/getting-started.md).
Both of these examples are already seamlessly done under the hood by our [hardhat-zksync-deploy](../../../tools/hardhat/getting-started.md).

Note that the factory deps do not necessarily have to be used by the transaction in any way. These are just markers that these bytecodes should be published on L1 with this transaction. If your contract contains a lot of various factory dependencies and they do not fit inside a single L1 block, you can split the list of factory dependencies between multiple transactions.

Expand Down
12 changes: 6 additions & 6 deletions docs/dev/building-on-zksync/contracts/contract-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ zkSync Era allows developers to build projects using the same programming langua

::: tip Differences with Ethereum

Although most smart contracts work out of the box, we **strongly recommend developers to read about the [differences between Ethereum and zkSync Era](./differences-with-ethereum.md)**, and test their projects both locally using the [local setup](../../../api/hardhat/testing.md) and in testnet.
Although most smart contracts work out of the box, we **strongly recommend developers to read about the [differences between Ethereum and zkSync Era](./differences-with-ethereum.md)**, and test their projects both locally using the [local setup](../../../tools/hardhat/testing.md) and in testnet.

:::

## Solidity support

Currently, Solidity versions as old as `0.4.12` are supported, although **we strongly recommend using the latest supported revision of 0.8**, as older versions contain known bugs and [have limitations with our compiler](../../../api/compiler-toolchain/solidity.md#limitations).
Currently, Solidity versions as old as `0.4.12` are supported, although **we strongly recommend using the latest supported revision of 0.8**, as older versions contain known bugs and [have limitations with our compiler](../../../tools/compiler-toolchain/solidity.md#limitations).

Please read [this section of the docs](../../../api/compiler-toolchain/solidity.md#using-libraries) if your project uses libraries.
Please read [this section of the docs](../../../tools/compiler-toolchain/solidity.md#using-libraries) if your project uses libraries.

## Vyper support

Expand All @@ -25,9 +25,9 @@ Although you can write smart contracts in both Solidity and Vyper, compiling the
- [zksolc](https://github.com/matter-labs/zksolc-bin): Solidity compiler.
- [zkvyper](https://github.com/matter-labs/zkvyper-bin): Vyper compiler.

You can find more information about our compilers in the [Compiler toolchain section](../../../api/compiler-toolchain/README.md).
You can find more information about our compilers in the [Compiler toolchain section](../../../tools/compiler-toolchain/README.md).

**Learn more about how to install and configure the compiler Hardhat plugins in the links below:**

- [hardhat-zksync-solc documentation](../../../api/hardhat/hardhat-zksync-solc.md)
- [hardhat-zksync-vyper documentation](../../../api/hardhat/hardhat-zksync-vyper.md)
- [hardhat-zksync-solc documentation](../../../tools/hardhat/hardhat-zksync-solc.md)
- [hardhat-zksync-vyper documentation](../../../tools/hardhat/hardhat-zksync-vyper.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Verify smart contracts by using block explorer UI

Now that you have learned how to deploy your contracts, you might be interested to know how you can **verify** the contracts deployed on zkSync using the official block explorer. All the details about how to verify contracts can be found on the [block explorer](../../../api/tools/block-explorer/contract-verification.md) page.
Now that you have learned how to deploy your contracts, you might be interested to know how you can **verify** the contracts deployed on zkSync using the official block explorer. All the details about how to verify contracts can be found on the [block explorer](../../../tools/block-explorer/contract-verification.md) page.


## Verify smart contracts with the hardhat-zksync-verify plugin

Learn how to verify your smart contracts with **zkSync Era hardhat plugin**, by following the detailed guide on the [hardhat-zksync-verify](../../../api/hardhat/hardhat-zksync-verify.md) page.
Learn how to verify your smart contracts with **zkSync Era hardhat plugin**, by following the detailed guide on the [hardhat-zksync-verify](../../../tools/hardhat/hardhat-zksync-verify.md) page.
4 changes: 2 additions & 2 deletions docs/dev/building-on-zksync/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Greeter was deployed to 0xE84774C41F096Ba5BafA1439cEE787D9dD1A6b72

**Congratulations! You have deployed a smart contract to zkSync Era Testnet** 🎉

Now visit the [zkSync block explorer](https://explorer.zksync.io/) and search with the contract address to confirm the deployment. Follow the [contract verification guide](../../api/tools/block-explorer/contract-verification.md) for instructions on how to verify your smart contract using the zkSync block explorer.
Now visit the [zkSync block explorer](https://explorer.zksync.io/) and search with the contract address to confirm the deployment. Follow the [contract verification guide](../../tools/block-explorer/contract-verification.md) for instructions on how to verify your smart contract using the zkSync block explorer.

## Build the front-end dApp

Expand Down Expand Up @@ -700,4 +700,4 @@ After the transaction is processed, the page updates the balances and the new gr
### Learn more
- To learn more about `zksync-web3` SDK, check out its [documentation](../../api/js).
- To learn more about the zkSync hardhat plugins, check out their [documentation](../../api/hardhat).
- To learn more about the zkSync hardhat plugins, check out their [documentation](../../tools/hardhat).
2 changes: 1 addition & 1 deletion docs/dev/developer-guides/bridging/bridging-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default async function (hre: HardhatRuntimeEnvironment) {
}
```

To run this script, configure your `hardhat.config.ts` file as explained in this [guide](../../../api/hardhat/hardhat-zksync-deploy.md), or use the command `npx zksync-cli@latest create PROJECT_NAME` to scaffold a new project.
To run this script, configure your `hardhat.config.ts` file as explained in this [guide](../../../tools/hardhat/hardhat-zksync-deploy.md), or use the command `npx zksync-cli@latest create PROJECT_NAME` to scaffold a new project.

Once your `hardhat.config.ts` file is configured, place the script files in the `deploy` folder and run them with the following command:

Expand Down
2 changes: 1 addition & 1 deletion docs/dev/developer-guides/transactions/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ Instead of signing the RLP-encoded transaction, the user signs the following typ
| factoryDeps | `bytes32[]` |
| paymasterInput | `bytes` |

These fields are handled by our [SDK](./js/features.md).
These fields are handled by our [SDK](../../../api/js/features.md).
Loading

0 comments on commit 39f0eba

Please sign in to comment.