mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-11 23:18:07 -05:00
Compare commits
3 Commits
v4.1.12
...
commit-bat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8207ebdf3 | ||
|
|
44c7d75544 | ||
|
|
f1073e7d13 |
@@ -374,6 +374,15 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
|
||||
|
||||
// send transaction
|
||||
txID := batch.Hash + "-commit"
|
||||
log.Info(
|
||||
"Sending commitBatch",
|
||||
"batch.Index", batch.Index,
|
||||
"batch.Hash", batch.Hash,
|
||||
"RollupContractAddress", r.cfg.RollupContractAddress,
|
||||
"calldata", common.Bytes2Hex(calldata),
|
||||
"parentBatch.BatchHeader", common.Bytes2Hex(parentBatch.BatchHeader),
|
||||
"batch.BatchHeader", common.Bytes2Hex(batch.BatchHeader),
|
||||
)
|
||||
txHash, err := r.rollupSender.SendTransaction(txID, &r.cfg.RollupContractAddress, big.NewInt(0), calldata, 0)
|
||||
if err != nil {
|
||||
if !errors.Is(err, sender.ErrNoAvailableAccount) && !errors.Is(err, sender.ErrFullPending) {
|
||||
@@ -496,6 +505,25 @@ func (r *Layer2Relayer) ProcessCommittedBatches() {
|
||||
success = true
|
||||
r.processingFinalization.Store(txID, hash)
|
||||
|
||||
case types.ProvingTaskFailed:
|
||||
// We were unable to prove this batch. There are two possibilities:
|
||||
// (a) Prover bug. In this case, we should fix and redeploy the prover.
|
||||
// In the meantime, we continue to commit batches to L1 as well as
|
||||
// proposing and proving chunks and batches.
|
||||
// (b) Unprovable batch, e.g. proof overflow. In this case we need to
|
||||
// stop the ledger, fix the limit, revert all the violating blocks,
|
||||
// chunks and batches and all subsequent ones, and resume, i.e. this
|
||||
// case requires manual resolution.
|
||||
log.Error(
|
||||
"batch proving failed",
|
||||
"Index", batch.Index,
|
||||
"Hash", batch.Hash,
|
||||
"ProverAssignedAt", batch.ProverAssignedAt,
|
||||
"ProvedAt", batch.ProvedAt,
|
||||
"ProofTimeSec", batch.ProofTimeSec,
|
||||
)
|
||||
return
|
||||
|
||||
default:
|
||||
log.Error("encounter unreachable case in ProcessCommittedBatches", "proving status", status)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
var tag = "v4.1.12"
|
||||
var tag = "v4.1.13"
|
||||
|
||||
var commit = func() string {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
|
||||
@@ -533,7 +533,7 @@ Emitted when some ERC1155 token is refunded.
|
||||
### UpdateTokenMapping
|
||||
|
||||
```solidity
|
||||
event UpdateTokenMapping(address _l1Token, address _l2Token)
|
||||
event UpdateTokenMapping(address indexed l1Token, address indexed oldL2Token, address indexed newL2Token)
|
||||
```
|
||||
|
||||
Emitted when token mapping for ERC1155 token is updated.
|
||||
@@ -544,8 +544,9 @@ Emitted when token mapping for ERC1155 token is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _l1Token | address | The address of ERC1155 token on layer 1. |
|
||||
| _l2Token | address | The address of corresponding ERC1155 token on layer 2. |
|
||||
| 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. |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ Emitted when some ERC721 token is refunded.
|
||||
### UpdateTokenMapping
|
||||
|
||||
```solidity
|
||||
event UpdateTokenMapping(address _l1Token, address _l2Token)
|
||||
event UpdateTokenMapping(address indexed l1Token, address indexed oldL2Token, address indexed newL2Token)
|
||||
```
|
||||
|
||||
Emitted when token mapping for ERC721 token is updated.
|
||||
@@ -483,8 +483,9 @@ Emitted when token mapping for ERC721 token is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _l1Token | address | The address of ERC721 token on layer 1. |
|
||||
| _l2Token | address | The address of corresponding ERC721 token on layer 2. |
|
||||
| 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. |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ Request ERC20 token transfer from users to gateways.
|
||||
### setDefaultERC20Gateway
|
||||
|
||||
```solidity
|
||||
function setDefaultERC20Gateway(address _defaultERC20Gateway) external nonpayable
|
||||
function setDefaultERC20Gateway(address _newDefaultERC20Gateway) external nonpayable
|
||||
```
|
||||
|
||||
Update the address of default ERC20 gateway contract.
|
||||
@@ -361,7 +361,7 @@ Update the address of default ERC20 gateway contract.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _defaultERC20Gateway | address | The address to update. |
|
||||
| _newDefaultERC20Gateway | address | undefined |
|
||||
|
||||
### setERC20Gateway
|
||||
|
||||
@@ -383,7 +383,7 @@ Update the mapping from token address to gateway address.
|
||||
### setETHGateway
|
||||
|
||||
```solidity
|
||||
function setETHGateway(address _ethGateway) external nonpayable
|
||||
function setETHGateway(address _newEthGateway) external nonpayable
|
||||
```
|
||||
|
||||
Update the address of ETH gateway contract.
|
||||
@@ -394,7 +394,7 @@ Update the address of ETH gateway contract.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _ethGateway | address | The address to update. |
|
||||
| _newEthGateway | address | undefined |
|
||||
|
||||
### transferOwnership
|
||||
|
||||
@@ -567,7 +567,7 @@ Emitted when some ETH is refunded.
|
||||
### SetDefaultERC20Gateway
|
||||
|
||||
```solidity
|
||||
event SetDefaultERC20Gateway(address indexed defaultERC20Gateway)
|
||||
event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway)
|
||||
```
|
||||
|
||||
Emitted when the address of default ERC20 Gateway is updated.
|
||||
@@ -578,12 +578,13 @@ Emitted when the address of default ERC20 Gateway is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| defaultERC20Gateway `indexed` | address | undefined |
|
||||
| oldDefaultERC20Gateway `indexed` | address | undefined |
|
||||
| newDefaultERC20Gateway `indexed` | address | undefined |
|
||||
|
||||
### SetERC20Gateway
|
||||
|
||||
```solidity
|
||||
event SetERC20Gateway(address indexed token, address indexed gateway)
|
||||
event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway)
|
||||
```
|
||||
|
||||
Emitted when the `gateway` for `token` is updated.
|
||||
@@ -595,12 +596,13 @@ Emitted when the `gateway` for `token` is updated.
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| token `indexed` | address | undefined |
|
||||
| gateway `indexed` | address | undefined |
|
||||
| oldGateway `indexed` | address | undefined |
|
||||
| newGateway `indexed` | address | undefined |
|
||||
|
||||
### SetETHGateway
|
||||
|
||||
```solidity
|
||||
event SetETHGateway(address indexed ethGateway)
|
||||
event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway)
|
||||
```
|
||||
|
||||
Emitted when the address of ETH Gateway is updated.
|
||||
@@ -611,7 +613,8 @@ Emitted when the address of ETH Gateway is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| ethGateway `indexed` | address | undefined |
|
||||
| oldETHGateway `indexed` | address | undefined |
|
||||
| newEthGateway `indexed` | address | undefined |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -423,7 +423,7 @@ Update fee vault contract.
|
||||
### updateMaxReplayTimes
|
||||
|
||||
```solidity
|
||||
function updateMaxReplayTimes(uint256 _maxReplayTimes) external nonpayable
|
||||
function updateMaxReplayTimes(uint256 _newMaxReplayTimes) external nonpayable
|
||||
```
|
||||
|
||||
Update max replay times.
|
||||
@@ -434,7 +434,7 @@ Update max replay times.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _maxReplayTimes | uint256 | The new max replay times. |
|
||||
| _newMaxReplayTimes | uint256 | The new max replay times. |
|
||||
|
||||
### xDomainMessageSender
|
||||
|
||||
@@ -595,7 +595,7 @@ Emitted when owner updates fee vault contract.
|
||||
### UpdateMaxReplayTimes
|
||||
|
||||
```solidity
|
||||
event UpdateMaxReplayTimes(uint256 maxReplayTimes)
|
||||
event UpdateMaxReplayTimes(uint256 oldMaxReplayTimes, uint256 newMaxReplayTimes)
|
||||
```
|
||||
|
||||
Emitted when the maximum number of times each message can be replayed is updated.
|
||||
@@ -606,7 +606,8 @@ Emitted when the maximum number of times each message can be replayed is updated
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| maxReplayTimes | uint256 | undefined |
|
||||
| oldMaxReplayTimes | uint256 | undefined |
|
||||
| newMaxReplayTimes | uint256 | undefined |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -458,7 +458,7 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn
|
||||
### UpdateTokenMapping
|
||||
|
||||
```solidity
|
||||
event UpdateTokenMapping(address _l2Token, address _l1Token)
|
||||
event UpdateTokenMapping(address indexed l2Token, address indexed oldL1Token, address indexed newL1Token)
|
||||
```
|
||||
|
||||
Emitted when token mapping for ERC1155 token is updated.
|
||||
@@ -469,8 +469,9 @@ Emitted when token mapping for ERC1155 token is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _l2Token | address | The address of corresponding ERC1155 token on layer 2. |
|
||||
| _l1Token | address | The address of ERC1155 token on layer 1. |
|
||||
| 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
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn
|
||||
### UpdateTokenMapping
|
||||
|
||||
```solidity
|
||||
event UpdateTokenMapping(address _l2Token, address _l1Token)
|
||||
event UpdateTokenMapping(address indexed l2Token, address indexed oldL1Token, address indexed newL1Token)
|
||||
```
|
||||
|
||||
Emitted when token mapping for ERC721 token is updated.
|
||||
@@ -411,8 +411,9 @@ Emitted when token mapping for ERC721 token is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _l2Token | address | The address of corresponding ERC721 token on layer 2. |
|
||||
| _l1Token | address | The address of ERC721 token on layer 1. |
|
||||
| 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
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ function renounceOwnership() external nonpayable
|
||||
### setDefaultERC20Gateway
|
||||
|
||||
```solidity
|
||||
function setDefaultERC20Gateway(address _defaultERC20Gateway) external nonpayable
|
||||
function setDefaultERC20Gateway(address _newDefaultERC20Gateway) external nonpayable
|
||||
```
|
||||
|
||||
Update the address of default ERC20 gateway contract.
|
||||
@@ -231,7 +231,7 @@ Update the address of default ERC20 gateway contract.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _defaultERC20Gateway | address | The address to update. |
|
||||
| _newDefaultERC20Gateway | address | The address to update. |
|
||||
|
||||
### setERC20Gateway
|
||||
|
||||
@@ -253,7 +253,7 @@ Update the mapping from token address to gateway address.
|
||||
### setETHGateway
|
||||
|
||||
```solidity
|
||||
function setETHGateway(address _ethGateway) external nonpayable
|
||||
function setETHGateway(address _newEthGateway) external nonpayable
|
||||
```
|
||||
|
||||
Update the address of ETH gateway contract.
|
||||
@@ -264,7 +264,7 @@ Update the address of ETH gateway contract.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _ethGateway | address | The address to update. |
|
||||
| _newEthGateway | address | The address to update. |
|
||||
|
||||
### transferOwnership
|
||||
|
||||
@@ -473,7 +473,7 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn
|
||||
### SetDefaultERC20Gateway
|
||||
|
||||
```solidity
|
||||
event SetDefaultERC20Gateway(address indexed defaultERC20Gateway)
|
||||
event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway)
|
||||
```
|
||||
|
||||
Emitted when the address of default ERC20 Gateway is updated.
|
||||
@@ -484,12 +484,13 @@ Emitted when the address of default ERC20 Gateway is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| defaultERC20Gateway `indexed` | address | undefined |
|
||||
| oldDefaultERC20Gateway `indexed` | address | undefined |
|
||||
| newDefaultERC20Gateway `indexed` | address | undefined |
|
||||
|
||||
### SetERC20Gateway
|
||||
|
||||
```solidity
|
||||
event SetERC20Gateway(address indexed token, address indexed gateway)
|
||||
event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway)
|
||||
```
|
||||
|
||||
Emitted when the `gateway` for `token` is updated.
|
||||
@@ -501,12 +502,13 @@ Emitted when the `gateway` for `token` is updated.
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| token `indexed` | address | undefined |
|
||||
| gateway `indexed` | address | undefined |
|
||||
| oldGateway `indexed` | address | undefined |
|
||||
| newGateway `indexed` | address | undefined |
|
||||
|
||||
### SetETHGateway
|
||||
|
||||
```solidity
|
||||
event SetETHGateway(address indexed ethGateway)
|
||||
event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway)
|
||||
```
|
||||
|
||||
Emitted when the address of ETH Gateway is updated.
|
||||
@@ -517,7 +519,8 @@ Emitted when the address of ETH Gateway is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| ethGateway `indexed` | address | undefined |
|
||||
| oldETHGateway `indexed` | address | undefined |
|
||||
| newEthGateway `indexed` | address | undefined |
|
||||
|
||||
### WithdrawERC20
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ Update fee vault contract.
|
||||
### updateMaxFailedExecutionTimes
|
||||
|
||||
```solidity
|
||||
function updateMaxFailedExecutionTimes(uint256 _maxFailedExecutionTimes) external nonpayable
|
||||
function updateMaxFailedExecutionTimes(uint256 _newMaxFailedExecutionTimes) external nonpayable
|
||||
```
|
||||
|
||||
Update max failed execution times.
|
||||
@@ -326,7 +326,7 @@ Update max failed execution times.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| _maxFailedExecutionTimes | uint256 | The new max failed execution times. |
|
||||
| _newMaxFailedExecutionTimes | uint256 | The new max failed execution times. |
|
||||
|
||||
### xDomainMessageSender
|
||||
|
||||
@@ -487,7 +487,7 @@ Emitted when owner updates fee vault contract.
|
||||
### UpdateMaxFailedExecutionTimes
|
||||
|
||||
```solidity
|
||||
event UpdateMaxFailedExecutionTimes(uint256 maxFailedExecutionTimes)
|
||||
event UpdateMaxFailedExecutionTimes(uint256 oldMaxFailedExecutionTimes, uint256 newMaxFailedExecutionTimes)
|
||||
```
|
||||
|
||||
Emitted when the maximum number of times each message can fail in L2 is updated.
|
||||
@@ -498,7 +498,8 @@ Emitted when the maximum number of times each message can fail in L2 is updated.
|
||||
|
||||
| Name | Type | Description |
|
||||
|---|---|---|
|
||||
| maxFailedExecutionTimes | uint256 | The new maximum number of times each message can fail in L2. |
|
||||
| oldMaxFailedExecutionTimes | uint256 | undefined |
|
||||
| newMaxFailedExecutionTimes | uint256 | undefined |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,9 @@ interface IL1ScrollMessenger is IScrollMessenger {
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when the maximum number of times each message can be replayed is updated.
|
||||
/// @param maxReplayTimes The new maximum number of times each message can be replayed.
|
||||
event UpdateMaxReplayTimes(uint256 maxReplayTimes);
|
||||
/// @param oldMaxReplayTimes The old maximum number of times each message can be replayed.
|
||||
/// @param newMaxReplayTimes The new maximum number of times each message can be replayed.
|
||||
event UpdateMaxReplayTimes(uint256 oldMaxReplayTimes, uint256 newMaxReplayTimes);
|
||||
|
||||
/***********
|
||||
* Structs *
|
||||
|
||||
@@ -293,11 +293,12 @@ contract L1ScrollMessenger is ScrollMessengerBase, IL1ScrollMessenger {
|
||||
|
||||
/// @notice Update max replay times.
|
||||
/// @dev This function can only called by contract owner.
|
||||
/// @param _maxReplayTimes The new max replay times.
|
||||
function updateMaxReplayTimes(uint256 _maxReplayTimes) external onlyOwner {
|
||||
maxReplayTimes = _maxReplayTimes;
|
||||
/// @param _newMaxReplayTimes The new max replay times.
|
||||
function updateMaxReplayTimes(uint256 _newMaxReplayTimes) external onlyOwner {
|
||||
uint256 _oldMaxReplayTimes = maxReplayTimes;
|
||||
maxReplayTimes = _newMaxReplayTimes;
|
||||
|
||||
emit UpdateMaxReplayTimes(_maxReplayTimes);
|
||||
emit UpdateMaxReplayTimes(_oldMaxReplayTimes, _newMaxReplayTimes);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -11,17 +11,20 @@ interface IL1GatewayRouter is IL1ETHGateway, IL1ERC20Gateway {
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when the address of ETH Gateway is updated.
|
||||
/// @param ethGateway The address of new ETH Gateway.
|
||||
event SetETHGateway(address indexed ethGateway);
|
||||
/// @param oldETHGateway The address of the old ETH Gateway.
|
||||
/// @param newEthGateway The address of the new ETH Gateway.
|
||||
event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway);
|
||||
|
||||
/// @notice Emitted when the address of default ERC20 Gateway is updated.
|
||||
/// @param defaultERC20Gateway The address of new default ERC20 Gateway.
|
||||
event SetDefaultERC20Gateway(address indexed defaultERC20Gateway);
|
||||
/// @param oldDefaultERC20Gateway The address of the old default ERC20 Gateway.
|
||||
/// @param newDefaultERC20Gateway The address of the new default ERC20 Gateway.
|
||||
event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway);
|
||||
|
||||
/// @notice Emitted when the `gateway` for `token` is updated.
|
||||
/// @param token The address of token updated.
|
||||
/// @param gateway The corresponding address of gateway updated.
|
||||
event SetERC20Gateway(address indexed token, address indexed gateway);
|
||||
/// @param oldGateway The corresponding address of the old gateway.
|
||||
/// @param newGateway The corresponding address of the new gateway.
|
||||
event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway);
|
||||
|
||||
/*************************
|
||||
* Public View Functions *
|
||||
|
||||
@@ -25,9 +25,10 @@ contract L1CustomERC20Gateway is L1ERC20Gateway {
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when token mapping for ERC20 token is updated.
|
||||
/// @param _l1Token The address of ERC20 token on layer 1.
|
||||
/// @param _l2Token The address of corresponding ERC20 token on layer 2.
|
||||
event UpdateTokenMapping(address _l1Token, address _l2Token);
|
||||
/// @param l1Token The address of ERC20 token in layer 1.
|
||||
/// @param oldL2Token The address of the old corresponding ERC20 token in layer 2.
|
||||
/// @param newL2Token The address of the new corresponding ERC20 token in layer 2.
|
||||
event UpdateTokenMapping(address indexed l1Token, address indexed oldL2Token, address indexed newL2Token);
|
||||
|
||||
/*************
|
||||
* Variables *
|
||||
@@ -77,9 +78,10 @@ contract L1CustomERC20Gateway is L1ERC20Gateway {
|
||||
function updateTokenMapping(address _l1Token, address _l2Token) external onlyOwner {
|
||||
require(_l2Token != address(0), "token address cannot be 0");
|
||||
|
||||
address _oldL2Token = tokenMapping[_l1Token];
|
||||
tokenMapping[_l1Token] = _l2Token;
|
||||
|
||||
emit UpdateTokenMapping(_l1Token, _l2Token);
|
||||
emit UpdateTokenMapping(_l1Token, _oldL2Token, _l2Token);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -25,9 +25,10 @@ contract L1ERC1155Gateway is ERC1155HolderUpgradeable, ScrollGatewayBase, IL1ERC
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when token mapping for ERC1155 token is updated.
|
||||
/// @param _l1Token The address of ERC1155 token on layer 1.
|
||||
/// @param _l2Token The address of corresponding ERC1155 token on layer 2.
|
||||
event UpdateTokenMapping(address _l1Token, address _l2Token);
|
||||
/// @param l1Token The address of ERC1155 token in layer 1.
|
||||
/// @param oldL2Token The address of the old corresponding ERC1155 token in layer 2.
|
||||
/// @param newL2Token The address of the new corresponding ERC1155 token in layer 2.
|
||||
event UpdateTokenMapping(address indexed l1Token, address indexed oldL2Token, address indexed newL2Token);
|
||||
|
||||
/*************
|
||||
* Variables *
|
||||
@@ -169,9 +170,10 @@ contract L1ERC1155Gateway is ERC1155HolderUpgradeable, ScrollGatewayBase, IL1ERC
|
||||
function updateTokenMapping(address _l1Token, address _l2Token) external onlyOwner {
|
||||
require(_l2Token != address(0), "token address cannot be 0");
|
||||
|
||||
address _oldL2Token = tokenMapping[_l1Token];
|
||||
tokenMapping[_l1Token] = _l2Token;
|
||||
|
||||
emit UpdateTokenMapping(_l1Token, _l2Token);
|
||||
emit UpdateTokenMapping(_l1Token, _oldL2Token, _l2Token);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -25,9 +25,10 @@ contract L1ERC721Gateway is ERC721HolderUpgradeable, ScrollGatewayBase, IL1ERC72
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when token mapping for ERC721 token is updated.
|
||||
/// @param _l1Token The address of ERC721 token on layer 1.
|
||||
/// @param _l2Token The address of corresponding ERC721 token on layer 2.
|
||||
event UpdateTokenMapping(address _l1Token, address _l2Token);
|
||||
/// @param l1Token The address of ERC721 token in layer 1.
|
||||
/// @param oldL2Token The address of the old corresponding ERC721 token in layer 2.
|
||||
/// @param newL2Token The address of the new corresponding ERC721 token in layer 2.
|
||||
event UpdateTokenMapping(address indexed l1Token, address indexed oldL2Token, address indexed newL2Token);
|
||||
|
||||
/*************
|
||||
* Variables *
|
||||
@@ -165,9 +166,10 @@ contract L1ERC721Gateway is ERC721HolderUpgradeable, ScrollGatewayBase, IL1ERC72
|
||||
function updateTokenMapping(address _l1Token, address _l2Token) external onlyOwner {
|
||||
require(_l2Token != address(0), "token address cannot be 0");
|
||||
|
||||
address _oldL2Token = tokenMapping[_l1Token];
|
||||
tokenMapping[_l1Token] = _l2Token;
|
||||
|
||||
emit UpdateTokenMapping(_l1Token, _l2Token);
|
||||
emit UpdateTokenMapping(_l1Token, _oldL2Token, _l2Token);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -66,13 +66,13 @@ contract L1GatewayRouter is OwnableUpgradeable, IL1GatewayRouter {
|
||||
// it can be zero during initialization
|
||||
if (_defaultERC20Gateway != address(0)) {
|
||||
defaultERC20Gateway = _defaultERC20Gateway;
|
||||
emit SetDefaultERC20Gateway(_defaultERC20Gateway);
|
||||
emit SetDefaultERC20Gateway(address(0), _defaultERC20Gateway);
|
||||
}
|
||||
|
||||
// it can be zero during initialization
|
||||
if (_ethGateway != address(0)) {
|
||||
ethGateway = _ethGateway;
|
||||
emit SetETHGateway(_ethGateway);
|
||||
emit SetETHGateway(address(0), _ethGateway);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,17 +223,19 @@ contract L1GatewayRouter is OwnableUpgradeable, IL1GatewayRouter {
|
||||
************************/
|
||||
|
||||
/// @inheritdoc IL1GatewayRouter
|
||||
function setETHGateway(address _ethGateway) external onlyOwner {
|
||||
ethGateway = _ethGateway;
|
||||
function setETHGateway(address _newEthGateway) external onlyOwner {
|
||||
address _oldETHGateway = ethGateway;
|
||||
ethGateway = _newEthGateway;
|
||||
|
||||
emit SetETHGateway(_ethGateway);
|
||||
emit SetETHGateway(_oldETHGateway, _newEthGateway);
|
||||
}
|
||||
|
||||
/// @inheritdoc IL1GatewayRouter
|
||||
function setDefaultERC20Gateway(address _defaultERC20Gateway) external onlyOwner {
|
||||
defaultERC20Gateway = _defaultERC20Gateway;
|
||||
function setDefaultERC20Gateway(address _newDefaultERC20Gateway) external onlyOwner {
|
||||
address _oldDefaultERC20Gateway = defaultERC20Gateway;
|
||||
defaultERC20Gateway = _newDefaultERC20Gateway;
|
||||
|
||||
emit SetDefaultERC20Gateway(_defaultERC20Gateway);
|
||||
emit SetDefaultERC20Gateway(_oldDefaultERC20Gateway, _newDefaultERC20Gateway);
|
||||
}
|
||||
|
||||
/// @inheritdoc IL1GatewayRouter
|
||||
@@ -241,9 +243,10 @@ contract L1GatewayRouter is OwnableUpgradeable, IL1GatewayRouter {
|
||||
require(_tokens.length == _gateways.length, "length mismatch");
|
||||
|
||||
for (uint256 i = 0; i < _tokens.length; i++) {
|
||||
address _oldGateway = ERC20Gateway[_tokens[i]];
|
||||
ERC20Gateway[_tokens[i]] = _gateways[i];
|
||||
|
||||
emit SetERC20Gateway(_tokens[i], _gateways[i]);
|
||||
emit SetERC20Gateway(_tokens[i], _oldGateway, _gateways[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ contract L1MessageQueue is OwnableUpgradeable, IL1MessageQueue {
|
||||
/// @notice Emitted when owner updates gas oracle contract.
|
||||
/// @param _oldGasOracle The address of old gas oracle contract.
|
||||
/// @param _newGasOracle The address of new gas oracle contract.
|
||||
event UpdateGasOracle(address _oldGasOracle, address _newGasOracle);
|
||||
event UpdateGasOracle(address indexed _oldGasOracle, address indexed _newGasOracle);
|
||||
|
||||
/// @notice Emitted when owner updates EnforcedTxGateway contract.
|
||||
/// @param _oldGateway The address of old EnforcedTxGateway contract.
|
||||
/// @param _newGateway The address of new EnforcedTxGateway contract.
|
||||
event UpdateEnforcedTxGateway(address _oldGateway, address _newGateway);
|
||||
event UpdateEnforcedTxGateway(address indexed _oldGateway, address indexed _newGateway);
|
||||
|
||||
/// @notice Emitted when owner updates max gas limit.
|
||||
/// @param _oldMaxGasLimit The old max gas limit.
|
||||
|
||||
@@ -19,8 +19,9 @@ contract L2GasPriceOracle is OwnableUpgradeable, IL2GasPriceOracle {
|
||||
event UpdateWhitelist(address _oldWhitelist, address _newWhitelist);
|
||||
|
||||
/// @notice Emitted when current l2 base fee is updated.
|
||||
/// @param l2BaseFee The current l2 base fee updated.
|
||||
event L2BaseFeeUpdated(uint256 l2BaseFee);
|
||||
/// @param oldL2BaseFee The original l2 base fee before update.
|
||||
/// @param newL2BaseFee The current l2 base fee updated.
|
||||
event L2BaseFeeUpdated(uint256 oldL2BaseFee, uint256 newL2BaseFee);
|
||||
|
||||
/// @notice Emitted when intrinsic params are updated.
|
||||
/// @param txGas The intrinsic gas for transaction.
|
||||
@@ -130,13 +131,14 @@ contract L2GasPriceOracle is OwnableUpgradeable, IL2GasPriceOracle {
|
||||
}
|
||||
|
||||
/// @notice Allows the owner to modify the l2 base fee.
|
||||
/// @param _l2BaseFee The new l2 base fee.
|
||||
function setL2BaseFee(uint256 _l2BaseFee) external {
|
||||
/// @param _newL2BaseFee The new l2 base fee.
|
||||
function setL2BaseFee(uint256 _newL2BaseFee) external {
|
||||
require(whitelist.isSenderAllowed(msg.sender), "Not whitelisted sender");
|
||||
|
||||
l2BaseFee = _l2BaseFee;
|
||||
uint256 _oldL2BaseFee = l2BaseFee;
|
||||
l2BaseFee = _newL2BaseFee;
|
||||
|
||||
emit L2BaseFeeUpdated(_l2BaseFee);
|
||||
emit L2BaseFeeUpdated(_oldL2BaseFee, _newL2BaseFee);
|
||||
}
|
||||
|
||||
/************************
|
||||
|
||||
@@ -34,7 +34,7 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain {
|
||||
/// @notice Emitted when the address of rollup verifier is updated.
|
||||
/// @param oldVerifier The address of old rollup verifier.
|
||||
/// @param newVerifier The address of new rollup verifier.
|
||||
event UpdateVerifier(address oldVerifier, address newVerifier);
|
||||
event UpdateVerifier(address indexed oldVerifier, address indexed newVerifier);
|
||||
|
||||
/// @notice Emitted when the value of `maxNumL2TxInChunk` is updated.
|
||||
/// @param oldMaxNumL2TxInChunk The old value of `maxNumL2TxInChunk`.
|
||||
|
||||
@@ -5,6 +5,15 @@ pragma solidity ^0.8.16;
|
||||
import {IScrollMessenger} from "../libraries/IScrollMessenger.sol";
|
||||
|
||||
interface IL2ScrollMessenger is IScrollMessenger {
|
||||
/**********
|
||||
* Events *
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when the maximum number of times each message can fail in L2 is updated.
|
||||
/// @param oldMaxFailedExecutionTimes The old maximum number of times each message can fail in L2.
|
||||
/// @param newMaxFailedExecutionTimes The new maximum number of times each message can fail in L2.
|
||||
event UpdateMaxFailedExecutionTimes(uint256 oldMaxFailedExecutionTimes, uint256 newMaxFailedExecutionTimes);
|
||||
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
@@ -23,14 +23,6 @@ import {ScrollMessengerBase} from "../libraries/ScrollMessengerBase.sol";
|
||||
/// @dev 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.
|
||||
contract L2ScrollMessenger is ScrollMessengerBase, IL2ScrollMessenger {
|
||||
/**********
|
||||
* Events *
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when the maximum number of times each message can fail in L2 is updated.
|
||||
/// @param maxFailedExecutionTimes The new maximum number of times each message can fail in L2.
|
||||
event UpdateMaxFailedExecutionTimes(uint256 maxFailedExecutionTimes);
|
||||
|
||||
/*************
|
||||
* Constants *
|
||||
*************/
|
||||
@@ -119,13 +111,14 @@ contract L2ScrollMessenger is ScrollMessengerBase, IL2ScrollMessenger {
|
||||
|
||||
/// @notice Update max failed execution times.
|
||||
/// @dev This function can only called by contract owner.
|
||||
/// @param _maxFailedExecutionTimes The new max failed execution times.
|
||||
function updateMaxFailedExecutionTimes(uint256 _maxFailedExecutionTimes) external onlyOwner {
|
||||
require(_maxFailedExecutionTimes > 0, "maxFailedExecutionTimes cannot be zero");
|
||||
/// @param _newMaxFailedExecutionTimes The new max failed execution times.
|
||||
function updateMaxFailedExecutionTimes(uint256 _newMaxFailedExecutionTimes) external onlyOwner {
|
||||
require(_newMaxFailedExecutionTimes > 0, "maxFailedExecutionTimes cannot be zero");
|
||||
|
||||
maxFailedExecutionTimes = _maxFailedExecutionTimes;
|
||||
uint256 _oldMaxFailedExecutionTimes = maxFailedExecutionTimes;
|
||||
maxFailedExecutionTimes = _newMaxFailedExecutionTimes;
|
||||
|
||||
emit UpdateMaxFailedExecutionTimes(_maxFailedExecutionTimes);
|
||||
emit UpdateMaxFailedExecutionTimes(_oldMaxFailedExecutionTimes, _newMaxFailedExecutionTimes);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -11,15 +11,18 @@ interface IL2GatewayRouter is IL2ETHGateway, IL2ERC20Gateway {
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when the address of ETH Gateway is updated.
|
||||
/// @param ethGateway The address of new ETH Gateway.
|
||||
event SetETHGateway(address indexed ethGateway);
|
||||
/// @param oldETHGateway The address of the old ETH Gateway.
|
||||
/// @param newEthGateway The address of the new ETH Gateway.
|
||||
event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway);
|
||||
|
||||
/// @notice Emitted when the address of default ERC20 Gateway is updated.
|
||||
/// @param defaultERC20Gateway The address of new default ERC20 Gateway.
|
||||
event SetDefaultERC20Gateway(address indexed defaultERC20Gateway);
|
||||
/// @param oldDefaultERC20Gateway The address of the old default ERC20 Gateway.
|
||||
/// @param newDefaultERC20Gateway The address of the new default ERC20 Gateway.
|
||||
event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway);
|
||||
|
||||
/// @notice Emitted when the `gateway` for `token` is updated.
|
||||
/// @param token The address of token updated.
|
||||
/// @param gateway The corresponding address of gateway updated.
|
||||
event SetERC20Gateway(address indexed token, address indexed gateway);
|
||||
/// @param oldGateway The corresponding address of the old gateway.
|
||||
/// @param newGateway The corresponding address of the new gateway.
|
||||
event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,10 @@ contract L2CustomERC20Gateway is L2ERC20Gateway {
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when token mapping for ERC20 token is updated.
|
||||
/// @param _l2Token The address of corresponding ERC20 token on layer 2.
|
||||
/// @param _l1Token The address of ERC20 token on layer 1.
|
||||
event UpdateTokenMapping(address _l2Token, address _l1Token);
|
||||
/// @param l2Token The address of corresponding ERC20 token in layer 2.
|
||||
/// @param oldL1Token The address of the old corresponding ERC20 token in layer 1.
|
||||
/// @param newL1Token The address of the new corresponding ERC20 token in layer 1.
|
||||
event UpdateTokenMapping(address indexed l2Token, address indexed oldL1Token, address indexed newL1Token);
|
||||
|
||||
/*************
|
||||
* Variables *
|
||||
@@ -96,9 +97,10 @@ contract L2CustomERC20Gateway is L2ERC20Gateway {
|
||||
function updateTokenMapping(address _l2Token, address _l1Token) external onlyOwner {
|
||||
require(_l1Token != address(0), "token address cannot be 0");
|
||||
|
||||
address _oldL1Token = tokenMapping[_l2Token];
|
||||
tokenMapping[_l2Token] = _l1Token;
|
||||
|
||||
emit UpdateTokenMapping(_l2Token, _l1Token);
|
||||
emit UpdateTokenMapping(_l2Token, _oldL1Token, _l1Token);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -23,9 +23,10 @@ contract L2ERC1155Gateway is ERC1155HolderUpgradeable, ScrollGatewayBase, IL2ERC
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when token mapping for ERC1155 token is updated.
|
||||
/// @param _l2Token The address of corresponding ERC1155 token on layer 2.
|
||||
/// @param _l1Token The address of ERC1155 token on layer 1.
|
||||
event UpdateTokenMapping(address _l2Token, address _l1Token);
|
||||
/// @param l2Token The address of corresponding ERC1155 token in layer 2.
|
||||
/// @param oldL1Token The address of the old corresponding ERC1155 token in layer 1.
|
||||
/// @param newL1Token The address of the new corresponding ERC1155 token in layer 1.
|
||||
event UpdateTokenMapping(address indexed l2Token, address indexed oldL1Token, address indexed newL1Token);
|
||||
|
||||
/*************
|
||||
* Variables *
|
||||
@@ -139,9 +140,10 @@ contract L2ERC1155Gateway is ERC1155HolderUpgradeable, ScrollGatewayBase, IL2ERC
|
||||
function updateTokenMapping(address _l2Token, address _l1Token) external onlyOwner {
|
||||
require(_l1Token != address(0), "token address cannot be 0");
|
||||
|
||||
address _oldL1Token = tokenMapping[_l2Token];
|
||||
tokenMapping[_l2Token] = _l1Token;
|
||||
|
||||
emit UpdateTokenMapping(_l2Token, _l1Token);
|
||||
emit UpdateTokenMapping(_l2Token, _oldL1Token, _l1Token);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -23,9 +23,10 @@ contract L2ERC721Gateway is ERC721HolderUpgradeable, ScrollGatewayBase, IL2ERC72
|
||||
**********/
|
||||
|
||||
/// @notice Emitted when token mapping for ERC721 token is updated.
|
||||
/// @param _l2Token The address of corresponding ERC721 token on layer 2.
|
||||
/// @param _l1Token The address of ERC721 token on layer 1.
|
||||
event UpdateTokenMapping(address _l2Token, address _l1Token);
|
||||
/// @param l2Token The address of corresponding ERC721 token in layer 2.
|
||||
/// @param oldL1Token The address of the old corresponding ERC721 token in layer 1.
|
||||
/// @param newL1Token The address of the new corresponding ERC721 token in layer 1.
|
||||
event UpdateTokenMapping(address indexed l2Token, address indexed oldL1Token, address indexed newL1Token);
|
||||
|
||||
/*************
|
||||
* Variables *
|
||||
@@ -134,9 +135,10 @@ contract L2ERC721Gateway is ERC721HolderUpgradeable, ScrollGatewayBase, IL2ERC72
|
||||
function updateTokenMapping(address _l2Token, address _l1Token) external onlyOwner {
|
||||
require(_l1Token != address(0), "token address cannot be 0");
|
||||
|
||||
address _oldL1Token = tokenMapping[_l2Token];
|
||||
tokenMapping[_l2Token] = _l1Token;
|
||||
|
||||
emit UpdateTokenMapping(_l2Token, _l1Token);
|
||||
emit UpdateTokenMapping(_l2Token, _oldL1Token, _l1Token);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -42,13 +42,13 @@ contract L2GatewayRouter is OwnableUpgradeable, IL2GatewayRouter {
|
||||
// it can be zero during initialization
|
||||
if (_defaultERC20Gateway != address(0)) {
|
||||
defaultERC20Gateway = _defaultERC20Gateway;
|
||||
emit SetDefaultERC20Gateway(_defaultERC20Gateway);
|
||||
emit SetDefaultERC20Gateway(address(0), _defaultERC20Gateway);
|
||||
}
|
||||
|
||||
// it can be zero during initialization
|
||||
if (_ethGateway != address(0)) {
|
||||
ethGateway = _ethGateway;
|
||||
emit SetETHGateway(_ethGateway);
|
||||
emit SetETHGateway(address(0), _ethGateway);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,20 +179,22 @@ contract L2GatewayRouter is OwnableUpgradeable, IL2GatewayRouter {
|
||||
|
||||
/// @notice Update the address of ETH gateway contract.
|
||||
/// @dev This function should only be called by contract owner.
|
||||
/// @param _ethGateway The address to update.
|
||||
function setETHGateway(address _ethGateway) external onlyOwner {
|
||||
ethGateway = _ethGateway;
|
||||
/// @param _newEthGateway The address to update.
|
||||
function setETHGateway(address _newEthGateway) external onlyOwner {
|
||||
address _oldEthGateway = ethGateway;
|
||||
ethGateway = _newEthGateway;
|
||||
|
||||
emit SetETHGateway(_ethGateway);
|
||||
emit SetETHGateway(_oldEthGateway, _newEthGateway);
|
||||
}
|
||||
|
||||
/// @notice Update the address of default ERC20 gateway contract.
|
||||
/// @dev This function should only be called by contract owner.
|
||||
/// @param _defaultERC20Gateway The address to update.
|
||||
function setDefaultERC20Gateway(address _defaultERC20Gateway) external onlyOwner {
|
||||
defaultERC20Gateway = _defaultERC20Gateway;
|
||||
/// @param _newDefaultERC20Gateway The address to update.
|
||||
function setDefaultERC20Gateway(address _newDefaultERC20Gateway) external onlyOwner {
|
||||
address _oldDefaultERC20Gateway = defaultERC20Gateway;
|
||||
defaultERC20Gateway = _newDefaultERC20Gateway;
|
||||
|
||||
emit SetDefaultERC20Gateway(_defaultERC20Gateway);
|
||||
emit SetDefaultERC20Gateway(_oldDefaultERC20Gateway, _newDefaultERC20Gateway);
|
||||
}
|
||||
|
||||
/// @notice Update the mapping from token address to gateway address.
|
||||
@@ -203,9 +205,10 @@ contract L2GatewayRouter is OwnableUpgradeable, IL2GatewayRouter {
|
||||
require(_tokens.length == _gateways.length, "length mismatch");
|
||||
|
||||
for (uint256 i = 0; i < _tokens.length; i++) {
|
||||
address _oldGateway = ERC20Gateway[_tokens[i]];
|
||||
ERC20Gateway[_tokens[i]] = _gateways[i];
|
||||
|
||||
emit SetERC20Gateway(_tokens[i], _gateways[i]);
|
||||
emit SetERC20Gateway(_tokens[i], _oldGateway, _gateways[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import {TransferReentrantToken} from "./mocks/tokens/TransferReentrantToken.sol"
|
||||
|
||||
contract L1GatewayRouterTest is L1GatewayTestBase {
|
||||
// from L1GatewayRouter
|
||||
event SetETHGateway(address indexed ethGateway);
|
||||
event SetDefaultERC20Gateway(address indexed defaultERC20Gateway);
|
||||
event SetERC20Gateway(address indexed token, address indexed gateway);
|
||||
event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway);
|
||||
event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway);
|
||||
event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway);
|
||||
|
||||
ScrollStandardERC20 private template;
|
||||
ScrollStandardERC20Factory private factory;
|
||||
@@ -94,8 +94,8 @@ contract L1GatewayRouterTest is L1GatewayTestBase {
|
||||
hevm.stopPrank();
|
||||
|
||||
// set by owner, should succeed
|
||||
hevm.expectEmit(true, false, false, true);
|
||||
emit SetDefaultERC20Gateway(address(l1StandardERC20Gateway));
|
||||
hevm.expectEmit(true, true, false, true);
|
||||
emit SetDefaultERC20Gateway(address(0), address(l1StandardERC20Gateway));
|
||||
|
||||
assertEq(address(0), router.getERC20Gateway(address(l1Token)));
|
||||
assertEq(address(0), router.defaultERC20Gateway());
|
||||
@@ -121,8 +121,8 @@ contract L1GatewayRouterTest is L1GatewayTestBase {
|
||||
_tokens[0] = address(l1Token);
|
||||
_gateways[0] = address(l1StandardERC20Gateway);
|
||||
|
||||
hevm.expectEmit(true, true, false, true);
|
||||
emit SetERC20Gateway(address(l1Token), address(l1StandardERC20Gateway));
|
||||
hevm.expectEmit(true, true, true, true);
|
||||
emit SetERC20Gateway(address(l1Token), address(0), address(l1StandardERC20Gateway));
|
||||
|
||||
assertEq(address(0), router.getERC20Gateway(address(l1Token)));
|
||||
router.setERC20Gateway(_tokens, _gateways);
|
||||
|
||||
@@ -16,7 +16,7 @@ import {L1GatewayTestBase} from "./L1GatewayTestBase.t.sol";
|
||||
|
||||
contract L1ScrollMessengerTest is L1GatewayTestBase {
|
||||
event OnDropMessageCalled(bytes);
|
||||
event UpdateMaxReplayTimes(uint256 maxReplayTimes);
|
||||
event UpdateMaxReplayTimes(uint256 oldMaxReplayTimes, uint256 newMaxReplayTimes);
|
||||
|
||||
function setUp() public {
|
||||
L1GatewayTestBase.setUpBase();
|
||||
@@ -159,7 +159,7 @@ contract L1ScrollMessengerTest is L1GatewayTestBase {
|
||||
hevm.stopPrank();
|
||||
|
||||
hevm.expectEmit(false, false, false, true);
|
||||
emit UpdateMaxReplayTimes(_maxReplayTimes);
|
||||
emit UpdateMaxReplayTimes(0, _maxReplayTimes);
|
||||
|
||||
assertEq(l1Messenger.maxReplayTimes(), 0);
|
||||
l1Messenger.updateMaxReplayTimes(_maxReplayTimes);
|
||||
|
||||
@@ -19,10 +19,10 @@ import {ScrollStandardERC20Factory} from "../libraries/token/ScrollStandardERC20
|
||||
import {L2GatewayTestBase} from "./L2GatewayTestBase.t.sol";
|
||||
|
||||
contract L2GatewayRouterTest is L2GatewayTestBase {
|
||||
// from L1GatewayRouter
|
||||
event SetETHGateway(address indexed ethGateway);
|
||||
event SetDefaultERC20Gateway(address indexed defaultERC20Gateway);
|
||||
event SetERC20Gateway(address indexed token, address indexed gateway);
|
||||
// from L2GatewayRouter
|
||||
event SetETHGateway(address indexed oldETHGateway, address indexed newEthGateway);
|
||||
event SetDefaultERC20Gateway(address indexed oldDefaultERC20Gateway, address indexed newDefaultERC20Gateway);
|
||||
event SetERC20Gateway(address indexed token, address indexed oldGateway, address indexed newGateway);
|
||||
|
||||
ScrollStandardERC20 private template;
|
||||
ScrollStandardERC20Factory private factory;
|
||||
@@ -89,8 +89,8 @@ contract L2GatewayRouterTest is L2GatewayTestBase {
|
||||
hevm.stopPrank();
|
||||
|
||||
// set by owner, should succeed
|
||||
hevm.expectEmit(true, false, false, true);
|
||||
emit SetDefaultERC20Gateway(address(l2StandardERC20Gateway));
|
||||
hevm.expectEmit(true, true, false, true);
|
||||
emit SetDefaultERC20Gateway(address(0), address(l2StandardERC20Gateway));
|
||||
|
||||
assertEq(address(0), router.getERC20Gateway(address(l1Token)));
|
||||
assertEq(address(0), router.defaultERC20Gateway());
|
||||
@@ -116,8 +116,8 @@ contract L2GatewayRouterTest is L2GatewayTestBase {
|
||||
_tokens[0] = address(l1Token);
|
||||
_gateways[0] = address(l2StandardERC20Gateway);
|
||||
|
||||
hevm.expectEmit(true, true, false, true);
|
||||
emit SetERC20Gateway(address(l1Token), address(l2StandardERC20Gateway));
|
||||
hevm.expectEmit(true, true, true, true);
|
||||
emit SetERC20Gateway(address(l1Token), address(0), address(l2StandardERC20Gateway));
|
||||
|
||||
assertEq(address(0), router.getERC20Gateway(address(l1Token)));
|
||||
router.setERC20Gateway(_tokens, _gateways);
|
||||
|
||||
@@ -18,7 +18,7 @@ contract ScrollChainTest is DSTestPlus {
|
||||
// from ScrollChain
|
||||
event UpdateSequencer(address indexed account, bool status);
|
||||
event UpdateProver(address indexed account, bool status);
|
||||
event UpdateVerifier(address oldVerifier, address newVerifier);
|
||||
event UpdateVerifier(address indexed oldVerifier, address indexed newVerifier);
|
||||
event UpdateMaxNumL2TxInChunk(uint256 oldMaxNumL2TxInChunk, uint256 newMaxNumL2TxInChunk);
|
||||
|
||||
event CommitBatch(uint256 indexed batchIndex, bytes32 indexed batchHash);
|
||||
@@ -596,7 +596,7 @@ contract ScrollChainTest is DSTestPlus {
|
||||
hevm.stopPrank();
|
||||
|
||||
// change to random operator
|
||||
hevm.expectEmit(false, false, false, true);
|
||||
hevm.expectEmit(true, true, false, true);
|
||||
emit UpdateVerifier(address(verifier), _newVerifier);
|
||||
|
||||
assertEq(rollup.verifier(), address(verifier));
|
||||
|
||||
Reference in New Issue
Block a user