diff --git a/contracts/README.md b/contracts/README.md index decf63b137..09fd967ce2 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -1,78 +1,78 @@ # Scroll Contracts -Note: For more comprehensive documentation, see [`./docs/`](./docs). +This directory contains the solidity code for Scroll L1 bridge and rollup contracts and L2 bridge and pre-deployed contracts. The [`specs`](../specs/) folder describes the overall Scroll protocol including the cross-domain messaging and rollup process. You can also find contract APIs and more details in the [`docs`](./docs) folder. ## Directory Structure -``` -integration-test -|- xxx.test.ts - "Hardhat integration tests" -lib -|- forge-std - "foundry dependency" -scripts -|- deploy_xxx.ts - "hardhat deploy script" -|- foundry - "foundry deploy scripts" -src -|- test -| `- xxx.t.sol - "Unit testi in solidity" -`- xxx.sol - "solidity contract" -.gitmodules - "foundry dependecy modules" -foundry.toml - "configure foundry" -hardhat.config.ts - "configure hardhat" -remappings.txt - "foundry dependency mappings" +
+├── docs: Documentation for the contracts +├── integration-test: Hardhat integration tests +├── lib: External libraries and testing tools +├── scripts: Deployment scripts +├── src +│ ├── gas-swap: Utility contract that allows gas payment in other tokens +│ ├── interfaces: Common contract interfaces +│ ├── L1: Contracts deployed on the L1 (Ethereum) +│ │ ├── gateways: Gateway router and token gateway contracts +│ │ ├── rollup: Rollup contracts for data availability and finalization +│ │ ├── IL1ScrollMessenger.sol: L1 Scroll messenger interface +│ │ └── L1ScrollMessenger.sol: L1 Scroll messenger contract +│ ├── L2: Contracts deployed on the L2 (Scroll) +│ │ ├── gateways: Gateway router and token gateway contracts +│ │ ├── predeploys: Pre-deployed contracts on L2 +│ │ ├── IL2ScrollMessenger.sol: L2 Scroll messenger interface +│ │ └── L2ScrollMessenger.sol: L2 Scroll messenger contract +│ ├── libraries: Shared contract libraries +│ ├── misc: Miscellaneous contracts +│ ├── mocks: Mock contracts used in the testing +│ ├── rate-limiter: Rater limiter contract +│ └── test: Unit tests in solidity +├── foundry.toml: Foundry configuration +├── hardhat.config.ts: Hardhat configuration +├── remappings.txt: Foundry dependency mappings ... -``` +## Dependencies +### Node.js + +First install [`Node.js`](https://nodejs.org/en) and [`npm`](https://www.npmjs.com/). +Run the following command to install [`yarn`](https://classic.yarnpkg.com/en/): + +```bash +npm install --global yarn +``` + ### Foundry -First run the command below to get foundryup, the Foundry toolchain installer: +Install `foundryup`, the Foundry toolchain installer: ```bash curl -L https://foundry.paradigm.xyz | bash ``` -If you do not want to use the redirect, feel free to manually download the foundryup installation script from [here](https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup). +If you do not want to use the redirect, feel free to manually download the `foundryup` installation script from [here](https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup). -Then, run `foundryup` in a new terminal session or after reloading your `PATH`. +Then, run `foundryup` in a new terminal session or after reloading `PATH`. Other ways to install Foundry can be found [here](https://github.com/foundry-rs/foundry#installation). ### Hardhat +Run the following command to install [Hardhat](https://hardhat.org/) and other dependencies. + ``` yarn install ``` ## Build -- Run `git submodule update --init --recursive` to initialise git submodules. +- Run `git submodule update --init --recursive` to initialize git submodules. - Run `yarn prettier:solidity` to run linting in fix mode, will auto-format all solidity codes. - Run `yarn prettier` to run linting in fix mode, will auto-format all typescript codes. -- Run `yarn prepare` to install the precommit linting hook +- Run `yarn prepare` to install the precommit linting hook. - Run `forge build` to compile contracts with foundry. - Run `npx hardhat compile` to compile with hardhat. - Run `forge test -vvv` to run foundry units tests. It will compile all contracts before running the unit tests. - Run `npx hardhat test` to run integration tests. It may not compile all contracts before running, it's better to run `npx hardhat compile` first. - -## TODO - -- [ ] unit tests - - [ ] L1 Messenger - - [x] L1 Gateways - - [x] L1 Gateway Router - - [ ] L2 Messenger - - [x] L2 Gateways - - [x] L2 Gateway Router - - [x] ScrollStandardERC20Factory - - [x] Whitelist - - [ ] SimpleGasOracle -- [ ] integration tests - - [x] ERC20Gateway - - [x] GatewayRouter -- [ ] ZKRollup contracts -- [x] Gas Oracle contracts for cross chain message call -- [ ] ERC721/ERC115 interface design -- [ ] add proof verification codes -- [ ] security analysis diff --git a/contracts/docs/CrossDomainMessaging.md b/contracts/docs/CrossDomainMessaging.md deleted file mode 100644 index f23b6359f2..0000000000 --- a/contracts/docs/CrossDomainMessaging.md +++ /dev/null @@ -1,33 +0,0 @@ -# Cross Domain Messaging - -Like other layer 2 protocol, Scroll allow dapps to communicate between layer 1 and layer 2. More specifically, dapps on layer 1 can trigger contract functions in layer 2, and vice versa. - -## Message Between L1 and L2 - -The Scroll protocol implements two core contracts `L1ScrollMessenger` and `L2ScrollMessenger` to enable cross domain messaging. The only entry to send cross domain message is to call the following function: - -```solidity -function sendMessage( - address _to, - bytes memory _message, - uint256 _gasLimit - ) external payable -``` - -The function is attached in both messenger in layer 1 and layer 2. After that, the Sequencer will handle the rest part for you. We will explain the detailed workflow in the following docs. - -### Send Message from L1 to L2 - -As described above, the first step is to call `L1ScrollMessenger.sendMessage` in layer 1. The `L1ScrollMessenger` contract will emit a `SentMessage` event, which will be notified by the Sequencer. The Sequencer will for the confirmation of the function call in layer 1. Normally, the Sequencer will wait for 10-20 blocks. After that, the Sequencer will initiate a transaction in layer 2, calling function `L2ScrollMessenger.relayMessage` and finally, the message is executed in layer 2. - -The execution in layer 2 may be failed due to out of gas problem. In such case, one can call `L1ScrollMessenger.replayMessage` to replace the message with a larger gas limit. And the Sequencer will follow the steps and execute the message again in layer 2. - -### Send Message from L2 to L1 - -Similar to sending message from L1 to L2, you should call `L2ScrollMessenger.sendMessage` first in layer 2. The `L2ScrollMessenger` contract will emit a `SentMessage` event, which will be notified by the Sequencer. Unlike above, the Sequencer will first batch submit layer 2 transactions (or block) to `ZKRollup` contract in layer 1. Then the Sequencer will wait the proof generated by prover and submit the proof to `ZKRollup` contract in layer 1 again. Finally, anyone can call `L1ScrollMessenger.relayMessageWithProof` with correct proof to execute the message in layer 1. - -Currently, for the safety reason, we only allow privileged contracts to send cross domain messages. And only privileged accounts can call `L2ScrollMessenger.relayMessage`. - -## Fee For Sending Message - -to be discussed. diff --git a/contracts/docs/Overview.md b/contracts/docs/Overview.md deleted file mode 100644 index 0a9bce8c15..0000000000 --- a/contracts/docs/Overview.md +++ /dev/null @@ -1,22 +0,0 @@ -# Overview - -![](./assets/overview.png) - -The above picture is the overview of the contract design. There are several components both in layer 1 and layer 2: L1/L2 Scroll Messenger, various L1/L2 Gateways and L1/L2 Gateway Router. Besides these, there is a Rollup component only in layer 1. - -The followings are the detailed docs for each component (docs are generated automatically by `@primitivefi/hardhat-dodoc` plugin): - -- [L1 Scroll Messenger](./apis/L1ScrollMessenger.md) and [L2 Scroll Messenger](./apis/L2ScrollMessenger.md): Main entry for sending and relaying cross domain message. -- [Rollup](./apis/ZKRollup.md) -- [L1 Gateway Router](./apis/L1GatewayRouter.md) and [L2 Gateway Router](./apis/L2GatewayRouter.md): Router contract for depositing/withdrawing Ethers and ERC20 tokens. -- L1/L2 Gateways: - - [L1 Standard ERC20 Gateway](./apis/L1StandardERC20Gateway.md) and [L2 Standard ERC20 Gateway](./apis/L2StandardERC20Gateway.md) - - [L1 WETH Gateway](./apis/L1WETHGateway.md) and [L2 WETH Gateway](./apis/L2WETHGateway.md) - - [L1 ERC721 Gateway](./apis/L1ERC721Gateway.md) and [L2 ERC721 Gateway](./apis/L2ERC721Gateway.md) - - [L1 ERC1155 Gateway](./apis/L1ERC1155Gateway.md) and [L2 ERC1155 Gateway](./apis/L2ERC1155Gateway.md) -- [ScrollStandardERC20Factory](./apis/ScrollStandardERC20Factory.md): The `ScrollStandardERC20` token factory used by `L2StandardERC20Gateway`. - -There are two main applications: Token Bridge and Cross Domain Messaging. You can find the documentations in the links below: - -- [Token Bridge](./TokenBridge.md): moving token from layer 1 to layer 2, or from layer 2 to layer 1. -- [Cross Domain Messaging](./CrossDomainMessaging.md): sending data to layer 2 from layer 1, or sending data to layer 2 from layer 1. Basically, it will help to trigger function call cross layer. The token bridge also use cross domain messaging to achieve its functionality. diff --git a/contracts/docs/TokenBridge.md b/contracts/docs/TokenBridge.md deleted file mode 100644 index 1d7f21363a..0000000000 --- a/contracts/docs/TokenBridge.md +++ /dev/null @@ -1,134 +0,0 @@ -# Bridge Token Between Layer 1 and Layer 2 - -The Token Bridge of Scroll Protocol offers a way to move assets from layer 1 to layer 2 and back, including Ether, ERC20 token, ERC-721 token, ERC-1155 token, etc. The asset should be deposited and locked in layer 1 and then in exchange of the same amount of an equivalent token on layer 2. For example, if you deposit 1000 Ether in layer 1, you will get 1000 Ether in layer 2 for return. And if you withdraw 1000 Ether in layer 2, you will get 1000 Ether in layer 1 for return. - -The Ether and ERC20 tokens can be deposited or withdrawn using one single contract `GatewayRouter` (`L1GatewayRouter` in layer 1 and `L2GatewayRouter` in layer 2). The ERC-721 tokens and ERC-1155 tokens can be deposited or withdrawn using the corresponding `ERC1155Gateway` and `ERC721Gateway` in layer 1 or layer 2 (They may be integrated into `GatewayRouter` in the future). - -## Bridge Ether - -To bridge Ether from layer 1 to layer 2, one can use `L1GatewayRouter.depositETH`. This will transfer ethers to the `L1ScrollMessenger` contract on the layer 1 and credits the same amount of ether to you in layer 2 at the specified address. - -```solidity -function depositETH(uint256 _gasLimit) external payable; - -function depositETH(address _to, uint256 _gasLimit) external payable; - -``` - -In the layer 1, all deposited Ether will be locked in `L1ScrollMessenger` contract. It means your deposited Ether will firstly be transfered to `L1GatewayRouter` contract and then to `L1ScrollMessenger` contract. - -To withdraw Ether from layer 2 to layer 1, one can use `L2GatewayRouter.withdrawETH`. - -```solidity -function withdrawETH(uint256 _gasLimit) external payable; - -function withdrawETH(address _to, uint256 _gasLimit) external payable; - -``` - -In layer 2, the `L2ScrollMessenger` holds infinite amount of Ether at the beginning. All your withdrawn Ether will be transfered back to `L2ScrollMessenger`, just like the process in layer 1. - -In addition, you can actually call `sendMessage` from the `L1ScrollMessenger` or `L2ScrollMessenger` contract to deposit or withdraw Ether. The `L1GatewayRouter.depositETH` and `L2GatewayRouter.withdrawETH` are just alias for `L1ScrollMessenger/L2ScrollMessenger.sendMessage`. - -## Bridge ERC20 Tokens - -We use the similar design as [Arbitrum protocol](https://developer.offchainlabs.com/docs/bridging_assets#bridging-erc20-tokens) do. Several gateway contracts are used to bridge different kinds of ERC20 tokens, such as Wrapped Ether, standard ERC20 tokens, etc. - -We implement a `StandardERC20Gateway` to deposit and withdraw standard ERC20 tokens. The standard procedure to deposit ERC20 tokens is to call `L1GatewayRouter.depositERC20` in layer 1. The token will be locked in `L1StandardERC20Gateway` contract in layer 1. The the standard procedure to withdraw ERC20 tokens is to call `L2GatewayRouter.withdrawRC20` in layer 2 and the token will be burned in layer 2. - -For many other non-standard ERC20 tokens, we provide a custom ERC20 gateway. Anyone can implement such gateway as long as it implements all required interfaces. We implement the Wrapped Ether gateway as an example. To deposit or withdraw Wrapped Ether, one should first unwrap it to Ether, then transfer the Ether to `ScrollMessenger` just like Ether bridging. - -### Passing data when depositing ERC20 tokens - -The Scroll protocol offer a way to call another contract after depositing the token in layer 2 by calling `L1GatewayRouter.depositERC20AndCall` in layer 1. The ERC20 token in layer 2 implements the [ERC 677 Standard](https://github.com/ethereum/EIPs/issues/677). By using `transferAndCall` function, we can transfer the token to corresponding recipient in layer 2 and then call the recipient with passed data. - -```solidity -function depositERC20AndCall( - address _token, - address _to, - uint256 _amount, - bytes memory _data, - uint256 _gasLimit -) external; - -``` - -Like Bridging Ether, all above functionality can be achieved by calling corresponding function in ERC20Gateway contract. - -## Bridge ERC-721/ERC-1155 Tokens - -The depositing/withdrawing ERC-721 or ERC-1155 tokens works very similar to ERC20 tokens. One can use the following function to deposit ERC-721/ERC-1155 tokens in layer 1. - -```solidity -function depositERC1155( - address _token, - uint256 _tokenId, - uint256 _amount, - uint256 _gasLimit -) external; - -function depositERC1155( - address _token, - address _to, - uint256 _tokenId, - uint256 _amount, - uint256 _gasLimit -) external; - -function depositERC721( - address _token, - uint256 _tokenId, - uint256 _gasLimit -) external; - -function depositERC721( - address _token, - address _to, - uint256 _tokenId, - uint256 _gasLimit -) external; - -``` - -One can use the following function to withdraw ERC-721/ERC-1155 tokens in layer 2. - -```solidity -function withdrawERC1155( - address _token, - uint256 _tokenId, - uint256 _amount, - uint256 _gasLimit -) external; - -function withdrawERC1155( - address _token, - address _to, - uint256 _tokenId, - uint256 _amount, - uint256 _gasLimit -) external; - -function withdrawERC721( - address _token, - uint256 _tokenId, - uint256 _gasLimit -) external; - -function withdrawERC721( - address _token, - address _to, - uint256 _tokenId, - uint256 _gasLimit -) external; - -``` - -To save the gas usage, we also provide a batch deposit/withdraw function, such as `batchDepositERC1155` and `batchDepositERC721`, by passing a list of token ids to the function. - -## Drop Depositing/Withdrawing - -Coming soon... - -## Force Exit - -Coming soon... diff --git a/contracts/docs/apis/ScrollChain.md b/contracts/docs/apis/ScrollChain.md new file mode 100644 index 0000000000..ae61a96e73 --- /dev/null +++ b/contracts/docs/apis/ScrollChain.md @@ -0,0 +1,571 @@ +# ScrollChain + + + +> ScrollChain + +This contract maintains data for the Scroll rollup. + + + +## Methods + +### commitBatch + +```solidity +function commitBatch(uint8 _version, bytes _parentBatchHeader, bytes[] _chunks, bytes _skippedL1MessageBitmap) external nonpayable +``` + +Commit a batch of transactions on layer 1. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _version | uint8 | undefined | +| _parentBatchHeader | bytes | undefined | +| _chunks | bytes[] | undefined | +| _skippedL1MessageBitmap | bytes | undefined | + +### committedBatches + +```solidity +function committedBatches(uint256) external view returns (bytes32) +``` + +Return the batch hash of a committed batch. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### finalizeBatchWithProof + +```solidity +function finalizeBatchWithProof(bytes _batchHeader, bytes32 _prevStateRoot, bytes32 _postStateRoot, bytes32 _withdrawRoot, bytes _aggrProof) external nonpayable +``` + +Finalize a committed batch on layer 1. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _batchHeader | bytes | undefined | +| _prevStateRoot | bytes32 | undefined | +| _postStateRoot | bytes32 | undefined | +| _withdrawRoot | bytes32 | undefined | +| _aggrProof | bytes | undefined | + +### finalizedStateRoots + +```solidity +function finalizedStateRoots(uint256) external view returns (bytes32) +``` + +Return the state root of a committed batch. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### importGenesisBatch + +```solidity +function importGenesisBatch(bytes _batchHeader, bytes32 _stateRoot) external nonpayable +``` + +Import layer 2 genesis block + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _batchHeader | bytes | undefined | +| _stateRoot | bytes32 | undefined | + +### initialize + +```solidity +function initialize(address _messageQueue, address _verifier, uint256 _maxNumL2TxInChunk) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _messageQueue | address | undefined | +| _verifier | address | undefined | +| _maxNumL2TxInChunk | uint256 | undefined | + +### isBatchFinalized + +```solidity +function isBatchFinalized(uint256 _batchIndex) external view returns (bool) +``` + +Return whether the batch is finalized by batch index. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _batchIndex | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### isProver + +```solidity +function isProver(address) external view returns (bool) +``` + +Whether an account is a prover. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### isSequencer + +```solidity +function isSequencer(address) external view returns (bool) +``` + +Whether an account is a sequencer. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### lastFinalizedBatchIndex + +```solidity +function lastFinalizedBatchIndex() external view returns (uint256) +``` + +The latest finalized batch index. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### layer2ChainId + +```solidity +function layer2ChainId() external view returns (uint64) +``` + +The chain id of the corresponding layer 2 chain. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint64 | undefined | + +### maxNumL2TxInChunk + +```solidity +function maxNumL2TxInChunk() external view returns (uint256) +``` + +The maximum number of transactions allowed in each chunk. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### messageQueue + +```solidity +function messageQueue() external view returns (address) +``` + +The address of L1MessageQueue. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + + + +*Returns the address of the current owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + + + +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.* + + +### revertBatch + +```solidity +function revertBatch(bytes _batchHeader, uint256 _count) external nonpayable +``` + +Revert a pending batch. + +*one can only revert unfinalized batches.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _batchHeader | bytes | undefined | +| _count | uint256 | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + + + +*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newOwner | address | undefined | + +### updateMaxNumL2TxInChunk + +```solidity +function updateMaxNumL2TxInChunk(uint256 _maxNumL2TxInChunk) external nonpayable +``` + +Update the value of `maxNumL2TxInChunk`. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _maxNumL2TxInChunk | uint256 | The new value of `maxNumL2TxInChunk`. | + +### updateProver + +```solidity +function updateProver(address _account, bool _status) external nonpayable +``` + +Update the status of prover. + +*This function can only called by contract owner.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _account | address | The address of account to update. | +| _status | bool | The status of the account to update. | + +### updateSequencer + +```solidity +function updateSequencer(address _account, bool _status) external nonpayable +``` + +Update the status of sequencer. + +*This function can only called by contract owner.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _account | address | The address of account to update. | +| _status | bool | The status of the account to update. | + +### updateVerifier + +```solidity +function updateVerifier(address _newVerifier) external nonpayable +``` + +Update the address verifier contract. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _newVerifier | address | The address of new verifier contract. | + +### verifier + +```solidity +function verifier() external view returns (address) +``` + +The address of RollupVerifier. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### withdrawRoots + +```solidity +function withdrawRoots(uint256) external view returns (bytes32) +``` + +Return the message root of a committed batch. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + + + +## Events + +### CommitBatch + +```solidity +event CommitBatch(bytes32 indexed batchHash) +``` + +Emitted when a new batch is committed. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| batchHash `indexed` | bytes32 | undefined | + +### FinalizeBatch + +```solidity +event FinalizeBatch(bytes32 indexed batchHash, bytes32 stateRoot, bytes32 withdrawRoot) +``` + +Emitted when a batch is finalized. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| batchHash `indexed` | bytes32 | undefined | +| stateRoot | bytes32 | undefined | +| withdrawRoot | bytes32 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### RevertBatch + +```solidity +event RevertBatch(bytes32 indexed batchHash) +``` + +revert a pending batch. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| batchHash `indexed` | bytes32 | undefined | + +### UpdateMaxNumL2TxInChunk + +```solidity +event UpdateMaxNumL2TxInChunk(uint256 oldMaxNumL2TxInChunk, uint256 newMaxNumL2TxInChunk) +``` + +Emitted when the value of `maxNumL2TxInChunk` is updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| oldMaxNumL2TxInChunk | uint256 | The old value of `maxNumL2TxInChunk`. | +| newMaxNumL2TxInChunk | uint256 | The new value of `maxNumL2TxInChunk`. | + +### UpdateProver + +```solidity +event UpdateProver(address indexed account, bool status) +``` + +Emitted when owner updates the status of prover. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | The address of account updated. | +| status | bool | The status of the account updated. | + +### UpdateSequencer + +```solidity +event UpdateSequencer(address indexed account, bool status) +``` + +Emitted when owner updates the status of sequencer. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | The address of account updated. | +| status | bool | The status of the account updated. | + +### UpdateVerifier + +```solidity +event UpdateVerifier(address oldVerifier, address newVerifier) +``` + +Emitted when the address of rollup verifier is updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| oldVerifier | address | The address of old rollup verifier. | +| newVerifier | address | The address of new rollup verifier. | + + + diff --git a/contracts/docs/assets/overview.png b/contracts/docs/assets/overview.png deleted file mode 100644 index b8a526597b..0000000000 Binary files a/contracts/docs/assets/overview.png and /dev/null differ diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index da5917e373..7fb93c7c2f 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -91,7 +91,7 @@ const config: HardhatUserConfig = { runOnCompile: true, keepFileStructure: false, include: [ - "ZKRollup", + "ScrollChain", "L1ScrollMessenger", "L2ScrollMessenger", "L1GatewayRouter", @@ -118,8 +118,9 @@ const config: HardhatUserConfig = { "IL1ERC1155Gateway", "IL2ERC1155Gateway", "IScrollStandardERC20Factory", - "IZKRollup", - "WrappedEther", + "IScrollChain", + "ScrollChainCommitmentVerifier", + "WETH9", ], }, };