diff --git a/.gitignore b/.gitignore index 10418cae..bf438599 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ typechain cache cache-hardhat artifacts +artifacts-hardhat broadcast # logs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..fbb19b01 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "lib/forge-std"] + path = lib/forge-std + url = https://github.com/foundry-rs/forge-std +[submodule "lib/solmate"] + path = lib/solmate + url = https://github.com/transmissions11/solmate +[submodule "lib/ds-test"] + path = lib/ds-test + url = https://github.com/dapphub/ds-test diff --git a/.husky/pre-commit b/.husky/pre-commit index cdb0f556..b946a2c5 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -cd contracts yarn lint-staged \ No newline at end of file diff --git a/README.md b/README.md index 50466220..b468ddc7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ # Scroll Contracts -This directory contains the solidity code for Scroll L1 bridge and rollup contracts and L2 bridge and pre-deployed contracts. You can also find contract APIs and more details in the [`docs`](./docs) folder. +This directory contains the solidity code for Scroll L1 bridge and rollup contracts and L2 bridge and pre-deployed contracts. ## Directory Structure
-├── docs: Documentation for the contracts
-├── integration-test: Hardhat integration tests
+├── hardhat-test: Hardhat integration tests
 ├── lib: External libraries and testing tools
 ├── scripts: Deployment scripts
 ├── src
@@ -72,7 +71,7 @@ yarn install
 - 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 `forge build` to compile contracts with foundry.
+- Run `forge build --evm-version cancun` 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 `forge test --evm-version cancun -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.
diff --git a/deployments/README.md b/deployments/README.md
deleted file mode 100644
index 88b430f1..00000000
--- a/deployments/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Deployments
-
-## local testnet
-
-```bash
-# start local hardhat node
-npx hardhat node
-```
-
-### layer 1
-
-Contract addresses can be found in [deployments](./l1geth.json).
-
-### layer 2
-
-Contract addresses can be found in [deployments](./l2geth.json).
diff --git a/deployments/l1geth.json b/deployments/l1geth.json
deleted file mode 100644
index 4a391321..00000000
--- a/deployments/l1geth.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-  "ProxyAdmin": null,
-  "ZKRollup": {
-    "implementation": null,
-    "proxy": null
-  },
-  "L1ScrollMessenger": {
-    "implementation": null,
-    "proxy": null
-  },
-  "L1GatewayRouter": {
-    "implementation": null,
-    "proxy": null
-  },
-  "L1StandardERC20Gateway": {
-    "implementation": null,
-    "proxy": null
-  },
-  "L1WETHGateway": {
-    "implementation": null,
-    "proxy": null
-  }
-}
diff --git a/deployments/l2geth.json b/deployments/l2geth.json
deleted file mode 100644
index 52032aa9..00000000
--- a/deployments/l2geth.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "ProxyAdmin": null,
-  "WETH": null,
-  "Whitelist": null,
-  "ScrollStandardERC20": null,
-  "ScrollStandardERC20Factory": null,
-  "L2ScrollMessenger": null,
-  "L2GatewayRouter": {
-    "implementation": null,
-    "proxy": null
-  },
-  "L2StandardERC20Gateway": {
-    "implementation": null,
-    "proxy": null
-  },
-  "L2WETHGateway": {
-    "implementation": null,
-    "proxy": null
-  }
-}
diff --git a/docs/apis/L1ERC1155Gateway.md b/docs/apis/L1ERC1155Gateway.md
deleted file mode 100644
index e410f029..00000000
--- a/docs/apis/L1ERC1155Gateway.md
+++ /dev/null
@@ -1,599 +0,0 @@
-# L1ERC1155Gateway
-
-
-
-> L1ERC1155Gateway
-
-The `L1ERC1155Gateway` is used to deposit ERC1155 compatible NFT on layer 1 and finalize withdraw the NFTs from layer 2.
-
-*The deposited NFTs are held in this gateway. On finalizing withdraw, the corresponding NFT will be transfer to the recipient directly. This will be changed if we have more specific scenarios.*
-
-## Methods
-
-### batchDepositERC1155
-
-```solidity
-function batchDepositERC1155(address _token, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external payable
-```
-
-Deposit a list of some ERC1155 NFT to caller's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC1155 NFT on layer 1. |
-| _tokenIds | uint256[] | The list of token ids to deposit. |
-| _amounts | uint256[] | The list of corresponding number of token to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### batchDepositERC1155
-
-```solidity
-function batchDepositERC1155(address _token, address _to, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external payable
-```
-
-Deposit a list of some ERC1155 NFT to a recipient's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC1155 NFT on layer 1. |
-| _to | address | The address of recipient on layer 2. |
-| _tokenIds | uint256[] | The list of token ids to deposit. |
-| _amounts | uint256[] | The list of corresponding number of token to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### depositERC1155
-
-```solidity
-function depositERC1155(address _token, address _to, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some ERC1155 NFT to a recipient's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC1155 NFT on layer 1. |
-| _to | address | The address of recipient on layer 2. |
-| _tokenId | uint256 | The token id to deposit. |
-| _amount | uint256 | The amount of token to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### depositERC1155
-
-```solidity
-function depositERC1155(address _token, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some ERC1155 NFT to caller's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC1155 NFT on layer 1. |
-| _tokenId | uint256 | The token id to deposit. |
-| _amount | uint256 | The amount of token to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### finalizeBatchWithdrawERC1155
-
-```solidity
-function finalizeBatchWithdrawERC1155(address _l1Token, address _l2Token, address _from, address _to, uint256[] _tokenIds, uint256[] _amounts) external nonpayable
-```
-
-Complete ERC1155 batch withdraw from layer 2 to layer 1 and send fund to recipient's account on layer 1.      The function should only be called by L1ScrollMessenger.      The function should also only be called by L2ERC1155Gateway on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of corresponding layer 1 token. |
-| _l2Token | address | The address of corresponding layer 2 token. |
-| _from | address | The address of account who withdraw the token on layer 2. |
-| _to | address | The address of recipient on layer 1 to receive the token. |
-| _tokenIds | uint256[] | The list of token ids to withdraw. |
-| _amounts | uint256[] | The list of corresponding number of token to withdraw. |
-
-### finalizeWithdrawERC1155
-
-```solidity
-function finalizeWithdrawERC1155(address _l1Token, address _l2Token, address _from, address _to, uint256 _tokenId, uint256 _amount) external nonpayable
-```
-
-Complete ERC1155 withdraw from layer 2 to layer 1 and send fund to recipient's account on layer 1.      The function should only be called by L1ScrollMessenger.      The function should also only be called by L2ERC1155Gateway on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of corresponding layer 1 token. |
-| _l2Token | address | The address of corresponding layer 2 token. |
-| _from | address | The address of account who withdraw the token on layer 2. |
-| _to | address | The address of recipient on layer 1 to receive the token. |
-| _tokenId | uint256 | The token id to withdraw. |
-| _amount | uint256 | The amount of token to withdraw. |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _messenger) external nonpayable
-```
-
-Initialize the storage of L1ERC1155Gateway.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of L2ERC1155Gateway in L2. |
-| _messenger | address | The address of L1ScrollMessenger in L1. |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### onDropMessage
-
-```solidity
-function onDropMessage(bytes _message) external payable
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _message | bytes | undefined |
-
-### onERC1155BatchReceived
-
-```solidity
-function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256[] | undefined |
-| _3 | uint256[] | undefined |
-| _4 | bytes | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes4 | undefined |
-
-### onERC1155Received
-
-```solidity
-function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256 | undefined |
-| _3 | uint256 | undefined |
-| _4 | bytes | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes4 | 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### supportsInterface
-
-```solidity
-function supportsInterface(bytes4 interfaceId) external view returns (bool)
-```
-
-
-
-*See {IERC165-supportsInterface}.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| interfaceId | bytes4 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### tokenMapping
-
-```solidity
-function tokenMapping(address) external view returns (address)
-```
-
-Mapping from l1 token address to l2 token address for ERC1155 NFT.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-### updateTokenMapping
-
-```solidity
-function updateTokenMapping(address _l1Token, address _l2Token) external nonpayable
-```
-
-Update layer 2 to layer 2 token mapping.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of ERC1155 token on layer 1. |
-| _l2Token | address | The address of corresponding ERC1155 token on layer 2. |
-
-
-
-## Events
-
-### BatchDepositERC1155
-
-```solidity
-event BatchDepositERC1155(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256[] _tokenIds, uint256[] _amounts)
-```
-
-Emitted when the ERC1155 NFT is batch deposited to gateway on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 1. |
-| _to  | address | The address of recipient on layer 2. |
-| _tokenIds  | uint256[] | The list of token ids of the ERC1155 NFT to deposit on layer 1. |
-| _amounts  | uint256[] | The list of corresponding number of token to deposit on layer 1. |
-
-### BatchRefundERC1155
-
-```solidity
-event BatchRefundERC1155(address indexed token, address indexed recipient, uint256[] tokenIds, uint256[] amounts)
-```
-
-Emitted when some ERC1155 token is refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of the token in L1. |
-| recipient `indexed` | address | The address of receiver in L1. |
-| tokenIds  | uint256[] | The list of ids of token refunded. |
-| amounts  | uint256[] | The list of amount of token refunded. |
-
-### DepositERC1155
-
-```solidity
-event DepositERC1155(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _tokenId, uint256 _amount)
-```
-
-Emitted when the ERC1155 NFT is deposited to gateway on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 1. |
-| _to  | address | The address of recipient on layer 2. |
-| _tokenId  | uint256 | The token id of the ERC1155 NFT to deposit on layer 1. |
-| _amount  | uint256 | The number of token to deposit on layer 1. |
-
-### FinalizeBatchWithdrawERC1155
-
-```solidity
-event FinalizeBatchWithdrawERC1155(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256[] _tokenIds, uint256[] _amounts)
-```
-
-Emitted when the ERC1155 NFT is batch transferred to recipient on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 2. |
-| _to  | address | The address of recipient on layer 1. |
-| _tokenIds  | uint256[] | The list of token ids of the ERC1155 NFT to withdraw from layer 2. |
-| _amounts  | uint256[] | The list of corresponding number of token to withdraw from layer 2. |
-
-### FinalizeWithdrawERC1155
-
-```solidity
-event FinalizeWithdrawERC1155(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _tokenId, uint256 _amount)
-```
-
-Emitted when the ERC1155 NFT is transferred to recipient on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 2. |
-| _to  | address | The address of recipient on layer 1. |
-| _tokenId  | uint256 | The token id of the ERC1155 NFT to withdraw from layer 2. |
-| _amount  | uint256 | The number of token to withdraw from layer 2. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### RefundERC1155
-
-```solidity
-event RefundERC1155(address indexed token, address indexed recipient, uint256 tokenId, uint256 amount)
-```
-
-Emitted when some ERC1155 token is refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of the token in L1. |
-| recipient `indexed` | address | The address of receiver in L1. |
-| tokenId  | uint256 | The id of token refunded. |
-| amount  | uint256 | The amount of token refunded. |
-
-### UpdateTokenMapping
-
-```solidity
-event UpdateTokenMapping(address indexed l1Token, address indexed oldL2Token, address indexed newL2Token)
-```
-
-Emitted when token mapping for ERC1155 token is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC1155 token in layer 1. |
-| oldL2Token `indexed` | address | The address of the old corresponding ERC1155 token in layer 2. |
-| newL2Token `indexed` | address | The address of the new corresponding ERC1155 token in layer 2. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L1ERC721Gateway.md b/docs/apis/L1ERC721Gateway.md
deleted file mode 100644
index 17f54006..00000000
--- a/docs/apis/L1ERC721Gateway.md
+++ /dev/null
@@ -1,538 +0,0 @@
-# L1ERC721Gateway
-
-
-
-> L1ERC721Gateway
-
-The `L1ERC721Gateway` is used to deposit ERC721 compatible NFT on layer 1 and finalize withdraw the NFTs from layer 2.
-
-*The deposited NFTs are held in this gateway. On finalizing withdraw, the corresponding NFT will be transfer to the recipient directly. This will be changed if we have more specific scenarios.*
-
-## Methods
-
-### batchDepositERC721
-
-```solidity
-function batchDepositERC721(address _token, address _to, uint256[] _tokenIds, uint256 _gasLimit) external payable
-```
-
-Deposit a list of some ERC721 NFT to a recipient's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC721 NFT on layer 1. |
-| _to | address | The address of recipient on layer 2. |
-| _tokenIds | uint256[] | The list of token ids to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### batchDepositERC721
-
-```solidity
-function batchDepositERC721(address _token, uint256[] _tokenIds, uint256 _gasLimit) external payable
-```
-
-Deposit a list of some ERC721 NFT to caller's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC721 NFT on layer 1. |
-| _tokenIds | uint256[] | The list of token ids to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### depositERC721
-
-```solidity
-function depositERC721(address _token, address _to, uint256 _tokenId, uint256 _gasLimit) external payable
-```
-
-Deposit some ERC721 NFT to a recipient's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC721 NFT on layer 1. |
-| _to | address | The address of recipient on layer 2. |
-| _tokenId | uint256 | The token id to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### depositERC721
-
-```solidity
-function depositERC721(address _token, uint256 _tokenId, uint256 _gasLimit) external payable
-```
-
-Deposit some ERC721 NFT to caller's account on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of ERC721 NFT on layer 1. |
-| _tokenId | uint256 | The token id to deposit. |
-| _gasLimit | uint256 | Estimated gas limit required to complete the deposit on layer 2. |
-
-### finalizeBatchWithdrawERC721
-
-```solidity
-function finalizeBatchWithdrawERC721(address _l1Token, address _l2Token, address _from, address _to, uint256[] _tokenIds) external nonpayable
-```
-
-Complete ERC721 batch withdraw from layer 2 to layer 1 and send NFT to recipient's account on layer 1.
-
-*Requirements:  - The function should only be called by L1ScrollMessenger.  - The function should also only be called by L2ERC721Gateway on layer 2.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of corresponding layer 1 token. |
-| _l2Token | address | The address of corresponding layer 2 token. |
-| _from | address | The address of account who withdraw the token on layer 2. |
-| _to | address | The address of recipient on layer 1 to receive the token. |
-| _tokenIds | uint256[] | The list of token ids to withdraw. |
-
-### finalizeWithdrawERC721
-
-```solidity
-function finalizeWithdrawERC721(address _l1Token, address _l2Token, address _from, address _to, uint256 _tokenId) external nonpayable
-```
-
-Complete ERC721 withdraw from layer 2 to layer 1 and send NFT to recipient's account on layer 1.
-
-*Requirements:  - The function should only be called by L1ScrollMessenger.  - The function should also only be called by L2ERC721Gateway on layer 2.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of corresponding layer 1 token. |
-| _l2Token | address | The address of corresponding layer 2 token. |
-| _from | address | The address of account who withdraw the token on layer 2. |
-| _to | address | The address of recipient on layer 1 to receive the token. |
-| _tokenId | uint256 | The token id to withdraw. |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _messenger) external nonpayable
-```
-
-Initialize the storage of L1ERC721Gateway.
-
-*The parameters `_counterpart` and `_messenger` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of L2ERC721Gateway in L2. |
-| _messenger | address | The address of L1ScrollMessenger in L1. |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### onDropMessage
-
-```solidity
-function onDropMessage(bytes _message) external payable
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _message | bytes | undefined |
-
-### onERC721Received
-
-```solidity
-function onERC721Received(address, address, uint256, bytes) external nonpayable returns (bytes4)
-```
-
-
-
-*See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256 | undefined |
-| _3 | bytes | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes4 | 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### tokenMapping
-
-```solidity
-function tokenMapping(address) external view returns (address)
-```
-
-Mapping from l1 token address to l2 token address for ERC721 NFT.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-### updateTokenMapping
-
-```solidity
-function updateTokenMapping(address _l1Token, address _l2Token) external nonpayable
-```
-
-Update layer 2 to layer 2 token mapping.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of ERC721 token on layer 1. |
-| _l2Token | address | The address of corresponding ERC721 token on layer 2. |
-
-
-
-## Events
-
-### BatchDepositERC721
-
-```solidity
-event BatchDepositERC721(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256[] _tokenIds)
-```
-
-Emitted when the ERC721 NFT is batch deposited to gateway on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 1. |
-| _to  | address | The address of recipient on layer 2. |
-| _tokenIds  | uint256[] | The list of token ids of the ERC721 NFT to deposit on layer 1. |
-
-### BatchRefundERC721
-
-```solidity
-event BatchRefundERC721(address indexed token, address indexed recipient, uint256[] tokenIds)
-```
-
-Emitted when a batch of ERC721 tokens are refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of the token in L1. |
-| recipient `indexed` | address | The address of receiver in L1. |
-| tokenIds  | uint256[] | The list of token ids of the ERC721 NFT refunded. |
-
-### DepositERC721
-
-```solidity
-event DepositERC721(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _tokenId)
-```
-
-Emitted when the ERC721 NFT is deposited to gateway on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 1. |
-| _to  | address | The address of recipient on layer 2. |
-| _tokenId  | uint256 | The token id of the ERC721 NFT to deposit on layer 1. |
-
-### FinalizeBatchWithdrawERC721
-
-```solidity
-event FinalizeBatchWithdrawERC721(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256[] _tokenIds)
-```
-
-Emitted when the ERC721 NFT is batch transferred to recipient on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 2. |
-| _to  | address | The address of recipient on layer 1. |
-| _tokenIds  | uint256[] | The list of token ids of the ERC721 NFT to withdraw from layer 2. |
-
-### FinalizeWithdrawERC721
-
-```solidity
-event FinalizeWithdrawERC721(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _tokenId)
-```
-
-Emitted when the ERC721 NFT is transferred to recipient on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| _l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| _from `indexed` | address | The address of sender on layer 2. |
-| _to  | address | The address of recipient on layer 1. |
-| _tokenId  | uint256 | The token id of the ERC721 NFT to withdraw from layer 2. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### RefundERC721
-
-```solidity
-event RefundERC721(address indexed token, address indexed recipient, uint256 tokenId)
-```
-
-Emitted when some ERC721 token is refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of the token in L1. |
-| recipient `indexed` | address | The address of receiver in L1. |
-| tokenId  | uint256 | The id of token refunded. |
-
-### UpdateTokenMapping
-
-```solidity
-event UpdateTokenMapping(address indexed l1Token, address indexed oldL2Token, address indexed newL2Token)
-```
-
-Emitted when token mapping for ERC721 token is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC721 token in layer 1. |
-| oldL2Token `indexed` | address | The address of the old corresponding ERC721 token in layer 2. |
-| newL2Token `indexed` | address | The address of the new corresponding ERC721 token in layer 2. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L1GatewayRouter.md b/docs/apis/L1GatewayRouter.md
deleted file mode 100644
index a4a84f19..00000000
--- a/docs/apis/L1GatewayRouter.md
+++ /dev/null
@@ -1,620 +0,0 @@
-# L1GatewayRouter
-
-
-
-> L1GatewayRouter
-
-The `L1GatewayRouter` is the main entry for depositing Ether and ERC20 tokens. All deposited tokens are routed to corresponding gateways.
-
-*One can also use this contract to query L1/L2 token address mapping. In the future, ERC-721 and ERC-1155 tokens will be added to the router too.*
-
-## Methods
-
-### ERC20Gateway
-
-```solidity
-function ERC20Gateway(address) external view returns (address)
-```
-
-Mapping from ERC20 token address to corresponding L1ERC20Gateway.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### defaultERC20Gateway
-
-```solidity
-function defaultERC20Gateway() external view returns (address)
-```
-
-The addess of default ERC20 gateway, normally the L1StandardERC20Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### depositERC20
-
-```solidity
-function depositERC20(address _token, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a caller's account on L2.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _amount | uint256 | The amount of token to transfer. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### depositERC20
-
-```solidity
-function depositERC20(address _token, address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a recipient's account on L2.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _to | address | The address of recipient's account on L2. |
-| _amount | uint256 | The amount of token to transfer. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### depositERC20AndCall
-
-```solidity
-function depositERC20AndCall(address _token, address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a recipient's account on L2 and call.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _to | address | The address of recipient's account on L2. |
-| _amount | uint256 | The amount of token to transfer. |
-| _data | bytes | Optional data to forward to recipient's account. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### depositETH
-
-```solidity
-function depositETH(uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit ETH to caller's account in L2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### depositETH
-
-```solidity
-function depositETH(address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit ETH to some recipient's account in L2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### depositETHAndCall
-
-```solidity
-function depositETHAndCall(address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Deposit ETH to some recipient's account in L2 and call the target contract.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _data | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-
-### ethGateway
-
-```solidity
-function ethGateway() external view returns (address)
-```
-
-The address of L1ETHGateway.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### finalizeWithdrawERC20
-
-```solidity
-function finalizeWithdrawERC20(address, address, address, address, uint256, bytes) external payable
-```
-
-Complete ERC20 withdraw from L2 to L1 and send fund to recipient's account in L1.
-
-*Make this function payable to handle WETH deposit/withdraw.      The function should only be called by L1ScrollMessenger.      The function should also only be called by L2ERC20Gateway in L2.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | address | undefined |
-| _3 | address | undefined |
-| _4 | uint256 | undefined |
-| _5 | bytes | undefined |
-
-### finalizeWithdrawETH
-
-```solidity
-function finalizeWithdrawETH(address, address, uint256, bytes) external payable
-```
-
-Complete ETH withdraw from L2 to L1 and send fund to recipient's account in L1.
-
-*This function should only be called by L1ScrollMessenger.      This function should also only be called by L1ETHGateway in L2.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256 | undefined |
-| _3 | bytes | undefined |
-
-### gatewayInContext
-
-```solidity
-function gatewayInContext() external view returns (address)
-```
-
-The address of gateway in current execution context.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### getERC20Gateway
-
-```solidity
-function getERC20Gateway(address _token) external view returns (address)
-```
-
-Return the corresponding gateway address for given token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token to query. |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### getL2ERC20Address
-
-```solidity
-function getL2ERC20Address(address _l1Address) external view returns (address)
-```
-
-Return the corresponding l2 token address given l1 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Address | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _ethGateway, address _defaultERC20Gateway) external nonpayable
-```
-
-Initialize the storage of L1GatewayRouter.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _ethGateway | address | The address of L1ETHGateway contract. |
-| _defaultERC20Gateway | address | The address of default ERC20 Gateway contract. |
-
-### 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### requestERC20
-
-```solidity
-function requestERC20(address _sender, address _token, uint256 _amount) external nonpayable returns (uint256)
-```
-
-Request ERC20 token transfer from users to gateways.
-
-*All the gateways should have reentrancy guard to prevent potential attack though this function.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _sender | address | undefined |
-| _token | address | undefined |
-| _amount | uint256 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-### setDefaultERC20Gateway
-
-```solidity
-function setDefaultERC20Gateway(address _newDefaultERC20Gateway) external nonpayable
-```
-
-Update the address of default ERC20 gateway contract.
-
-*This function should only be called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _newDefaultERC20Gateway | address | undefined |
-
-### setERC20Gateway
-
-```solidity
-function setERC20Gateway(address[] _tokens, address[] _gateways) external nonpayable
-```
-
-Update the mapping from token address to gateway address.
-
-*This function should only be called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _tokens | address[] | The list of addresses of tokens to update. |
-| _gateways | address[] | The list of addresses of gateways to update. |
-
-### setETHGateway
-
-```solidity
-function setETHGateway(address _newEthGateway) external nonpayable
-```
-
-Update the address of ETH gateway contract.
-
-*This function should only be called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _newEthGateway | address | 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 |
-
-
-
-## Events
-
-### DepositERC20
-
-```solidity
-event DepositERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when someone deposit ERC20 token from L1 to L2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L1. |
-| to  | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of token will be deposited from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### DepositETH
-
-```solidity
-event DepositETH(address indexed from, address indexed to, uint256 amount, bytes data)
-```
-
-Emitted when someone deposit ETH from L1 to L2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| from `indexed` | address | The address of sender in L1. |
-| to `indexed` | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of ETH will be deposited from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### FinalizeWithdrawERC20
-
-```solidity
-event FinalizeWithdrawERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when ERC20 token is withdrawn from L2 to L1 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L2. |
-| to  | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of token withdrawn from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-### FinalizeWithdrawETH
-
-```solidity
-event FinalizeWithdrawETH(address indexed from, address indexed to, uint256 amount, bytes data)
-```
-
-Emitted when ETH is withdrawn from L2 to L1 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| from `indexed` | address | The address of sender in L2. |
-| to `indexed` | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of ETH withdrawn from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### RefundERC20
-
-```solidity
-event RefundERC20(address indexed token, address indexed recipient, uint256 amount)
-```
-
-Emitted when some ERC20 token is refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of the token in L1. |
-| recipient `indexed` | address | The address of receiver in L1. |
-| amount  | uint256 | The amount of token refunded to receiver. |
-
-### RefundETH
-
-```solidity
-event RefundETH(address indexed recipient, uint256 amount)
-```
-
-Emitted when some ETH is refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| recipient `indexed` | address | The address of receiver in L1. |
-| amount  | uint256 | The amount of ETH refunded to receiver. |
-
-### SetDefaultERC20Gateway
-
-```solidity
-event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway)
-```
-
-Emitted when the address of default ERC20 Gateway is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| oldDefaultERC20Gateway `indexed` | address | The address of the old default ERC20 Gateway. |
-| newDefaultERC20Gateway `indexed` | address | The address of the new default ERC20 Gateway. |
-
-### SetERC20Gateway
-
-```solidity
-event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway)
-```
-
-Emitted when the `gateway` for `token` is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of token updated. |
-| oldGateway `indexed` | address | The corresponding address of the old gateway. |
-| newGateway `indexed` | address | The corresponding address of the new gateway. |
-
-### SetETHGateway
-
-```solidity
-event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway)
-```
-
-Emitted when the address of ETH Gateway is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| oldETHGateway `indexed` | address | The address of the old ETH Gateway. |
-| newEthGateway `indexed` | address | The address of the new ETH Gateway. |
-
-
-
diff --git a/docs/apis/L1ScrollMessenger.md b/docs/apis/L1ScrollMessenger.md
deleted file mode 100644
index d31959b5..00000000
--- a/docs/apis/L1ScrollMessenger.md
+++ /dev/null
@@ -1,627 +0,0 @@
-# L1ScrollMessenger
-
-
-
-> L1ScrollMessenger
-
-The `L1ScrollMessenger` contract can: 1. send messages from layer 1 to layer 2; 2. relay messages from layer 2 layer 1; 3. replay failed message by replacing the gas limit; 4. drop expired message due to sequencer problems.
-
-*All deposited Ether (including `WETH` deposited throng `L1WETHGateway`) will locked in this contract.*
-
-## Methods
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of counterpart ScrollMessenger contract in L1/L2.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### dropMessage
-
-```solidity
-function dropMessage(address _from, address _to, uint256 _value, uint256 _messageNonce, bytes _message) external nonpayable
-```
-
-Drop a skipped message.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _from | address | undefined |
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _messageNonce | uint256 | undefined |
-| _message | bytes | undefined |
-
-### feeVault
-
-```solidity
-function feeVault() external view returns (address)
-```
-
-The address of fee vault, collecting cross domain messaging fee.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _feeVault, address _rollup, address _messageQueue) external nonpayable
-```
-
-Initialize the storage of L1ScrollMessenger.
-
-*The parameters `_counterpart`, `_rollup` and `_messageQueue` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of L2ScrollMessenger contract in L2. |
-| _feeVault | address | The address of fee vault, which will be used to collect relayer fee. |
-| _rollup | address | The address of ScrollChain contract. |
-| _messageQueue | address | The address of L1MessageQueue contract. |
-
-### isL1MessageDropped
-
-```solidity
-function isL1MessageDropped(bytes32) external view returns (bool)
-```
-
-Mapping from L1 message hash to drop status.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### isL2MessageExecuted
-
-```solidity
-function isL2MessageExecuted(bytes32) external view returns (bool)
-```
-
-Mapping from L2 message hash to a boolean value indicating if the message has been successfully executed.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### maxReplayTimes
-
-```solidity
-function maxReplayTimes() external view returns (uint256)
-```
-
-The maximum number of times each L1 message can be replayed.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-### messageQueue
-
-```solidity
-function messageQueue() external view returns (address)
-```
-
-The address of L1MessageQueue contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### messageSendTimestamp
-
-```solidity
-function messageSendTimestamp(bytes32) external view returns (uint256)
-```
-
-Mapping from L1 message hash to the timestamp when the message is sent.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-### owner
-
-```solidity
-function owner() external view returns (address)
-```
-
-
-
-*Returns the address of the current owner.*
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### paused
-
-```solidity
-function paused() external view returns (bool)
-```
-
-
-
-*Returns true if the contract is paused, and false otherwise.*
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### prevReplayIndex
-
-```solidity
-function prevReplayIndex(uint256) external view returns (uint256)
-```
-
-Mapping from queue index to previous replay queue index.
-
-*If a message `x` was replayed 3 times with index `q1`, `q2` and `q3`, the value of `prevReplayIndex` and `replayStates` will be `replayStates[hash(x)].lastIndex = q3`, `replayStates[hash(x)].times = 3`, `prevReplayIndex[q3] = q2`, `prevReplayIndex[q2] = q1`, `prevReplayIndex[q1] = x` and `prevReplayIndex[x]=nil`.The index `x` that `prevReplayIndex[x]=nil` is used as the termination of the list. Usually we use `0` to represent `nil`, but we cannot distinguish it with the first message with index zero. So a nonzero offset `1` is added to the value of `prevReplayIndex[x]` to avoid such situation.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-### relayMessageWithProof
-
-```solidity
-function relayMessageWithProof(address _from, address _to, uint256 _value, uint256 _nonce, bytes _message, IL1ScrollMessenger.L2MessageProof _proof) external nonpayable
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _from | address | undefined |
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _nonce | uint256 | undefined |
-| _message | bytes | undefined |
-| _proof | IL1ScrollMessenger.L2MessageProof | undefined |
-
-### renounceOwnership
-
-```solidity
-function renounceOwnership() external nonpayable
-```
-
-
-
-*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### replayMessage
-
-```solidity
-function replayMessage(address _from, address _to, uint256 _value, uint256 _messageNonce, bytes _message, uint32 _newGasLimit, address _refundAddress) external payable
-```
-
-Replay an existing message.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _from | address | undefined |
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _messageNonce | uint256 | undefined |
-| _message | bytes | undefined |
-| _newGasLimit | uint32 | undefined |
-| _refundAddress | address | undefined |
-
-### replayStates
-
-```solidity
-function replayStates(bytes32) external view returns (uint128 times, uint128 lastIndex)
-```
-
-Mapping from L1 message hash to replay state.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| times | uint128 | undefined |
-| lastIndex | uint128 | undefined |
-
-### rollup
-
-```solidity
-function rollup() external view returns (address)
-```
-
-The address of Rollup contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### sendMessage
-
-```solidity
-function sendMessage(address _to, uint256 _value, bytes _message, uint256 _gasLimit, address _refundAddress) external payable
-```
-
-Send cross chain message from L1 to L2 or L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _message | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-| _refundAddress | address | undefined |
-
-### sendMessage
-
-```solidity
-function sendMessage(address _to, uint256 _value, bytes _message, uint256 _gasLimit) external payable
-```
-
-Send cross chain message from L1 to L2 or L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _message | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-
-### setPause
-
-```solidity
-function setPause(bool _status) external nonpayable
-```
-
-Pause the contract
-
-*This function can only called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _status | bool | The pause status to update. |
-
-### 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 |
-
-### updateFeeVault
-
-```solidity
-function updateFeeVault(address _newFeeVault) external nonpayable
-```
-
-Update fee vault contract.
-
-*This function can only called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _newFeeVault | address | The address of new fee vault contract. |
-
-### updateMaxReplayTimes
-
-```solidity
-function updateMaxReplayTimes(uint256 _newMaxReplayTimes) external nonpayable
-```
-
-Update max replay times.
-
-*This function can only called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _newMaxReplayTimes | uint256 | The new max replay times. |
-
-### xDomainMessageSender
-
-```solidity
-function xDomainMessageSender() external view returns (address)
-```
-
-See {IScrollMessenger-xDomainMessageSender}
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-
-
-## Events
-
-### FailedRelayedMessage
-
-```solidity
-event FailedRelayedMessage(bytes32 indexed messageHash)
-```
-
-Emitted when a cross domain message is failed to relay.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| messageHash `indexed` | bytes32 | The hash of the message. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### Paused
-
-```solidity
-event Paused(address account)
-```
-
-
-
-*Emitted when the pause is triggered by `account`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| account  | address | undefined |
-
-### RelayedMessage
-
-```solidity
-event RelayedMessage(bytes32 indexed messageHash)
-```
-
-Emitted when a cross domain message is relayed successfully.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| messageHash `indexed` | bytes32 | The hash of the message. |
-
-### SentMessage
-
-```solidity
-event SentMessage(address indexed sender, address indexed target, uint256 value, uint256 messageNonce, uint256 gasLimit, bytes message)
-```
-
-Emitted when a cross domain message is sent.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| sender `indexed` | address | The address of the sender who initiates the message. |
-| target `indexed` | address | The address of target contract to call. |
-| value  | uint256 | The amount of value passed to the target contract. |
-| messageNonce  | uint256 | The nonce of the message. |
-| gasLimit  | uint256 | The optional gas limit passed to L1 or L2. |
-| message  | bytes | The calldata passed to the target contract. |
-
-### Unpaused
-
-```solidity
-event Unpaused(address account)
-```
-
-
-
-*Emitted when the pause is lifted by `account`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| account  | address | undefined |
-
-### UpdateFeeVault
-
-```solidity
-event UpdateFeeVault(address _oldFeeVault, address _newFeeVault)
-```
-
-Emitted when owner updates fee vault contract.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _oldFeeVault  | address | The address of old fee vault contract. |
-| _newFeeVault  | address | The address of new fee vault contract. |
-
-### UpdateMaxReplayTimes
-
-```solidity
-event UpdateMaxReplayTimes(uint256 oldMaxReplayTimes, uint256 newMaxReplayTimes)
-```
-
-Emitted when the maximum number of times each message can be replayed is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| oldMaxReplayTimes  | uint256 | The old maximum number of times each message can be replayed. |
-| newMaxReplayTimes  | uint256 | The new maximum number of times each message can be replayed. |
-
-
-
-## Errors
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L1StandardERC20Gateway.md b/docs/apis/L1StandardERC20Gateway.md
deleted file mode 100644
index 3cf8ade8..00000000
--- a/docs/apis/L1StandardERC20Gateway.md
+++ /dev/null
@@ -1,423 +0,0 @@
-# L1StandardERC20Gateway
-
-
-
-> L1StandardERC20Gateway
-
-The `L1StandardERC20Gateway` is used to deposit standard ERC20 tokens on layer 1 and finalize withdraw the tokens from layer 2.
-
-*The deposited ERC20 tokens are held in this gateway. On finalizing withdraw, the corresponding token will be transfer to the recipient directly. Any ERC20 that requires non-standard functionality should use a separate gateway.*
-
-## Methods
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### depositERC20
-
-```solidity
-function depositERC20(address _token, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a caller's account on L2.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _amount | uint256 | The amount of token to transfer. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### depositERC20
-
-```solidity
-function depositERC20(address _token, address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a recipient's account on L2.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _to | address | The address of recipient's account on L2. |
-| _amount | uint256 | The amount of token to transfer. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### depositERC20AndCall
-
-```solidity
-function depositERC20AndCall(address _token, address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a recipient's account on L2 and call.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _to | address | The address of recipient's account on L2. |
-| _amount | uint256 | The amount of token to transfer. |
-| _data | bytes | Optional data to forward to recipient's account. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### finalizeWithdrawERC20
-
-```solidity
-function finalizeWithdrawERC20(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external payable
-```
-
-Complete ERC20 withdraw from L2 to L1 and send fund to recipient's account in L1.
-
-*Make this function payable to handle WETH deposit/withdraw.      The function should only be called by L1ScrollMessenger.      The function should also only be called by L2ERC20Gateway in L2.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of corresponding L1 token. |
-| _l2Token | address | The address of corresponding L2 token. |
-| _from | address | The address of account who withdraw the token in L2. |
-| _to | address | The address of recipient in L1 to receive the token. |
-| _amount | uint256 | The amount of the token to withdraw. |
-| _data | bytes | Optional data to forward to recipient's account. |
-
-### getL2ERC20Address
-
-```solidity
-function getL2ERC20Address(address _l1Token) external view returns (address)
-```
-
-Return the corresponding l2 token address given l1 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of l1 token. |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _router, address _messenger, address, address) external nonpayable
-```
-
-Initialize the storage of L1StandardERC20Gateway.
-
-*The parameters `_counterpart`, `_router`, `_messenger`, `_l2TokenImplementation` and `_l2TokenFactory` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of L2StandardERC20Gateway in L2. |
-| _router | address | The address of L1GatewayRouter in L1. |
-| _messenger | address | The address of L1ScrollMessenger in L1. |
-| _3 | address | undefined |
-| _4 | address | undefined |
-
-### l2TokenFactory
-
-```solidity
-function l2TokenFactory() external view returns (address)
-```
-
-The address of ScrollStandardERC20Factory contract in L2.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### l2TokenImplementation
-
-```solidity
-function l2TokenImplementation() external view returns (address)
-```
-
-The address of ScrollStandardERC20 implementation in L2.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### onDropMessage
-
-```solidity
-function onDropMessage(bytes _message) external payable
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _message | bytes | 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-
-
-## Events
-
-### DepositERC20
-
-```solidity
-event DepositERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when someone deposit ERC20 token from L1 to L2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L1. |
-| to  | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of token will be deposited from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### FinalizeWithdrawERC20
-
-```solidity
-event FinalizeWithdrawERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when ERC20 token is withdrawn from L2 to L1 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L2. |
-| to  | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of token withdrawn from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### RefundERC20
-
-```solidity
-event RefundERC20(address indexed token, address indexed recipient, uint256 amount)
-```
-
-Emitted when some ERC20 token is refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of the token in L1. |
-| recipient `indexed` | address | The address of receiver in L1. |
-| amount  | uint256 | The amount of token refunded to receiver. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L1WETHGateway.md b/docs/apis/L1WETHGateway.md
deleted file mode 100644
index 141a2e9e..00000000
--- a/docs/apis/L1WETHGateway.md
+++ /dev/null
@@ -1,421 +0,0 @@
-# L1WETHGateway
-
-
-
-> L1WETHGateway
-
-The `L1WETHGateway` contract is used to deposit `WETH` token on layer 1 and finalize withdraw `WETH` from layer 2.
-
-*The deposited WETH tokens are not held in the gateway. It will first be unwrapped as Ether and then the Ether will be sent to the `L1ScrollMessenger` contract. On finalizing withdraw, the Ether will be transferred from `L1ScrollMessenger`, then wrapped as WETH and finally transfer to recipient.*
-
-## Methods
-
-### WETH
-
-```solidity
-function WETH() external view returns (address)
-```
-
-The address of L1 WETH address.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### depositERC20
-
-```solidity
-function depositERC20(address _token, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a caller's account on L2.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _amount | uint256 | The amount of token to transfer. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### depositERC20
-
-```solidity
-function depositERC20(address _token, address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a recipient's account on L2.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _to | address | The address of recipient's account on L2. |
-| _amount | uint256 | The amount of token to transfer. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### depositERC20AndCall
-
-```solidity
-function depositERC20AndCall(address _token, address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Deposit some token to a recipient's account on L2 and call.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token in L1. |
-| _to | address | The address of recipient's account on L2. |
-| _amount | uint256 | The amount of token to transfer. |
-| _data | bytes | Optional data to forward to recipient's account. |
-| _gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
-
-### finalizeWithdrawERC20
-
-```solidity
-function finalizeWithdrawERC20(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external payable
-```
-
-Complete ERC20 withdraw from L2 to L1 and send fund to recipient's account in L1.
-
-*Make this function payable to handle WETH deposit/withdraw.      The function should only be called by L1ScrollMessenger.      The function should also only be called by L2ERC20Gateway in L2.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | The address of corresponding L1 token. |
-| _l2Token | address | The address of corresponding L2 token. |
-| _from | address | The address of account who withdraw the token in L2. |
-| _to | address | The address of recipient in L1 to receive the token. |
-| _amount | uint256 | The amount of the token to withdraw. |
-| _data | bytes | Optional data to forward to recipient's account. |
-
-### getL2ERC20Address
-
-```solidity
-function getL2ERC20Address(address) external view returns (address)
-```
-
-Return the corresponding l2 token address given l1 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _router, address _messenger) external nonpayable
-```
-
-Initialize the storage of L1WETHGateway.
-
-*The parameters `_counterpart`, `_router` and `_messenger` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of L2ETHGateway in L2. |
-| _router | address | The address of L1GatewayRouter in L1. |
-| _messenger | address | The address of L1ScrollMessenger in L1. |
-
-### l2WETH
-
-```solidity
-function l2WETH() external view returns (address)
-```
-
-The address of L2 WETH address.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### onDropMessage
-
-```solidity
-function onDropMessage(bytes _message) external payable
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _message | bytes | 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-
-
-## Events
-
-### DepositERC20
-
-```solidity
-event DepositERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when someone deposit ERC20 token from L1 to L2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L1. |
-| to  | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of token will be deposited from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### FinalizeWithdrawERC20
-
-```solidity
-event FinalizeWithdrawERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when ERC20 token is withdrawn from L2 to L1 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L2. |
-| to  | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of token withdrawn from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### RefundERC20
-
-```solidity
-event RefundERC20(address indexed token, address indexed recipient, uint256 amount)
-```
-
-Emitted when some ERC20 token is refunded.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of the token in L1. |
-| recipient `indexed` | address | The address of receiver in L1. |
-| amount  | uint256 | The amount of token refunded to receiver. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L2ERC1155Gateway.md b/docs/apis/L2ERC1155Gateway.md
deleted file mode 100644
index d4565aad..00000000
--- a/docs/apis/L2ERC1155Gateway.md
+++ /dev/null
@@ -1,545 +0,0 @@
-# L2ERC1155Gateway
-
-
-
-> L2ERC1155Gateway
-
-The `L2ERC1155Gateway` is used to withdraw ERC1155 compatible NFTs on layer 2 and finalize deposit the NFTs from layer 1.
-
-*The withdrawn NFTs tokens will be burned directly. On finalizing deposit, the corresponding NFT will be minted and transferred to the recipient. This will be changed if we have more specific scenarios.*
-
-## Methods
-
-### batchWithdrawERC1155
-
-```solidity
-function batchWithdrawERC1155(address _token, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external payable
-```
-
-Batch withdraw a list of ERC1155 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _tokenIds | uint256[] | undefined |
-| _amounts | uint256[] | undefined |
-| _gasLimit | uint256 | undefined |
-
-### batchWithdrawERC1155
-
-```solidity
-function batchWithdrawERC1155(address _token, address _to, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external payable
-```
-
-Batch withdraw a list of ERC1155 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _tokenIds | uint256[] | undefined |
-| _amounts | uint256[] | undefined |
-| _gasLimit | uint256 | undefined |
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### finalizeBatchDepositERC1155
-
-```solidity
-function finalizeBatchDepositERC1155(address _l1Token, address _l2Token, address _from, address _to, uint256[] _tokenIds, uint256[] _amounts) external nonpayable
-```
-
-Complete ERC1155 deposit from layer 1 to layer 2 and send NFT to recipient's account on layer 2.
-
-*Requirements:  - The function should only be called by L2ScrollMessenger.  - The function should also only be called by L1ERC1155Gateway on layer 1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | undefined |
-| _l2Token | address | undefined |
-| _from | address | undefined |
-| _to | address | undefined |
-| _tokenIds | uint256[] | undefined |
-| _amounts | uint256[] | undefined |
-
-### finalizeDepositERC1155
-
-```solidity
-function finalizeDepositERC1155(address _l1Token, address _l2Token, address _from, address _to, uint256 _tokenId, uint256 _amount) external nonpayable
-```
-
-Complete ERC1155 deposit from layer 1 to layer 2 and send NFT to recipient's account on layer 2.
-
-*Requirements:  - The function should only be called by L2ScrollMessenger.  - The function should also only be called by L1ERC1155Gateway on layer 1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | undefined |
-| _l2Token | address | undefined |
-| _from | address | undefined |
-| _to | address | undefined |
-| _tokenId | uint256 | undefined |
-| _amount | uint256 | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _messenger) external nonpayable
-```
-
-Initialize the storage of `L2ERC1155Gateway`.
-
-*The parameters `_counterpart` and `_messenger` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of `L1ERC1155Gateway` contract in L1. |
-| _messenger | address | The address of `L2ScrollMessenger` contract in L2. |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### onERC1155BatchReceived
-
-```solidity
-function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256[] | undefined |
-| _3 | uint256[] | undefined |
-| _4 | bytes | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes4 | undefined |
-
-### onERC1155Received
-
-```solidity
-function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256 | undefined |
-| _3 | uint256 | undefined |
-| _4 | bytes | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes4 | 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### supportsInterface
-
-```solidity
-function supportsInterface(bytes4 interfaceId) external view returns (bool)
-```
-
-
-
-*See {IERC165-supportsInterface}.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| interfaceId | bytes4 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### tokenMapping
-
-```solidity
-function tokenMapping(address) external view returns (address)
-```
-
-Mapping from layer 2 token address to layer 1 token address for ERC1155 NFT.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-### updateTokenMapping
-
-```solidity
-function updateTokenMapping(address _l2Token, address _l1Token) external nonpayable
-```
-
-Update layer 2 to layer 1 token mapping.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l2Token | address | The address of corresponding ERC1155 token on layer 2. |
-| _l1Token | address | The address of ERC1155 token on layer 1. |
-
-### withdrawERC1155
-
-```solidity
-function withdrawERC1155(address _token, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw some ERC1155 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _tokenId | uint256 | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC1155
-
-```solidity
-function withdrawERC1155(address _token, address _to, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw some ERC1155 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _tokenId | uint256 | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-
-
-## Events
-
-### BatchWithdrawERC1155
-
-```solidity
-event BatchWithdrawERC1155(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256[] tokenIds, uint256[] amounts)
-```
-
-Emitted when the ERC1155 NFT is batch transferred to gateway on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 2. |
-| to  | address | The address of recipient on layer 1. |
-| tokenIds  | uint256[] | The list of token ids of the ERC1155 NFT to withdraw on layer 2. |
-| amounts  | uint256[] | The list of corresponding amounts to withdraw. |
-
-### FinalizeBatchDepositERC1155
-
-```solidity
-event FinalizeBatchDepositERC1155(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256[] tokenIds, uint256[] amounts)
-```
-
-Emitted when the ERC1155 NFT is batch transferred to recipient on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 1. |
-| to  | address | The address of recipient on layer 2. |
-| tokenIds  | uint256[] | The list of token ids of the ERC1155 NFT deposited on layer 1. |
-| amounts  | uint256[] | The list of corresponding amounts deposited. |
-
-### FinalizeDepositERC1155
-
-```solidity
-event FinalizeDepositERC1155(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 tokenId, uint256 amount)
-```
-
-Emitted when the ERC1155 NFT is transferred to recipient on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 1. |
-| to  | address | The address of recipient on layer 2. |
-| tokenId  | uint256 | The token id of the ERC1155 NFT deposited on layer 1. |
-| amount  | uint256 | The amount of token deposited. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### UpdateTokenMapping
-
-```solidity
-event UpdateTokenMapping(address indexed l2Token, address indexed oldL1Token, address indexed newL1Token)
-```
-
-Emitted when token mapping for ERC1155 token is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l2Token `indexed` | address | The address of corresponding ERC1155 token in layer 2. |
-| oldL1Token `indexed` | address | The address of the old corresponding ERC1155 token in layer 1. |
-| newL1Token `indexed` | address | The address of the new corresponding ERC1155 token in layer 1. |
-
-### WithdrawERC1155
-
-```solidity
-event WithdrawERC1155(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 tokenId, uint256 amount)
-```
-
-Emitted when the ERC1155 NFT is transferred to gateway on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC1155 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC1155 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 2. |
-| to  | address | The address of recipient on layer 1. |
-| tokenId  | uint256 | The token id of the ERC1155 NFT to withdraw on layer 2. |
-| amount  | uint256 | The amount of token to withdraw. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L2ERC721Gateway.md b/docs/apis/L2ERC721Gateway.md
deleted file mode 100644
index d615a16a..00000000
--- a/docs/apis/L2ERC721Gateway.md
+++ /dev/null
@@ -1,486 +0,0 @@
-# L2ERC721Gateway
-
-
-
-> L2ERC721Gateway
-
-The `L2ERC721Gateway` is used to withdraw ERC721 compatible NFTs on layer 2 and finalize deposit the NFTs from layer 1.
-
-*The withdrawn NFTs tokens will be burned directly. On finalizing deposit, the corresponding NFT will be minted and transferred to the recipient. This will be changed if we have more specific scenarios.*
-
-## Methods
-
-### batchWithdrawERC721
-
-```solidity
-function batchWithdrawERC721(address _token, uint256[] _tokenIds, uint256 _gasLimit) external payable
-```
-
-Batch withdraw a list of ERC721 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _tokenIds | uint256[] | undefined |
-| _gasLimit | uint256 | undefined |
-
-### batchWithdrawERC721
-
-```solidity
-function batchWithdrawERC721(address _token, address _to, uint256[] _tokenIds, uint256 _gasLimit) external payable
-```
-
-Batch withdraw a list of ERC721 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _tokenIds | uint256[] | undefined |
-| _gasLimit | uint256 | undefined |
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### finalizeBatchDepositERC721
-
-```solidity
-function finalizeBatchDepositERC721(address _l1Token, address _l2Token, address _from, address _to, uint256[] _tokenIds) external nonpayable
-```
-
-Complete ERC721 deposit from layer 1 to layer 2 and send NFT to recipient's account on layer 2.
-
-*Requirements:  - The function should only be called by L2ScrollMessenger.  - The function should also only be called by L1ERC721Gateway on layer 1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | undefined |
-| _l2Token | address | undefined |
-| _from | address | undefined |
-| _to | address | undefined |
-| _tokenIds | uint256[] | undefined |
-
-### finalizeDepositERC721
-
-```solidity
-function finalizeDepositERC721(address _l1Token, address _l2Token, address _from, address _to, uint256 _tokenId) external nonpayable
-```
-
-Complete ERC721 deposit from layer 1 to layer 2 and send NFT to recipient's account on layer 2.
-
-*Requirements:  - The function should only be called by L2ScrollMessenger.  - The function should also only be called by L1ERC721Gateway on layer 1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | undefined |
-| _l2Token | address | undefined |
-| _from | address | undefined |
-| _to | address | undefined |
-| _tokenId | uint256 | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _messenger) external nonpayable
-```
-
-Initialize the storage of `L2ERC721Gateway`.
-
-*The parameters `_counterpart` and `_messenger` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of `L1ERC721Gateway` contract in L1. |
-| _messenger | address | The address of `L2ScrollMessenger` contract in L2. |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### onERC721Received
-
-```solidity
-function onERC721Received(address, address, uint256, bytes) external nonpayable returns (bytes4)
-```
-
-
-
-*See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256 | undefined |
-| _3 | bytes | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes4 | 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### tokenMapping
-
-```solidity
-function tokenMapping(address) external view returns (address)
-```
-
-Mapping from layer 2 token address to layer 1 token address for ERC721 NFT.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-### updateTokenMapping
-
-```solidity
-function updateTokenMapping(address _l2Token, address _l1Token) external nonpayable
-```
-
-Update layer 2 to layer 1 token mapping.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l2Token | address | The address of corresponding ERC721 token on layer 2. |
-| _l1Token | address | The address of ERC721 token on layer 1. |
-
-### withdrawERC721
-
-```solidity
-function withdrawERC721(address _token, uint256 _tokenId, uint256 _gasLimit) external payable
-```
-
-Withdraw some ERC721 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _tokenId | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC721
-
-```solidity
-function withdrawERC721(address _token, address _to, uint256 _tokenId, uint256 _gasLimit) external payable
-```
-
-Withdraw some ERC721 NFT to caller's account on layer 1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _tokenId | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-
-
-## Events
-
-### BatchWithdrawERC721
-
-```solidity
-event BatchWithdrawERC721(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256[] tokenIds)
-```
-
-Emitted when the ERC721 NFT is batch transferred to gateway on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 2. |
-| to  | address | The address of recipient on layer 1. |
-| tokenIds  | uint256[] | The list of token ids of the ERC721 NFT to withdraw on layer 2. |
-
-### FinalizeBatchDepositERC721
-
-```solidity
-event FinalizeBatchDepositERC721(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256[] tokenIds)
-```
-
-Emitted when the ERC721 NFT is batch transferred to recipient on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 1. |
-| to  | address | The address of recipient on layer 2. |
-| tokenIds  | uint256[] | The list of token ids of the ERC721 NFT deposited on layer 1. |
-
-### FinalizeDepositERC721
-
-```solidity
-event FinalizeDepositERC721(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 tokenId)
-```
-
-Emitted when the ERC721 NFT is transferred to recipient on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 1. |
-| to  | address | The address of recipient on layer 2. |
-| tokenId  | uint256 | The token id of the ERC721 NFT deposited on layer 1. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### UpdateTokenMapping
-
-```solidity
-event UpdateTokenMapping(address indexed l2Token, address indexed oldL1Token, address indexed newL1Token)
-```
-
-Emitted when token mapping for ERC721 token is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l2Token `indexed` | address | The address of corresponding ERC721 token in layer 2. |
-| oldL1Token `indexed` | address | The address of the old corresponding ERC721 token in layer 1. |
-| newL1Token `indexed` | address | The address of the new corresponding ERC721 token in layer 1. |
-
-### WithdrawERC721
-
-```solidity
-event WithdrawERC721(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 tokenId)
-```
-
-Emitted when the ERC721 NFT is transferred to gateway on layer 2.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of ERC721 NFT on layer 1. |
-| l2Token `indexed` | address | The address of ERC721 NFT on layer 2. |
-| from `indexed` | address | The address of sender on layer 2. |
-| to  | address | The address of recipient on layer 1. |
-| tokenId  | uint256 | The token id of the ERC721 NFT to withdraw on layer 2. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L2GatewayRouter.md b/docs/apis/L2GatewayRouter.md
deleted file mode 100644
index 7b6d5515..00000000
--- a/docs/apis/L2GatewayRouter.md
+++ /dev/null
@@ -1,566 +0,0 @@
-# L2GatewayRouter
-
-
-
-> L2GatewayRouter
-
-The `L2GatewayRouter` is the main entry for withdrawing Ether and ERC20 tokens. All deposited tokens are routed to corresponding gateways.
-
-*One can also use this contract to query L1/L2 token address mapping. In the future, ERC-721 and ERC-1155 tokens will be added to the router too.*
-
-## Methods
-
-### ERC20Gateway
-
-```solidity
-function ERC20Gateway(address) external view returns (address)
-```
-
-Mapping from L2 ERC20 token address to corresponding L2ERC20Gateway.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### defaultERC20Gateway
-
-```solidity
-function defaultERC20Gateway() external view returns (address)
-```
-
-The addess of default L2 ERC20 gateway, normally the L2StandardERC20Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### ethGateway
-
-```solidity
-function ethGateway() external view returns (address)
-```
-
-The address of L2ETHGateway.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### finalizeDepositERC20
-
-```solidity
-function finalizeDepositERC20(address, address, address, address, uint256, bytes) external payable
-```
-
-Complete a deposit from L1 to L2 and send fund to recipient's account in L2.
-
-*Make this function payable to handle WETH deposit/withdraw.      The function should only be called by L2ScrollMessenger.      The function should also only be called by L1ERC20Gateway in L1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | address | undefined |
-| _3 | address | undefined |
-| _4 | uint256 | undefined |
-| _5 | bytes | undefined |
-
-### finalizeDepositETH
-
-```solidity
-function finalizeDepositETH(address, address, uint256, bytes) external payable
-```
-
-Complete ETH deposit from L1 to L2 and send fund to recipient's account in L2.
-
-*This function should only be called by L2ScrollMessenger.      This function should also only be called by L1GatewayRouter in L1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-| _1 | address | undefined |
-| _2 | uint256 | undefined |
-| _3 | bytes | undefined |
-
-### getERC20Gateway
-
-```solidity
-function getERC20Gateway(address _token) external view returns (address)
-```
-
-Return the corresponding gateway address for given token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | The address of token to query. |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### getL1ERC20Address
-
-```solidity
-function getL1ERC20Address(address _l2Address) external view returns (address)
-```
-
-Return the corresponding l1 token address given l2 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l2Address | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### getL2ERC20Address
-
-```solidity
-function getL2ERC20Address(address) external pure returns (address)
-```
-
-Return the corresponding l2 token address given l1 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _ethGateway, address _defaultERC20Gateway) external nonpayable
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _ethGateway | address | undefined |
-| _defaultERC20Gateway | 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### setDefaultERC20Gateway
-
-```solidity
-function setDefaultERC20Gateway(address _newDefaultERC20Gateway) external nonpayable
-```
-
-Update the address of default ERC20 gateway contract.
-
-*This function should only be called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _newDefaultERC20Gateway | address | The address to update. |
-
-### setERC20Gateway
-
-```solidity
-function setERC20Gateway(address[] _tokens, address[] _gateways) external nonpayable
-```
-
-Update the mapping from token address to gateway address.
-
-*This function should only be called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _tokens | address[] | The list of addresses of tokens to update. |
-| _gateways | address[] | The list of addresses of gateways to update. |
-
-### setETHGateway
-
-```solidity
-function setETHGateway(address _newEthGateway) external nonpayable
-```
-
-Update the address of ETH gateway contract.
-
-*This function should only be called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _newEthGateway | address | The address to update. |
-
-### 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 |
-
-### withdrawERC20
-
-```solidity
-function withdrawERC20(address _token, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a caller's account on L1.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC20
-
-```solidity
-function withdrawERC20(address _token, address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a recipient's account on L1.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC20AndCall
-
-```solidity
-function withdrawERC20AndCall(address _token, address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a recipient's account on L1 and call.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _data | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawETH
-
-```solidity
-function withdrawETH(address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw ETH to caller's account in L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawETH
-
-```solidity
-function withdrawETH(uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw ETH to caller's account in L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawETHAndCall
-
-```solidity
-function withdrawETHAndCall(address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Withdraw ETH to caller's account in L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _data | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-
-
-
-## Events
-
-### FinalizeDepositERC20
-
-```solidity
-event FinalizeDepositERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when ERC20 token is deposited from L1 to L2 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L1. |
-| to  | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of token withdrawn from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### FinalizeDepositETH
-
-```solidity
-event FinalizeDepositETH(address indexed from, address indexed to, uint256 amount, bytes data)
-```
-
-Emitted when ETH is deposited from L1 to L2 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| from `indexed` | address | The address of sender in L1. |
-| to `indexed` | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of ETH deposited from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### SetDefaultERC20Gateway
-
-```solidity
-event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway)
-```
-
-Emitted when the address of default ERC20 Gateway is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| oldDefaultERC20Gateway `indexed` | address | The address of the old default ERC20 Gateway. |
-| newDefaultERC20Gateway `indexed` | address | The address of the new default ERC20 Gateway. |
-
-### SetERC20Gateway
-
-```solidity
-event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway)
-```
-
-Emitted when the `gateway` for `token` is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| token `indexed` | address | The address of token updated. |
-| oldGateway `indexed` | address | The corresponding address of the old gateway. |
-| newGateway `indexed` | address | The corresponding address of the new gateway. |
-
-### SetETHGateway
-
-```solidity
-event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway)
-```
-
-Emitted when the address of ETH Gateway is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| oldETHGateway `indexed` | address | The address of the old ETH Gateway. |
-| newEthGateway `indexed` | address | The address of the new ETH Gateway. |
-
-### WithdrawERC20
-
-```solidity
-event WithdrawERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when someone withdraw ERC20 token from L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L2. |
-| to  | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of token will be deposited from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-### WithdrawETH
-
-```solidity
-event WithdrawETH(address indexed from, address indexed to, uint256 amount, bytes data)
-```
-
-Emitted when someone withdraw ETH from L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| from `indexed` | address | The address of sender in L2. |
-| to `indexed` | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of ETH will be deposited from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-
-
diff --git a/docs/apis/L2ScrollMessenger.md b/docs/apis/L2ScrollMessenger.md
deleted file mode 100644
index 170bb4a8..00000000
--- a/docs/apis/L2ScrollMessenger.md
+++ /dev/null
@@ -1,464 +0,0 @@
-# L2ScrollMessenger
-
-
-
-> L2ScrollMessenger
-
-The `L2ScrollMessenger` contract can: 1. send messages from layer 2 to layer 1; 2. relay messages from layer 1 layer 2; 3. drop expired message due to sequencer problems.
-
-*It should be a predeployed contract on layer 2 and should hold infinite amount of Ether (Specifically, `uint256(-1)`), which can be initialized in Genesis Block.*
-
-## Methods
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of counterpart ScrollMessenger contract in L1/L2.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### feeVault
-
-```solidity
-function feeVault() external view returns (address)
-```
-
-The address of fee vault, collecting cross domain messaging fee.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address) external nonpayable
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### isL1MessageExecuted
-
-```solidity
-function isL1MessageExecuted(bytes32) external view returns (bool)
-```
-
-Mapping from L1 message hash to a boolean value indicating if the message has been successfully executed.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### messageQueue
-
-```solidity
-function messageQueue() external view returns (address)
-```
-
-The address of L2MessageQueue.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### messageSendTimestamp
-
-```solidity
-function messageSendTimestamp(bytes32) external view returns (uint256)
-```
-
-Mapping from L2 message hash to the timestamp when the message is sent.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-### owner
-
-```solidity
-function owner() external view returns (address)
-```
-
-
-
-*Returns the address of the current owner.*
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### paused
-
-```solidity
-function paused() external view returns (bool)
-```
-
-
-
-*Returns true if the contract is paused, and false otherwise.*
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### relayMessage
-
-```solidity
-function relayMessage(address _from, address _to, uint256 _value, uint256 _nonce, bytes _message) external nonpayable
-```
-
-execute L1 => L2 message
-
-*Make sure this is only called by privileged accounts.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _from | address | undefined |
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _nonce | uint256 | undefined |
-| _message | bytes | undefined |
-
-### renounceOwnership
-
-```solidity
-function renounceOwnership() external nonpayable
-```
-
-
-
-*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### sendMessage
-
-```solidity
-function sendMessage(address _to, uint256 _value, bytes _message, uint256 _gasLimit, address) external payable
-```
-
-Send cross chain message from L1 to L2 or L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _message | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-| _4 | address | undefined |
-
-### sendMessage
-
-```solidity
-function sendMessage(address _to, uint256 _value, bytes _message, uint256 _gasLimit) external payable
-```
-
-Send cross chain message from L1 to L2 or L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _to | address | undefined |
-| _value | uint256 | undefined |
-| _message | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-
-### setPause
-
-```solidity
-function setPause(bool _status) external nonpayable
-```
-
-Pause the contract
-
-*This function can only called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _status | bool | The pause status to update. |
-
-### 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 |
-
-### updateFeeVault
-
-```solidity
-function updateFeeVault(address _newFeeVault) external nonpayable
-```
-
-Update fee vault contract.
-
-*This function can only called by contract owner.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _newFeeVault | address | The address of new fee vault contract. |
-
-### xDomainMessageSender
-
-```solidity
-function xDomainMessageSender() external view returns (address)
-```
-
-See {IScrollMessenger-xDomainMessageSender}
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-
-
-## Events
-
-### FailedRelayedMessage
-
-```solidity
-event FailedRelayedMessage(bytes32 indexed messageHash)
-```
-
-Emitted when a cross domain message is failed to relay.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| messageHash `indexed` | bytes32 | The hash of the message. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### Paused
-
-```solidity
-event Paused(address account)
-```
-
-
-
-*Emitted when the pause is triggered by `account`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| account  | address | undefined |
-
-### RelayedMessage
-
-```solidity
-event RelayedMessage(bytes32 indexed messageHash)
-```
-
-Emitted when a cross domain message is relayed successfully.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| messageHash `indexed` | bytes32 | The hash of the message. |
-
-### SentMessage
-
-```solidity
-event SentMessage(address indexed sender, address indexed target, uint256 value, uint256 messageNonce, uint256 gasLimit, bytes message)
-```
-
-Emitted when a cross domain message is sent.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| sender `indexed` | address | The address of the sender who initiates the message. |
-| target `indexed` | address | The address of target contract to call. |
-| value  | uint256 | The amount of value passed to the target contract. |
-| messageNonce  | uint256 | The nonce of the message. |
-| gasLimit  | uint256 | The optional gas limit passed to L1 or L2. |
-| message  | bytes | The calldata passed to the target contract. |
-
-### Unpaused
-
-```solidity
-event Unpaused(address account)
-```
-
-
-
-*Emitted when the pause is lifted by `account`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| account  | address | undefined |
-
-### UpdateFeeVault
-
-```solidity
-event UpdateFeeVault(address _oldFeeVault, address _newFeeVault)
-```
-
-Emitted when owner updates fee vault contract.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _oldFeeVault  | address | The address of old fee vault contract. |
-| _newFeeVault  | address | The address of new fee vault contract. |
-
-### UpdateMaxFailedExecutionTimes
-
-```solidity
-event UpdateMaxFailedExecutionTimes(uint256 oldMaxFailedExecutionTimes, uint256 newMaxFailedExecutionTimes)
-```
-
-Emitted when the maximum number of times each message can fail in L2 is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| oldMaxFailedExecutionTimes  | uint256 | The old maximum number of times each message can fail in L2. |
-| newMaxFailedExecutionTimes  | uint256 | The new maximum number of times each message can fail in L2. |
-
-
-
-## Errors
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L2StandardERC20Gateway.md b/docs/apis/L2StandardERC20Gateway.md
deleted file mode 100644
index 05dd24aa..00000000
--- a/docs/apis/L2StandardERC20Gateway.md
+++ /dev/null
@@ -1,393 +0,0 @@
-# L2StandardERC20Gateway
-
-
-
-> L2StandardERC20Gateway
-
-The `L2StandardERC20Gateway` is used to withdraw standard ERC20 tokens on layer 2 and finalize deposit the tokens from layer 1.
-
-*The withdrawn ERC20 tokens will be burned directly. On finalizing deposit, the corresponding token will be minted and transferred to the recipient. Any ERC20 that requires non-standard functionality should use a separate gateway.*
-
-## Methods
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### finalizeDepositERC20
-
-```solidity
-function finalizeDepositERC20(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external payable
-```
-
-Complete a deposit from L1 to L2 and send fund to recipient's account in L2.
-
-*Make this function payable to handle WETH deposit/withdraw.      The function should only be called by L2ScrollMessenger.      The function should also only be called by L1ERC20Gateway in L1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | undefined |
-| _l2Token | address | undefined |
-| _from | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _data | bytes | undefined |
-
-### getL1ERC20Address
-
-```solidity
-function getL1ERC20Address(address _l2Token) external view returns (address)
-```
-
-Return the corresponding l1 token address given l2 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l2Token | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### getL2ERC20Address
-
-```solidity
-function getL2ERC20Address(address _l1Token) external view returns (address)
-```
-
-Return the corresponding l2 token address given l1 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _router, address _messenger, address) external nonpayable
-```
-
-Initialize the storage of L2StandardERC20Gateway.
-
-*The parameters `_counterpart`, `_router`, `_messenger` and `_tokenFactory` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of `L1StandardERC20Gateway` contract in L1. |
-| _router | address | The address of `L2GatewayRouter` contract in L2. |
-| _messenger | address | The address of `L2ScrollMessenger` contract in L2. |
-| _3 | address | undefined |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### tokenFactory
-
-```solidity
-function tokenFactory() external view returns (address)
-```
-
-The address of ScrollStandardERC20Factory.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-### withdrawERC20
-
-```solidity
-function withdrawERC20(address _token, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a caller's account on L1.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC20
-
-```solidity
-function withdrawERC20(address _token, address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a recipient's account on L1.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC20AndCall
-
-```solidity
-function withdrawERC20AndCall(address _token, address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a recipient's account on L1 and call.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _data | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-
-
-
-## Events
-
-### FinalizeDepositERC20
-
-```solidity
-event FinalizeDepositERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when ERC20 token is deposited from L1 to L2 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L1. |
-| to  | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of token withdrawn from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### WithdrawERC20
-
-```solidity
-event WithdrawERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when someone withdraw ERC20 token from L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L2. |
-| to  | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of token will be deposited from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/L2WETHGateway.md b/docs/apis/L2WETHGateway.md
deleted file mode 100644
index 129addae..00000000
--- a/docs/apis/L2WETHGateway.md
+++ /dev/null
@@ -1,409 +0,0 @@
-# L2WETHGateway
-
-
-
-> L2WETHGateway
-
-The `L2WETHGateway` contract is used to withdraw `WETH` token on layer 2 and finalize deposit `WETH` from layer 1.
-
-*The WETH tokens are not held in the gateway. It will first be unwrapped as Ether and then the Ether will be sent to the `L2ScrollMessenger` contract. On finalizing deposit, the Ether will be transferred from `L2ScrollMessenger`, then wrapped as WETH and finally transfer to recipient.*
-
-## Methods
-
-### WETH
-
-```solidity
-function WETH() external view returns (address)
-```
-
-The address of L2 WETH address.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### counterpart
-
-```solidity
-function counterpart() external view returns (address)
-```
-
-The address of corresponding L1/L2 Gateway contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### finalizeDepositERC20
-
-```solidity
-function finalizeDepositERC20(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external payable
-```
-
-Complete a deposit from L1 to L2 and send fund to recipient's account in L2.
-
-*Make this function payable to handle WETH deposit/withdraw.      The function should only be called by L2ScrollMessenger.      The function should also only be called by L1ERC20Gateway in L1.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token | address | undefined |
-| _l2Token | address | undefined |
-| _from | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _data | bytes | undefined |
-
-### getL1ERC20Address
-
-```solidity
-function getL1ERC20Address(address) external view returns (address)
-```
-
-Return the corresponding l1 token address given l2 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### getL2ERC20Address
-
-```solidity
-function getL2ERC20Address(address) external view returns (address)
-```
-
-Return the corresponding l2 token address given l1 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### initialize
-
-```solidity
-function initialize(address _counterpart, address _router, address _messenger) external nonpayable
-```
-
-Initialize the storage of `L2WETHGateway`.
-
-*The parameters `_counterpart`, `_router` and `_messenger` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _counterpart | address | The address of `L1WETHGateway` contract in L1. |
-| _router | address | The address of `L2GatewayRouter` contract in L2. |
-| _messenger | address | The address of `L2ScrollMessenger` contract in L2. |
-
-### l1WETH
-
-```solidity
-function l1WETH() external view returns (address)
-```
-
-The address of L1 WETH address.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### messenger
-
-```solidity
-function messenger() external view returns (address)
-```
-
-The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
-
-
-
-
-#### 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### router
-
-```solidity
-function router() external view returns (address)
-```
-
-The address of L1GatewayRouter/L2GatewayRouter contract.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | 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 |
-
-### withdrawERC20
-
-```solidity
-function withdrawERC20(address _token, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a caller's account on L1.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC20
-
-```solidity
-function withdrawERC20(address _token, address _to, uint256 _amount, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a recipient's account on L1.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _gasLimit | uint256 | undefined |
-
-### withdrawERC20AndCall
-
-```solidity
-function withdrawERC20AndCall(address _token, address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
-```
-
-Withdraw of some token to a recipient's account on L1 and call.
-
-*Make this function payable to send relayer fee in Ether.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _token | address | undefined |
-| _to | address | undefined |
-| _amount | uint256 | undefined |
-| _data | bytes | undefined |
-| _gasLimit | uint256 | undefined |
-
-
-
-## Events
-
-### FinalizeDepositERC20
-
-```solidity
-event FinalizeDepositERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when ERC20 token is deposited from L1 to L2 and transfer to recipient.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L1. |
-| to  | address | The address of recipient in L2. |
-| amount  | uint256 | The amount of token withdrawn from L1 to L2. |
-| data  | bytes | The optional calldata passed to recipient in L2. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### WithdrawERC20
-
-```solidity
-event WithdrawERC20(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes data)
-```
-
-Emitted when someone withdraw ERC20 token from L2 to L1.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| l1Token `indexed` | address | The address of the token in L1. |
-| l2Token `indexed` | address | The address of the token in L2. |
-| from `indexed` | address | The address of sender in L2. |
-| to  | address | The address of recipient in L1. |
-| amount  | uint256 | The amount of token will be deposited from L2 to L1. |
-| data  | bytes | The optional calldata passed to recipient in L1. |
-
-
-
-## Errors
-
-### ErrorCallerIsNotCounterpartGateway
-
-```solidity
-error ErrorCallerIsNotCounterpartGateway()
-```
-
-
-
-*Thrown when the cross chain sender is not the counterpart gateway contract.*
-
-
-### ErrorCallerIsNotMessenger
-
-```solidity
-error ErrorCallerIsNotMessenger()
-```
-
-
-
-*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
-
-
-### ErrorNotInDropMessageContext
-
-```solidity
-error ErrorNotInDropMessageContext()
-```
-
-
-
-*Thrown when ScrollMessenger is not dropping message.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/ScrollChain.md b/docs/apis/ScrollChain.md
deleted file mode 100644
index fd0444b4..00000000
--- a/docs/apis/ScrollChain.md
+++ /dev/null
@@ -1,1017 +0,0 @@
-# ScrollChain
-
-
-
-> ScrollChain
-
-This contract maintains data for the Scroll rollup.
-
-
-
-## Methods
-
-### addProver
-
-```solidity
-function addProver(address _account) external nonpayable
-```
-
-Add an account to the prover list.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _account | address | The address of account to add. |
-
-### addSequencer
-
-```solidity
-function addSequencer(address _account) external nonpayable
-```
-
-Add an account to the sequencer list.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _account | address | The address of account to add. |
-
-### 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)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | The batch hash of a committed batch. |
-
-### finalizeBatchWithProof
-
-```solidity
-function finalizeBatchWithProof(bytes _batchHeader, bytes32 _prevStateRoot, bytes32 _postStateRoot, bytes32 _withdrawRoot, bytes _aggrProof) external nonpayable
-```
-
-Finalize a committed batch on layer 1.
-
-*We keep this function to upgrade to 4844 more smoothly.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _batchHeader | bytes | undefined |
-| _prevStateRoot | bytes32 | undefined |
-| _postStateRoot | bytes32 | undefined |
-| _withdrawRoot | bytes32 | undefined |
-| _aggrProof | bytes | undefined |
-
-### finalizeBatchWithProof4844
-
-```solidity
-function finalizeBatchWithProof4844(bytes _batchHeader, bytes32 _prevStateRoot, bytes32 _postStateRoot, bytes32 _withdrawRoot, bytes _blobDataProof, bytes _aggrProof) external nonpayable
-```
-
-Finalize a committed batch (with blob) on layer 1.
-
-*Memory layout of `_blobDataProof`: ```text | z       | y       | kzg_commitment | kzg_proof | |---------|---------|----------------|-----------| | bytes32 | bytes32 | bytes48        | bytes48   | ```*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _batchHeader | bytes | undefined |
-| _prevStateRoot | bytes32 | undefined |
-| _postStateRoot | bytes32 | undefined |
-| _withdrawRoot | bytes32 | undefined |
-| _blobDataProof | bytes | undefined |
-| _aggrProof | bytes | undefined |
-
-### finalizedStateRoots
-
-```solidity
-function finalizedStateRoots(uint256) external view returns (bytes32)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | The state root of a committed batch. |
-
-### importGenesisBatch
-
-```solidity
-function importGenesisBatch(bytes _batchHeader, bytes32 _stateRoot) external nonpayable
-```
-
-Import layer 2 genesis block
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _batchHeader | bytes | The header of the genesis batch. |
-| _stateRoot | bytes32 | The state root of the genesis block. |
-
-### initialize
-
-```solidity
-function initialize(address _messageQueue, address _verifier, uint256 _maxNumTxInChunk) external nonpayable
-```
-
-Initialize the storage of ScrollChain.
-
-*The parameters `_messageQueue` are no longer used.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _messageQueue | address | The address of `L1MessageQueue` contract. |
-| _verifier | address | The address of zkevm verifier contract. |
-| _maxNumTxInChunk | uint256 | The maximum number of transactions allowed in each chunk. |
-
-### isBatchFinalized
-
-```solidity
-function isBatchFinalized(uint256 _batchIndex) external view returns (bool)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _batchIndex | uint256 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | Whether the batch is finalized by batch index. |
-
-### 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)
-```
-
-
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | The latest finalized batch index. |
-
-### layer2ChainId
-
-```solidity
-function layer2ChainId() external view returns (uint64)
-```
-
-The chain id of the corresponding layer 2 chain.
-
-
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint64 | undefined |
-
-### maxNumTxInChunk
-
-```solidity
-function maxNumTxInChunk() 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 contract.
-
-
-
-
-#### 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 |
-
-### paused
-
-```solidity
-function paused() external view returns (bool)
-```
-
-
-
-*Returns true if the contract is paused, and false otherwise.*
-
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bool | undefined |
-
-### removeProver
-
-```solidity
-function removeProver(address _account) external nonpayable
-```
-
-Add an account from the prover list.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _account | address | The address of account to remove. |
-
-### removeSequencer
-
-```solidity
-function removeSequencer(address _account) external nonpayable
-```
-
-Remove an account from the sequencer list.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _account | address | The address of account to remove. |
-
-### renounceOwnership
-
-```solidity
-function renounceOwnership() external nonpayable
-```
-
-
-
-*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### revertBatch
-
-```solidity
-function revertBatch(bytes _batchHeader, uint256 _count) external nonpayable
-```
-
-Revert a pending batch.
-
-*If the owner want to revert a sequence of batches by sending multiple transactions,      make sure to revert recent batches first.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _batchHeader | bytes | undefined |
-| _count | uint256 | undefined |
-
-### setPause
-
-```solidity
-function setPause(bool _status) external nonpayable
-```
-
-Pause the contract
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _status | bool | The pause status to update. |
-
-### 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 |
-
-### updateMaxNumTxInChunk
-
-```solidity
-function updateMaxNumTxInChunk(uint256 _maxNumTxInChunk) external nonpayable
-```
-
-Update the value of `maxNumTxInChunk`.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _maxNumTxInChunk | uint256 | The new value of `maxNumTxInChunk`. |
-
-### 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)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | uint256 | undefined |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | bytes32 | The message root of a committed batch. |
-
-
-
-## Events
-
-### CommitBatch
-
-```solidity
-event CommitBatch(uint256 indexed batchIndex, bytes32 indexed batchHash)
-```
-
-Emitted when a new batch is committed.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| batchIndex `indexed` | uint256 | The index of the batch. |
-| batchHash `indexed` | bytes32 | The hash of the batch. |
-
-### FinalizeBatch
-
-```solidity
-event FinalizeBatch(uint256 indexed batchIndex, bytes32 indexed batchHash, bytes32 stateRoot, bytes32 withdrawRoot)
-```
-
-Emitted when a batch is finalized.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| batchIndex `indexed` | uint256 | The index of the batch. |
-| batchHash `indexed` | bytes32 | The hash of the batch |
-| stateRoot  | bytes32 | The state root on layer 2 after this batch. |
-| withdrawRoot  | bytes32 | The merkle root on layer2 after this batch. |
-
-### Initialized
-
-```solidity
-event Initialized(uint8 version)
-```
-
-
-
-*Triggered when the contract has been initialized or reinitialized.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| version  | uint8 | undefined |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-### Paused
-
-```solidity
-event Paused(address account)
-```
-
-
-
-*Emitted when the pause is triggered by `account`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| account  | address | undefined |
-
-### RevertBatch
-
-```solidity
-event RevertBatch(uint256 indexed batchIndex, bytes32 indexed batchHash)
-```
-
-revert a pending batch.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| batchIndex `indexed` | uint256 | The index of the batch. |
-| batchHash `indexed` | bytes32 | The hash of the batch |
-
-### Unpaused
-
-```solidity
-event Unpaused(address account)
-```
-
-
-
-*Emitted when the pause is lifted by `account`.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| account  | address | undefined |
-
-### UpdateMaxNumTxInChunk
-
-```solidity
-event UpdateMaxNumTxInChunk(uint256 oldMaxNumTxInChunk, uint256 newMaxNumTxInChunk)
-```
-
-Emitted when the value of `maxNumTxInChunk` is updated.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| oldMaxNumTxInChunk  | uint256 | The old value of `maxNumTxInChunk`. |
-| newMaxNumTxInChunk  | uint256 | The new value of `maxNumTxInChunk`. |
-
-### 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. |
-
-
-
-## Errors
-
-### ErrorAccountIsNotEOA
-
-```solidity
-error ErrorAccountIsNotEOA()
-```
-
-
-
-*Thrown when the given account is not EOA account.*
-
-
-### ErrorBatchHeaderLengthTooSmall
-
-```solidity
-error ErrorBatchHeaderLengthTooSmall()
-```
-
-
-
-*Thrown when the length of batch header is smaller than 89*
-
-
-### ErrorBatchIsAlreadyCommitted
-
-```solidity
-error ErrorBatchIsAlreadyCommitted()
-```
-
-
-
-*Thrown when committing a committed batch.*
-
-
-### ErrorBatchIsAlreadyVerified
-
-```solidity
-error ErrorBatchIsAlreadyVerified()
-```
-
-
-
-*Thrown when finalizing a verified batch.*
-
-
-### ErrorBatchIsEmpty
-
-```solidity
-error ErrorBatchIsEmpty()
-```
-
-
-
-*Thrown when committing empty batch (batch without chunks)*
-
-
-### ErrorCallPointEvaluationPrecompileFailed
-
-```solidity
-error ErrorCallPointEvaluationPrecompileFailed()
-```
-
-
-
-*Thrown when call precompile failed.*
-
-
-### ErrorCallerIsNotProver
-
-```solidity
-error ErrorCallerIsNotProver()
-```
-
-
-
-*Thrown when the caller is not prover.*
-
-
-### ErrorCallerIsNotSequencer
-
-```solidity
-error ErrorCallerIsNotSequencer()
-```
-
-
-
-*Thrown when the caller is not sequencer.*
-
-
-### ErrorFoundMultipleBlob
-
-```solidity
-error ErrorFoundMultipleBlob()
-```
-
-
-
-*Thrown when the transaction has multiple blobs.*
-
-
-### ErrorGenesisBatchHasNonZeroField
-
-```solidity
-error ErrorGenesisBatchHasNonZeroField()
-```
-
-
-
-*Thrown when some fields are not zero in genesis batch.*
-
-
-### ErrorGenesisBatchImported
-
-```solidity
-error ErrorGenesisBatchImported()
-```
-
-
-
-*Thrown when importing genesis batch twice.*
-
-
-### ErrorGenesisDataHashIsZero
-
-```solidity
-error ErrorGenesisDataHashIsZero()
-```
-
-
-
-*Thrown when data hash in genesis batch is zero.*
-
-
-### ErrorGenesisParentBatchHashIsNonZero
-
-```solidity
-error ErrorGenesisParentBatchHashIsNonZero()
-```
-
-
-
-*Thrown when the parent batch hash in genesis batch is zero.*
-
-
-### ErrorIncompleteL2TransactionData
-
-```solidity
-error ErrorIncompleteL2TransactionData()
-```
-
-
-
-*Thrown when the l2 transaction is incomplete.*
-
-
-### ErrorIncorrectBatchHash
-
-```solidity
-error ErrorIncorrectBatchHash()
-```
-
-
-
-*Thrown when the batch hash is incorrect.*
-
-
-### ErrorIncorrectBatchIndex
-
-```solidity
-error ErrorIncorrectBatchIndex()
-```
-
-
-
-*Thrown when the batch index is incorrect.*
-
-
-### ErrorIncorrectBitmapLength
-
-```solidity
-error ErrorIncorrectBitmapLength()
-```
-
-
-
-*Thrown when the bitmap length is incorrect.*
-
-
-### ErrorIncorrectChunkLength
-
-```solidity
-error ErrorIncorrectChunkLength()
-```
-
-
-
-*Thrown when the length of chunk is incorrect.*
-
-
-### ErrorIncorrectPreviousStateRoot
-
-```solidity
-error ErrorIncorrectPreviousStateRoot()
-```
-
-
-
-*Thrown when the previous state root doesn't match stored one.*
-
-
-### ErrorLastL1MessageSkipped
-
-```solidity
-error ErrorLastL1MessageSkipped()
-```
-
-
-
-*Thrown when the last message is skipped.*
-
-
-### ErrorNoBlobFound
-
-```solidity
-error ErrorNoBlobFound()
-```
-
-
-
-*Thrown when no blob found in the transaction.*
-
-
-### ErrorNoBlockInChunk
-
-```solidity
-error ErrorNoBlockInChunk()
-```
-
-
-
-*Thrown when no blocks in chunk.*
-
-
-### ErrorNumTxsLessThanNumL1Msgs
-
-```solidity
-error ErrorNumTxsLessThanNumL1Msgs()
-```
-
-
-
-*Thrown when the number of transactions is less than number of L1 message in one block.*
-
-
-### ErrorPreviousStateRootIsZero
-
-```solidity
-error ErrorPreviousStateRootIsZero()
-```
-
-
-
-*Thrown when the given previous state is zero.*
-
-
-### ErrorRevertFinalizedBatch
-
-```solidity
-error ErrorRevertFinalizedBatch()
-```
-
-
-
-*Thrown when reverting a finialized batch.*
-
-
-### ErrorRevertNotStartFromEnd
-
-```solidity
-error ErrorRevertNotStartFromEnd()
-```
-
-
-
-*Thrown when the reverted batches are not in the ending of commited batch chain.*
-
-
-### ErrorRevertZeroBatches
-
-```solidity
-error ErrorRevertZeroBatches()
-```
-
-
-
-*Thrown when the number of batches to revert is zero.*
-
-
-### ErrorStateRootIsZero
-
-```solidity
-error ErrorStateRootIsZero()
-```
-
-
-
-*Thrown when the given state root is zero.*
-
-
-### ErrorTooManyTxsInOneChunk
-
-```solidity
-error ErrorTooManyTxsInOneChunk()
-```
-
-
-
-*Thrown when a chunk contains too many transactions.*
-
-
-### ErrorUnexpectedPointEvaluationPrecompileOutput
-
-```solidity
-error ErrorUnexpectedPointEvaluationPrecompileOutput()
-```
-
-
-
-*Thrown when the precompile output is incorrect.*
-
-
-### ErrorZeroAddress
-
-```solidity
-error ErrorZeroAddress()
-```
-
-
-
-*Thrown when the given address is `address(0)`.*
-
-
-
diff --git a/docs/apis/ScrollStandardERC20Factory.md b/docs/apis/ScrollStandardERC20Factory.md
deleted file mode 100644
index 68609ca6..00000000
--- a/docs/apis/ScrollStandardERC20Factory.md
+++ /dev/null
@@ -1,159 +0,0 @@
-# ScrollStandardERC20Factory
-
-
-
-> ScrollStandardERC20Factory
-
-The `ScrollStandardERC20Factory` is used to deploy `ScrollStandardERC20` for `L2StandardERC20Gateway`. It uses the `Clones` contract to deploy contract with minimum gas usage.
-
-*The implementation of deployed token is non-upgradable. This design may be changed in the future.*
-
-## Methods
-
-### computeL2TokenAddress
-
-```solidity
-function computeL2TokenAddress(address _gateway, address _l1Token) external view returns (address)
-```
-
-Compute the corresponding l2 token address given l1 token address.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _gateway | address | The address of gateway contract. |
-| _l1Token | address | The address of l1 token. |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### deployL2Token
-
-```solidity
-function deployL2Token(address _gateway, address _l1Token) external nonpayable returns (address)
-```
-
-Deploy the corresponding l2 token address given l1 token address.
-
-*This function should only be called by owner to avoid DDoS attack on StandardTokenBridge.*
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _gateway | address | The address of gateway contract. |
-| _l1Token | address | The address of l1 token. |
-
-#### Returns
-
-| Name | Type | Description |
-|---|---|---|
-| _0 | address | undefined |
-
-### implementation
-
-```solidity
-function implementation() external view returns (address)
-```
-
-The address of `ScrollStandardERC20` implementation.
-
-
-
-
-#### 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. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*
-
-
-### 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 |
-
-
-
-## Events
-
-### DeployToken
-
-```solidity
-event DeployToken(address indexed _l1Token, address indexed _l2Token)
-```
-
-Emitted when a l2 token is deployed.
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| _l1Token `indexed` | address | The address of the l1 token. |
-| _l2Token `indexed` | address | The address of the l2 token. |
-
-### OwnershipTransferred
-
-```solidity
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-```
-
-
-
-
-
-#### Parameters
-
-| Name | Type | Description |
-|---|---|---|
-| previousOwner `indexed` | address | undefined |
-| newOwner `indexed` | address | undefined |
-
-
-
diff --git a/foundry.toml b/foundry.toml
index 3ea34d7a..741b5bbe 100644
--- a/foundry.toml
+++ b/foundry.toml
@@ -3,7 +3,7 @@ src = 'src'                                             # the source directory
 test = 'src/test'                                       # the test directory
 script = 'scripts'                                      # the script directory
 out = 'artifacts/src'                                   # the output directory (for artifacts)
-libs = []                                                     # a list of library directories
+libs = ["lib"]
 remappings = []                                               # a list of remappings
 libraries = []                                                # a list of deployed libraries to link against
 cache = true                                                  # whether to cache builds or not
diff --git a/integration-test/EnforcedTxGateway.spec.ts b/hardhat-test/EnforcedTxGateway.spec.ts
similarity index 100%
rename from integration-test/EnforcedTxGateway.spec.ts
rename to hardhat-test/EnforcedTxGateway.spec.ts
diff --git a/integration-test/GasOptimizationUpgrade.spec.ts b/hardhat-test/GasOptimizationUpgrade.spec.ts
similarity index 100%
rename from integration-test/GasOptimizationUpgrade.spec.ts
rename to hardhat-test/GasOptimizationUpgrade.spec.ts
diff --git a/integration-test/GasSwap.spec.ts b/hardhat-test/GasSwap.spec.ts
similarity index 100%
rename from integration-test/GasSwap.spec.ts
rename to hardhat-test/GasSwap.spec.ts
diff --git a/integration-test/L1BlockContainer.spec.ts b/hardhat-test/L1BlockContainer.spec.ts
similarity index 100%
rename from integration-test/L1BlockContainer.spec.ts
rename to hardhat-test/L1BlockContainer.spec.ts
diff --git a/integration-test/L1MessageQueue.spec.ts b/hardhat-test/L1MessageQueue.spec.ts
similarity index 100%
rename from integration-test/L1MessageQueue.spec.ts
rename to hardhat-test/L1MessageQueue.spec.ts
diff --git a/integration-test/PatriciaMerkleTrieVerifier.spec.ts b/hardhat-test/PatriciaMerkleTrieVerifier.spec.ts
similarity index 100%
rename from integration-test/PatriciaMerkleTrieVerifier.spec.ts
rename to hardhat-test/PatriciaMerkleTrieVerifier.spec.ts
diff --git a/integration-test/PoseidonHash.spec.ts b/hardhat-test/PoseidonHash.spec.ts
similarity index 100%
rename from integration-test/PoseidonHash.spec.ts
rename to hardhat-test/PoseidonHash.spec.ts
diff --git a/integration-test/ScrollChain.blob.spec.ts b/hardhat-test/ScrollChain.blob.spec.ts
similarity index 100%
rename from integration-test/ScrollChain.blob.spec.ts
rename to hardhat-test/ScrollChain.blob.spec.ts
diff --git a/integration-test/ScrollChain.spec.ts b/hardhat-test/ScrollChain.spec.ts
similarity index 100%
rename from integration-test/ScrollChain.spec.ts
rename to hardhat-test/ScrollChain.spec.ts
diff --git a/integration-test/ZkEvmVerifierV1.spec.ts b/hardhat-test/ZkEvmVerifierV1.spec.ts
similarity index 100%
rename from integration-test/ZkEvmVerifierV1.spec.ts
rename to hardhat-test/ZkEvmVerifierV1.spec.ts
diff --git a/integration-test/ZkTrieVerifier.spec.ts b/hardhat-test/ZkTrieVerifier.spec.ts
similarity index 100%
rename from integration-test/ZkTrieVerifier.spec.ts
rename to hardhat-test/ZkTrieVerifier.spec.ts
diff --git a/integration-test/testdata/plonk_verifier_0.9.8_pi.data b/hardhat-test/testdata/plonk_verifier_0.9.8_pi.data
similarity index 100%
rename from integration-test/testdata/plonk_verifier_0.9.8_pi.data
rename to hardhat-test/testdata/plonk_verifier_0.9.8_pi.data
diff --git a/integration-test/testdata/plonk_verifier_0.9.8_proof.data b/hardhat-test/testdata/plonk_verifier_0.9.8_proof.data
similarity index 100%
rename from integration-test/testdata/plonk_verifier_0.9.8_proof.data
rename to hardhat-test/testdata/plonk_verifier_0.9.8_proof.data
diff --git a/integration-test/testdata/poseidon_hash_with_domain.data b/hardhat-test/testdata/poseidon_hash_with_domain.data
similarity index 100%
rename from integration-test/testdata/poseidon_hash_with_domain.data
rename to hardhat-test/testdata/poseidon_hash_with_domain.data
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 07a5afe1..b2aaf821 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -6,7 +6,6 @@ import "@nomicfoundation/hardhat-verify";
 import "@nomicfoundation/hardhat-ethers";
 import "@nomicfoundation/hardhat-chai-matchers";
 import "@typechain/hardhat";
-import "@primitivefi/hardhat-dodoc";
 import "hardhat-gas-reporter";
 import "solidity-coverage";
 import { readFileSync } from "fs";
@@ -68,9 +67,10 @@ const config: HardhatUserConfig = {
     },
   },
   paths: {
+    artifacts: "./artifacts-hardhat",
     cache: "./cache-hardhat",
     sources: "./src",
-    tests: "./integration-test",
+    tests: "./hardhat-test",
   },
   typechain: {
     outDir: "./typechain",
@@ -83,7 +83,7 @@ const config: HardhatUserConfig = {
   },
   etherscan: {
     apiKey: {
-      ethereum: process.env.ETHERSCAN_API_KEY || "",
+      mainnet: process.env.ETHERSCAN_API_KEY || "",
       sepolia: process.env.ETHERSCAN_API_KEY || "",
       scroll: process.env.SCROLLSCAN_API_KEY || "",
       scroll_sepolia: process.env.SCROLLSCAN_API_KEY || "",
@@ -110,42 +110,6 @@ const config: HardhatUserConfig = {
   mocha: {
     timeout: 10000000,
   },
-  dodoc: {
-    runOnCompile: true,
-    keepFileStructure: false,
-    include: [
-      "ScrollChain",
-      "L1ScrollMessenger",
-      "L2ScrollMessenger",
-      "L1GatewayRouter",
-      "L2GatewayRouter",
-      "L1StandardERC20Gateway",
-      "L2StandardERC20Gateway",
-      "L1ERC721Gateway",
-      "L2ERC721Gateway",
-      "L1ERC1155Gateway",
-      "L2ERC1155Gateway",
-      "L1WETHGateway",
-      "L2WETHGateway",
-      "ScrollStandardERC20Factory",
-    ],
-    outputDir: "docs/apis",
-    exclude: [
-      "IERC677Receiver",
-      "IL1ScrollMessenger",
-      "IL2ScrollMessenger",
-      "IL1GatewayRouter",
-      "IL2GatewayRouter",
-      "IL1ERC721Gateway",
-      "IL2ERC721Gateway",
-      "IL1ERC1155Gateway",
-      "IL2ERC1155Gateway",
-      "IScrollStandardERC20Factory",
-      "IScrollChain",
-      "ScrollChainCommitmentVerifier",
-      "WETH9",
-    ],
-  },
 };
 
 export default config;
diff --git a/lib/ds-test b/lib/ds-test
index 9310e879..e282159d 160000
--- a/lib/ds-test
+++ b/lib/ds-test
@@ -1 +1 @@
-Subproject commit 9310e879db8ba3ea6d5c6489a579118fd264a3f5
+Subproject commit e282159d5170298eb2455a6c05280ab5a73a4ef0
diff --git a/lib/forge-std b/lib/forge-std
index 662ae0d6..978ac6fa 160000
--- a/lib/forge-std
+++ b/lib/forge-std
@@ -1 +1 @@
-Subproject commit 662ae0d6936654c5d1fb79fc15f521de28edb60e
+Subproject commit 978ac6fadb62f5f0b723c996f64be52eddba6801
diff --git a/lib/solmate b/lib/solmate
index bff24e83..c8923099 160000
--- a/lib/solmate
+++ b/lib/solmate
@@ -1 +1 @@
-Subproject commit bff24e835192470ed38bf15dbed6084c2d723ace
+Subproject commit c892309933b25c03d32b1b0d674df7ae292ba925
diff --git a/package.json b/package.json
index b62bd10e..256e7ba3 100644
--- a/package.json
+++ b/package.json
@@ -13,13 +13,12 @@
     "lint": "yarn lint:ts && yarn lint:sol",
     "coverage": "hardhat coverage",
     "coverage:forge": "forge coverage",
-    "prepare": "cd .. && husky install contracts/.husky"
+    "prepare": "husky install .husky"
   },
   "devDependencies": {
     "@nomicfoundation/hardhat-chai-matchers": "^2.0.6",
     "@nomicfoundation/hardhat-ethers": "^3.0.5",
     "@nomicfoundation/hardhat-verify": "^2.0.5",
-    "@primitivefi/hardhat-dodoc": "^0.2.3",
     "@typechain/ethers-v6": "^0.5.1",
     "@typechain/hardhat": "^9.1.0",
     "@types/chai": "^4.2.21",
diff --git a/scripts/README.md b/scripts/README.md
deleted file mode 100644
index 986d28d9..00000000
--- a/scripts/README.md
+++ /dev/null
@@ -1,104 +0,0 @@
-# Deployment scripts of Scroll contracts
-
-## Deployment using Hardhat
-
-The scripts should run as below sequence:
-
-```bash
-export layer1=l1geth # change to actual network name
-export layer2=l2geth # change to actual network name
-export owner=0x0000000000000000000000000000000000000000 # change to actual owner
-
-# deploy contracts in layer 1
-npx hardhat --network $layer1 run scripts/deploy_proxy_admin.ts
-npx hardhat --network $layer1 run scripts/deploy_scroll_chain.ts
-env CONTRACT_NAME=L1ScrollMessenger npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L1GatewayRouter npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L1StandardERC20Gateway npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L1CustomERC20Gateway npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L1ERC721Gateway npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L1ERC1155Gateway npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L1ETHGateway npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L1WETHGateway npx hardhat run --network $layer1 scripts/deploy_proxy_contract.ts
-
-# deploy contracts in layer 2, note: l2_messenger is predeployed
-npx hardhat --network $layer2 run scripts/deploy_proxy_admin.ts
-npx hardhat --network $layer2 run scripts/deploy_l2_messenger.ts
-npx hardhat --network $layer2 run scripts/deploy_l2_token_factory.ts
-env CONTRACT_NAME=L2GatewayRouter npx hardhat run --network $layer2 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L2StandardERC20Gateway npx hardhat run --network $layer2 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L2CustomERC20Gateway npx hardhat run --network $layer2 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L2ERC721Gateway npx hardhat run --network $layer2 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L2ERC1155Gateway npx hardhat run --network $layer2 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L2ETHGateway npx hardhat run --network $layer2 scripts/deploy_proxy_contract.ts
-env CONTRACT_NAME=L2WETHGateway npx hardhat run --network $layer2 scripts/deploy_proxy_contract.ts
-
-# initialize contracts in layer 1, should set proper bash env variables first
-npx hardhat --network $layer1 run scripts/initialize_l1_erc20_gateway.ts
-npx hardhat --network $layer1 run scripts/initialize_l1_gateway_router.ts
-npx hardhat --network $layer1 run scripts/initialize_scroll_chain.ts
-npx hardhat --network $layer1 run scripts/initialize_l1_messenger.ts
-npx hardhat --network $layer1 run scripts/initialize_l1_custom_erc20_gateway.ts
-npx hardhat --network $layer1 run scripts/initialize_l1_erc1155_gateway.ts
-npx hardhat --network $layer1 run scripts/initialize_l1_erc721_gateway.ts
-
-# initialize contracts in layer 2, should set proper bash env variables first
-npx hardhat --network $layer2 run scripts/initialize_l2_erc20_gateway.ts
-npx hardhat --network $layer2 run scripts/initialize_l2_gateway_router.ts
-npx hardhat --network $layer2 run scripts/initialize_l2_custom_erc20_gateway.ts
-npx hardhat --network $layer2 run scripts/initialize_l2_erc1155_gateway.ts
-npx hardhat --network $layer2 run scripts/initialize_l2_erc721_gateway.ts
-npx hardhat --network $layer2 run scripts/initialize_l2_token_factory.ts
-
-# transfer ownership in layer 1
-env CONTRACT_NAME=ProxyAdmin CONTRACT_OWNER=$owner npx hardhat run --network $layer1 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L1ScrollMessenger CONTRACT_OWNER=$owner npx hardhat run --network $layer1 scripts/transfer_ownership.ts
-env CONTRACT_NAME=ZKRollup CONTRACT_OWNER=$owner npx hardhat run --network $layer1 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L1GatewayRouter CONTRACT_OWNER=$owner npx hardhat run --network $layer1 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L1CustomERC20Gateway CONTRACT_OWNER=$owner npx hardhat run --network $layer1 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L1ERC721Gateway CONTRACT_OWNER=$owner npx hardhat run --network $layer1 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L1ERC1155Gateway CONTRACT_OWNER=$owner npx hardhat run --network $layer1 scripts/transfer_ownership.ts
-# transfer ownership in layer 2
-env CONTRACT_NAME=ProxyAdmin CONTRACT_OWNER=$owner npx hardhat run --network $layer2 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L2ScrollMessenger CONTRACT_OWNER=$owner npx hardhat run --network $layer2 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L2GatewayRouter CONTRACT_OWNER=$owner npx hardhat run --network $layer2 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L2CustomERC20Gateway CONTRACT_OWNER=$owner npx hardhat run --network $layer2 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L2ERC721Gateway CONTRACT_OWNER=$owner npx hardhat run --network $layer2 scripts/transfer_ownership.ts
-env CONTRACT_NAME=L2ERC1155Gateway CONTRACT_OWNER=$owner npx hardhat run --network $layer2 scripts/transfer_ownership.ts
-```
-
-Reference testnet [run_deploy_contracts.sh](https://github.com/scroll-tech/testnet/blob/staging/run_deploy_contracts.sh) for details.
-
-## Deployment using Foundry
-
-Note: The Foundry scripts take parameters like `CHAIN_ID_L2` and `L1_SCROLL_CHAIN_PROXY_ADDR` as environment variables.
-
-```bash
-# allexport
-$ set -a
-
-$ cat .env
-CHAIN_ID_L2="5343541"
-SCROLL_L1_RPC="http://localhost:8543"
-SCROLL_L2_RPC="http://localhost:8545"
-L1_DEPLOYER_PRIVATE_KEY="0x0000000000000000000000000000000000000000000000000000000000000001"
-L2_DEPLOYER_PRIVATE_KEY="0x0000000000000000000000000000000000000000000000000000000000000002"
-L1_ROLLUP_OPERATOR_ADDR="0x1111111111111111111111111111111111111111"
-
-$ source .env
-
-# Deploy L1 contracts
-# Note: We extract the logged addresses as environment variables.
-$ OUTPUT=$(forge script scripts/foundry/DeployL1BridgeContracts.s.sol:DeployL1BridgeContracts --rpc-url $SCROLL_L1_RPC --broadcast); echo $OUTPUT
-$ echo "$OUTPUT" | grep -Eo "(L1)_.*" > .env.l1_addresses
-$ source .env.l1_addresses
-
-# Deploy L2 contracts
-$ OUTPUT=$(forge script scripts/foundry/DeployL2BridgeContracts.s.sol:DeployL2BridgeContracts --rpc-url $SCROLL_L2_RPC --broadcast); echo $OUTPUT
-$ echo "$OUTPUT" | grep -Eo "(L2)_.*" > .env.l2_addresses
-$ source .env.l2_addresses
-
-# Initialize contracts
-$ forge script scripts/foundry/InitializeL1BridgeContracts.s.sol:InitializeL1BridgeContracts --rpc-url $SCROLL_L1_RPC --broadcast
-$ forge script scripts/foundry/InitializeL2BridgeContracts.s.sol:InitializeL2BridgeContracts --rpc-url $SCROLL_L2_RPC --broadcast
-```
diff --git a/scripts/deploy_l2_messenger.ts b/scripts/deploy_l2_messenger.ts
deleted file mode 100644
index 4e5c8d19..00000000
--- a/scripts/deploy_l2_messenger.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const ProxyAdmin = await ethers.getContractAt("ProxyAdmin", addressFile.get("ProxyAdmin"), deployer);
-
-  const container = process.env.L1_BLOCK_CONTAINER_ADDR!;
-  const queue = process.env.L2_MESSAGE_QUEUE_ADDR!;
-  if (!addressFile.get("L2ScrollMessenger.implementation")) {
-    console.log(">> Deploy L2ScrollMessenger implementation");
-    const L2ScrollMessenger = await ethers.getContractFactory("L2ScrollMessenger", deployer);
-    const impl = await L2ScrollMessenger.deploy(container, queue);
-    console.log(`>> waiting for transaction: ${impl.deployTransaction.hash}`);
-    await impl.deployed();
-    console.log(`✅ L2ScrollMessenger implementation deployed at ${impl.address}`);
-    addressFile.set("L2ScrollMessenger.implementation", impl.address);
-  }
-
-  const impl = addressFile.get("L2ScrollMessenger.implementation") as string;
-
-  if (!addressFile.get("L2ScrollMessenger.proxy")) {
-    console.log(">> Deploy L2ScrollMessenger proxy");
-    const TransparentUpgradeableProxy = await ethers.getContractFactory("TransparentUpgradeableProxy", deployer);
-    const proxy = await TransparentUpgradeableProxy.deploy(impl, ProxyAdmin.address, "0x");
-    console.log(`>> waiting for transaction: ${proxy.deployTransaction.hash}`);
-    await proxy.deployed();
-    console.log(`✅ L2ScrollMessenger proxy deployed at ${proxy.address}`);
-    addressFile.set(`L2ScrollMessenger.proxy`, proxy.address);
-  }
-
-  // Export contract address to testnet.
-  console.log(
-    `testnet-export: ${addressFile.get("L2ScrollMessenger.implementation")};${addressFile.get(
-      "L2ScrollMessenger.proxy"
-    )}`
-  );
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/deploy_l2_token_factory.ts b/scripts/deploy_l2_token_factory.ts
deleted file mode 100644
index 42c71c9d..00000000
--- a/scripts/deploy_l2_token_factory.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  if (!addressFile.get("ScrollStandardERC20")) {
-    console.log(">> Deploy ScrollStandardERC20");
-    const ScrollStandardERC20 = await ethers.getContractFactory("ScrollStandardERC20", deployer);
-    const token = await ScrollStandardERC20.deploy();
-    console.log(`>> waiting for transaction: ${token.deployTransaction.hash}`);
-    await token.deployed();
-    console.log(`✅ ScrollStandardERC20 deployed at ${token.address}`);
-    addressFile.set("ScrollStandardERC20", token.address);
-  }
-
-  const tokenImpl = addressFile.get("ScrollStandardERC20") as string;
-
-  if (!addressFile.get("ScrollStandardERC20Factory")) {
-    console.log(">> Deploy ScrollStandardERC20Factory");
-    const ScrollStandardERC20Factory = await ethers.getContractFactory("ScrollStandardERC20Factory", deployer);
-    const token = await ScrollStandardERC20Factory.deploy(tokenImpl);
-    console.log(`>> waiting for transaction: ${token.deployTransaction.hash}`);
-    await token.deployed();
-    console.log(`✅ ScrollStandardERC20Factory deployed at ${token.address}`);
-    addressFile.set("ScrollStandardERC20Factory", token.address);
-  }
-
-  // Export contract address to testnet.
-  console.log(
-    `testnet-export: ${addressFile.get("ScrollStandardERC20")};${addressFile.get("ScrollStandardERC20Factory")}`
-  );
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/deploy_proxy_admin.ts b/scripts/deploy_proxy_admin.ts
deleted file mode 100644
index 8894dc3c..00000000
--- a/scripts/deploy_proxy_admin.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  if (!addressFile.get("ProxyAdmin")) {
-    console.log(">> Deploy ProxyAdmin");
-    const ProxyAdmin = await ethers.getContractFactory("ProxyAdmin", deployer);
-    const proxyAdmin = await ProxyAdmin.deploy();
-    console.log(`>> waiting for transaction: ${proxyAdmin.deployTransaction.hash}`);
-    await proxyAdmin.deployed();
-    console.log(`✅ ProxyAdmin deployed at ${proxyAdmin.address}`);
-    addressFile.set("ProxyAdmin", proxyAdmin.address);
-  }
-
-  // Export contract address to testnet.
-  console.log(`testnet-export: ${addressFile.get("ProxyAdmin")}`);
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/deploy_proxy_contract.ts b/scripts/deploy_proxy_contract.ts
deleted file mode 100644
index 2921a114..00000000
--- a/scripts/deploy_proxy_contract.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  if (process.env.CONTRACT_NAME === undefined) {
-    throw new Error("env CONTRACT_NAME undefined");
-  }
-
-  const contractName = process.env.CONTRACT_NAME!;
-  const ProxyAdmin = await ethers.getContractAt("ProxyAdmin", addressFile.get("ProxyAdmin"), deployer);
-
-  if (!addressFile.get(`${contractName}.implementation`)) {
-    console.log(`>> Deploy ${contractName} implementation`);
-    const ContractImpl = await ethers.getContractFactory(contractName, deployer);
-    const impl = await ContractImpl.deploy();
-    console.log(`>> waiting for transaction: ${impl.deployTransaction.hash}`);
-    await impl.deployed();
-    console.log(`✅ ${contractName} implementation deployed at ${impl.address}`);
-    addressFile.set(`${contractName}.implementation`, impl.address);
-  }
-
-  const impl = addressFile.get(`${contractName}.implementation`) as string;
-
-  if (!addressFile.get(`${contractName}.proxy`)) {
-    console.log(`>> Deploy ${contractName} proxy`);
-    const TransparentUpgradeableProxy = await ethers.getContractFactory("TransparentUpgradeableProxy", deployer);
-    const proxy = await TransparentUpgradeableProxy.deploy(impl, ProxyAdmin.address, "0x");
-    console.log(`>> waiting for transaction: ${proxy.deployTransaction.hash}`);
-    await proxy.deployed();
-    console.log(`✅ ${contractName} proxy deployed at ${proxy.address}`);
-    addressFile.set(`${contractName}.proxy`, proxy.address);
-  }
-
-  // Export contract address to testnet.
-  console.log(
-    `testnet-export: ${addressFile.get(`${contractName}.implementation`)};${addressFile.get(`${contractName}.proxy`)}`
-  );
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/deploy_scroll_chain.ts b/scripts/deploy_scroll_chain.ts
deleted file mode 100644
index 18052f3c..00000000
--- a/scripts/deploy_scroll_chain.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const CHAIN_ID_L2 = process.env.CHAIN_ID_L2 || "none";
-  const MAX_TX_IN_BATCH = process.env.MAX_TX_IN_BATCH || 25;
-  const PADDING_TX_HASH =
-    process.env.PADDING_TX_HASH || "0xb5baa665b2664c3bfed7eb46e00ebc110ecf2ebd257854a9bf2b9dbc9b2c08f6";
-
-  const ProxyAdmin = await ethers.getContractAt("ProxyAdmin", addressFile.get("ProxyAdmin"), deployer);
-
-  if (!addressFile.get("ScrollChain.verifier")) {
-    console.log(">> Deploy RollupVerifier");
-    const RollupVerifier = await ethers.getContractFactory("RollupVerifier", deployer);
-    const verifier = await RollupVerifier.deploy();
-    console.log(`>> waiting for transaction: ${verifier.deployTransaction.hash}`);
-    await verifier.deployed();
-    console.log(`✅ RollupVerifier deployed at ${verifier.address}`);
-    addressFile.set("ScrollChain.verifier", verifier.address);
-  }
-
-  if (!addressFile.get("ScrollChain.implementation")) {
-    console.log(">> Deploy ScrollChain implementation");
-    const ScrollChain = await ethers.getContractFactory("ScrollChain", {
-      libraries: {
-        RollupVerifier: addressFile.get("ScrollChain.verifier"),
-      },
-      signer: deployer,
-    });
-    const impl = await ScrollChain.deploy(CHAIN_ID_L2, MAX_TX_IN_BATCH, PADDING_TX_HASH);
-    console.log(`>> waiting for transaction: ${impl.deployTransaction.hash}`);
-    await impl.deployed();
-    console.log(`✅ ScrollChain implementation deployed at ${impl.address}`);
-    addressFile.set("ScrollChain.implementation", impl.address);
-  }
-
-  const impl = addressFile.get("ScrollChain.implementation") as string;
-
-  if (!addressFile.get("ScrollChain.proxy")) {
-    console.log(">> Deploy ScrollChain proxy");
-    const TransparentUpgradeableProxy = await ethers.getContractFactory("TransparentUpgradeableProxy", deployer);
-    const proxy = await TransparentUpgradeableProxy.deploy(impl, ProxyAdmin.address, "0x");
-    console.log(`>> waiting for transaction: ${proxy.deployTransaction.hash}`);
-    await proxy.deployed();
-    console.log(`✅ ScrollChain proxy deployed at ${proxy.address}`);
-    addressFile.set("ScrollChain.proxy", proxy.address);
-  }
-
-  // Export contract address to testnet.
-  console.log(
-    `testnet-export: ${addressFile.get("ScrollChain.implementation")};${addressFile.get("ScrollChain.proxy")}`
-  );
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/deploy_weth.ts b/scripts/deploy_weth.ts
deleted file mode 100644
index b9a2d524..00000000
--- a/scripts/deploy_weth.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  if (!addressFile.get("WETH")) {
-    console.log(">> Deploy WETH");
-    const WrappedEther = await ethers.getContractFactory("WrappedEther", deployer);
-    const weth = await WrappedEther.deploy();
-    console.log(`>> waiting for transaction: ${weth.deployTransaction.hash}`);
-    await weth.deployed();
-    console.log(`✅ WETH deployed at ${weth.address}`);
-    addressFile.set("WETH", weth.address);
-  }
-
-  // Export contract address to testnet.
-  console.log(`testnet-export: ${addressFile.get("WETH")}`);
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/ScrollChainCommitmentVerifier.deploy.ts b/scripts/hardhat/ScrollChainCommitmentVerifier.deploy.ts
similarity index 65%
rename from scripts/ScrollChainCommitmentVerifier.deploy.ts
rename to scripts/hardhat/ScrollChainCommitmentVerifier.deploy.ts
index 24dc639c..c4cae55b 100644
--- a/scripts/ScrollChainCommitmentVerifier.deploy.ts
+++ b/scripts/hardhat/ScrollChainCommitmentVerifier.deploy.ts
@@ -2,7 +2,7 @@
 import * as dotenv from "dotenv";
 
 import { ethers } from "hardhat";
-import { generateABI, createCode } from "../scripts/poseidon";
+import { generateABI, createCode } from "../poseidon";
 
 dotenv.config();
 
@@ -18,18 +18,20 @@ async function main() {
     const Poseidon2Elements = new ethers.ContractFactory(generateABI(2), createCode(2), deployer);
 
     const poseidon = await Poseidon2Elements.deploy();
-    console.log("Deploy PoseidonUnit2 contract, hash:", poseidon.deployTransaction.hash);
-    const receipt = await poseidon.deployTransaction.wait();
-    console.log(`✅ Deploy PoseidonUnit2 contract at: ${poseidon.address}, gas used: ${receipt.gasUsed}`);
-    PoseidonUnit2Address = poseidon.address;
+    console.log("Deploy PoseidonUnit2 contract, hash:", poseidon.deploymentTransaction()?.hash);
+    const receipt = await poseidon.deploymentTransaction()!.wait();
+    console.log(`✅ Deploy PoseidonUnit2 contract at: ${await poseidon.getAddress()}, gas used: ${receipt!.gasUsed}`);
+    PoseidonUnit2Address = await poseidon.getAddress();
   }
 
   const verifier = await ScrollChainCommitmentVerifier.deploy(PoseidonUnit2Address, L1ScrollChainAddress, {
     gasPrice: 1e9,
   });
-  console.log("Deploy ScrollChainCommitmentVerifier contract, hash:", verifier.deployTransaction.hash);
-  const receipt = await verifier.deployTransaction.wait();
-  console.log(`✅ Deploy ScrollChainCommitmentVerifier contract at: ${verifier.address}, gas used: ${receipt.gasUsed}`);
+  console.log("Deploy ScrollChainCommitmentVerifier contract, hash:", verifier.deploymentTransaction()!.hash);
+  const receipt = await verifier.deploymentTransaction()!.wait();
+  console.log(
+    `✅ Deploy ScrollChainCommitmentVerifier contract at: ${await verifier.getAddress()}, gas used: ${receipt!.gasUsed}`
+  );
 }
 
 // We recommend this pattern to be able to use async/await everywhere
diff --git a/scripts/import_genesis_block.ts b/scripts/import_genesis_block.ts
deleted file mode 100644
index a521a6b9..00000000
--- a/scripts/import_genesis_block.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import fs from "fs";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-const GENESIS_FILE_PATH = process.env.GENESIS_FILE_PATH || "genesis.json";
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const rollupAddr = process.env.L1_SCROLL_CHAIN_PROXY_ADDR || addressFile.get("ScrollChain.proxy") || "0x";
-  console.log("Using rollup proxy address:", rollupAddr);
-
-  const ScrollChain = await ethers.getContractAt("ScrollChain", rollupAddr, deployer);
-  const genesis = JSON.parse(fs.readFileSync(GENESIS_FILE_PATH, "utf8"));
-  console.log("Using genesis block:", genesis.blockHash);
-
-  const tx = await ScrollChain.importGenesisBatch(genesis);
-
-  console.log("importGenesisBatch ScrollChain, hash:", tx.hash);
-  const receipt = await tx.wait();
-  console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/index.ts b/scripts/index.ts
deleted file mode 100644
index e69de29b..00000000
diff --git a/scripts/initialize_l1_custom_erc20_gateway.ts b/scripts/initialize_l1_custom_erc20_gateway.ts
deleted file mode 100644
index 931226d8..00000000
--- a/scripts/initialize_l1_custom_erc20_gateway.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L1CustomERC20Gateway = await ethers.getContractAt(
-    "L1CustomERC20Gateway",
-    addressFile.get("L1CustomERC20Gateway.proxy"),
-    deployer
-  );
-
-  const L1GatewayRouterAddress = addressFile.get("L1GatewayRouter.proxy");
-  const L1ScrollMessengerAddress = addressFile.get("L1ScrollMessenger.proxy");
-  const L2CustomERC20GatewayAddress = process.env.L2_CUSTOM_ERC20_GATEWAY_PROXY_ADDR!;
-
-  if ((await L1CustomERC20Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L1CustomERC20Gateway.initialize(
-      L2CustomERC20GatewayAddress,
-      L1GatewayRouterAddress,
-      L1ScrollMessengerAddress
-    );
-    console.log("initialize L1CustomERC20Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l1_erc1155_gateway.ts b/scripts/initialize_l1_erc1155_gateway.ts
deleted file mode 100644
index 8cb3e0c9..00000000
--- a/scripts/initialize_l1_erc1155_gateway.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L1ERC1155Gateway = await ethers.getContractAt(
-    "L1ERC1155Gateway",
-    addressFile.get("L1ERC1155Gateway.proxy"),
-    deployer
-  );
-
-  const L1ScrollMessengerAddress = addressFile.get("L1ScrollMessenger.proxy");
-  const L2ERC1155GatewayAddress = process.env.L2_ERC1155_GATEWAY_PROXY_ADDR!;
-
-  if ((await L1ERC1155Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L1ERC1155Gateway.initialize(L2ERC1155GatewayAddress, L1ScrollMessengerAddress);
-    console.log("initialize L1ERC1155Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l1_erc20_gateway.ts b/scripts/initialize_l1_erc20_gateway.ts
deleted file mode 100644
index 0a82ed4a..00000000
--- a/scripts/initialize_l1_erc20_gateway.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L1StandardERC20Gateway = await ethers.getContractAt(
-    "L1StandardERC20Gateway",
-    addressFile.get("L1StandardERC20Gateway.proxy"),
-    deployer
-  );
-
-  const L1GatewayRouterAddress = addressFile.get("L1GatewayRouter.proxy");
-  const L1ScrollMessengerAddress = addressFile.get("L1ScrollMessenger.proxy");
-  const L2StandardERC20GatewayAddress = process.env.L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR!;
-  const L2StandardERC20Impl = process.env.L2_SCROLL_STANDARD_ERC20_ADDR!;
-  const L2StandardERC20FactoryAddress = process.env.L2_SCROLL_STANDARD_ERC20_FACTORY_ADDR!;
-
-  if ((await L1StandardERC20Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L1StandardERC20Gateway.initialize(
-      L2StandardERC20GatewayAddress,
-      L1GatewayRouterAddress,
-      L1ScrollMessengerAddress,
-      L2StandardERC20Impl,
-      L2StandardERC20FactoryAddress
-    );
-    console.log("initialize L1StandardERC20Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l1_erc721_gateway.ts b/scripts/initialize_l1_erc721_gateway.ts
deleted file mode 100644
index 6355c58f..00000000
--- a/scripts/initialize_l1_erc721_gateway.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L1ERC721Gateway = await ethers.getContractAt(
-    "L1ERC721Gateway",
-    addressFile.get("L1ERC721Gateway.proxy"),
-    deployer
-  );
-
-  const L1ScrollMessengerAddress = addressFile.get("L1ScrollMessenger.proxy");
-  const L2ERC721GatewayAddress = process.env.L2_ERC721_GATEWAY_PROXY_ADDR!;
-
-  if ((await L1ERC721Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L1ERC721Gateway.initialize(L2ERC721GatewayAddress, L1ScrollMessengerAddress);
-    console.log("initialize L1ERC721Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l1_gateway_router.ts b/scripts/initialize_l1_gateway_router.ts
deleted file mode 100644
index c8f70feb..00000000
--- a/scripts/initialize_l1_gateway_router.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L1GatewayRouter = await ethers.getContractAt(
-    "L1GatewayRouter",
-    addressFile.get("L1GatewayRouter.proxy"),
-    deployer
-  );
-
-  const L1StandardERC20GatewayAddress = addressFile.get("L1StandardERC20Gateway.proxy");
-  const L1ScrollMessengerAddress = addressFile.get("L1ScrollMessenger.proxy");
-  const L2GatewayRouterAddress = process.env.L2_GATEWAY_ROUTER_PROXY_ADDR!;
-
-  if ((await L1GatewayRouter.counterpart()) === constants.AddressZero) {
-    const tx = await L1GatewayRouter.initialize(
-      L1StandardERC20GatewayAddress,
-      L2GatewayRouterAddress,
-      L1ScrollMessengerAddress
-    );
-    console.log("initialize L1StandardERC20Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l1_messenger.ts b/scripts/initialize_l1_messenger.ts
deleted file mode 100644
index 0df64fb6..00000000
--- a/scripts/initialize_l1_messenger.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L1ScrollMessenger = await ethers.getContractAt(
-    "L1ScrollMessenger",
-    addressFile.get("L1ScrollMessenger.proxy"),
-    deployer
-  );
-
-  const ZKRollupAddress = addressFile.get("ZKRollup.proxy");
-
-  if ((await L1ScrollMessenger.rollup()) === constants.AddressZero) {
-    const tx = await L1ScrollMessenger.initialize(ZKRollupAddress);
-    console.log("initialize L1StandardERC20Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l2_custom_erc20_gateway.ts b/scripts/initialize_l2_custom_erc20_gateway.ts
deleted file mode 100644
index c0cf1e9b..00000000
--- a/scripts/initialize_l2_custom_erc20_gateway.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L2CustomERC20Gateway = await ethers.getContractAt(
-    "L2CustomERC20Gateway",
-    addressFile.get("L2CustomERC20Gateway.proxy"),
-    deployer
-  );
-
-  const L2GatewayRouterAddress = addressFile.get("L2GatewayRouter.proxy");
-  const L2ScrollMessengerAddress = addressFile.get("L2ScrollMessenger");
-  const L1CustomERC20GatewayAddress = process.env.L1_CUSTOM_ERC20_GATEWAY_PROXY_ADDR!;
-
-  if ((await L2CustomERC20Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L2CustomERC20Gateway.initialize(
-      L1CustomERC20GatewayAddress,
-      L2GatewayRouterAddress,
-      L2ScrollMessengerAddress
-    );
-    console.log("initialize L2CustomERC20Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l2_erc1155_gateway.ts b/scripts/initialize_l2_erc1155_gateway.ts
deleted file mode 100644
index 521aa7f4..00000000
--- a/scripts/initialize_l2_erc1155_gateway.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L2ERC1155Gateway = await ethers.getContractAt(
-    "L2ERC1155Gateway",
-    addressFile.get("L2ERC1155Gateway.proxy"),
-    deployer
-  );
-
-  const L2ScrollMessengerAddress = addressFile.get("L2ScrollMessenger");
-  const L1ERC1155GatewayAddress = process.env.L1_ERC1155_GATEWAY_PROXY_ADDR!;
-
-  if ((await L2ERC1155Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L2ERC1155Gateway.initialize(L1ERC1155GatewayAddress, L2ScrollMessengerAddress);
-    console.log("initialize L2ERC1155Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l2_erc20_gateway.ts b/scripts/initialize_l2_erc20_gateway.ts
deleted file mode 100644
index d2b823d7..00000000
--- a/scripts/initialize_l2_erc20_gateway.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L2StandardERC20Gateway = await ethers.getContractAt(
-    "L2StandardERC20Gateway",
-    addressFile.get("L2StandardERC20Gateway.proxy"),
-    deployer
-  );
-
-  const L2GatewayRouterAddress = addressFile.get("L2GatewayRouter.proxy");
-  const L2ScrollMessengerAddress = addressFile.get("L2ScrollMessenger");
-  const L2StandardERC20FactoryAddress = addressFile.get("ScrollStandardERC20Factory");
-  const L1StandardERC20GatewayAddress = process.env.L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR!;
-
-  if ((await L2StandardERC20Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L2StandardERC20Gateway.initialize(
-      L1StandardERC20GatewayAddress,
-      L2GatewayRouterAddress,
-      L2ScrollMessengerAddress,
-      L2StandardERC20FactoryAddress
-    );
-    console.log("initialize L2StandardERC20Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l2_erc721_gateway.ts b/scripts/initialize_l2_erc721_gateway.ts
deleted file mode 100644
index 97f7564a..00000000
--- a/scripts/initialize_l2_erc721_gateway.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L2ERC721Gateway = await ethers.getContractAt(
-    "L2ERC721Gateway",
-    addressFile.get("L2ERC721Gateway.proxy"),
-    deployer
-  );
-
-  const L2ScrollMessengerAddress = addressFile.get("L2ScrollMessenger");
-  const L1ERC721GatewayAddress = process.env.L1_ERC721_GATEWAY_PROXY_ADDR!;
-
-  if ((await L2ERC721Gateway.counterpart()) === constants.AddressZero) {
-    const tx = await L2ERC721Gateway.initialize(L1ERC721GatewayAddress, L2ScrollMessengerAddress);
-    console.log("initialize L2ERC721Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l2_gateway_router.ts b/scripts/initialize_l2_gateway_router.ts
deleted file mode 100644
index a1bcda58..00000000
--- a/scripts/initialize_l2_gateway_router.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import { constants } from "ethers";
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const L2GatewayRouter = await ethers.getContractAt(
-    "L2GatewayRouter",
-    addressFile.get("L2GatewayRouter.proxy"),
-    deployer
-  );
-
-  const L2StandardERC20GatewayAddress = addressFile.get("L2StandardERC20Gateway.proxy");
-  const L2ScrollMessengerAddress = addressFile.get("L2ScrollMessenger");
-  const L1GatewayRouterAddress = process.env.L1_GATEWAY_ROUTER_PROXY_ADDR!;
-
-  if ((await L2GatewayRouter.counterpart()) === constants.AddressZero) {
-    const tx = await L2GatewayRouter.initialize(
-      L2StandardERC20GatewayAddress,
-      L1GatewayRouterAddress,
-      L2ScrollMessengerAddress
-    );
-    console.log("initialize L1StandardERC20Gateway, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_l2_token_factory.ts b/scripts/initialize_l2_token_factory.ts
deleted file mode 100644
index 471a3055..00000000
--- a/scripts/initialize_l2_token_factory.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const ScrollStandardERC20Factory = await ethers.getContractAt(
-    "ScrollStandardERC20Factory",
-    addressFile.get("ScrollStandardERC20Factory"),
-    deployer
-  );
-
-  const L2StandardERC20GatewayAddress = addressFile.get("L2StandardERC20Gateway.proxy");
-
-  // if ((await ScrollStandardERC20Factory.owner()) !== L2StandardERC20GatewayAddress) {
-  const tx = await ScrollStandardERC20Factory.transferOwnership(L2StandardERC20GatewayAddress);
-  console.log("transfer ownernship ScrollStandardERC20Factory, hash:", tx.hash);
-  const receipt = await tx.wait();
-  console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  // }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/initialize_zkrollup.ts b/scripts/initialize_zkrollup.ts
deleted file mode 100644
index 6c318788..00000000
--- a/scripts/initialize_zkrollup.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-import { constants } from "ethers";
-
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-const L1_MESSAGE_QUEUE = process.env.L1_MESSAGE_QUEUE || "none";
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const ScrollChain = await ethers.getContractAt("ScrollChain", addressFile.get("ScrollChain.proxy"), deployer);
-
-  if ((await ScrollChain.owner()) === constants.AddressZero) {
-    const tx = await ScrollChain.initialize(L1_MESSAGE_QUEUE, constants.AddressZero);
-    console.log("initialize ScrollChain, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-
-  const L1RollupOperatorAddress = process.env.L1_ROLLUP_OPERATOR_ADDR!;
-  if ((await ScrollChain.isBatchFinalized(L1RollupOperatorAddress)) === false) {
-    console.log("L1_ROLLUP_OPERATOR_ADDR", L1RollupOperatorAddress);
-    const tx = await ScrollChain.updateSequencer(L1RollupOperatorAddress, true);
-    console.log("updateOperator ScrollChain, hash:", tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/transfer_ownership.ts b/scripts/transfer_ownership.ts
deleted file mode 100644
index 57e4455d..00000000
--- a/scripts/transfer_ownership.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  if (process.env.CONTRACT_NAME === undefined) {
-    throw new Error("env CONTRACT_NAME undefined");
-  }
-  const contractName = process.env.CONTRACT_NAME!;
-  const contractAddress = addressFile.get(`${contractName}.proxy`) || addressFile.get(`${contractName}`);
-  const Contract = await ethers.getContractAt(contractName, contractAddress, deployer);
-
-  const owner = process.env.CONTRACT_OWNER || deployer.address;
-  if ((await Contract.owner()).toLowerCase() !== owner.toLowerCase()) {
-    const tx = await Contract.transferOwnership(owner);
-    console.log(`${contractName} transfer ownership to ${owner}, hash: ${tx.hash}`);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/upgrade_impl.ts b/scripts/upgrade_impl.ts
deleted file mode 100644
index aa6f9959..00000000
--- a/scripts/upgrade_impl.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/* eslint-disable node/no-missing-import */
-import * as dotenv from "dotenv";
-
-import * as hre from "hardhat";
-import { ethers } from "hardhat";
-import { selectAddressFile } from "./utils";
-
-dotenv.config();
-
-async function main() {
-  const addressFile = selectAddressFile(hre.network.name);
-
-  const [deployer] = await ethers.getSigners();
-
-  const contractName = process.env.CONTRACT_NAME_TO_UPGRADE!;
-
-  const ProxyAdmin = await ethers.getContractAt("ProxyAdmin", addressFile.get("ProxyAdmin"), deployer);
-  const proxy = await ethers.getContractAt(contractName, addressFile.get(`${contractName}.proxy`), deployer);
-  const contractImplAddress = addressFile.get(`${contractName}.implementation`);
-
-  if ((await ProxyAdmin.getProxyImplementation(proxy.address)) !== contractImplAddress) {
-    const tx = await ProxyAdmin.upgrade(proxy.address, contractImplAddress);
-    console.log(`upgrade impl for ${contractName}, hash:`, tx.hash);
-    const receipt = await tx.wait();
-    console.log(`✅ Done, gas used: ${receipt.gasUsed}`);
-  }
-}
-
-// We recommend this pattern to be able to use async/await everywhere
-// and properly handle errors.
-main().catch((error) => {
-  console.error(error);
-  process.exitCode = 1;
-});
diff --git a/scripts/utils.ts b/scripts/utils.ts
deleted file mode 100644
index d8fe3302..00000000
--- a/scripts/utils.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import * as fs from "fs";
-import * as path from "path";
-import editJsonFile from "edit-json-file";
-
-const CONFIG_FILE_DIR = path.join(__dirname, "../", "deployments");
-
-export function selectAddressFile(network: string) {
-  if (!fs.existsSync(CONFIG_FILE_DIR)) {
-    fs.mkdirSync(CONFIG_FILE_DIR, { recursive: true });
-  }
-
-  let filename: string;
-  if (["hardhat", "l1geth", "l2geth"].includes(network)) {
-    filename = path.join(CONFIG_FILE_DIR, `${network}.json`);
-  } else {
-    throw new Error(`network ${network} not supported yet`);
-  }
-
-  const addressFile = editJsonFile(filename, {
-    stringify_eol: true,
-    autosave: true,
-  });
-
-  return addressFile;
-}
diff --git a/src/L1/rollup/ScrollChain.sol b/src/L1/rollup/ScrollChain.sol
index 62b46e3a..20e08c20 100644
--- a/src/L1/rollup/ScrollChain.sol
+++ b/src/L1/rollup/ScrollChain.sol
@@ -89,10 +89,10 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain {
     /// @dev Thrown when the number of batches to revert is zero.
     error ErrorRevertZeroBatches();
 
-    /// @dev Thrown when the reverted batches are not in the ending of commited batch chain.
+    /// @dev Thrown when the reverted batches are not in the ending of committed batch chain.
     error ErrorRevertNotStartFromEnd();
 
-    /// @dev Thrown when reverting a finialized batch.
+    /// @dev Thrown when reverting a finalized batch.
     error ErrorRevertFinalizedBatch();
 
     /// @dev Thrown when the given state root is zero.
@@ -112,11 +112,11 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain {
      *************/
 
     /// @dev Address of the point evaluation precompile used for EIP-4844 blob verification.
-    address private constant POINT_EVALUATION_PRECOMPILE_ADDR = address(0x0A);
+    address internal constant POINT_EVALUATION_PRECOMPILE_ADDR = address(0x0A);
 
     /// @dev BLS Modulus value defined in EIP-4844 and the magic value returned from a successful call to the
     /// point evaluation precompile
-    uint256 private constant BLS_MODULUS =
+    uint256 internal constant BLS_MODULUS =
         52435875175126190479447740508185965837690552500527637822603658699938581184513;
 
     /// @notice The chain id of the corresponding layer 2 chain.
diff --git a/src/L2/predeploys/L1GasPriceOracle.sol b/src/L2/predeploys/L1GasPriceOracle.sol
index fe3c37e4..6d535328 100644
--- a/src/L2/predeploys/L1GasPriceOracle.sol
+++ b/src/L2/predeploys/L1GasPriceOracle.sol
@@ -60,7 +60,7 @@ contract L1GasPriceOracle is OwnableBase, IL1GasPriceOracle {
     /// commit_scalar = commit_gas_per_tx * fluctuation_multiplier * 1e9
     /// ```
     /// So, the value should not exceed 10^9 * 1e9 normally.
-    uint256 private constant MAX_COMMIT_SCALAR = 10 ** 9 * PRECISION;
+    uint256 private constant MAX_COMMIT_SCALAR = 10**9 * PRECISION;
 
     /// @dev The maximum possible l1 blob fee scalar after Curie.
     /// We derive the blob scalar by
@@ -68,7 +68,7 @@ contract L1GasPriceOracle is OwnableBase, IL1GasPriceOracle {
     /// blob_scalar = fluctuation_multiplier / compression_ratio / blob_util_ratio * 1e9
     /// ```
     /// So, the value should not exceed 10^9 * 1e9 normally.
-    uint256 private constant MAX_BLOB_SCALAR = 10 ** 9 * PRECISION;
+    uint256 private constant MAX_BLOB_SCALAR = 10**9 * PRECISION;
 
     /*************
      * Variables *
@@ -150,10 +150,11 @@ contract L1GasPriceOracle is OwnableBase, IL1GasPriceOracle {
     }
 
     /// @inheritdoc IL1GasPriceOracle
-    function setL1BaseFeeAndBlobBaseFee(
-        uint256 _l1BaseFee,
-        uint256 _l1BlobBaseFee
-    ) external override onlyWhitelistedSender {
+    function setL1BaseFeeAndBlobBaseFee(uint256 _l1BaseFee, uint256 _l1BlobBaseFee)
+        external
+        override
+        onlyWhitelistedSender
+    {
         l1BaseFee = _l1BaseFee;
         l1BlobBaseFee = _l1BlobBaseFee;
 
diff --git a/src/mocks/ScrollChainMockFinalize.sol b/src/mocks/ScrollChainMockFinalize.sol
new file mode 100644
index 00000000..3e576b3d
--- /dev/null
+++ b/src/mocks/ScrollChainMockFinalize.sol
@@ -0,0 +1,121 @@
+// SPDX-License-Identifier: MIT
+
+pragma solidity =0.8.24;
+
+import {ScrollChain} from "../L1/rollup/ScrollChain.sol";
+
+import {BatchHeaderV0Codec} from "../libraries/codec/BatchHeaderV0Codec.sol";
+import {BatchHeaderV1Codec} from "../libraries/codec/BatchHeaderV1Codec.sol";
+
+contract ScrollChainMockFinalize is ScrollChain {
+    /***************
+     * Constructor *
+     ***************/
+
+    /// @notice Constructor for `ScrollChain` implementation contract.
+    ///
+    /// @param _chainId The chain id of L2.
+    /// @param _messageQueue The address of `L1MessageQueue` contract.
+    /// @param _verifier The address of zkevm verifier contract.
+    constructor(
+        uint64 _chainId,
+        address _messageQueue,
+        address _verifier
+    ) ScrollChain(_chainId, _messageQueue, _verifier) {}
+
+    /*****************************
+     * Public Mutating Functions *
+     *****************************/
+
+    /// @notice Finalize batch without proof, see the comments of {ScrollChain-finalizeBatchWithProof}.
+    function finalizeBatch(
+        bytes calldata _batchHeader,
+        bytes32 _prevStateRoot,
+        bytes32 _postStateRoot,
+        bytes32 _withdrawRoot
+    ) external OnlyProver whenNotPaused {
+        if (_prevStateRoot == bytes32(0)) revert ErrorPreviousStateRootIsZero();
+        if (_postStateRoot == bytes32(0)) revert ErrorStateRootIsZero();
+
+        // compute batch hash and verify
+        (uint256 memPtr, bytes32 _batchHash, uint256 _batchIndex, ) = _loadBatchHeader(_batchHeader);
+
+        // verify previous state root.
+        if (finalizedStateRoots[_batchIndex - 1] != _prevStateRoot) revert ErrorIncorrectPreviousStateRoot();
+
+        // avoid duplicated verification
+        if (finalizedStateRoots[_batchIndex] != bytes32(0)) revert ErrorBatchIsAlreadyVerified();
+
+        // check and update lastFinalizedBatchIndex
+        unchecked {
+            if (lastFinalizedBatchIndex + 1 != _batchIndex) revert ErrorIncorrectBatchIndex();
+            lastFinalizedBatchIndex = _batchIndex;
+        }
+
+        // record state root and withdraw root
+        finalizedStateRoots[_batchIndex] = _postStateRoot;
+        withdrawRoots[_batchIndex] = _withdrawRoot;
+
+        // Pop finalized and non-skipped message from L1MessageQueue.
+        _popL1Messages(
+            BatchHeaderV0Codec.getSkippedBitmapPtr(memPtr),
+            BatchHeaderV0Codec.getTotalL1MessagePopped(memPtr),
+            BatchHeaderV0Codec.getL1MessagePopped(memPtr)
+        );
+
+        emit FinalizeBatch(_batchIndex, _batchHash, _postStateRoot, _withdrawRoot);
+    }
+
+    /// @notice Finalize 4844 batch without proof, See the comments of {ScrollChain-finalizeBatchWithProof4844}.
+    function finalizeBatch4844(
+        bytes calldata _batchHeader,
+        bytes32 _prevStateRoot,
+        bytes32 _postStateRoot,
+        bytes32 _withdrawRoot,
+        bytes calldata _blobDataProof
+    ) external OnlyProver whenNotPaused {
+        if (_prevStateRoot == bytes32(0)) revert ErrorPreviousStateRootIsZero();
+        if (_postStateRoot == bytes32(0)) revert ErrorStateRootIsZero();
+
+        // compute batch hash and verify
+        (uint256 memPtr, bytes32 _batchHash, uint256 _batchIndex, ) = _loadBatchHeader(_batchHeader);
+        bytes32 _blobVersionedHash = BatchHeaderV1Codec.getBlobVersionedHash(memPtr);
+
+        // Calls the point evaluation precompile and verifies the output
+        {
+            (bool success, bytes memory data) = POINT_EVALUATION_PRECOMPILE_ADDR.staticcall(
+                abi.encodePacked(_blobVersionedHash, _blobDataProof)
+            );
+            // We verify that the point evaluation precompile call was successful by testing the latter 32 bytes of the
+            // response is equal to BLS_MODULUS as defined in https://eips.ethereum.org/EIPS/eip-4844#point-evaluation-precompile
+            if (!success) revert ErrorCallPointEvaluationPrecompileFailed();
+            (, uint256 result) = abi.decode(data, (uint256, uint256));
+            if (result != BLS_MODULUS) revert ErrorUnexpectedPointEvaluationPrecompileOutput();
+        }
+
+        // verify previous state root.
+        if (finalizedStateRoots[_batchIndex - 1] != _prevStateRoot) revert ErrorIncorrectPreviousStateRoot();
+
+        // avoid duplicated verification
+        if (finalizedStateRoots[_batchIndex] != bytes32(0)) revert ErrorBatchIsAlreadyVerified();
+
+        // check and update lastFinalizedBatchIndex
+        unchecked {
+            if (lastFinalizedBatchIndex + 1 != _batchIndex) revert ErrorIncorrectBatchIndex();
+            lastFinalizedBatchIndex = _batchIndex;
+        }
+
+        // record state root and withdraw root
+        finalizedStateRoots[_batchIndex] = _postStateRoot;
+        withdrawRoots[_batchIndex] = _withdrawRoot;
+
+        // Pop finalized and non-skipped message from L1MessageQueue.
+        _popL1Messages(
+            BatchHeaderV1Codec.getSkippedBitmapPtr(memPtr),
+            BatchHeaderV1Codec.getTotalL1MessagePopped(memPtr),
+            BatchHeaderV1Codec.getL1MessagePopped(memPtr)
+        );
+
+        emit FinalizeBatch(_batchIndex, _batchHash, _postStateRoot, _withdrawRoot);
+    }
+}
diff --git a/src/test/L1GasPriceOracle.t.sol b/src/test/L1GasPriceOracle.t.sol
index d6b4c834..3d845ad9 100644
--- a/src/test/L1GasPriceOracle.t.sol
+++ b/src/test/L1GasPriceOracle.t.sol
@@ -11,8 +11,8 @@ contract L1GasPriceOracleTest is DSTestPlus {
     uint256 private constant PRECISION = 1e9;
     uint256 private constant MAX_OVERHEAD = 30000000 / 16;
     uint256 private constant MAX_SCALAR = 1000 * PRECISION;
-    uint256 private constant MAX_COMMIT_SCALAR = 10 ** 9 * PRECISION;
-    uint256 private constant MAX_BLOB_SCALAR = 10 ** 9 * PRECISION;
+    uint256 private constant MAX_COMMIT_SCALAR = 10**9 * PRECISION;
+    uint256 private constant MAX_BLOB_SCALAR = 10**9 * PRECISION;
 
     L1GasPriceOracle private oracle;
     Whitelist private whitelist;
diff --git a/tsconfig.json b/tsconfig.json
index d77c214c..3b283858 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,6 +7,6 @@
     "outDir": "dist",
     "declaration": true
   },
-  "include": ["./scripts", "integration-test", "./typechain"],
+  "include": ["./scripts", "hardhat-test", "./typechain"],
   "files": ["./hardhat.config.ts", "./circomlib.d.ts"]
 }
diff --git a/yarn.lock b/yarn.lock
index 8373cc0b..bed2aa41 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -986,13 +986,6 @@
   resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364"
   integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==
 
-"@primitivefi/hardhat-dodoc@^0.2.3":
-  version "0.2.3"
-  resolved "https://registry.yarnpkg.com/@primitivefi/hardhat-dodoc/-/hardhat-dodoc-0.2.3.tgz#76aebbfa70de2d6454af29e166b1430583b54c5c"
-  integrity sha512-ver9uHa79LTDTeebOKZ/eOVRL/FP1k0s0x/5Bo/8ZaDdLWFVClKqZyZYVjjW4CJqTPCt8uU9b9p71P2vzH4O9A==
-  dependencies:
-    squirrelly "^8.0.8"
-
 "@resolver-engine/core@^0.3.3":
   version "0.3.3"
   resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967"
@@ -9728,7 +9721,7 @@ sprintf-js@~1.0.2:
   resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
   integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
 
-squirrelly@8.0.8, squirrelly@^8.0.8:
+squirrelly@8.0.8:
   version "8.0.8"
   resolved "https://registry.yarnpkg.com/squirrelly/-/squirrelly-8.0.8.tgz#d6704650b2170b8040d5de5bff9fa69cb62b5e0f"
   integrity sha512-7dyZJ9Gw86MmH0dYLiESsjGOTj6KG8IWToTaqBuB6LwPI+hyNb6mbQaZwrfnAQ4cMDnSWMUvX/zAYDLTSWLk/w==