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 kiriyaga-txfusion-upgradable-deployment-salt
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriyaga-txfusion authored May 14, 2024
2 parents 4043626 + 34c6c79 commit 30cf7e3
Show file tree
Hide file tree
Showing 31 changed files with 630 additions and 173 deletions.
4 changes: 4 additions & 0 deletions cspell-zksync.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ psql
jemalloc
recid
plux
pipx

// ETC
gitter
Expand Down Expand Up @@ -313,3 +314,6 @@ Aave
// testing ci
Omnibtc
Owlto
Gbps
Gelato
VRFs
8 changes: 8 additions & 0 deletions docs/.vuepress/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export const enSidebar = sidebar({
text: "SubQuery",
link: "/build/tutorials/tooling-guides/subquery.md",
},
{
text: "DipDup",
link: "/build/tutorials/tooling-guides/dipdup.md",
},
],
},
{
Expand Down Expand Up @@ -548,6 +552,10 @@ export const enSidebar = sidebar({
text: "Introduction",
link: "/infra/introduction.md",
},
{
text: "Quickstart",
link: "/infra/quickstart.md",
},
{
text: "Component Breakdown",
link: "/infra/component-breakdown.md",
Expand Down
Binary file added docs/assets/images/dipdupnew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/dockerps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/hasurarequest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
164 changes: 164 additions & 0 deletions docs/build/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,170 @@ curl -X POST -H "Content-Type: application/json" \
}
```

### `zks_sendRawTransactionWithDetailedOutput`

Executes a transaction and returns its hash, storage logs, and events that would have been generated
if the transaction had already been included in the block. The API has a similar behaviour to
`eth_sendRawTransaction` but with some extra data returned from it.

With this API Consumer apps can apply "optimistic" events in their applications instantly without having to wait for
zkSync block confirmation time.

It’s expected that the optimistic logs of two uncommitted transactions that modify the same state will not have causal
relationships between each other.

#### Inputs

| Parameter | Type | Description |
| --------- | -------- | --------------------------------------------------------------------------- |
| `data` | `string` | The signed transaction. Typically, signed with a library such as ethers.js. |

#### curl example

```curl
curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["Signed Transaction"],"id":1}' \
"https://mainnet.era.zksync.io"
```

#### Output

```json
{
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
"storageLogs": [
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x7",
"writtenValue": "0x40000000000000000000000006641f961"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x6",
"writtenValue": "0x5f5e100"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x9",
"writtenValue": "0xc0000000000000000000000006641f961"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x16",
"writtenValue": "0xe1ef29fc6c51f74bbdef5bc1406e3c9925d89c5b1f79215648b82ac15419bcbe"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0xa",
"writtenValue": "0x0"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x10c",
"writtenValue": "0xc0000000000000000000000006641f961"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0xa",
"writtenValue": "0xe3ed371c32f62f3b3a28d51b909b2668e293c6cbfa4b4fd549c8f00a9a93a296"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x110",
"writtenValue": "0x0"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x10f",
"writtenValue": "0x88"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x1",
"writtenValue": "0x8001"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x2",
"writtenValue": "0x5f5e100"
},
{
"address": "0x0000000000000000000000000000000000008003",
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
"writtenValue": "0x4"
},
{
"address": "0x000000000000000000000000000000000000800a",
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
"writtenValue": "0x55ce6fa97340"
},
{
"address": "0x000000000000000000000000000000000000800a",
"key": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
"writtenValue": "0xb9b031bf400"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x1",
"writtenValue": "0x36615cf349d7f6344891b1e7ca7c72883f5dc049"
},
{
"address": "0x000000000000000000000000000000000000800b",
"key": "0x1",
"writtenValue": "0x8001"
},
{
"address": "0x000000000000000000000000000000000000800a",
"key": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
"writtenValue": "0xa7557c54f00"
},
{
"address": "0x000000000000000000000000000000000000800a",
"key": "0xeaa2b2fbf0b42c559059e5e9510edc15755f1c1883f0e41d5ba5f9aea4ac201a",
"writtenValue": "0x56f41b001840"
}
],
"events": [
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x00000000000000000000000036615cf349d7f6344891b1e7ca7c72883f5dc049",
"0x0000000000000000000000000000000000000000000000000000000000008001"
],
"data": "0x00000000000000000000000000000000000000000000000000000b9b031bf400",
"blockHash": null,
"blockNumber": null,
"l1BatchNumber": "0x4",
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
"transactionIndex": "0x0",
"logIndex": null,
"transactionLogIndex": null,
"logType": null,
"removed": false
},
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000008001",
"0x00000000000000000000000036615cf349d7f6344891b1e7ca7c72883f5dc049"
],
"data": "0x00000000000000000000000000000000000000000000000000000125ab56a500",
"blockHash": null,
"blockNumber": null,
"l1BatchNumber": "0x4",
"transactionHash": "0xd586a9381ac33a70d1c34704664209242ee90316878fc1695aa8e4cf553c8595",
"transactionIndex": "0x0",
"logIndex": null,
"transactionLogIndex": null,
"logType": null,
"removed": false
}
]
}
```

## PubSub API

zkSync is fully compatible with [Geth's pubsub API](https://geth.ethereum.org/docs/interacting-with-geth/rpc/pubsub), except for the `syncing` subscription. This is because nodes on the zkSync network are technically always synchronized.
Expand Down
6 changes: 0 additions & 6 deletions docs/build/developer-reference/account-abstraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ head:

# Account Abstraction

::: warning

- Please note that with the system update released in Feb 2023, the `ergs` concept is only used by the VM while the API layer operates with `gas`.
- For more information, read the [changelog].
:::

## Introduction

On Ethereum there are two types of accounts: [externally owned accounts (EOAs)](https://ethereum.org/en/developers/docs/accounts/#externally-owned-accounts-and-key-pairs) and [contracts accounts](https://ethereum.org/en/developers/docs/accounts/#contract-accounts).
Expand Down
2 changes: 1 addition & 1 deletion docs/build/sdks/js/accounts-l1-l2.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ method specification [`getBaseCost`](accounts.md#getbasecost).

## Withdrawal

`Wallet` and `Signer` objects provide a withdrawal workflow. For more information, please refer to the method specification [`Deposit`](accounts.md#deposit).
`Wallet` and `Signer` objects provide a withdrawal workflow. For more information, please refer to the method specification [`Withdraw`](accounts.md#withdraw).

For a complete example of how to execute the deposit workflow, take a look at the following: [Withdraw ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/js/src/03_withdraw.ts).
2 changes: 1 addition & 1 deletion docs/build/sdks/js/zksync-ethers/accounts-l1-l2.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ method specification [`getBaseCost`](accounts.md#getbasecost).

## Withdrawal

`Wallet` and `Signer` objects provide a withdrawal workflow. For more information, please refer to the method specification [`Deposit`](accounts.md#deposit).
`Wallet` and `Signer` objects provide a withdrawal workflow. For more information, please refer to the method specification [`Withdraw`](accounts.md#withdraw).

For a complete example of how to execute the deposit workflow, take a look at the following: [Withdraw ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/js/src/03_withdraw.ts).
2 changes: 1 addition & 1 deletion docs/build/tooling/block-explorer/block-explorer-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The following modules are supported:
- [Logs](https://block-explorer-api.mainnet.zksync.io/docs#/Logs%20API)
- [Block](https://block-explorer-api.mainnet.zksync.io/docs#/Block%20API)

Check out the API documentation [API docs on Mainnet](https://block-explorer-api.mainnet.zksync.io/docs) | [API docs on Testnet](https://block-explorer-api.testnets.zksync.dev/docs)
Check out the API documentation [API docs on Mainnet](https://block-explorer-api.mainnet.zksync.io/docs) | [API docs on Testnet](https://block-explorer-api.sepolia.zksync.dev/docs)

:::note Note

Expand Down
2 changes: 1 addition & 1 deletion docs/build/tooling/block-explorer/contract-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ You can output the constructor argument data at deploy time by adding the follow
const your_constructor_argument = "Hi there!";
const myContract = await deployer.deploy(artifact, [your_constructor_argument]);

//obtain the Constructor Arguments
// obtain the Constructor Arguments
console.log("constructor args:" + myContract.interface.encodeDeploy([your_constructor_argument]));
```
2 changes: 1 addition & 1 deletion docs/build/tooling/block-explorer/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following modules are supported:
- [Logs](https://block-explorer-api.mainnet.zksync.io/docs#/Logs%20API)
- [Block](https://block-explorer-api.mainnet.zksync.io/docs#/Block%20API)

Check out the API documentation [API docs on Mainnet](https://block-explorer-api.mainnet.zksync.io/docs) | [API docs on Testnet](https://block-explorer-api.testnets.zksync.dev/docs)
Check out the API documentation [API docs on Mainnet](https://block-explorer-api.mainnet.zksync.io/docs) | [API docs on Testnet](https://block-explorer-api.sepolia.zksync.dev/docs)

:::note Note

Expand Down
1 change: 1 addition & 0 deletions docs/build/tooling/data-indexers.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Welcome to the Analytics page, a comprehensive hub dedicated to interacting with

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

### Contribute

Expand Down
2 changes: 1 addition & 1 deletion docs/build/tooling/hardhat/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default async function (hre: HardhatRuntimeEnvironment) {

const greeterContract = await deployer.deploy(artifact, [greeting]);

//obtain the Constructor Arguments
// obtain the Constructor Arguments
console.log("constructor args:" + greeterContract.interface.encodeDeploy([greeting]));

// Show the contract info.
Expand Down
4 changes: 2 additions & 2 deletions docs/build/tooling/nft-marketplaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ The following NFT marketplaces are specialized in facilitating the trade, creati
[Element](https://element.market/) is a community-driven aggregated marketplace where you can buy and sell NFTs across different platforms, save money, and earn rewards.\
**Specialty**: Aggregated Marketplace, Rewards

### Kreatorland
### Libera

[Kreatorland](https://kreatorland.com/) is a native NFT marketplace built specifically for the zkSync Era.\
[Libera](https://libera.xyz/) is a native NFT marketplace built specifically for the zkSync Era.\
**Specialty**: zkSync Era Native

### OKX NFT
Expand Down
4 changes: 4 additions & 0 deletions docs/build/tooling/node-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ head:

[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.

### NOWNodes

[NOWNodes](https://nownodes.io/nodes) provides Full Node for zkSync with is a high-quality standart and 24/7 support. Free Plan is available.

### 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 Down
6 changes: 5 additions & 1 deletion docs/build/tooling/oracles.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ Welcome to the Oracles page, a comprehensive hub dedicated to interacting with o

### Pyth

[Pythnet](https://docs.pyth.network/documentation/pythnet-price-feeds) price feeds use a "pull" price update model, where users are responsible for posting price updates on-chain when needed. Checkout the usage guide to get started today!
[Pythnet](https://docs.pyth.network/price-feeds) price feeds use a "pull" price update model, where users are responsible for posting price updates on-chain when needed. Checkout the usage guide to get started today!

### Gelato

[Gelato](https://docs.gelato.network/web3-services/vrf/understanding-vrf) provides access to Verifiable Random Functions (VRF) on zkSync. VRFs are cryptographic primitives that generate pseudorandom numbers in a way that is provably secure and verifiable. A VRF allows a holder of a private key to produce a random number along with a proof that the number was generated legitimately (making it publically verifable). More information, including how to use VRFs in your dApp, can be found in the Gelato docs.

### Usage guides

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const getOverrides = async () => {
2. Import `utils` from `zksync-ethers` SDK as we'll need to use some of its methods next:

```javascript
import { Contract, Web3Provider, Provider, utils } from "zksync-ethers";
import { Contract, BrowserProvider, Provider, utils } from "zksync-ethers";
```

3. We need to calculate how many tokens are required to process the transaction. Since the testnet paymaster exchanges any ERC20 token to ETH at a 1:1 rate, the amount is the same as the ETH amount in wei:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ The code below sets and removes the limit.
_updateLimit(_token, 0, 0, 0, false);
}
// verify if the update to a Limit struct is valid
// verify if the update to a Limit struct is valid
// Ensure that users can't freely modify(increase or remove) the daily limit to spend more.
function isValidUpdate(address _token) internal view returns (bool) {
// Reverts unless it is first spending after enabling
Expand Down
Loading

0 comments on commit 30cf7e3

Please sign in to comment.