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

Commit

Permalink
SEO improvements (#625)
Browse files Browse the repository at this point in the history
* fixes fee model redirects

* broken menu

* fixes zksync redirect

* removes wrong redirect hyperscaling

* fixes tips

* fixes transactions and blocks redirects

* changes aa page and redirects

* adds link to best practises

* redirects contract dev

* fixes wrong redirect

* fix contract dep redirects

* fix redirects events

* fix redirects faq

* fix interacting redirects

* creates tutorials index page

* adds websocket endpoints

* same tutorials description

* fix incorrect redirects

* fixes links for aa rename

* fix broken links

* fix issue redirecting

* change link to page

* reverts paymasterParams

* how to index

* fixes broken links
  • Loading branch information
uF4No authored Jul 6, 2023
1 parent 2aca718 commit 43e17df
Show file tree
Hide file tree
Showing 33 changed files with 166 additions and 134 deletions.
19 changes: 10 additions & 9 deletions docs/.vuepress/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ export const enSidebar = sidebar({
},
{
text: "Getting started",
link: "/dev/building-on-zksync/hello-world.md",
children: [
"/dev/building-on-zksync/hello-world.md",
link: "/dev/building-on-zksync/hello-world.md",
children: [
"/dev/building-on-zksync/hello-world.md",
"/dev/building-on-zksync/interacting.md",
"/dev/building-on-zksync/best-practices.md",
"/dev/building-on-zksync/useful-address.md", ],
"/dev/building-on-zksync/useful-address.md",
],
},
{
text: "How to",
link: "/dev/how-to/estimate-gas.md",
link: "/dev/how-to/README.md",
children: [
"/dev/how-to/estimate-gas.md",
"/dev/how-to/send-transaction-l1-l2",
Expand All @@ -29,7 +30,7 @@ export const enSidebar = sidebar({
},
{
text: "Tutorials",
link: "/dev/tutorials/cross-chain-tutorial.md",
link: "/dev/tutorials/README.md",
children: [
"/dev/tutorials/cross-chain-tutorial.md",
"/dev/tutorials/custom-aa-tutorial.md",
Expand All @@ -51,11 +52,11 @@ export const enSidebar = sidebar({
"/reference/concepts/rollups.md",
"/reference/concepts/zkSync.md",
"/reference/concepts/hyperscaling.md",
"/reference/concepts/account-abstraction.md",
"/reference/concepts/transactions.md",
"/reference/concepts/blocks.md",
"/reference/concepts/fee-model.md",
"/reference/concepts/finality.md",
"/reference/concepts/aa.md",
"/reference/concepts/bridging-asset.md",
"/reference/concepts/l1-l2-interop.md",
],
Expand All @@ -65,9 +66,9 @@ export const enSidebar = sidebar({
link: "/reference/architecture/differences-with-ethereum.md",
children: [
"/reference/architecture/differences-with-ethereum.md",
"/reference/architecture/system-contracts.md",
"/reference/architecture/contract-development.md",
"/reference/architecture/contract-deployment.md",
"/reference/architecture/system-contracts.md",
"/reference/architecture/events.md",
],
},
Expand Down Expand Up @@ -120,7 +121,7 @@ export const enSidebar = sidebar({
{
text: "Go SDK",
link: "/api/go",
children: ["/api/go/getting-started", "/api/go/providers", "/api/go/accounts", "/api/go/accounts-l1-l2", "/api/go/contract-interface", "/api/go/types"],
children: ["/api/go/getting-started", "/api/go/providers", "/api/go/accounts", "/api/go/accounts-l1-l2", "/api/go/contracts", "/api/go/types"],
},
{
text: "Java SDK", // required
Expand Down
15 changes: 8 additions & 7 deletions docs/api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
zkSync Era supports the standard [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) and adds some L2-specific features.

:::tip Tip
- As long as code does not involve deploying new smart contracts, which can only be deployed using [EIP712 transactions](../reference/concepts/transactions.md#eip-712-transactions), _no changes to the codebase are needed_.
- Read the documentation on [EIP-712 transactions](../reference/concepts/transactions.md#eip-712-transactions) for more information.
- As long as code does not involve deploying new smart contracts, which can only be deployed using [EIP712 transactions](../reference/concepts/transactions.md#transaction-types), _no changes to the codebase are needed_.
- Read the documentation on [EIP-712 transactions](../reference/concepts/transactions.md#eip-712-0x71) for more information.
:::

## RPC endpoint URLs

### Testnet

`https://testnet.era.zksync.dev`
- HTTPS: `https://testnet.era.zksync.dev`
- Websocket: `wss://testnet.era.zksync.dev/ws`

### Mainnet

`https://mainnet.era.zksync.io`

- HTTPS: `https://mainnet.era.zksync.io`
- Websocket: `wss://mainnet.era.zksync.io/ws`

## zkSync Era JSON-RPC methods

Expand Down Expand Up @@ -702,7 +703,7 @@ curl -X POST -H "Content-Type: application/json" \

### `zks_getTestnetPaymaster`

Returns the address of the [testnet paymaster](../reference/concepts/aa.md#testnet-paymaster): the paymaster that is available on testnets and enables paying fees in ERC-20 compatible tokens.
Returns the address of the [testnet paymaster](../reference/concepts/account-abstraction.md#testnet-paymaster): the paymaster that is available on testnets and enables paying fees in ERC-20 compatible tokens.

#### Inputs

Expand Down Expand Up @@ -856,4 +857,4 @@ The WebSocket URL is `wss://testnet.era.zksync.dev/ws`.

::: tip
- Use the websocket endpoint to handle smart contract events, as detailed [in this section of the docs](../reference/architecture/events.md).
:::
:::
2 changes: 1 addition & 1 deletion docs/api/go/paymaster-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func GetGeneralPaymasterInput(paymasterInput types.GeneralPaymasterInput) ([]byt

### `GetPaymasterParams`

Returns a correctly-formed `paymasterParams` object for common [paymaster flows](../../reference/concepts/aa.md#built-in-paymaster-flows).
Returns a correctly-formed `paymasterParams` object for common [paymaster flows](../../reference/concepts/account-abstraction.md#built-in-paymaster-flows).

#### Inputs

Expand Down
8 changes: 4 additions & 4 deletions docs/api/js/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ While zkSync is mostly Web3-compatible, it has some differences compared to Ethe
- Deployment transactions require the contracts' bytecode to be passed in a separate field.
- The fee system is somewhat different.

These require us to extend standard Ethereum transactions with new custom fields. Such extended transactions are called EIP712 transactions since [EIP712](https://eips.ethereum.org/EIPS/eip-712) is used to sign them. You can look at the internal structure of the EIP712 transactions [here](../api.md#eip712).
These require us to extend standard Ethereum transactions with new custom fields. Such extended transactions are called EIP712 transactions since [EIP712](https://eips.ethereum.org/EIPS/eip-712) is used to sign them. You can look at the internal structure of the EIP712 transactions [here](../../reference/concepts/transactions.md#eip-712-0x71).

This document will focus solely on how to pass these arguments to the SDK.

Expand Down Expand Up @@ -65,13 +65,13 @@ Use custom signature `0x123456` for account, while using paymaster with address

## Encoding paymaster params

While the paymaster feature by itself does not impose any limitations on values of the `paymasterInput`, the Matter Labs team endorses certain types of [paymaster flows](../../reference/concepts/aa.md#built-in-paymaster-flows) that are processable by EOAs.
While the paymaster feature by itself does not impose any limitations on values of the `paymasterInput`, the Matter Labs team endorses certain types of [paymaster flows](../../reference/concepts/account-abstraction.md#built-in-paymaster-flows) that are processable by EOAs.

zkSync SDK provides a utility method that can be used to get the correctly formed `paymasterParams` object: [getPaymasterParams](./utils.md#encoding-paymaster-params).
zkSync SDK provides a utility method that can be used to get the correctly formed `paymasterParams` object: [getPaymasterParams](./paymaster-utils.md#getpaymasterparams).

## See in action

If you want to call the method `setGreeting` of an ethers `Contract` object called `greeter`, this would look the following way, while paying fees with the [testnet paymaster](../../reference/concepts/aa.md#testnet-paymaster):
If you want to call the method `setGreeting` of an ethers `Contract` object called `greeter`, this would look the following way, while paying fees with the [testnet paymaster](../../reference/concepts/account-abstraction.md#testnet-paymaster):

```javascript
// The `setGreeting` method has a single parameter -- new greeting
Expand Down
4 changes: 2 additions & 2 deletions docs/api/js/paymaster-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function getGeneralPaymasterInput(paymasterInput: GeneralPaymasterInput):

### `getPaymasterParams`

Returns a correctly-formed `paymasterParams` object for common [paymaster flows](../../reference/concepts/aa.md#built-in-paymaster-flows).
Returns a correctly-formed `paymasterParams` object for common [paymaster flows](../../reference/concepts/account-abstraction.md#built-in-paymaster-flows).


#### Inputs
Expand All @@ -66,4 +66,4 @@ Returns a correctly-formed `paymasterParams` object for common [paymaster flows]
export function getPaymasterParams(paymasterAddress: Address, paymasterInput: PaymasterInput): PaymasterParams
```

Find out more about the [`PaymasterInput` type](./types.md).
Find out more about the [`PaymasterInput` type](./types.md).
4 changes: 2 additions & 2 deletions docs/api/js/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ async getPriorityOpResponse(l1TxResponse: ethers.providers.TransactionResponse):

### `getTestnetPaymasterAddress`

Returns the [testnet paymaster](../../reference/concepts/aa.md#paymasters) address if available, or null.
Returns the [testnet paymaster](../../reference/concepts/account-abstraction.md#paymasters) address if available, or null.

```typescript
async getTestnetPaymasterAddress(): Promise<Address | null> {
Expand Down Expand Up @@ -819,4 +819,4 @@ override async send(method: string, params?: Array<any>): Promise<any> {
override getSigner(addressOrIndex?: number | string): Signer {
return Signer.from(super.getSigner(addressOrIndex) as any);
}
```
```
3 changes: 2 additions & 1 deletion docs/api/js/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ export async function getERC20DefaultBridgeData(
}
```


### `getL2HashFromPriorityOp`

Returns the hash of the L2 priority operation from a given transaction receipt and L2 address.
Expand Down Expand Up @@ -810,4 +811,4 @@ export function undoL1ToL2Alias(address: string): string {
}
```

See also [`applyl1tol2alias`](#applyl1tol2alias).
See also [`applyl1tol2alias`](#applyl1tol2alias).
10 changes: 5 additions & 5 deletions docs/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Our docs are open source so feel free to suggest new topics, add new content, or

## Tutorials

- [Cross-chain governance](./tutorials/cross-chain-tutorial.md): Facilitate cross-chain governance between L1 and L2 with this comprehensive guide.
- [Account abstraction multisig](./tutorials/custom-aa-tutorial.md): Build, deploy, and test a 2-of-2 multi-signature account using a factory contract.
- [Daily spending limit account](./tutorials/aa-daily-spend-limit.md): Create a smart contract account with a daily spending limit using zkSync Era's account abstraction support.
- [Building a custom paymaster](./tutorials/custom-paymaster-tutorial.md): Construct a custom paymaster to enable users to pay fees with any ERC20 token.
- [USDC paymaster tutorial with API3 dAPIs](./tutorials/api3-usd-paymaster-tutorial.md): Develop a custom paymaster leveraging API3 data feeds, allowing users to pay fees with mockUSDC ERC20 token.
- [Cross chain governance](./tutorials/cross-chain-tutorial.md): send transactions and update variables in a contract state using L1-L2 communication.
- [Account abstraction multisig](./tutorials/custom-aa-tutorial.md): create a native multisig smart contract account.
- [Daily spending limit account](./tutorials/aa-daily-spend-limit.md): create a smart contract account with a daily spending limit.
- [Building a custom paymaster](./tutorials/custom-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with an ERC20 token.
- [USDC paymaster tutorial with API3](./tutorials/api3-usd-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with USDC using API3 dAPIs.
4 changes: 2 additions & 2 deletions docs/dev/building-on-zksync/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Use zkSync Era's native account abstraction support for signature validation ins
We recommend not relying on the fact that an account has an ECDSA private key, since the account may be governed by
multisig and use another signature scheme.

Read more about [zkSync Era Account Abstraction support](../../reference/concepts/aa.md).
Read more about [zkSync Era Account Abstraction support](../../reference/concepts/account-abstraction.md).

## Use local testing environment

Expand All @@ -110,4 +110,4 @@ The zkSync team provides a dockerized local setup specifically designed for loca

By incorporating local testing into your development workflow, you can effectively verify the behavior and functionality of your contracts in a controlled environment, ensuring a smooth deployment process to the mainnet.

For detailed instructions on configuring the local testing environment and performing tests using Mocha and Chai, refer to the dedicated [Local Testing](../../tools/hardhat/testing.md) page.
For detailed instructions on configuring the local testing environment and performing tests using Mocha and Chai, refer to the dedicated [Local Testing](../../tools/hardhat/testing.md) page.
8 changes: 4 additions & 4 deletions docs/dev/building-on-zksync/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Navigate to `http://localhost:8080/` in a browser to see the running application

Enabling smart accounts allows you to onboard Argent account abstraction wallet users that have been using the first version of zkSync.

- Use [this library](../../reference/concepts/aa#aa-signature-checker) to verify your smart account compatibility.
- Use [this library](../../reference/concepts/account-abstraction.md#aa-signature-checker) to verify your smart account compatibility.
- Follow [this guide](https://docs.argent.xyz/) to add Argent login to your dApp.

#### Externally owned accounts (EOAs)
Expand Down Expand Up @@ -543,9 +543,9 @@ Read more about `wallet_requestPermissions`, in the [MetaMask documentation](htt
### Paying fees using testnet paymaster
The zkSync Era account abstraction feature allows you to integrate [paymasters](../../reference/concepts/aa.md#paymasters) that can pay the fees entirely for you, or swap your tokens on the fly.
The zkSync Era account abstraction feature allows you to integrate [paymasters](../../reference/concepts/account-abstraction.md#paymasters) that can pay the fees entirely for you, or swap your tokens on the fly.
We will use the [testnet paymaster](../../reference/concepts/aa.md#testnet-paymaster) that is provided on all zkSync Era testnets.
We will use the [testnet paymaster](../../reference/concepts/account-abstraction.md#testnet-paymaster) that is provided on all zkSync Era testnets.
:::info
**The testnet paymaster allows users to pay fees in any ERC20 token** with the exchange rate of Token:ETH of 1:1, i.e. one unit of the token for one wei of ETH.
Expand Down Expand Up @@ -623,7 +623,7 @@ async getOverrides() {
}
```
4. Now, what is left is to encode the paymasterInput following the [protocol requirements](../../reference/concepts/aa.md#testnet-paymaster) and return the needed overrides.
4. Now, what is left is to encode the paymasterInput following the [protocol requirements](../../reference/concepts/account-abstraction.md#testnet-paymaster) and return the needed overrides.
Copy/paste the following complete function:
Expand Down
7 changes: 7 additions & 0 deletions docs/dev/how-to/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# How to

- [Estimate gas](./estimate-gas.md): Learn to implement gas estimation for various transactions (L1 to L1, L1 to L2, L2 to L2) in the zkSync environment.
- [Send an L1 to L2 transaction](./send-transaction-l1-l2.md): Detailed guide for initiating an L1 to L2 transaction.
- [Send an L2 to L1 message](./send-message-l2-l1.md): Understand the process of sending an L2 to L1 message.
- [Transfer a token on L2](./transfer-token-l2.md): Discover the steps for transferring a token within L2.
- [Verify contracts with Hardhat](./verify-contracts.md): Contract verification using the zkSync Hardhat plugin.
10 changes: 5 additions & 5 deletions docs/dev/how-to/send-transaction-l1-l2.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Along with zkSync Era's built-in censorship resistance that requires multi-layer
```
:::
4. Call the JSON-RPC method [`zks_estimateGasL1toL2`](../../api/api.md#zks-estimategasl1tol2), wrapping the transaction data in a [`CallRequest`](#transaction-parameters-1) JSON object parameter.
4. Call the JSON-RPC method [`zks_estimateGasL1toL2`](../../api/api.md#zks-estimategasl1tol2), wrapping the transaction data in a `CallRequest` JSON object parameter.
The method returns the amount of gas required for the transaction to succeed.
Expand Down Expand Up @@ -136,7 +136,7 @@ Along with zkSync Era's built-in censorship resistance that requires multi-layer
```
:::
5. The return value is a 256-bit unsigned integer in hexadecimal representing the amount of gas the transaction uses.
6. The return value is a 256-bit unsigned integer in hexadecimal representing the amount of gas the transaction uses.
```json
{
Expand All @@ -146,7 +146,7 @@ Along with zkSync Era's built-in censorship resistance that requires multi-layer
}
```
6. Send the transaction, including the gas price and base cost in the value parameters, by calling the [`requestL2Transaction`](https://github.com/matter-labs/v2-testnet-contracts/blob/b8449bf9c819098cc8bfee0549ff5094456be51d/l1/contracts/zksync/interfaces/IMailbox.sol#L119) function.
7. Send the transaction, including the gas price and base cost in the value parameters, by calling the [`requestL2Transaction`](https://github.com/matter-labs/v2-testnet-contracts/blob/b8449bf9c819098cc8bfee0549ff5094456be51d/l1/contracts/zksync/interfaces/IMailbox.sol#L119) function.
Include the gas limit value from step 3 as `_l2GasLimit` and the `REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT` constant as `_l2GasPerPubdataByteLimit`.
Expand Down Expand Up @@ -190,10 +190,10 @@ Along with zkSync Era's built-in censorship resistance that requires multi-layer
- `_factoryDeps`: Bytecodes array containing the bytecode of the contract being deployed. If the contract is a factory contract, the array contains the bytecodes of the contracts it can deploy.
- `_refundRecipient`: Address that receives the rest of the fee after the transaction execution. If `refundRecipient == 0`, L2 `msg.sender` is used.
**Note**: If the `_refundRecipient` is a smart contract, then during the L1 to L2 transaction its address is [aliased](#aliasing).
**Note**: If the `_refundRecipient` is a smart contract, then during the L1 to L2 transaction its address is aliased.
:::
7. Wait for a transaction response and output the details.
8. Wait for a transaction response and output the details.
:::info Responses
- A **successful** L1 to L2 transaction produces an `L2Log` with `key = l2TxHash`, and `value = bytes32(1)`.
Expand Down
6 changes: 3 additions & 3 deletions docs/dev/how-to/verify-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For open-source projects, verifying contracts enhances trust and encourages more

### 1. Project setup

- Begin by installing [zkSync CLI](/docs/tools/zksync-cli/) to establish a new project:
- Begin by installing [zkSync CLI](../../tools/zksync-cli/README.md) to establish a new project:

```sh
yarn add global zksync-cli@latest
Expand Down Expand Up @@ -110,7 +110,7 @@ export default config;

### 4. Greeter contract compilation

The [zkSync CLI](/docs/tools/zksync-cli/) provides a `Greeter.sol` contract we will verify on zkSync Era.
The [zkSync CLI](../../tools/zksync-cli/README.md) provides a `Greeter.sol` contract we will verify on zkSync Era.

Compile the contract using this command:

Expand All @@ -120,7 +120,7 @@ yarn hardhat compile

### 5. Deploy the Greeter contract

The [zkSync CLI](/docs/tools/zksync-cli/) provides a `deploy/deploy-greeter.ts` script that we will use to deploy the Greeter contract.
The [zkSync CLI](../../tools/zksync-cli/README.md) provides a `deploy/deploy-greeter.ts` script that we will use to deploy the Greeter contract.

Add your private key to `<WALLET-PRIVATE-KEY>` in the `.env.example` file and remove `.example`.

Expand Down
9 changes: 9 additions & 0 deletions docs/dev/tutorials/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Tutorials

Here is the lisf of tutorials to help you build on zkSync Era.

- [Cross chain governance](./cross-chain-tutorial.md): send transactions and update variables in a contract state using L1-L2 communication.
- [Account abstraction multisig](./custom-aa-tutorial.md): create a native multisig smart contract account.
- [Daily spending limit account](./aa-daily-spend-limit.md): create a smart contract account with a daily spending limit.
- [Building a custom paymaster](./custom-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with an ERC20 token.
- [USDC paymaster tutorial with API3](./api3-usd-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with USDC using API3 dAPIs.
Loading

0 comments on commit 43e17df

Please sign in to comment.