Skip to content

Commit

Permalink
docs: update zkSync casing to ZKsync (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
benceharomi authored Aug 28, 2024
1 parent f2d553b commit 383e1b0
Show file tree
Hide file tree
Showing 104 changed files with 218 additions and 220 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ We aim to make it as easy as possible to contribute to the mission. This is stil
and suggestions here too. Some resources to help:

1. [In-repo docs aimed at developers](docs)
2. [zkSync Era docs!](https://era.zksync.io/docs/)
2. [ZKsync Era docs!](https://era.zksync.io/docs/)
3. Company links can be found in the [repo's readme](README.md)

## Code of Conduct
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# zkSync Era: Smart Contracts
# ZKsync Era: Smart Contracts

[![Logo](eraLogo.svg)](https://zksync.io/)

zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or
ZKsync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or
decentralization. Since it's EVM compatible (Solidity/Vyper), 99% of Ethereum projects can redeploy without refactoring
or re-auditing a single line of code. zkSync Era also uses an LLVM-based compiler that will eventually let developers
or re-auditing a single line of code. ZKsync Era also uses an LLVM-based compiler that will eventually let developers
write smart contracts in C++, Rust and other popular languages.

This repository contains both L1 and L2 zkSync smart contracts. For their description see the
This repository contains both L1 and L2 ZKsync smart contracts. For their description see the
[system overview](docs/Overview.md).

## Disclaimer
Expand All @@ -17,7 +17,7 @@ others may not.

## License

zkSync Era contracts are distributed under the terms of the MIT license.
ZKsync Era contracts are distributed under the terms of the MIT license.

See [LICENSE-MIT](LICENSE-MIT) for details.

Expand All @@ -33,7 +33,7 @@ See [LICENSE-MIT](LICENSE-MIT) for details.

## Disclaimer

zkSync Era has been through lots of testing and audits. Although it is live, it is still in alpha state and will go
ZKsync Era has been through lots of testing and audits. Although it is live, it is still in alpha state and will go
through more audits and bug bounties programs. We would love to hear our community's thoughts and suggestions about it!
It is important to state that forking it now can potentially lead to missing important security updates, critical
features, and performance improvements.
24 changes: 12 additions & 12 deletions docs/Overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overview

zkSync Era is a permissionless general-purpose ZK rollup. Similar to many L1 blockchains and sidechains it enables
ZKsync Era is a permissionless general-purpose ZK rollup. Similar to many L1 blockchains and sidechains it enables
deployment and interaction with Turing-complete smart contracts.

- L2 smart contracts are executed on a zkEVM.
Expand All @@ -10,7 +10,7 @@ deployment and interaction with Turing-complete smart contracts.
- There is no escape hatch mechanism yet, but there will be one.

All data that is needed to restore the L2 state are also pushed on-chain. There are two approaches, publishing inputs of
L2 transactions on-chain and publishing the state transition diff. zkSync follows the second option.
L2 transactions on-chain and publishing the state transition diff. ZKsync follows the second option.

See the [documentation](https://era.zksync.io/docs/dev/fundamentals/rollups.html) to read more!

Expand All @@ -25,13 +25,13 @@ See the [documentation](https://era.zksync.io/docs/dev/fundamentals/rollups.html
L2 blocks.
- **Facet** - implementation contract. The word comes from the EIP-2535.
- **Gas** - a unit that measures the amount of computational effort required to execute specific operations on the
zkSync Era network.
ZKsync Era network.

### L1 Smart contracts

#### Diamond

Technically, this L1 smart contract acts as a connector between Ethereum (L1) and zkSync (L2). This contract checks the
Technically, this L1 smart contract acts as a connector between Ethereum (L1) and ZKsync (L2). This contract checks the
validity proof and data availability, handles L2 <-> L1 communication, finalizes L2 state transition, and more.

There are also important contracts deployed on the L2 that can also execute logic called _system contracts_. Using L2
Expand Down Expand Up @@ -73,7 +73,7 @@ execution of upgrades in the diamond proxy.

This contract manages operations (calls with preconditions) for governance tasks. The contract allows for operations to
be scheduled, executed, and canceled with appropriate permissions and delays. It is used for managing and coordinating
upgrades and changes in all zkSync Era governed contracts.
upgrades and changes in all ZKsync Era governed contracts.

Each upgrade consists of two steps:

Expand Down Expand Up @@ -122,8 +122,8 @@ function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Ad
```

For most of the rollups the address aliasing needs to prevent cross-chain exploits that would otherwise be possible if
we simply reused the same L1 addresses as the L2 sender. In zkSync Era address derivation rule is different from the
Ethereum, so cross-chain exploits are already impossible. However, zkSync Era may add full EVM support in the future, so
we simply reused the same L1 addresses as the L2 sender. In ZKsync Era address derivation rule is different from the
Ethereum, so cross-chain exploits are already impossible. However, ZKsync Era may add full EVM support in the future, so
applying address aliasing leave room for future EVM compatibility.

The L1 -> L2 communication is also used for bridging ether. The user should include a `msg.value` when initiating a
Expand Down Expand Up @@ -253,8 +253,8 @@ the L1 recipient.

#### ValidatorTimelock

An intermediate smart contract between the validator EOA account and the zkSync smart contract. Its primary purpose is
to provide a trustless means of delaying batch execution without modifying the main zkSync contract. zkSync actively
An intermediate smart contract between the validator EOA account and the ZKsync smart contract. Its primary purpose is
to provide a trustless means of delaying batch execution without modifying the main ZKsync contract. ZKsync actively
monitors the chain activity and reacts to any suspicious activity by freezing the chain. This allows time for
investigation and mitigation before resuming normal operations.

Expand All @@ -264,12 +264,12 @@ the Alpha stage.
This contract consists of four main functions `commitBatches`, `proveBatches`, `executeBatches`, and `revertBatches`,
that can be called only by the validator.

When the validator calls `commitBatches`, the same calldata will be propagated to the zkSync contract (`DiamondProxy`
When the validator calls `commitBatches`, the same calldata will be propagated to the ZKsync contract (`DiamondProxy`
through `call` where it invokes the `ExecutorFacet` through `delegatecall`), and also a timestamp is assigned to these
batches to track the time these batches are committed by the validator to enforce a delay between committing and
execution of batches. Then, the validator can prove the already committed batches regardless of the mentioned timestamp,
and again the same calldata (related to the `proveBatches` function) will be propagated to the zkSync contract. After,
the `delay` is elapsed, the validator is allowed to call `executeBatches` to propagate the same calldata to zkSync
and again the same calldata (related to the `proveBatches` function) will be propagated to the ZKsync contract. After,
the `delay` is elapsed, the validator is allowed to call `executeBatches` to propagate the same calldata to ZKsync
contract.

### L2 specifics
Expand Down
2 changes: 1 addition & 1 deletion gas-bound-caller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Since `GasBoundCaller` would be the contract that calls the `_to` contract, the

It should be deployed via a built-in CREATE2 factory on each individual chain.

The current address on both sepolia testnet and mainnet for zkSync Era is `0xc706EC7dfA5D4Dc87f29f859094165E8290530f5`.
The current address on both sepolia testnet and mainnet for ZKsync Era is `0xc706EC7dfA5D4Dc87f29f859094165E8290530f5`.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {MSG_VALUE_SYSTEM_CONTRACT, MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT} from "@mat
import {Utils} from "@matterlabs/zksync-contracts/l2/system-contracts/libraries/Utils.sol";

// Addresses used for the compiler to be replaced with the
// zkSync-specific opcodes during the compilation.
// ZKsync-specific opcodes during the compilation.
// IMPORTANT: these are just compile-time constants and are used
// only if used in-place by Yul optimizer.
address constant TO_L1_CALL_ADDRESS = address((1 << 16) - 1);
Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# zkSync Era: L1 Contracts
# ZKsync Era: L1 Contracts

[![Logo](../eraLogo.svg)](https://zksync.io/)

zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or
ZKsync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or
decentralization. Since it's EVM compatible (Solidity/Vyper), 99% of Ethereum projects can redeploy without refactoring
or re-auditing a single line of code. zkSync Era also uses an LLVM-based compiler that will eventually let developers
or re-auditing a single line of code. ZKsync Era also uses an LLVM-based compiler that will eventually let developers
write smart contracts in C++, Rust and other popular languages.

## L1 Contracts
Expand Down
14 changes: 7 additions & 7 deletions l1-contracts/contracts/bridge/L1ERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {Unauthorized, EmptyDeposit, TokensWithFeesNotSupported, WithdrawalAlread
/// @author Matter Labs
/// @custom:security-contact [email protected]
/// @notice Smart contract that allows depositing ERC20 tokens from Ethereum to hyperchains
/// @dev It is a legacy bridge from zkSync Era, that was deprecated in favour of shared bridge.
/// @dev It is a legacy bridge from ZKsync Era, that was deprecated in favour of shared bridge.
/// It is needed for backward compatibility with already integrated projects.
contract L1ERC20Bridge is IL1ERC20Bridge, ReentrancyGuard {
using SafeERC20 for IERC20;
Expand All @@ -25,25 +25,25 @@ contract L1ERC20Bridge is IL1ERC20Bridge, ReentrancyGuard {
IL1SharedBridge public immutable override SHARED_BRIDGE;

/// @dev A mapping L2 batch number => message number => flag.
/// @dev Used to indicate that L2 -> L1 message was already processed for zkSync Era withdrawals.
/// @dev Used to indicate that L2 -> L1 message was already processed for ZKsync Era withdrawals.
// slither-disable-next-line uninitialized-state
mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized))
public isWithdrawalFinalized;

/// @dev A mapping account => L1 token address => L2 deposit transaction hash => amount.
/// @dev Used for saving the number of deposited funds, to claim them in case the deposit transaction will fail in zkSync Era.
/// @dev Used for saving the number of deposited funds, to claim them in case the deposit transaction will fail in ZKsync Era.
mapping(address account => mapping(address l1Token => mapping(bytes32 depositL2TxHash => uint256 amount)))
public depositAmount;

/// @dev The address that is used as a L2 bridge counterpart in zkSync Era.
/// @dev The address that is used as a L2 bridge counterpart in ZKsync Era.
// slither-disable-next-line uninitialized-state
address public l2Bridge;

/// @dev The address that is used as a beacon for L2 tokens in zkSync Era.
/// @dev The address that is used as a beacon for L2 tokens in ZKsync Era.
// slither-disable-next-line uninitialized-state
address public l2TokenBeacon;

/// @dev Stores the hash of the L2 token proxy contract's bytecode on zkSync Era.
/// @dev Stores the hash of the L2 token proxy contract's bytecode on ZKsync Era.
// slither-disable-next-line uninitialized-state
bytes32 public l2TokenProxyBytecodeHash;

Expand Down Expand Up @@ -78,7 +78,7 @@ contract L1ERC20Bridge is IL1ERC20Bridge, ReentrancyGuard {
ERA LEGACY GETTERS
//////////////////////////////////////////////////////////////*/

/// @return The L2 token address that would be minted for deposit of the given L1 token on zkSync Era.
/// @return The L2 token address that would be minted for deposit of the given L1 token on ZKsync Era.
function l2TokenAddress(address _l1Token) external view returns (address) {
bytes32 constructorInputHash = keccak256(abi.encode(l2TokenBeacon, ""));
bytes32 salt = bytes32(uint256(uint160(_l1Token)));
Expand Down
Loading

0 comments on commit 383e1b0

Please sign in to comment.