From 55fe16587f2dce68ddaf115217df64df51bca267 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Sun, 17 Mar 2024 02:34:45 +0530 Subject: [PATCH 01/12] #1042 Allow configure db ConnMaxLifetime & ConnMaxIdleTime --- bridge-history-api/conf/config.json | 4 +++- common/database/config.go | 2 ++ common/database/db.go | 4 ++-- common/database/db_test.go | 10 ++++++---- common/docker/docker_app.go | 2 ++ coordinator/conf/config.json | 4 +++- coordinator/internal/config/config_test.go | 4 +++- coordinator/internal/orm/orm_test.go | 10 ++++++---- coordinator/test/api_test.go | 10 ++++++---- database/config.go | 2 ++ database/config.json | 4 +++- database/config_test.go | 4 +++- rollup/conf/config.json | 4 +++- rollup/internal/controller/relayer/relayer_test.go | 10 ++++++---- rollup/internal/controller/sender/sender_test.go | 10 ++++++---- rollup/internal/controller/watcher/watcher_test.go | 10 ++++++---- rollup/internal/orm/orm_test.go | 10 ++++++---- rollup/tests/bridge_test.go | 10 ++++++---- tests/integration-test/integration_test.go | 10 ++++++---- 19 files changed, 80 insertions(+), 44 deletions(-) diff --git a/bridge-history-api/conf/config.json b/bridge-history-api/conf/config.json index bcbf6384f2..49c069bbaf 100644 --- a/bridge-history-api/conf/config.json +++ b/bridge-history-api/conf/config.json @@ -40,7 +40,9 @@ "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driverName": "postgres", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "redis": { "address": "localhost:6379", diff --git a/common/database/config.go b/common/database/config.go index 0a99a6b153..013c427547 100644 --- a/common/database/config.go +++ b/common/database/config.go @@ -8,4 +8,6 @@ type Config struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` + MaxLifetime int `json:"maxLifetime"` + MaxIdleTime int `json:"maxIdleTime"` } diff --git a/common/database/db.go b/common/database/db.go index 322ba27115..055db5ed8b 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,8 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(time.Minute * 10) - sqlDB.SetConnMaxIdleTime(time.Minute * 5) + sqlDB.SetConnMaxLifetime(config.maxLifetime) + sqlDB.SetConnMaxIdleTime(config.maxIdleTime) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/database/db_test.go b/common/database/db_test.go index df6bcd6496..8b097b5873 100644 --- a/common/database/db_test.go +++ b/common/database/db_test.go @@ -44,10 +44,12 @@ func TestDB(t *testing.T) { base.RunDBImage(t) dbCfg := &Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } var err error diff --git a/common/docker/docker_app.go b/common/docker/docker_app.go index 568921001b..4f558614e8 100644 --- a/common/docker/docker_app.go +++ b/common/docker/docker_app.go @@ -167,6 +167,8 @@ func (b *App) mockDBConfig() error { DriverName: "postgres", MaxOpenNum: 200, MaxIdleNum: 20, + MaxLifetime: 600, + MaxIdleTime: 300 } if b.DBImg != nil { diff --git a/coordinator/conf/config.json b/coordinator/conf/config.json index b143a702f7..a1ffae9069 100644 --- a/coordinator/conf/config.json +++ b/coordinator/conf/config.json @@ -16,7 +16,9 @@ "driver_name": "postgres", "dsn": "postgres://localhost/scroll?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "l2": { "chain_id": 111 diff --git a/coordinator/internal/config/config_test.go b/coordinator/internal/config/config_test.go index 748fe9c2a9..2e43e3da75 100644 --- a/coordinator/internal/config/config_test.go +++ b/coordinator/internal/config/config_test.go @@ -29,7 +29,9 @@ func TestConfig(t *testing.T) { "driver_name": "postgres", "dsn": "postgres://admin:123456@localhost/test?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "l2": { "chain_id": 111 diff --git a/coordinator/internal/orm/orm_test.go b/coordinator/internal/orm/orm_test.go index ed6f719b78..737975e2c3 100644 --- a/coordinator/internal/orm/orm_test.go +++ b/coordinator/internal/orm/orm_test.go @@ -38,10 +38,12 @@ func setupEnv(t *testing.T) { var err error db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/coordinator/test/api_test.go b/coordinator/test/api_test.go index 179390300e..c79897944a 100644 --- a/coordinator/test/api_test.go +++ b/coordinator/test/api_test.go @@ -125,10 +125,12 @@ func setEnv(t *testing.T) { base.RunDBImage(t) dbCfg = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } var err error diff --git a/database/config.go b/database/config.go index 4c037946c1..d6a5cf1cdc 100644 --- a/database/config.go +++ b/database/config.go @@ -14,6 +14,8 @@ type DBConfig struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` + MaxLifetime int `json:"maxLifetime"` + MaxIdleTime int `json:"maxIdleTime"` } // NewConfig returns a new instance of Config. diff --git a/database/config.json b/database/config.json index eda41de4c4..7a4a24a620 100644 --- a/database/config.json +++ b/database/config.json @@ -2,5 +2,7 @@ "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driver_name": "postgres", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 } \ No newline at end of file diff --git a/database/config_test.go b/database/config_test.go index 4c8b723c90..f12a6e628c 100644 --- a/database/config_test.go +++ b/database/config_test.go @@ -15,7 +15,9 @@ func TestConfig(t *testing.T) { "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driver_name": "postgres", "maxOpenNum": %d, - "maxIdleNum": %d + "maxIdleNum": %d, + "maxLifetime": %d, + "maxIdleTime": %d }` t.Run("Success Case", func(t *testing.T) { diff --git a/rollup/conf/config.json b/rollup/conf/config.json index feca4a84c9..242acebc1a 100644 --- a/rollup/conf/config.json +++ b/rollup/conf/config.json @@ -79,6 +79,8 @@ "driver_name": "postgres", "dsn": "postgres://localhost/scroll?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 } } diff --git a/rollup/internal/controller/relayer/relayer_test.go b/rollup/internal/controller/relayer/relayer_test.go index 60f2137e59..bbe6b09b4c 100644 --- a/rollup/internal/controller/relayer/relayer_test.go +++ b/rollup/internal/controller/relayer/relayer_test.go @@ -56,10 +56,12 @@ func setupEnv(t *testing.T) { cfg.L2Config.RelayerConfig.SenderConfig.Endpoint = base.L1gethImg.Endpoint() cfg.L1Config.RelayerConfig.SenderConfig.Endpoint = base.L2gethImg.Endpoint() cfg.DBConfig = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } port, err := rand.Int(rand.Reader, big.NewInt(10000)) assert.NoError(t, err) diff --git a/rollup/internal/controller/sender/sender_test.go b/rollup/internal/controller/sender/sender_test.go index 145cc1a855..af4e415e9f 100644 --- a/rollup/internal/controller/sender/sender_test.go +++ b/rollup/internal/controller/sender/sender_test.go @@ -67,10 +67,12 @@ func setupEnv(t *testing.T) { base.RunDBImage(t) db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/rollup/internal/controller/watcher/watcher_test.go b/rollup/internal/controller/watcher/watcher_test.go index 0e73bad703..a2105f6066 100644 --- a/rollup/internal/controller/watcher/watcher_test.go +++ b/rollup/internal/controller/watcher/watcher_test.go @@ -47,10 +47,12 @@ func setupEnv(t *testing.T) (err error) { cfg.L2Config.RelayerConfig.SenderConfig.Endpoint = base.L1gethImg.Endpoint() cfg.L1Config.RelayerConfig.SenderConfig.Endpoint = base.L2gethImg.Endpoint() cfg.DBConfig = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } // Create l2geth client. diff --git a/rollup/internal/orm/orm_test.go b/rollup/internal/orm/orm_test.go index 58391e2e51..a73a99e7c4 100644 --- a/rollup/internal/orm/orm_test.go +++ b/rollup/internal/orm/orm_test.go @@ -50,10 +50,12 @@ func setupEnv(t *testing.T) { var err error db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/rollup/tests/bridge_test.go b/rollup/tests/bridge_test.go index eae810be6c..7bab956a58 100644 --- a/rollup/tests/bridge_test.go +++ b/rollup/tests/bridge_test.go @@ -48,10 +48,12 @@ var ( func setupDB(t *testing.T) *gorm.DB { cfg := &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } db, err := database.InitDB(cfg) assert.NoError(t, err) diff --git a/tests/integration-test/integration_test.go b/tests/integration-test/integration_test.go index f36ea73701..8177544227 100644 --- a/tests/integration-test/integration_test.go +++ b/tests/integration-test/integration_test.go @@ -49,10 +49,12 @@ func TestCoordinatorProverInteraction(t *testing.T) { // Init data dbCfg := &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } db, err := database.InitDB(dbCfg) From 8a21fe4515562b55d86fc30da8a50ccee5247ca1 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Sun, 17 Mar 2024 02:34:45 +0530 Subject: [PATCH 02/12] #1042 Allow configure db ConnMaxLifetime & ConnMaxIdleTime --- bridge-history-api/conf/config.json | 4 +++- common/database/config.go | 2 ++ common/database/db.go | 4 ++-- common/database/db_test.go | 10 ++++++---- common/docker/docker_app.go | 2 ++ coordinator/conf/config.json | 4 +++- coordinator/internal/config/config_test.go | 4 +++- coordinator/internal/orm/orm_test.go | 10 ++++++---- coordinator/test/api_test.go | 10 ++++++---- database/config.go | 2 ++ database/config.json | 4 +++- database/config_test.go | 4 +++- rollup/conf/config.json | 4 +++- rollup/internal/controller/relayer/relayer_test.go | 10 ++++++---- rollup/internal/controller/sender/sender_test.go | 10 ++++++---- rollup/internal/controller/watcher/watcher_test.go | 10 ++++++---- rollup/internal/orm/orm_test.go | 10 ++++++---- rollup/tests/bridge_test.go | 10 ++++++---- tests/integration-test/integration_test.go | 10 ++++++---- 19 files changed, 80 insertions(+), 44 deletions(-) diff --git a/bridge-history-api/conf/config.json b/bridge-history-api/conf/config.json index bcbf6384f2..49c069bbaf 100644 --- a/bridge-history-api/conf/config.json +++ b/bridge-history-api/conf/config.json @@ -40,7 +40,9 @@ "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driverName": "postgres", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "redis": { "address": "localhost:6379", diff --git a/common/database/config.go b/common/database/config.go index 0a99a6b153..013c427547 100644 --- a/common/database/config.go +++ b/common/database/config.go @@ -8,4 +8,6 @@ type Config struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` + MaxLifetime int `json:"maxLifetime"` + MaxIdleTime int `json:"maxIdleTime"` } diff --git a/common/database/db.go b/common/database/db.go index 322ba27115..055db5ed8b 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,8 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(time.Minute * 10) - sqlDB.SetConnMaxIdleTime(time.Minute * 5) + sqlDB.SetConnMaxLifetime(config.maxLifetime) + sqlDB.SetConnMaxIdleTime(config.maxIdleTime) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/database/db_test.go b/common/database/db_test.go index df6bcd6496..8b097b5873 100644 --- a/common/database/db_test.go +++ b/common/database/db_test.go @@ -44,10 +44,12 @@ func TestDB(t *testing.T) { base.RunDBImage(t) dbCfg := &Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } var err error diff --git a/common/docker/docker_app.go b/common/docker/docker_app.go index 568921001b..4f558614e8 100644 --- a/common/docker/docker_app.go +++ b/common/docker/docker_app.go @@ -167,6 +167,8 @@ func (b *App) mockDBConfig() error { DriverName: "postgres", MaxOpenNum: 200, MaxIdleNum: 20, + MaxLifetime: 600, + MaxIdleTime: 300 } if b.DBImg != nil { diff --git a/coordinator/conf/config.json b/coordinator/conf/config.json index b143a702f7..a1ffae9069 100644 --- a/coordinator/conf/config.json +++ b/coordinator/conf/config.json @@ -16,7 +16,9 @@ "driver_name": "postgres", "dsn": "postgres://localhost/scroll?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "l2": { "chain_id": 111 diff --git a/coordinator/internal/config/config_test.go b/coordinator/internal/config/config_test.go index 748fe9c2a9..2e43e3da75 100644 --- a/coordinator/internal/config/config_test.go +++ b/coordinator/internal/config/config_test.go @@ -29,7 +29,9 @@ func TestConfig(t *testing.T) { "driver_name": "postgres", "dsn": "postgres://admin:123456@localhost/test?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "l2": { "chain_id": 111 diff --git a/coordinator/internal/orm/orm_test.go b/coordinator/internal/orm/orm_test.go index ed6f719b78..737975e2c3 100644 --- a/coordinator/internal/orm/orm_test.go +++ b/coordinator/internal/orm/orm_test.go @@ -38,10 +38,12 @@ func setupEnv(t *testing.T) { var err error db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/coordinator/test/api_test.go b/coordinator/test/api_test.go index 179390300e..c79897944a 100644 --- a/coordinator/test/api_test.go +++ b/coordinator/test/api_test.go @@ -125,10 +125,12 @@ func setEnv(t *testing.T) { base.RunDBImage(t) dbCfg = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } var err error diff --git a/database/config.go b/database/config.go index 4c037946c1..d6a5cf1cdc 100644 --- a/database/config.go +++ b/database/config.go @@ -14,6 +14,8 @@ type DBConfig struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` + MaxLifetime int `json:"maxLifetime"` + MaxIdleTime int `json:"maxIdleTime"` } // NewConfig returns a new instance of Config. diff --git a/database/config.json b/database/config.json index eda41de4c4..7a4a24a620 100644 --- a/database/config.json +++ b/database/config.json @@ -2,5 +2,7 @@ "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driver_name": "postgres", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 } \ No newline at end of file diff --git a/database/config_test.go b/database/config_test.go index 4c8b723c90..f12a6e628c 100644 --- a/database/config_test.go +++ b/database/config_test.go @@ -15,7 +15,9 @@ func TestConfig(t *testing.T) { "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driver_name": "postgres", "maxOpenNum": %d, - "maxIdleNum": %d + "maxIdleNum": %d, + "maxLifetime": %d, + "maxIdleTime": %d }` t.Run("Success Case", func(t *testing.T) { diff --git a/rollup/conf/config.json b/rollup/conf/config.json index bfecdd003d..4589a6fd28 100644 --- a/rollup/conf/config.json +++ b/rollup/conf/config.json @@ -81,6 +81,8 @@ "driver_name": "postgres", "dsn": "postgres://localhost/scroll?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 } } diff --git a/rollup/internal/controller/relayer/relayer_test.go b/rollup/internal/controller/relayer/relayer_test.go index 60f2137e59..bbe6b09b4c 100644 --- a/rollup/internal/controller/relayer/relayer_test.go +++ b/rollup/internal/controller/relayer/relayer_test.go @@ -56,10 +56,12 @@ func setupEnv(t *testing.T) { cfg.L2Config.RelayerConfig.SenderConfig.Endpoint = base.L1gethImg.Endpoint() cfg.L1Config.RelayerConfig.SenderConfig.Endpoint = base.L2gethImg.Endpoint() cfg.DBConfig = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } port, err := rand.Int(rand.Reader, big.NewInt(10000)) assert.NoError(t, err) diff --git a/rollup/internal/controller/sender/sender_test.go b/rollup/internal/controller/sender/sender_test.go index 7513c32170..4ae6fee37e 100644 --- a/rollup/internal/controller/sender/sender_test.go +++ b/rollup/internal/controller/sender/sender_test.go @@ -85,10 +85,12 @@ func setupEnv(t *testing.T) { base.RunDBImage(t) db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/rollup/internal/controller/watcher/watcher_test.go b/rollup/internal/controller/watcher/watcher_test.go index 0e73bad703..a2105f6066 100644 --- a/rollup/internal/controller/watcher/watcher_test.go +++ b/rollup/internal/controller/watcher/watcher_test.go @@ -47,10 +47,12 @@ func setupEnv(t *testing.T) (err error) { cfg.L2Config.RelayerConfig.SenderConfig.Endpoint = base.L1gethImg.Endpoint() cfg.L1Config.RelayerConfig.SenderConfig.Endpoint = base.L2gethImg.Endpoint() cfg.DBConfig = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } // Create l2geth client. diff --git a/rollup/internal/orm/orm_test.go b/rollup/internal/orm/orm_test.go index dc458a0b35..bf82137af1 100644 --- a/rollup/internal/orm/orm_test.go +++ b/rollup/internal/orm/orm_test.go @@ -50,10 +50,12 @@ func setupEnv(t *testing.T) { var err error db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/rollup/tests/bridge_test.go b/rollup/tests/bridge_test.go index a7e1be9dba..4e1dc7683d 100644 --- a/rollup/tests/bridge_test.go +++ b/rollup/tests/bridge_test.go @@ -48,10 +48,12 @@ var ( func setupDB(t *testing.T) *gorm.DB { cfg := &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } db, err := database.InitDB(cfg) assert.NoError(t, err) diff --git a/tests/integration-test/integration_test.go b/tests/integration-test/integration_test.go index 16455fc728..7bcdd8f6f8 100644 --- a/tests/integration-test/integration_test.go +++ b/tests/integration-test/integration_test.go @@ -48,10 +48,12 @@ func TestCoordinatorProverInteraction(t *testing.T) { // Init data dbCfg := &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } db, err := database.InitDB(dbCfg) From 6935fd41c4a73c66ed98c8d7f6f90515bbb9f0ba Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Wed, 20 Mar 2024 18:45:55 +0530 Subject: [PATCH 03/12] Fix test cases --- common/database/db.go | 4 ++-- common/docker/docker_app.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/database/db.go b/common/database/db.go index 055db5ed8b..f982f872fd 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,8 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(config.maxLifetime) - sqlDB.SetConnMaxIdleTime(config.maxIdleTime) + sqlDB.SetConnMaxLifetime(config.MaxLifetime) + sqlDB.SetConnMaxIdleTime(config.MaxIdleTime) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/docker/docker_app.go b/common/docker/docker_app.go index 4f558614e8..3974543279 100644 --- a/common/docker/docker_app.go +++ b/common/docker/docker_app.go @@ -168,7 +168,7 @@ func (b *App) mockDBConfig() error { MaxOpenNum: 200, MaxIdleNum: 20, MaxLifetime: 600, - MaxIdleTime: 300 + MaxIdleTime: 300, } if b.DBImg != nil { From e01e9d422855cae4bb40d004746d2adc31560568 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Wed, 20 Mar 2024 19:13:59 +0530 Subject: [PATCH 04/12] Make config optional with omitEmpty --- common/database/config.go | 4 ++-- common/database/db.go | 4 ++-- database/config.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/database/config.go b/common/database/config.go index 013c427547..8e090ea018 100644 --- a/common/database/config.go +++ b/common/database/config.go @@ -8,6 +8,6 @@ type Config struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` - MaxLifetime int `json:"maxLifetime"` - MaxIdleTime int `json:"maxIdleTime"` + MaxLifetime int `json:"maxLifetime,omitempty"` + MaxIdleTime int `json:"maxIdleTime,omitempty"` } diff --git a/common/database/db.go b/common/database/db.go index f982f872fd..33e4dfef36 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,8 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(config.MaxLifetime) - sqlDB.SetConnMaxIdleTime(config.MaxIdleTime) + sqlDB.SetConnMaxLifetime(config.MaxLifetime != 0 ? config.MaxLifetime : time.Minute * 10) + sqlDB.SetConnMaxIdleTime(config.MaxIdleTime != 0 ? config.MaxIdleTime : time.Minute * 5) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/database/config.go b/database/config.go index d6a5cf1cdc..06920c743c 100644 --- a/database/config.go +++ b/database/config.go @@ -14,8 +14,8 @@ type DBConfig struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` - MaxLifetime int `json:"maxLifetime"` - MaxIdleTime int `json:"maxIdleTime"` + MaxLifetime int `json:"maxLifetime,omitempty"` + MaxIdleTime int `json:"maxIdleTime,omitempty"` } // NewConfig returns a new instance of Config. From 8bd4277c13ec17670963848a24e4e1b135504f3f Mon Sep 17 00:00:00 2001 From: Xi Lin Date: Fri, 22 Mar 2024 18:02:02 +0800 Subject: [PATCH 05/12] feat(contracts): 4844 support (#1179) --- .github/workflows/common.yml | 4 +- .github/workflows/contracts.yml | 14 +- .github/workflows/coordinator.yml | 4 +- .github/workflows/database.yml | 4 +- contracts/.nvmrc | 1 + contracts/docs/apis/L1ERC1155Gateway.md | 68 +- contracts/docs/apis/L1ERC721Gateway.md | 56 +- contracts/docs/apis/L1GatewayRouter.md | 101 +- contracts/docs/apis/L1ScrollMessenger.md | 30 +- contracts/docs/apis/L1StandardERC20Gateway.md | 42 +- contracts/docs/apis/L1WETHGateway.md | 38 +- contracts/docs/apis/L2ERC1155Gateway.md | 50 +- contracts/docs/apis/L2ERC721Gateway.md | 42 +- contracts/docs/apis/L2GatewayRouter.md | 87 +- contracts/docs/apis/L2ScrollMessenger.md | 30 +- contracts/docs/apis/L2StandardERC20Gateway.md | 36 +- contracts/docs/apis/L2WETHGateway.md | 26 +- contracts/docs/apis/ScrollChain.md | 384 ++- .../docs/apis/ScrollStandardERC20Factory.md | 4 +- contracts/foundry.toml | 4 +- contracts/hardhat.config.ts | 67 +- .../EnforcedTxGateway.spec.ts | 131 +- .../GasOptimizationUpgrade.spec.ts | 178 +- contracts/integration-test/GasSwap.spec.ts | 174 +- .../integration-test/L1BlockContainer.spec.ts | 24 +- .../integration-test/L1MessageQueue.spec.ts | 161 +- .../PatriciaMerkleTrieVerifier.spec.ts | 4 +- .../integration-test/PoseidonHash.spec.ts | 33 +- .../integration-test/ScrollChain.blob.spec.ts | 162 ++ .../integration-test/ScrollChain.spec.ts | 42 +- .../integration-test/ZkEvmVerifierV1.spec.ts | 14 +- .../integration-test/ZkTrieVerifier.spec.ts | 28 +- contracts/package.json | 38 +- .../foundry/DeployFallbackContracts.s.sol | 2 +- .../foundry/DeployL1BridgeContracts.s.sol | 8 +- .../DeployL1BridgeProxyPlaceholder.s.sol | 2 +- .../scripts/foundry/DeployL1ScrollOwner.s.sol | 2 +- .../foundry/DeployL2BridgeContracts.s.sol | 2 +- .../DeployL2BridgeProxyPlaceholder.s.sol | 2 +- .../scripts/foundry/DeployL2ScrollOwner.s.sol | 2 +- .../DeployScrollChainCommitmentVerifier.s.sol | 2 +- contracts/scripts/foundry/DeployWeth.s.sol | 2 +- .../foundry/InitializeL1BridgeContracts.s.sol | 5 +- .../foundry/InitializeL1ScrollOwner.s.sol | 2 +- .../foundry/InitializeL2BridgeContracts.s.sol | 2 +- .../foundry/InitializeL2ScrollOwner.s.sol | 2 +- contracts/scripts/poseidon.ts | 6 +- contracts/src/External.sol | 2 +- contracts/src/L1/IL1ScrollMessenger.sol | 2 +- contracts/src/L1/L1ScrollMessenger.sol | 2 +- .../src/L1/gateways/EnforcedTxGateway.sol | 2 +- .../src/L1/gateways/IL1ERC1155Gateway.sol | 2 +- contracts/src/L1/gateways/IL1ERC20Gateway.sol | 2 +- .../src/L1/gateways/IL1ERC721Gateway.sol | 2 +- contracts/src/L1/gateways/IL1ETHGateway.sol | 2 +- .../src/L1/gateways/IL1GatewayRouter.sol | 2 +- .../src/L1/gateways/L1CustomERC20Gateway.sol | 2 +- .../src/L1/gateways/L1ERC1155Gateway.sol | 2 +- contracts/src/L1/gateways/L1ERC20Gateway.sol | 2 +- contracts/src/L1/gateways/L1ERC721Gateway.sol | 2 +- contracts/src/L1/gateways/L1ETHGateway.sol | 2 +- contracts/src/L1/gateways/L1GatewayRouter.sol | 2 +- .../L1/gateways/L1StandardERC20Gateway.sol | 2 +- contracts/src/L1/gateways/L1WETHGateway.sol | 2 +- .../src/L1/gateways/usdc/L1USDCGateway.sol | 2 +- .../gateways/usdc/draft-L1USDCGatewayCCTP.sol | 2 +- contracts/src/L1/rollup/IL1MessageQueue.sol | 2 +- .../IL1MessageQueueWithGasPriceOracle.sol | 2 +- contracts/src/L1/rollup/IL2GasPriceOracle.sol | 2 +- contracts/src/L1/rollup/IScrollChain.sol | 42 +- contracts/src/L1/rollup/L1MessageQueue.sol | 2 +- .../L1MessageQueueWithGasPriceOracle.sol | 2 +- contracts/src/L1/rollup/L2GasPriceOracle.sol | 2 +- .../rollup/MultipleVersionRollupVerifier.sol | 110 +- contracts/src/L1/rollup/ScrollChain.sol | 713 ++++-- .../rollup/ScrollChainCommitmentVerifier.sol | 2 +- contracts/src/L2/IL2ScrollMessenger.sol | 2 +- contracts/src/L2/L2ScrollMessenger.sol | 2 +- .../src/L2/gateways/IL2ERC1155Gateway.sol | 2 +- contracts/src/L2/gateways/IL2ERC20Gateway.sol | 2 +- .../src/L2/gateways/IL2ERC721Gateway.sol | 2 +- contracts/src/L2/gateways/IL2ETHGateway.sol | 2 +- .../src/L2/gateways/IL2GatewayRouter.sol | 2 +- .../src/L2/gateways/L2CustomERC20Gateway.sol | 2 +- .../src/L2/gateways/L2ERC1155Gateway.sol | 2 +- contracts/src/L2/gateways/L2ERC20Gateway.sol | 2 +- contracts/src/L2/gateways/L2ERC721Gateway.sol | 2 +- contracts/src/L2/gateways/L2ETHGateway.sol | 2 +- contracts/src/L2/gateways/L2GatewayRouter.sol | 2 +- .../L2/gateways/L2StandardERC20Gateway.sol | 2 +- contracts/src/L2/gateways/L2WETHGateway.sol | 2 +- .../src/L2/gateways/usdc/L2USDCGateway.sol | 2 +- .../gateways/usdc/draft-L2USDCGatewayCCTP.sol | 2 +- .../src/L2/predeploys/IL1BlockContainer.sol | 2 +- .../src/L2/predeploys/IL1GasPriceOracle.sol | 2 +- .../src/L2/predeploys/L1BlockContainer.sol | 2 +- .../src/L2/predeploys/L1GasPriceOracle.sol | 2 +- .../src/L2/predeploys/L2MessageQueue.sol | 2 +- contracts/src/L2/predeploys/L2TxFeeVault.sol | 2 +- contracts/src/L2/predeploys/Whitelist.sol | 2 +- contracts/src/gas-swap/GasSwap.sol | 2 +- contracts/src/interfaces/IFiatToken.sol | 2 +- .../src/interfaces/IMessageTransmitter.sol | 2 +- contracts/src/interfaces/ITokenMessenger.sol | 2 +- .../interfaces/IUSDCBurnableSourceBridge.sol | 2 +- .../src/interfaces/IUSDCDestinationBridge.sol | 2 +- contracts/src/interfaces/IWETH.sol | 2 +- contracts/src/libraries/IScrollMessenger.sol | 2 +- .../src/libraries/ScrollMessengerBase.sol | 2 +- .../libraries/callbacks/IERC677Receiver.sol | 2 +- .../callbacks/IMessageDropCallback.sol | 2 +- .../callbacks/IScrollGatewayCallback.sol | 2 +- .../libraries/codec/BatchHeaderV0Codec.sol | 54 +- .../libraries/codec/BatchHeaderV1Codec.sol | 230 ++ .../{ChunkCodec.sol => ChunkCodecV0.sol} | 27 +- .../src/libraries/codec/ChunkCodecV1.sol | 86 + .../libraries/common/AddressAliasHelper.sol | 2 +- .../libraries/common/AppendOnlyMerkleTree.sol | 2 +- contracts/src/libraries/common/IWhitelist.sol | 2 +- .../src/libraries/common/OwnableBase.sol | 2 +- .../libraries/constants/ScrollConstants.sol | 2 +- .../libraries/constants/ScrollPredeploy.sol | 2 +- .../src/libraries/gateway/IScrollGateway.sol | 2 +- .../libraries/gateway/ScrollGatewayBase.sol | 2 +- .../src/libraries/token/IScrollERC1155.sol | 2 +- .../src/libraries/token/IScrollERC20.sol | 2 +- .../token/IScrollERC20Upgradeable.sol | 2 +- .../src/libraries/token/IScrollERC721.sol | 2 +- .../token/IScrollStandardERC20Factory.sol | 2 +- .../libraries/token/ScrollStandardERC20.sol | 2 +- .../token/ScrollStandardERC20Factory.sol | 2 +- .../libraries/verifier/IRollupVerifier.sol | 14 +- .../src/libraries/verifier/IZkEvmVerifier.sol | 2 +- .../verifier/PatriciaMerkleTrieVerifier.sol | 2 +- .../src/libraries/verifier/RollupVerifier.sol | 2 +- .../verifier/WithdrawTrieVerifier.sol | 2 +- .../libraries/verifier/ZkEvmVerifierV1.sol | 2 +- .../src/libraries/verifier/ZkTrieVerifier.sol | 2 +- contracts/src/lido/L1LidoGateway.sol | 2 +- contracts/src/lido/L2LidoGateway.sol | 2 +- contracts/src/lido/L2WstETHToken.sol | 2 +- contracts/src/lido/LidoBridgeableTokens.sol | 2 +- contracts/src/lido/LidoGatewayManager.sol | 2 +- contracts/src/misc/ERC2771Forwarder.sol | 2 +- contracts/src/misc/EmptyContract.sol | 2 +- contracts/src/misc/Fallback.sol | 2 +- contracts/src/misc/Nonces.sol | 2 +- contracts/src/misc/ScrollOwner.sol | 2 +- contracts/src/mocks/MockCaller.sol | 2 +- contracts/src/mocks/MockERC20.sol | 2 +- contracts/src/mocks/MockGasSwapTarget.sol | 2 +- .../mocks/MockPatriciaMerkleTrieVerifier.sol | 2 +- contracts/src/mocks/MockZkTrieVerifier.sol | 2 +- contracts/src/rate-limiter/ETHRateLimiter.sol | 2 +- .../src/rate-limiter/IETHRateLimiter.sol | 2 +- .../src/rate-limiter/ITokenRateLimiter.sol | 2 +- .../src/rate-limiter/TokenRateLimiter.sol | 2 +- contracts/src/test/ETHRateLimiter.t.sol | 2 +- contracts/src/test/L1CustomERC20Gateway.t.sol | 2 +- contracts/src/test/L1ERC1155Gateway.t.sol | 2 +- contracts/src/test/L1ERC721Gateway.t.sol | 2 +- contracts/src/test/L1ETHGateway.t.sol | 2 +- contracts/src/test/L1GasPriceOracle.t.sol | 2 +- contracts/src/test/L1GatewayRouter.t.sol | 2 +- contracts/src/test/L1GatewayTestBase.t.sol | 2 +- .../L1MessageQueueWithGasPriceOracle.t.sol | 2 +- .../src/test/L1ScrollMessengerTest.t.sol | 2 +- .../src/test/L1StandardERC20Gateway.t.sol | 2 +- contracts/src/test/L1WETHGateway.t.sol | 2 +- contracts/src/test/L2CustomERC20Gateway.t.sol | 2 +- contracts/src/test/L2ERC1155Gateway.t.sol | 2 +- contracts/src/test/L2ERC721Gateway.t.sol | 2 +- contracts/src/test/L2ETHGateway.t.sol | 2 +- contracts/src/test/L2GasPriceOracle.t.sol | 2 +- contracts/src/test/L2GatewayRouter.t.sol | 2 +- contracts/src/test/L2GatewayTestBase.t.sol | 2 +- contracts/src/test/L2MessageQueue.t.sol | 2 +- contracts/src/test/L2ScrollMessenger.t.sol | 2 +- .../src/test/L2StandardERC20Gateway.t.sol | 2 +- contracts/src/test/L2TxFeeVault.t.sol | 2 +- contracts/src/test/L2USDCGateway.t.sol | 2 +- contracts/src/test/L2WETHGateway.t.sol | 2 +- .../test/MultipleVersionRollupVerifier.t.sol | 175 +- contracts/src/test/ScrollChain.t.sol | 112 +- .../src/test/ScrollStandardERC20Factory.t.sol | 2 +- contracts/src/test/ScrollTestBase.t.sol | 2 +- contracts/src/test/TokenRateLimiter.t.sol | 2 +- contracts/src/test/Whitelist.t.sol | 2 +- contracts/src/test/WithdrawTrieVerifier.t.sol | 2 +- .../integration/GatewayIntegrationBase.t.sol | 2 +- .../integration/LidoGatewayIntegration.t.sol | 2 +- contracts/src/test/lido/L1LidoGateway.t.sol | 2 +- contracts/src/test/lido/L2LidoGateway.t.sol | 2 +- contracts/src/test/lido/L2WstETHToken.t.sol | 2 +- .../src/test/mocks/MockERC1155Recipient.sol | 2 +- .../src/test/mocks/MockERC721Recipient.sol | 2 +- .../src/test/mocks/MockGatewayRecipient.sol | 2 +- .../src/test/mocks/MockL1LidoGateway.sol | 2 +- .../src/test/mocks/MockL2LidoGateway.sol | 2 +- .../src/test/mocks/MockRollupVerifier.sol | 10 +- contracts/src/test/mocks/MockScrollChain.sol | 2 +- .../src/test/mocks/MockScrollMessenger.sol | 2 +- .../src/test/mocks/MockZkEvmVerifier.sol | 2 +- .../test/mocks/tokens/FeeOnTransferToken.sol | 2 +- .../mocks/tokens/TransferReentrantToken.sol | 2 +- contracts/tsconfig.json | 2 +- contracts/yarn.lock | 2197 +++++++++-------- rollup/mock_bridge/MockBridge.sol | 22 +- 208 files changed, 3883 insertions(+), 2327 deletions(-) create mode 100644 contracts/.nvmrc create mode 100644 contracts/integration-test/ScrollChain.blob.spec.ts create mode 100644 contracts/src/libraries/codec/BatchHeaderV1Codec.sol rename contracts/src/libraries/codec/{ChunkCodec.sol => ChunkCodecV0.sol} (84%) create mode 100644 contracts/src/libraries/codec/ChunkCodecV1.sol diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index b7fb788623..b35fb842e3 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -85,9 +85,9 @@ jobs: - name: Install Solc uses: supplypike/setup-bin@v3 with: - uri: 'https://github.com/ethereum/solidity/releases/download/v0.8.16/solc-static-linux' + uri: 'https://github.com/ethereum/solidity/releases/download/v0.8.24/solc-static-linux' name: 'solc' - version: '0.8.16' + version: '0.8.24' - name: Install Geth Tools uses: gacts/install-geth-tools@v1 - name: Build prerequisites diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index aecf594020..0e90e1351d 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -43,10 +43,10 @@ jobs: - name: Setup LCOV uses: hrishikesh-kadam/setup-lcov@v1 - - name: Install Node.js 14 + - name: Install Node.js 18 uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '18' - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -73,13 +73,13 @@ jobs: run: yarn install - name: Compile with foundry - run: forge build + run: forge build --evm-version cancun - name: Run foundry tests - run: forge test -vvv + run: forge test --evm-version cancun -vvv - name: Run foundry coverage - run : forge coverage --report lcov + run : forge coverage --evm-version cancun --report lcov - name : Prune coverage run : lcov --rc branch_coverage=1 --remove ./lcov.info -o ./lcov.info.pruned 'src/mocks/*' 'src/test/*' 'scripts/*' 'node_modules/*' 'lib/*' @@ -102,10 +102,10 @@ jobs: with: submodules: recursive - - name: Install Node.js 14 + - name: Install Node.js 18 uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '18' - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/coordinator.yml b/.github/workflows/coordinator.yml index 92f938b2c6..b441a78a97 100644 --- a/.github/workflows/coordinator.yml +++ b/.github/workflows/coordinator.yml @@ -101,9 +101,9 @@ jobs: - name: Install Solc uses: supplypike/setup-bin@v3 with: - uri: 'https://github.com/ethereum/solidity/releases/download/v0.8.16/solc-static-linux' + uri: 'https://github.com/ethereum/solidity/releases/download/v0.8.24/solc-static-linux' name: 'solc' - version: '0.8.16' + version: '0.8.24' - name: Install Geth Tools uses: gacts/install-geth-tools@v1 - name: Build prerequisites diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index d59ba15411..90b1f8b904 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -78,9 +78,9 @@ jobs: - name: Install Solc uses: supplypike/setup-bin@v3 with: - uri: 'https://github.com/ethereum/solidity/releases/download/v0.8.16/solc-static-linux' + uri: 'https://github.com/ethereum/solidity/releases/download/v0.8.24/solc-static-linux' name: 'solc' - version: '0.8.16' + version: '0.8.24' - name: Install Geth Tools uses: gacts/install-geth-tools@v1 - name: Build prerequisites diff --git a/contracts/.nvmrc b/contracts/.nvmrc new file mode 100644 index 0000000000..e048c8ca19 --- /dev/null +++ b/contracts/.nvmrc @@ -0,0 +1 @@ +v18.15.0 diff --git a/contracts/docs/apis/L1ERC1155Gateway.md b/contracts/docs/apis/L1ERC1155Gateway.md index b58d84986c..e410f029a6 100644 --- a/contracts/docs/apis/L1ERC1155Gateway.md +++ b/contracts/docs/apis/L1ERC1155Gateway.md @@ -162,7 +162,7 @@ Initialize the storage of L1ERC1155Gateway. | Name | Type | Description | |---|---|---| | _counterpart | address | The address of L2ERC1155Gateway in L2. | -| _messenger | address | The address of L1ScrollMessenger. | +| _messenger | address | The address of L1ScrollMessenger in L1. | ### messenger @@ -389,12 +389,12 @@ Emitted when the ERC1155 NFT is batch deposited to gateway on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenIds | uint256[] | undefined | -| _amounts | uint256[] | undefined | +| _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 @@ -410,10 +410,10 @@ Emitted when some ERC1155 token is refunded. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| recipient `indexed` | address | undefined | -| tokenIds | uint256[] | undefined | -| amounts | uint256[] | undefined | +| 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 @@ -429,12 +429,12 @@ Emitted when the ERC1155 NFT is deposited to gateway on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenId | uint256 | undefined | -| _amount | uint256 | undefined | +| _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 @@ -450,12 +450,12 @@ Emitted when the ERC1155 NFT is batch transferred to recipient on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenIds | uint256[] | undefined | -| _amounts | uint256[] | undefined | +| _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 @@ -471,12 +471,12 @@ Emitted when the ERC1155 NFT is transferred to recipient on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenId | uint256 | undefined | -| _amount | uint256 | undefined | +| _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 @@ -486,7 +486,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -525,10 +525,10 @@ Emitted when some ERC1155 token is refunded. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| recipient `indexed` | address | undefined | -| tokenId | uint256 | undefined | -| amount | uint256 | undefined | +| 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 diff --git a/contracts/docs/apis/L1ERC721Gateway.md b/contracts/docs/apis/L1ERC721Gateway.md index f45893cfc6..17f54006ac 100644 --- a/contracts/docs/apis/L1ERC721Gateway.md +++ b/contracts/docs/apis/L1ERC721Gateway.md @@ -156,7 +156,7 @@ Initialize the storage of L1ERC721Gateway. | Name | Type | Description | |---|---|---| | _counterpart | address | The address of L2ERC721Gateway in L2. | -| _messenger | address | The address of L1ScrollMessenger. | +| _messenger | address | The address of L1ScrollMessenger in L1. | ### messenger @@ -334,11 +334,11 @@ Emitted when the ERC721 NFT is batch deposited to gateway on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenIds | uint256[] | undefined | +| _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 @@ -354,9 +354,9 @@ Emitted when a batch of ERC721 tokens are refunded. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| recipient `indexed` | address | undefined | -| tokenIds | uint256[] | undefined | +| 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 @@ -372,11 +372,11 @@ Emitted when the ERC721 NFT is deposited to gateway on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenId | uint256 | undefined | +| _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 @@ -392,11 +392,11 @@ Emitted when the ERC721 NFT is batch transferred to recipient on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenIds | uint256[] | undefined | +| _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 @@ -412,11 +412,11 @@ Emitted when the ERC721 NFT is transferred to recipient on layer 1. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | -| _from `indexed` | address | undefined | -| _to | address | undefined | -| _tokenId | uint256 | undefined | +| _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 @@ -426,7 +426,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -465,9 +465,9 @@ Emitted when some ERC721 token is refunded. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| recipient `indexed` | address | undefined | -| tokenId | uint256 | undefined | +| 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 diff --git a/contracts/docs/apis/L1GatewayRouter.md b/contracts/docs/apis/L1GatewayRouter.md index a46b2e2fbf..a4a84f1979 100644 --- a/contracts/docs/apis/L1GatewayRouter.md +++ b/contracts/docs/apis/L1GatewayRouter.md @@ -168,7 +168,7 @@ function ethGateway() external view returns (address) The address of L1ETHGateway. -*This variable is no longer used.* + #### Returns @@ -286,7 +286,7 @@ function initialize(address _ethGateway, address _defaultERC20Gateway) external Initialize the storage of L1GatewayRouter. -*The parameters `_ethGateway` is no longer used.* + #### Parameters @@ -295,23 +295,6 @@ Initialize the storage of L1GatewayRouter. | _ethGateway | address | The address of L1ETHGateway contract. | | _defaultERC20Gateway | address | The address of default ERC20 Gateway contract. | -### messenger - -```solidity -function messenger() external view returns (address) -``` - -The address of `L1ScrollMessenger`. - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - ### owner ```solidity @@ -447,12 +430,12 @@ Emitted when someone deposit ERC20 token from L1 to L2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -468,10 +451,10 @@ Emitted when someone deposit ETH from L1 to L2. | Name | Type | Description | |---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -487,12 +470,12 @@ Emitted when ERC20 token is withdrawn from L2 to L1 and transfer to recipient. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -508,10 +491,10 @@ Emitted when ETH is withdrawn from L2 to L1 and transfer to recipient. | Name | Type | Description | |---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -521,7 +504,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -560,9 +543,9 @@ Emitted when some ERC20 token is refunded. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| recipient `indexed` | address | undefined | -| amount | uint256 | undefined | +| 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 @@ -578,8 +561,8 @@ Emitted when some ETH is refunded. | Name | Type | Description | |---|---|---| -| recipient `indexed` | address | undefined | -| amount | uint256 | undefined | +| recipient `indexed` | address | The address of receiver in L1. | +| amount | uint256 | The amount of ETH refunded to receiver. | ### SetDefaultERC20Gateway @@ -595,8 +578,8 @@ Emitted when the address of default ERC20 Gateway is updated. | Name | Type | Description | |---|---|---| -| oldDefaultERC20Gateway `indexed` | address | undefined | -| newDefaultERC20Gateway `indexed` | address | undefined | +| oldDefaultERC20Gateway `indexed` | address | The address of the old default ERC20 Gateway. | +| newDefaultERC20Gateway `indexed` | address | The address of the new default ERC20 Gateway. | ### SetERC20Gateway @@ -612,9 +595,9 @@ Emitted when the `gateway` for `token` is updated. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| oldGateway `indexed` | address | undefined | -| newGateway `indexed` | address | undefined | +| 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 @@ -630,22 +613,8 @@ Emitted when the address of ETH Gateway is updated. | Name | Type | Description | |---|---|---| -| oldETHGateway `indexed` | address | undefined | -| newEthGateway `indexed` | address | undefined | - - - -## Errors - -### ErrorZeroAddress - -```solidity -error ErrorZeroAddress() -``` - - - -*Thrown when the given address is `address(0)`.* +| oldETHGateway `indexed` | address | The address of the old ETH Gateway. | +| newEthGateway `indexed` | address | The address of the new ETH Gateway. | diff --git a/contracts/docs/apis/L1ScrollMessenger.md b/contracts/docs/apis/L1ScrollMessenger.md index e331f234e1..d31959b594 100644 --- a/contracts/docs/apis/L1ScrollMessenger.md +++ b/contracts/docs/apis/L1ScrollMessenger.md @@ -471,7 +471,7 @@ Emitted when a cross domain message is failed to relay. | Name | Type | Description | |---|---|---| -| messageHash `indexed` | bytes32 | undefined | +| messageHash `indexed` | bytes32 | The hash of the message. | ### Initialized @@ -481,7 +481,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -514,7 +514,7 @@ event Paused(address account) - +*Emitted when the pause is triggered by `account`.* #### Parameters @@ -536,7 +536,7 @@ Emitted when a cross domain message is relayed successfully. | Name | Type | Description | |---|---|---| -| messageHash `indexed` | bytes32 | undefined | +| messageHash `indexed` | bytes32 | The hash of the message. | ### SentMessage @@ -552,12 +552,12 @@ Emitted when a cross domain message is sent. | Name | Type | Description | |---|---|---| -| sender `indexed` | address | undefined | -| target `indexed` | address | undefined | -| value | uint256 | undefined | -| messageNonce | uint256 | undefined | -| gasLimit | uint256 | undefined | -| message | bytes | undefined | +| 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 @@ -567,7 +567,7 @@ event Unpaused(address account) - +*Emitted when the pause is lifted by `account`.* #### Parameters @@ -589,8 +589,8 @@ Emitted when owner updates fee vault contract. | Name | Type | Description | |---|---|---| -| _oldFeeVault | address | undefined | -| _newFeeVault | address | undefined | +| _oldFeeVault | address | The address of old fee vault contract. | +| _newFeeVault | address | The address of new fee vault contract. | ### UpdateMaxReplayTimes @@ -606,8 +606,8 @@ Emitted when the maximum number of times each message can be replayed is updated | Name | Type | Description | |---|---|---| -| oldMaxReplayTimes | uint256 | undefined | -| newMaxReplayTimes | uint256 | undefined | +| 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. | diff --git a/contracts/docs/apis/L1StandardERC20Gateway.md b/contracts/docs/apis/L1StandardERC20Gateway.md index b67fa77a47..3cf8ade860 100644 --- a/contracts/docs/apis/L1StandardERC20Gateway.md +++ b/contracts/docs/apis/L1StandardERC20Gateway.md @@ -130,7 +130,7 @@ Return the corresponding l2 token address given l1 token address. ### initialize ```solidity -function initialize(address _counterpart, address _router, address _messenger, address _l2TokenImplementation, address _l2TokenFactory) external nonpayable +function initialize(address _counterpart, address _router, address _messenger, address, address) external nonpayable ``` Initialize the storage of L1StandardERC20Gateway. @@ -142,10 +142,10 @@ Initialize the storage of L1StandardERC20Gateway. | Name | Type | Description | |---|---|---| | _counterpart | address | The address of L2StandardERC20Gateway in L2. | -| _router | address | The address of L1GatewayRouter. | -| _messenger | address | The address of L1ScrollMessenger. | -| _l2TokenImplementation | address | The address of ScrollStandardERC20 implementation in L2. | -| _l2TokenFactory | address | The address of ScrollStandardERC20Factory contract 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 @@ -293,12 +293,12 @@ Emitted when someone deposit ERC20 token from L1 to L2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -314,12 +314,12 @@ Emitted when ERC20 token is withdrawn from L2 to L1 and transfer to recipient. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -329,7 +329,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -368,9 +368,9 @@ Emitted when some ERC20 token is refunded. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| recipient `indexed` | address | undefined | -| amount | uint256 | undefined | +| 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. | diff --git a/contracts/docs/apis/L1WETHGateway.md b/contracts/docs/apis/L1WETHGateway.md index d7231992ad..141a2e9ef6 100644 --- a/contracts/docs/apis/L1WETHGateway.md +++ b/contracts/docs/apis/L1WETHGateway.md @@ -152,15 +152,15 @@ function initialize(address _counterpart, address _router, address _messenger) e 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. | -| _messenger | address | The address of L1ScrollMessenger. | +| _router | address | The address of L1GatewayRouter in L1. | +| _messenger | address | The address of L1ScrollMessenger in L1. | ### l2WETH @@ -291,12 +291,12 @@ Emitted when someone deposit ERC20 token from L1 to L2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -312,12 +312,12 @@ Emitted when ERC20 token is withdrawn from L2 to L1 and transfer to recipient. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -327,7 +327,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -366,9 +366,9 @@ Emitted when some ERC20 token is refunded. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| recipient `indexed` | address | undefined | -| amount | uint256 | undefined | +| 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. | diff --git a/contracts/docs/apis/L2ERC1155Gateway.md b/contracts/docs/apis/L2ERC1155Gateway.md index df62081eac..d4565aad01 100644 --- a/contracts/docs/apis/L2ERC1155Gateway.md +++ b/contracts/docs/apis/L2ERC1155Gateway.md @@ -373,12 +373,12 @@ Emitted when the ERC1155 NFT is batch transferred to gateway on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenIds | uint256[] | undefined | -| amounts | uint256[] | undefined | +| 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 @@ -394,12 +394,12 @@ Emitted when the ERC1155 NFT is batch transferred to recipient on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenIds | uint256[] | undefined | -| amounts | uint256[] | undefined | +| 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 @@ -415,12 +415,12 @@ Emitted when the ERC1155 NFT is transferred to recipient on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| amount | uint256 | undefined | +| 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 @@ -430,7 +430,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -487,12 +487,12 @@ Emitted when the ERC1155 NFT is transferred to gateway on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| amount | uint256 | undefined | +| 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. | diff --git a/contracts/docs/apis/L2ERC721Gateway.md b/contracts/docs/apis/L2ERC721Gateway.md index 1dcff7e434..d615a16a44 100644 --- a/contracts/docs/apis/L2ERC721Gateway.md +++ b/contracts/docs/apis/L2ERC721Gateway.md @@ -318,11 +318,11 @@ Emitted when the ERC721 NFT is batch transferred to gateway on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenIds | uint256[] | undefined | +| 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 @@ -338,11 +338,11 @@ Emitted when the ERC721 NFT is batch transferred to recipient on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenIds | uint256[] | undefined | +| 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 @@ -358,11 +358,11 @@ Emitted when the ERC721 NFT is transferred to recipient on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | +| 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 @@ -372,7 +372,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -429,11 +429,11 @@ Emitted when the ERC721 NFT is transferred to gateway on layer 2. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | +| 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. | diff --git a/contracts/docs/apis/L2GatewayRouter.md b/contracts/docs/apis/L2GatewayRouter.md index 3f2960ccc9..7b6d551541 100644 --- a/contracts/docs/apis/L2GatewayRouter.md +++ b/contracts/docs/apis/L2GatewayRouter.md @@ -189,23 +189,6 @@ function initialize(address _ethGateway, address _defaultERC20Gateway) external | _ethGateway | address | undefined | | _defaultERC20Gateway | address | undefined | -### messenger - -```solidity -function messenger() external view returns (address) -``` - -The address of `L2ScrollMessenger`. - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - ### owner ```solidity @@ -428,12 +411,12 @@ Emitted when ERC20 token is deposited from L1 to L2 and transfer to recipient. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -449,10 +432,10 @@ Emitted when ETH is deposited from L1 to L2 and transfer to recipient. | Name | Type | Description | |---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -462,7 +445,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -501,8 +484,8 @@ Emitted when the address of default ERC20 Gateway is updated. | Name | Type | Description | |---|---|---| -| oldDefaultERC20Gateway `indexed` | address | undefined | -| newDefaultERC20Gateway `indexed` | address | undefined | +| oldDefaultERC20Gateway `indexed` | address | The address of the old default ERC20 Gateway. | +| newDefaultERC20Gateway `indexed` | address | The address of the new default ERC20 Gateway. | ### SetERC20Gateway @@ -518,9 +501,9 @@ Emitted when the `gateway` for `token` is updated. | Name | Type | Description | |---|---|---| -| token `indexed` | address | undefined | -| oldGateway `indexed` | address | undefined | -| newGateway `indexed` | address | undefined | +| 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 @@ -536,8 +519,8 @@ Emitted when the address of ETH Gateway is updated. | Name | Type | Description | |---|---|---| -| oldETHGateway `indexed` | address | undefined | -| newEthGateway `indexed` | address | undefined | +| oldETHGateway `indexed` | address | The address of the old ETH Gateway. | +| newEthGateway `indexed` | address | The address of the new ETH Gateway. | ### WithdrawERC20 @@ -553,12 +536,12 @@ Emitted when someone withdraw ERC20 token from L2 to L1. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -574,24 +557,10 @@ Emitted when someone withdraw ETH from L2 to L1. | Name | Type | Description | |---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - - - -## Errors - -### ErrorZeroAddress - -```solidity -error ErrorZeroAddress() -``` - - - -*Thrown when the given address is `address(0)`.* +| 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/contracts/docs/apis/L2ScrollMessenger.md b/contracts/docs/apis/L2ScrollMessenger.md index 0992a2a36f..170bb4a806 100644 --- a/contracts/docs/apis/L2ScrollMessenger.md +++ b/contracts/docs/apis/L2ScrollMessenger.md @@ -308,7 +308,7 @@ Emitted when a cross domain message is failed to relay. | Name | Type | Description | |---|---|---| -| messageHash `indexed` | bytes32 | undefined | +| messageHash `indexed` | bytes32 | The hash of the message. | ### Initialized @@ -318,7 +318,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -351,7 +351,7 @@ event Paused(address account) - +*Emitted when the pause is triggered by `account`.* #### Parameters @@ -373,7 +373,7 @@ Emitted when a cross domain message is relayed successfully. | Name | Type | Description | |---|---|---| -| messageHash `indexed` | bytes32 | undefined | +| messageHash `indexed` | bytes32 | The hash of the message. | ### SentMessage @@ -389,12 +389,12 @@ Emitted when a cross domain message is sent. | Name | Type | Description | |---|---|---| -| sender `indexed` | address | undefined | -| target `indexed` | address | undefined | -| value | uint256 | undefined | -| messageNonce | uint256 | undefined | -| gasLimit | uint256 | undefined | -| message | bytes | undefined | +| 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 @@ -404,7 +404,7 @@ event Unpaused(address account) - +*Emitted when the pause is lifted by `account`.* #### Parameters @@ -426,8 +426,8 @@ Emitted when owner updates fee vault contract. | Name | Type | Description | |---|---|---| -| _oldFeeVault | address | undefined | -| _newFeeVault | address | undefined | +| _oldFeeVault | address | The address of old fee vault contract. | +| _newFeeVault | address | The address of new fee vault contract. | ### UpdateMaxFailedExecutionTimes @@ -443,8 +443,8 @@ Emitted when the maximum number of times each message can fail in L2 is updated. | Name | Type | Description | |---|---|---| -| oldMaxFailedExecutionTimes | uint256 | undefined | -| newMaxFailedExecutionTimes | uint256 | undefined | +| 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. | diff --git a/contracts/docs/apis/L2StandardERC20Gateway.md b/contracts/docs/apis/L2StandardERC20Gateway.md index 7b1cc23bcd..05dd24aa1d 100644 --- a/contracts/docs/apis/L2StandardERC20Gateway.md +++ b/contracts/docs/apis/L2StandardERC20Gateway.md @@ -95,7 +95,7 @@ Return the corresponding l2 token address given l1 token address. ### initialize ```solidity -function initialize(address _counterpart, address _router, address _messenger, address _tokenFactory) external nonpayable +function initialize(address _counterpart, address _router, address _messenger, address) external nonpayable ``` Initialize the storage of L2StandardERC20Gateway. @@ -106,10 +106,10 @@ Initialize the storage of L2StandardERC20Gateway. | Name | Type | Description | |---|---|---| -| _counterpart | address | The address of L1ETHGateway in L1. | -| _router | address | The address of L2GatewayRouter. | -| _messenger | address | The address of L2ScrollMessenger. | -| _tokenFactory | address | The address of ScrollStandardERC20Factory. | +| _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 @@ -281,12 +281,12 @@ Emitted when ERC20 token is deposited from L1 to L2 and transfer to recipient. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -296,7 +296,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -335,12 +335,12 @@ Emitted when someone withdraw ERC20 token from L2 to L1. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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. | diff --git a/contracts/docs/apis/L2WETHGateway.md b/contracts/docs/apis/L2WETHGateway.md index 37fcc64654..129addae65 100644 --- a/contracts/docs/apis/L2WETHGateway.md +++ b/contracts/docs/apis/L2WETHGateway.md @@ -297,12 +297,12 @@ Emitted when ERC20 token is deposited from L1 to L2 and transfer to recipient. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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 @@ -312,7 +312,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -351,12 +351,12 @@ Emitted when someone withdraw ERC20 token from L2 to L1. | Name | Type | Description | |---|---|---| -| l1Token `indexed` | address | undefined | -| l2Token `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | +| 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. | diff --git a/contracts/docs/apis/ScrollChain.md b/contracts/docs/apis/ScrollChain.md index 1ece4631c6..2486dc7e78 100644 --- a/contracts/docs/apis/ScrollChain.md +++ b/contracts/docs/apis/ScrollChain.md @@ -91,7 +91,27 @@ function finalizeBatchWithProof(bytes _batchHeader, bytes32 _prevStateRoot, byte 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 @@ -101,6 +121,7 @@ Finalize a committed batch on layer 1. | _prevStateRoot | bytes32 | undefined | | _postStateRoot | bytes32 | undefined | | _withdrawRoot | bytes32 | undefined | +| _blobDataProof | bytes | undefined | | _aggrProof | bytes | undefined | ### finalizedStateRoots @@ -493,8 +514,8 @@ Emitted when a new batch is committed. | Name | Type | Description | |---|---|---| -| batchIndex `indexed` | uint256 | undefined | -| batchHash `indexed` | bytes32 | undefined | +| batchIndex `indexed` | uint256 | The index of the batch. | +| batchHash `indexed` | bytes32 | The hash of the batch. | ### FinalizeBatch @@ -510,10 +531,10 @@ Emitted when a batch is finalized. | Name | Type | Description | |---|---|---| -| batchIndex `indexed` | uint256 | undefined | -| batchHash `indexed` | bytes32 | undefined | -| stateRoot | bytes32 | undefined | -| withdrawRoot | bytes32 | undefined | +| 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 @@ -523,7 +544,7 @@ event Initialized(uint8 version) - +*Triggered when the contract has been initialized or reinitialized.* #### Parameters @@ -556,7 +577,7 @@ event Paused(address account) - +*Emitted when the pause is triggered by `account`.* #### Parameters @@ -578,8 +599,8 @@ revert a pending batch. | Name | Type | Description | |---|---|---| -| batchIndex `indexed` | uint256 | undefined | -| batchHash `indexed` | bytes32 | undefined | +| batchIndex `indexed` | uint256 | The index of the batch. | +| batchHash `indexed` | bytes32 | The hash of the batch | ### Unpaused @@ -589,7 +610,7 @@ event Unpaused(address account) - +*Emitted when the pause is lifted by `account`.* #### Parameters @@ -652,6 +673,347 @@ Emitted when owner updates the status of sequencer. ## 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.* + + +### ErrorInvalidBatchHeaderVersion + +```solidity +error ErrorInvalidBatchHeaderVersion() +``` + + + +*Thrown when the batch header version is invalid.* + + +### 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 diff --git a/contracts/docs/apis/ScrollStandardERC20Factory.md b/contracts/docs/apis/ScrollStandardERC20Factory.md index 3a8c0e409a..68609ca692 100644 --- a/contracts/docs/apis/ScrollStandardERC20Factory.md +++ b/contracts/docs/apis/ScrollStandardERC20Factory.md @@ -135,8 +135,8 @@ Emitted when a l2 token is deployed. | Name | Type | Description | |---|---|---| -| _l1Token `indexed` | address | undefined | -| _l2Token `indexed` | address | undefined | +| _l1Token `indexed` | address | The address of the l1 token. | +| _l2Token `indexed` | address | The address of the l2 token. | ### OwnershipTransferred diff --git a/contracts/foundry.toml b/contracts/foundry.toml index bff45c75ed..3ea34d7a48 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -8,8 +8,8 @@ remappings = [] # a list of remapp libraries = [] # a list of deployed libraries to link against cache = true # whether to cache builds or not force = true # whether to ignore the cache (clean build) -evm_version = 'london' # the evm version (by hardfork name) -solc_version = '0.8.16' # override for the solc version (setting this ignores `auto_detect_solc`) +# evm_version = 'london' # the evm version (by hardfork name) +solc_version = '0.8.24' # override for the solc version (setting this ignores `auto_detect_solc`) optimizer = true # enable or disable the solc optimizer optimizer_runs = 200 # the number of optimizer runs verbosity = 2 # the verbosity of tests diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 7fb93c7c2f..07a5afe17a 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -2,8 +2,9 @@ import * as dotenv from "dotenv"; import { HardhatUserConfig, subtask } from "hardhat/config"; import * as toml from "toml"; -import "@nomiclabs/hardhat-etherscan"; -import "@nomiclabs/hardhat-waffle"; +import "@nomicfoundation/hardhat-verify"; +import "@nomicfoundation/hardhat-ethers"; +import "@nomicfoundation/hardhat-chai-matchers"; import "@typechain/hardhat"; import "@primitivefi/hardhat-dodoc"; import "hardhat-gas-reporter"; @@ -13,16 +14,10 @@ import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/ta dotenv.config(); -// default values here to avoid failures when running hardhat -const RINKEBY_RPC = process.env.RINKEBY_RPC || "1".repeat(32); -const SCROLL_L1_RPC = process.env.SCROLL_L1_RPC || "1".repeat(32); -const SCROLL_L2_RPC = process.env.SCROLL_L2_RPC || "1".repeat(32); - -const RINKEBY_PRIVATE_KEY = process.env.RINKEBY_PRIVATE_KEY || "1".repeat(64); const L1_DEPLOYER_PRIVATE_KEY = process.env.L1_DEPLOYER_PRIVATE_KEY || "1".repeat(64); const L2_DEPLOYER_PRIVATE_KEY = process.env.L2_DEPLOYER_PRIVATE_KEY || "1".repeat(64); -const SOLC_DEFAULT = "0.8.16"; +const SOLC_DEFAULT = "0.8.24"; // try use forge config let foundry: any; @@ -45,29 +40,30 @@ subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper const config: HardhatUserConfig = { solidity: { - version: foundry.default?.solc || SOLC_DEFAULT, + version: foundry.default?.solc_version || SOLC_DEFAULT, settings: { optimizer: { enabled: foundry.default?.optimizer || true, runs: foundry.default?.optimizer_runs || 200, }, + evmVersion: "cancun", }, }, networks: { - rinkeby: { - url: RINKEBY_RPC, - accounts: [RINKEBY_PRIVATE_KEY], + ethereum: { + url: "https://1rpc.io/eth", + accounts: [L1_DEPLOYER_PRIVATE_KEY], }, - l1geth: { - url: SCROLL_L1_RPC, - gasPrice: 20000000000, - gasMultiplier: 1.1, + sepolia: { + url: "https://1rpc.io/sepolia", accounts: [L1_DEPLOYER_PRIVATE_KEY], }, - l2geth: { - url: SCROLL_L2_RPC, - gasPrice: 20000000000, - gasMultiplier: 1.1, + scroll: { + url: "https://rpc.scroll.io", + accounts: [L2_DEPLOYER_PRIVATE_KEY], + }, + scroll_sepolia: { + url: "https://sepolia-rpc.scroll.io", accounts: [L2_DEPLOYER_PRIVATE_KEY], }, }, @@ -76,13 +72,40 @@ const config: HardhatUserConfig = { sources: "./src", tests: "./integration-test", }, + typechain: { + outDir: "./typechain", + target: "ethers-v6", + }, gasReporter: { enabled: process.env.REPORT_GAS !== undefined, excludeContracts: ["src/test"], currency: "USD", }, etherscan: { - apiKey: process.env.ETHERSCAN_API_KEY, + apiKey: { + ethereum: process.env.ETHERSCAN_API_KEY || "", + sepolia: process.env.ETHERSCAN_API_KEY || "", + scroll: process.env.SCROLLSCAN_API_KEY || "", + scroll_sepolia: process.env.SCROLLSCAN_API_KEY || "", + }, + customChains: [ + { + network: "scroll", + chainId: 534352, + urls: { + apiURL: "https://api.scrollscan.com/api", + browserURL: "https://www.scrollscan.com/", + }, + }, + { + network: "scroll_sepolia", + chainId: 534351, + urls: { + apiURL: "https://api-sepolia.scrollscan.com/api", + browserURL: "https://sepolia.scrollscan.com/", + }, + }, + ], }, mocha: { timeout: 10000000, diff --git a/contracts/integration-test/EnforcedTxGateway.spec.ts b/contracts/integration-test/EnforcedTxGateway.spec.ts index da137e72a5..4dbd76bafa 100644 --- a/contracts/integration-test/EnforcedTxGateway.spec.ts +++ b/contracts/integration-test/EnforcedTxGateway.spec.ts @@ -1,16 +1,16 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ +import { HardhatEthersSigner, SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { expect } from "chai"; -import { BigNumberish, BytesLike, constants } from "ethers"; +import { BigNumberish, BytesLike, MaxUint256, ZeroAddress, getBytes } from "ethers"; import { ethers } from "hardhat"; + import { EnforcedTxGateway, L1MessageQueue, L2GasPriceOracle, MockCaller } from "../typechain"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { arrayify } from "ethers/lib/utils"; describe("EnforcedTxGateway.spec", async () => { - let deployer: SignerWithAddress; - let feeVault: SignerWithAddress; - let signer: SignerWithAddress; + let deployer: HardhatEthersSigner; + let feeVault: HardhatEthersSigner; + let signer: HardhatEthersSigner; let caller: MockCaller; let gateway: EnforcedTxGateway; @@ -21,10 +21,8 @@ describe("EnforcedTxGateway.spec", async () => { const TransparentUpgradeableProxy = await ethers.getContractFactory("TransparentUpgradeableProxy", deployer); const Factory = await ethers.getContractFactory(name, deployer); const impl = args.length > 0 ? await Factory.deploy(...args) : await Factory.deploy(); - await impl.deployed(); - const proxy = await TransparentUpgradeableProxy.deploy(impl.address, admin, "0x"); - await proxy.deployed(); - return proxy.address; + const proxy = await TransparentUpgradeableProxy.deploy(impl.getAddress(), admin, "0x"); + return proxy.getAddress(); }; beforeEach(async () => { @@ -32,66 +30,61 @@ describe("EnforcedTxGateway.spec", async () => { const ProxyAdmin = await ethers.getContractFactory("ProxyAdmin", deployer); const admin = await ProxyAdmin.deploy(); - await admin.deployed(); gateway = await ethers.getContractAt( "EnforcedTxGateway", - await deployProxy("EnforcedTxGateway", admin.address, []), + await deployProxy("EnforcedTxGateway", await admin.getAddress(), []), deployer ); queue = await ethers.getContractAt( "L1MessageQueue", - await deployProxy("L1MessageQueue", admin.address, [deployer.address, deployer.address, gateway.address]), + await deployProxy("L1MessageQueue", await admin.getAddress(), [ + deployer.address, + deployer.address, + await gateway.getAddress(), + ]), deployer ); oracle = await ethers.getContractAt( "L2GasPriceOracle", - await deployProxy("L2GasPriceOracle", admin.address, []), + await deployProxy("L2GasPriceOracle", await admin.getAddress(), []), deployer ); const MockCaller = await ethers.getContractFactory("MockCaller", deployer); caller = await MockCaller.deploy(); - await caller.deployed(); - - await queue.initialize( - constants.AddressZero, - constants.AddressZero, - constants.AddressZero, - oracle.address, - 10000000 - ); - await gateway.initialize(queue.address, feeVault.address); + + await queue.initialize(ZeroAddress, ZeroAddress, ZeroAddress, oracle.getAddress(), 10000000); + await gateway.initialize(queue.getAddress(), feeVault.address); await oracle.initialize(21000, 51000, 8, 16); const Whitelist = await ethers.getContractFactory("Whitelist", deployer); const whitelist = await Whitelist.deploy(deployer.address); - await whitelist.deployed(); await whitelist.updateWhitelistStatus([deployer.address], true); - await oracle.updateWhitelist(whitelist.address); + await oracle.updateWhitelist(whitelist.getAddress()); await oracle.setL2BaseFee(1); }); context("auth", async () => { it("should initialize correctly", async () => { expect(await gateway.owner()).to.eq(deployer.address); - expect(await gateway.messageQueue()).to.eq(queue.address); + expect(await gateway.messageQueue()).to.eq(await queue.getAddress()); expect(await gateway.feeVault()).to.eq(feeVault.address); expect(await gateway.paused()).to.eq(false); }); it("should revert, when initialize again", async () => { - await expect(gateway.initialize(constants.AddressZero, constants.AddressZero)).to.revertedWith( + await expect(gateway.initialize(ZeroAddress, ZeroAddress)).to.revertedWith( "Initializable: contract is already initialized" ); }); context("#updateFeeVault", async () => { it("should revert, when non-owner call", async () => { - await expect(gateway.connect(signer).updateFeeVault(constants.AddressZero)).to.revertedWith( + await expect(gateway.connect(signer).updateFeeVault(ZeroAddress)).to.revertedWith( "Ownable: caller is not the owner" ); }); @@ -129,13 +122,13 @@ describe("EnforcedTxGateway.spec", async () => { }); it("should revert, when call is not EOA", async () => { - const tx = await gateway.populateTransaction["sendTransaction(address,uint256,uint256,bytes)"]( + const calldata = gateway.interface.encodeFunctionData("sendTransaction(address,uint256,uint256,bytes)", [ signer.address, 0, 0, - "0x" - ); - await expect(caller.callTarget(gateway.address, tx.data!)).to.revertedWith( + "0x", + ]); + await expect(caller.callTarget(gateway.getAddress(), calldata)).to.revertedWith( "Only EOA senders are allowed to send enforced transaction" ); }); @@ -145,12 +138,12 @@ describe("EnforcedTxGateway.spec", async () => { await expect( gateway .connect(signer) - ["sendTransaction(address,uint256,uint256,bytes)"](signer.address, 0, 1000000, "0x", { value: fee.sub(1) }) + ["sendTransaction(address,uint256,uint256,bytes)"](signer.address, 0, 1000000, "0x", { value: fee - 1n }) ).to.revertedWith("Insufficient value for fee"); }); it("should revert, when failed to deduct the fee", async () => { - await gateway.updateFeeVault(gateway.address); + await gateway.updateFeeVault(gateway.getAddress()); const fee = await queue.estimateCrossDomainMessageFee(1000000); await expect( gateway @@ -170,7 +163,7 @@ describe("EnforcedTxGateway.spec", async () => { .to.emit(queue, "QueueTransaction") .withArgs(signer.address, deployer.address, 0, 0, 1000000, "0x"); const feeVaultBalanceAfter = await ethers.provider.getBalance(feeVault.address); - expect(feeVaultBalanceAfter.sub(feeVaultBalanceBefore)).to.eq(fee); + expect(feeVaultBalanceAfter - feeVaultBalanceBefore).to.eq(fee); }); it("should succeed, with refund", async () => { @@ -179,17 +172,15 @@ describe("EnforcedTxGateway.spec", async () => { const signerBalanceBefore = await ethers.provider.getBalance(signer.address); const tx = await gateway .connect(signer) - ["sendTransaction(address,uint256,uint256,bytes)"](deployer.address, 0, 1000000, "0x", { value: fee.add(100) }); + ["sendTransaction(address,uint256,uint256,bytes)"](deployer.address, 0, 1000000, "0x", { value: fee + 100n }); await expect(tx) .to.emit(queue, "QueueTransaction") .withArgs(signer.address, deployer.address, 0, 0, 1000000, "0x"); const receipt = await tx.wait(); const feeVaultBalanceAfter = await ethers.provider.getBalance(feeVault.address); const signerBalanceAfter = await ethers.provider.getBalance(signer.address); - expect(feeVaultBalanceAfter.sub(feeVaultBalanceBefore)).to.eq(fee); - expect(signerBalanceBefore.sub(signerBalanceAfter)).to.eq( - receipt.gasUsed.mul(receipt.effectiveGasPrice).add(fee) - ); + expect(feeVaultBalanceAfter - feeVaultBalanceBefore).to.eq(fee); + expect(signerBalanceBefore - signerBalanceAfter).to.eq(receipt!.gasUsed * receipt!.gasPrice + fee); }); }); @@ -203,19 +194,19 @@ describe("EnforcedTxGateway.spec", async () => { ) => { const enforcedTx = { sender: signer.address, - target: target, - value: value, - gasLimit: gasLimit, - data: arrayify(data), + target, + value, + gasLimit, + data: getBytes(data), nonce: await gateway.nonces(signer.address), - deadline: constants.MaxUint256, + deadline: MaxUint256, }; const domain = { name: "EnforcedTxGateway", version: "1", chainId: (await ethers.provider.getNetwork()).chainId, - verifyingContract: gateway.address, + verifyingContract: await gateway.getAddress(), }; const types = { @@ -251,7 +242,7 @@ describe("EnforcedTxGateway.spec", async () => { ], }; - const signature = await signer._signTypedData(domain, types, enforcedTx); + const signature = await signer.signTypedData(domain, types, enforcedTx); return signature; }; @@ -266,15 +257,15 @@ describe("EnforcedTxGateway.spec", async () => { 0, 0, "0x", - constants.MaxUint256, + MaxUint256, "0x", - constants.AddressZero + ZeroAddress ) ).to.revertedWith("Pausable: paused"); }); it("should revert, when signature expired", async () => { - const timestamp = (await ethers.provider.getBlock("latest")).timestamp; + const timestamp = (await ethers.provider.getBlock("latest"))!.timestamp; await expect( gateway .connect(deployer) @@ -286,7 +277,7 @@ describe("EnforcedTxGateway.spec", async () => { "0x", timestamp - 1, "0x", - constants.AddressZero + ZeroAddress ) ).to.revertedWith("signature expired"); }); @@ -302,9 +293,9 @@ describe("EnforcedTxGateway.spec", async () => { 0, 0, "0x", - constants.MaxUint256, + MaxUint256, signature, - constants.AddressZero + ZeroAddress ) ).to.revertedWith("Incorrect signature"); }); @@ -321,16 +312,16 @@ describe("EnforcedTxGateway.spec", async () => { 0, 1000000, "0x", - constants.MaxUint256, + MaxUint256, signature, signer.address, - { value: fee.sub(1) } + { value: fee - 1n } ) ).to.revertedWith("Insufficient value for fee"); }); it("should revert, when failed to deduct the fee", async () => { - await gateway.updateFeeVault(gateway.address); + await gateway.updateFeeVault(gateway.getAddress()); const signature = await getSignature(signer, signer.address, 0, 1000000, "0x"); const fee = await queue.estimateCrossDomainMessageFee(1000000); await expect( @@ -342,7 +333,7 @@ describe("EnforcedTxGateway.spec", async () => { 0, 1000000, "0x", - constants.MaxUint256, + MaxUint256, signature, signer.address, { value: fee } @@ -364,7 +355,7 @@ describe("EnforcedTxGateway.spec", async () => { 0, 1000000, "0x", - constants.MaxUint256, + MaxUint256, signature, signer.address, { value: fee } @@ -374,7 +365,7 @@ describe("EnforcedTxGateway.spec", async () => { .withArgs(signer.address, deployer.address, 0, 0, 1000000, "0x"); expect(await gateway.nonces(signer.address)).to.eq(1); const feeVaultBalanceAfter = await ethers.provider.getBalance(feeVault.address); - expect(feeVaultBalanceAfter.sub(feeVaultBalanceBefore)).to.eq(fee); + expect(feeVaultBalanceAfter - feeVaultBalanceBefore).to.eq(fee); // use the same nonce to sign should fail await expect( @@ -386,7 +377,7 @@ describe("EnforcedTxGateway.spec", async () => { 0, 1000000, "0x", - constants.MaxUint256, + MaxUint256, signature, signer.address, { value: fee } @@ -409,10 +400,10 @@ describe("EnforcedTxGateway.spec", async () => { 0, 1000000, "0x", - constants.MaxUint256, + MaxUint256, signature, signer.address, - { value: fee.add(100) } + { value: fee + 100n } ) ) .to.emit(queue, "QueueTransaction") @@ -420,8 +411,8 @@ describe("EnforcedTxGateway.spec", async () => { expect(await gateway.nonces(signer.address)).to.eq(1); const feeVaultBalanceAfter = await ethers.provider.getBalance(feeVault.address); const signerBalanceAfter = await ethers.provider.getBalance(signer.address); - expect(feeVaultBalanceAfter.sub(feeVaultBalanceBefore)).to.eq(fee); - expect(signerBalanceAfter.sub(signerBalanceBefore)).to.eq(100); + expect(feeVaultBalanceAfter - feeVaultBalanceBefore).to.eq(fee); + expect(signerBalanceAfter - signerBalanceBefore).to.eq(100n); // use the same nonce to sign should fail await expect( @@ -433,10 +424,10 @@ describe("EnforcedTxGateway.spec", async () => { 0, 1000000, "0x", - constants.MaxUint256, + MaxUint256, signature, signer.address, - { value: fee.add(100) } + { value: fee + 100n } ) ).to.revertedWith("Incorrect signature"); }); @@ -453,10 +444,10 @@ describe("EnforcedTxGateway.spec", async () => { 0, 1000000, "0x1234", - constants.MaxUint256, + MaxUint256, signature, - gateway.address, - { value: fee.add(100) } + gateway.getAddress(), + { value: fee + 100n } ) ).to.revertedWith("Failed to refund the fee"); }); diff --git a/contracts/integration-test/GasOptimizationUpgrade.spec.ts b/contracts/integration-test/GasOptimizationUpgrade.spec.ts index c8def13260..b641bb2ece 100644 --- a/contracts/integration-test/GasOptimizationUpgrade.spec.ts +++ b/contracts/integration-test/GasOptimizationUpgrade.spec.ts @@ -1,9 +1,8 @@ /* eslint-disable node/no-missing-import */ /* eslint-disable node/no-unpublished-import */ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; import { expect } from "chai"; -import { BigNumber, BigNumberish, ContractTransaction, constants } from "ethers"; -import { keccak256 } from "ethers/lib/utils"; +import { BigNumberish, ContractTransactionResponse, MaxUint256, keccak256, toQuantity } from "ethers"; import { ethers, network } from "hardhat"; import { @@ -24,31 +23,27 @@ describe("GasOptimizationUpgrade.spec", async () => { const L2_MESSAGE_QUEUE = "0x5300000000000000000000000000000000000000"; const SCROLL_CHAIN = "0xa13BAF47339d63B743e7Da8741db5456DAc1E556"; - let deployer: SignerWithAddress; + let deployer: HardhatEthersSigner; let proxyAdmin: ProxyAdmin; - const mockERC20Balance = async (tokenAddress: string, balance: BigNumber, slot: BigNumberish) => { + const mockERC20Balance = async (tokenAddress: string, balance: bigint, slot: BigNumberish) => { const storageSlot = keccak256( - ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [deployer.address, slot]) + ethers.AbiCoder.defaultAbiCoder().encode(["address", "uint256"], [deployer.address, slot]) ); - await ethers.provider.send("hardhat_setStorageAt", [ - tokenAddress, - storageSlot, - ethers.utils.hexlify(ethers.utils.zeroPad(balance.toHexString(), 32)), - ]); + await ethers.provider.send("hardhat_setStorageAt", [tokenAddress, storageSlot, toQuantity(balance)]); const token = await ethers.getContractAt("MockERC20", tokenAddress, deployer); expect(await token.balanceOf(deployer.address)).to.eq(balance); }; - const mockETHBalance = async (balance: BigNumber) => { - await network.provider.send("hardhat_setBalance", [deployer.address, balance.toHexString()]); - expect(await deployer.getBalance()).to.eq(balance); + const mockETHBalance = async (balance: bigint) => { + await network.provider.send("hardhat_setBalance", [deployer.address, toQuantity(balance)]); + expect(await ethers.provider.getBalance(deployer.address)).to.eq(balance); }; - const showGasUsage = async (tx: ContractTransaction, desc: string) => { + const showGasUsage = async (tx: ContractTransactionResponse, desc: string) => { const receipt = await tx.wait(); - console.log(`${desc}: GasUsed[${receipt.gasUsed}]`); + console.log(`${desc}: GasUsed[${receipt!.gasUsed}]`); }; context("L1 upgrade", async () => { @@ -59,7 +54,7 @@ describe("GasOptimizationUpgrade.spec", async () => { beforeEach(async () => { // fork network - const provider = new ethers.providers.JsonRpcProvider("https://rpc.ankr.com/eth"); + const provider = new ethers.JsonRpcProvider("https://rpc.ankr.com/eth"); if (!forkBlock) { forkBlock = (await provider.getBlockNumber()) - 10; } @@ -81,14 +76,14 @@ describe("GasOptimizationUpgrade.spec", async () => { // mock eth balance deployer = await ethers.getSigner("0x1100000000000000000000000000000000000011"); - await mockETHBalance(ethers.utils.parseEther("1000")); + await mockETHBalance(ethers.parseEther("1000")); // mock owner of proxy admin proxyAdmin = await ethers.getContractAt("ProxyAdmin", "0xEB803eb3F501998126bf37bB823646Ed3D59d072", deployer); await ethers.provider.send("hardhat_setStorageAt", [ - proxyAdmin.address, + await proxyAdmin.getAddress(), "0x0", - ethers.utils.hexlify(ethers.utils.zeroPad(deployer.address, 32)), + ethers.AbiCoder.defaultAbiCoder().encode(["address"], [deployer.address]), ]); expect(await proxyAdmin.owner()).to.eq(deployer.address); @@ -107,9 +102,7 @@ describe("GasOptimizationUpgrade.spec", async () => { const ScrollChain = await ethers.getContractFactory("ScrollChain", deployer); await proxyAdmin.upgrade( L1_MESSENGER, - ( - await L1ScrollMessenger.deploy(L2_MESSENGER, SCROLL_CHAIN, L1_MESSAGE_QUEUE) - ).address + (await L1ScrollMessenger.deploy(L2_MESSENGER, SCROLL_CHAIN, L1_MESSAGE_QUEUE)).getAddress() ); await proxyAdmin.upgrade( L1_MESSAGE_QUEUE, @@ -119,14 +112,12 @@ describe("GasOptimizationUpgrade.spec", async () => { SCROLL_CHAIN, "0x72CAcBcfDe2d1e19122F8A36a4d6676cd39d7A5d" ) - ).address + ).getAddress() ); await queue.initializeV2(); await proxyAdmin.upgrade( SCROLL_CHAIN, - ( - await ScrollChain.deploy(534352, L1_MESSAGE_QUEUE, "0xA2Ab526e5C5491F10FC05A55F064BF9F7CEf32a0") - ).address + (await ScrollChain.deploy(534352, L1_MESSAGE_QUEUE, "0xA2Ab526e5C5491F10FC05A55F064BF9F7CEf32a0")).getAddress() ); }; @@ -136,40 +127,40 @@ describe("GasOptimizationUpgrade.spec", async () => { const L1ETHGateway = await ethers.getContractFactory("L1ETHGateway", deployer); const impl = await L1ETHGateway.deploy(L2_GATEWAY, L1_ROUTER, L1_MESSENGER); const gateway = await ethers.getContractAt("L1ETHGateway", L1_GATEWAY, deployer); - const amountIn = ethers.utils.parseEther("1"); + const amountIn = ethers.parseEther("1"); const fee = await queue.estimateCrossDomainMessageFee(1e6); // before upgrade await showGasUsage( - await gateway["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn.add(fee) }), + await gateway["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn + fee }), "L1ETHGateway.depositETH before upgrade" ); await showGasUsage( - await router["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn.add(fee) }), + await router["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn + fee }), "L1GatewayRouter.depositETH before upgrade" ); await showGasUsage( await messenger["sendMessage(address,uint256,bytes,uint256)"](deployer.address, amountIn, "0x", 1e6, { - value: amountIn.add(fee), + value: amountIn + fee, }), "L1ScrollMessenger.sendMessage before upgrade" ); // do upgrade - await upgradeL1(L1_GATEWAY, impl.address); + await upgradeL1(L1_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( - await gateway["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn.add(fee) }), + await gateway["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn + fee }), "L1ETHGateway.depositETH after upgrade" ); await showGasUsage( - await router["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn.add(fee) }), + await router["depositETH(uint256,uint256)"](amountIn, 1e6, { value: amountIn + fee }), "L1GatewayRouter.depositETH after upgrade" ); await showGasUsage( await messenger["sendMessage(address,uint256,bytes,uint256)"](deployer.address, amountIn, "0x", 1e6, { - value: amountIn.add(fee), + value: amountIn + fee, }), "L1ScrollMessenger.sendMessage after upgrade" ); @@ -183,12 +174,12 @@ describe("GasOptimizationUpgrade.spec", async () => { const L1WETHGateway = await ethers.getContractFactory("L1WETHGateway", deployer); const impl = await L1WETHGateway.deploy(L1_WETH, L2_WETH, L2_GATEWAY, L1_ROUTER, L1_MESSENGER); const gateway = await ethers.getContractAt("L1WETHGateway", L1_GATEWAY, deployer); - const amountIn = ethers.utils.parseEther("1"); + const amountIn = ethers.parseEther("1"); const fee = await queue.estimateCrossDomainMessageFee(1e6); const token = await ethers.getContractAt("MockERC20", L1_WETH, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 3); - await token.approve(L1_GATEWAY, constants.MaxUint256); - await token.approve(L1_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 3); + await token.approve(L1_GATEWAY, MaxUint256); + await token.approve(L1_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -201,7 +192,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL1(L1_GATEWAY, impl.address); + await upgradeL1(L1_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -227,12 +218,12 @@ describe("GasOptimizationUpgrade.spec", async () => { "0x66e5312EDeEAef6e80759A0F789e7914Fb401484" ); const gateway = await ethers.getContractAt("L1StandardERC20Gateway", L1_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 6); + const amountIn = ethers.parseUnits("1", 6); const fee = await queue.estimateCrossDomainMessageFee(1e6); const token = await ethers.getContractAt("MockERC20", L1_USDT, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 2); - await token.approve(L1_GATEWAY, constants.MaxUint256); - await token.approve(L1_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 2); + await token.approve(L1_GATEWAY, MaxUint256); + await token.approve(L1_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -245,7 +236,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL1(L1_GATEWAY, impl.address); + await upgradeL1(L1_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -265,12 +256,12 @@ describe("GasOptimizationUpgrade.spec", async () => { const L1CustomERC20Gateway = await ethers.getContractFactory("L1CustomERC20Gateway", deployer); const impl = await L1CustomERC20Gateway.deploy(L2_GATEWAY, L1_ROUTER, L1_MESSENGER); const gateway = await ethers.getContractAt("L1CustomERC20Gateway", L1_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 18); + const amountIn = ethers.parseUnits("1", 18); const fee = await queue.estimateCrossDomainMessageFee(1e6); const token = await ethers.getContractAt("MockERC20", L1_DAI, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 2); - await token.approve(L1_GATEWAY, constants.MaxUint256); - await token.approve(L1_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 2); + await token.approve(L1_GATEWAY, MaxUint256); + await token.approve(L1_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -283,7 +274,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL1(L1_GATEWAY, impl.address); + await upgradeL1(L1_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -304,12 +295,12 @@ describe("GasOptimizationUpgrade.spec", async () => { const L1USDCGateway = await ethers.getContractFactory("L1USDCGateway", deployer); const impl = await L1USDCGateway.deploy(L1_USDC, L2_USDC, L2_GATEWAY, L1_ROUTER, L1_MESSENGER); const gateway = await ethers.getContractAt("L1USDCGateway", L1_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 6); + const amountIn = ethers.parseUnits("1", 6); const fee = await queue.estimateCrossDomainMessageFee(1e6); const token = await ethers.getContractAt("MockERC20", L1_USDC, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 9); - await token.approve(L1_GATEWAY, constants.MaxUint256); - await token.approve(L1_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 9); + await token.approve(L1_GATEWAY, MaxUint256); + await token.approve(L1_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -322,7 +313,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL1(L1_GATEWAY, impl.address); + await upgradeL1(L1_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -343,12 +334,12 @@ describe("GasOptimizationUpgrade.spec", async () => { const L1LidoGateway = await ethers.getContractFactory("L1LidoGateway", deployer); const impl = await L1LidoGateway.deploy(L1_WSTETH, L2_WSTETH, L2_GATEWAY, L1_ROUTER, L1_MESSENGER); const gateway = await ethers.getContractAt("L1LidoGateway", L1_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 6); + const amountIn = ethers.parseUnits("1", 6); const fee = await queue.estimateCrossDomainMessageFee(1e6); const token = await ethers.getContractAt("MockERC20", L1_WSTETH, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 0); - await token.approve(L1_GATEWAY, constants.MaxUint256); - await token.approve(L1_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 0); + await token.approve(L1_GATEWAY, MaxUint256); + await token.approve(L1_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -361,7 +352,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL1(L1_GATEWAY, impl.address); + await upgradeL1(L1_GATEWAY, await impl.getAddress()); await gateway.initializeV2(deployer.address, deployer.address, deployer.address, deployer.address); // after upgrade @@ -383,7 +374,7 @@ describe("GasOptimizationUpgrade.spec", async () => { beforeEach(async () => { // fork network - const provider = new ethers.providers.JsonRpcProvider("https://rpc.scroll.io"); + const provider = new ethers.JsonRpcProvider("https://rpc.scroll.io"); if (!forkBlock) { forkBlock = (await provider.getBlockNumber()) - 31; } @@ -405,14 +396,14 @@ describe("GasOptimizationUpgrade.spec", async () => { // mock eth balance deployer = await ethers.getSigner("0x1100000000000000000000000000000000000011"); - await mockETHBalance(ethers.utils.parseEther("1000")); + await mockETHBalance(ethers.parseEther("1000")); // mock owner of proxy admin proxyAdmin = await ethers.getContractAt("ProxyAdmin", "0xA76acF000C890b0DD7AEEf57627d9899F955d026", deployer); await ethers.provider.send("hardhat_setStorageAt", [ - proxyAdmin.address, + await proxyAdmin.getAddress(), "0x0", - ethers.utils.hexlify(ethers.utils.zeroPad(deployer.address, 32)), + ethers.AbiCoder.defaultAbiCoder().encode(["address"], [deployer.address]), ]); expect(await proxyAdmin.owner()).to.eq(deployer.address); @@ -423,7 +414,10 @@ describe("GasOptimizationUpgrade.spec", async () => { const upgradeL2 = async (proxy: string, impl: string) => { await proxyAdmin.upgrade(proxy, impl); const L2ScrollMessenger = await ethers.getContractFactory("L2ScrollMessenger", deployer); - await proxyAdmin.upgrade(L2_MESSENGER, (await L2ScrollMessenger.deploy(L1_MESSENGER, L2_MESSAGE_QUEUE)).address); + await proxyAdmin.upgrade( + L2_MESSENGER, + (await L2ScrollMessenger.deploy(L1_MESSENGER, L2_MESSAGE_QUEUE)).getAddress() + ); }; it.skip("should succeed on L2ETHGateway", async () => { @@ -432,7 +426,7 @@ describe("GasOptimizationUpgrade.spec", async () => { const L2ETHGateway = await ethers.getContractFactory("L2ETHGateway", deployer); const impl = await L2ETHGateway.deploy(L1_GATEWAY, L2_ROUTER, L2_MESSENGER); const gateway = await ethers.getContractAt("L2ETHGateway", L2_GATEWAY, deployer); - const amountIn = ethers.utils.parseEther("1"); + const amountIn = ethers.parseEther("1"); // before upgrade await showGasUsage( @@ -451,7 +445,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL2(L2_GATEWAY, impl.address); + await upgradeL2(L2_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -478,11 +472,11 @@ describe("GasOptimizationUpgrade.spec", async () => { const L2WETHGateway = await ethers.getContractFactory("L2WETHGateway", deployer); const impl = await L2WETHGateway.deploy(L2_WETH, L1_WETH, L1_GATEWAY, L2_ROUTER, L2_MESSENGER); const gateway = await ethers.getContractAt("L2WETHGateway", L2_GATEWAY, deployer); - const amountIn = ethers.utils.parseEther("1"); + const amountIn = ethers.parseEther("1"); const token = await ethers.getContractAt("MockERC20", L2_WETH, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 0); - await token.approve(L2_GATEWAY, constants.MaxUint256); - await token.approve(L2_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 0); + await token.approve(L2_GATEWAY, MaxUint256); + await token.approve(L2_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -495,7 +489,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL2(L2_GATEWAY, impl.address); + await upgradeL2(L2_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -520,11 +514,11 @@ describe("GasOptimizationUpgrade.spec", async () => { "0x66e5312EDeEAef6e80759A0F789e7914Fb401484" ); const gateway = await ethers.getContractAt("L2StandardERC20Gateway", L2_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 6); + const amountIn = ethers.parseUnits("1", 6); const token = await ethers.getContractAt("MockERC20", L2_USDT, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 51); - await token.approve(L2_GATEWAY, constants.MaxUint256); - await token.approve(L2_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 51); + await token.approve(L2_GATEWAY, MaxUint256); + await token.approve(L2_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -537,7 +531,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL2(L2_GATEWAY, impl.address); + await upgradeL2(L2_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -557,11 +551,11 @@ describe("GasOptimizationUpgrade.spec", async () => { const L2CustomERC20Gateway = await ethers.getContractFactory("L2CustomERC20Gateway", deployer); const impl = await L2CustomERC20Gateway.deploy(L1_GATEWAY, L2_ROUTER, L2_MESSENGER); const gateway = await ethers.getContractAt("L2CustomERC20Gateway", L2_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 18); + const amountIn = ethers.parseUnits("1", 18); const token = await ethers.getContractAt("MockERC20", L2_DAI, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 51); - await token.approve(L1_GATEWAY, constants.MaxUint256); - await token.approve(L1_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 51); + await token.approve(L1_GATEWAY, MaxUint256); + await token.approve(L1_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -574,7 +568,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL2(L2_GATEWAY, impl.address); + await upgradeL2(L2_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -595,11 +589,11 @@ describe("GasOptimizationUpgrade.spec", async () => { const L2USDCGateway = await ethers.getContractFactory("L2USDCGateway", deployer); const impl = await L2USDCGateway.deploy(L1_USDC, L2_USDC, L1_GATEWAY, L2_ROUTER, L2_MESSENGER); const gateway = await ethers.getContractAt("L2USDCGateway", L2_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 6); + const amountIn = ethers.parseUnits("1", 6); const token = await ethers.getContractAt("MockERC20", L2_USDC, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 9); - await token.approve(L2_GATEWAY, constants.MaxUint256); - await token.approve(L2_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 9); + await token.approve(L2_GATEWAY, MaxUint256); + await token.approve(L2_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -612,7 +606,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL2(L2_GATEWAY, impl.address); + await upgradeL2(L2_GATEWAY, await impl.getAddress()); // after upgrade await showGasUsage( @@ -633,11 +627,11 @@ describe("GasOptimizationUpgrade.spec", async () => { const L2LidoGateway = await ethers.getContractFactory("L2LidoGateway", deployer); const impl = await L2LidoGateway.deploy(L1_WSTETH, L2_WSTETH, L1_GATEWAY, L2_ROUTER, L2_MESSENGER); const gateway = await ethers.getContractAt("L2LidoGateway", L2_GATEWAY, deployer); - const amountIn = ethers.utils.parseUnits("1", 6); + const amountIn = ethers.parseUnits("1", 6); const token = await ethers.getContractAt("MockERC20", L2_WSTETH, deployer); - await mockERC20Balance(token.address, amountIn.mul(10), 51); - await token.approve(L2_GATEWAY, constants.MaxUint256); - await token.approve(L2_ROUTER, constants.MaxUint256); + await mockERC20Balance(await token.getAddress(), amountIn * 10n, 51); + await token.approve(L2_GATEWAY, MaxUint256); + await token.approve(L2_ROUTER, MaxUint256); // before upgrade await showGasUsage( @@ -650,7 +644,7 @@ describe("GasOptimizationUpgrade.spec", async () => { ); // do upgrade - await upgradeL2(L2_GATEWAY, impl.address); + await upgradeL2(L2_GATEWAY, await impl.getAddress()); await gateway.initializeV2(deployer.address, deployer.address, deployer.address, deployer.address); // after upgrade diff --git a/contracts/integration-test/GasSwap.spec.ts b/contracts/integration-test/GasSwap.spec.ts index 49c3b33d31..4c98ab4ab1 100644 --- a/contracts/integration-test/GasSwap.spec.ts +++ b/contracts/integration-test/GasSwap.spec.ts @@ -1,15 +1,15 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; +import { expect } from "chai"; +import { MaxUint256, Signature, ZeroAddress, ZeroHash, toBigInt } from "ethers"; import { ethers } from "hardhat"; + import { GasSwap, ERC2771Forwarder, MockERC20, MockGasSwapTarget } from "../typechain"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { expect } from "chai"; -import { BigNumber, constants } from "ethers"; -import { splitSignature } from "ethers/lib/utils"; describe("GasSwap.spec", async () => { - let deployer: SignerWithAddress; - let signer: SignerWithAddress; + let deployer: HardhatEthersSigner; + let signer: HardhatEthersSigner; let forwarder: ERC2771Forwarder; let swap: GasSwap; @@ -21,19 +21,15 @@ describe("GasSwap.spec", async () => { const ERC2771Forwarder = await ethers.getContractFactory("ERC2771Forwarder", deployer); forwarder = await ERC2771Forwarder.deploy("ERC2771Forwarder"); - await forwarder.deployed(); const GasSwap = await ethers.getContractFactory("GasSwap", deployer); - swap = await GasSwap.deploy(forwarder.address); - await swap.deployed(); + swap = await GasSwap.deploy(forwarder.getAddress()); const MockGasSwapTarget = await ethers.getContractFactory("MockGasSwapTarget", deployer); target = await MockGasSwapTarget.deploy(); - await target.deployed(); const MockERC20 = await ethers.getContractFactory("MockERC20", deployer); token = await MockERC20.deploy("x", "y", 18); - await token.deployed(); }); context("auth", async () => { @@ -43,11 +39,11 @@ describe("GasSwap.spec", async () => { context("#updateFeeRatio", async () => { it("should revert, when non-owner call", async () => { - await expect(swap.connect(signer).updateFeeRatio(1)).to.revertedWith("caller is not the owner"); + await expect(swap.connect(signer).updateFeeRatio(1)).to.revertedWith("Ownable: caller is not the owner"); }); it("should succeed", async () => { - expect(await swap.feeRatio()).to.eq(constants.AddressZero); + expect(await swap.feeRatio()).to.eq(ZeroAddress); await expect(swap.updateFeeRatio(100)).to.emit(swap, "UpdateFeeRatio").withArgs(100); expect(await swap.feeRatio()).to.eq(100); }); @@ -55,66 +51,62 @@ describe("GasSwap.spec", async () => { context("#updateApprovedTarget", async () => { it("should revert, when non-owner call", async () => { - await expect(swap.connect(signer).updateApprovedTarget(target.address, false)).to.revertedWith( - "caller is not the owner" + await expect(swap.connect(signer).updateApprovedTarget(target.getAddress(), false)).to.revertedWith( + "Ownable: caller is not the owner" ); }); it("should succeed", async () => { - expect(await swap.approvedTargets(target.address)).to.eq(false); - await expect(swap.updateApprovedTarget(target.address, true)) + expect(await swap.approvedTargets(target.getAddress())).to.eq(false); + await expect(swap.updateApprovedTarget(target.getAddress(), true)) .to.emit(swap, "UpdateApprovedTarget") - .withArgs(target.address, true); - expect(await swap.approvedTargets(target.address)).to.eq(true); - await expect(swap.updateApprovedTarget(target.address, false)) + .withArgs(await target.getAddress(), true); + expect(await swap.approvedTargets(target.getAddress())).to.eq(true); + await expect(swap.updateApprovedTarget(target.getAddress(), false)) .to.emit(swap, "UpdateApprovedTarget") - .withArgs(target.address, false); - expect(await swap.approvedTargets(target.address)).to.eq(false); + .withArgs(await target.getAddress(), false); + expect(await swap.approvedTargets(target.getAddress())).to.eq(false); }); }); context("#withdraw", async () => { it("should revert, when non-owner call", async () => { - await expect(swap.connect(signer).withdraw(constants.AddressZero, 0)).to.revertedWith( - "caller is not the owner" - ); + await expect(swap.connect(signer).withdraw(ZeroAddress, 0)).to.revertedWith("Ownable: caller is not the owner"); }); it("should succeed, when withdraw ETH", async () => { - await deployer.sendTransaction({ to: swap.address, value: ethers.utils.parseEther("1") }); - const balanceBefore = await deployer.getBalance(); - const tx = await swap.withdraw(constants.AddressZero, ethers.utils.parseEther("1")); + await deployer.sendTransaction({ to: swap.getAddress(), value: ethers.parseEther("1") }); + const balanceBefore = await ethers.provider.getBalance(deployer.address); + const tx = await swap.withdraw(ZeroAddress, ethers.parseEther("1")); const receipt = await tx.wait(); - const balanceAfter = await deployer.getBalance(); - expect(balanceAfter.sub(balanceBefore)).to.eq( - ethers.utils.parseEther("1").sub(receipt.gasUsed.mul(receipt.effectiveGasPrice)) - ); + const balanceAfter = await ethers.provider.getBalance(deployer.address); + expect(balanceAfter - balanceBefore).to.eq(ethers.parseEther("1") - receipt!.gasUsed * receipt!.gasPrice); }); it("should succeed, when withdraw token", async () => { - await token.mint(swap.address, ethers.utils.parseEther("1")); + await token.mint(swap.getAddress(), ethers.parseEther("1")); const balanceBefore = await token.balanceOf(deployer.address); - await swap.withdraw(token.address, ethers.utils.parseEther("1")); + await swap.withdraw(token.getAddress(), ethers.parseEther("1")); const balanceAfter = await token.balanceOf(deployer.address); - expect(balanceAfter.sub(balanceBefore)).to.eq(ethers.utils.parseEther("1")); + expect(balanceAfter - balanceBefore).to.eq(ethers.parseEther("1")); }); }); }); - const permit = async (amount: BigNumber) => { + const permit = async (amount: bigint) => { const value = { owner: signer.address, - spender: swap.address, + spender: await swap.getAddress(), value: amount, nonce: await token.nonces(signer.address), - deadline: constants.MaxUint256, + deadline: MaxUint256, }; const domain = { name: await token.name(), version: "1", chainId: (await ethers.provider.getNetwork()).chainId, - verifyingContract: token.address, + verifyingContract: await token.getAddress(), }; const types = { @@ -142,7 +134,7 @@ describe("GasSwap.spec", async () => { ], }; - const signature = splitSignature(await signer._signTypedData(domain, types, value)); + const signature = Signature.from(await signer.signTypedData(domain, types, value)); return signature; }; @@ -151,15 +143,15 @@ describe("GasSwap.spec", async () => { await expect( swap.swap( { - token: token.address, + token: token.getAddress(), value: 0, deadline: 0, - r: constants.HashZero, - s: constants.HashZero, + r: ZeroHash, + s: ZeroHash, v: 0, }, { - target: target.address, + target: target.getAddress(), data: "0x", minOutput: 0, } @@ -168,121 +160,119 @@ describe("GasSwap.spec", async () => { }); it("should revert, when insufficient output amount", async () => { - const amountIn = ethers.utils.parseEther("1"); - const amountOut = ethers.utils.parseEther("2"); + const amountIn = ethers.parseEther("1"); + const amountOut = ethers.parseEther("2"); await token.mint(signer.address, amountIn); - await deployer.sendTransaction({ to: target.address, value: amountOut }); + await deployer.sendTransaction({ to: target.getAddress(), value: amountOut }); const signature = await permit(amountIn); - await target.setToken(token.address); + await target.setToken(token.getAddress()); await target.setAmountIn(amountIn); - await swap.updateApprovedTarget(target.address, true); + await swap.updateApprovedTarget(target.getAddress(), true); await expect( swap.connect(signer).swap( { - token: token.address, + token: await token.getAddress(), value: amountIn, - deadline: constants.MaxUint256, + deadline: MaxUint256, r: signature.r, s: signature.s, v: signature.v, }, { - target: target.address, + target: target.getAddress(), data: "0x8119c065", - minOutput: amountOut.add(1), + minOutput: amountOut + 1n, } ) ).to.revertedWith("insufficient output amount"); }); - for (const refundRatio of ["0", "1", "5"]) { + for (const refundRatio of [0n, 1n, 5n]) { for (const feeRatio of ["0", "5", "50"]) { it(`should succeed, when swap by signer directly, with feeRatio[${feeRatio}%] refundRatio[${refundRatio}%]`, async () => { - const amountIn = ethers.utils.parseEther("1"); - const amountOut = ethers.utils.parseEther("2"); + const amountIn = ethers.parseEther("1"); + const amountOut = ethers.parseEther("2"); await token.mint(signer.address, amountIn); - await deployer.sendTransaction({ to: target.address, value: amountOut }); + await deployer.sendTransaction({ to: target.getAddress(), value: amountOut }); const signature = await permit(amountIn); - await target.setToken(token.address); + await target.setToken(token.getAddress()); await target.setAmountIn(amountIn); - await target.setRefund(amountIn.mul(refundRatio).div(100)); + await target.setRefund((amountIn * refundRatio) / 100n); - await swap.updateApprovedTarget(target.address, true); - await swap.updateFeeRatio(ethers.utils.parseEther(feeRatio).div(100)); - const fee = amountOut.mul(feeRatio).div(100); + await swap.updateApprovedTarget(target.getAddress(), true); + await swap.updateFeeRatio(ethers.parseEther(feeRatio) / 100n); + const fee = (amountOut * toBigInt(feeRatio)) / 100n; - const balanceBefore = await signer.getBalance(); + const balanceBefore = await ethers.provider.getBalance(signer.address); const tx = await swap.connect(signer).swap( { - token: token.address, + token: await token.getAddress(), value: amountIn, - deadline: constants.MaxUint256, + deadline: MaxUint256, r: signature.r, s: signature.s, v: signature.v, }, { - target: target.address, + target: target.getAddress(), data: "0x8119c065", - minOutput: amountOut.sub(fee), + minOutput: amountOut - fee, } ); const receipt = await tx.wait(); - const balanceAfter = await signer.getBalance(); - expect(balanceAfter.sub(balanceBefore)).to.eq( - amountOut.sub(fee).sub(receipt.gasUsed.mul(receipt.effectiveGasPrice)) - ); - expect(await token.balanceOf(signer.address)).to.eq(amountIn.mul(refundRatio).div(100)); + const balanceAfter = await ethers.provider.getBalance(signer.address); + expect(balanceAfter - balanceBefore).to.eq(amountOut - fee - receipt!.gasUsed * receipt!.gasPrice); + expect(await token.balanceOf(signer.address)).to.eq((amountIn * refundRatio) / 100n); }); it(`should succeed, when swap by signer with forwarder, with feeRatio[${feeRatio}%] refundRatio[${refundRatio}%]`, async () => { - const amountIn = ethers.utils.parseEther("1"); - const amountOut = ethers.utils.parseEther("2"); + const amountIn = ethers.parseEther("1"); + const amountOut = ethers.parseEther("2"); await token.mint(signer.address, amountIn); - await deployer.sendTransaction({ to: target.address, value: amountOut }); + await deployer.sendTransaction({ to: await target.getAddress(), value: amountOut }); const permitSignature = await permit(amountIn); - await target.setToken(token.address); + await target.setToken(token.getAddress()); await target.setAmountIn(amountIn); - await target.setRefund(amountIn.mul(refundRatio).div(100)); + await target.setRefund((amountIn * refundRatio) / 100n); - await swap.updateApprovedTarget(target.address, true); - await swap.updateFeeRatio(ethers.utils.parseEther(feeRatio).div(100)); - const fee = amountOut.mul(feeRatio).div(100); + await swap.updateApprovedTarget(target.getAddress(), true); + await swap.updateFeeRatio(ethers.parseEther(feeRatio) / 100n); + const fee = (amountOut * toBigInt(feeRatio)) / 100n; const reqWithoutSignature = { from: signer.address, - to: swap.address, - value: constants.Zero, + to: await swap.getAddress(), + value: 0n, gas: 1000000, nonce: await forwarder.nonces(signer.address), deadline: 2000000000, data: swap.interface.encodeFunctionData("swap", [ { - token: token.address, + token: await token.getAddress(), value: amountIn, - deadline: constants.MaxUint256, + deadline: MaxUint256, r: permitSignature.r, s: permitSignature.s, v: permitSignature.v, }, { - target: target.address, + target: await target.getAddress(), data: "0x8119c065", - minOutput: amountOut.sub(fee), + minOutput: amountOut - fee, }, ]), }; - const signature = await signer._signTypedData( + const signature = await signer.signTypedData( { name: "ERC2771Forwarder", version: "1", chainId: (await ethers.provider.getNetwork()).chainId, - verifyingContract: forwarder.address, + verifyingContract: await forwarder.getAddress(), }, { ForwardRequest: [ @@ -319,7 +309,7 @@ describe("GasSwap.spec", async () => { reqWithoutSignature ); - const balanceBefore = await signer.getBalance(); + const balanceBefore = await ethers.provider.getBalance(signer.address); await forwarder.execute({ from: reqWithoutSignature.from, to: reqWithoutSignature.to, @@ -329,9 +319,9 @@ describe("GasSwap.spec", async () => { data: reqWithoutSignature.data, signature, }); - const balanceAfter = await signer.getBalance(); - expect(balanceAfter.sub(balanceBefore)).to.eq(amountOut.sub(fee)); - expect(await token.balanceOf(signer.address)).to.eq(amountIn.mul(refundRatio).div(100)); + const balanceAfter = await ethers.provider.getBalance(signer.address); + expect(balanceAfter - balanceBefore).to.eq(amountOut - fee); + expect(await token.balanceOf(signer.address)).to.eq((amountIn * refundRatio) / 100n); }); } } diff --git a/contracts/integration-test/L1BlockContainer.spec.ts b/contracts/integration-test/L1BlockContainer.spec.ts index 409773f8d6..257a7a8501 100644 --- a/contracts/integration-test/L1BlockContainer.spec.ts +++ b/contracts/integration-test/L1BlockContainer.spec.ts @@ -1,9 +1,9 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ import { expect } from "chai"; -import { BigNumber, BigNumberish, constants } from "ethers"; -import { concat, RLP } from "ethers/lib/utils"; +import { BigNumberish, ZeroHash, concat, encodeRlp, toBeHex, toBigInt } from "ethers"; import { ethers } from "hardhat"; + import { L1BlockContainer } from "../typechain"; interface IImportTestConfig { @@ -90,7 +90,7 @@ const testcases: Array = [ ]; function encodeHeader(test: IImportTestConfig): string { - return RLP.encode([ + return encodeRlp([ test.parentHash, test.uncleHash, test.coinbase, @@ -98,15 +98,15 @@ function encodeHeader(test: IImportTestConfig): string { test.transactionsRoot, test.receiptsRoot, test.logsBloom, - BigNumber.from(test.difficulty).isZero() ? "0x" : BigNumber.from(test.difficulty).toHexString(), - BigNumber.from(test.blockHeight).toHexString(), - BigNumber.from(test.gasLimit).toHexString(), - BigNumber.from(test.gasUsed).toHexString(), - BigNumber.from(test.blockTimestamp).toHexString(), + toBigInt(test.difficulty) === 0n ? "0x" : toBeHex(test.difficulty), + toBeHex(test.blockHeight), + toBeHex(test.gasLimit), + toBeHex(test.gasUsed), + toBeHex(test.blockTimestamp), test.extraData, test.mixHash, test.blockNonce, - BigNumber.from(test.baseFee).toHexString(), + toBeHex(test.baseFee), ]); } @@ -124,7 +124,7 @@ describe("L1BlockContainer", async () => { const whitelist = await Whitelist.deploy(deployer.address); await whitelist.updateWhitelistStatus([deployer.address], true); - await container.updateWhitelist(whitelist.address); + await container.updateWhitelist(whitelist.getAddress()); }); it("should revert, when sender not allowed", async () => { @@ -137,7 +137,7 @@ describe("L1BlockContainer", async () => { test.stateRoot ); - await expect(container.connect(signer).importBlockHeader(constants.HashZero, [], false)).to.revertedWith( + await expect(container.connect(signer).importBlockHeader(ZeroHash, "0x", false)).to.revertedWith( "Not whitelisted sender" ); }); @@ -172,7 +172,7 @@ describe("L1BlockContainer", async () => { it("should revert, when parent not imported", async () => { await container.initialize( - constants.HashZero, + ZeroHash, test.blockHeight - 1, test.blockTimestamp - 1, test.baseFee, diff --git a/contracts/integration-test/L1MessageQueue.spec.ts b/contracts/integration-test/L1MessageQueue.spec.ts index c363ce0eaa..33109a2d00 100644 --- a/contracts/integration-test/L1MessageQueue.spec.ts +++ b/contracts/integration-test/L1MessageQueue.spec.ts @@ -1,18 +1,29 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; import { expect } from "chai"; -import { BigNumber, constants } from "ethers"; -import { concat, getAddress, hexlify, keccak256, randomBytes, RLP, stripZeros } from "ethers/lib/utils"; import { ethers } from "hardhat"; + import { L1MessageQueue, L2GasPriceOracle } from "../typechain"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { + MaxUint256, + ZeroAddress, + concat, + encodeRlp, + getAddress, + hexlify, + keccak256, + randomBytes, + toBeHex, + toBigInt, +} from "ethers"; describe("L1MessageQueue", async () => { - let deployer: SignerWithAddress; - let scrollChain: SignerWithAddress; - let messenger: SignerWithAddress; - let gateway: SignerWithAddress; - let signer: SignerWithAddress; + let deployer: HardhatEthersSigner; + let scrollChain: HardhatEthersSigner; + let messenger: HardhatEthersSigner; + let gateway: HardhatEthersSigner; + let signer: HardhatEthersSigner; let oracle: L2GasPriceOracle; let queue: L1MessageQueue; @@ -21,10 +32,8 @@ describe("L1MessageQueue", async () => { const TransparentUpgradeableProxy = await ethers.getContractFactory("TransparentUpgradeableProxy", deployer); const Factory = await ethers.getContractFactory(name, deployer); const impl = args.length > 0 ? await Factory.deploy(...args) : await Factory.deploy(); - await impl.deployed(); - const proxy = await TransparentUpgradeableProxy.deploy(impl.address, admin, "0x"); - await proxy.deployed(); - return proxy.address; + const proxy = await TransparentUpgradeableProxy.deploy(impl.getAddress(), admin, "0x"); + return proxy.getAddress(); }; beforeEach(async () => { @@ -32,22 +41,25 @@ describe("L1MessageQueue", async () => { const ProxyAdmin = await ethers.getContractFactory("ProxyAdmin", deployer); const admin = await ProxyAdmin.deploy(); - await admin.deployed(); queue = await ethers.getContractAt( "L1MessageQueue", - await deployProxy("L1MessageQueue", admin.address, [messenger.address, scrollChain.address, gateway.address]), + await deployProxy("L1MessageQueue", await admin.getAddress(), [ + messenger.address, + scrollChain.address, + gateway.address, + ]), deployer ); oracle = await ethers.getContractAt( "L2GasPriceOracle", - await deployProxy("L2GasPriceOracle", admin.address, []), + await deployProxy("L2GasPriceOracle", await admin.getAddress(), []), deployer ); await oracle.initialize(21000, 50000, 8, 16); - await queue.initialize(messenger.address, scrollChain.address, constants.AddressZero, oracle.address, 10000000); + await queue.initialize(messenger.address, scrollChain.address, ZeroAddress, oracle.getAddress(), 10000000); }); context("auth", async () => { @@ -56,28 +68,28 @@ describe("L1MessageQueue", async () => { expect(await queue.messenger()).to.eq(messenger.address); expect(await queue.scrollChain()).to.eq(scrollChain.address); expect(await queue.enforcedTxGateway()).to.eq(gateway.address); - expect(await queue.gasOracle()).to.eq(oracle.address); + expect(await queue.gasOracle()).to.eq(await oracle.getAddress()); expect(await queue.maxGasLimit()).to.eq(10000000); }); it("should revert, when initialize again", async () => { - await expect( - queue.initialize(constants.AddressZero, constants.AddressZero, constants.AddressZero, constants.AddressZero, 0) - ).to.revertedWith("Initializable: contract is already initialized"); + await expect(queue.initialize(ZeroAddress, ZeroAddress, ZeroAddress, ZeroAddress, 0)).to.revertedWith( + "Initializable: contract is already initialized" + ); }); context("#updateGasOracle", async () => { it("should revert, when non-owner call", async () => { - await expect(queue.connect(signer).updateGasOracle(constants.AddressZero)).to.revertedWith( + await expect(queue.connect(signer).updateGasOracle(ZeroAddress)).to.revertedWith( "Ownable: caller is not the owner" ); }); it("should succeed", async () => { - expect(await queue.gasOracle()).to.eq(oracle.address); + expect(await queue.gasOracle()).to.eq(await oracle.getAddress()); await expect(queue.updateGasOracle(deployer.address)) .to.emit(queue, "UpdateGasOracle") - .withArgs(oracle.address, deployer.address); + .withArgs(await oracle.getAddress(), deployer.address); expect(await queue.gasOracle()).to.eq(deployer.address); }); }); @@ -101,30 +113,9 @@ describe("L1MessageQueue", async () => { const target = "0xcb18150e4efefb6786130e289a5f61a82a5b86d7"; const transactionType = "0x7E"; - for (const nonce of [ - BigNumber.from(0), - BigNumber.from(1), - BigNumber.from(127), - BigNumber.from(128), - BigNumber.from(22334455), - constants.MaxUint256, - ]) { - for (const value of [ - BigNumber.from(0), - BigNumber.from(1), - BigNumber.from(127), - BigNumber.from(128), - BigNumber.from(22334455), - constants.MaxUint256, - ]) { - for (const gasLimit of [ - BigNumber.from(0), - BigNumber.from(1), - BigNumber.from(127), - BigNumber.from(128), - BigNumber.from(22334455), - constants.MaxUint256, - ]) { + for (const nonce of [0n, 1n, 127n, 128n, 22334455n, MaxUint256]) { + for (const value of [0n, 1n, 127n, 128n, 22334455n, MaxUint256]) { + for (const gasLimit of [0n, 1n, 127n, 128n, 22334455n, MaxUint256]) { for (const dataLen of [0, 1, 2, 3, 4, 55, 56, 100]) { const tests = [randomBytes(dataLen)]; if (dataLen === 1) { @@ -133,11 +124,11 @@ describe("L1MessageQueue", async () => { } } for (const data of tests) { - const transactionPayload = RLP.encode([ - stripZeros(nonce.toHexString()), - stripZeros(gasLimit.toHexString()), + const transactionPayload = encodeRlp([ + nonce === 0n ? "0x" : toBeHex(nonce), + gasLimit === 0n ? "0x" : toBeHex(gasLimit), target, - stripZeros(value.toHexString()), + value === 0n ? "0x" : toBeHex(value), data, sender, ]); @@ -159,30 +150,27 @@ describe("L1MessageQueue", async () => { context("#appendCrossDomainMessage", async () => { it("should revert, when non-messenger call", async () => { - await expect(queue.connect(signer).appendCrossDomainMessage(constants.AddressZero, 0, "0x")).to.revertedWith( + await expect(queue.connect(signer).appendCrossDomainMessage(ZeroAddress, 0, "0x")).to.revertedWith( "Only callable by the L1ScrollMessenger" ); }); it("should revert, when exceed maxGasLimit", async () => { - await expect( - queue.connect(messenger).appendCrossDomainMessage(constants.AddressZero, 10000001, "0x") - ).to.revertedWith("Gas limit must not exceed maxGasLimit"); + await expect(queue.connect(messenger).appendCrossDomainMessage(ZeroAddress, 10000001, "0x")).to.revertedWith( + "Gas limit must not exceed maxGasLimit" + ); }); it("should revert, when below intrinsic gas", async () => { - await expect(queue.connect(messenger).appendCrossDomainMessage(constants.AddressZero, 0, "0x")).to.revertedWith( + await expect(queue.connect(messenger).appendCrossDomainMessage(ZeroAddress, 0, "0x")).to.revertedWith( "Insufficient gas limit, must be above intrinsic gas" ); }); it("should succeed", async () => { - expect(await queue.nextCrossDomainMessageIndex()).to.eq(constants.Zero); + expect(await queue.nextCrossDomainMessageIndex()).to.eq(0n); const sender = getAddress( - BigNumber.from(messenger.address) - .add("0x1111000000000000000000000000000000001111") - .mod(BigNumber.from(2).pow(160)) - .toHexString() + toBeHex((toBigInt(messenger.address) + toBigInt("0x1111000000000000000000000000000000001111")) % 2n ** 160n) .slice(2) .padStart(40, "0") ); @@ -190,7 +178,7 @@ describe("L1MessageQueue", async () => { await expect(queue.connect(messenger).appendCrossDomainMessage(signer.address, 100000, "0x01")) .to.emit(queue, "QueueTransaction") .withArgs(sender, signer.address, 0, 0, 100000, "0x01"); - expect(await queue.nextCrossDomainMessageIndex()).to.eq(constants.One); + expect(await queue.nextCrossDomainMessageIndex()).to.eq(1n); expect(await queue.getCrossDomainMessage(0)).to.eq(hash); }); }); @@ -198,30 +186,30 @@ describe("L1MessageQueue", async () => { context("#appendEnforcedTransaction", async () => { it("should revert, when non-gateway call", async () => { await expect( - queue.connect(signer).appendEnforcedTransaction(signer.address, constants.AddressZero, 0, 0, "0x") + queue.connect(signer).appendEnforcedTransaction(signer.address, ZeroAddress, 0, 0, "0x") ).to.revertedWith("Only callable by the EnforcedTxGateway"); }); it("should revert, when sender is not EOA", async () => { await expect( - queue.connect(gateway).appendEnforcedTransaction(queue.address, constants.AddressZero, 0, 0, "0x") + queue.connect(gateway).appendEnforcedTransaction(queue.getAddress(), ZeroAddress, 0, 0, "0x") ).to.revertedWith("only EOA"); }); it("should revert, when exceed maxGasLimit", async () => { await expect( - queue.connect(gateway).appendEnforcedTransaction(signer.address, constants.AddressZero, 0, 10000001, "0x") + queue.connect(gateway).appendEnforcedTransaction(signer.address, ZeroAddress, 0, 10000001, "0x") ).to.revertedWith("Gas limit must not exceed maxGasLimit"); }); it("should revert, when below intrinsic gas", async () => { await expect( - queue.connect(gateway).appendEnforcedTransaction(signer.address, constants.AddressZero, 0, 0, "0x") + queue.connect(gateway).appendEnforcedTransaction(signer.address, ZeroAddress, 0, 0, "0x") ).to.revertedWith("Insufficient gas limit, must be above intrinsic gas"); }); it("should succeed", async () => { - expect(await queue.nextCrossDomainMessageIndex()).to.eq(constants.Zero); + expect(await queue.nextCrossDomainMessageIndex()).to.eq(0n); const sender = signer.address; const hash = await queue.computeTransactionHash(sender, 0, 200, signer.address, 100000, "0x01"); await expect( @@ -229,7 +217,7 @@ describe("L1MessageQueue", async () => { ) .to.emit(queue, "QueueTransaction") .withArgs(sender, signer.address, 200, 0, 100000, "0x01"); - expect(await queue.nextCrossDomainMessageIndex()).to.eq(constants.One); + expect(await queue.nextCrossDomainMessageIndex()).to.eq(1n); expect(await queue.getCrossDomainMessage(0)).to.eq(hash); }); }); @@ -254,7 +242,7 @@ describe("L1MessageQueue", async () => { it("should succeed", async () => { // append 512 messages for (let i = 0; i < 256 * 2; i++) { - await queue.connect(messenger).appendCrossDomainMessage(constants.AddressZero, 1000000, "0x"); + await queue.connect(messenger).appendCrossDomainMessage(ZeroAddress, 1000000, "0x"); } // pop 50 messages with no skip @@ -292,17 +280,12 @@ describe("L1MessageQueue", async () => { } // pop 256 messages with random skip - const bitmap = BigNumber.from("0x496525059c3f33758d17030403e45afe067b8a0ae1317cda0487fd2932cbea1a"); + const bitmap = toBigInt("0x496525059c3f33758d17030403e45afe067b8a0ae1317cda0487fd2932cbea1a"); const tx = await queue.connect(scrollChain).popCrossDomainMessage(80, 256, bitmap); await expect(tx).to.emit(queue, "DequeueTransaction").withArgs(80, 256, bitmap); - console.log("gas used:", (await tx.wait()).gasUsed.toString()); + console.log("gas used:", (await tx.wait())!.gasUsed.toString()); for (let i = 80; i < 80 + 256; i++) { - expect(await queue.isMessageSkipped(i)).to.eq( - bitmap - .shr(i - 80) - .and(1) - .eq(1) - ); + expect(await queue.isMessageSkipped(i)).to.eq(((bitmap >> toBigInt(i - 80)) & 1n) === 1n); expect(await queue.isMessageDropped(i)).to.eq(false); } }); @@ -314,39 +297,39 @@ describe("L1MessageQueue", async () => { it.skip(`should succeed on random tests, pop three times each with ${count1} ${count2} ${count3} msgs`, async () => { // append count1 + count2 + count3 messages for (let i = 0; i < count1 + count2 + count3; i++) { - await queue.connect(messenger).appendCrossDomainMessage(constants.AddressZero, 1000000, "0x"); + await queue.connect(messenger).appendCrossDomainMessage(ZeroAddress, 1000000, "0x"); } // first pop `count1` messages - const bitmap1 = BigNumber.from(randomBytes(32)); + const bitmap1 = toBigInt(randomBytes(32)); let tx = await queue.connect(scrollChain).popCrossDomainMessage(0, count1, bitmap1); await expect(tx) .to.emit(queue, "DequeueTransaction") - .withArgs(0, count1, bitmap1.and(constants.One.shl(count1).sub(1))); + .withArgs(0, count1, bitmap1 & ((1n << toBigInt(count1)) - 1n)); for (let i = 0; i < count1; i++) { - expect(await queue.isMessageSkipped(i)).to.eq(bitmap1.shr(i).and(1).eq(1)); + expect(await queue.isMessageSkipped(i)).to.eq(((bitmap1 >> toBigInt(i)) & 1n) === 1n); expect(await queue.isMessageDropped(i)).to.eq(false); } // then pop `count2` messages - const bitmap2 = BigNumber.from(randomBytes(32)); + const bitmap2 = toBigInt(randomBytes(32)); tx = await queue.connect(scrollChain).popCrossDomainMessage(count1, count2, bitmap2); await expect(tx) .to.emit(queue, "DequeueTransaction") - .withArgs(count1, count2, bitmap2.and(constants.One.shl(count2).sub(1))); + .withArgs(count1, count2, bitmap2 & ((1n << toBigInt(count2)) - 1n)); for (let i = 0; i < count2; i++) { - expect(await queue.isMessageSkipped(i + count1)).to.eq(bitmap2.shr(i).and(1).eq(1)); + expect(await queue.isMessageSkipped(i + count1)).to.eq(((bitmap2 >> toBigInt(i)) & 1n) === 1n); expect(await queue.isMessageDropped(i + count1)).to.eq(false); } // last pop `count3` messages - const bitmap3 = BigNumber.from(randomBytes(32)); + const bitmap3 = toBigInt(randomBytes(32)); tx = await queue.connect(scrollChain).popCrossDomainMessage(count1 + count2, count3, bitmap3); await expect(tx) .to.emit(queue, "DequeueTransaction") - .withArgs(count1 + count2, count3, bitmap3.and(constants.One.shl(count3).sub(1))); + .withArgs(count1 + count2, count3, bitmap3 & ((1n << toBigInt(count3)) - 1n)); for (let i = 0; i < count3; i++) { - expect(await queue.isMessageSkipped(i + count1 + count2)).to.eq(bitmap3.shr(i).and(1).eq(1)); + expect(await queue.isMessageSkipped(i + count1 + count2)).to.eq(((bitmap3 >> toBigInt(i)) & 1n) === 1n); expect(await queue.isMessageDropped(i + count1 + count2)).to.eq(false); } }); @@ -365,7 +348,7 @@ describe("L1MessageQueue", async () => { it("should revert, when drop non-skipped message", async () => { // append 10 messages for (let i = 0; i < 10; i++) { - await queue.connect(messenger).appendCrossDomainMessage(constants.AddressZero, 1000000, "0x"); + await queue.connect(messenger).appendCrossDomainMessage(ZeroAddress, 1000000, "0x"); } // pop 5 messages with no skip await expect(queue.connect(scrollChain).popCrossDomainMessage(0, 5, 0)) @@ -390,7 +373,7 @@ describe("L1MessageQueue", async () => { it("should succeed", async () => { // append 10 messages for (let i = 0; i < 10; i++) { - await queue.connect(messenger).appendCrossDomainMessage(constants.AddressZero, 1000000, "0x"); + await queue.connect(messenger).appendCrossDomainMessage(ZeroAddress, 1000000, "0x"); } // pop 10 messages, all skipped await expect(queue.connect(scrollChain).popCrossDomainMessage(0, 10, 0x3ff)) diff --git a/contracts/integration-test/PatriciaMerkleTrieVerifier.spec.ts b/contracts/integration-test/PatriciaMerkleTrieVerifier.spec.ts index 5e3c37a77d..10750cd1f2 100644 --- a/contracts/integration-test/PatriciaMerkleTrieVerifier.spec.ts +++ b/contracts/integration-test/PatriciaMerkleTrieVerifier.spec.ts @@ -1,8 +1,9 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ import { expect } from "chai"; -import { concat } from "ethers/lib/utils"; +import { concat } from "ethers"; import { ethers } from "hardhat"; + import { MockPatriciaMerkleTrieVerifier } from "../typechain"; interface ITestConfig { @@ -121,7 +122,6 @@ describe("PatriciaMerkleTrieVerifier", async () => { const MockPatriciaMerkleTrieVerifier = await ethers.getContractFactory("MockPatriciaMerkleTrieVerifier", deployer); verifier = await MockPatriciaMerkleTrieVerifier.deploy(); - await verifier.deployed(); }); for (const test of testcases) { diff --git a/contracts/integration-test/PoseidonHash.spec.ts b/contracts/integration-test/PoseidonHash.spec.ts index 5746cb3f2e..21382580db 100644 --- a/contracts/integration-test/PoseidonHash.spec.ts +++ b/contracts/integration-test/PoseidonHash.spec.ts @@ -2,9 +2,9 @@ /* eslint-disable node/no-unpublished-import */ import { expect } from "chai"; import { randomBytes } from "crypto"; -import { BigNumber, Contract } from "ethers"; -import { ethers } from "hardhat"; +import { Contract, toBigInt } from "ethers"; import fs from "fs"; +import { ethers } from "hardhat"; import PoseidonWithoutDomain from "circomlib/src/poseidon_gencontract"; import { generateABI, createCode } from "../scripts/poseidon"; @@ -23,12 +23,10 @@ describe("PoseidonHash.spec", async () => { PoseidonWithoutDomain.createCode(2), deployer ); - poseidonCircom = await PoseidonWithoutDomainFactory.deploy(); - await poseidonCircom.deployed(); + poseidonCircom = (await PoseidonWithoutDomainFactory.deploy()) as Contract; const PoseidonWithDomainFactory = new ethers.ContractFactory(generateABI(2), createCode(2), deployer); - poseidon = await PoseidonWithDomainFactory.deploy(); - await poseidon.deployed(); + poseidon = (await PoseidonWithDomainFactory.deploy()) as Contract; }); it("should succeed on zero inputs", async () => { @@ -40,8 +38,8 @@ describe("PoseidonHash.spec", async () => { it("should succeed on random inputs", async () => { for (let bytes = 1; bytes <= 32; ++bytes) { for (let i = 0; i < 5; ++i) { - const a = randomBytes(bytes); - const b = randomBytes(bytes); + const a = toBigInt(randomBytes(bytes)); + const b = toBigInt(randomBytes(bytes)); expect(await poseidonCircom["poseidon(uint256[2])"]([a, b])).to.eq( await poseidon["poseidon(uint256[2],uint256)"]([a, b], 0) ); @@ -58,31 +56,20 @@ describe("PoseidonHash.spec", async () => { // test against with scroll's go implementation. context("domain = nonzero", async () => { - let poseidonCircom: Contract; let poseidon: Contract; beforeEach(async () => { const [deployer] = await ethers.getSigners(); - - const PoseidonWithoutDomainFactory = new ethers.ContractFactory( - PoseidonWithoutDomain.generateABI(2), - PoseidonWithoutDomain.createCode(2), - deployer - ); - poseidonCircom = await PoseidonWithoutDomainFactory.deploy(); - await poseidonCircom.deployed(); - const PoseidonWithDomainFactory = new ethers.ContractFactory(generateABI(2), createCode(2), deployer); - poseidon = await PoseidonWithDomainFactory.deploy(); - await poseidon.deployed(); + poseidon = (await PoseidonWithDomainFactory.deploy()) as Contract; }); it("should succeed on zero inputs", async () => { expect(await poseidon["poseidon(uint256[2],uint256)"]([0, 0], 6)).to.eq( - BigNumber.from("17848312925884193353134534408113064827548730776291701343555436351962284922129") + toBigInt("17848312925884193353134534408113064827548730776291701343555436351962284922129") ); expect(await poseidon["poseidon(uint256[2],uint256)"]([0, 0], 7)).to.eq( - BigNumber.from("20994231331856095272861976502721128670019193481895476667943874333621461724676") + toBigInt("20994231331856095272861976502721128670019193481895476667943874333621461724676") ); }); @@ -90,7 +77,7 @@ describe("PoseidonHash.spec", async () => { const lines = String(fs.readFileSync("./integration-test/testdata/poseidon_hash_with_domain.data")).split("\n"); for (const line of lines) { const [domain, a, b, hash] = line.split(" "); - expect(await poseidon["poseidon(uint256[2],uint256)"]([a, b], domain)).to.eq(BigNumber.from(hash)); + expect(await poseidon["poseidon(uint256[2],uint256)"]([a, b], domain)).to.eq(toBigInt(hash)); } }); }); diff --git a/contracts/integration-test/ScrollChain.blob.spec.ts b/contracts/integration-test/ScrollChain.blob.spec.ts new file mode 100644 index 0000000000..b30ed82f9d --- /dev/null +++ b/contracts/integration-test/ScrollChain.blob.spec.ts @@ -0,0 +1,162 @@ +/* eslint-disable node/no-unpublished-import */ +/* eslint-disable node/no-missing-import */ +import { ZeroAddress } from "ethers"; +import { ethers } from "hardhat"; + +import { ScrollChain, L1MessageQueue } from "../typechain"; +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; +import { randomBytes } from "crypto"; +import { expect } from "chai"; + +describe("ScrollChain.blob", async () => { + let deployer: HardhatEthersSigner; + let signer: HardhatEthersSigner; + + let queue: L1MessageQueue; + let chain: ScrollChain; + + beforeEach(async () => { + [deployer, signer] = await ethers.getSigners(); + + const EmptyContract = await ethers.getContractFactory("EmptyContract", deployer); + const empty = await EmptyContract.deploy(); + + const ProxyAdmin = await ethers.getContractFactory("ProxyAdmin", deployer); + const admin = await ProxyAdmin.deploy(); + + const TransparentUpgradeableProxy = await ethers.getContractFactory("TransparentUpgradeableProxy", deployer); + const queueProxy = await TransparentUpgradeableProxy.deploy(empty.getAddress(), admin.getAddress(), "0x"); + const chainProxy = await TransparentUpgradeableProxy.deploy(empty.getAddress(), admin.getAddress(), "0x"); + + const L1MessageQueue = await ethers.getContractFactory("L1MessageQueue", deployer); + const queueImpl = await L1MessageQueue.deploy(deployer.address, chainProxy.getAddress(), deployer.address); + await admin.upgrade(queueProxy.getAddress(), queueImpl.getAddress()); + + const ScrollChain = await ethers.getContractFactory("ScrollChain", deployer); + const chainImpl = await ScrollChain.deploy(0, queueProxy.getAddress(), deployer.address); + await admin.upgrade(chainProxy.getAddress(), chainImpl.getAddress()); + + queue = await ethers.getContractAt("L1MessageQueue", await queueProxy.getAddress(), deployer); + chain = await ethers.getContractAt("ScrollChain", await chainProxy.getAddress(), deployer); + + await chain.initialize(queue.getAddress(), ZeroAddress, 100); + await chain.addSequencer(deployer.address); + await chain.addProver(deployer.address); + await queue.initialize(deployer.address, chain.getAddress(), deployer.address, deployer.address, 10000000); + }); + + context("commit batch", async () => { + let batchHeader0: Uint8Array; + + beforeEach(async () => { + // import 10 L1 messages + for (let i = 0; i < 10; i++) { + queue.appendCrossDomainMessage(deployer.address, 1000000, "0x"); + } + + // import genesis batch first + batchHeader0 = new Uint8Array(89); + batchHeader0[25] = 1; + await chain.importGenesisBatch(batchHeader0, randomBytes(32)); + }); + + it("should revert when caller is not sequencer", async () => { + await expect(chain.connect(signer).commitBatch(1, batchHeader0, [], "0x")).to.revertedWithCustomError( + chain, + "ErrorCallerIsNotSequencer" + ); + }); + + it("should revert when batch is empty", async () => { + await expect(chain.commitBatch(1, batchHeader0, [], "0x")).to.revertedWithCustomError(chain, "ErrorBatchIsEmpty"); + }); + + it("should revert when batch header length too small", async () => { + const header = new Uint8Array(120); + header[0] = 1; + await expect(chain.commitBatch(1, header, ["0x"], "0x")).to.revertedWithCustomError( + chain, + "ErrorBatchHeaderLengthTooSmall" + ); + }); + + it("should revert when wrong bitmap length", async () => { + const header = new Uint8Array(122); + header[0] = 1; + await expect(chain.commitBatch(1, header, ["0x"], "0x")).to.revertedWithCustomError( + chain, + "ErrorIncorrectBitmapLength" + ); + }); + + it("should revert when incorrect parent batch hash", async () => { + batchHeader0[25] = 2; + await expect(chain.commitBatch(1, batchHeader0, ["0x"], "0x")).to.revertedWithCustomError( + chain, + "ErrorIncorrectBatchHash" + ); + batchHeader0[25] = 1; + }); + + it("should revert when ErrorInvalidBatchHeaderVersion", async () => { + const header = new Uint8Array(121); + header[0] = 2; + await expect(chain.commitBatch(1, header, ["0x"], "0x")).to.revertedWithCustomError( + chain, + "ErrorInvalidBatchHeaderVersion" + ); + await expect(chain.commitBatch(2, batchHeader0, ["0x"], "0x")).to.revertedWithCustomError( + chain, + "ErrorInvalidBatchHeaderVersion" + ); + }); + + it("should revert when ErrorNoBlobFound", async () => { + await expect(chain.commitBatch(1, batchHeader0, ["0x"], "0x")).to.revertedWithCustomError( + chain, + "ErrorNoBlobFound" + ); + }); + + /* Hardhat doesn't have support for EIP4844 yet. + const makeTransaction = async (data: string, value: bigint, blobVersionedHashes: Array) => { + const tx = new Transaction(); + tx.type = 3; + tx.to = await chain.getAddress(); + tx.data = data; + tx.nonce = await deployer.getNonce(); + tx.gasLimit = 1000000; + tx.maxPriorityFeePerGas = (await ethers.provider.getFeeData()).maxPriorityFeePerGas; + tx.maxFeePerGas = (await ethers.provider.getFeeData()).maxFeePerGas; + tx.value = value; + tx.chainId = (await ethers.provider.getNetwork()).chainId; + tx.maxFeePerBlobGas = ethers.parseUnits("1", "gwei"); + tx.blobVersionedHashes = blobVersionedHashes; + return tx; + }; + + it("should revert when ErrorFoundMultipleBlob", async () => { + const data = chain.interface.encodeFunctionData("commitBatch", [1, batchHeader0, ["0x"], "0x"]); + const tx = await makeTransaction(data, 0n, [ZeroHash, ZeroHash]); + const signature = await deployer.signMessage(tx.unsignedHash); + tx.signature = Signature.from(signature); + const r = await ethers.provider.broadcastTransaction(tx.serialized); + await expect(r).to.revertedWithCustomError(chain, "ErrorFoundMultipleBlob"); + }); + + it("should revert when ErrorNoBlockInChunk", async () => {}); + + it("should revert when ErrorIncorrectChunkLength", async () => {}); + + it("should revert when ErrorLastL1MessageSkipped", async () => {}); + + it("should revert when ErrorNumTxsLessThanNumL1Msgs", async () => {}); + + it("should revert when ErrorTooManyTxsInOneChunk", async () => {}); + + it("should revert when ErrorIncorrectBitmapLength", async () => {}); + + it("should succeed", async () => {}); + */ + }); +}); diff --git a/contracts/integration-test/ScrollChain.spec.ts b/contracts/integration-test/ScrollChain.spec.ts index 5ecf2268f3..256a41017a 100644 --- a/contracts/integration-test/ScrollChain.spec.ts +++ b/contracts/integration-test/ScrollChain.spec.ts @@ -1,8 +1,8 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ -import { concat } from "ethers/lib/utils"; -import { constants } from "ethers"; +import { ZeroAddress, concat, getBytes } from "ethers"; import { ethers } from "hardhat"; + import { ScrollChain, L1MessageQueue } from "../typechain"; describe("ScrollChain", async () => { @@ -14,40 +14,28 @@ describe("ScrollChain", async () => { const EmptyContract = await ethers.getContractFactory("EmptyContract", deployer); const empty = await EmptyContract.deploy(); - await empty.deployed(); const ProxyAdmin = await ethers.getContractFactory("ProxyAdmin", deployer); const admin = await ProxyAdmin.deploy(); - await admin.deployed(); const TransparentUpgradeableProxy = await ethers.getContractFactory("TransparentUpgradeableProxy", deployer); - const queueProxy = await TransparentUpgradeableProxy.deploy(empty.address, admin.address, "0x"); - await queueProxy.deployed(); - const chainProxy = await TransparentUpgradeableProxy.deploy(empty.address, admin.address, "0x"); - await chainProxy.deployed(); + const queueProxy = await TransparentUpgradeableProxy.deploy(empty.getAddress(), admin.getAddress(), "0x"); + const chainProxy = await TransparentUpgradeableProxy.deploy(empty.getAddress(), admin.getAddress(), "0x"); const L1MessageQueue = await ethers.getContractFactory("L1MessageQueue", deployer); - const queueImpl = await L1MessageQueue.deploy(constants.AddressZero, chainProxy.address, deployer.address); - await queueImpl.deployed(); - await admin.upgrade(queueProxy.address, queueImpl.address); + const queueImpl = await L1MessageQueue.deploy(ZeroAddress, chainProxy.getAddress(), deployer.address); + await admin.upgrade(queueProxy.getAddress(), queueImpl.getAddress()); const ScrollChain = await ethers.getContractFactory("ScrollChain", deployer); - const chainImpl = await ScrollChain.deploy(0, queueProxy.address, deployer.address); - await chainImpl.deployed(); - await admin.upgrade(chainProxy.address, chainImpl.address); + const chainImpl = await ScrollChain.deploy(0, queueProxy.getAddress(), deployer.address); + await admin.upgrade(chainProxy.getAddress(), chainImpl.getAddress()); - queue = await ethers.getContractAt("L1MessageQueue", queueProxy.address, deployer); - chain = await ethers.getContractAt("ScrollChain", chainProxy.address, deployer); + queue = await ethers.getContractAt("L1MessageQueue", await queueProxy.getAddress(), deployer); + chain = await ethers.getContractAt("ScrollChain", await chainProxy.getAddress(), deployer); - await chain.initialize(queue.address, constants.AddressZero, 100); + await chain.initialize(queue.getAddress(), ZeroAddress, 100); await chain.addSequencer(deployer.address); - await queue.initialize( - constants.AddressZero, - chain.address, - constants.AddressZero, - constants.AddressZero, - 10000000 - ); + await queue.initialize(ZeroAddress, chain.getAddress(), ZeroAddress, ZeroAddress, 10000000); }); // @note skip this benchmark tests @@ -82,12 +70,12 @@ describe("ScrollChain", async () => { for (let i = 0; i < numChunks; i++) { const txsInChunk: Array = []; for (let j = 0; j < numBlocks; j++) { - txsInChunk.push(concat(txs)); + txsInChunk.push(getBytes(concat(txs))); } - chunks.push(concat([chunk, concat(txsInChunk)])); + chunks.push(getBytes(concat([chunk, concat(txsInChunk)]))); } - const estimateGas = await chain.estimateGas.commitBatch(0, batchHeader0, chunks, "0x"); + const estimateGas = await chain.commitBatch.estimateGas(0, batchHeader0, chunks, "0x"); console.log( `${numChunks}`, `${numBlocks}`, diff --git a/contracts/integration-test/ZkEvmVerifierV1.spec.ts b/contracts/integration-test/ZkEvmVerifierV1.spec.ts index d070b62e6c..f20ffa85aa 100644 --- a/contracts/integration-test/ZkEvmVerifierV1.spec.ts +++ b/contracts/integration-test/ZkEvmVerifierV1.spec.ts @@ -1,14 +1,15 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; import { expect } from "chai"; -import { hexlify } from "ethers/lib/utils"; +import { hexlify } from "ethers"; +import fs from "fs"; import { ethers } from "hardhat"; + import { ZkEvmVerifierV1 } from "../typechain"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import fs from "fs"; describe("ZkEvmVerifierV1", async () => { - let deployer: SignerWithAddress; + let deployer: HardhatEthersSigner; let zkEvmVerifier: ZkEvmVerifierV1; @@ -20,8 +21,7 @@ describe("ZkEvmVerifierV1", async () => { const receipt = await tx.wait(); const ZkEvmVerifierV1 = await ethers.getContractFactory("ZkEvmVerifierV1", deployer); - zkEvmVerifier = await ZkEvmVerifierV1.deploy(receipt.contractAddress); - await zkEvmVerifier.deployed(); + zkEvmVerifier = await ZkEvmVerifierV1.deploy(receipt!.contractAddress!); }); it("should succeed", async () => { @@ -37,7 +37,7 @@ describe("ZkEvmVerifierV1", async () => { // verify ok await zkEvmVerifier.verify(proof, publicInputHash); - console.log("Gas Usage:", (await zkEvmVerifier.estimateGas.verify(proof, publicInputHash)).toString()); + console.log("Gas Usage:", (await zkEvmVerifier.verify.estimateGas(proof, publicInputHash)).toString()); // verify failed await expect(zkEvmVerifier.verify(proof, publicInputHash.reverse())).to.reverted; diff --git a/contracts/integration-test/ZkTrieVerifier.spec.ts b/contracts/integration-test/ZkTrieVerifier.spec.ts index e7257be163..c76724af00 100644 --- a/contracts/integration-test/ZkTrieVerifier.spec.ts +++ b/contracts/integration-test/ZkTrieVerifier.spec.ts @@ -1,11 +1,11 @@ /* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-missing-import */ import { expect } from "chai"; -import { concat } from "ethers/lib/utils"; import { ethers } from "hardhat"; -import { MockZkTrieVerifier } from "../typechain"; import { generateABI, createCode } from "../scripts/poseidon"; +import { MockZkTrieVerifier } from "../typechain"; +import { concat } from "ethers"; const chars = "0123456789abcdef"; @@ -273,13 +273,10 @@ describe("ZkTrieVerifier", async () => { const [deployer] = await ethers.getSigners(); const PoseidonHashWithDomainFactory = new ethers.ContractFactory(generateABI(2), createCode(2), deployer); - const poseidon = await PoseidonHashWithDomainFactory.deploy(); - await poseidon.deployed(); const MockZkTrieVerifier = await ethers.getContractFactory("MockZkTrieVerifier", deployer); - verifier = await MockZkTrieVerifier.deploy(poseidon.address); - await verifier.deployed(); + verifier = await MockZkTrieVerifier.deploy(poseidon.getAddress()); }); const shouldRevert = async (test: ITestConfig, reason: string, extra?: string) => { @@ -456,7 +453,7 @@ describe("ZkTrieVerifier", async () => { it("should revert, when InvalidAccountKeyPreimage", async () => { const test = testcases[0]; const index = test.accountProof.length - 2; - const correct = test.accountProof[index]; + const correct = test.accountProof[index].slice(); for (const p of [398, 438]) { const v = correct[p]; for (let b = 0; b < 3; ++b) { @@ -471,7 +468,7 @@ describe("ZkTrieVerifier", async () => { it("should revert, when InvalidProofMagicBytes", async () => { const test = testcases[0]; let index = test.accountProof.length - 1; - let correct = test.accountProof[index]; + let correct = test.accountProof[index].slice(); for (const p of [2, 32, 91]) { const v = correct[p]; for (let b = 0; b < 3; ++b) { @@ -483,7 +480,7 @@ describe("ZkTrieVerifier", async () => { } index = test.storageProof.length - 1; - correct = test.storageProof[index]; + correct = test.storageProof[index].slice(); for (const p of [2, 32, 91]) { const v = correct[p]; for (let b = 0; b < 3; ++b) { @@ -497,13 +494,14 @@ describe("ZkTrieVerifier", async () => { it("should revert, when InvalidAccountLeafNodeHash", async () => { const test = testcases[0]; - const correct = test.storageProof.slice(); - test.storageProof = [ - "0x05", - "0x5448495320495320534f4d45204d4147494320425954455320464f5220534d54206d3172525867503278704449", - ]; + const correct = test.accountProof[test.accountProof.length - 2]; + // change nonce + test.accountProof[test.accountProof.length - 2] = correct.replace( + "0x0420e9fb498ff9c35246d527da24aa1710d2cc9b055ecf9a95a8a2a11d3d836cdf050800000", + "0x0420e9fb498ff9c35246d527da24aa1710d2cc9b055ecf9a95a8a2a11d3d836cdf050800001" + ); await shouldRevert(test, "InvalidAccountLeafNodeHash"); - test.storageProof = correct; + test.accountProof[test.accountProof.length - 2] = correct; }); it("should revert, when InvalidStorageLeafNodeType", async () => { diff --git a/contracts/package.json b/contracts/package.json index 4f0209651b..f506802eac 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -16,44 +16,47 @@ "prepare": "cd .. && husky install contracts/.husky" }, "devDependencies": { - "@nomiclabs/hardhat-ethers": "^2.0.0", - "@nomiclabs/hardhat-etherscan": "^3.0.0", - "@nomiclabs/hardhat-waffle": "^2.0.0", + "@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-v5": "^7.0.1", - "@typechain/hardhat": "^2.3.0", + "@typechain/ethers-v6": "^0.5.1", + "@typechain/hardhat": "^9.1.0", "@types/chai": "^4.2.21", "@types/edit-json-file": "^1.7.0", "@types/mocha": "^9.0.0", - "@types/node": "^12.0.0", - "@typescript-eslint/eslint-plugin": "^4.29.1", - "@typescript-eslint/parser": "^4.29.1", + "@types/node": "^20.11.27", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", "chai": "^4.2.0", "circom": "^0.5.46", "circomlib": "^0.5.0", "dotenv": "^10.0.0", "edit-json-file": "^1.7.0", - "eslint": "^7.29.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^8.3.0", - "eslint-config-standard": "^16.0.3", + "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.23.4", + "eslint-plugin-n": "^16.6.2", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", - "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-promise": "^6.1.1", "ethereum-waffle": "^3.0.0", - "ethers": "^5.0.0", - "hardhat": "^2.9.3", + "ethers": "^6.11.1", + "hardhat": "^2.22.0", "hardhat-gas-reporter": "^1.0.4", "husky": "^8.0.1", "lint-staged": "^13.0.3", + "lodash": "^4.17.21", "prettier": "^2.3.2", "prettier-plugin-solidity": "^1.0.0-beta.13", "solhint": "^3.3.6", - "solidity-coverage": "^0.7.16", + "solidity-coverage": "^0.8.11", + "squirrelly": "8.0.8", "toml": "^3.0.0", "ts-node": "^10.1.0", - "typechain": "^5.1.2", - "typescript": "^4.5.2" + "typechain": "^8.3.2", + "typescript": "^5.4.2" }, "dependencies": { "@openzeppelin/contracts": "^v4.9.3", @@ -63,5 +66,8 @@ "*.{js,ts}": "npx eslint --cache --fix", "!(docs/apis/*).md": "prettier --ignore-unknown --write", "*.sol": "prettier --ignore-unknown --write" + }, + "engines": { + "node": ">=10.4.0" } } diff --git a/contracts/scripts/foundry/DeployFallbackContracts.s.sol b/contracts/scripts/foundry/DeployFallbackContracts.s.sol index 8f5099b4af..ac0f226e67 100644 --- a/contracts/scripts/foundry/DeployFallbackContracts.s.sol +++ b/contracts/scripts/foundry/DeployFallbackContracts.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; // solhint-disable no-console diff --git a/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol b/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol index 511b8b6f01..2733f47672 100644 --- a/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol +++ b/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; // solhint-disable no-console @@ -92,7 +92,11 @@ contract DeployL1BridgeContracts is Script { } function deployMultipleVersionRollupVerifier() internal { - rollupVerifier = new MultipleVersionRollupVerifier(address(zkEvmVerifierV1)); + uint256[] memory _versions = new uint256[](1); + address[] memory _verifiers = new address[](1); + _versions[0] = 0; + _verifiers[0] = address(zkEvmVerifierV1); + rollupVerifier = new MultipleVersionRollupVerifier(L1_SCROLL_CHAIN_PROXY_ADDR, _versions, _verifiers); logAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR", address(rollupVerifier)); } diff --git a/contracts/scripts/foundry/DeployL1BridgeProxyPlaceholder.s.sol b/contracts/scripts/foundry/DeployL1BridgeProxyPlaceholder.s.sol index 3a441390a4..2d9afe4eac 100644 --- a/contracts/scripts/foundry/DeployL1BridgeProxyPlaceholder.s.sol +++ b/contracts/scripts/foundry/DeployL1BridgeProxyPlaceholder.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; // solhint-disable no-console diff --git a/contracts/scripts/foundry/DeployL1ScrollOwner.s.sol b/contracts/scripts/foundry/DeployL1ScrollOwner.s.sol index b8b6c12f53..3eda446449 100644 --- a/contracts/scripts/foundry/DeployL1ScrollOwner.s.sol +++ b/contracts/scripts/foundry/DeployL1ScrollOwner.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; diff --git a/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol b/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol index 061d5da046..5ea907707a 100644 --- a/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol +++ b/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; // solhint-disable no-console diff --git a/contracts/scripts/foundry/DeployL2BridgeProxyPlaceholder.s.sol b/contracts/scripts/foundry/DeployL2BridgeProxyPlaceholder.s.sol index 8f4432a24a..94c214b99c 100644 --- a/contracts/scripts/foundry/DeployL2BridgeProxyPlaceholder.s.sol +++ b/contracts/scripts/foundry/DeployL2BridgeProxyPlaceholder.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; // solhint-disable no-console diff --git a/contracts/scripts/foundry/DeployL2ScrollOwner.s.sol b/contracts/scripts/foundry/DeployL2ScrollOwner.s.sol index bf8558d1d8..fe20dac0a1 100644 --- a/contracts/scripts/foundry/DeployL2ScrollOwner.s.sol +++ b/contracts/scripts/foundry/DeployL2ScrollOwner.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; diff --git a/contracts/scripts/foundry/DeployScrollChainCommitmentVerifier.s.sol b/contracts/scripts/foundry/DeployScrollChainCommitmentVerifier.s.sol index 121c86faac..1347b01738 100644 --- a/contracts/scripts/foundry/DeployScrollChainCommitmentVerifier.s.sol +++ b/contracts/scripts/foundry/DeployScrollChainCommitmentVerifier.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; diff --git a/contracts/scripts/foundry/DeployWeth.s.sol b/contracts/scripts/foundry/DeployWeth.s.sol index f1837c8b49..3b1976d71c 100644 --- a/contracts/scripts/foundry/DeployWeth.s.sol +++ b/contracts/scripts/foundry/DeployWeth.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; diff --git a/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol b/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol index da4201e52f..790cea3536 100644 --- a/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol +++ b/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; @@ -96,9 +96,6 @@ contract InitializeL1BridgeContracts is Script { ScrollChain(L1_SCROLL_CHAIN_PROXY_ADDR).addSequencer(L1_COMMIT_SENDER_ADDRESS); ScrollChain(L1_SCROLL_CHAIN_PROXY_ADDR).addProver(L1_FINALIZE_SENDER_ADDRESS); - // initialize MultipleVersionRollupVerifier - MultipleVersionRollupVerifier(L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR).initialize(L1_SCROLL_CHAIN_PROXY_ADDR); - // initialize L2GasPriceOracle L2GasPriceOracle(L2_GAS_PRICE_ORACLE_PROXY_ADDR).initialize( 21000, // _txGas diff --git a/contracts/scripts/foundry/InitializeL1ScrollOwner.s.sol b/contracts/scripts/foundry/InitializeL1ScrollOwner.s.sol index 5629ff1f3e..b2af8e9d49 100644 --- a/contracts/scripts/foundry/InitializeL1ScrollOwner.s.sol +++ b/contracts/scripts/foundry/InitializeL1ScrollOwner.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; diff --git a/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol b/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol index ec1ba712ca..da522335f2 100644 --- a/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol +++ b/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; diff --git a/contracts/scripts/foundry/InitializeL2ScrollOwner.s.sol b/contracts/scripts/foundry/InitializeL2ScrollOwner.s.sol index 7ff2b83423..f01e8cbfdf 100644 --- a/contracts/scripts/foundry/InitializeL2ScrollOwner.s.sol +++ b/contracts/scripts/foundry/InitializeL2ScrollOwner.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Script} from "forge-std/Script.sol"; diff --git a/contracts/scripts/poseidon.ts b/contracts/scripts/poseidon.ts index 00883987a0..274746ba46 100644 --- a/contracts/scripts/poseidon.ts +++ b/contracts/scripts/poseidon.ts @@ -1,5 +1,5 @@ /* eslint-disable node/no-missing-import */ -import { ethers } from "ethers"; +import { ethers, keccak256 } from "ethers"; import Contract from "circomlib/src/evmasm"; import * as constants from "circomlib/src/poseidon_constants"; @@ -90,10 +90,10 @@ export function createCode(nInputs: number) { C.calldataload(); C.div(); C.dup(0); - C.push(ethers.utils.keccak256(ethers.utils.toUtf8Bytes(`poseidon(uint256[${nInputs}],uint256)`)).slice(0, 10)); // poseidon(uint256[n],uint256) + C.push(keccak256(ethers.toUtf8Bytes(`poseidon(uint256[${nInputs}],uint256)`)).slice(0, 10)); // poseidon(uint256[n],uint256) C.eq(); C.swap(1); - C.push(ethers.utils.keccak256(ethers.utils.toUtf8Bytes(`poseidon(bytes32[${nInputs}],bytes32)`)).slice(0, 10)); // poseidon(bytes32[n],bytes32) + C.push(keccak256(ethers.toUtf8Bytes(`poseidon(bytes32[${nInputs}],bytes32)`)).slice(0, 10)); // poseidon(bytes32[n],bytes32) C.eq(); C.or(); C.jmpi("start"); diff --git a/contracts/src/External.sol b/contracts/src/External.sol index c21b3831d1..5201e8c118 100644 --- a/contracts/src/External.sol +++ b/contracts/src/External.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {TimelockController} from "@openzeppelin/contracts/governance/TimelockController.sol"; import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; diff --git a/contracts/src/L1/IL1ScrollMessenger.sol b/contracts/src/L1/IL1ScrollMessenger.sol index e08aaa25c0..4a8f2b9f88 100644 --- a/contracts/src/L1/IL1ScrollMessenger.sol +++ b/contracts/src/L1/IL1ScrollMessenger.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IScrollMessenger} from "../libraries/IScrollMessenger.sol"; diff --git a/contracts/src/L1/L1ScrollMessenger.sol b/contracts/src/L1/L1ScrollMessenger.sol index c36e8580ad..544beb2b96 100644 --- a/contracts/src/L1/L1ScrollMessenger.sol +++ b/contracts/src/L1/L1ScrollMessenger.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IScrollChain} from "./rollup/IScrollChain.sol"; import {IL1MessageQueue} from "./rollup/IL1MessageQueue.sol"; diff --git a/contracts/src/L1/gateways/EnforcedTxGateway.sol b/contracts/src/L1/gateways/EnforcedTxGateway.sol index 873bbab2fb..14b718e96f 100644 --- a/contracts/src/L1/gateways/EnforcedTxGateway.sol +++ b/contracts/src/L1/gateways/EnforcedTxGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {ECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; diff --git a/contracts/src/L1/gateways/IL1ERC1155Gateway.sol b/contracts/src/L1/gateways/IL1ERC1155Gateway.sol index 93f4229955..4a16b3a80f 100644 --- a/contracts/src/L1/gateways/IL1ERC1155Gateway.sol +++ b/contracts/src/L1/gateways/IL1ERC1155Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title The interface for the ERC1155 cross chain gateway on layer 1. interface IL1ERC1155Gateway { diff --git a/contracts/src/L1/gateways/IL1ERC20Gateway.sol b/contracts/src/L1/gateways/IL1ERC20Gateway.sol index d1266de18c..6b551b70f6 100644 --- a/contracts/src/L1/gateways/IL1ERC20Gateway.sol +++ b/contracts/src/L1/gateways/IL1ERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL1ERC20Gateway { /********** diff --git a/contracts/src/L1/gateways/IL1ERC721Gateway.sol b/contracts/src/L1/gateways/IL1ERC721Gateway.sol index b030348bd5..e6a027aa24 100644 --- a/contracts/src/L1/gateways/IL1ERC721Gateway.sol +++ b/contracts/src/L1/gateways/IL1ERC721Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title The interface for the ERC721 cross chain gateway on layer 1. interface IL1ERC721Gateway { diff --git a/contracts/src/L1/gateways/IL1ETHGateway.sol b/contracts/src/L1/gateways/IL1ETHGateway.sol index b991bbf1cb..16721996c7 100644 --- a/contracts/src/L1/gateways/IL1ETHGateway.sol +++ b/contracts/src/L1/gateways/IL1ETHGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL1ETHGateway { /********** diff --git a/contracts/src/L1/gateways/IL1GatewayRouter.sol b/contracts/src/L1/gateways/IL1GatewayRouter.sol index 08381600a2..fd0aef9e6b 100644 --- a/contracts/src/L1/gateways/IL1GatewayRouter.sol +++ b/contracts/src/L1/gateways/IL1GatewayRouter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IL1ETHGateway} from "./IL1ETHGateway.sol"; import {IL1ERC20Gateway} from "./IL1ERC20Gateway.sol"; diff --git a/contracts/src/L1/gateways/L1CustomERC20Gateway.sol b/contracts/src/L1/gateways/L1CustomERC20Gateway.sol index ab95fdaa93..e3af654a99 100644 --- a/contracts/src/L1/gateways/L1CustomERC20Gateway.sol +++ b/contracts/src/L1/gateways/L1CustomERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; diff --git a/contracts/src/L1/gateways/L1ERC1155Gateway.sol b/contracts/src/L1/gateways/L1ERC1155Gateway.sol index 6e25f7c953..794d43ce5f 100644 --- a/contracts/src/L1/gateways/L1ERC1155Gateway.sol +++ b/contracts/src/L1/gateways/L1ERC1155Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IERC1155Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol"; import {ERC1155HolderUpgradeable, ERC1155ReceiverUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC1155/utils/ERC1155HolderUpgradeable.sol"; diff --git a/contracts/src/L1/gateways/L1ERC20Gateway.sol b/contracts/src/L1/gateways/L1ERC20Gateway.sol index d50a0fc863..42c51144d3 100644 --- a/contracts/src/L1/gateways/L1ERC20Gateway.sol +++ b/contracts/src/L1/gateways/L1ERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; diff --git a/contracts/src/L1/gateways/L1ERC721Gateway.sol b/contracts/src/L1/gateways/L1ERC721Gateway.sol index a306a3ed05..f8ee61131a 100644 --- a/contracts/src/L1/gateways/L1ERC721Gateway.sol +++ b/contracts/src/L1/gateways/L1ERC721Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import {ERC721HolderUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol"; diff --git a/contracts/src/L1/gateways/L1ETHGateway.sol b/contracts/src/L1/gateways/L1ETHGateway.sol index 28346e9563..c268a1ba05 100644 --- a/contracts/src/L1/gateways/L1ETHGateway.sol +++ b/contracts/src/L1/gateways/L1ETHGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL2ETHGateway} from "../../L2/gateways/IL2ETHGateway.sol"; import {IL1ScrollMessenger} from "../IL1ScrollMessenger.sol"; diff --git a/contracts/src/L1/gateways/L1GatewayRouter.sol b/contracts/src/L1/gateways/L1GatewayRouter.sol index c9bbf19601..25bf1aa7d6 100644 --- a/contracts/src/L1/gateways/L1GatewayRouter.sol +++ b/contracts/src/L1/gateways/L1GatewayRouter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; diff --git a/contracts/src/L1/gateways/L1StandardERC20Gateway.sol b/contracts/src/L1/gateways/L1StandardERC20Gateway.sol index 833ad4f90d..ac31c37e19 100644 --- a/contracts/src/L1/gateways/L1StandardERC20Gateway.sol +++ b/contracts/src/L1/gateways/L1StandardERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ClonesUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol"; import {IERC20MetadataUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; diff --git a/contracts/src/L1/gateways/L1WETHGateway.sol b/contracts/src/L1/gateways/L1WETHGateway.sol index c8d5ae81a7..9adfd7af75 100644 --- a/contracts/src/L1/gateways/L1WETHGateway.sol +++ b/contracts/src/L1/gateways/L1WETHGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IWETH} from "../../interfaces/IWETH.sol"; import {IL2ERC20Gateway} from "../../L2/gateways/IL2ERC20Gateway.sol"; diff --git a/contracts/src/L1/gateways/usdc/L1USDCGateway.sol b/contracts/src/L1/gateways/usdc/L1USDCGateway.sol index 0ba117fb43..bae81de37d 100644 --- a/contracts/src/L1/gateways/usdc/L1USDCGateway.sol +++ b/contracts/src/L1/gateways/usdc/L1USDCGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IFiatToken} from "../../../interfaces/IFiatToken.sol"; import {IUSDCBurnableSourceBridge} from "../../../interfaces/IUSDCBurnableSourceBridge.sol"; diff --git a/contracts/src/L1/gateways/usdc/draft-L1USDCGatewayCCTP.sol b/contracts/src/L1/gateways/usdc/draft-L1USDCGatewayCCTP.sol index 9306ce594f..35d101a9bd 100644 --- a/contracts/src/L1/gateways/usdc/draft-L1USDCGatewayCCTP.sol +++ b/contracts/src/L1/gateways/usdc/draft-L1USDCGatewayCCTP.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; diff --git a/contracts/src/L1/rollup/IL1MessageQueue.sol b/contracts/src/L1/rollup/IL1MessageQueue.sol index e28e99fee0..210f2c8d99 100644 --- a/contracts/src/L1/rollup/IL1MessageQueue.sol +++ b/contracts/src/L1/rollup/IL1MessageQueue.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL1MessageQueue { /********** diff --git a/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol b/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol index dac5ecfedd..6101044311 100644 --- a/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol +++ b/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IL1MessageQueue} from "./IL1MessageQueue.sol"; diff --git a/contracts/src/L1/rollup/IL2GasPriceOracle.sol b/contracts/src/L1/rollup/IL2GasPriceOracle.sol index 695e556c44..773c1c9564 100644 --- a/contracts/src/L1/rollup/IL2GasPriceOracle.sol +++ b/contracts/src/L1/rollup/IL2GasPriceOracle.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL2GasPriceOracle { /// @notice Return the latest known l2 base fee. diff --git a/contracts/src/L1/rollup/IScrollChain.sol b/contracts/src/L1/rollup/IScrollChain.sol index bf1cdcedba..cdb7f4457e 100644 --- a/contracts/src/L1/rollup/IScrollChain.sol +++ b/contracts/src/L1/rollup/IScrollChain.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IScrollChain { /********** @@ -24,12 +24,20 @@ interface IScrollChain { /// @param withdrawRoot The merkle root on layer2 after this batch. event FinalizeBatch(uint256 indexed batchIndex, bytes32 indexed batchHash, bytes32 stateRoot, bytes32 withdrawRoot); - /********** - * Errors * - **********/ + /// @notice Emitted when owner updates the status of sequencer. + /// @param account The address of account updated. + /// @param status The status of the account updated. + event UpdateSequencer(address indexed account, bool status); + + /// @notice Emitted when owner updates the status of prover. + /// @param account The address of account updated. + /// @param status The status of the account updated. + event UpdateProver(address indexed account, bool status); - /// @dev Thrown when the given address is `address(0)`. - error ErrorZeroAddress(); + /// @notice Emitted when the value of `maxNumTxInChunk` is updated. + /// @param oldMaxNumTxInChunk The old value of `maxNumTxInChunk`. + /// @param newMaxNumTxInChunk The new value of `maxNumTxInChunk`. + event UpdateMaxNumTxInChunk(uint256 oldMaxNumTxInChunk, uint256 newMaxNumTxInChunk); /************************* * Public View Functions * @@ -90,4 +98,26 @@ interface IScrollChain { bytes32 withdrawRoot, bytes calldata aggrProof ) external; + + /// @notice Finalize a committed batch (with blob) on layer 1. + /// + /// @dev Memory layout of `blobDataProof`: + /// | z | y | kzg_commitment | kzg_proof | + /// |---------|---------|----------------|-----------| + /// | bytes32 | bytes32 | bytes48 | bytes48 | + /// + /// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch. + /// @param prevStateRoot The state root of parent batch. + /// @param postStateRoot The state root of current batch. + /// @param withdrawRoot The withdraw trie root of current batch. + /// @param blobDataProof The proof for blob data. + /// @param aggrProof The aggregation proof for current batch. + function finalizeBatchWithProof4844( + bytes calldata batchHeader, + bytes32 prevStateRoot, + bytes32 postStateRoot, + bytes32 withdrawRoot, + bytes calldata blobDataProof, + bytes calldata aggrProof + ) external; } diff --git a/contracts/src/L1/rollup/L1MessageQueue.sol b/contracts/src/L1/rollup/L1MessageQueue.sol index 29c236b9d6..6ffee522e7 100644 --- a/contracts/src/L1/rollup/L1MessageQueue.sol +++ b/contracts/src/L1/rollup/L1MessageQueue.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {BitMapsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/BitMapsUpgradeable.sol"; diff --git a/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol b/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol index 172f3ea1fb..0be3acffc0 100644 --- a/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol +++ b/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IWhitelist} from "../../libraries/common/IWhitelist.sol"; import {IL1MessageQueue} from "./IL1MessageQueue.sol"; diff --git a/contracts/src/L1/rollup/L2GasPriceOracle.sol b/contracts/src/L1/rollup/L2GasPriceOracle.sol index 14549b2826..4585621a00 100644 --- a/contracts/src/L1/rollup/L2GasPriceOracle.sol +++ b/contracts/src/L1/rollup/L2GasPriceOracle.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; diff --git a/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol b/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol index 3eda7b86e5..ebfccb1e36 100644 --- a/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol +++ b/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; @@ -14,9 +14,30 @@ contract MultipleVersionRollupVerifier is IRollupVerifier, Ownable { **********/ /// @notice Emitted when the address of verifier is updated. + /// @param version The version of the verifier. /// @param startBatchIndex The start batch index when the verifier will be used. /// @param verifier The address of new verifier. - event UpdateVerifier(uint256 startBatchIndex, address verifier); + event UpdateVerifier(uint256 version, uint256 startBatchIndex, address verifier); + + /********** + * Errors * + **********/ + + /// @dev Thrown when the given address is `address(0)`. + error ErrorZeroAddress(); + + /// @dev Thrown when the given start batch index is finalized. + error ErrorStartBatchIndexFinalized(); + + /// @dev Thrown when the given start batch index is smaller than `latestVerifier.startBatchIndex`. + error ErrorStartBatchIndexTooSmall(); + + /************* + * Constants * + *************/ + + /// @notice The address of ScrollChain contract. + address immutable scrollChain; /*********** * Structs * @@ -33,29 +54,31 @@ contract MultipleVersionRollupVerifier is IRollupVerifier, Ownable { * Variables * *************/ - /// @notice The list of legacy zkevm verifier, sorted by batchIndex in increasing order. - Verifier[] public legacyVerifiers; + /// @notice Mapping from verifier version to the list of legacy zkevm verifiers. + /// The verifiers are sorted by batchIndex in increasing order. + mapping(uint256 => Verifier[]) public legacyVerifiers; - /// @notice The lastest used zkevm verifier. - Verifier public latestVerifier; - - /// @notice The address of ScrollChain contract. - address public scrollChain; + /// @notice Mapping from verifier version to the lastest used zkevm verifier. + mapping(uint256 => Verifier) public latestVerifier; /*************** * Constructor * ***************/ - constructor(address _verifier) { - require(_verifier != address(0), "zero verifier address"); - - latestVerifier.verifier = _verifier; - } + constructor( + address _scrollChain, + uint256[] memory _versions, + address[] memory _verifiers + ) { + if (_scrollChain == address(0)) revert ErrorZeroAddress(); + scrollChain = _scrollChain; - function initialize(address _scrollChain) external onlyOwner { - require(scrollChain == address(0), "initialized"); + for (uint256 i = 0; i < _versions.length; i++) { + if (_verifiers[i] == address(0)) revert ErrorZeroAddress(); + latestVerifier[_versions[i]].verifier = _verifiers[i]; - scrollChain = _scrollChain; + emit UpdateVerifier(_versions[i], 0, _verifiers[i]); + } } /************************* @@ -63,23 +86,24 @@ contract MultipleVersionRollupVerifier is IRollupVerifier, Ownable { *************************/ /// @notice Return the number of legacy verifiers. - function legacyVerifiersLength() external view returns (uint256) { - return legacyVerifiers.length; + function legacyVerifiersLength(uint256 _version) external view returns (uint256) { + return legacyVerifiers[_version].length; } /// @notice Compute the verifier should be used for specific batch. + /// @param _version The version of verifier to query. /// @param _batchIndex The batch index to query. - function getVerifier(uint256 _batchIndex) public view returns (address) { + function getVerifier(uint256 _version, uint256 _batchIndex) public view returns (address) { // Normally, we will use the latest verifier. - Verifier memory _verifier = latestVerifier; + Verifier memory _verifier = latestVerifier[_version]; if (_verifier.startBatchIndex > _batchIndex) { - uint256 _length = legacyVerifiers.length; + uint256 _length = legacyVerifiers[_version].length; // In most case, only last few verifier will be used by `ScrollChain`. // So, we use linear search instead of binary search. unchecked { for (uint256 i = _length; i > 0; --i) { - _verifier = legacyVerifiers[i - 1]; + _verifier = legacyVerifiers[_version][i - 1]; if (_verifier.startBatchIndex <= _batchIndex) break; } } @@ -98,7 +122,19 @@ contract MultipleVersionRollupVerifier is IRollupVerifier, Ownable { bytes calldata _aggrProof, bytes32 _publicInputHash ) external view override { - address _verifier = getVerifier(_batchIndex); + address _verifier = getVerifier(0, _batchIndex); + + IZkEvmVerifier(_verifier).verify(_aggrProof, _publicInputHash); + } + + /// @inheritdoc IRollupVerifier + function verifyAggregateProof( + uint256 _version, + uint256 _batchIndex, + bytes calldata _aggrProof, + bytes32 _publicInputHash + ) external view override { + address _verifier = getVerifier(_version, _batchIndex); IZkEvmVerifier(_verifier).verify(_aggrProof, _publicInputHash); } @@ -110,21 +146,29 @@ contract MultipleVersionRollupVerifier is IRollupVerifier, Ownable { /// @notice Update the address of zkevm verifier. /// @param _startBatchIndex The start batch index when the verifier will be used. /// @param _verifier The address of new verifier. - function updateVerifier(uint64 _startBatchIndex, address _verifier) external onlyOwner { - require(_startBatchIndex > IScrollChain(scrollChain).lastFinalizedBatchIndex(), "start batch index finalized"); - - Verifier memory _latestVerifier = latestVerifier; - require(_startBatchIndex >= _latestVerifier.startBatchIndex, "start batch index too small"); - require(_verifier != address(0), "zero verifier address"); + function updateVerifier( + uint256 _version, + uint64 _startBatchIndex, + address _verifier + ) external onlyOwner { + if (_startBatchIndex <= IScrollChain(scrollChain).lastFinalizedBatchIndex()) + revert ErrorStartBatchIndexFinalized(); + + Verifier memory _latestVerifier = latestVerifier[_version]; + if (_startBatchIndex < _latestVerifier.startBatchIndex) revert ErrorStartBatchIndexTooSmall(); + if (_verifier == address(0)) revert ErrorZeroAddress(); if (_latestVerifier.startBatchIndex < _startBatchIndex) { - legacyVerifiers.push(_latestVerifier); + // don't push when it is the first update of the version. + if (_latestVerifier.verifier != address(0)) { + legacyVerifiers[_version].push(_latestVerifier); + } _latestVerifier.startBatchIndex = _startBatchIndex; } _latestVerifier.verifier = _verifier; - latestVerifier = _latestVerifier; + latestVerifier[_version] = _latestVerifier; - emit UpdateVerifier(_startBatchIndex, _verifier); + emit UpdateVerifier(_version, _startBatchIndex, _verifier); } } diff --git a/contracts/src/L1/rollup/ScrollChain.sol b/contracts/src/L1/rollup/ScrollChain.sol index dc2beced2e..b4fb087426 100644 --- a/contracts/src/L1/rollup/ScrollChain.sol +++ b/contracts/src/L1/rollup/ScrollChain.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; @@ -8,7 +8,9 @@ import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ import {IL1MessageQueue} from "./IL1MessageQueue.sol"; import {IScrollChain} from "./IScrollChain.sol"; import {BatchHeaderV0Codec} from "../../libraries/codec/BatchHeaderV0Codec.sol"; -import {ChunkCodec} from "../../libraries/codec/ChunkCodec.sol"; +import {BatchHeaderV1Codec} from "../../libraries/codec/BatchHeaderV1Codec.sol"; +import {ChunkCodecV0} from "../../libraries/codec/ChunkCodecV0.sol"; +import {ChunkCodecV1} from "../../libraries/codec/ChunkCodecV1.sol"; import {IRollupVerifier} from "../../libraries/verifier/IRollupVerifier.sol"; // solhint-disable no-inline-assembly @@ -18,28 +20,107 @@ import {IRollupVerifier} from "../../libraries/verifier/IRollupVerifier.sol"; /// @notice This contract maintains data for the Scroll rollup. contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { /********** - * Events * + * Errors * **********/ - /// @notice Emitted when owner updates the status of sequencer. - /// @param account The address of account updated. - /// @param status The status of the account updated. - event UpdateSequencer(address indexed account, bool status); + /// @dev Thrown when the given account is not EOA account. + error ErrorAccountIsNotEOA(); - /// @notice Emitted when owner updates the status of prover. - /// @param account The address of account updated. - /// @param status The status of the account updated. - event UpdateProver(address indexed account, bool status); + /// @dev Thrown when committing a committed batch. + error ErrorBatchIsAlreadyCommitted(); - /// @notice Emitted when the value of `maxNumTxInChunk` is updated. - /// @param oldMaxNumTxInChunk The old value of `maxNumTxInChunk`. - /// @param newMaxNumTxInChunk The new value of `maxNumTxInChunk`. - event UpdateMaxNumTxInChunk(uint256 oldMaxNumTxInChunk, uint256 newMaxNumTxInChunk); + /// @dev Thrown when finalizing a verified batch. + error ErrorBatchIsAlreadyVerified(); + + /// @dev Thrown when committing empty batch (batch without chunks) + error ErrorBatchIsEmpty(); + + /// @dev Thrown when call precompile failed. + error ErrorCallPointEvaluationPrecompileFailed(); + + /// @dev Thrown when the caller is not prover. + error ErrorCallerIsNotProver(); + + /// @dev Thrown when the caller is not sequencer. + error ErrorCallerIsNotSequencer(); + + /// @dev Thrown when the transaction has multiple blobs. + error ErrorFoundMultipleBlob(); + + /// @dev Thrown when some fields are not zero in genesis batch. + error ErrorGenesisBatchHasNonZeroField(); + + /// @dev Thrown when importing genesis batch twice. + error ErrorGenesisBatchImported(); + + /// @dev Thrown when data hash in genesis batch is zero. + error ErrorGenesisDataHashIsZero(); + + /// @dev Thrown when the parent batch hash in genesis batch is zero. + error ErrorGenesisParentBatchHashIsNonZero(); + + /// @dev Thrown when the l2 transaction is incomplete. + error ErrorIncompleteL2TransactionData(); + + /// @dev Thrown when the batch hash is incorrect. + error ErrorIncorrectBatchHash(); + + /// @dev Thrown when the batch index is incorrect. + error ErrorIncorrectBatchIndex(); + + /// @dev Thrown when the bitmap length is incorrect. + error ErrorIncorrectBitmapLength(); + + /// @dev Thrown when the previous state root doesn't match stored one. + error ErrorIncorrectPreviousStateRoot(); + + /// @dev Thrown when the batch header version is invalid. + error ErrorInvalidBatchHeaderVersion(); + + /// @dev Thrown when the last message is skipped. + error ErrorLastL1MessageSkipped(); + + /// @dev Thrown when no blob found in the transaction. + error ErrorNoBlobFound(); + + /// @dev Thrown when the number of transactions is less than number of L1 message in one block. + error ErrorNumTxsLessThanNumL1Msgs(); + + /// @dev Thrown when the given previous state is zero. + error ErrorPreviousStateRootIsZero(); + + /// @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. + error ErrorRevertNotStartFromEnd(); + + /// @dev Thrown when reverting a finialized batch. + error ErrorRevertFinalizedBatch(); + + /// @dev Thrown when the given state root is zero. + error ErrorStateRootIsZero(); + + /// @dev Thrown when a chunk contains too many transactions. + error ErrorTooManyTxsInOneChunk(); + + /// @dev Thrown when the precompile output is incorrect. + error ErrorUnexpectedPointEvaluationPrecompileOutput(); + + /// @dev Thrown when the given address is `address(0)`. + error ErrorZeroAddress(); /************* * Constants * *************/ + /// @dev Address of the point evaluation precompile used for EIP-4844 blob verification. + address 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 constant BLS_MODULUS = 52435875175126190479447740508185965837690552500527637822603658699938581184513; + /// @notice The chain id of the corresponding layer 2 chain. uint64 public immutable layer2ChainId; @@ -86,12 +167,12 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { modifier OnlySequencer() { // @note In the decentralized mode, it should be only called by a list of validator. - require(isSequencer[_msgSender()], "caller not sequencer"); + if (!isSequencer[_msgSender()]) revert ErrorCallerIsNotSequencer(); _; } modifier OnlyProver() { - require(isProver[_msgSender()], "caller not prover"); + if (!isProver[_msgSender()]) revert ErrorCallerIsNotProver(); _; } @@ -157,23 +238,23 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { /// @notice Import layer 2 genesis block function importGenesisBatch(bytes calldata _batchHeader, bytes32 _stateRoot) external { // check genesis batch header length - require(_stateRoot != bytes32(0), "zero state root"); + if (_stateRoot == bytes32(0)) revert ErrorStateRootIsZero(); // check whether the genesis batch is imported - require(finalizedStateRoots[0] == bytes32(0), "Genesis batch imported"); + if (finalizedStateRoots[0] != bytes32(0)) revert ErrorGenesisBatchImported(); - (uint256 memPtr, bytes32 _batchHash) = _loadBatchHeader(_batchHeader); + (uint256 memPtr, bytes32 _batchHash, , ) = _loadBatchHeader(_batchHeader); // check all fields except `dataHash` and `lastBlockHash` are zero unchecked { - uint256 sum = BatchHeaderV0Codec.version(memPtr) + - BatchHeaderV0Codec.batchIndex(memPtr) + - BatchHeaderV0Codec.l1MessagePopped(memPtr) + - BatchHeaderV0Codec.totalL1MessagePopped(memPtr); - require(sum == 0, "not all fields are zero"); + uint256 sum = BatchHeaderV0Codec.getVersion(memPtr) + + BatchHeaderV0Codec.getBatchIndex(memPtr) + + BatchHeaderV0Codec.getL1MessagePopped(memPtr) + + BatchHeaderV0Codec.getTotalL1MessagePopped(memPtr); + if (sum != 0) revert ErrorGenesisBatchHasNonZeroField(); } - require(BatchHeaderV0Codec.dataHash(memPtr) != bytes32(0), "zero data hash"); - require(BatchHeaderV0Codec.parentBatchHash(memPtr) == bytes32(0), "nonzero parent batch hash"); + if (BatchHeaderV0Codec.getDataHash(memPtr) == bytes32(0)) revert ErrorGenesisDataHashIsZero(); + if (BatchHeaderV0Codec.getParentBatchHash(memPtr) != bytes32(0)) revert ErrorGenesisParentBatchHashIsNonZero(); committedBatches[0] = _batchHash; finalizedStateRoots[0] = _stateRoot; @@ -189,89 +270,80 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { bytes[] memory _chunks, bytes calldata _skippedL1MessageBitmap ) external override OnlySequencer whenNotPaused { - require(_version == 0, "invalid version"); - // check whether the batch is empty - uint256 _chunksLength = _chunks.length; - require(_chunksLength > 0, "batch is empty"); - - // The overall memory layout in this function is organized as follows - // +---------------------+-------------------+------------------+ - // | parent batch header | chunk data hashes | new batch header | - // +---------------------+-------------------+------------------+ - // ^ ^ ^ - // batchPtr dataPtr newBatchPtr (re-use var batchPtr) - // - // 1. We copy the parent batch header from calldata to memory starting at batchPtr - // 2. We store `_chunksLength` number of Keccak hashes starting at `dataPtr`. Each Keccak - // hash corresponds to the data hash of a chunk. So we reserve the memory region from - // `dataPtr` to `dataPtr + _chunkLength * 32` for the chunk data hashes. - // 3. The memory starting at `newBatchPtr` is used to store the new batch header and compute - // the batch hash. - - // the variable `batchPtr` will be reused later for the current batch - (uint256 batchPtr, bytes32 _parentBatchHash) = _loadBatchHeader(_parentBatchHeader); - - uint256 _batchIndex = BatchHeaderV0Codec.batchIndex(batchPtr); - uint256 _totalL1MessagesPoppedOverall = BatchHeaderV0Codec.totalL1MessagePopped(batchPtr); - require(committedBatches[_batchIndex] == _parentBatchHash, "incorrect parent batch hash"); - require(committedBatches[_batchIndex + 1] == 0, "batch already committed"); - - // load `dataPtr` and reserve the memory region for chunk data hashes - uint256 dataPtr; - assembly { - dataPtr := mload(0x40) - mstore(0x40, add(dataPtr, mul(_chunksLength, 32))) + if (_chunks.length == 0) revert ErrorBatchIsEmpty(); + + (, bytes32 _parentBatchHash, uint256 _batchIndex, uint256 _totalL1MessagesPoppedOverall) = _loadBatchHeader( + _parentBatchHeader + ); + unchecked { + _batchIndex += 1; } + if (committedBatches[_batchIndex] != 0) revert ErrorBatchIsAlreadyCommitted(); - // compute the data hash for each chunk + bytes32 _batchHash; + uint256 batchPtr; + bytes32 _dataHash; uint256 _totalL1MessagesPoppedInBatch; - for (uint256 i = 0; i < _chunksLength; i++) { - uint256 _totalNumL1MessagesInChunk = _commitChunk( - dataPtr, - _chunks[i], - _totalL1MessagesPoppedInBatch, + if (_version == 0) { + (_dataHash, _totalL1MessagesPoppedInBatch) = _commitChunksV0( _totalL1MessagesPoppedOverall, + _chunks, _skippedL1MessageBitmap ); - - unchecked { - _totalL1MessagesPoppedInBatch += _totalNumL1MessagesInChunk; - _totalL1MessagesPoppedOverall += _totalNumL1MessagesInChunk; - dataPtr += 32; + assembly { + batchPtr := mload(0x40) + _totalL1MessagesPoppedOverall := add(_totalL1MessagesPoppedOverall, _totalL1MessagesPoppedInBatch) } + // store entries, the order matters + BatchHeaderV0Codec.storeVersion(batchPtr, 0); + BatchHeaderV0Codec.storeBatchIndex(batchPtr, _batchIndex); + BatchHeaderV0Codec.storeL1MessagePopped(batchPtr, _totalL1MessagesPoppedInBatch); + BatchHeaderV0Codec.storeTotalL1MessagePopped(batchPtr, _totalL1MessagesPoppedOverall); + BatchHeaderV0Codec.storeDataHash(batchPtr, _dataHash); + BatchHeaderV0Codec.storeParentBatchHash(batchPtr, _parentBatchHash); + BatchHeaderV0Codec.storeSkippedBitmap(batchPtr, _skippedL1MessageBitmap); + // compute batch hash + _batchHash = BatchHeaderV0Codec.computeBatchHash( + batchPtr, + BatchHeaderV0Codec.BATCH_HEADER_FIXED_LENGTH + _skippedL1MessageBitmap.length + ); + } else if (_version == 1) { + bytes32 blobVersionedHash; + (blobVersionedHash, _dataHash, _totalL1MessagesPoppedInBatch) = _commitChunksV1( + _totalL1MessagesPoppedOverall, + _chunks, + _skippedL1MessageBitmap + ); + assembly { + batchPtr := mload(0x40) + _totalL1MessagesPoppedOverall := add(_totalL1MessagesPoppedOverall, _totalL1MessagesPoppedInBatch) + } + // store entries, the order matters + BatchHeaderV1Codec.storeVersion(batchPtr, 1); + BatchHeaderV1Codec.storeBatchIndex(batchPtr, _batchIndex); + BatchHeaderV1Codec.storeL1MessagePopped(batchPtr, _totalL1MessagesPoppedInBatch); + BatchHeaderV1Codec.storeTotalL1MessagePopped(batchPtr, _totalL1MessagesPoppedOverall); + BatchHeaderV1Codec.storeDataHash(batchPtr, _dataHash); + BatchHeaderV1Codec.storeBlobVersionedHash(batchPtr, blobVersionedHash); + BatchHeaderV1Codec.storeParentBatchHash(batchPtr, _parentBatchHash); + BatchHeaderV1Codec.storeSkippedBitmap(batchPtr, _skippedL1MessageBitmap); + // compute batch hash + _batchHash = BatchHeaderV1Codec.computeBatchHash( + batchPtr, + BatchHeaderV1Codec.BATCH_HEADER_FIXED_LENGTH + _skippedL1MessageBitmap.length + ); + } else { + revert ErrorInvalidBatchHeaderVersion(); } // check the length of bitmap unchecked { - require( - ((_totalL1MessagesPoppedInBatch + 255) / 256) * 32 == _skippedL1MessageBitmap.length, - "wrong bitmap length" - ); - } - - // compute the data hash for current batch - bytes32 _dataHash; - assembly { - let dataLen := mul(_chunksLength, 0x20) - _dataHash := keccak256(sub(dataPtr, dataLen), dataLen) - - batchPtr := mload(0x40) // reset batchPtr - _batchIndex := add(_batchIndex, 1) // increase batch index + if (((_totalL1MessagesPoppedInBatch + 255) / 256) * 32 != _skippedL1MessageBitmap.length) { + revert ErrorIncorrectBitmapLength(); + } } - // store entries, the order matters - BatchHeaderV0Codec.storeVersion(batchPtr, _version); - BatchHeaderV0Codec.storeBatchIndex(batchPtr, _batchIndex); - BatchHeaderV0Codec.storeL1MessagePopped(batchPtr, _totalL1MessagesPoppedInBatch); - BatchHeaderV0Codec.storeTotalL1MessagePopped(batchPtr, _totalL1MessagesPoppedOverall); - BatchHeaderV0Codec.storeDataHash(batchPtr, _dataHash); - BatchHeaderV0Codec.storeParentBatchHash(batchPtr, _parentBatchHash); - BatchHeaderV0Codec.storeSkippedBitmap(batchPtr, _skippedL1MessageBitmap); - - // compute batch hash - bytes32 _batchHash = BatchHeaderV0Codec.computeBatchHash(batchPtr, 89 + _skippedL1MessageBitmap.length); - committedBatches[_batchIndex] = _batchHash; emit CommitBatch(_batchIndex, _batchHash); } @@ -280,18 +352,14 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { /// @dev If the owner want to revert a sequence of batches by sending multiple transactions, /// make sure to revert recent batches first. function revertBatch(bytes calldata _batchHeader, uint256 _count) external onlyOwner { - require(_count > 0, "count must be nonzero"); - - (uint256 memPtr, bytes32 _batchHash) = _loadBatchHeader(_batchHeader); + if (_count == 0) revert ErrorRevertZeroBatches(); - // check batch hash - uint256 _batchIndex = BatchHeaderV0Codec.batchIndex(memPtr); - require(committedBatches[_batchIndex] == _batchHash, "incorrect batch hash"); + (, bytes32 _batchHash, uint256 _batchIndex, ) = _loadBatchHeader(_batchHeader); // make sure no gap is left when reverting from the ending to the beginning. - require(committedBatches[_batchIndex + _count] == bytes32(0), "reverting must start from the ending"); + if (committedBatches[_batchIndex + _count] != bytes32(0)) revert ErrorRevertNotStartFromEnd(); // check finalization - require(_batchIndex > lastFinalizedBatchIndex, "can only revert unfinalized batch"); + if (_batchIndex <= lastFinalizedBatchIndex) revert ErrorRevertFinalizedBatch(); while (_count > 0) { committedBatches[_batchIndex] = bytes32(0); @@ -309,6 +377,7 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { } /// @inheritdoc IScrollChain + /// @dev We keep this function to upgrade to 4844 more smoothly. function finalizeBatchWithProof( bytes calldata _batchHeader, bytes32 _prevStateRoot, @@ -316,21 +385,18 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { bytes32 _withdrawRoot, bytes calldata _aggrProof ) external override OnlyProver whenNotPaused { - require(_prevStateRoot != bytes32(0), "previous state root is zero"); - require(_postStateRoot != bytes32(0), "new state root is zero"); + if (_prevStateRoot == bytes32(0)) revert ErrorPreviousStateRootIsZero(); + if (_postStateRoot == bytes32(0)) revert ErrorStateRootIsZero(); // compute batch hash and verify - (uint256 memPtr, bytes32 _batchHash) = _loadBatchHeader(_batchHeader); - - bytes32 _dataHash = BatchHeaderV0Codec.dataHash(memPtr); - uint256 _batchIndex = BatchHeaderV0Codec.batchIndex(memPtr); - require(committedBatches[_batchIndex] == _batchHash, "incorrect batch hash"); + (uint256 memPtr, bytes32 _batchHash, uint256 _batchIndex, ) = _loadBatchHeader(_batchHeader); + bytes32 _dataHash = BatchHeaderV0Codec.getDataHash(memPtr); // verify previous state root. - require(finalizedStateRoots[_batchIndex - 1] == _prevStateRoot, "incorrect previous state root"); + if (finalizedStateRoots[_batchIndex - 1] != _prevStateRoot) revert ErrorIncorrectPreviousStateRoot(); // avoid duplicated verification - require(finalizedStateRoots[_batchIndex] == bytes32(0), "batch already verified"); + if (finalizedStateRoots[_batchIndex] != bytes32(0)) revert ErrorBatchIsAlreadyVerified(); // compute public input hash bytes32 _publicInputHash = keccak256( @@ -338,11 +404,11 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { ); // verify batch - IRollupVerifier(verifier).verifyAggregateProof(_batchIndex, _aggrProof, _publicInputHash); + IRollupVerifier(verifier).verifyAggregateProof(0, _batchIndex, _aggrProof, _publicInputHash); // check and update lastFinalizedBatchIndex unchecked { - require(lastFinalizedBatchIndex + 1 == _batchIndex, "incorrect batch index"); + if (lastFinalizedBatchIndex + 1 != _batchIndex) revert ErrorIncorrectBatchIndex(); lastFinalizedBatchIndex = _batchIndex; } @@ -351,27 +417,93 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { withdrawRoots[_batchIndex] = _withdrawRoot; // Pop finalized and non-skipped message from L1MessageQueue. - uint256 _l1MessagePopped = BatchHeaderV0Codec.l1MessagePopped(memPtr); - if (_l1MessagePopped > 0) { - IL1MessageQueue _queue = IL1MessageQueue(messageQueue); + _popL1Messages( + BatchHeaderV0Codec.getSkippedBitmapPtr(memPtr), + BatchHeaderV0Codec.getTotalL1MessagePopped(memPtr), + BatchHeaderV0Codec.getL1MessagePopped(memPtr) + ); - unchecked { - uint256 _startIndex = BatchHeaderV0Codec.totalL1MessagePopped(memPtr) - _l1MessagePopped; + emit FinalizeBatch(_batchIndex, _batchHash, _postStateRoot, _withdrawRoot); + } - for (uint256 i = 0; i < _l1MessagePopped; i += 256) { - uint256 _count = 256; - if (_l1MessagePopped - i < _count) { - _count = _l1MessagePopped - i; - } - uint256 _skippedBitmap = BatchHeaderV0Codec.skippedBitmap(memPtr, i / 256); + /// @inheritdoc IScrollChain + /// @dev Memory layout of `_blobDataProof`: + /// ```text + /// | z | y | kzg_commitment | kzg_proof | + /// |---------|---------|----------------|-----------| + /// | bytes32 | bytes32 | bytes48 | bytes48 | + /// ``` + function finalizeBatchWithProof4844( + bytes calldata _batchHeader, + bytes32 _prevStateRoot, + bytes32 _postStateRoot, + bytes32 _withdrawRoot, + bytes calldata _blobDataProof, + bytes calldata _aggrProof + ) external override OnlyProver whenNotPaused { + if (_prevStateRoot == bytes32(0)) revert ErrorPreviousStateRootIsZero(); + if (_postStateRoot == bytes32(0)) revert ErrorStateRootIsZero(); - _queue.popCrossDomainMessage(_startIndex, _count, _skippedBitmap); + // compute batch hash and verify + (uint256 memPtr, bytes32 _batchHash, uint256 _batchIndex, ) = _loadBatchHeader(_batchHeader); + bytes32 _dataHash = BatchHeaderV1Codec.getDataHash(memPtr); + bytes32 _blobVersionedHash = BatchHeaderV1Codec.getBlobVersionedHash(memPtr); - _startIndex += 256; - } - } + // 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(); + + // compute public input hash + bytes32 _publicInputHash = keccak256( + abi.encodePacked( + layer2ChainId, + _prevStateRoot, + _postStateRoot, + _withdrawRoot, + _dataHash, + _blobDataProof[0:64] + ) + ); + + // load version from batch header, it is always the first byte. + uint256 batchVersion; + assembly { + batchVersion := shr(248, calldataload(_batchHeader.offset)) + } + // verify batch + IRollupVerifier(verifier).verifyAggregateProof(batchVersion, _batchIndex, _aggrProof, _publicInputHash); + + // 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); } @@ -384,7 +516,7 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { function addSequencer(address _account) external onlyOwner { // @note Currently many external services rely on EOA sequencer to decode metadata directly from tx.calldata. // So we explicitly make sure the account is EOA. - require(_account.code.length == 0, "not EOA"); + if (_account.code.length > 0) revert ErrorAccountIsNotEOA(); isSequencer[_account] = true; @@ -404,7 +536,7 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { function addProver(address _account) external onlyOwner { // @note Currently many external services rely on EOA prover to decode metadata directly from tx.calldata. // So we explicitly make sure the account is EOA. - require(_account.code.length == 0, "not EOA"); + if (_account.code.length > 0) revert ErrorAccountIsNotEOA(); isProver[_account] = true; emit UpdateProver(_account, true); @@ -441,56 +573,195 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { * Internal Functions * **********************/ + /// @dev Internal function to commit chunks with version 0 + /// @param _totalL1MessagesPoppedOverall The number of L1 messages popped before the list of chunks. + /// @param _chunks The list of chunks to commit. + /// @param _skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not. + /// @return _batchDataHash The computed data hash for the list of chunks. + /// @return _totalL1MessagesPoppedInBatch The total number of L1 messages poped in this batch, including skipped one. + function _commitChunksV0( + uint256 _totalL1MessagesPoppedOverall, + bytes[] memory _chunks, + bytes calldata _skippedL1MessageBitmap + ) internal view returns (bytes32 _batchDataHash, uint256 _totalL1MessagesPoppedInBatch) { + uint256 _chunksLength = _chunks.length; + + // load `batchDataHashPtr` and reserve the memory region for chunk data hashes + uint256 batchDataHashPtr; + assembly { + batchDataHashPtr := mload(0x40) + mstore(0x40, add(batchDataHashPtr, mul(_chunksLength, 32))) + } + + // compute the data hash for each chunk + for (uint256 i = 0; i < _chunksLength; i++) { + uint256 _totalNumL1MessagesInChunk; + bytes32 _chunkDataHash; + (_chunkDataHash, _totalNumL1MessagesInChunk) = _commitChunkV0( + _chunks[i], + _totalL1MessagesPoppedInBatch, + _totalL1MessagesPoppedOverall, + _skippedL1MessageBitmap + ); + unchecked { + _totalL1MessagesPoppedInBatch += _totalNumL1MessagesInChunk; + _totalL1MessagesPoppedOverall += _totalNumL1MessagesInChunk; + } + assembly { + mstore(batchDataHashPtr, _chunkDataHash) + batchDataHashPtr := add(batchDataHashPtr, 0x20) + } + } + + assembly { + let dataLen := mul(_chunksLength, 0x20) + _batchDataHash := keccak256(sub(batchDataHashPtr, dataLen), dataLen) + } + } + + /// @dev Internal function to commit chunks with version 1 + /// @param _totalL1MessagesPoppedOverall The number of L1 messages popped before the list of chunks. + /// @param _chunks The list of chunks to commit. + /// @param _skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not. + /// @return _blobVersionedHash The blob versioned hash for the blob carried in this transaction. + /// @return _batchDataHash The computed data hash for the list of chunks. + /// @return _totalL1MessagesPoppedInBatch The total number of L1 messages poped in this batch, including skipped one. + function _commitChunksV1( + uint256 _totalL1MessagesPoppedOverall, + bytes[] memory _chunks, + bytes calldata _skippedL1MessageBitmap + ) + internal + view + returns ( + bytes32 _blobVersionedHash, + bytes32 _batchDataHash, + uint256 _totalL1MessagesPoppedInBatch + ) + { + { + bytes32 _secondBlob; + // Get blob's versioned hash + assembly { + _blobVersionedHash := blobhash(0) + _secondBlob := blobhash(1) + } + if (_blobVersionedHash == bytes32(0)) revert ErrorNoBlobFound(); + if (_secondBlob != bytes32(0)) revert ErrorFoundMultipleBlob(); + } + + uint256 _chunksLength = _chunks.length; + + // load `batchDataHashPtr` and reserve the memory region for chunk data hashes + uint256 batchDataHashPtr; + assembly { + batchDataHashPtr := mload(0x40) + mstore(0x40, add(batchDataHashPtr, mul(_chunksLength, 32))) + } + + // compute the data hash for each chunk + for (uint256 i = 0; i < _chunksLength; i++) { + uint256 _totalNumL1MessagesInChunk; + bytes32 _chunkDataHash; + (_chunkDataHash, _totalNumL1MessagesInChunk) = _commitChunkV1( + _chunks[i], + _totalL1MessagesPoppedInBatch, + _totalL1MessagesPoppedOverall, + _skippedL1MessageBitmap + ); + unchecked { + _totalL1MessagesPoppedInBatch += _totalNumL1MessagesInChunk; + _totalL1MessagesPoppedOverall += _totalNumL1MessagesInChunk; + } + assembly { + mstore(batchDataHashPtr, _chunkDataHash) + batchDataHashPtr := add(batchDataHashPtr, 0x20) + } + } + + // compute the data hash for current batch + assembly { + let dataLen := mul(_chunksLength, 0x20) + _batchDataHash := keccak256(sub(batchDataHashPtr, dataLen), dataLen) + } + } + /// @dev Internal function to load batch header from calldata to memory. /// @param _batchHeader The batch header in calldata. - /// @return memPtr The start memory offset of loaded batch header. + /// @return batchPtr The start memory offset of loaded batch header. /// @return _batchHash The hash of the loaded batch header. - function _loadBatchHeader(bytes calldata _batchHeader) internal pure returns (uint256 memPtr, bytes32 _batchHash) { - // load to memory - uint256 _length; - (memPtr, _length) = BatchHeaderV0Codec.loadAndValidate(_batchHeader); + /// @return _batchIndex The index of this batch. + /// @param _totalL1MessagesPoppedOverall The number of L1 messages popped after this batch. + function _loadBatchHeader(bytes calldata _batchHeader) + internal + view + returns ( + uint256 batchPtr, + bytes32 _batchHash, + uint256 _batchIndex, + uint256 _totalL1MessagesPoppedOverall + ) + { + // load version from batch header, it is always the first byte. + uint256 version; + assembly { + version := shr(248, calldataload(_batchHeader.offset)) + } - // compute batch hash - _batchHash = BatchHeaderV0Codec.computeBatchHash(memPtr, _length); + // version should be always 0 or 1 in current code + uint256 _length; + if (version == 0) { + (batchPtr, _length) = BatchHeaderV0Codec.loadAndValidate(_batchHeader); + _batchHash = BatchHeaderV0Codec.computeBatchHash(batchPtr, _length); + _batchIndex = BatchHeaderV0Codec.getBatchIndex(batchPtr); + } else if (version == 1) { + (batchPtr, _length) = BatchHeaderV1Codec.loadAndValidate(_batchHeader); + _batchHash = BatchHeaderV1Codec.computeBatchHash(batchPtr, _length); + _batchIndex = BatchHeaderV1Codec.getBatchIndex(batchPtr); + } else { + revert ErrorInvalidBatchHeaderVersion(); + } + // only check when genesis is imported + if (committedBatches[_batchIndex] != _batchHash && finalizedStateRoots[0] != bytes32(0)) { + revert ErrorIncorrectBatchHash(); + } + _totalL1MessagesPoppedOverall = BatchHeaderV0Codec.getTotalL1MessagePopped(batchPtr); } - /// @dev Internal function to commit a chunk. - /// @param memPtr The start memory offset to store list of `dataHash`. + /// @dev Internal function to commit a chunk with version 0. /// @param _chunk The encoded chunk to commit. - /// @param _totalL1MessagesPoppedInBatch The total number of L1 messages popped in current batch. - /// @param _totalL1MessagesPoppedOverall The total number of L1 messages popped in all batches including current batch. + /// @param _totalL1MessagesPoppedInBatch The total number of L1 messages popped in the current batch before this chunk. + /// @param _totalL1MessagesPoppedOverall The total number of L1 messages popped in all batches including the current batch, before this chunk. /// @param _skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not. + /// @return _dataHash The computed data hash for this chunk. /// @return _totalNumL1MessagesInChunk The total number of L1 message popped in current chunk - function _commitChunk( - uint256 memPtr, + function _commitChunkV0( bytes memory _chunk, uint256 _totalL1MessagesPoppedInBatch, uint256 _totalL1MessagesPoppedOverall, bytes calldata _skippedL1MessageBitmap - ) internal view returns (uint256 _totalNumL1MessagesInChunk) { + ) internal view returns (bytes32 _dataHash, uint256 _totalNumL1MessagesInChunk) { uint256 chunkPtr; uint256 startDataPtr; uint256 dataPtr; - uint256 blockPtr; assembly { dataPtr := mload(0x40) startDataPtr := dataPtr chunkPtr := add(_chunk, 0x20) // skip chunkLength - blockPtr := add(chunkPtr, 1) // skip numBlocks } - uint256 _numBlocks = ChunkCodec.validateChunkLength(chunkPtr, _chunk.length); + uint256 _numBlocks = ChunkCodecV0.validateChunkLength(chunkPtr, _chunk.length); // concatenate block contexts, use scope to avoid stack too deep { uint256 _totalTransactionsInChunk; for (uint256 i = 0; i < _numBlocks; i++) { - dataPtr = ChunkCodec.copyBlockContext(chunkPtr, dataPtr, i); - uint256 _numTransactionsInBlock = ChunkCodec.numTransactions(blockPtr); + dataPtr = ChunkCodecV0.copyBlockContext(chunkPtr, dataPtr, i); + uint256 blockPtr = chunkPtr + 1 + i * ChunkCodecV0.BLOCK_CONTEXT_LENGTH; + uint256 _numTransactionsInBlock = ChunkCodecV0.getNumTransactions(blockPtr); unchecked { _totalTransactionsInChunk += _numTransactionsInBlock; - blockPtr += ChunkCodec.BLOCK_CONTEXT_LENGTH; } } assembly { @@ -499,17 +770,13 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { } // It is used to compute the actual number of transactions in chunk. - uint256 txHashStartDataPtr; - assembly { - txHashStartDataPtr := dataPtr - blockPtr := add(chunkPtr, 1) // reset block ptr - } - + uint256 txHashStartDataPtr = dataPtr; // concatenate tx hashes - uint256 l2TxPtr = ChunkCodec.l2TxPtr(chunkPtr, _numBlocks); + uint256 l2TxPtr = ChunkCodecV0.getL2TxPtr(chunkPtr, _numBlocks); + chunkPtr += 1; while (_numBlocks > 0) { // concatenate l1 message hashes - uint256 _numL1MessagesInBlock = ChunkCodec.numL1Messages(blockPtr); + uint256 _numL1MessagesInBlock = ChunkCodecV0.getNumL1Messages(chunkPtr); dataPtr = _loadL1MessageHashes( dataPtr, _numL1MessagesInBlock, @@ -519,11 +786,11 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { ); // concatenate l2 transaction hashes - uint256 _numTransactionsInBlock = ChunkCodec.numTransactions(blockPtr); - require(_numTransactionsInBlock >= _numL1MessagesInBlock, "num txs less than num L1 msgs"); + uint256 _numTransactionsInBlock = ChunkCodecV0.getNumTransactions(chunkPtr); + if (_numTransactionsInBlock < _numL1MessagesInBlock) revert ErrorNumTxsLessThanNumL1Msgs(); for (uint256 j = _numL1MessagesInBlock; j < _numTransactionsInBlock; j++) { bytes32 txHash; - (txHash, l2TxPtr) = ChunkCodec.loadL2TxHash(l2TxPtr); + (txHash, l2TxPtr) = ChunkCodecV0.loadL2TxHash(l2TxPtr); assembly { mstore(dataPtr, txHash) dataPtr := add(dataPtr, 0x20) @@ -536,23 +803,99 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { _totalL1MessagesPoppedOverall += _numL1MessagesInBlock; _numBlocks -= 1; - blockPtr += ChunkCodec.BLOCK_CONTEXT_LENGTH; + chunkPtr += ChunkCodecV0.BLOCK_CONTEXT_LENGTH; } } // check the actual number of transactions in the chunk - require((dataPtr - txHashStartDataPtr) / 32 <= maxNumTxInChunk, "too many txs in one chunk"); + if ((dataPtr - txHashStartDataPtr) / 32 > maxNumTxInChunk) revert ErrorTooManyTxsInOneChunk(); + assembly { + chunkPtr := add(_chunk, 0x20) + } // check chunk has correct length - require(l2TxPtr - chunkPtr == _chunk.length, "incomplete l2 transaction data"); + if (l2TxPtr - chunkPtr != _chunk.length) revert ErrorIncompleteL2TransactionData(); // compute data hash and store to memory assembly { - let dataHash := keccak256(startDataPtr, sub(dataPtr, startDataPtr)) - mstore(memPtr, dataHash) + _dataHash := keccak256(startDataPtr, sub(dataPtr, startDataPtr)) + } + } + + /// @dev Internal function to commit a chunk with version 1. + /// @param _chunk The encoded chunk to commit. + /// @param _totalL1MessagesPoppedInBatch The total number of L1 messages popped in current batch. + /// @param _totalL1MessagesPoppedOverall The total number of L1 messages popped in all batches including current batch. + /// @param _skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not. + /// @return _dataHash The computed data hash for this chunk. + /// @return _totalNumL1MessagesInChunk The total number of L1 message popped in current chunk + function _commitChunkV1( + bytes memory _chunk, + uint256 _totalL1MessagesPoppedInBatch, + uint256 _totalL1MessagesPoppedOverall, + bytes calldata _skippedL1MessageBitmap + ) internal view returns (bytes32 _dataHash, uint256 _totalNumL1MessagesInChunk) { + uint256 chunkPtr; + uint256 startDataPtr; + uint256 dataPtr; + + assembly { + dataPtr := mload(0x40) + startDataPtr := dataPtr + chunkPtr := add(_chunk, 0x20) // skip chunkLength + } + + uint256 _numBlocks = ChunkCodecV1.validateChunkLength(chunkPtr, _chunk.length); + // concatenate block contexts, use scope to avoid stack too deep + for (uint256 i = 0; i < _numBlocks; i++) { + dataPtr = ChunkCodecV1.copyBlockContext(chunkPtr, dataPtr, i); + uint256 blockPtr = chunkPtr + 1 + i * ChunkCodecV1.BLOCK_CONTEXT_LENGTH; + uint256 _numL1MessagesInBlock = ChunkCodecV1.getNumL1Messages(blockPtr); + unchecked { + _totalNumL1MessagesInChunk += _numL1MessagesInBlock; + } + } + assembly { + mstore(0x40, add(dataPtr, mul(_totalNumL1MessagesInChunk, 0x20))) // reserve memory for l1 message hashes + chunkPtr := add(chunkPtr, 1) + } + + // the number of actual transactions in one chunk: non-skipped l1 messages + l2 txs + uint256 _totalTransactionsInChunk; + // concatenate tx hashes + while (_numBlocks > 0) { + // concatenate l1 message hashes + uint256 _numL1MessagesInBlock = ChunkCodecV1.getNumL1Messages(chunkPtr); + uint256 startPtr = dataPtr; + dataPtr = _loadL1MessageHashes( + dataPtr, + _numL1MessagesInBlock, + _totalL1MessagesPoppedInBatch, + _totalL1MessagesPoppedOverall, + _skippedL1MessageBitmap + ); + uint256 _numTransactionsInBlock = ChunkCodecV1.getNumTransactions(chunkPtr); + if (_numTransactionsInBlock < _numL1MessagesInBlock) revert ErrorNumTxsLessThanNumL1Msgs(); + unchecked { + _totalTransactionsInChunk += dataPtr - startPtr; // number of non-skipped l1 messages + _totalTransactionsInChunk += _numTransactionsInBlock - _numL1MessagesInBlock; // number of l2 txs + _totalL1MessagesPoppedInBatch += _numL1MessagesInBlock; + _totalL1MessagesPoppedOverall += _numL1MessagesInBlock; + + _numBlocks -= 1; + chunkPtr += ChunkCodecV1.BLOCK_CONTEXT_LENGTH; + } } - return _totalNumL1MessagesInChunk; + // check the actual number of transactions in the chunk + if (_totalTransactionsInChunk > maxNumTxInChunk) { + revert ErrorTooManyTxsInOneChunk(); + } + + // compute data hash and store to memory + assembly { + _dataHash := keccak256(startDataPtr, sub(dataPtr, startDataPtr)) + } } /// @dev Internal function to load L1 message hashes from the message queue. @@ -600,9 +943,39 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { // check last L1 message is not skipped, _totalL1MessagesPoppedInBatch must > 0 rem = (_totalL1MessagesPoppedInBatch - 1) & 0xff; - require(((_bitmap >> rem) & 1) == 0, "cannot skip last L1 message"); + if (((_bitmap >> rem) & 1) > 0) revert ErrorLastL1MessageSkipped(); } return _ptr; } + + /// @dev Internal function to pop finalized l1 messages. + /// @param bitmapPtr The memory offset of `skippedL1MessageBitmap`. + /// @param totalL1MessagePopped The total number of L1 messages poped in all batches including current batch. + /// @param l1MessagePopped The number of L1 messages popped in current batch. + function _popL1Messages( + uint256 bitmapPtr, + uint256 totalL1MessagePopped, + uint256 l1MessagePopped + ) internal { + if (l1MessagePopped == 0) return; + + unchecked { + uint256 startIndex = totalL1MessagePopped - l1MessagePopped; + uint256 bitmap; + + for (uint256 i = 0; i < l1MessagePopped; i += 256) { + uint256 _count = 256; + if (l1MessagePopped - i < _count) { + _count = l1MessagePopped - i; + } + assembly { + bitmap := mload(bitmapPtr) + bitmapPtr := add(bitmapPtr, 0x20) + } + IL1MessageQueue(messageQueue).popCrossDomainMessage(startIndex, _count, bitmap); + startIndex += 256; + } + } + } } diff --git a/contracts/src/L1/rollup/ScrollChainCommitmentVerifier.sol b/contracts/src/L1/rollup/ScrollChainCommitmentVerifier.sol index e955af7ae0..3d5674f5c5 100644 --- a/contracts/src/L1/rollup/ScrollChainCommitmentVerifier.sol +++ b/contracts/src/L1/rollup/ScrollChainCommitmentVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IScrollChain} from "./IScrollChain.sol"; import {ZkTrieVerifier} from "../../libraries/verifier/ZkTrieVerifier.sol"; diff --git a/contracts/src/L2/IL2ScrollMessenger.sol b/contracts/src/L2/IL2ScrollMessenger.sol index 700a28a384..44e60b16f6 100644 --- a/contracts/src/L2/IL2ScrollMessenger.sol +++ b/contracts/src/L2/IL2ScrollMessenger.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IScrollMessenger} from "../libraries/IScrollMessenger.sol"; diff --git a/contracts/src/L2/L2ScrollMessenger.sol b/contracts/src/L2/L2ScrollMessenger.sol index 8b070ccaa4..3d01b40e86 100644 --- a/contracts/src/L2/L2ScrollMessenger.sol +++ b/contracts/src/L2/L2ScrollMessenger.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL2ScrollMessenger} from "./IL2ScrollMessenger.sol"; import {L2MessageQueue} from "./predeploys/L2MessageQueue.sol"; diff --git a/contracts/src/L2/gateways/IL2ERC1155Gateway.sol b/contracts/src/L2/gateways/IL2ERC1155Gateway.sol index a9e743f525..2a0d6182b7 100644 --- a/contracts/src/L2/gateways/IL2ERC1155Gateway.sol +++ b/contracts/src/L2/gateways/IL2ERC1155Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title The interface for the ERC1155 cross chain gateway on layer 2. interface IL2ERC1155Gateway { diff --git a/contracts/src/L2/gateways/IL2ERC20Gateway.sol b/contracts/src/L2/gateways/IL2ERC20Gateway.sol index 98463a4ada..39740cbd35 100644 --- a/contracts/src/L2/gateways/IL2ERC20Gateway.sol +++ b/contracts/src/L2/gateways/IL2ERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL2ERC20Gateway { /********** diff --git a/contracts/src/L2/gateways/IL2ERC721Gateway.sol b/contracts/src/L2/gateways/IL2ERC721Gateway.sol index 470d9ec6d1..d92b55702a 100644 --- a/contracts/src/L2/gateways/IL2ERC721Gateway.sol +++ b/contracts/src/L2/gateways/IL2ERC721Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title The interface for the ERC721 cross chain gateway on layer 2. interface IL2ERC721Gateway { diff --git a/contracts/src/L2/gateways/IL2ETHGateway.sol b/contracts/src/L2/gateways/IL2ETHGateway.sol index 86f07c1ea6..80407b10ee 100644 --- a/contracts/src/L2/gateways/IL2ETHGateway.sol +++ b/contracts/src/L2/gateways/IL2ETHGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL2ETHGateway { /********** diff --git a/contracts/src/L2/gateways/IL2GatewayRouter.sol b/contracts/src/L2/gateways/IL2GatewayRouter.sol index 3cab528b6b..f2a6facc82 100644 --- a/contracts/src/L2/gateways/IL2GatewayRouter.sol +++ b/contracts/src/L2/gateways/IL2GatewayRouter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IL2ETHGateway} from "./IL2ETHGateway.sol"; import {IL2ERC20Gateway} from "./IL2ERC20Gateway.sol"; diff --git a/contracts/src/L2/gateways/L2CustomERC20Gateway.sol b/contracts/src/L2/gateways/L2CustomERC20Gateway.sol index 24b0089b2a..5e4d7c4ccb 100644 --- a/contracts/src/L2/gateways/L2CustomERC20Gateway.sol +++ b/contracts/src/L2/gateways/L2CustomERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL2ERC20Gateway, L2ERC20Gateway} from "./L2ERC20Gateway.sol"; import {IL2ScrollMessenger} from "../IL2ScrollMessenger.sol"; diff --git a/contracts/src/L2/gateways/L2ERC1155Gateway.sol b/contracts/src/L2/gateways/L2ERC1155Gateway.sol index 2babc075ef..d85f685a6d 100644 --- a/contracts/src/L2/gateways/L2ERC1155Gateway.sol +++ b/contracts/src/L2/gateways/L2ERC1155Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ERC1155HolderUpgradeable, ERC1155ReceiverUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC1155/utils/ERC1155HolderUpgradeable.sol"; diff --git a/contracts/src/L2/gateways/L2ERC20Gateway.sol b/contracts/src/L2/gateways/L2ERC20Gateway.sol index 106cbeff01..7479a9398c 100644 --- a/contracts/src/L2/gateways/L2ERC20Gateway.sol +++ b/contracts/src/L2/gateways/L2ERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IL2ERC20Gateway} from "./IL2ERC20Gateway.sol"; diff --git a/contracts/src/L2/gateways/L2ERC721Gateway.sol b/contracts/src/L2/gateways/L2ERC721Gateway.sol index b18426606f..72c408535e 100644 --- a/contracts/src/L2/gateways/L2ERC721Gateway.sol +++ b/contracts/src/L2/gateways/L2ERC721Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ERC721HolderUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol"; diff --git a/contracts/src/L2/gateways/L2ETHGateway.sol b/contracts/src/L2/gateways/L2ETHGateway.sol index dcadc1ed95..ae9c42ffbc 100644 --- a/contracts/src/L2/gateways/L2ETHGateway.sol +++ b/contracts/src/L2/gateways/L2ETHGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL1ETHGateway} from "../../L1/gateways/IL1ETHGateway.sol"; import {IL2ScrollMessenger} from "../IL2ScrollMessenger.sol"; diff --git a/contracts/src/L2/gateways/L2GatewayRouter.sol b/contracts/src/L2/gateways/L2GatewayRouter.sol index 04d39cbffc..3c982b380a 100644 --- a/contracts/src/L2/gateways/L2GatewayRouter.sol +++ b/contracts/src/L2/gateways/L2GatewayRouter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; diff --git a/contracts/src/L2/gateways/L2StandardERC20Gateway.sol b/contracts/src/L2/gateways/L2StandardERC20Gateway.sol index d608d997cc..3b3455ffdb 100644 --- a/contracts/src/L2/gateways/L2StandardERC20Gateway.sol +++ b/contracts/src/L2/gateways/L2StandardERC20Gateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {AddressUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; diff --git a/contracts/src/L2/gateways/L2WETHGateway.sol b/contracts/src/L2/gateways/L2WETHGateway.sol index f8ebc013eb..a50a7b35bf 100644 --- a/contracts/src/L2/gateways/L2WETHGateway.sol +++ b/contracts/src/L2/gateways/L2WETHGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; diff --git a/contracts/src/L2/gateways/usdc/L2USDCGateway.sol b/contracts/src/L2/gateways/usdc/L2USDCGateway.sol index 95e7ab8d97..d3408c8372 100644 --- a/contracts/src/L2/gateways/usdc/L2USDCGateway.sol +++ b/contracts/src/L2/gateways/usdc/L2USDCGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; diff --git a/contracts/src/L2/gateways/usdc/draft-L2USDCGatewayCCTP.sol b/contracts/src/L2/gateways/usdc/draft-L2USDCGatewayCCTP.sol index bcec3b7c01..002f7bf204 100644 --- a/contracts/src/L2/gateways/usdc/draft-L2USDCGatewayCCTP.sol +++ b/contracts/src/L2/gateways/usdc/draft-L2USDCGatewayCCTP.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; diff --git a/contracts/src/L2/predeploys/IL1BlockContainer.sol b/contracts/src/L2/predeploys/IL1BlockContainer.sol index 80b7ecaa93..aafee8cd5b 100644 --- a/contracts/src/L2/predeploys/IL1BlockContainer.sol +++ b/contracts/src/L2/predeploys/IL1BlockContainer.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL1BlockContainer { /********** diff --git a/contracts/src/L2/predeploys/IL1GasPriceOracle.sol b/contracts/src/L2/predeploys/IL1GasPriceOracle.sol index 1fc8d07220..9d67595d98 100644 --- a/contracts/src/L2/predeploys/IL1GasPriceOracle.sol +++ b/contracts/src/L2/predeploys/IL1GasPriceOracle.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IL1GasPriceOracle { /********** diff --git a/contracts/src/L2/predeploys/L1BlockContainer.sol b/contracts/src/L2/predeploys/L1BlockContainer.sol index ff5b31c5f4..6c163379de 100644 --- a/contracts/src/L2/predeploys/L1BlockContainer.sol +++ b/contracts/src/L2/predeploys/L1BlockContainer.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL1BlockContainer} from "./IL1BlockContainer.sol"; import {IL1GasPriceOracle} from "./IL1GasPriceOracle.sol"; diff --git a/contracts/src/L2/predeploys/L1GasPriceOracle.sol b/contracts/src/L2/predeploys/L1GasPriceOracle.sol index cd4bab72e7..8e8086130d 100644 --- a/contracts/src/L2/predeploys/L1GasPriceOracle.sol +++ b/contracts/src/L2/predeploys/L1GasPriceOracle.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableBase} from "../../libraries/common/OwnableBase.sol"; import {IWhitelist} from "../../libraries/common/IWhitelist.sol"; diff --git a/contracts/src/L2/predeploys/L2MessageQueue.sol b/contracts/src/L2/predeploys/L2MessageQueue.sol index cc5039a798..997ff446a5 100644 --- a/contracts/src/L2/predeploys/L2MessageQueue.sol +++ b/contracts/src/L2/predeploys/L2MessageQueue.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {AppendOnlyMerkleTree} from "../../libraries/common/AppendOnlyMerkleTree.sol"; import {OwnableBase} from "../../libraries/common/OwnableBase.sol"; diff --git a/contracts/src/L2/predeploys/L2TxFeeVault.sol b/contracts/src/L2/predeploys/L2TxFeeVault.sol index 550a79bece..20248eb765 100644 --- a/contracts/src/L2/predeploys/L2TxFeeVault.sol +++ b/contracts/src/L2/predeploys/L2TxFeeVault.sol @@ -23,7 +23,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL2ScrollMessenger} from "../IL2ScrollMessenger.sol"; import {OwnableBase} from "../../libraries/common/OwnableBase.sol"; diff --git a/contracts/src/L2/predeploys/Whitelist.sol b/contracts/src/L2/predeploys/Whitelist.sol index 62f95df754..712700cf19 100644 --- a/contracts/src/L2/predeploys/Whitelist.sol +++ b/contracts/src/L2/predeploys/Whitelist.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {OwnableBase} from "../../libraries/common/OwnableBase.sol"; import {IWhitelist} from "../../libraries/common/IWhitelist.sol"; diff --git a/contracts/src/gas-swap/GasSwap.sol b/contracts/src/gas-swap/GasSwap.sol index 7b3800f417..61bea33c44 100644 --- a/contracts/src/gas-swap/GasSwap.sol +++ b/contracts/src/gas-swap/GasSwap.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ERC2771Context} from "@openzeppelin/contracts/metatx/ERC2771Context.sol"; diff --git a/contracts/src/interfaces/IFiatToken.sol b/contracts/src/interfaces/IFiatToken.sol index 9c6e8104af..ce1b43d7b7 100644 --- a/contracts/src/interfaces/IFiatToken.sol +++ b/contracts/src/interfaces/IFiatToken.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IFiatToken { /** diff --git a/contracts/src/interfaces/IMessageTransmitter.sol b/contracts/src/interfaces/IMessageTransmitter.sol index 5e20f14ee8..f579f79b98 100644 --- a/contracts/src/interfaces/IMessageTransmitter.sol +++ b/contracts/src/interfaces/IMessageTransmitter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title IMessageTransmitter /// @notice The interface of `MessageTransmitter` of Circle's Cross-Chain Transfer Protocol (CCTP). diff --git a/contracts/src/interfaces/ITokenMessenger.sol b/contracts/src/interfaces/ITokenMessenger.sol index f5de9dee8d..95de16dd2b 100644 --- a/contracts/src/interfaces/ITokenMessenger.sol +++ b/contracts/src/interfaces/ITokenMessenger.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title ITokenMessenger /// @notice The interface of `TokenMessenger` of Circle's Cross-Chain Transfer Protocol (CCTP). diff --git a/contracts/src/interfaces/IUSDCBurnableSourceBridge.sol b/contracts/src/interfaces/IUSDCBurnableSourceBridge.sol index b16afff110..081bacfb49 100644 --- a/contracts/src/interfaces/IUSDCBurnableSourceBridge.sol +++ b/contracts/src/interfaces/IUSDCBurnableSourceBridge.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title IUSDCBurnableSourceBridge /// @notice The interface of `USDCBurnableSourceBridge` of Circle's upgrader in L1 (Ethereum). diff --git a/contracts/src/interfaces/IUSDCDestinationBridge.sol b/contracts/src/interfaces/IUSDCDestinationBridge.sol index 35397dd491..9ea6648146 100644 --- a/contracts/src/interfaces/IUSDCDestinationBridge.sol +++ b/contracts/src/interfaces/IUSDCDestinationBridge.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @title IUSDCDestinationBridge /// @notice The interface required for USDC bridge in the destination chain (Scroll). diff --git a/contracts/src/interfaces/IWETH.sol b/contracts/src/interfaces/IWETH.sol index c8097b7cce..bf10aacd31 100644 --- a/contracts/src/interfaces/IWETH.sol +++ b/contracts/src/interfaces/IWETH.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IWETH { function deposit() external payable; diff --git a/contracts/src/libraries/IScrollMessenger.sol b/contracts/src/libraries/IScrollMessenger.sol index 82ce7a7ae5..b5d0f46b8a 100644 --- a/contracts/src/libraries/IScrollMessenger.sol +++ b/contracts/src/libraries/IScrollMessenger.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IScrollMessenger { /********** diff --git a/contracts/src/libraries/ScrollMessengerBase.sol b/contracts/src/libraries/ScrollMessengerBase.sol index b984caa8f8..9d34ae1cc6 100644 --- a/contracts/src/libraries/ScrollMessengerBase.sol +++ b/contracts/src/libraries/ScrollMessengerBase.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; diff --git a/contracts/src/libraries/callbacks/IERC677Receiver.sol b/contracts/src/libraries/callbacks/IERC677Receiver.sol index 560e6ee04f..53e98d0f8c 100644 --- a/contracts/src/libraries/callbacks/IERC677Receiver.sol +++ b/contracts/src/libraries/callbacks/IERC677Receiver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IERC677Receiver { function onTokenTransfer( diff --git a/contracts/src/libraries/callbacks/IMessageDropCallback.sol b/contracts/src/libraries/callbacks/IMessageDropCallback.sol index 8a73974514..e23f3cda78 100644 --- a/contracts/src/libraries/callbacks/IMessageDropCallback.sol +++ b/contracts/src/libraries/callbacks/IMessageDropCallback.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IMessageDropCallback { function onDropMessage(bytes memory message) external payable; diff --git a/contracts/src/libraries/callbacks/IScrollGatewayCallback.sol b/contracts/src/libraries/callbacks/IScrollGatewayCallback.sol index ad025e9420..9d0d296291 100644 --- a/contracts/src/libraries/callbacks/IScrollGatewayCallback.sol +++ b/contracts/src/libraries/callbacks/IScrollGatewayCallback.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IScrollGatewayCallback { function onScrollGatewayCallback(bytes memory data) external; diff --git a/contracts/src/libraries/codec/BatchHeaderV0Codec.sol b/contracts/src/libraries/codec/BatchHeaderV0Codec.sol index 93004b40ce..d6bd8fe864 100644 --- a/contracts/src/libraries/codec/BatchHeaderV0Codec.sol +++ b/contracts/src/libraries/codec/BatchHeaderV0Codec.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; // solhint-disable no-inline-assembly @@ -10,19 +10,28 @@ pragma solidity ^0.8.16; /// * version 1 uint8 0 The batch version /// * batchIndex 8 uint64 1 The index of the batch /// * l1MessagePopped 8 uint64 9 Number of L1 messages popped in the batch -/// * totalL1MessagePopped 8 uint64 17 Number of total L1 message popped after the batch +/// * totalL1MessagePopped 8 uint64 17 Number of total L1 messages popped after the batch /// * dataHash 32 bytes32 25 The data hash of the batch /// * parentBatchHash 32 bytes32 57 The parent batch hash /// * skippedL1MessageBitmap dynamic uint256[] 89 A bitmap to indicate which L1 messages are skipped in the batch /// ``` library BatchHeaderV0Codec { + /// @dev Thrown when the length of batch header is smaller than 89 + error ErrorBatchHeaderLengthTooSmall(); + + /// @dev Thrown when the length of skippedL1MessageBitmap is incorrect. + error ErrorIncorrectBitmapLength(); + + /// @dev The length of fixed parts of the batch header. + uint256 internal constant BATCH_HEADER_FIXED_LENGTH = 89; + /// @notice Load batch header in calldata to memory. /// @param _batchHeader The encoded batch header bytes in calldata. /// @return batchPtr The start memory offset of the batch header in memory. /// @return length The length in bytes of the batch header. function loadAndValidate(bytes calldata _batchHeader) internal pure returns (uint256 batchPtr, uint256 length) { length = _batchHeader.length; - require(length >= 89, "batch header length too small"); + if (length < BATCH_HEADER_FIXED_LENGTH) revert ErrorBatchHeaderLengthTooSmall(); // copy batch header to memory. assembly { @@ -32,17 +41,19 @@ library BatchHeaderV0Codec { } // check batch header length - uint256 _l1MessagePopped = BatchHeaderV0Codec.l1MessagePopped(batchPtr); + uint256 _l1MessagePopped = getL1MessagePopped(batchPtr); unchecked { - require(length == 89 + ((_l1MessagePopped + 255) / 256) * 32, "wrong bitmap length"); + if (length != BATCH_HEADER_FIXED_LENGTH + ((_l1MessagePopped + 255) / 256) * 32) { + revert ErrorIncorrectBitmapLength(); + } } } /// @notice Get the version of the batch header. /// @param batchPtr The start memory offset of the batch header in memory. /// @return _version The version of the batch header. - function version(uint256 batchPtr) internal pure returns (uint256 _version) { + function getVersion(uint256 batchPtr) internal pure returns (uint256 _version) { assembly { _version := shr(248, mload(batchPtr)) } @@ -51,7 +62,7 @@ library BatchHeaderV0Codec { /// @notice Get the batch index of the batch. /// @param batchPtr The start memory offset of the batch header in memory. /// @return _batchIndex The batch index of the batch. - function batchIndex(uint256 batchPtr) internal pure returns (uint256 _batchIndex) { + function getBatchIndex(uint256 batchPtr) internal pure returns (uint256 _batchIndex) { assembly { _batchIndex := shr(192, mload(add(batchPtr, 1))) } @@ -60,7 +71,7 @@ library BatchHeaderV0Codec { /// @notice Get the number of L1 messages of the batch. /// @param batchPtr The start memory offset of the batch header in memory. /// @return _l1MessagePopped The number of L1 messages of the batch. - function l1MessagePopped(uint256 batchPtr) internal pure returns (uint256 _l1MessagePopped) { + function getL1MessagePopped(uint256 batchPtr) internal pure returns (uint256 _l1MessagePopped) { assembly { _l1MessagePopped := shr(192, mload(add(batchPtr, 9))) } @@ -69,7 +80,7 @@ library BatchHeaderV0Codec { /// @notice Get the number of L1 messages popped before this batch. /// @param batchPtr The start memory offset of the batch header in memory. /// @return _totalL1MessagePopped The the number of L1 messages popped before this batch. - function totalL1MessagePopped(uint256 batchPtr) internal pure returns (uint256 _totalL1MessagePopped) { + function getTotalL1MessagePopped(uint256 batchPtr) internal pure returns (uint256 _totalL1MessagePopped) { assembly { _totalL1MessagePopped := shr(192, mload(add(batchPtr, 17))) } @@ -78,7 +89,7 @@ library BatchHeaderV0Codec { /// @notice Get the data hash of the batch header. /// @param batchPtr The start memory offset of the batch header in memory. /// @return _dataHash The data hash of the batch header. - function dataHash(uint256 batchPtr) internal pure returns (bytes32 _dataHash) { + function getDataHash(uint256 batchPtr) internal pure returns (bytes32 _dataHash) { assembly { _dataHash := mload(add(batchPtr, 25)) } @@ -87,19 +98,28 @@ library BatchHeaderV0Codec { /// @notice Get the parent batch hash of the batch header. /// @param batchPtr The start memory offset of the batch header in memory. /// @return _parentBatchHash The parent batch hash of the batch header. - function parentBatchHash(uint256 batchPtr) internal pure returns (bytes32 _parentBatchHash) { + function getParentBatchHash(uint256 batchPtr) internal pure returns (bytes32 _parentBatchHash) { assembly { _parentBatchHash := mload(add(batchPtr, 57)) } } + /// @notice Get the start memory offset for skipped L1 messages bitmap. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _bitmapPtr the start memory offset for skipped L1 messages bitmap. + function getSkippedBitmapPtr(uint256 batchPtr) internal pure returns (uint256 _bitmapPtr) { + assembly { + _bitmapPtr := add(batchPtr, BATCH_HEADER_FIXED_LENGTH) + } + } + /// @notice Get the skipped L1 messages bitmap. /// @param batchPtr The start memory offset of the batch header in memory. /// @param index The index of bitmap to load. /// @return _bitmap The bitmap from bits `index * 256` to `index * 256 + 255`. - function skippedBitmap(uint256 batchPtr, uint256 index) internal pure returns (uint256 _bitmap) { + function getSkippedBitmap(uint256 batchPtr, uint256 index) internal pure returns (uint256 _bitmap) { assembly { - batchPtr := add(batchPtr, 89) + batchPtr := add(batchPtr, BATCH_HEADER_FIXED_LENGTH) _bitmap := mload(add(batchPtr, mul(index, 32))) } } @@ -169,14 +189,18 @@ library BatchHeaderV0Codec { /// @param _skippedL1MessageBitmap The skipped L1 message bitmap. function storeSkippedBitmap(uint256 batchPtr, bytes calldata _skippedL1MessageBitmap) internal pure { assembly { - calldatacopy(add(batchPtr, 89), _skippedL1MessageBitmap.offset, _skippedL1MessageBitmap.length) + calldatacopy( + add(batchPtr, BATCH_HEADER_FIXED_LENGTH), + _skippedL1MessageBitmap.offset, + _skippedL1MessageBitmap.length + ) } } /// @notice Compute the batch hash. /// @dev Caller should make sure that the encoded batch header is correct. /// - /// @param batchPtr The memory offset of the encoded batch header. + /// @param batchPtr The start memory offset of the batch header in memory. /// @param length The length of the batch. /// @return _batchHash The hash of the corresponding batch. function computeBatchHash(uint256 batchPtr, uint256 length) internal pure returns (bytes32 _batchHash) { diff --git a/contracts/src/libraries/codec/BatchHeaderV1Codec.sol b/contracts/src/libraries/codec/BatchHeaderV1Codec.sol new file mode 100644 index 0000000000..28a5fd513a --- /dev/null +++ b/contracts/src/libraries/codec/BatchHeaderV1Codec.sol @@ -0,0 +1,230 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.24; + +// solhint-disable no-inline-assembly + +/// @dev Below is the encoding for `BatchHeader` V1, total 121 + ceil(l1MessagePopped / 256) * 32 bytes. +/// ```text +/// * Field Bytes Type Index Comments +/// * version 1 uint8 0 The batch version +/// * batchIndex 8 uint64 1 The index of the batch +/// * l1MessagePopped 8 uint64 9 Number of L1 messages popped in the batch +/// * totalL1MessagePopped 8 uint64 17 Number of total L1 messages popped after the batch +/// * dataHash 32 bytes32 25 The data hash of the batch +/// * blobVersionedHash 32 bytes32 57 The versioned hash of the blob with this batch’s data +/// * parentBatchHash 32 bytes32 89 The parent batch hash +/// * skippedL1MessageBitmap dynamic uint256[] 121 A bitmap to indicate which L1 messages are skipped in the batch +/// ``` +library BatchHeaderV1Codec { + /// @dev Thrown when the length of batch header is smaller than 121. + error ErrorBatchHeaderLengthTooSmall(); + + /// @dev Thrown when the length of skippedL1MessageBitmap is incorrect. + error ErrorIncorrectBitmapLength(); + + /// @dev The length of fixed parts of the batch header. + uint256 internal constant BATCH_HEADER_FIXED_LENGTH = 121; + + /// @notice Load batch header in calldata to memory. + /// @param _batchHeader The encoded batch header bytes in calldata. + /// @return batchPtr The start memory offset of the batch header in memory. + /// @return length The length in bytes of the batch header. + function loadAndValidate(bytes calldata _batchHeader) internal pure returns (uint256 batchPtr, uint256 length) { + length = _batchHeader.length; + if (length < BATCH_HEADER_FIXED_LENGTH) revert ErrorBatchHeaderLengthTooSmall(); + + // copy batch header to memory. + assembly { + batchPtr := mload(0x40) + calldatacopy(batchPtr, _batchHeader.offset, length) + mstore(0x40, add(batchPtr, length)) + } + + // check batch header length + uint256 _l1MessagePopped = getL1MessagePopped(batchPtr); + + unchecked { + if (length != BATCH_HEADER_FIXED_LENGTH + ((_l1MessagePopped + 255) / 256) * 32) + revert ErrorIncorrectBitmapLength(); + } + } + + /// @notice Get the version of the batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _version The version of the batch header. + function getVersion(uint256 batchPtr) internal pure returns (uint256 _version) { + assembly { + _version := shr(248, mload(batchPtr)) + } + } + + /// @notice Get the batch index of the batch. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _batchIndex The batch index of the batch. + function getBatchIndex(uint256 batchPtr) internal pure returns (uint256 _batchIndex) { + assembly { + _batchIndex := shr(192, mload(add(batchPtr, 1))) + } + } + + /// @notice Get the number of L1 messages of the batch. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _l1MessagePopped The number of L1 messages of the batch. + function getL1MessagePopped(uint256 batchPtr) internal pure returns (uint256 _l1MessagePopped) { + assembly { + _l1MessagePopped := shr(192, mload(add(batchPtr, 9))) + } + } + + /// @notice Get the number of L1 messages popped before this batch. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _totalL1MessagePopped The the number of L1 messages popped before this batch. + function getTotalL1MessagePopped(uint256 batchPtr) internal pure returns (uint256 _totalL1MessagePopped) { + assembly { + _totalL1MessagePopped := shr(192, mload(add(batchPtr, 17))) + } + } + + /// @notice Get the data hash of the batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _dataHash The data hash of the batch header. + function getDataHash(uint256 batchPtr) internal pure returns (bytes32 _dataHash) { + assembly { + _dataHash := mload(add(batchPtr, 25)) + } + } + + /// @notice Get the blob versioned hash of the batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _blobVersionedHash The blob versioned hash of the batch header. + function getBlobVersionedHash(uint256 batchPtr) internal pure returns (bytes32 _blobVersionedHash) { + assembly { + _blobVersionedHash := mload(add(batchPtr, 57)) + } + } + + /// @notice Get the parent batch hash of the batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _parentBatchHash The parent batch hash of the batch header. + function getParentBatchHash(uint256 batchPtr) internal pure returns (bytes32 _parentBatchHash) { + assembly { + _parentBatchHash := mload(add(batchPtr, 89)) + } + } + + /// @notice Get the start memory offset for skipped L1 messages bitmap. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @return _bitmapPtr the start memory offset for skipped L1 messages bitmap. + function getSkippedBitmapPtr(uint256 batchPtr) internal pure returns (uint256 _bitmapPtr) { + assembly { + _bitmapPtr := add(batchPtr, BATCH_HEADER_FIXED_LENGTH) + } + } + + /// @notice Get the skipped L1 messages bitmap. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param index The index of bitmap to load. + /// @return _bitmap The bitmap from bits `index * 256` to `index * 256 + 255`. + function getSkippedBitmap(uint256 batchPtr, uint256 index) internal pure returns (uint256 _bitmap) { + assembly { + batchPtr := add(batchPtr, BATCH_HEADER_FIXED_LENGTH) + _bitmap := mload(add(batchPtr, mul(index, 32))) + } + } + + /// @notice Store the version of batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _version The version of batch header. + function storeVersion(uint256 batchPtr, uint256 _version) internal pure { + assembly { + mstore8(batchPtr, _version) + } + } + + /// @notice Store the batch index of batch header. + /// @dev Because this function can overwrite the subsequent fields, it must be called before + /// `storeL1MessagePopped`, `storeTotalL1MessagePopped`, and `storeDataHash`. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _batchIndex The batch index. + function storeBatchIndex(uint256 batchPtr, uint256 _batchIndex) internal pure { + assembly { + mstore(add(batchPtr, 1), shl(192, _batchIndex)) + } + } + + /// @notice Store the number of L1 messages popped in current batch to batch header. + /// @dev Because this function can overwrite the subsequent fields, it must be called before + /// `storeTotalL1MessagePopped` and `storeDataHash`. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _l1MessagePopped The number of L1 messages popped in current batch. + function storeL1MessagePopped(uint256 batchPtr, uint256 _l1MessagePopped) internal pure { + assembly { + mstore(add(batchPtr, 9), shl(192, _l1MessagePopped)) + } + } + + /// @notice Store the total number of L1 messages popped after current batch to batch header. + /// @dev Because this function can overwrite the subsequent fields, it must be called before + /// `storeDataHash`. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _totalL1MessagePopped The total number of L1 messages popped after current batch. + function storeTotalL1MessagePopped(uint256 batchPtr, uint256 _totalL1MessagePopped) internal pure { + assembly { + mstore(add(batchPtr, 17), shl(192, _totalL1MessagePopped)) + } + } + + /// @notice Store the data hash of batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _dataHash The data hash. + function storeDataHash(uint256 batchPtr, bytes32 _dataHash) internal pure { + assembly { + mstore(add(batchPtr, 25), _dataHash) + } + } + + /// @notice Store the parent batch hash of batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _blobVersionedHash The versioned hash of the blob with this batch’s data. + function storeBlobVersionedHash(uint256 batchPtr, bytes32 _blobVersionedHash) internal pure { + assembly { + mstore(add(batchPtr, 57), _blobVersionedHash) + } + } + + /// @notice Store the parent batch hash of batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _parentBatchHash The parent batch hash. + function storeParentBatchHash(uint256 batchPtr, bytes32 _parentBatchHash) internal pure { + assembly { + mstore(add(batchPtr, 89), _parentBatchHash) + } + } + + /// @notice Store the skipped L1 message bitmap of batch header. + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param _skippedL1MessageBitmap The skipped L1 message bitmap. + function storeSkippedBitmap(uint256 batchPtr, bytes calldata _skippedL1MessageBitmap) internal pure { + assembly { + calldatacopy( + add(batchPtr, BATCH_HEADER_FIXED_LENGTH), + _skippedL1MessageBitmap.offset, + _skippedL1MessageBitmap.length + ) + } + } + + /// @notice Compute the batch hash. + /// @dev Caller should make sure that the encoded batch header is correct. + /// + /// @param batchPtr The start memory offset of the batch header in memory. + /// @param length The length of the batch. + /// @return _batchHash The hash of the corresponding batch. + function computeBatchHash(uint256 batchPtr, uint256 length) internal pure returns (bytes32 _batchHash) { + // in the current version, the hash is: keccak(BatchHeader without timestamp) + assembly { + _batchHash := keccak256(batchPtr, length) + } + } +} diff --git a/contracts/src/libraries/codec/ChunkCodec.sol b/contracts/src/libraries/codec/ChunkCodecV0.sol similarity index 84% rename from contracts/src/libraries/codec/ChunkCodec.sol rename to contracts/src/libraries/codec/ChunkCodecV0.sol index 0da4d95252..1d4751c750 100644 --- a/contracts/src/libraries/codec/ChunkCodec.sol +++ b/contracts/src/libraries/codec/ChunkCodecV0.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /// @dev Below is the encoding for `Chunk`, total 60*n+1+m bytes. /// ```text @@ -19,12 +19,19 @@ pragma solidity ^0.8.16; /// * Field Bytes Type Index Comments /// * blockNumber 8 uint64 0 The height of this block. /// * timestamp 8 uint64 8 The timestamp of this block. -/// * baseFee 32 uint256 16 The base fee of this block. Currently, it is always 0, because we disable EIP-1559. +/// * baseFee 32 uint256 16 The base fee of this block. /// * gasLimit 8 uint64 48 The gas limit of this block. /// * numTransactions 2 uint16 56 The number of transactions in this block, both L1 & L2 txs. /// * numL1Messages 2 uint16 58 The number of l1 messages in this block. /// ``` -library ChunkCodec { +library ChunkCodecV0 { + /// @dev Thrown when no blocks in chunk. + error ErrorNoBlockInChunk(); + + /// @dev Thrown when the length of chunk is incorrect. + error ErrorIncorrectChunkLength(); + + /// @dev The length of one block context. uint256 internal constant BLOCK_CONTEXT_LENGTH = 60; /// @notice Validate the length of chunk. @@ -32,13 +39,13 @@ library ChunkCodec { /// @param _length The length of the chunk. /// @return _numBlocks The number of blocks in current chunk. function validateChunkLength(uint256 chunkPtr, uint256 _length) internal pure returns (uint256 _numBlocks) { - _numBlocks = numBlocks(chunkPtr); + _numBlocks = getNumBlocks(chunkPtr); // should contain at least one block - require(_numBlocks > 0, "no block in chunk"); + if (_numBlocks == 0) revert ErrorNoBlockInChunk(); // should contain at least the number of the blocks and block contexts - require(_length >= 1 + _numBlocks * BLOCK_CONTEXT_LENGTH, "invalid chunk length"); + if (_length < 1 + _numBlocks * BLOCK_CONTEXT_LENGTH) revert ErrorIncorrectChunkLength(); } /// @notice Return the start memory offset of `l2Transactions`. @@ -46,7 +53,7 @@ library ChunkCodec { /// @param chunkPtr The start memory offset of the chunk in memory. /// @param _numBlocks The number of blocks in current chunk. /// @return _l2TxPtr the start memory offset of `l2Transactions`. - function l2TxPtr(uint256 chunkPtr, uint256 _numBlocks) internal pure returns (uint256 _l2TxPtr) { + function getL2TxPtr(uint256 chunkPtr, uint256 _numBlocks) internal pure returns (uint256 _l2TxPtr) { unchecked { _l2TxPtr = chunkPtr + 1 + _numBlocks * BLOCK_CONTEXT_LENGTH; } @@ -55,7 +62,7 @@ library ChunkCodec { /// @notice Return the number of blocks in current chunk. /// @param chunkPtr The start memory offset of the chunk in memory. /// @return _numBlocks The number of blocks in current chunk. - function numBlocks(uint256 chunkPtr) internal pure returns (uint256 _numBlocks) { + function getNumBlocks(uint256 chunkPtr) internal pure returns (uint256 _numBlocks) { assembly { _numBlocks := shr(248, mload(chunkPtr)) } @@ -89,7 +96,7 @@ library ChunkCodec { /// @notice Return the number of transactions in current block. /// @param blockPtr The start memory offset of the block context in memory. /// @return _numTransactions The number of transactions in current block. - function numTransactions(uint256 blockPtr) internal pure returns (uint256 _numTransactions) { + function getNumTransactions(uint256 blockPtr) internal pure returns (uint256 _numTransactions) { assembly { _numTransactions := shr(240, mload(add(blockPtr, 56))) } @@ -98,7 +105,7 @@ library ChunkCodec { /// @notice Return the number of L1 messages in current block. /// @param blockPtr The start memory offset of the block context in memory. /// @return _numL1Messages The number of L1 messages in current block. - function numL1Messages(uint256 blockPtr) internal pure returns (uint256 _numL1Messages) { + function getNumL1Messages(uint256 blockPtr) internal pure returns (uint256 _numL1Messages) { assembly { _numL1Messages := shr(240, mload(add(blockPtr, 58))) } diff --git a/contracts/src/libraries/codec/ChunkCodecV1.sol b/contracts/src/libraries/codec/ChunkCodecV1.sol new file mode 100644 index 0000000000..51f0993089 --- /dev/null +++ b/contracts/src/libraries/codec/ChunkCodecV1.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.24; + +import {ChunkCodecV0} from "./ChunkCodecV0.sol"; + +/// @dev Below is the encoding for `Chunk`, total 60*n+1 bytes. +/// The only difference between `ChunkCodecV0` is we remove `l2Transactions` from chunk encoding. +/// ```text +/// * Field Bytes Type Index Comments +/// * numBlocks 1 uint8 0 The number of blocks in this chunk +/// * block[0] 60 BlockContext 1 The first block in this chunk +/// * ...... +/// * block[i] 60 BlockContext 60*i+1 The (i+1)'th block in this chunk +/// * ...... +/// * block[n-1] 60 BlockContext 60*n-59 The last block in this chunk +/// ``` +/// +/// @dev Below is the encoding for `BlockContext`, total 60 bytes. +/// ```text +/// * Field Bytes Type Index Comments +/// * blockNumber 8 uint64 0 The height of this block. +/// * timestamp 8 uint64 8 The timestamp of this block. +/// * baseFee 32 uint256 16 The base fee of this block. +/// * gasLimit 8 uint64 48 The gas limit of this block. +/// * numTransactions 2 uint16 56 The number of transactions in this block, both L1 & L2 txs. +/// * numL1Messages 2 uint16 58 The number of l1 messages in this block. +/// ``` +library ChunkCodecV1 { + /// @dev Thrown when no blocks in chunk. + error ErrorNoBlockInChunk(); + + /// @dev Thrown when the length of chunk is incorrect. + error ErrorIncorrectChunkLength(); + + /// @dev The length of one block context. + uint256 internal constant BLOCK_CONTEXT_LENGTH = 60; + + /// @notice Validate the length of chunk. + /// @param chunkPtr The start memory offset of the chunk in memory. + /// @param _length The length of the chunk. + /// @return _numBlocks The number of blocks in current chunk. + function validateChunkLength(uint256 chunkPtr, uint256 _length) internal pure returns (uint256 _numBlocks) { + _numBlocks = getNumBlocks(chunkPtr); + + // should contain at least one block + if (_numBlocks == 0) revert ErrorNoBlockInChunk(); + + // should contain the number of the blocks and block contexts + if (_length != 1 + _numBlocks * BLOCK_CONTEXT_LENGTH) revert ErrorIncorrectChunkLength(); + } + + /// @notice Return the number of blocks in current chunk. + /// @param chunkPtr The start memory offset of the chunk in memory. + /// @return _numBlocks The number of blocks in current chunk. + function getNumBlocks(uint256 chunkPtr) internal pure returns (uint256 _numBlocks) { + return ChunkCodecV0.getNumBlocks(chunkPtr); + } + + /// @notice Copy the block context to another memory. + /// @param chunkPtr The start memory offset of the chunk in memory. + /// @param dstPtr The destination memory offset to store the block context. + /// @param index The index of block context to copy. + /// @return uint256 The new destination memory offset after copy. + function copyBlockContext( + uint256 chunkPtr, + uint256 dstPtr, + uint256 index + ) internal pure returns (uint256) { + return ChunkCodecV0.copyBlockContext(chunkPtr, dstPtr, index); + } + + /// @notice Return the number of transactions in current block. + /// @param blockPtr The start memory offset of the block context in memory. + /// @return _numTransactions The number of transactions in current block. + function getNumTransactions(uint256 blockPtr) internal pure returns (uint256 _numTransactions) { + return ChunkCodecV0.getNumTransactions(blockPtr); + } + + /// @notice Return the number of L1 messages in current block. + /// @param blockPtr The start memory offset of the block context in memory. + /// @return _numL1Messages The number of L1 messages in current block. + function getNumL1Messages(uint256 blockPtr) internal pure returns (uint256 _numL1Messages) { + return ChunkCodecV0.getNumL1Messages(blockPtr); + } +} diff --git a/contracts/src/libraries/common/AddressAliasHelper.sol b/contracts/src/libraries/common/AddressAliasHelper.sol index 6edad88900..b618f58694 100644 --- a/contracts/src/libraries/common/AddressAliasHelper.sol +++ b/contracts/src/libraries/common/AddressAliasHelper.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; library AddressAliasHelper { /// @dev The offset added to the address in L1. diff --git a/contracts/src/libraries/common/AppendOnlyMerkleTree.sol b/contracts/src/libraries/common/AppendOnlyMerkleTree.sol index 466b5c9a62..23337bb3ae 100644 --- a/contracts/src/libraries/common/AppendOnlyMerkleTree.sol +++ b/contracts/src/libraries/common/AppendOnlyMerkleTree.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; abstract contract AppendOnlyMerkleTree { /// @dev The maximum height of the withdraw merkle tree. diff --git a/contracts/src/libraries/common/IWhitelist.sol b/contracts/src/libraries/common/IWhitelist.sol index cac9507887..a5187e3658 100644 --- a/contracts/src/libraries/common/IWhitelist.sol +++ b/contracts/src/libraries/common/IWhitelist.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IWhitelist { /// @notice Check whether the sender is allowed to do something. diff --git a/contracts/src/libraries/common/OwnableBase.sol b/contracts/src/libraries/common/OwnableBase.sol index ae901024ba..71b5aefab6 100644 --- a/contracts/src/libraries/common/OwnableBase.sol +++ b/contracts/src/libraries/common/OwnableBase.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; abstract contract OwnableBase { /********** diff --git a/contracts/src/libraries/constants/ScrollConstants.sol b/contracts/src/libraries/constants/ScrollConstants.sol index ff80b141f8..db9489b576 100644 --- a/contracts/src/libraries/constants/ScrollConstants.sol +++ b/contracts/src/libraries/constants/ScrollConstants.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; library ScrollConstants { /// @notice The address of default cross chain message sender. diff --git a/contracts/src/libraries/constants/ScrollPredeploy.sol b/contracts/src/libraries/constants/ScrollPredeploy.sol index fcb6e7b3f6..93fbeb3207 100644 --- a/contracts/src/libraries/constants/ScrollPredeploy.sol +++ b/contracts/src/libraries/constants/ScrollPredeploy.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; library ScrollPredeploy { address internal constant L1_MESSAGE_QUEUE = 0x5300000000000000000000000000000000000000; diff --git a/contracts/src/libraries/gateway/IScrollGateway.sol b/contracts/src/libraries/gateway/IScrollGateway.sol index 819ae625c2..955253d41e 100644 --- a/contracts/src/libraries/gateway/IScrollGateway.sol +++ b/contracts/src/libraries/gateway/IScrollGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IScrollGateway { /********** diff --git a/contracts/src/libraries/gateway/ScrollGatewayBase.sol b/contracts/src/libraries/gateway/ScrollGatewayBase.sol index a45e89fd19..4bc49ebc82 100644 --- a/contracts/src/libraries/gateway/ScrollGatewayBase.sol +++ b/contracts/src/libraries/gateway/ScrollGatewayBase.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; diff --git a/contracts/src/libraries/token/IScrollERC1155.sol b/contracts/src/libraries/token/IScrollERC1155.sol index 3a33816220..bbc92c0754 100644 --- a/contracts/src/libraries/token/IScrollERC1155.sol +++ b/contracts/src/libraries/token/IScrollERC1155.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {IScrollERC1155Extension} from "./IScrollERC1155Extension.sol"; diff --git a/contracts/src/libraries/token/IScrollERC20.sol b/contracts/src/libraries/token/IScrollERC20.sol index f626390766..6904e647c4 100644 --- a/contracts/src/libraries/token/IScrollERC20.sol +++ b/contracts/src/libraries/token/IScrollERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol"; diff --git a/contracts/src/libraries/token/IScrollERC20Upgradeable.sol b/contracts/src/libraries/token/IScrollERC20Upgradeable.sol index d4c9093a7e..1358623bf1 100644 --- a/contracts/src/libraries/token/IScrollERC20Upgradeable.sol +++ b/contracts/src/libraries/token/IScrollERC20Upgradeable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {IERC20PermitUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol"; diff --git a/contracts/src/libraries/token/IScrollERC721.sol b/contracts/src/libraries/token/IScrollERC721.sol index 775f8be4f5..502bcb7672 100644 --- a/contracts/src/libraries/token/IScrollERC721.sol +++ b/contracts/src/libraries/token/IScrollERC721.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IScrollERC721Extension} from "./IScrollERC721Extension.sol"; diff --git a/contracts/src/libraries/token/IScrollStandardERC20Factory.sol b/contracts/src/libraries/token/IScrollStandardERC20Factory.sol index 9747bc0ead..6262ce08e6 100644 --- a/contracts/src/libraries/token/IScrollStandardERC20Factory.sol +++ b/contracts/src/libraries/token/IScrollStandardERC20Factory.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IScrollStandardERC20Factory { /// @notice Emitted when a l2 token is deployed. diff --git a/contracts/src/libraries/token/ScrollStandardERC20.sol b/contracts/src/libraries/token/ScrollStandardERC20.sol index 3b42fd6794..05157d5fe6 100644 --- a/contracts/src/libraries/token/ScrollStandardERC20.sol +++ b/contracts/src/libraries/token/ScrollStandardERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import {ERC20PermitUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; diff --git a/contracts/src/libraries/token/ScrollStandardERC20Factory.sol b/contracts/src/libraries/token/ScrollStandardERC20Factory.sol index 2c288bba46..67767a08fc 100644 --- a/contracts/src/libraries/token/ScrollStandardERC20Factory.sol +++ b/contracts/src/libraries/token/ScrollStandardERC20Factory.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/contracts/src/libraries/verifier/IRollupVerifier.sol b/contracts/src/libraries/verifier/IRollupVerifier.sol index 8a43127f94..72217d5d0a 100644 --- a/contracts/src/libraries/verifier/IRollupVerifier.sol +++ b/contracts/src/libraries/verifier/IRollupVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IRollupVerifier { /// @notice Verify aggregate zk proof. @@ -12,4 +12,16 @@ interface IRollupVerifier { bytes calldata aggrProof, bytes32 publicInputHash ) external view; + + /// @notice Verify aggregate zk proof. + /// @param version The version of verifier to use. + /// @param batchIndex The batch index to verify. + /// @param aggrProof The aggregated proof. + /// @param publicInputHash The public input hash. + function verifyAggregateProof( + uint256 version, + uint256 batchIndex, + bytes calldata aggrProof, + bytes32 publicInputHash + ) external view; } diff --git a/contracts/src/libraries/verifier/IZkEvmVerifier.sol b/contracts/src/libraries/verifier/IZkEvmVerifier.sol index 708e1c63db..853aca159d 100644 --- a/contracts/src/libraries/verifier/IZkEvmVerifier.sol +++ b/contracts/src/libraries/verifier/IZkEvmVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IZkEvmVerifier { /// @notice Verify aggregate zk proof. diff --git a/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol b/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol index f518564925..9ef65109df 100644 --- a/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol +++ b/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; library PatriciaMerkleTrieVerifier { /// @notice Internal function to validates a proof from eth_getProof. diff --git a/contracts/src/libraries/verifier/RollupVerifier.sol b/contracts/src/libraries/verifier/RollupVerifier.sol index 86c0ccfcbb..ba1a26551d 100644 --- a/contracts/src/libraries/verifier/RollupVerifier.sol +++ b/contracts/src/libraries/verifier/RollupVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; library RollupVerifier { function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) { diff --git a/contracts/src/libraries/verifier/WithdrawTrieVerifier.sol b/contracts/src/libraries/verifier/WithdrawTrieVerifier.sol index 4efe3a9548..c540925453 100644 --- a/contracts/src/libraries/verifier/WithdrawTrieVerifier.sol +++ b/contracts/src/libraries/verifier/WithdrawTrieVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; // solhint-disable no-inline-assembly diff --git a/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol b/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol index 5d325f0fc0..45bfe909d8 100644 --- a/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol +++ b/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IZkEvmVerifier} from "./IZkEvmVerifier.sol"; diff --git a/contracts/src/libraries/verifier/ZkTrieVerifier.sol b/contracts/src/libraries/verifier/ZkTrieVerifier.sol index 3efb764f3b..803a35dd83 100644 --- a/contracts/src/libraries/verifier/ZkTrieVerifier.sol +++ b/contracts/src/libraries/verifier/ZkTrieVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; // solhint-disable no-inline-assembly diff --git a/contracts/src/lido/L1LidoGateway.sol b/contracts/src/lido/L1LidoGateway.sol index 416064fd94..c3b87e91fd 100644 --- a/contracts/src/lido/L1LidoGateway.sol +++ b/contracts/src/lido/L1LidoGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL1ERC20Gateway} from "../L1/gateways/IL1ERC20Gateway.sol"; import {L1ERC20Gateway} from "../L1/gateways/L1ERC20Gateway.sol"; diff --git a/contracts/src/lido/L2LidoGateway.sol b/contracts/src/lido/L2LidoGateway.sol index 991ea00627..310b44ced2 100644 --- a/contracts/src/lido/L2LidoGateway.sol +++ b/contracts/src/lido/L2LidoGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IL1ERC20Gateway} from "../L1/gateways/IL1ERC20Gateway.sol"; import {IL2ERC20Gateway} from "../L2/gateways/IL2ERC20Gateway.sol"; diff --git a/contracts/src/lido/L2WstETHToken.sol b/contracts/src/lido/L2WstETHToken.sol index 9b53e69fbf..63e90c0c81 100644 --- a/contracts/src/lido/L2WstETHToken.sol +++ b/contracts/src/lido/L2WstETHToken.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IERC20PermitUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol"; import {ERC20PermitUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol"; diff --git a/contracts/src/lido/LidoBridgeableTokens.sol b/contracts/src/lido/LidoBridgeableTokens.sol index 57bade1dc4..2da95ba1b5 100644 --- a/contracts/src/lido/LidoBridgeableTokens.sol +++ b/contracts/src/lido/LidoBridgeableTokens.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; abstract contract LidoBridgeableTokens { /************* diff --git a/contracts/src/lido/LidoGatewayManager.sol b/contracts/src/lido/LidoGatewayManager.sol index 08ccb2135c..dd4d809840 100644 --- a/contracts/src/lido/LidoGatewayManager.sol +++ b/contracts/src/lido/LidoGatewayManager.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {EnumerableSetUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; diff --git a/contracts/src/misc/ERC2771Forwarder.sol b/contracts/src/misc/ERC2771Forwarder.sol index 59708326f4..8e1b4d6900 100644 --- a/contracts/src/misc/ERC2771Forwarder.sol +++ b/contracts/src/misc/ERC2771Forwarder.sol @@ -4,7 +4,7 @@ // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/metatx/ERC2771Forwarder.sol // Modifications are made to make it compatible with solidity 0.8.16. -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ERC2771Context} from "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; diff --git a/contracts/src/misc/EmptyContract.sol b/contracts/src/misc/EmptyContract.sol index cf7c66610c..635e8565d8 100644 --- a/contracts/src/misc/EmptyContract.sol +++ b/contracts/src/misc/EmptyContract.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; // solhint-disable no-empty-blocks diff --git a/contracts/src/misc/Fallback.sol b/contracts/src/misc/Fallback.sol index 57472dec0f..ba12f3d68d 100644 --- a/contracts/src/misc/Fallback.sol +++ b/contracts/src/misc/Fallback.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/src/misc/Nonces.sol b/contracts/src/misc/Nonces.sol index 3871ea61a0..7c761498b4 100644 --- a/contracts/src/misc/Nonces.sol +++ b/contracts/src/misc/Nonces.sol @@ -4,7 +4,7 @@ // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Nonces.sol // Modifications are made to make it compatible with solidity 0.8.16. -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; /** * @dev Provides tracking nonces for addresses. Nonces will only increment. diff --git a/contracts/src/misc/ScrollOwner.sol b/contracts/src/misc/ScrollOwner.sol index 0da16cde4c..bb3bace7c8 100644 --- a/contracts/src/misc/ScrollOwner.sol +++ b/contracts/src/misc/ScrollOwner.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; diff --git a/contracts/src/mocks/MockCaller.sol b/contracts/src/mocks/MockCaller.sol index 5d0341cec7..9c253c2c7e 100644 --- a/contracts/src/mocks/MockCaller.sol +++ b/contracts/src/mocks/MockCaller.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; contract MockCaller { function callTarget(address to, bytes calldata data) external payable { diff --git a/contracts/src/mocks/MockERC20.sol b/contracts/src/mocks/MockERC20.sol index 2cb1d4403f..3e3e4997a0 100644 --- a/contracts/src/mocks/MockERC20.sol +++ b/contracts/src/mocks/MockERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; diff --git a/contracts/src/mocks/MockGasSwapTarget.sol b/contracts/src/mocks/MockGasSwapTarget.sol index d4ce857db2..919315f544 100644 --- a/contracts/src/mocks/MockGasSwapTarget.sol +++ b/contracts/src/mocks/MockGasSwapTarget.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/src/mocks/MockPatriciaMerkleTrieVerifier.sol b/contracts/src/mocks/MockPatriciaMerkleTrieVerifier.sol index d90e962df1..98d541c6a7 100644 --- a/contracts/src/mocks/MockPatriciaMerkleTrieVerifier.sol +++ b/contracts/src/mocks/MockPatriciaMerkleTrieVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {PatriciaMerkleTrieVerifier} from "../libraries/verifier/PatriciaMerkleTrieVerifier.sol"; diff --git a/contracts/src/mocks/MockZkTrieVerifier.sol b/contracts/src/mocks/MockZkTrieVerifier.sol index 61983c2afd..fe863678d4 100644 --- a/contracts/src/mocks/MockZkTrieVerifier.sol +++ b/contracts/src/mocks/MockZkTrieVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ZkTrieVerifier} from "../libraries/verifier/ZkTrieVerifier.sol"; diff --git a/contracts/src/rate-limiter/ETHRateLimiter.sol b/contracts/src/rate-limiter/ETHRateLimiter.sol index c2a641aced..31ba904c7a 100644 --- a/contracts/src/rate-limiter/ETHRateLimiter.sol +++ b/contracts/src/rate-limiter/ETHRateLimiter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; diff --git a/contracts/src/rate-limiter/IETHRateLimiter.sol b/contracts/src/rate-limiter/IETHRateLimiter.sol index 79fae96b62..43db682e59 100644 --- a/contracts/src/rate-limiter/IETHRateLimiter.sol +++ b/contracts/src/rate-limiter/IETHRateLimiter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface IETHRateLimiter { /********** diff --git a/contracts/src/rate-limiter/ITokenRateLimiter.sol b/contracts/src/rate-limiter/ITokenRateLimiter.sol index ad44fa8755..050680efca 100644 --- a/contracts/src/rate-limiter/ITokenRateLimiter.sol +++ b/contracts/src/rate-limiter/ITokenRateLimiter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity ^0.8.24; interface ITokenRateLimiter { /********** diff --git a/contracts/src/rate-limiter/TokenRateLimiter.sol b/contracts/src/rate-limiter/TokenRateLimiter.sol index 5d25f4b3b4..dab08e8a27 100644 --- a/contracts/src/rate-limiter/TokenRateLimiter.sol +++ b/contracts/src/rate-limiter/TokenRateLimiter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; diff --git a/contracts/src/test/ETHRateLimiter.t.sol b/contracts/src/test/ETHRateLimiter.t.sol index eecd35f9ec..31c537253a 100644 --- a/contracts/src/test/ETHRateLimiter.t.sol +++ b/contracts/src/test/ETHRateLimiter.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L1CustomERC20Gateway.t.sol b/contracts/src/test/L1CustomERC20Gateway.t.sol index 936b129a50..a1b667d262 100644 --- a/contracts/src/test/L1CustomERC20Gateway.t.sol +++ b/contracts/src/test/L1CustomERC20Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/L1ERC1155Gateway.t.sol b/contracts/src/test/L1ERC1155Gateway.t.sol index 13dd7f6ee2..c9c7836c1b 100644 --- a/contracts/src/test/L1ERC1155Gateway.t.sol +++ b/contracts/src/test/L1ERC1155Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; import {MockERC1155} from "solmate/test/utils/mocks/MockERC1155.sol"; diff --git a/contracts/src/test/L1ERC721Gateway.t.sol b/contracts/src/test/L1ERC721Gateway.t.sol index d7c28f3c11..b76163d834 100644 --- a/contracts/src/test/L1ERC721Gateway.t.sol +++ b/contracts/src/test/L1ERC721Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC721} from "solmate/test/utils/mocks/MockERC721.sol"; import {ERC721TokenReceiver} from "solmate/tokens/ERC721.sol"; diff --git a/contracts/src/test/L1ETHGateway.t.sol b/contracts/src/test/L1ETHGateway.t.sol index d8a3f670fa..d03dee7adc 100644 --- a/contracts/src/test/L1ETHGateway.t.sol +++ b/contracts/src/test/L1ETHGateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ITransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/contracts/src/test/L1GasPriceOracle.t.sol b/contracts/src/test/L1GasPriceOracle.t.sol index ce6d5abfe6..5c77ce6c75 100644 --- a/contracts/src/test/L1GasPriceOracle.t.sol +++ b/contracts/src/test/L1GasPriceOracle.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L1GatewayRouter.t.sol b/contracts/src/test/L1GatewayRouter.t.sol index 977ef53902..cb2460aded 100644 --- a/contracts/src/test/L1GatewayRouter.t.sol +++ b/contracts/src/test/L1GatewayRouter.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/L1GatewayTestBase.t.sol b/contracts/src/test/L1GatewayTestBase.t.sol index 53346277cf..a47b594595 100644 --- a/contracts/src/test/L1GatewayTestBase.t.sol +++ b/contracts/src/test/L1GatewayTestBase.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol b/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol index 6ac51affeb..536d85ea9d 100644 --- a/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol +++ b/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L1ScrollMessengerTest.t.sol b/contracts/src/test/L1ScrollMessengerTest.t.sol index c2eb626593..bd804e21f9 100644 --- a/contracts/src/test/L1ScrollMessengerTest.t.sol +++ b/contracts/src/test/L1ScrollMessengerTest.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L1StandardERC20Gateway.t.sol b/contracts/src/test/L1StandardERC20Gateway.t.sol index 589ae3c5cc..576c557d8d 100644 --- a/contracts/src/test/L1StandardERC20Gateway.t.sol +++ b/contracts/src/test/L1StandardERC20Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/L1WETHGateway.t.sol b/contracts/src/test/L1WETHGateway.t.sol index e839d4db2c..f2a14425da 100644 --- a/contracts/src/test/L1WETHGateway.t.sol +++ b/contracts/src/test/L1WETHGateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {WETH} from "solmate/tokens/WETH.sol"; diff --git a/contracts/src/test/L2CustomERC20Gateway.t.sol b/contracts/src/test/L2CustomERC20Gateway.t.sol index bc3494400f..5a0838f2f8 100644 --- a/contracts/src/test/L2CustomERC20Gateway.t.sol +++ b/contracts/src/test/L2CustomERC20Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/L2ERC1155Gateway.t.sol b/contracts/src/test/L2ERC1155Gateway.t.sol index 5a3ab622df..b436306fd8 100644 --- a/contracts/src/test/L2ERC1155Gateway.t.sol +++ b/contracts/src/test/L2ERC1155Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; import {MockERC1155} from "solmate/test/utils/mocks/MockERC1155.sol"; diff --git a/contracts/src/test/L2ERC721Gateway.t.sol b/contracts/src/test/L2ERC721Gateway.t.sol index b4ef1caeb2..2534f0fa8c 100644 --- a/contracts/src/test/L2ERC721Gateway.t.sol +++ b/contracts/src/test/L2ERC721Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; import {MockERC721} from "solmate/test/utils/mocks/MockERC721.sol"; diff --git a/contracts/src/test/L2ETHGateway.t.sol b/contracts/src/test/L2ETHGateway.t.sol index 004b254fc1..324d5335f2 100644 --- a/contracts/src/test/L2ETHGateway.t.sol +++ b/contracts/src/test/L2ETHGateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ITransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/contracts/src/test/L2GasPriceOracle.t.sol b/contracts/src/test/L2GasPriceOracle.t.sol index c7f4b00026..dd5a583d4e 100644 --- a/contracts/src/test/L2GasPriceOracle.t.sol +++ b/contracts/src/test/L2GasPriceOracle.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L2GatewayRouter.t.sol b/contracts/src/test/L2GatewayRouter.t.sol index c5aa251330..edf090411b 100644 --- a/contracts/src/test/L2GatewayRouter.t.sol +++ b/contracts/src/test/L2GatewayRouter.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/L2GatewayTestBase.t.sol b/contracts/src/test/L2GatewayTestBase.t.sol index 007dc83094..180fba2b86 100644 --- a/contracts/src/test/L2GatewayTestBase.t.sol +++ b/contracts/src/test/L2GatewayTestBase.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L2MessageQueue.t.sol b/contracts/src/test/L2MessageQueue.t.sol index 9b29ea77f2..d0068c1d6e 100644 --- a/contracts/src/test/L2MessageQueue.t.sol +++ b/contracts/src/test/L2MessageQueue.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L2ScrollMessenger.t.sol b/contracts/src/test/L2ScrollMessenger.t.sol index 8be708d375..6dea30edc4 100644 --- a/contracts/src/test/L2ScrollMessenger.t.sol +++ b/contracts/src/test/L2ScrollMessenger.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L2StandardERC20Gateway.t.sol b/contracts/src/test/L2StandardERC20Gateway.t.sol index b057d8e3ef..a1fb335a1f 100644 --- a/contracts/src/test/L2StandardERC20Gateway.t.sol +++ b/contracts/src/test/L2StandardERC20Gateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/L2TxFeeVault.t.sol b/contracts/src/test/L2TxFeeVault.t.sol index 4d53f986c6..04f3d89e93 100644 --- a/contracts/src/test/L2TxFeeVault.t.sol +++ b/contracts/src/test/L2TxFeeVault.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/L2USDCGateway.t.sol b/contracts/src/test/L2USDCGateway.t.sol index 2762caa59f..316f258158 100644 --- a/contracts/src/test/L2USDCGateway.t.sol +++ b/contracts/src/test/L2USDCGateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ITransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/contracts/src/test/L2WETHGateway.t.sol b/contracts/src/test/L2WETHGateway.t.sol index 8ed22be2cb..2d36ce5c70 100644 --- a/contracts/src/test/L2WETHGateway.t.sol +++ b/contracts/src/test/L2WETHGateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {WETH} from "solmate/tokens/WETH.sol"; diff --git a/contracts/src/test/MultipleVersionRollupVerifier.t.sol b/contracts/src/test/MultipleVersionRollupVerifier.t.sol index 9da14344e0..cd9a168be7 100644 --- a/contracts/src/test/MultipleVersionRollupVerifier.t.sol +++ b/contracts/src/test/MultipleVersionRollupVerifier.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; @@ -24,95 +24,143 @@ contract MultipleVersionRollupVerifierTest is DSTestPlus { v0 = new MockZkEvmVerifier(); v1 = new MockZkEvmVerifier(); v2 = new MockZkEvmVerifier(); - verifier = new MultipleVersionRollupVerifier(address(v0)); - chain = new MockScrollChain(address(1), address(verifier)); + + chain = new MockScrollChain(address(1), address(1)); + uint256[] memory _versions = new uint256[](1); + address[] memory _verifiers = new address[](1); + _versions[0] = 0; + _verifiers[0] = address(v0); + verifier = new MultipleVersionRollupVerifier(address(chain), _versions, _verifiers); } - function testInitialize(address _chain) external { - hevm.assume(_chain != address(0)); + function testUpdateVerifierVersion0(address _newVerifier) external { + hevm.assume(_newVerifier != address(0)); // set by non-owner, should revert hevm.startPrank(address(1)); hevm.expectRevert("Ownable: caller is not the owner"); - verifier.initialize(_chain); + verifier.updateVerifier(0, 0, address(0)); hevm.stopPrank(); - // succeed - assertEq(verifier.scrollChain(), address(0)); - verifier.initialize(_chain); - assertEq(verifier.scrollChain(), _chain); + // start batch index finalized, revert + hevm.expectRevert(MultipleVersionRollupVerifier.ErrorStartBatchIndexFinalized.selector); + verifier.updateVerifier(0, 0, address(1)); + + // zero verifier address, revert + hevm.expectRevert(MultipleVersionRollupVerifier.ErrorZeroAddress.selector); + verifier.updateVerifier(0, 1, address(0)); + + // change to random operator + assertEq(verifier.legacyVerifiersLength(0), 0); + verifier.updateVerifier(0, uint64(100), _newVerifier); + assertEq(verifier.legacyVerifiersLength(0), 1); + (uint64 _startBatchIndex, address _verifier) = verifier.latestVerifier(0); + assertEq(_startBatchIndex, uint64(100)); + assertEq(_verifier, _newVerifier); + (_startBatchIndex, _verifier) = verifier.legacyVerifiers(0, 0); + assertEq(_startBatchIndex, uint64(0)); + assertEq(_verifier, address(v0)); + + // change to same batch index + verifier.updateVerifier(0, uint64(100), address(v1)); + (_startBatchIndex, _verifier) = verifier.latestVerifier(0); + assertEq(_startBatchIndex, uint64(100)); + assertEq(_verifier, address(v1)); + (_startBatchIndex, _verifier) = verifier.legacyVerifiers(0, 0); + assertEq(_startBatchIndex, uint64(0)); + assertEq(_verifier, address(v0)); - // initialized, revert - hevm.expectRevert("initialized"); - verifier.initialize(_chain); + // start batch index too small, revert + hevm.expectRevert(MultipleVersionRollupVerifier.ErrorStartBatchIndexTooSmall.selector); + verifier.updateVerifier(0, 99, _newVerifier); } - function testUpdateVerifier(address _newVerifier) external { + function testUpdateVerifierVersion(uint256 version, address _newVerifier) external { + hevm.assume(version != 0); hevm.assume(_newVerifier != address(0)); - verifier.initialize(address(chain)); + // set v0 + assertEq(verifier.legacyVerifiersLength(version), 0); + verifier.updateVerifier(version, 1, address(v0)); + assertEq(verifier.legacyVerifiersLength(version), 0); + (uint64 _startBatchIndex, address _verifier) = verifier.latestVerifier(version); + assertEq(_startBatchIndex, 1); + assertEq(_verifier, address(v0)); // set by non-owner, should revert hevm.startPrank(address(1)); hevm.expectRevert("Ownable: caller is not the owner"); - verifier.updateVerifier(0, address(0)); + verifier.updateVerifier(version, 0, address(0)); hevm.stopPrank(); // start batch index finalized, revert - hevm.expectRevert("start batch index finalized"); - verifier.updateVerifier(0, address(1)); + hevm.expectRevert(MultipleVersionRollupVerifier.ErrorStartBatchIndexFinalized.selector); + verifier.updateVerifier(version, 0, address(1)); // zero verifier address, revert - hevm.expectRevert("zero verifier address"); - verifier.updateVerifier(1, address(0)); + hevm.expectRevert(MultipleVersionRollupVerifier.ErrorZeroAddress.selector); + verifier.updateVerifier(version, 1, address(0)); // change to random operator - assertEq(verifier.legacyVerifiersLength(), 0); - verifier.updateVerifier(uint64(100), _newVerifier); - assertEq(verifier.legacyVerifiersLength(), 1); - (uint64 _startBatchIndex, address _verifier) = verifier.latestVerifier(); + assertEq(verifier.legacyVerifiersLength(version), 0); + verifier.updateVerifier(version, uint64(100), _newVerifier); + assertEq(verifier.legacyVerifiersLength(version), 1); + (_startBatchIndex, _verifier) = verifier.latestVerifier(version); assertEq(_startBatchIndex, uint64(100)); assertEq(_verifier, _newVerifier); - (_startBatchIndex, _verifier) = verifier.legacyVerifiers(0); - assertEq(_startBatchIndex, uint64(0)); + (_startBatchIndex, _verifier) = verifier.legacyVerifiers(version, 0); + assertEq(_startBatchIndex, uint64(1)); assertEq(_verifier, address(v0)); // change to same batch index - verifier.updateVerifier(uint64(100), address(v1)); - (_startBatchIndex, _verifier) = verifier.latestVerifier(); + verifier.updateVerifier(version, uint64(100), address(v1)); + (_startBatchIndex, _verifier) = verifier.latestVerifier(version); assertEq(_startBatchIndex, uint64(100)); assertEq(_verifier, address(v1)); - (_startBatchIndex, _verifier) = verifier.legacyVerifiers(0); - assertEq(_startBatchIndex, uint64(0)); + (_startBatchIndex, _verifier) = verifier.legacyVerifiers(version, 0); + assertEq(_startBatchIndex, uint64(1)); assertEq(_verifier, address(v0)); // start batch index too small, revert - hevm.expectRevert("start batch index too small"); - verifier.updateVerifier(99, _newVerifier); + hevm.expectRevert(MultipleVersionRollupVerifier.ErrorStartBatchIndexTooSmall.selector); + verifier.updateVerifier(version, 99, _newVerifier); } - function testGetVerifier() external { - verifier.initialize(address(chain)); - - verifier.updateVerifier(100, address(v1)); - verifier.updateVerifier(300, address(v2)); - - assertEq(verifier.getVerifier(0), address(v0)); - assertEq(verifier.getVerifier(1), address(v0)); - assertEq(verifier.getVerifier(99), address(v0)); - assertEq(verifier.getVerifier(100), address(v1)); - assertEq(verifier.getVerifier(101), address(v1)); - assertEq(verifier.getVerifier(299), address(v1)); - assertEq(verifier.getVerifier(300), address(v2)); - assertEq(verifier.getVerifier(301), address(v2)); - assertEq(verifier.getVerifier(10000), address(v2)); + function testGetVerifierV0() external { + verifier.updateVerifier(0, 100, address(v1)); + verifier.updateVerifier(0, 300, address(v2)); + + assertEq(verifier.getVerifier(0, 0), address(v0)); + assertEq(verifier.getVerifier(0, 1), address(v0)); + assertEq(verifier.getVerifier(0, 99), address(v0)); + assertEq(verifier.getVerifier(0, 100), address(v1)); + assertEq(verifier.getVerifier(0, 101), address(v1)); + assertEq(verifier.getVerifier(0, 299), address(v1)); + assertEq(verifier.getVerifier(0, 300), address(v2)); + assertEq(verifier.getVerifier(0, 301), address(v2)); + assertEq(verifier.getVerifier(0, 10000), address(v2)); } - function testVerifyAggregateProof() external { - verifier.initialize(address(chain)); + function testGetVerifier(uint256 version) external { + hevm.assume(version != 0); + + verifier.updateVerifier(version, 1, address(v0)); + verifier.updateVerifier(version, 100, address(v1)); + verifier.updateVerifier(version, 300, address(v2)); + + assertEq(verifier.getVerifier(version, 1), address(v0)); + assertEq(verifier.getVerifier(version, 99), address(v0)); + assertEq(verifier.getVerifier(version, 100), address(v1)); + assertEq(verifier.getVerifier(version, 101), address(v1)); + assertEq(verifier.getVerifier(version, 299), address(v1)); + assertEq(verifier.getVerifier(version, 300), address(v2)); + assertEq(verifier.getVerifier(version, 301), address(v2)); + assertEq(verifier.getVerifier(version, 10000), address(v2)); + } - verifier.updateVerifier(100, address(v1)); - verifier.updateVerifier(300, address(v2)); + function testVerifyAggregateProofV0() external { + verifier.updateVerifier(0, 100, address(v1)); + verifier.updateVerifier(0, 300, address(v2)); hevm.expectRevert(abi.encode(address(v0))); verifier.verifyAggregateProof(0, new bytes(0), bytes32(0)); @@ -133,4 +181,29 @@ contract MultipleVersionRollupVerifierTest is DSTestPlus { hevm.expectRevert(abi.encode(address(v2))); verifier.verifyAggregateProof(10000, new bytes(0), bytes32(0)); } + + function testVerifyAggregateProof(uint256 version) external { + hevm.assume(version != 0); + + verifier.updateVerifier(version, 1, address(v0)); + verifier.updateVerifier(version, 100, address(v1)); + verifier.updateVerifier(version, 300, address(v2)); + + hevm.expectRevert(abi.encode(address(v0))); + verifier.verifyAggregateProof(version, 1, new bytes(0), bytes32(0)); + hevm.expectRevert(abi.encode(address(v0))); + verifier.verifyAggregateProof(version, 99, new bytes(0), bytes32(0)); + hevm.expectRevert(abi.encode(address(v1))); + verifier.verifyAggregateProof(version, 100, new bytes(0), bytes32(0)); + hevm.expectRevert(abi.encode(address(v1))); + verifier.verifyAggregateProof(version, 101, new bytes(0), bytes32(0)); + hevm.expectRevert(abi.encode(address(v1))); + verifier.verifyAggregateProof(version, 299, new bytes(0), bytes32(0)); + hevm.expectRevert(abi.encode(address(v2))); + verifier.verifyAggregateProof(version, 300, new bytes(0), bytes32(0)); + hevm.expectRevert(abi.encode(address(v2))); + verifier.verifyAggregateProof(version, 301, new bytes(0), bytes32(0)); + hevm.expectRevert(abi.encode(address(v2))); + verifier.verifyAggregateProof(version, 10000, new bytes(0), bytes32(0)); + } } diff --git a/contracts/src/test/ScrollChain.t.sol b/contracts/src/test/ScrollChain.t.sol index 763f58fbf3..d24862f5cd 100644 --- a/contracts/src/test/ScrollChain.t.sol +++ b/contracts/src/test/ScrollChain.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; @@ -9,6 +9,8 @@ import {ITransparentUpgradeableProxy, TransparentUpgradeableProxy} from "@openze import {L1MessageQueue} from "../L1/rollup/L1MessageQueue.sol"; import {ScrollChain, IScrollChain} from "../L1/rollup/ScrollChain.sol"; +import {BatchHeaderV0Codec} from "../libraries/codec/BatchHeaderV0Codec.sol"; +import {ChunkCodecV0} from "../libraries/codec/ChunkCodecV0.sol"; import {EmptyContract} from "../misc/EmptyContract.sol"; import {MockRollupVerifier} from "./mocks/MockRollupVerifier.sol"; @@ -53,7 +55,7 @@ contract ScrollChainTest is DSTestPlus { rollup.initialize(address(messageQueue), address(verifier), 100); } - function testInitialized() public { + function testInitialized() external { assertEq(address(this), rollup.owner()); assertEq(rollup.layer2ChainId(), 233); @@ -61,7 +63,7 @@ contract ScrollChainTest is DSTestPlus { rollup.initialize(address(messageQueue), address(0), 100); } - function testCommitBatch() public { + function testCommitBatchV0() external { bytes memory batchHeader0 = new bytes(89); // import 10 L1 messages @@ -76,32 +78,32 @@ contract ScrollChainTest is DSTestPlus { rollup.importGenesisBatch(batchHeader0, bytes32(uint256(1))); // caller not sequencer, revert - hevm.expectRevert("caller not sequencer"); + hevm.expectRevert(ScrollChain.ErrorCallerIsNotSequencer.selector); rollup.commitBatch(0, batchHeader0, new bytes[](0), new bytes(0)); rollup.addSequencer(address(0)); - // invalid version, revert + // batch is empty, revert hevm.startPrank(address(0)); - hevm.expectRevert("invalid version"); - rollup.commitBatch(1, batchHeader0, new bytes[](0), new bytes(0)); + hevm.expectRevert(ScrollChain.ErrorBatchIsEmpty.selector); + rollup.commitBatch(0, batchHeader0, new bytes[](0), new bytes(0)); hevm.stopPrank(); - // batch is empty, revert + // invalid version, revert hevm.startPrank(address(0)); - hevm.expectRevert("batch is empty"); - rollup.commitBatch(0, batchHeader0, new bytes[](0), new bytes(0)); + hevm.expectRevert(ScrollChain.ErrorInvalidBatchHeaderVersion.selector); + rollup.commitBatch(2, batchHeader0, new bytes[](1), new bytes(0)); hevm.stopPrank(); // batch header length too small, revert hevm.startPrank(address(0)); - hevm.expectRevert("batch header length too small"); + hevm.expectRevert(BatchHeaderV0Codec.ErrorBatchHeaderLengthTooSmall.selector); rollup.commitBatch(0, new bytes(88), new bytes[](1), new bytes(0)); hevm.stopPrank(); // wrong bitmap length, revert hevm.startPrank(address(0)); - hevm.expectRevert("wrong bitmap length"); + hevm.expectRevert(BatchHeaderV0Codec.ErrorIncorrectBitmapLength.selector); rollup.commitBatch(0, new bytes(90), new bytes[](1), new bytes(0)); hevm.stopPrank(); @@ -110,7 +112,7 @@ contract ScrollChainTest is DSTestPlus { mstore(add(batchHeader0, add(0x20, 25)), 2) // change data hash for batch0 } hevm.startPrank(address(0)); - hevm.expectRevert("incorrect parent batch hash"); + hevm.expectRevert(ScrollChain.ErrorIncorrectBatchHash.selector); rollup.commitBatch(0, batchHeader0, new bytes[](1), new bytes(0)); hevm.stopPrank(); assembly { @@ -124,7 +126,7 @@ contract ScrollChainTest is DSTestPlus { chunk0 = new bytes(1); chunks[0] = chunk0; hevm.startPrank(address(0)); - hevm.expectRevert("no block in chunk"); + hevm.expectRevert(ChunkCodecV0.ErrorNoBlockInChunk.selector); rollup.commitBatch(0, batchHeader0, chunks, new bytes(0)); hevm.stopPrank(); @@ -133,7 +135,7 @@ contract ScrollChainTest is DSTestPlus { chunk0[0] = bytes1(uint8(1)); // one block in this chunk chunks[0] = chunk0; hevm.startPrank(address(0)); - hevm.expectRevert("invalid chunk length"); + hevm.expectRevert(ChunkCodecV0.ErrorIncorrectChunkLength.selector); rollup.commitBatch(0, batchHeader0, chunks, new bytes(0)); hevm.stopPrank(); @@ -146,7 +148,7 @@ contract ScrollChainTest is DSTestPlus { bitmap[31] = bytes1(uint8(1)); chunks[0] = chunk0; hevm.startPrank(address(0)); - hevm.expectRevert("cannot skip last L1 message"); + hevm.expectRevert(ScrollChain.ErrorLastL1MessageSkipped.selector); rollup.commitBatch(0, batchHeader0, chunks, bitmap); hevm.stopPrank(); @@ -159,7 +161,7 @@ contract ScrollChainTest is DSTestPlus { bitmap[31] = bytes1(uint8(3)); chunks[0] = chunk0; hevm.startPrank(address(0)); - hevm.expectRevert("num txs less than num L1 msgs"); + hevm.expectRevert(ScrollChain.ErrorNumTxsLessThanNumL1Msgs.selector); rollup.commitBatch(0, batchHeader0, chunks, bitmap); hevm.stopPrank(); @@ -168,7 +170,7 @@ contract ScrollChainTest is DSTestPlus { chunk0[0] = bytes1(uint8(1)); // one block in this chunk chunks[0] = chunk0; hevm.startPrank(address(0)); - hevm.expectRevert("incomplete l2 transaction data"); + hevm.expectRevert(ScrollChain.ErrorIncompleteL2TransactionData.selector); rollup.commitBatch(0, batchHeader0, chunks, new bytes(0)); hevm.stopPrank(); @@ -183,14 +185,14 @@ contract ScrollChainTest is DSTestPlus { // batch is already committed, revert hevm.startPrank(address(0)); - hevm.expectRevert("batch already committed"); + hevm.expectRevert(ScrollChain.ErrorBatchIsAlreadyCommitted.selector); rollup.commitBatch(0, batchHeader0, chunks, new bytes(0)); hevm.stopPrank(); } - function testFinalizeBatchWithProof() public { + function testFinalizeBatchWithProofV0() external { // caller not prover, revert - hevm.expectRevert("caller not prover"); + hevm.expectRevert(ScrollChain.ErrorCallerIsNotProver.selector); rollup.finalizeBatchWithProof(new bytes(0), bytes32(0), bytes32(0), bytes32(0), new bytes(0)); rollup.addProver(address(0)); @@ -228,16 +230,16 @@ contract ScrollChainTest is DSTestPlus { } // incorrect batch hash, revert - batchHeader1[0] = bytes1(uint8(1)); // change version to 1 + batchHeader1[1] = bytes1(uint8(1)); // change random byte hevm.startPrank(address(0)); - hevm.expectRevert("incorrect batch hash"); + hevm.expectRevert(ScrollChain.ErrorIncorrectBatchHash.selector); rollup.finalizeBatchWithProof(batchHeader1, bytes32(uint256(1)), bytes32(uint256(2)), bytes32(0), new bytes(0)); hevm.stopPrank(); - batchHeader1[0] = bytes1(uint8(0)); // change back + batchHeader1[1] = bytes1(uint8(0)); // change back // batch header length too small, revert hevm.startPrank(address(0)); - hevm.expectRevert("batch header length too small"); + hevm.expectRevert(BatchHeaderV0Codec.ErrorBatchHeaderLengthTooSmall.selector); rollup.finalizeBatchWithProof( new bytes(88), bytes32(uint256(1)), @@ -249,7 +251,7 @@ contract ScrollChainTest is DSTestPlus { // wrong bitmap length, revert hevm.startPrank(address(0)); - hevm.expectRevert("wrong bitmap length"); + hevm.expectRevert(BatchHeaderV0Codec.ErrorIncorrectBitmapLength.selector); rollup.finalizeBatchWithProof( new bytes(90), bytes32(uint256(1)), @@ -261,7 +263,7 @@ contract ScrollChainTest is DSTestPlus { // incorrect previous state root, revert hevm.startPrank(address(0)); - hevm.expectRevert("incorrect previous state root"); + hevm.expectRevert(ScrollChain.ErrorIncorrectPreviousStateRoot.selector); rollup.finalizeBatchWithProof(batchHeader1, bytes32(uint256(2)), bytes32(uint256(2)), bytes32(0), new bytes(0)); hevm.stopPrank(); @@ -283,7 +285,7 @@ contract ScrollChainTest is DSTestPlus { // batch already verified, revert hevm.startPrank(address(0)); - hevm.expectRevert("batch already verified"); + hevm.expectRevert(ScrollChain.ErrorBatchIsAlreadyVerified.selector); rollup.finalizeBatchWithProof( batchHeader1, bytes32(uint256(1)), @@ -294,7 +296,7 @@ contract ScrollChainTest is DSTestPlus { hevm.stopPrank(); } - function testCommitAndFinalizeWithL1Messages() public { + function testCommitAndFinalizeWithL1MessagesV0() external { rollup.addSequencer(address(0)); rollup.addProver(address(0)); @@ -486,12 +488,12 @@ contract ScrollChainTest is DSTestPlus { // too many txs in one chunk, revert rollup.updateMaxNumTxInChunk(2); // 3 - 1 hevm.startPrank(address(0)); - hevm.expectRevert("too many txs in one chunk"); + hevm.expectRevert(ScrollChain.ErrorTooManyTxsInOneChunk.selector); rollup.commitBatch(0, batchHeader1, chunks, bitmap); // first chunk with too many txs hevm.stopPrank(); rollup.updateMaxNumTxInChunk(185); // 5+10+300 - 2 - 127 hevm.startPrank(address(0)); - hevm.expectRevert("too many txs in one chunk"); + hevm.expectRevert(ScrollChain.ErrorTooManyTxsInOneChunk.selector); rollup.commitBatch(0, batchHeader1, chunks, bitmap); // second chunk with too many txs hevm.stopPrank(); @@ -544,7 +546,7 @@ contract ScrollChainTest is DSTestPlus { } } - function testRevertBatch() public { + function testRevertBatch() external { // caller not owner, revert hevm.startPrank(address(1)); hevm.expectRevert("Ownable: caller is not the owner"); @@ -589,21 +591,21 @@ contract ScrollChainTest is DSTestPlus { hevm.stopPrank(); // count must be nonzero, revert - hevm.expectRevert("count must be nonzero"); + hevm.expectRevert(ScrollChain.ErrorRevertZeroBatches.selector); rollup.revertBatch(batchHeader0, 0); // incorrect batch hash, revert - hevm.expectRevert("incorrect batch hash"); - batchHeader1[0] = bytes1(uint8(1)); // change version to 1 + hevm.expectRevert(ScrollChain.ErrorIncorrectBatchHash.selector); + batchHeader1[1] = bytes1(uint8(1)); // change random byte rollup.revertBatch(batchHeader1, 1); - batchHeader1[0] = bytes1(uint8(0)); // change back + batchHeader1[1] = bytes1(uint8(0)); // change back // revert middle batch, revert - hevm.expectRevert("reverting must start from the ending"); + hevm.expectRevert(ScrollChain.ErrorRevertNotStartFromEnd.selector); rollup.revertBatch(batchHeader1, 1); // can only revert unfinalized batch, revert - hevm.expectRevert("can only revert unfinalized batch"); + hevm.expectRevert(ScrollChain.ErrorRevertFinalizedBatch.selector); rollup.revertBatch(batchHeader0, 3); // succeed to revert next two pending batches. @@ -620,7 +622,7 @@ contract ScrollChainTest is DSTestPlus { assertEq(uint256(rollup.committedBatches(2)), 0); } - function testAddAndRemoveSequencer(address _sequencer) public { + function testAddAndRemoveSequencer(address _sequencer) external { // set by non-owner, should revert hevm.startPrank(address(1)); hevm.expectRevert("Ownable: caller is not the owner"); @@ -629,7 +631,7 @@ contract ScrollChainTest is DSTestPlus { rollup.removeSequencer(_sequencer); hevm.stopPrank(); - hevm.expectRevert("not EOA"); + hevm.expectRevert(ScrollChain.ErrorAccountIsNotEOA.selector); rollup.addSequencer(address(this)); hevm.assume(_sequencer.code.length == 0); @@ -647,7 +649,7 @@ contract ScrollChainTest is DSTestPlus { assertBoolEq(rollup.isSequencer(_sequencer), false); } - function testAddAndRemoveProver(address _prover) public { + function testAddAndRemoveProver(address _prover) external { // set by non-owner, should revert hevm.startPrank(address(1)); hevm.expectRevert("Ownable: caller is not the owner"); @@ -656,7 +658,7 @@ contract ScrollChainTest is DSTestPlus { rollup.removeProver(_prover); hevm.stopPrank(); - hevm.expectRevert("not EOA"); + hevm.expectRevert(ScrollChain.ErrorAccountIsNotEOA.selector); rollup.addProver(address(this)); hevm.assume(_prover.code.length == 0); @@ -700,7 +702,7 @@ contract ScrollChainTest is DSTestPlus { assertBoolEq(false, rollup.paused()); } - function testUpdateMaxNumTxInChunk(uint256 _maxNumTxInChunk) public { + function testUpdateMaxNumTxInChunk(uint256 _maxNumTxInChunk) external { // set by non-owner, should revert hevm.startPrank(address(1)); hevm.expectRevert("Ownable: caller is not the owner"); @@ -716,57 +718,57 @@ contract ScrollChainTest is DSTestPlus { assertEq(rollup.maxNumTxInChunk(), _maxNumTxInChunk); } - function testImportGenesisBlock() public { + function testImportGenesisBlock() external { bytes memory batchHeader; // zero state root, revert batchHeader = new bytes(89); - hevm.expectRevert("zero state root"); + hevm.expectRevert(ScrollChain.ErrorStateRootIsZero.selector); rollup.importGenesisBatch(batchHeader, bytes32(0)); // batch header length too small, revert batchHeader = new bytes(88); - hevm.expectRevert("batch header length too small"); + hevm.expectRevert(BatchHeaderV0Codec.ErrorBatchHeaderLengthTooSmall.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); // wrong bitmap length, revert batchHeader = new bytes(90); - hevm.expectRevert("wrong bitmap length"); + hevm.expectRevert(BatchHeaderV0Codec.ErrorIncorrectBitmapLength.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); // not all fields are zero, revert - batchHeader = new bytes(89); + batchHeader = new bytes(121); batchHeader[0] = bytes1(uint8(1)); // version not zero - hevm.expectRevert("not all fields are zero"); + hevm.expectRevert(ScrollChain.ErrorGenesisBatchHasNonZeroField.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); batchHeader = new bytes(89); batchHeader[1] = bytes1(uint8(1)); // batchIndex not zero - hevm.expectRevert("not all fields are zero"); + hevm.expectRevert(ScrollChain.ErrorGenesisBatchHasNonZeroField.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); batchHeader = new bytes(89 + 32); assembly { mstore(add(batchHeader, add(0x20, 9)), shl(192, 1)) // l1MessagePopped not zero } - hevm.expectRevert("not all fields are zero"); + hevm.expectRevert(ScrollChain.ErrorGenesisBatchHasNonZeroField.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); batchHeader = new bytes(89); batchHeader[17] = bytes1(uint8(1)); // totalL1MessagePopped not zero - hevm.expectRevert("not all fields are zero"); + hevm.expectRevert(ScrollChain.ErrorGenesisBatchHasNonZeroField.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); // zero data hash, revert batchHeader = new bytes(89); - hevm.expectRevert("zero data hash"); + hevm.expectRevert(ScrollChain.ErrorGenesisDataHashIsZero.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); // nonzero parent batch hash, revert batchHeader = new bytes(89); batchHeader[25] = bytes1(uint8(1)); // dataHash not zero batchHeader[57] = bytes1(uint8(1)); // parentBatchHash not zero - hevm.expectRevert("nonzero parent batch hash"); + hevm.expectRevert(ScrollChain.ErrorGenesisParentBatchHashIsNonZero.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); // import correctly @@ -781,7 +783,7 @@ contract ScrollChainTest is DSTestPlus { assertGt(uint256(rollup.committedBatches(0)), 0); // Genesis batch imported, revert - hevm.expectRevert("Genesis batch imported"); + hevm.expectRevert(ScrollChain.ErrorGenesisBatchImported.selector); rollup.importGenesisBatch(batchHeader, bytes32(uint256(1))); } diff --git a/contracts/src/test/ScrollStandardERC20Factory.t.sol b/contracts/src/test/ScrollStandardERC20Factory.t.sol index 2c1d4ea6cc..9059f45f2d 100644 --- a/contracts/src/test/ScrollStandardERC20Factory.t.sol +++ b/contracts/src/test/ScrollStandardERC20Factory.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; import {WETH} from "solmate/tokens/WETH.sol"; diff --git a/contracts/src/test/ScrollTestBase.t.sol b/contracts/src/test/ScrollTestBase.t.sol index 41d40a536f..19a66f39d8 100644 --- a/contracts/src/test/ScrollTestBase.t.sol +++ b/contracts/src/test/ScrollTestBase.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/TokenRateLimiter.t.sol b/contracts/src/test/TokenRateLimiter.t.sol index 29127ce457..5eb44b14c8 100644 --- a/contracts/src/test/TokenRateLimiter.t.sol +++ b/contracts/src/test/TokenRateLimiter.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/Whitelist.t.sol b/contracts/src/test/Whitelist.t.sol index c82dd56545..5c4a4a3e71 100644 --- a/contracts/src/test/Whitelist.t.sol +++ b/contracts/src/test/Whitelist.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; import {WETH} from "solmate/tokens/WETH.sol"; diff --git a/contracts/src/test/WithdrawTrieVerifier.t.sol b/contracts/src/test/WithdrawTrieVerifier.t.sol index 7a677c9b48..ddef16df2b 100644 --- a/contracts/src/test/WithdrawTrieVerifier.t.sol +++ b/contracts/src/test/WithdrawTrieVerifier.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/integration/GatewayIntegrationBase.t.sol b/contracts/src/test/integration/GatewayIntegrationBase.t.sol index 6ef694952b..41fa99f763 100644 --- a/contracts/src/test/integration/GatewayIntegrationBase.t.sol +++ b/contracts/src/test/integration/GatewayIntegrationBase.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {Test} from "forge-std/Test.sol"; import {Vm} from "forge-std/Vm.sol"; diff --git a/contracts/src/test/integration/LidoGatewayIntegration.t.sol b/contracts/src/test/integration/LidoGatewayIntegration.t.sol index 1db8db7941..7710f2874f 100644 --- a/contracts/src/test/integration/LidoGatewayIntegration.t.sol +++ b/contracts/src/test/integration/LidoGatewayIntegration.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/lido/L1LidoGateway.t.sol b/contracts/src/test/lido/L1LidoGateway.t.sol index 541d96e106..533ba0f1d4 100644 --- a/contracts/src/test/lido/L1LidoGateway.t.sol +++ b/contracts/src/test/lido/L1LidoGateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/lido/L2LidoGateway.t.sol b/contracts/src/test/lido/L2LidoGateway.t.sol index d3127a84ed..c69c246c6c 100644 --- a/contracts/src/test/lido/L2LidoGateway.t.sol +++ b/contracts/src/test/lido/L2LidoGateway.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/lido/L2WstETHToken.t.sol b/contracts/src/test/lido/L2WstETHToken.t.sol index 612d42ee03..0fa302f86f 100644 --- a/contracts/src/test/lido/L2WstETHToken.t.sol +++ b/contracts/src/test/lido/L2WstETHToken.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol"; diff --git a/contracts/src/test/mocks/MockERC1155Recipient.sol b/contracts/src/test/mocks/MockERC1155Recipient.sol index c161dfd2bc..489b0ebe57 100644 --- a/contracts/src/test/mocks/MockERC1155Recipient.sol +++ b/contracts/src/test/mocks/MockERC1155Recipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ERC1155TokenReceiver} from "solmate/tokens/ERC1155.sol"; diff --git a/contracts/src/test/mocks/MockERC721Recipient.sol b/contracts/src/test/mocks/MockERC721Recipient.sol index f8dcc14bc0..2b56527cc1 100644 --- a/contracts/src/test/mocks/MockERC721Recipient.sol +++ b/contracts/src/test/mocks/MockERC721Recipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ERC721TokenReceiver} from "solmate/tokens/ERC721.sol"; diff --git a/contracts/src/test/mocks/MockGatewayRecipient.sol b/contracts/src/test/mocks/MockGatewayRecipient.sol index 13d213f2ab..53b4a560d2 100644 --- a/contracts/src/test/mocks/MockGatewayRecipient.sol +++ b/contracts/src/test/mocks/MockGatewayRecipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IScrollGatewayCallback} from "../../libraries/callbacks/IScrollGatewayCallback.sol"; diff --git a/contracts/src/test/mocks/MockL1LidoGateway.sol b/contracts/src/test/mocks/MockL1LidoGateway.sol index cb1d30f7dc..76a21346b7 100644 --- a/contracts/src/test/mocks/MockL1LidoGateway.sol +++ b/contracts/src/test/mocks/MockL1LidoGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {L1LidoGateway} from "../../lido/L1LidoGateway.sol"; diff --git a/contracts/src/test/mocks/MockL2LidoGateway.sol b/contracts/src/test/mocks/MockL2LidoGateway.sol index 0b2fdd4c93..77a696a5dd 100644 --- a/contracts/src/test/mocks/MockL2LidoGateway.sol +++ b/contracts/src/test/mocks/MockL2LidoGateway.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {L2LidoGateway} from "../../lido/L2LidoGateway.sol"; diff --git a/contracts/src/test/mocks/MockRollupVerifier.sol b/contracts/src/test/mocks/MockRollupVerifier.sol index 1b601a47ac..783b7ce8dc 100644 --- a/contracts/src/test/mocks/MockRollupVerifier.sol +++ b/contracts/src/test/mocks/MockRollupVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IRollupVerifier} from "../../libraries/verifier/IRollupVerifier.sol"; @@ -11,4 +11,12 @@ contract MockRollupVerifier is IRollupVerifier { bytes calldata, bytes32 ) external view {} + + /// @inheritdoc IRollupVerifier + function verifyAggregateProof( + uint256, + uint256, + bytes calldata, + bytes32 + ) external view {} } diff --git a/contracts/src/test/mocks/MockScrollChain.sol b/contracts/src/test/mocks/MockScrollChain.sol index e79d11c16f..da6efa6276 100644 --- a/contracts/src/test/mocks/MockScrollChain.sol +++ b/contracts/src/test/mocks/MockScrollChain.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {ScrollChain} from "../../L1/rollup/ScrollChain.sol"; diff --git a/contracts/src/test/mocks/MockScrollMessenger.sol b/contracts/src/test/mocks/MockScrollMessenger.sol index d9107ee7d2..bd558eaa28 100644 --- a/contracts/src/test/mocks/MockScrollMessenger.sol +++ b/contracts/src/test/mocks/MockScrollMessenger.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IScrollMessenger} from "../../libraries/IScrollMessenger.sol"; diff --git a/contracts/src/test/mocks/MockZkEvmVerifier.sol b/contracts/src/test/mocks/MockZkEvmVerifier.sol index 84f3b4ae10..33cbd2aaaf 100644 --- a/contracts/src/test/mocks/MockZkEvmVerifier.sol +++ b/contracts/src/test/mocks/MockZkEvmVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {IZkEvmVerifier} from "../../libraries/verifier/IZkEvmVerifier.sol"; diff --git a/contracts/src/test/mocks/tokens/FeeOnTransferToken.sol b/contracts/src/test/mocks/tokens/FeeOnTransferToken.sol index 1e063c3898..1e0db22bad 100644 --- a/contracts/src/test/mocks/tokens/FeeOnTransferToken.sol +++ b/contracts/src/test/mocks/tokens/FeeOnTransferToken.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/src/test/mocks/tokens/TransferReentrantToken.sol b/contracts/src/test/mocks/tokens/TransferReentrantToken.sol index 0b3a5e9a6e..9001dda54d 100644 --- a/contracts/src/test/mocks/tokens/TransferReentrantToken.sol +++ b/contracts/src/test/mocks/tokens/TransferReentrantToken.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.16; +pragma solidity =0.8.24; import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/contracts/tsconfig.json b/contracts/tsconfig.json index 5130a78e22..d77c214cdb 100644 --- a/contracts/tsconfig.json +++ b/contracts/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2018", + "target": "es2020", "module": "commonjs", "strict": true, "esModuleInterop": true, diff --git a/contracts/yarn.lock b/contracts/yarn.lock index bd6521578e..8373cc0b30 100644 --- a/contracts/yarn.lock +++ b/contracts/yarn.lock @@ -2,12 +2,15 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + +"@adraffy/ens-normalize@1.10.1": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" + integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== "@babel/code-frame@^7.0.0": version "7.16.7" @@ -21,7 +24,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== -"@babel/highlight@^7.10.4", "@babel/highlight@^7.16.7": +"@babel/highlight@^7.16.7": version "7.17.9" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.17.9.tgz#61b2ee7f32ea0454612def4fccdae0de232b73e3" integrity sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg== @@ -58,21 +61,38 @@ resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.0", "@eslint-community/regexpp@^4.6.1": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" + integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== + +"@eslint/eslintrc@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" + integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" + debug "^4.3.2" + espree "^9.6.0" + globals "^13.19.0" + ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" + js-yaml "^4.1.0" + minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@8.57.0": + version "8.57.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" + integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== + "@ethereum-waffle/chai@^3.4.4": version "3.4.4" resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.4.4.tgz#16c4cc877df31b035d6d92486dfdf983df9138ff" @@ -126,74 +146,19 @@ patch-package "^6.2.2" postinstall-postinstall "^2.1.0" -"@ethereumjs/block@^3.5.0", "@ethereumjs/block@^3.6.0", "@ethereumjs/block@^3.6.2": - version "3.6.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.6.2.tgz#63d1e26d0b7a7a3684fce920de6ebabec1e5b674" - integrity sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw== - dependencies: - "@ethereumjs/common" "^2.6.3" - "@ethereumjs/tx" "^3.5.1" - ethereumjs-util "^7.1.4" - merkle-patricia-tree "^4.2.4" - -"@ethereumjs/blockchain@^5.5.0", "@ethereumjs/blockchain@^5.5.2": - version "5.5.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz#1848abd9dc1ee56acf8cec4c84304d7f4667d027" - integrity sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig== - dependencies: - "@ethereumjs/block" "^3.6.2" - "@ethereumjs/common" "^2.6.3" - "@ethereumjs/ethash" "^1.1.0" - debug "^4.3.3" - ethereumjs-util "^7.1.4" - level-mem "^5.0.1" - lru-cache "^5.1.1" - semaphore-async-await "^1.5.1" - -"@ethereumjs/common@^2.3.0", "@ethereumjs/common@^2.4.0", "@ethereumjs/common@^2.6.0", "@ethereumjs/common@^2.6.3", "@ethereumjs/common@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.4.tgz#1b3cdd3aa4ee3b0ca366756fc35e4a03022a01cc" - integrity sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.4" +"@ethereumjs/rlp@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" + integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== -"@ethereumjs/ethash@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.1.0.tgz#7c5918ffcaa9cb9c1dc7d12f77ef038c11fb83fb" - integrity sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA== +"@ethereumjs/util@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.1.0.tgz#299df97fb6b034e0577ce9f94c7d9d1004409ed4" + integrity sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA== dependencies: - "@ethereumjs/block" "^3.5.0" - "@types/levelup" "^4.3.0" - buffer-xor "^2.0.1" - ethereumjs-util "^7.1.1" - miller-rabin "^4.0.0" - -"@ethereumjs/tx@^3.2.1", "@ethereumjs/tx@^3.4.0", "@ethereumjs/tx@^3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.1.tgz#8d941b83a602b4a89949c879615f7ea9a90e6671" - integrity sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA== - dependencies: - "@ethereumjs/common" "^2.6.3" - ethereumjs-util "^7.1.4" - -"@ethereumjs/vm@^5.6.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.9.0.tgz#54e485097c6dbb42554d541ef8d84d06b7ddf12f" - integrity sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg== - dependencies: - "@ethereumjs/block" "^3.6.2" - "@ethereumjs/blockchain" "^5.5.2" - "@ethereumjs/common" "^2.6.4" - "@ethereumjs/tx" "^3.5.1" - async-eventemitter "^0.2.4" - core-js-pure "^3.0.1" - debug "^4.3.3" - ethereumjs-util "^7.1.4" - functional-red-black-tree "^1.0.1" - mcl-wasm "^0.7.1" - merkle-patricia-tree "^4.2.4" - rustbn.js "~0.2.0" + "@ethereumjs/rlp" "^4.0.1" + ethereum-cryptography "^2.0.0" + micro-ftch "^0.3.1" "@ethersproject/abi@5.0.0-beta.153": version "5.0.0-beta.153" @@ -210,21 +175,6 @@ "@ethersproject/properties" ">=5.0.0-beta.131" "@ethersproject/strings" ">=5.0.0-beta.130" -"@ethersproject/abi@5.0.7": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.7.tgz#79e52452bd3ca2956d0e1c964207a58ad1a0ee7b" - integrity sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw== - dependencies: - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - "@ethersproject/abi@5.6.1", "@ethersproject/abi@^5.0.0-beta.146", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.6.0": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.1.tgz#f7de888edeb56b0a657b672bdd1b3a1135cd14f7" @@ -240,6 +190,21 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" +"@ethersproject/abi@^5.0.9": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/abstract-provider@5.6.0", "@ethersproject/abstract-provider@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz#0c4ac7054650dbd9c476cf5907f588bbb6ef3061" @@ -253,6 +218,19 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/web" "^5.6.0" +"@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + "@ethersproject/abstract-signer@5.6.0", "@ethersproject/abstract-signer@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz#9cd7ae9211c2b123a3b29bf47aab17d4d016e3e7" @@ -264,7 +242,18 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/address@5.6.0", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.6.0": +"@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.6.0", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.0.tgz#13c49836d73e7885fc148ad633afad729da25012" integrity sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ== @@ -275,6 +264,17 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/rlp" "^5.6.0" +"@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/base64@5.6.0", "@ethersproject/base64@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.0.tgz#a12c4da2a6fb86d88563216b0282308fc15907c9" @@ -282,6 +282,13 @@ dependencies: "@ethersproject/bytes" "^5.6.0" +"@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/basex@5.6.0", "@ethersproject/basex@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.0.tgz#9ea7209bf0a1c3ddc2a90f180c3a7f0d7d2e8a69" @@ -290,7 +297,7 @@ "@ethersproject/bytes" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/bignumber@5.6.0", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.6.0": +"@ethersproject/bignumber@5.6.0", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.0.tgz#116c81b075c57fa765a8f3822648cf718a8a0e26" integrity sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA== @@ -299,20 +306,43 @@ "@ethersproject/logger" "^5.6.0" bn.js "^4.11.9" -"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.6.0": +"@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.6.0": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/constants@5.6.0", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.6.0": +"@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@5.6.0", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.0.tgz#55e3eb0918584d3acc0688e9958b0cedef297088" integrity sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA== dependencies: "@ethersproject/bignumber" "^5.6.0" +"@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/contracts@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.0.tgz#60f2cfc7addd99a865c6c8cfbbcec76297386067" @@ -329,7 +359,7 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/transactions" "^5.6.0" -"@ethersproject/hash@5.6.0", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.6.0": +"@ethersproject/hash@5.6.0", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.0.tgz#d24446a5263e02492f9808baa99b6e2b4c3429a2" integrity sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA== @@ -343,6 +373,21 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" +"@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/hdnode@5.6.0", "@ethersproject/hdnode@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.0.tgz#9dcbe8d629bbbcf144f2cae476337fe92d320998" @@ -380,7 +425,7 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.6.0": +"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.0.tgz#fea4bb47dbf8f131c2e1774a1cecbfeb9d606459" integrity sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w== @@ -388,11 +433,24 @@ "@ethersproject/bytes" "^5.6.0" js-sha3 "0.8.0" -"@ethersproject/logger@5.6.0", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.6.0": +"@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.6.0", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== +"@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + "@ethersproject/networks@5.6.2", "@ethersproject/networks@^5.6.0": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.2.tgz#2bacda62102c0b1fcee408315f2bed4f6fbdf336" @@ -400,6 +458,13 @@ dependencies: "@ethersproject/logger" "^5.6.0" +"@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2@5.6.0", "@ethersproject/pbkdf2@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz#04fcc2d7c6bff88393f5b4237d906a192426685a" @@ -408,13 +473,20 @@ "@ethersproject/bytes" "^5.6.0" "@ethersproject/sha2" "^5.6.0" -"@ethersproject/properties@5.6.0", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.6.0": +"@ethersproject/properties@5.6.0", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== dependencies: "@ethersproject/logger" "^5.6.0" +"@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + "@ethersproject/providers@5.6.4": version "5.6.4" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.4.tgz#1a49c211b57b0b2703c320819abbbfa35c83dff7" @@ -456,6 +528,14 @@ "@ethersproject/bytes" "^5.6.0" "@ethersproject/logger" "^5.6.0" +"@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2@5.6.0", "@ethersproject/sha2@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.0.tgz#364c4c11cc753bda36f31f001628706ebadb64d9" @@ -477,6 +557,18 @@ elliptic "6.5.4" hash.js "1.1.7" +"@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + "@ethersproject/solidity@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.6.0.tgz#64657362a596bf7f5630bdc921c07dd78df06dc3" @@ -489,7 +581,7 @@ "@ethersproject/sha2" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/strings@5.6.0", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.6.0": +"@ethersproject/strings@5.6.0", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.0.tgz#9891b26709153d996bf1303d39a7f4bc047878fd" integrity sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg== @@ -498,6 +590,15 @@ "@ethersproject/constants" "^5.6.0" "@ethersproject/logger" "^5.6.0" +"@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/transactions@5.6.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.0.tgz#4b594d73a868ef6e1529a2f8f94a785e6791ae4e" @@ -513,6 +614,21 @@ "@ethersproject/rlp" "^5.6.0" "@ethersproject/signing-key" "^5.6.0" +"@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/units@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.6.0.tgz#e5cbb1906988f5740254a21b9ded6bd51e826d9c" @@ -554,6 +670,17 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" +"@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/wordlists@5.6.0", "@ethersproject/wordlists@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.6.0.tgz#79e62c5276e091d8575f6930ba01a29218ded032" @@ -565,19 +692,29 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== +"@fastify/busboy@^2.0.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + +"@humanwhocodes/config-array@^0.11.14": + version "0.11.14" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" + integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== dependencies: - "@humanwhocodes/object-schema" "^1.2.0" - debug "^4.1.1" - minimatch "^3.0.4" + "@humanwhocodes/object-schema" "^2.0.2" + debug "^4.3.1" + minimatch "^3.0.5" -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" + integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== "@iden3/bigarray@0.0.2": version "0.0.2" @@ -595,11 +732,35 @@ tweetnacl "^1.0.3" tweetnacl-util "^0.15.1" +"@noble/curves@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/curves@1.3.0", "@noble/curves@~1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.3.0.tgz#01be46da4fd195822dab821e72f71bf4aeec635e" + integrity sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA== + dependencies: + "@noble/hashes" "1.3.3" + "@noble/hashes@1.0.0", "@noble/hashes@~1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae" integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg== +"@noble/hashes@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + +"@noble/hashes@1.3.3", "@noble/hashes@~1.3.2": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" + integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== + "@noble/secp256k1@1.5.5", "@noble/secp256k1@~1.5.2": version "1.5.5" resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.5.5.tgz#315ab5745509d1a8c8e90d0bdf59823ccf9bcfc3" @@ -618,7 +779,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -626,31 +787,194 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomiclabs/hardhat-ethers@^2.0.0": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.5.tgz#131b0da1b71680d5a01569f916ae878229d326d3" - integrity sha512-A2gZAGB6kUvLx+kzM92HKuUF33F1FSe90L0TmkXkT2Hh0OKRpvWZURUSU2nghD2yC4DzfEZ3DftfeHGvZ2JTUw== +"@nomicfoundation/edr-darwin-arm64@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.1.tgz#386cbb7dd8ba70659d76d6ce5e8b06242fac6c8c" + integrity sha512-qsdGS1Kfp6bVH4fk4hUzbsEm0fH7hGurraKk+IWby7Ecv+u7BuNaLVqeoYauYRFLYnGg8XZmcKOJ9BW35Y96Jg== -"@nomiclabs/hardhat-etherscan@^3.0.0": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.0.3.tgz#ca54a03351f3de41f9f5240e37bea9d64fa24e64" - integrity sha512-OfNtUKc/ZwzivmZnnpwWREfaYncXteKHskn3yDnz+fPBZ6wfM4GR+d5RwjREzYFWE+o5iR9ruXhWw/8fejWM9g== +"@nomicfoundation/edr-darwin-x64@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.1.tgz#809ebd68127fb7b4219c5ddc8ef65b38bc88312b" + integrity sha512-vtS2yuXIgjte42KEg/Aw/xmLRneVrIaDFhFMk578zg3m1UjNP+a29Lirw5fRXaqaL8aPyhRFmUy+1/V4MGaH+g== + +"@nomicfoundation/edr-linux-arm64-gnu@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.1.tgz#897bf524e88d6a07a2b39c5a9c5d94eaeee6ec20" + integrity sha512-GrbQcrVjTFLm/x8HdUzmJ1F8Juau9UEZM/YNr4sAxxTGvBHJlq73VaDZfArxj9Anq/u6aImPbs1ksu28D6XC3A== + +"@nomicfoundation/edr-linux-arm64-musl@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.1.tgz#726d57edee1adcd4844aaf31ec80063f1c44616b" + integrity sha512-wOqugcbugmbZkh58PcIC5naT0ilwkZ0/qH86AniENxsviOaPSrL4aMYhtfypQ3MNxlfrlgLZFCC+D5eJTsNsgQ== + +"@nomicfoundation/edr-linux-x64-gnu@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.1.tgz#d45ca451a30d429ed4ea97982879bf65842385f8" + integrity sha512-V+kyUVqbt52dQRgaZK+EWuPWJ5h/PsCYZmiK18A+DQynZvird7jrTsDppcTvlv1Dvny8UAAP0q/ue7G67OoLJQ== + +"@nomicfoundation/edr-linux-x64-musl@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.1.tgz#ee1d01135654124c0f22ae0c3e7d62388a41e595" + integrity sha512-vwrzLW40jQBDZVYmoJUBMwl36i7muB9AfT4F2fMRsb1JoOMgoeOBp8R+IAxbA6mjIJGwAClkRz5W5hCb3zMtMQ== + +"@nomicfoundation/edr-win32-arm64-msvc@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-arm64-msvc/-/edr-win32-arm64-msvc-0.3.1.tgz#e89c6e2c7a4458a6fd1de3ef3f57f915b771579e" + integrity sha512-7G29vUGrkwfbJqxo1V+QTxD976gVHx3Z0P5kwb1bErLmlP89cRNX3UN3/dzXpbKH9mp8ZcAjIcIbRUd4C+vH/A== + +"@nomicfoundation/edr-win32-ia32-msvc@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-ia32-msvc/-/edr-win32-ia32-msvc-0.3.1.tgz#8f05be496c18eff37e3a95628ed8265a03824df0" + integrity sha512-Q39eAkk/j1ZlvHcxQRTAzdY9qlckDNfiuJDgLYTlxdubpmX6KZucuUin/1A5NVhhCToTxw7aFwSglUROY3ejJw== + +"@nomicfoundation/edr-win32-x64-msvc@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.1.tgz#942c2b1490194d70d67c38b702a56e5603db19c7" + integrity sha512-8WzEzWUshw28xowVBhEyu4EQpx0TqNmDa70C3L1MWl5waym4U/VwbijFrI0Sb6Y1kdoNCdBTMvfr8OJNF2qJ/A== + +"@nomicfoundation/edr@^0.3.0": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.1.tgz#2a7d4de8d70f63f872f9e86a8487f946cc3d2dcc" + integrity sha512-uPg1/CvIJpsCe7Ipe80bYnC/Q2Bt/O55KB2ssLx7Z0os4jwDvWBZas8tLMopT+hpOQnv8cZkHJap1iNDTwAfQg== + optionalDependencies: + "@nomicfoundation/edr-darwin-arm64" "0.3.1" + "@nomicfoundation/edr-darwin-x64" "0.3.1" + "@nomicfoundation/edr-linux-arm64-gnu" "0.3.1" + "@nomicfoundation/edr-linux-arm64-musl" "0.3.1" + "@nomicfoundation/edr-linux-x64-gnu" "0.3.1" + "@nomicfoundation/edr-linux-x64-musl" "0.3.1" + "@nomicfoundation/edr-win32-arm64-msvc" "0.3.1" + "@nomicfoundation/edr-win32-ia32-msvc" "0.3.1" + "@nomicfoundation/edr-win32-x64-msvc" "0.3.1" + +"@nomicfoundation/ethereumjs-common@4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz#9901f513af2d4802da87c66d6f255b510bef5acb" + integrity sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg== + dependencies: + "@nomicfoundation/ethereumjs-util" "9.0.4" + +"@nomicfoundation/ethereumjs-rlp@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" + integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== + +"@nomicfoundation/ethereumjs-tx@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" + integrity sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@9.0.4": + version "9.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz#84c5274e82018b154244c877b76bc049a4ed7b38" + integrity sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/hardhat-chai-matchers@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz#ef88be3bd666adf29c06ac7882e96c8dbaaa32ba" + integrity sha512-Te1Uyo9oJcTCF0Jy9dztaLpshmlpjLf2yPtWXlXuLjMt3RRSmJLm/+rKVTW6gfadAEs12U/it6D0ZRnnRGiICQ== + dependencies: + "@types/chai-as-promised" "^7.1.3" + chai-as-promised "^7.1.1" + deep-eql "^4.0.1" + ordinal "^1.0.3" + +"@nomicfoundation/hardhat-ethers@^3.0.5": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.5.tgz#0422c2123dec7c42e7fb2be8e1691f1d9708db56" + integrity sha512-RNFe8OtbZK6Ila9kIlHp0+S80/0Bu/3p41HUpaRIoHLm6X3WekTd83vob3rE54Duufu1edCiBDxspBzi2rxHHw== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + +"@nomicfoundation/hardhat-verify@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.5.tgz#dcc2cb5e5c55a39704c7d492436f80f05a4ca5a3" + integrity sha512-Tg4zu8RkWpyADSFIgF4FlJIUEI4VkxcvELsmbJn2OokbvH2SnUrqKmw0BBfDrtvP0hhmx8wsnrRKP5DV/oTyTA== dependencies: "@ethersproject/abi" "^5.1.2" "@ethersproject/address" "^5.0.2" - cbor "^5.0.2" + cbor "^8.1.0" + chalk "^2.4.2" debug "^4.1.1" - fs-extra "^7.0.1" + lodash.clonedeep "^4.5.0" semver "^6.3.0" - undici "^4.14.1" + table "^6.8.0" + undici "^5.14.0" -"@nomiclabs/hardhat-waffle@^2.0.0": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.3.tgz#9c538a09c5ed89f68f5fd2dc3f78f16ed1d6e0b1" - integrity sha512-049PHSnI1CZq6+XTbrMbMv5NaL7cednTfPenx02k3cEh8wBMLa6ys++dBETJa6JjfwgA9nBhhHQ173LJv6k2Pg== - dependencies: - "@types/sinon-chai" "^3.2.3" - "@types/web3" "1.0.19" +"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" + integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== + +"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" + integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== + +"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" + integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== + +"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" + integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== + +"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" + integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== + +"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" + integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== + +"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" + integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== + +"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" + integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== + +"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" + integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== + +"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" + integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== + +"@nomicfoundation/solidity-analyzer@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" + integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== + optionalDependencies: + "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" + "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" "@openzeppelin/contracts-upgradeable@^v4.9.3": version "4.9.3" @@ -711,6 +1035,11 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.0.0.tgz#109fb595021de285f05a7db6806f2f48296fcee7" integrity sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA== +"@scure/base@~1.1.4": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" + integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== + "@scure/bip32@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.0.1.tgz#1409bdf9f07f0aec99006bb0d5827693418d3aa5" @@ -720,6 +1049,15 @@ "@noble/secp256k1" "~1.5.2" "@scure/base" "~1.0.0" +"@scure/bip32@1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.3.tgz#a9624991dc8767087c57999a5d79488f48eae6c8" + integrity sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ== + dependencies: + "@noble/curves" "~1.3.0" + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.4" + "@scure/bip39@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.0.0.tgz#47504e58de9a56a4bbed95159d2d6829fa491bb0" @@ -728,6 +1066,14 @@ "@noble/hashes" "~1.0.0" "@scure/base" "~1.0.0" +"@scure/bip39@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.2.tgz#f3426813f4ced11a47489cbcf7294aa963966527" + integrity sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA== + dependencies: + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.4" + "@sentry/core@5.30.0": version "5.30.0" resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" @@ -808,6 +1154,11 @@ dependencies: antlr4ts "^0.5.0-alpha.4" +"@solidity-parser/parser@^0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.18.0.tgz#8e77a02a09ecce957255a2f48c9a7178ec191908" + integrity sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA== + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -815,29 +1166,6 @@ dependencies: defer-to-connect "^1.0.1" -"@truffle/error@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@truffle/error/-/error-0.1.0.tgz#5e9fed79e6cda624c926d314b280a576f8b22a36" - integrity sha512-RbUfp5VreNhsa2Q4YbBjz18rOQI909pG32bghl1hulO7IpvcqTS+C3Ge5cNbiWQ1WGzy1wIeKLW0tmQtHFB7qg== - -"@truffle/interface-adapter@^0.5.14": - version "0.5.14" - resolved "https://registry.yarnpkg.com/@truffle/interface-adapter/-/interface-adapter-0.5.14.tgz#ca4ffebdd6b7720f08c197280083ea82cb5d4374" - integrity sha512-bUM2W5cNgDlxBLEiE3Rg47A0cqL4fNw7a2DgjtxMxCayZLXUA5gf1orLjcYq54a0kOLGh7B7sfgfP3TQINlylw== - dependencies: - bn.js "^5.1.3" - ethers "^4.0.32" - web3 "1.5.3" - -"@truffle/provider@^0.2.24": - version "0.2.52" - resolved "https://registry.yarnpkg.com/@truffle/provider/-/provider-0.2.52.tgz#5aee3bdec2ffd38bbfcb03fcf45246fdd935714c" - integrity sha512-3V0w+2EEMaXLKKrRjT0NN2vy8Yd9DfcenFeFPx4b4VWYmeuG8asSBBe9Gj4VF8mpgf6Iky0LevF5NFwf2hHwsg== - dependencies: - "@truffle/error" "^0.1.0" - "@truffle/interface-adapter" "^0.5.14" - web3 "1.5.3" - "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" @@ -865,41 +1193,48 @@ dependencies: ethers "^5.0.2" -"@typechain/ethers-v5@^7.0.1": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-7.2.0.tgz#d559cffe0efe6bdbc20e644b817f6fa8add5e8f8" - integrity sha512-jfcmlTvaaJjng63QsT49MT6R1HFhtO/TBMWbyzPFSzMmVIqb2tL6prnKBs4ZJrSvmgIXWy+ttSjpaxCTq8D/Tw== +"@typechain/ethers-v6@^0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz#42fe214a19a8b687086c93189b301e2b878797ea" + integrity sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA== dependencies: lodash "^4.17.15" ts-essentials "^7.0.1" -"@typechain/hardhat@^2.3.0": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-2.3.1.tgz#1e8a6e3795e115a5d5348526282b5c597fab0b78" - integrity sha512-BQV8OKQi0KAzLXCdsPO0pZBNQQ6ra8A2ucC26uFX/kquRBtJu1yEyWnVSmtr07b5hyRoJRpzUeINLnyqz4/MAw== +"@typechain/hardhat@^9.1.0": + version "9.1.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-9.1.0.tgz#6985015f01dfb37ef2ca8a29c742d05890351ddc" + integrity sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA== dependencies: fs-extra "^9.1.0" -"@types/abstract-leveldown@*": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz#f055979a99f7654e84d6b8e6267419e9c4cfff87" - integrity sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ== +"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" -"@types/bn.js@*", "@types/bn.js@^5.1.0": +"@types/bn.js@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== dependencies: "@types/node" "*" -"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== +"@types/chai-as-promised@^7.1.3": + version "7.1.8" + resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz#f2b3d82d53c59626b5d6bbc087667ccb4b677fe9" + integrity sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw== dependencies: - "@types/node" "*" + "@types/chai" "*" + +"@types/chai@*": + version "4.3.12" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.12.tgz#b192fe1c553b54f45d20543adc2ab88455a07d5e" + integrity sha512-zNKDHG/1yxm8Il6uCCVsm+dRdEsJlFoDu73X17y09bId6UwoYww+vFBsAcRzl8knM1sab3Dp1VRikFQwDOtDDw== -"@types/chai@*", "@types/chai@^4.2.21": +"@types/chai@^4.2.21": version "4.3.1" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.1.tgz#e2c6e73e0bdeb2521d00756d099218e9f5d90a04" integrity sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ== @@ -934,30 +1269,16 @@ "@types/minimatch" "*" "@types/node" "*" -"@types/json-schema@^7.0.7": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== +"@types/json-schema@^7.0.12": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/level-errors@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/level-errors/-/level-errors-3.0.0.tgz#15c1f4915a5ef763b51651b15e90f6dc081b96a8" - integrity sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ== - -"@types/levelup@^4.3.0": - version "4.3.3" - resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.3.tgz#4dc2b77db079b1cf855562ad52321aa4241b8ef4" - integrity sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA== - dependencies: - "@types/abstract-leveldown" "*" - "@types/level-errors" "*" - "@types/node" "*" - "@types/lru-cache@^5.1.0": version "5.1.1" resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" @@ -993,16 +1314,28 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.24.tgz#20ba1bf69c1b4ab405c7a01e950c4f446b05029f" integrity sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g== +"@types/node@18.15.13": + version "18.15.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== + "@types/node@^10.0.3": version "10.17.60" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== -"@types/node@^12.0.0", "@types/node@^12.12.6": +"@types/node@^12.12.6": version "12.20.48" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.48.tgz#55f70bd432b6515828c0298689776861b90ca4fa" integrity sha512-4kxzqkrpwYtn6okJUcb2lfUu9ilnb3yhUOH6qX3nug8D2DupZ2drIkff2yJzYcNJVl3begnlcaBJ7tqiTTzjnQ== +"@types/node@^20.11.27": + version "20.11.27" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.27.tgz#debe5cfc8a507dd60fe2a3b4875b1604f215c2ac" + integrity sha512-qyUZfMnCg1KEz57r7pzFtSGt49f6RPkPBis3Vo4PbS7roQEDn22hiHzl/Lo1q4i4hDEgBJmBF/NTNg2XR0HbFg== + dependencies: + undici-types "~5.26.4" + "@types/node@^8.0.0": version "8.10.66" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.66.tgz#dd035d409df322acc83dff62a602f12a5783bbb3" @@ -1039,119 +1372,112 @@ dependencies: "@types/node" "*" +"@types/semver@^7.5.0": + version "7.5.8" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" + integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== + "@types/set-value@*": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-4.0.1.tgz#7caf185556a67c2d9051080931853047423c93bd" integrity sha512-mP/CLy6pdrhsDVrz1+Yp5Ly6Tcel2IAEejhyI5NxY6WnBUdWN+AAfGa0HHsdgCdsPWWcd/4D5J2X2TrRYcYRag== -"@types/sinon-chai@^3.2.3": - version "3.2.8" - resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.8.tgz#5871d09ab50d671d8e6dd72e9073f8e738ac61dc" - integrity sha512-d4ImIQbT/rKMG8+AXpmcan5T2/PNeSjrYhvkwet6z0p8kzYtfgA32xzOBlbU0yqJfq+/0Ml805iFoODO0LP5/g== - dependencies: - "@types/chai" "*" - "@types/sinon" "*" - -"@types/sinon@*": - version "10.0.11" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.11.tgz#8245827b05d3fc57a6601bd35aee1f7ad330fc42" - integrity sha512-dmZsHlBsKUtBpHriNjlK0ndlvEh8dcb9uV9Afsbt89QIyydpC7NcR+nWlAhASfy3GHnxTl4FX/aKE7XZUt/B4g== - dependencies: - "@types/sinonjs__fake-timers" "*" - -"@types/sinonjs__fake-timers@*": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz#bf2e02a3dbd4aecaf95942ecd99b7402e03fad5e" - integrity sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA== - -"@types/underscore@*": - version "1.11.4" - resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.11.4.tgz#62e393f8bc4bd8a06154d110c7d042a93751def3" - integrity sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg== +"@typescript-eslint/eslint-plugin@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz#5a5fcad1a7baed85c10080d71ad901f98c38d5b7" + integrity sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw== + dependencies: + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "7.2.0" + "@typescript-eslint/type-utils" "7.2.0" + "@typescript-eslint/utils" "7.2.0" + "@typescript-eslint/visitor-keys" "7.2.0" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" -"@types/web3@1.0.19": - version "1.0.19" - resolved "https://registry.yarnpkg.com/@types/web3/-/web3-1.0.19.tgz#46b85d91d398ded9ab7c85a5dd57cb33ac558924" - integrity sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A== +"@typescript-eslint/parser@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.2.0.tgz#44356312aea8852a3a82deebdacd52ba614ec07a" + integrity sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg== dependencies: - "@types/bn.js" "*" - "@types/underscore" "*" + "@typescript-eslint/scope-manager" "7.2.0" + "@typescript-eslint/types" "7.2.0" + "@typescript-eslint/typescript-estree" "7.2.0" + "@typescript-eslint/visitor-keys" "7.2.0" + debug "^4.3.4" -"@typescript-eslint/eslint-plugin@^4.29.1": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" - integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== +"@typescript-eslint/scope-manager@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz#cfb437b09a84f95a0930a76b066e89e35d94e3da" + integrity sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg== dependencies: - "@typescript-eslint/experimental-utils" "4.33.0" - "@typescript-eslint/scope-manager" "4.33.0" - debug "^4.3.1" - functional-red-black-tree "^1.0.1" - ignore "^5.1.8" - regexpp "^3.1.0" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/experimental-utils@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== - dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/parser@^4.29.1": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" - integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== - dependencies: - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - debug "^4.3.1" + "@typescript-eslint/types" "7.2.0" + "@typescript-eslint/visitor-keys" "7.2.0" -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== +"@typescript-eslint/type-utils@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz#7be5c30e9b4d49971b79095a1181324ef6089a19" + integrity sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA== dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" + "@typescript-eslint/typescript-estree" "7.2.0" + "@typescript-eslint/utils" "7.2.0" + debug "^4.3.4" + ts-api-utils "^1.0.1" -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== +"@typescript-eslint/types@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.2.0.tgz#0feb685f16de320e8520f13cca30779c8b7c403f" + integrity sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA== -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== +"@typescript-eslint/typescript-estree@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz#5beda2876c4137f8440c5a84b4f0370828682556" + integrity sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA== dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" + "@typescript-eslint/types" "7.2.0" + "@typescript-eslint/visitor-keys" "7.2.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "9.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== +"@typescript-eslint/utils@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.2.0.tgz#fc8164be2f2a7068debb4556881acddbf0b7ce2a" + integrity sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "7.2.0" + "@typescript-eslint/types" "7.2.0" + "@typescript-eslint/typescript-estree" "7.2.0" + semver "^7.5.4" + +"@typescript-eslint/visitor-keys@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz#5035f177752538a5750cca1af6044b633610bf9e" + integrity sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A== dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" + "@typescript-eslint/types" "7.2.0" + eslint-visitor-keys "^3.4.1" "@ungap/promise-all-settled@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== +"@ungap/structured-clone@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" + integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + "@yarnpkg/lockfile@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" @@ -1167,13 +1493,6 @@ abbrev@1.0.x: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - abstract-leveldown@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" @@ -1195,17 +1514,6 @@ abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: dependencies: xtend "~4.0.0" -abstract-leveldown@^6.2.1: - version "6.3.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" - integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - abstract-leveldown@~2.6.0: version "2.6.3" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" @@ -1213,17 +1521,6 @@ abstract-leveldown@~2.6.0: dependencies: xtend "~4.0.0" -abstract-leveldown@~6.2.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" - integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" @@ -1232,7 +1529,7 @@ accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" -acorn-jsx@^5.0.0, acorn-jsx@^5.3.1: +acorn-jsx@^5.0.0, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -1247,20 +1544,15 @@ acorn@^6.0.7: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - acorn@^8.4.1: version "8.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== -address@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" - integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== +acorn@^8.9.0: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== adm-zip@^0.4.16: version "0.4.16" @@ -1272,6 +1564,11 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= +aes-js@4.0.0-beta.5: + version "4.0.0-beta.5" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== + aes-js@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" @@ -1292,7 +1589,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.6.1, ajv@^6.9.1: +ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.6.1, ajv@^6.9.1: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1317,6 +1614,13 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= +ansi-align@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== + dependencies: + string-width "^4.1.0" + ansi-colors@3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" @@ -1452,6 +1756,16 @@ array-back@^2.0.0: dependencies: typical "^2.6.1" +array-back@^3.0.1, array-back@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^4.0.1, array-back@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" + integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -1545,7 +1859,7 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-eventemitter@^0.2.2, async-eventemitter@^0.2.4: +async-eventemitter@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== @@ -1596,11 +1910,6 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -available-typed-arrays@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" - integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== - aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -2189,7 +2498,7 @@ big-integer@^1.6.42, big-integer@^1.6.48: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== -bignumber.js@^9.0.0, bignumber.js@^9.0.1: +bignumber.js@^9.0.0: version "9.0.2" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== @@ -2262,11 +2571,16 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^ resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.1.3, bn.js@^5.2.0: +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + body-parser@1.19.2: version "1.19.2" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.2.tgz#4714ccd9c157d44797b8b5607d72c0b89952f26e" @@ -2301,6 +2615,20 @@ body-parser@^1.16.0: type-is "~1.6.18" unpipe "1.0.0" +boxen@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -2464,6 +2792,18 @@ bufferutil@^4.0.1: dependencies: node-gyp-build "^4.3.0" +builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== + +builtins@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9" + integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ== + dependencies: + semver "^7.0.0" + bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -2562,7 +2902,7 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.0.0: +camelcase@^6.0.0, camelcase@^6.2.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -2577,13 +2917,19 @@ caseless@^0.12.0, caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -cbor@^5.0.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-5.2.0.tgz#4cca67783ccd6de7b50ab4ed62636712f287a67c" - integrity sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A== +cbor@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" + integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== dependencies: - bignumber.js "^9.0.1" - nofilter "^1.0.4" + nofilter "^3.1.0" + +chai-as-promised@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" + integrity sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA== + dependencies: + check-error "^1.0.2" chai@^4.2.0: version "4.3.6" @@ -2801,6 +3147,11 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -2962,6 +3313,26 @@ command-line-args@^4.0.7: find-replace "^1.0.3" typical "^2.6.1" +command-line-args@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" + integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== + dependencies: + array-back "^3.1.0" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@^6.1.0: + version "6.1.3" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.3.tgz#428fa5acde6a838779dfa30e44686f4b6761d957" + integrity sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw== + dependencies: + array-back "^4.0.2" + chalk "^2.4.2" + table-layout "^1.0.2" + typical "^5.2.0" + commander@2.18.0: version "2.18.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" @@ -3083,11 +3454,6 @@ cosmiconfig@^5.0.7: js-yaml "^3.13.1" parse-json "^4.0.0" -crc-32@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" - integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== - create-ecdh@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" @@ -3194,7 +3560,7 @@ death@^1.1.0: resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" integrity sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg= -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -3208,7 +3574,7 @@ debug@3.2.6: dependencies: ms "^2.1.1" -debug@4, debug@^4.0.1, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.0.1, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3222,13 +3588,6 @@ debug@4.3.1: dependencies: ms "2.1.2" -debug@4.3.3: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - debug@^3.1.0, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -3265,6 +3624,13 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" +deep-eql@^4.0.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + deep-equal@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" @@ -3277,6 +3643,11 @@ deep-equal@~1.1.1: object-keys "^1.1.1" regexp.prototype.flags "^1.2.0" +deep-extend@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" @@ -3302,14 +3673,6 @@ deferred-leveldown@~4.0.0: abstract-leveldown "~5.0.0" inherits "^2.0.3" -deferred-leveldown@~5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" - integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== - dependencies: - abstract-leveldown "~6.2.1" - inherits "^2.0.3" - define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" @@ -3385,14 +3748,6 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -detect-port@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/detect-port/-/detect-port-1.3.0.tgz#d9c40e9accadd4df5cac6a782aefd014d573d1f1" - integrity sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ== - dependencies: - address "^1.0.1" - debug "^2.6.0" - diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -3417,6 +3772,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +difflib@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/difflib/-/difflib-0.2.4.tgz#b5e30361a6db023176d562892db85940a718f47e" + integrity sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w== + dependencies: + heap ">= 0.2.0" + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -3550,16 +3912,6 @@ encoding-down@5.0.4, encoding-down@~5.0.0: level-errors "^2.0.0" xtend "^4.0.1" -encoding-down@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" - integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== - dependencies: - abstract-leveldown "^6.2.1" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" - encoding@^0.1.11: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -3574,7 +3926,7 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.0, enquirer@^2.3.5: +enquirer@^2.3.0: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -3600,7 +3952,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.5, es-abstract@^1.19.1, es-abstract@^1.19.2: +es-abstract@^1.19.1, es-abstract@^1.19.2: version "1.19.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.5.tgz#a2cb01eb87f724e815b278b0dd0d00f36ca9a7f1" integrity sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA== @@ -3700,15 +4052,20 @@ escodegen@1.8.x: optionalDependencies: source-map "~0.2.0" +eslint-compat-utils@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz#f45e3b5ced4c746c127cf724fb074cd4e730d653" + integrity sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg== + eslint-config-prettier@^8.3.0: version "8.5.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== -eslint-config-standard@^16.0.3: - version "16.0.3" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz#6c8761e544e96c531ff92642eeb87842b8488516" - integrity sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg== +eslint-config-standard@^17.1.0: + version "17.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz#40ffb8595d47a6b242e07cbfd49dc211ed128975" + integrity sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q== eslint-import-resolver-node@^0.3.6: version "0.3.6" @@ -3726,6 +4083,15 @@ eslint-module-utils@^2.7.3: debug "^3.2.7" find-up "^2.1.0" +eslint-plugin-es-x@^7.5.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz#d08d9cd155383e35156c48f736eb06561d07ba92" + integrity sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ== + dependencies: + "@eslint-community/eslint-utils" "^4.1.2" + "@eslint-community/regexpp" "^4.6.0" + eslint-compat-utils "^0.1.2" + eslint-plugin-es@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" @@ -3753,6 +4119,23 @@ eslint-plugin-import@^2.23.4: resolve "^1.22.0" tsconfig-paths "^3.14.1" +eslint-plugin-n@^16.6.2: + version "16.6.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-16.6.2.tgz#6a60a1a376870064c906742272074d5d0b412b0b" + integrity sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + builtins "^5.0.1" + eslint-plugin-es-x "^7.5.0" + get-tsconfig "^4.7.0" + globals "^13.24.0" + ignore "^5.2.4" + is-builtin-module "^3.2.1" + is-core-module "^2.12.1" + minimatch "^3.1.2" + resolve "^1.22.2" + semver "^7.5.3" + eslint-plugin-node@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" @@ -3772,10 +4155,10 @@ eslint-plugin-prettier@^3.4.0: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-promise@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-5.2.0.tgz#a596acc32981627eb36d9d75f9666ac1a4564971" - integrity sha512-SftLb1pUG01QYq2A/hGAWfDRXqYD82zE7j7TopDOyNdU+7SvvoXREls/+PRTY17vUXzXnZA/zfnyKgRH6x4JJw== +eslint-plugin-promise@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz#269a3e2772f62875661220631bd4dafcb4083816" + integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig== eslint-scope@^4.0.3: version "4.0.3" @@ -3785,13 +4168,13 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: esrecurse "^4.3.0" - estraverse "^4.1.1" + estraverse "^5.2.0" eslint-utils@^1.3.1: version "1.4.3" @@ -3800,29 +4183,22 @@ eslint-utils@^1.3.1: dependencies: eslint-visitor-keys "^1.1.0" -eslint-utils@^2.0.0, eslint-utils@^2.1.0: +eslint-utils@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^5.6.0: version "5.16.0" @@ -3866,51 +4242,49 @@ eslint@^5.6.0: table "^5.2.3" text-table "^0.2.0" -eslint@^7.29.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" - ajv "^6.10.0" +eslint@^8.57.0: + version "8.57.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" + integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.4" + "@eslint/js" "8.57.0" + "@humanwhocodes/config-array" "^0.11.14" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + "@ungap/structured-clone" "^1.2.0" + ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" + optionator "^0.9.3" + strip-ansi "^6.0.1" text-table "^0.2.0" - v8-compile-cache "^2.0.3" espree@^5.0.1: version "5.0.1" @@ -3921,14 +4295,14 @@ espree@^5.0.1: acorn-jsx "^5.0.0" eslint-visitor-keys "^1.0.0" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" esprima@2.7.x, esprima@^2.7.1: version "2.7.3" @@ -3940,13 +4314,20 @@ esprima@^4.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.1, esquery@^1.4.0: +esquery@^1.0.1: version "1.4.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== dependencies: estraverse "^5.1.0" +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + dependencies: + estraverse "^5.1.0" + esrecurse@^4.1.0, esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" @@ -4142,7 +4523,7 @@ ethereum-common@^0.0.18: resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= -ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: +ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== @@ -4173,6 +4554,16 @@ ethereum-cryptography@^1.0.3: "@scure/bip32" "1.0.1" "@scure/bip39" "1.0.0" +ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz#1352270ed3b339fe25af5ceeadcf1b9c8e30768a" + integrity sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA== + dependencies: + "@noble/curves" "1.3.0" + "@noble/hashes" "1.3.3" + "@scure/bip32" "1.3.3" + "@scure/bip39" "1.2.2" + ethereum-waffle@^3.0.0: version "3.4.4" resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.4.4.tgz#1378b72040697857b7f5e8f473ca8f97a37b5840" @@ -4326,7 +4717,7 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereum rlp "^2.0.0" safe-buffer "^5.1.1" -ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.2, ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.3, ethereumjs-util@^7.1.4: +ethereumjs-util@^7.0.2, ethereumjs-util@^7.1.0: version "7.1.4" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz#a6885bcdd92045b06f596c7626c3e89ab3312458" integrity sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A== @@ -4390,7 +4781,7 @@ ethereumjs-wallet@0.6.5: utf8 "^3.0.0" uuid "^3.3.2" -ethers@^4.0.32, ethers@^4.0.40: +ethers@^4.0.40: version "4.0.49" resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== @@ -4405,7 +4796,7 @@ ethers@^4.0.32, ethers@^4.0.40: uuid "2.0.1" xmlhttprequest "1.8.0" -ethers@^5.0.0, ethers@^5.0.1, ethers@^5.0.2, ethers@^5.5.2: +ethers@^5.0.1, ethers@^5.0.2, ethers@^5.5.2: version "5.6.4" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.4.tgz#23629e9a7d4bc5802dfb53d4da420d738744b53c" integrity sha512-62UIfxAQXdf67TeeOaoOoPctm5hUlYgfd0iW3wxfj7qRYKDcvvy0f+sJ3W2/Pyx77R8dblvejA8jokj+lS+ATQ== @@ -4441,6 +4832,19 @@ ethers@^5.0.0, ethers@^5.0.1, ethers@^5.0.2, ethers@^5.5.2: "@ethersproject/web" "5.6.0" "@ethersproject/wordlists" "5.6.0" +ethers@^6.11.1: + version "6.11.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.11.1.tgz#96aae00b627c2e35f9b0a4d65c7ab658259ee6af" + integrity sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.5.0" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -4457,11 +4861,6 @@ ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - eventemitter3@4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" @@ -4786,6 +5185,13 @@ find-replace@^1.0.3: array-back "^1.0.4" test-value "^2.1.0" +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + find-up@3.0.0, find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -4793,7 +5199,7 @@ find-up@3.0.0, find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@5.0.0: +find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== @@ -4910,11 +5316,6 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -5054,6 +5455,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -5162,6 +5568,13 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +get-tsconfig@^4.7.0: + version "4.7.3" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.3.tgz#0498163d98f7b58484dd4906999c0c9d5f103f83" + integrity sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg== + dependencies: + resolve-pkg-maps "^1.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -5189,6 +5602,13 @@ glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob@7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" @@ -5213,7 +5633,19 @@ glob@7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.2.0, glob@^7.0.0, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glob@~7.2.0: +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@7.2.0, glob@^7.0.0, glob@^7.1.2, glob@^7.1.3, glob@~7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -5225,6 +5657,17 @@ glob@7.2.0, glob@^7.0.0, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glob@~7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" @@ -5265,10 +5708,10 @@ globals@^11.7.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.6.0, globals@^13.9.0: - version "13.13.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.13.0.tgz#ac32261060d8070e2719dd6998406e27d2b5727b" - integrity sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A== +globals@^13.19.0, globals@^13.24.0: + version "13.24.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" + integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== dependencies: type-fest "^0.20.2" @@ -5291,7 +5734,7 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.3: +globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -5345,6 +5788,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" @@ -5384,57 +5832,52 @@ hardhat-gas-reporter@^1.0.4: eth-gas-reporter "^0.2.24" sha1 "^1.1.1" -hardhat@^2.9.3: - version "2.9.3" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.9.3.tgz#4759dc3c468c7d15f34334ca1be7d59b04e47b1e" - integrity sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg== +hardhat@^2.22.0: + version "2.22.0" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.0.tgz#ccb03fbacc2a3c5902a70e0e4df4acd92ee533f0" + integrity sha512-t1J+ThxNYANL6ub6yM5XC84RY38vhfG7ODBtVRNQFQozdALo3qZUjxDzyGQU0U0eswe6orK49hq9UpdB7nPXNQ== dependencies: - "@ethereumjs/block" "^3.6.0" - "@ethereumjs/blockchain" "^5.5.0" - "@ethereumjs/common" "^2.6.0" - "@ethereumjs/tx" "^3.4.0" - "@ethereumjs/vm" "^5.6.0" "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/edr" "^0.3.0" + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-tx" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + "@nomicfoundation/solidity-analyzer" "^0.1.0" "@sentry/node" "^5.18.1" - "@solidity-parser/parser" "^0.14.1" "@types/bn.js" "^5.1.0" "@types/lru-cache" "^5.1.0" - abort-controller "^3.0.0" adm-zip "^0.4.16" aggregate-error "^3.0.0" ansi-escapes "^4.3.0" + boxen "^5.1.2" chalk "^2.4.2" chokidar "^3.4.0" ci-info "^2.0.0" debug "^4.1.1" enquirer "^2.3.0" env-paths "^2.2.0" - ethereum-cryptography "^0.1.2" + ethereum-cryptography "^1.0.3" ethereumjs-abi "^0.6.8" - ethereumjs-util "^7.1.3" find-up "^2.1.0" fp-ts "1.19.3" fs-extra "^7.0.1" - glob "^7.1.3" + glob "7.2.0" immutable "^4.0.0-rc.12" io-ts "1.10.4" + keccak "^3.0.2" lodash "^4.17.11" - merkle-patricia-tree "^4.2.2" mnemonist "^0.38.0" - mocha "^9.2.0" + mocha "^10.0.0" p-map "^4.0.0" - qs "^6.7.0" raw-body "^2.4.1" resolve "1.17.0" semver "^6.3.0" - slash "^3.0.0" solc "0.7.3" source-map-support "^0.5.13" stacktrace-parser "^0.1.10" - "true-case-path" "^2.2.1" tsort "0.0.1" - undici "^4.14.1" + undici "^5.14.0" uuid "^8.3.2" ws "^7.4.6" @@ -5559,6 +6002,13 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hasown@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + he@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -5569,6 +6019,11 @@ heap@0.2.6: resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw= +"heap@>= 0.2.0": + version "0.2.7" + resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.7.tgz#1e6adf711d3f27ce35a81fe3b7bd576c2260a8fc" + integrity sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg== + hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -5698,11 +6153,16 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.1, ignore@^5.1.8, ignore@^5.2.0: +ignore@^5.1.1, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== +ignore@^5.2.4: + version "5.3.1" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" + integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== + immediate@^3.2.3: version "3.3.0" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" @@ -5878,6 +6338,13 @@ is-buffer@~2.0.3: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== +is-builtin-module@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" + integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== + dependencies: + builtin-modules "^3.3.0" + is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" @@ -5890,6 +6357,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.12.1, is-core-module@^2.13.0: + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== + dependencies: + hasown "^2.0.0" + is-core-module@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" @@ -6000,13 +6474,6 @@ is-function@^1.0.1: resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== -is-generator-function@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== - dependencies: - has-tostringtag "^1.0.0" - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -6048,6 +6515,11 @@ is-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -6114,17 +6586,6 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typed-array@^1.1.3, is-typed-array@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.8.tgz#cbaa6585dc7db43318bc5b89523ea384a6f65e79" - integrity sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -6262,7 +6723,7 @@ js-yaml@4.0.0: dependencies: argparse "^2.0.1" -js-yaml@4.1.0: +js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -6422,6 +6883,15 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" +keccak@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -6486,11 +6956,6 @@ level-codec@~7.0.0: resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== -level-concat-iterator@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" - integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== - level-errors@^1.0.3: version "1.1.2" resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" @@ -6540,15 +7005,6 @@ level-iterator-stream@~3.0.0: readable-stream "^2.3.6" xtend "^4.0.0" -level-iterator-stream@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" - integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== - dependencies: - inherits "^2.0.4" - readable-stream "^3.4.0" - xtend "^4.0.2" - level-mem@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-3.0.1.tgz#7ce8cf256eac40f716eb6489654726247f5a89e5" @@ -6557,22 +7013,6 @@ level-mem@^3.0.1: level-packager "~4.0.0" memdown "~3.0.0" -level-mem@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-5.0.1.tgz#c345126b74f5b8aa376dc77d36813a177ef8251d" - integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== - dependencies: - level-packager "^5.0.3" - memdown "^5.0.0" - -level-packager@^5.0.3: - version "5.1.1" - resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" - integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== - dependencies: - encoding-down "^6.3.0" - levelup "^4.3.2" - level-packager@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-4.0.1.tgz#7e7d3016af005be0869bc5fa8de93d2a7f56ffe6" @@ -6604,13 +7044,6 @@ level-sublevel@6.6.4: typewiselite "~1.0.0" xtend "~4.0.0" -level-supports@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" - integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== - dependencies: - xtend "^4.0.2" - level-ws@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" @@ -6628,15 +7061,6 @@ level-ws@^1.0.0: readable-stream "^2.2.8" xtend "^4.0.1" -level-ws@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-2.0.0.tgz#207a07bcd0164a0ec5d62c304b4615c54436d339" - integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== - dependencies: - inherits "^2.0.3" - readable-stream "^3.1.0" - xtend "^4.0.1" - levelup@3.1.1, levelup@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.1.1.tgz#c2c0b3be2b4dc316647c53b42e2f559e232d2189" @@ -6660,17 +7084,6 @@ levelup@^1.2.1: semver "~5.4.1" xtend "~4.0.0" -levelup@^4.3.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" - integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== - dependencies: - deferred-leveldown "~5.3.0" - level-errors "~2.0.0" - level-iterator-stream "~4.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -6771,6 +7184,21 @@ lodash.assign@^4.0.3, lodash.assign@^4.0.6: resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -6915,11 +7343,6 @@ markdown-table@^1.1.3: resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q== -mcl-wasm@^0.7.1: - version "0.7.9" - resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" - integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -6946,18 +7369,6 @@ memdown@^1.0.0: ltgt "~2.2.0" safe-buffer "~5.1.1" -memdown@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" - integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== - dependencies: - abstract-leveldown "~6.2.1" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.2.0" - memdown@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/memdown/-/memdown-3.0.0.tgz#93aca055d743b20efc37492e9e399784f2958309" @@ -7017,23 +7428,16 @@ merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2: rlp "^2.0.0" semaphore ">=1.0.1" -merkle-patricia-tree@^4.2.2, merkle-patricia-tree@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz#ff988d045e2bf3dfa2239f7fabe2d59618d57413" - integrity sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w== - dependencies: - "@types/levelup" "^4.3.0" - ethereumjs-util "^7.1.4" - level-mem "^5.0.1" - level-ws "^2.0.0" - readable-stream "^3.6.0" - semaphore-async-await "^1.5.1" - methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= +micro-ftch@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" + integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== + micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -7123,7 +7527,7 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -"minimatch@2 || 3", minimatch@^3.0.4, minimatch@^3.1.2: +"minimatch@2 || 3", minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -7137,12 +7541,19 @@ minimatch@3.0.4: dependencies: brace-expansion "^1.1.7" -minimatch@4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" - integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== dependencies: - brace-expansion "^1.1.7" + brace-expansion "^2.0.1" + +minimatch@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" minimatch@^5.0.1: version "5.1.6" @@ -7212,6 +7623,32 @@ mnemonist@^0.38.0: dependencies: obliterator "^2.0.0" +mocha@^10.0.0, mocha@^10.2.0: + version "10.3.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.3.0.tgz#0e185c49e6dccf582035c05fa91084a4ff6e3fe9" + integrity sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg== + dependencies: + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "8.1.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + mocha@^7.1.1: version "7.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" @@ -7273,36 +7710,6 @@ mocha@^8.2.1: yargs-parser "20.2.4" yargs-unparser "2.0.0" -mocha@^9.2.0: - version "9.2.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" - integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== - dependencies: - "@ungap/promise-all-settled" "1.1.2" - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.3" - debug "4.3.3" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.2.0" - growl "1.10.5" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "4.2.1" - ms "2.1.3" - nanoid "3.3.1" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - which "2.0.2" - workerpool "6.2.0" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" - mock-fs@^4.1.0: version "4.14.0" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" @@ -7393,11 +7800,6 @@ nanoid@3.1.20: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== -nanoid@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" - integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== - nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -7480,10 +7882,10 @@ node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" integrity sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ== -nofilter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e" - integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA== +nofilter@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-3.1.0.tgz#c757ba68801d41ff930ba2ec55bab52ca184aa66" + integrity sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g== nopt@3.x: version "3.0.6" @@ -7643,13 +8045,6 @@ oboe@2.1.4: dependencies: http-https "^1.0.0" -oboe@2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.5.tgz#5554284c543a2266d7a38f17e073821fbde393cd" - integrity sha1-VVQoTFQ6ImbXo48X4HOCH73jk80= - dependencies: - http-https "^1.0.0" - on-finished@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" @@ -7712,17 +8107,22 @@ optionator@^0.8.1, optionator@^0.8.2: type-check "~0.3.2" word-wrap "~1.2.3" -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" + +ordinal@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ordinal/-/ordinal-1.0.3.tgz#1a3c7726a61728112f50944ad7c35c06ae3a0d4d" + integrity sha512-cMddMgb2QElm8G7vdaa02jhUNbTSrhsgAGUz1OokD83uJTwSUn+nKoNoKVVaRa08yF6sgfO7Maou1+bgLd9rdQ== os-homedir@^1.0.0: version "1.0.2" @@ -8107,6 +8507,11 @@ prettier@^2.1.2, prettier@^2.3.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== +prettier@^2.3.1: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -8248,7 +8653,7 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.10.3, qs@^6.4.0, qs@^6.7.0: +qs@6.10.3, qs@^6.4.0: version "6.10.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== @@ -8378,7 +8783,7 @@ readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.2, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.6, readable-stream@^3.1.0, readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@^3.0.6, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -8432,6 +8837,11 @@ recursive-readdir@^2.2.2: dependencies: minimatch "3.0.4" +reduce-flatten@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" + integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== + regenerate@^1.2.1: version "1.4.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" @@ -8473,7 +8883,7 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== -regexpp@^3.0.0, regexpp@^3.1.0: +regexpp@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -8607,6 +9017,11 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== +resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -8624,7 +9039,7 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.8.1, resolve@~1.22.0: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.8.1, resolve@~1.22.0: version "1.22.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== @@ -8633,6 +9048,15 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.20.0, resolve@^1.22 path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.10.1, resolve@^1.22.2: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -8825,11 +9249,6 @@ seedrandom@3.0.1: resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.1.tgz#eb3dde015bcf55df05a233514e5df44ef9dce083" integrity sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg== -semaphore-async-await@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" - integrity sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo= - semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" @@ -8840,12 +9259,24 @@ semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.1.0, semver@^6.3.0: +semver@^6.1.0: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.4, semver@^7.3.5: +semver@^7.0.0, semver@^7.5.3, semver@^7.5.4: + version "7.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" + integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== + dependencies: + lru-cache "^6.0.0" + +semver@^7.3.4, semver@^7.3.5: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -9178,29 +9609,30 @@ solidity-comments-extractor@^0.0.7: resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== -solidity-coverage@^0.7.16: - version "0.7.20" - resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.7.20.tgz#246e9b0dd62f698bb8ddeecdcc46cab26c48b637" - integrity sha512-edOXTugUYdqxrtEnIn4vgrGjLPxdexcL0WD8LzAvVA3d1dwgcfRO3k8xQR02ZQnOnWMBi8Cqs0F+kAQQp3JW8g== +solidity-coverage@^0.8.11: + version "0.8.11" + resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.8.11.tgz#c95798f2c3e885c49dcfc9c43ee570d112214785" + integrity sha512-yy0Yk+olovBbXn0Me8BWULmmv7A69ZKkP5aTOJGOO8u61Tu2zS989erfjtFlUjDnfWtxRAVkd8BsQD704yLWHw== dependencies: - "@solidity-parser/parser" "^0.14.0" - "@truffle/provider" "^0.2.24" + "@ethersproject/abi" "^5.0.9" + "@solidity-parser/parser" "^0.18.0" chalk "^2.4.2" death "^1.1.0" - detect-port "^1.3.0" + difflib "^0.2.4" fs-extra "^8.1.0" ghost-testrpc "^0.0.2" global-modules "^2.0.0" globby "^10.0.1" jsonschema "^1.2.4" lodash "^4.17.15" + mocha "^10.2.0" node-emoji "^1.10.0" pify "^4.0.1" recursive-readdir "^2.2.2" sc-istanbul "^0.4.5" semver "^7.3.4" shelljs "^0.8.3" - web3-utils "^1.3.0" + web3-utils "^1.3.6" source-map-resolve@^0.5.0: version "0.5.3" @@ -9296,7 +9728,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== @@ -9364,6 +9796,11 @@ string-argv@^0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== +string-format@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" + integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -9390,7 +9827,7 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -9516,7 +9953,7 @@ strip-json-comments@2.0.1, strip-json-comments@^2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -9599,6 +10036,16 @@ sync-rpc@^1.2.1: dependencies: get-port "^3.1.0" +table-layout@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" + integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== + dependencies: + array-back "^4.0.1" + deep-extend "~0.6.0" + typical "^5.2.0" + wordwrapjs "^4.0.0" + table@^5.2.3: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" @@ -9609,10 +10056,10 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -table@^6.0.9: - version "6.8.0" - resolved "https://registry.yarnpkg.com/table/-/table-6.8.0.tgz#87e28f14fa4321c3377ba286f07b79b281a3b3ca" - integrity sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA== +table@^6.8.0: + version "6.8.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf" + integrity sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA== dependencies: ajv "^8.0.1" lodash.truncate "^4.4.2" @@ -9798,10 +10245,20 @@ trim-right@^1.0.1: resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= -"true-case-path@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-2.2.1.tgz#c5bf04a5bbec3fd118be4084461b3a27c4d796bf" - integrity sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q== +ts-api-utils@^1.0.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== + +ts-command-line-args@^2.2.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz#e64456b580d1d4f6d948824c274cf6fa5f45f7f0" + integrity sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw== + dependencies: + chalk "^4.1.0" + command-line-args "^5.1.1" + command-line-usage "^6.1.0" + string-format "^2.0.0" ts-essentials@^1.0.0: version "1.0.4" @@ -9862,28 +10319,21 @@ tsconfig-paths@^3.14.1: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tslib@^2.1.0: +tslib@2.4.0, tslib@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@^1.9.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tsort@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" integrity sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y= -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -9971,20 +10421,20 @@ typechain@^3.0.0: ts-essentials "^6.0.3" ts-generator "^0.1.1" -typechain@^5.1.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-5.2.0.tgz#10525a44773a34547eb2eed8978cb72c0a39a0f4" - integrity sha512-0INirvQ+P+MwJOeMct+WLkUE4zov06QxC96D+i3uGFEHoiSkZN70MKDQsaj8zkL86wQwByJReI2e7fOUwECFuw== +typechain@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.3.2.tgz#1090dd8d9c57b6ef2aed3640a516bdbf01b00d73" + integrity sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q== dependencies: "@types/prettier" "^2.1.1" - command-line-args "^4.0.7" - debug "^4.1.1" + debug "^4.3.1" fs-extra "^7.0.0" - glob "^7.1.6" + glob "7.1.7" js-sha3 "^0.8.0" lodash "^4.17.15" mkdirp "^1.0.4" - prettier "^2.1.2" + prettier "^2.3.1" + ts-command-line-args "^2.2.0" ts-essentials "^7.0.1" typedarray-to-buffer@^3.1.5: @@ -9999,10 +10449,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.5.2: - version "4.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" - integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== +typescript@^5.4.2: + version "5.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372" + integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ== typewise-core@^1.2, typewise-core@^1.2.0: version "1.2.0" @@ -10026,6 +10476,16 @@ typical@^2.6.0, typical@^2.6.1: resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" integrity sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0= +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" + integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== + uglify-js@^3.1.4: version "3.15.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.4.tgz#fa95c257e88f85614915b906204b9623d4fa340d" @@ -10051,10 +10511,17 @@ underscore@1.9.1: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== -undici@^4.14.1: - version "4.16.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-4.16.0.tgz#469bb87b3b918818d3d7843d91a1d08da357d5ff" - integrity sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +undici@^5.14.0: + version "5.28.3" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.3.tgz#a731e0eff2c3fcfd41c1169a869062be222d1e5b" + integrity sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA== + dependencies: + "@fastify/busboy" "^2.0.0" union-value@^1.0.0: version "1.0.1" @@ -10171,18 +10638,6 @@ util.promisify@^1.0.0: has-symbols "^1.0.1" object.getownpropertydescriptors "^2.1.1" -util@^0.12.0: - version "0.12.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" - integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - safe-buffer "^5.1.2" - which-typed-array "^1.1.2" - utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -10213,11 +10668,6 @@ v8-compile-cache-lib@^3.0.0: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -10296,15 +10746,6 @@ web3-bzz@1.2.11: swarm-js "^0.1.40" underscore "1.9.1" -web3-bzz@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.5.3.tgz#e36456905ce051138f9c3ce3623cbc73da088c2b" - integrity sha512-SlIkAqG0eS6cBS9Q2eBOTI1XFzqh83RqGJWnyrNZMDxUwsTVHL+zNnaPShVPvrWQA1Ub5b0bx1Kc5+qJVxsTJg== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - web3-core-helpers@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" @@ -10314,14 +10755,6 @@ web3-core-helpers@1.2.11: web3-eth-iban "1.2.11" web3-utils "1.2.11" -web3-core-helpers@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.5.3.tgz#099030235c477aadf39a94199ef40092151d563c" - integrity sha512-Ip1IjB3S8vN7Kf1PPjK41U5gskmMk6IJQlxIVuS8/1U7n/o0jC8krqtpRwiMfAgYyw3TXwBFtxSRTvJtnLyXZw== - dependencies: - web3-eth-iban "1.5.3" - web3-utils "1.5.3" - web3-core-method@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" @@ -10334,18 +10767,6 @@ web3-core-method@1.2.11: web3-core-subscriptions "1.2.11" web3-utils "1.2.11" -web3-core-method@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.5.3.tgz#6cff97ed19fe4ea2e9183d6f703823a079f5132c" - integrity sha512-8wJrwQ2qD9ibWieF9oHXwrJsUGrv3XAtEkNeyvyNMpktNTIjxJ2jaFGQUuLiyUrMubD18XXgLk4JS6PJU4Loeg== - dependencies: - "@ethereumjs/common" "^2.4.0" - "@ethersproject/transactions" "^5.0.0-beta.135" - web3-core-helpers "1.5.3" - web3-core-promievent "1.5.3" - web3-core-subscriptions "1.5.3" - web3-utils "1.5.3" - web3-core-promievent@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" @@ -10353,13 +10774,6 @@ web3-core-promievent@1.2.11: dependencies: eventemitter3 "4.0.4" -web3-core-promievent@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.5.3.tgz#3f11833c3dc6495577c274350b61144e0a4dba01" - integrity sha512-CFfgqvk3Vk6PIAxtLLuX+pOMozxkKCY+/GdGr7weMh033mDXEPvwyVjoSRO1PqIKj668/hMGQsVoIgbyxkJ9Mg== - dependencies: - eventemitter3 "4.0.4" - web3-core-requestmanager@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" @@ -10371,17 +10785,6 @@ web3-core-requestmanager@1.2.11: web3-providers-ipc "1.2.11" web3-providers-ws "1.2.11" -web3-core-requestmanager@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.5.3.tgz#b339525815fd40e3a2a81813c864ddc413f7b6f7" - integrity sha512-9k/Bze2rs8ONix5IZR+hYdMNQv+ark2Ek2kVcrFgWO+LdLgZui/rn8FikPunjE+ub7x7pJaKCgVRbYFXjo3ZWg== - dependencies: - util "^0.12.0" - web3-core-helpers "1.5.3" - web3-providers-http "1.5.3" - web3-providers-ipc "1.5.3" - web3-providers-ws "1.5.3" - web3-core-subscriptions@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" @@ -10391,14 +10794,6 @@ web3-core-subscriptions@1.2.11: underscore "1.9.1" web3-core-helpers "1.2.11" -web3-core-subscriptions@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.5.3.tgz#d7d69c4caad65074212028656e9dc56ca5c2159d" - integrity sha512-L2m9vG1iRN6thvmv/HQwO2YLhOQlmZU8dpLG6GSo9FBN14Uch868Swk0dYVr3rFSYjZ/GETevSXU+O+vhCummA== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.5.3" - web3-core@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.11.tgz#1043cacc1becb80638453cc5b2a14be9050288a7" @@ -10412,19 +10807,6 @@ web3-core@1.2.11: web3-core-requestmanager "1.2.11" web3-utils "1.2.11" -web3-core@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.5.3.tgz#59f8728b27c8305b349051326aa262b9b7e907bf" - integrity sha512-ACTbu8COCu+0eUNmd9pG7Q9EVsNkAg2w3Y7SqhDr+zjTgbSHZV01jXKlapm9z+G3AN/BziV3zGwudClJ4u4xXQ== - dependencies: - "@types/bn.js" "^4.11.5" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.5.3" - web3-core-method "1.5.3" - web3-core-requestmanager "1.5.3" - web3-utils "1.5.3" - web3-eth-abi@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" @@ -10434,14 +10816,6 @@ web3-eth-abi@1.2.11: underscore "1.9.1" web3-utils "1.2.11" -web3-eth-abi@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.5.3.tgz#5aea9394d797f99ca0d9bd40c3417eb07241c96c" - integrity sha512-i/qhuFsoNrnV130CSRYX/z4SlCfSQ4mHntti5yTmmQpt70xZKYZ57BsU0R29ueSQ9/P+aQrL2t2rqkQkAloUxg== - dependencies: - "@ethersproject/abi" "5.0.7" - web3-utils "1.5.3" - web3-eth-accounts@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz#a9e3044da442d31903a7ce035a86d8fa33f90520" @@ -10459,23 +10833,6 @@ web3-eth-accounts@1.2.11: web3-core-method "1.2.11" web3-utils "1.2.11" -web3-eth-accounts@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.5.3.tgz#076c816ff4d68c9dffebdc7fd2bfaddcfc163d77" - integrity sha512-pdGhXgeBaEJENMvRT6W9cmji3Zz/46ugFSvmnLLw79qi5EH7XJhKISNVb41eWCrs4am5GhI67GLx5d2s2a72iw== - dependencies: - "@ethereumjs/common" "^2.3.0" - "@ethereumjs/tx" "^3.2.1" - crypto-browserify "3.12.0" - eth-lib "0.2.8" - ethereumjs-util "^7.0.10" - scrypt-js "^3.0.1" - uuid "3.3.2" - web3-core "1.5.3" - web3-core-helpers "1.5.3" - web3-core-method "1.5.3" - web3-utils "1.5.3" - web3-eth-contract@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz#917065902bc27ce89da9a1da26e62ef663663b90" @@ -10491,20 +10848,6 @@ web3-eth-contract@1.2.11: web3-eth-abi "1.2.11" web3-utils "1.2.11" -web3-eth-contract@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.5.3.tgz#12b03a4a16ce583a945f874bea2ff2fb4c5b81ad" - integrity sha512-Gdlt1L6cdHe83k7SdV6xhqCytVtOZkjD0kY/15x441AuuJ4JLubCHuqu69k2Dr3tWifHYVys/vG8QE/W16syGg== - dependencies: - "@types/bn.js" "^4.11.5" - web3-core "1.5.3" - web3-core-helpers "1.5.3" - web3-core-method "1.5.3" - web3-core-promievent "1.5.3" - web3-core-subscriptions "1.5.3" - web3-eth-abi "1.5.3" - web3-utils "1.5.3" - web3-eth-ens@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz#26d4d7f16d6cbcfff918e39832b939edc3162532" @@ -10520,20 +10863,6 @@ web3-eth-ens@1.2.11: web3-eth-contract "1.2.11" web3-utils "1.2.11" -web3-eth-ens@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.5.3.tgz#ef6eee1ddf32b1ff9536fc7c599a74f2656bafe1" - integrity sha512-QmGFFtTGElg0E+3xfCIFhiUF+1imFi9eg/cdsRMUZU4F1+MZCC/ee+IAelYLfNTGsEslCqfAusliKOT9DdGGnw== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - web3-core "1.5.3" - web3-core-helpers "1.5.3" - web3-core-promievent "1.5.3" - web3-eth-abi "1.5.3" - web3-eth-contract "1.5.3" - web3-utils "1.5.3" - web3-eth-iban@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" @@ -10542,14 +10871,6 @@ web3-eth-iban@1.2.11: bn.js "^4.11.9" web3-utils "1.2.11" -web3-eth-iban@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.5.3.tgz#91b1475893a877b10eac1de5cce6eb379fb81b5d" - integrity sha512-vMzmGqolYZvRHwP9P4Nf6G8uYM5aTLlQu2a34vz78p0KlDC+eV1th3+90Qeaupa28EG7OO0IT1F0BejiIauOPw== - dependencies: - bn.js "^4.11.9" - web3-utils "1.5.3" - web3-eth-personal@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz#a38b3942a1d87a62070ce0622a941553c3d5aa70" @@ -10562,18 +10883,6 @@ web3-eth-personal@1.2.11: web3-net "1.2.11" web3-utils "1.2.11" -web3-eth-personal@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.5.3.tgz#4ebe09e9a77dd49d23d93b36b36cfbf4a6dae713" - integrity sha512-JzibJafR7ak/Icas8uvos3BmUNrZw1vShuNR5Cxjo+vteOC8XMqz1Vr7RH65B4bmlfb3bm9xLxetUHO894+Sew== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.5.3" - web3-core-helpers "1.5.3" - web3-core-method "1.5.3" - web3-net "1.5.3" - web3-utils "1.5.3" - web3-eth@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.11.tgz#4c81fcb6285b8caf544058fba3ae802968fdc793" @@ -10593,24 +10902,6 @@ web3-eth@1.2.11: web3-net "1.2.11" web3-utils "1.2.11" -web3-eth@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.5.3.tgz#d7d1ac7198f816ab8a2088c01e0bf1eda45862fe" - integrity sha512-saFurA1L23Bd7MEf7cBli6/jRdMhD4X/NaMiO2mdMMCXlPujoudlIJf+VWpRWJpsbDFdu7XJ2WHkmBYT5R3p1Q== - dependencies: - web3-core "1.5.3" - web3-core-helpers "1.5.3" - web3-core-method "1.5.3" - web3-core-subscriptions "1.5.3" - web3-eth-abi "1.5.3" - web3-eth-accounts "1.5.3" - web3-eth-contract "1.5.3" - web3-eth-ens "1.5.3" - web3-eth-iban "1.5.3" - web3-eth-personal "1.5.3" - web3-net "1.5.3" - web3-utils "1.5.3" - web3-net@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.11.tgz#eda68ef25e5cdb64c96c39085cdb74669aabbe1b" @@ -10620,15 +10911,6 @@ web3-net@1.2.11: web3-core-method "1.2.11" web3-utils "1.2.11" -web3-net@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.5.3.tgz#545fee49b8e213b0c55cbe74ffd0295766057463" - integrity sha512-0W/xHIPvgVXPSdLu0iZYnpcrgNnhzHMC888uMlGP5+qMCt8VuflUZHy7tYXae9Mzsg1kxaJAS5lHVNyeNw4CoQ== - dependencies: - web3-core "1.5.3" - web3-core-method "1.5.3" - web3-utils "1.5.3" - web3-provider-engine@14.2.1: version "14.2.1" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-14.2.1.tgz#ef351578797bf170e08d529cb5b02f8751329b95" @@ -10663,14 +10945,6 @@ web3-providers-http@1.2.11: web3-core-helpers "1.2.11" xhr2-cookies "1.1.0" -web3-providers-http@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.5.3.tgz#74f170fc3d79eb7941d9fbc34e2a067d61ced0b2" - integrity sha512-5DpUyWGHtDAr2RYmBu34Fu+4gJuBAuNx2POeiJIooUtJ+Mu6pIx4XkONWH6V+Ez87tZAVAsFOkJRTYuzMr3rPw== - dependencies: - web3-core-helpers "1.5.3" - xhr2-cookies "1.1.0" - web3-providers-ipc@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" @@ -10680,14 +10954,6 @@ web3-providers-ipc@1.2.11: underscore "1.9.1" web3-core-helpers "1.2.11" -web3-providers-ipc@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.5.3.tgz#4bd7f5e445c2f3c2595fce0929c72bb879320a3f" - integrity sha512-JmeAptugVpmXI39LGxUSAymx0NOFdgpuI1hGQfIhbEAcd4sv7fhfd5D+ZU4oLHbRI8IFr4qfGU0uhR8BXhDzlg== - dependencies: - oboe "2.1.5" - web3-core-helpers "1.5.3" - web3-providers-ws@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" @@ -10698,15 +10964,6 @@ web3-providers-ws@1.2.11: web3-core-helpers "1.2.11" websocket "^1.0.31" -web3-providers-ws@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.5.3.tgz#eec6cfb32bb928a4106de506f13a49070a21eabf" - integrity sha512-6DhTw4Q7nm5CFYEUHOJM0gAb3xFx+9gWpVveg3YxJ/ybR1BUvEWo3bLgIJJtX56cYX0WyY6DS35a7f0LOI1kVg== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.5.3" - websocket "^1.0.32" - web3-shh@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.11.tgz#f5d086f9621c9a47e98d438010385b5f059fd88f" @@ -10717,16 +10974,6 @@ web3-shh@1.2.11: web3-core-subscriptions "1.2.11" web3-net "1.2.11" -web3-shh@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.5.3.tgz#3c04aa4cda9ba0b746d7225262401160f8e38b13" - integrity sha512-COfEXfsqoV/BkcsNLRxQqnWc1Teb8/9GxdGag5GtPC5gQC/vsN+7hYVJUwNxY9LtJPKYTij2DHHnx6UkITng+Q== - dependencies: - web3-core "1.5.3" - web3-core-method "1.5.3" - web3-core-subscriptions "1.5.3" - web3-net "1.5.3" - web3-utils@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" @@ -10741,27 +10988,28 @@ web3-utils@1.2.11: underscore "1.9.1" utf8 "3.0.0" -web3-utils@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.5.3.tgz#e914c9320cd663b2a09a5cb920ede574043eb437" - integrity sha512-56nRgA+Ad9SEyCv39g36rTcr5fpsd4L9LgV3FK0aB66nAMazLAA6Qz4lH5XrUKPDyBIPGJIR+kJsyRtwcu2q1Q== +web3-utils@^1.0.0-beta.31, web3-utils@^1.3.0: + version "1.7.3" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.3.tgz#b214d05f124530d8694ad364509ac454d05f207c" + integrity sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg== dependencies: bn.js "^4.11.9" - eth-lib "0.2.8" ethereum-bloom-filters "^1.0.6" + ethereumjs-util "^7.1.0" ethjs-unit "0.1.6" number-to-bn "1.7.0" randombytes "^2.1.0" utf8 "3.0.0" -web3-utils@^1.0.0-beta.31, web3-utils@^1.3.0: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.3.tgz#b214d05f124530d8694ad364509ac454d05f207c" - integrity sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg== +web3-utils@^1.3.6: + version "1.10.4" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.4.tgz#0daee7d6841641655d8b3726baf33b08eda1cbec" + integrity sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A== dependencies: - bn.js "^4.11.9" + "@ethereumjs/util" "^8.1.0" + bn.js "^5.2.1" ethereum-bloom-filters "^1.0.6" - ethereumjs-util "^7.1.0" + ethereum-cryptography "^2.1.2" ethjs-unit "0.1.6" number-to-bn "1.7.0" randombytes "^2.1.0" @@ -10780,19 +11028,6 @@ web3@1.2.11: web3-shh "1.2.11" web3-utils "1.2.11" -web3@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.5.3.tgz#11882679453c645bf33620fbc255a243343075aa" - integrity sha512-eyBg/1K44flfv0hPjXfKvNwcUfIVDI4NX48qHQe6wd7C8nPSdbWqo9vLy6ksZIt9NLa90HjI8HsGYgnMSUxn6w== - dependencies: - web3-bzz "1.5.3" - web3-core "1.5.3" - web3-eth "1.5.3" - web3-eth-personal "1.5.3" - web3-net "1.5.3" - web3-shh "1.5.3" - web3-utils "1.5.3" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -10810,7 +11045,7 @@ websocket@1.0.32: utf-8-validate "^5.0.2" yaeti "^0.0.6" -websocket@^1.0.31, websocket@^1.0.32: +websocket@^1.0.31: version "1.0.34" resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== @@ -10856,18 +11091,6 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-typed-array@^1.1.2: - version "1.1.7" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.7.tgz#2761799b9a22d4b8660b3c1b40abaa7739691793" - integrity sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - is-typed-array "^1.1.7" - which@1.3.1, which@^1.1.1, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -10889,12 +11112,19 @@ wide-align@1.1.3: dependencies: string-width "^1.0.2 || 2" +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= -word-wrap@^1.2.3, word-wrap@~1.2.3: +word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== @@ -10904,6 +11134,14 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= +wordwrapjs@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" + integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== + dependencies: + reduce-flatten "^2.0.0" + typical "^5.2.0" + worker-threads@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/worker-threads/-/worker-threads-1.0.0.tgz#2b49ea7c9692ba737d9148f2c9b2be65e14e3470" @@ -10914,10 +11152,10 @@ workerpool@6.1.0: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.0.tgz#a8e038b4c94569596852de7a8ea4228eefdeb37b" integrity sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg== -workerpool@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" - integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== wrap-ansi@^2.0.0: version "2.1.0" @@ -10971,6 +11209,11 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" @@ -11034,7 +11277,7 @@ xmlhttprequest@1.8.0: resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= -xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== diff --git a/rollup/mock_bridge/MockBridge.sol b/rollup/mock_bridge/MockBridge.sol index 3501b04a78..0b69f2b119 100644 --- a/rollup/mock_bridge/MockBridge.sol +++ b/rollup/mock_bridge/MockBridge.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity =0.8.24; -import {BatchHeaderV0Codec} from "../../../contracts/src/libraries/codec/BatchHeaderV0Codec.sol"; -import {ChunkCodec} from "../../../contracts/src/libraries/codec/ChunkCodec.sol"; -import {IL1MessageQueue} from "../../../contracts/src/L1/rollup/IL1MessageQueue.sol"; +import {BatchHeaderV0Codec} from "../../contracts/src/libraries/codec/BatchHeaderV0Codec.sol"; +import {ChunkCodecV0} from "../../contracts/src/libraries/codec/ChunkCodecV0.sol"; +import {IL1MessageQueue} from "../../contracts/src/L1/rollup/IL1MessageQueue.sol"; contract MockBridge { /****************************** @@ -265,16 +265,16 @@ contract MockBridge { blockPtr := add(chunkPtr, 1) // skip numBlocks } - uint256 _numBlocks = ChunkCodec.validateChunkLength(chunkPtr, _chunk.length); + uint256 _numBlocks = ChunkCodecV0.validateChunkLength(chunkPtr, _chunk.length); // concatenate block contexts uint256 _totalTransactionsInChunk; for (uint256 i = 0; i < _numBlocks; i++) { - dataPtr = ChunkCodec.copyBlockContext(chunkPtr, dataPtr, i); - uint256 _numTransactionsInBlock = ChunkCodec.numTransactions(blockPtr); + dataPtr = ChunkCodecV0.copyBlockContext(chunkPtr, dataPtr, i); + uint256 _numTransactionsInBlock = ChunkCodecV0.getNumTransactions(blockPtr); unchecked { _totalTransactionsInChunk += _numTransactionsInBlock; - blockPtr += ChunkCodec.BLOCK_CONTEXT_LENGTH; + blockPtr += ChunkCodecV0.BLOCK_CONTEXT_LENGTH; } } @@ -284,13 +284,13 @@ contract MockBridge { } // concatenate tx hashes - uint256 l2TxPtr = ChunkCodec.l2TxPtr(chunkPtr, _numBlocks); + uint256 l2TxPtr = ChunkCodecV0.getL2TxPtr(chunkPtr, _numBlocks); while (_numBlocks > 0) { // concatenate l2 transaction hashes - uint256 _numTransactionsInBlock = ChunkCodec.numTransactions(blockPtr); + uint256 _numTransactionsInBlock = ChunkCodecV0.getNumTransactions(blockPtr); for (uint256 j = 0; j < _numTransactionsInBlock; j++) { bytes32 txHash; - (txHash, l2TxPtr) = ChunkCodec.loadL2TxHash(l2TxPtr); + (txHash, l2TxPtr) = ChunkCodecV0.loadL2TxHash(l2TxPtr); assembly { mstore(dataPtr, txHash) dataPtr := add(dataPtr, 0x20) @@ -299,7 +299,7 @@ contract MockBridge { unchecked { _numBlocks -= 1; - blockPtr += ChunkCodec.BLOCK_CONTEXT_LENGTH; + blockPtr += ChunkCodecV0.BLOCK_CONTEXT_LENGTH; } } From 0bf10e73aa5a9e65de84e3d18614fcd6906eaec5 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Fri, 22 Mar 2024 18:29:00 +0530 Subject: [PATCH 06/12] Fix syntax --- common/database/db.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/database/db.go b/common/database/db.go index 33e4dfef36..4322be3497 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,17 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(config.MaxLifetime != 0 ? config.MaxLifetime : time.Minute * 10) - sqlDB.SetConnMaxIdleTime(config.MaxIdleTime != 0 ? config.MaxIdleTime : time.Minute * 5) + if (config.MaxLifetime != 0) { + sqlDB.SetConnMaxLifetime(config.MaxLifetime) + } else { + sqlDB.SetConnMaxLifetime(time.Minute * 10) + } + + if (config.MaxIdleTime != 0) { + sqlDB.SetConnMaxIdleTime(config.MaxIdleTime) + } else { + sqlDB.SetConnMaxIdleTime(time.Minute * 5) + } sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) From 860b93746492e5eb611a4e9a7560ec0133189c92 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Sun, 17 Mar 2024 02:34:45 +0530 Subject: [PATCH 07/12] #1042 Allow configure db ConnMaxLifetime & ConnMaxIdleTime --- bridge-history-api/conf/config.json | 4 +++- common/database/config.go | 2 ++ common/database/db.go | 4 ++-- common/database/db_test.go | 10 ++++++---- common/docker/docker_app.go | 2 ++ coordinator/conf/config.json | 4 +++- coordinator/internal/config/config_test.go | 4 +++- coordinator/internal/orm/orm_test.go | 10 ++++++---- coordinator/test/api_test.go | 10 ++++++---- database/config.go | 2 ++ database/config.json | 4 +++- database/config_test.go | 4 +++- rollup/conf/config.json | 4 +++- rollup/internal/controller/relayer/relayer_test.go | 10 ++++++---- rollup/internal/controller/sender/sender_test.go | 10 ++++++---- rollup/internal/controller/watcher/watcher_test.go | 10 ++++++---- rollup/internal/orm/orm_test.go | 10 ++++++---- rollup/tests/bridge_test.go | 10 ++++++---- tests/integration-test/integration_test.go | 10 ++++++---- 19 files changed, 80 insertions(+), 44 deletions(-) diff --git a/bridge-history-api/conf/config.json b/bridge-history-api/conf/config.json index bcbf6384f2..49c069bbaf 100644 --- a/bridge-history-api/conf/config.json +++ b/bridge-history-api/conf/config.json @@ -40,7 +40,9 @@ "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driverName": "postgres", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "redis": { "address": "localhost:6379", diff --git a/common/database/config.go b/common/database/config.go index 0a99a6b153..013c427547 100644 --- a/common/database/config.go +++ b/common/database/config.go @@ -8,4 +8,6 @@ type Config struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` + MaxLifetime int `json:"maxLifetime"` + MaxIdleTime int `json:"maxIdleTime"` } diff --git a/common/database/db.go b/common/database/db.go index 322ba27115..055db5ed8b 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,8 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(time.Minute * 10) - sqlDB.SetConnMaxIdleTime(time.Minute * 5) + sqlDB.SetConnMaxLifetime(config.maxLifetime) + sqlDB.SetConnMaxIdleTime(config.maxIdleTime) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/database/db_test.go b/common/database/db_test.go index df6bcd6496..8b097b5873 100644 --- a/common/database/db_test.go +++ b/common/database/db_test.go @@ -44,10 +44,12 @@ func TestDB(t *testing.T) { base.RunDBImage(t) dbCfg := &Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } var err error diff --git a/common/docker/docker_app.go b/common/docker/docker_app.go index 568921001b..4f558614e8 100644 --- a/common/docker/docker_app.go +++ b/common/docker/docker_app.go @@ -167,6 +167,8 @@ func (b *App) mockDBConfig() error { DriverName: "postgres", MaxOpenNum: 200, MaxIdleNum: 20, + MaxLifetime: 600, + MaxIdleTime: 300 } if b.DBImg != nil { diff --git a/coordinator/conf/config.json b/coordinator/conf/config.json index b143a702f7..a1ffae9069 100644 --- a/coordinator/conf/config.json +++ b/coordinator/conf/config.json @@ -16,7 +16,9 @@ "driver_name": "postgres", "dsn": "postgres://localhost/scroll?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "l2": { "chain_id": 111 diff --git a/coordinator/internal/config/config_test.go b/coordinator/internal/config/config_test.go index 748fe9c2a9..2e43e3da75 100644 --- a/coordinator/internal/config/config_test.go +++ b/coordinator/internal/config/config_test.go @@ -29,7 +29,9 @@ func TestConfig(t *testing.T) { "driver_name": "postgres", "dsn": "postgres://admin:123456@localhost/test?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 }, "l2": { "chain_id": 111 diff --git a/coordinator/internal/orm/orm_test.go b/coordinator/internal/orm/orm_test.go index ed6f719b78..737975e2c3 100644 --- a/coordinator/internal/orm/orm_test.go +++ b/coordinator/internal/orm/orm_test.go @@ -38,10 +38,12 @@ func setupEnv(t *testing.T) { var err error db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/coordinator/test/api_test.go b/coordinator/test/api_test.go index 179390300e..c79897944a 100644 --- a/coordinator/test/api_test.go +++ b/coordinator/test/api_test.go @@ -125,10 +125,12 @@ func setEnv(t *testing.T) { base.RunDBImage(t) dbCfg = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } var err error diff --git a/database/config.go b/database/config.go index 4c037946c1..d6a5cf1cdc 100644 --- a/database/config.go +++ b/database/config.go @@ -14,6 +14,8 @@ type DBConfig struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` + MaxLifetime int `json:"maxLifetime"` + MaxIdleTime int `json:"maxIdleTime"` } // NewConfig returns a new instance of Config. diff --git a/database/config.json b/database/config.json index eda41de4c4..7a4a24a620 100644 --- a/database/config.json +++ b/database/config.json @@ -2,5 +2,7 @@ "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driver_name": "postgres", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 } \ No newline at end of file diff --git a/database/config_test.go b/database/config_test.go index 4c8b723c90..f12a6e628c 100644 --- a/database/config_test.go +++ b/database/config_test.go @@ -15,7 +15,9 @@ func TestConfig(t *testing.T) { "dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable", "driver_name": "postgres", "maxOpenNum": %d, - "maxIdleNum": %d + "maxIdleNum": %d, + "maxLifetime": %d, + "maxIdleTime": %d }` t.Run("Success Case", func(t *testing.T) { diff --git a/rollup/conf/config.json b/rollup/conf/config.json index bfecdd003d..4589a6fd28 100644 --- a/rollup/conf/config.json +++ b/rollup/conf/config.json @@ -81,6 +81,8 @@ "driver_name": "postgres", "dsn": "postgres://localhost/scroll?sslmode=disable", "maxOpenNum": 200, - "maxIdleNum": 20 + "maxIdleNum": 20, + "maxLifetime": 600, + "maxIdleTime": 300 } } diff --git a/rollup/internal/controller/relayer/relayer_test.go b/rollup/internal/controller/relayer/relayer_test.go index 60f2137e59..bbe6b09b4c 100644 --- a/rollup/internal/controller/relayer/relayer_test.go +++ b/rollup/internal/controller/relayer/relayer_test.go @@ -56,10 +56,12 @@ func setupEnv(t *testing.T) { cfg.L2Config.RelayerConfig.SenderConfig.Endpoint = base.L1gethImg.Endpoint() cfg.L1Config.RelayerConfig.SenderConfig.Endpoint = base.L2gethImg.Endpoint() cfg.DBConfig = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } port, err := rand.Int(rand.Reader, big.NewInt(10000)) assert.NoError(t, err) diff --git a/rollup/internal/controller/sender/sender_test.go b/rollup/internal/controller/sender/sender_test.go index 7513c32170..4ae6fee37e 100644 --- a/rollup/internal/controller/sender/sender_test.go +++ b/rollup/internal/controller/sender/sender_test.go @@ -85,10 +85,12 @@ func setupEnv(t *testing.T) { base.RunDBImage(t) db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/rollup/internal/controller/watcher/watcher_test.go b/rollup/internal/controller/watcher/watcher_test.go index 0e73bad703..a2105f6066 100644 --- a/rollup/internal/controller/watcher/watcher_test.go +++ b/rollup/internal/controller/watcher/watcher_test.go @@ -47,10 +47,12 @@ func setupEnv(t *testing.T) (err error) { cfg.L2Config.RelayerConfig.SenderConfig.Endpoint = base.L1gethImg.Endpoint() cfg.L1Config.RelayerConfig.SenderConfig.Endpoint = base.L2gethImg.Endpoint() cfg.DBConfig = &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } // Create l2geth client. diff --git a/rollup/internal/orm/orm_test.go b/rollup/internal/orm/orm_test.go index dc458a0b35..bf82137af1 100644 --- a/rollup/internal/orm/orm_test.go +++ b/rollup/internal/orm/orm_test.go @@ -50,10 +50,12 @@ func setupEnv(t *testing.T) { var err error db, err = database.InitDB( &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, }, ) assert.NoError(t, err) diff --git a/rollup/tests/bridge_test.go b/rollup/tests/bridge_test.go index a7e1be9dba..4e1dc7683d 100644 --- a/rollup/tests/bridge_test.go +++ b/rollup/tests/bridge_test.go @@ -48,10 +48,12 @@ var ( func setupDB(t *testing.T) *gorm.DB { cfg := &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } db, err := database.InitDB(cfg) assert.NoError(t, err) diff --git a/tests/integration-test/integration_test.go b/tests/integration-test/integration_test.go index 16455fc728..7bcdd8f6f8 100644 --- a/tests/integration-test/integration_test.go +++ b/tests/integration-test/integration_test.go @@ -48,10 +48,12 @@ func TestCoordinatorProverInteraction(t *testing.T) { // Init data dbCfg := &database.Config{ - DSN: base.DBConfig.DSN, - DriverName: base.DBConfig.DriverName, - MaxOpenNum: base.DBConfig.MaxOpenNum, - MaxIdleNum: base.DBConfig.MaxIdleNum, + DSN: base.DBConfig.DSN, + DriverName: base.DBConfig.DriverName, + MaxOpenNum: base.DBConfig.MaxOpenNum, + MaxIdleNum: base.DBConfig.MaxIdleNum, + MaxLifetime: base.DBConfig.MaxLifetime, + MaxIdleTime: base.DBConfig.MaxIdleTime, } db, err := database.InitDB(dbCfg) From 410f336605121e87be533a1a6327c0c8376853e7 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Wed, 20 Mar 2024 18:45:55 +0530 Subject: [PATCH 08/12] Fix test cases --- common/database/db.go | 4 ++-- common/docker/docker_app.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/database/db.go b/common/database/db.go index 055db5ed8b..f982f872fd 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,8 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(config.maxLifetime) - sqlDB.SetConnMaxIdleTime(config.maxIdleTime) + sqlDB.SetConnMaxLifetime(config.MaxLifetime) + sqlDB.SetConnMaxIdleTime(config.MaxIdleTime) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/docker/docker_app.go b/common/docker/docker_app.go index 4f558614e8..3974543279 100644 --- a/common/docker/docker_app.go +++ b/common/docker/docker_app.go @@ -168,7 +168,7 @@ func (b *App) mockDBConfig() error { MaxOpenNum: 200, MaxIdleNum: 20, MaxLifetime: 600, - MaxIdleTime: 300 + MaxIdleTime: 300, } if b.DBImg != nil { From 060f2650b916ebee5585dd7e8fa06ec3da2303ef Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Wed, 20 Mar 2024 19:13:59 +0530 Subject: [PATCH 09/12] Make config optional with omitEmpty --- common/database/config.go | 4 ++-- common/database/db.go | 4 ++-- database/config.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/database/config.go b/common/database/config.go index 013c427547..8e090ea018 100644 --- a/common/database/config.go +++ b/common/database/config.go @@ -8,6 +8,6 @@ type Config struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` - MaxLifetime int `json:"maxLifetime"` - MaxIdleTime int `json:"maxIdleTime"` + MaxLifetime int `json:"maxLifetime,omitempty"` + MaxIdleTime int `json:"maxIdleTime,omitempty"` } diff --git a/common/database/db.go b/common/database/db.go index f982f872fd..33e4dfef36 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,8 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(config.MaxLifetime) - sqlDB.SetConnMaxIdleTime(config.MaxIdleTime) + sqlDB.SetConnMaxLifetime(config.MaxLifetime != 0 ? config.MaxLifetime : time.Minute * 10) + sqlDB.SetConnMaxIdleTime(config.MaxIdleTime != 0 ? config.MaxIdleTime : time.Minute * 5) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/database/config.go b/database/config.go index d6a5cf1cdc..06920c743c 100644 --- a/database/config.go +++ b/database/config.go @@ -14,8 +14,8 @@ type DBConfig struct { MaxOpenNum int `json:"maxOpenNum"` MaxIdleNum int `json:"maxIdleNum"` - MaxLifetime int `json:"maxLifetime"` - MaxIdleTime int `json:"maxIdleTime"` + MaxLifetime int `json:"maxLifetime,omitempty"` + MaxIdleTime int `json:"maxIdleTime,omitempty"` } // NewConfig returns a new instance of Config. From eb4c480025dcd23bfaa950e3f66b015205e9e33c Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Fri, 22 Mar 2024 18:29:00 +0530 Subject: [PATCH 10/12] Fix syntax --- common/database/db.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/database/db.go b/common/database/db.go index 33e4dfef36..4322be3497 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,8 +70,17 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } - sqlDB.SetConnMaxLifetime(config.MaxLifetime != 0 ? config.MaxLifetime : time.Minute * 10) - sqlDB.SetConnMaxIdleTime(config.MaxIdleTime != 0 ? config.MaxIdleTime : time.Minute * 5) + if (config.MaxLifetime != 0) { + sqlDB.SetConnMaxLifetime(config.MaxLifetime) + } else { + sqlDB.SetConnMaxLifetime(time.Minute * 10) + } + + if (config.MaxIdleTime != 0) { + sqlDB.SetConnMaxIdleTime(config.MaxIdleTime) + } else { + sqlDB.SetConnMaxIdleTime(time.Minute * 5) + } sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) From b0676fd950901b304e7be447fa787e8dc7a522e0 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Sat, 23 Mar 2024 19:33:23 +0530 Subject: [PATCH 11/12] Convert int32 to duration --- common/database/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/database/db.go b/common/database/db.go index 4322be3497..79fd506622 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -71,13 +71,13 @@ func InitDB(config *Config) (*gorm.DB, error) { } if (config.MaxLifetime != 0) { - sqlDB.SetConnMaxLifetime(config.MaxLifetime) + sqlDB.SetConnMaxLifetime(time.second * config.MaxLifetime) } else { sqlDB.SetConnMaxLifetime(time.Minute * 10) } if (config.MaxIdleTime != 0) { - sqlDB.SetConnMaxIdleTime(config.MaxIdleTime) + sqlDB.SetConnMaxIdleTime(time.second * config.MaxIdleTime) } else { sqlDB.SetConnMaxIdleTime(time.Minute * 5) } From ece6b6f86414427d7a1e981e334f93558edeeb60 Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Sun, 24 Mar 2024 16:40:43 +0530 Subject: [PATCH 12/12] Fix time --- common/database/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/database/db.go b/common/database/db.go index 79fd506622..2a3d0773b3 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -71,13 +71,13 @@ func InitDB(config *Config) (*gorm.DB, error) { } if (config.MaxLifetime != 0) { - sqlDB.SetConnMaxLifetime(time.second * config.MaxLifetime) + sqlDB.SetConnMaxLifetime(time.Second * config.MaxLifetime) } else { sqlDB.SetConnMaxLifetime(time.Minute * 10) } if (config.MaxIdleTime != 0) { - sqlDB.SetConnMaxIdleTime(time.second * config.MaxIdleTime) + sqlDB.SetConnMaxIdleTime(time.Second * config.MaxIdleTime) } else { sqlDB.SetConnMaxIdleTime(time.Minute * 5) }